Skip to content

Commit

Permalink
HTML5 - new page model - geocommons
Browse files Browse the repository at this point in the history
git-svn-id: https://xerteonlinetoolkits.googlecode.com/svn/trunk@718 912cdd6b-5c7d-d5a7-a2ba-d0f0cdb91641
  • Loading branch information
FayCross committed Mar 8, 2013
1 parent 40d99b1 commit 33eca0b
Showing 1 changed file with 51 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<script type="text/javascript">

// pageChanged & sizeChanged functions are needed in every model file
// other functions for model should also be in here to avoid conflicts
var geocommons = new function() {

// function called every time the page is viewed after it has initially loaded
this.pageChanged = function() {

}

// function called every time the size of the LO is changed
this.sizeChanged = function() {
var $mapHolder = $("#mapHolder");
$mapHolder.height($x_pageHolder.height() - parseInt($x_pageDiv.css("padding-top")) * 2 - parseInt($mapHolder.css("padding-top")) * 2 - 15);
}

this.init = function() {
var src = x_currentPageXML.getAttribute("src");
var mapUrl = src.substring(src.indexOf('src="') + 5, src.indexOf('"', src.indexOf('src="') + 5));

// ** need to add this to xwd - description for contents of iframe for screen readers
var description = "";
if (x_currentPageXML.getAttribute("description") != "" && x_currentPageXML.getAttribute("description") != undefined) {
description = 'title="' + x_currentPageXML.getAttribute("description") + '"';
}

$("#mapHolder").append('<iframe width="100%" height="100%" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="' + mapUrl + '" ' + description + '></iframe>');

if (x_currentPage != 0) {
this.sizeChanged();
}

// call this function in every model once everything's loaded
x_pageLoaded();
}
}

geocommons.init();

</script>

<style type="text/css">

</style>

<div id="pageContents">

<div id="mapHolder" class="panel"/>

</div>

0 comments on commit 33eca0b

Please sign in to comment.