Browse Source

phpdoc compatibility

MOODLE_20_STABLE
bdaloukas 8 years ago
parent
commit
c490d9e5b3
  1. 34
      export/html/snakes/js/subModal.js

34
export/html/snakes/js/subModal.js

@ -21,24 +21,24 @@ if (!document.all) {
*/ */
function initPopUp() { function initPopUp() {
// Add the HTML to the body // Add the HTML to the body
theBody = document.getElementsByTagName('BODY')[0]; var theBody = document.getElementsByTagName('BODY')[0];
popmask = document.createElement('div'); var popmask = document.createElement('div');
popmask.id = 'popupMask'; popmask.id = 'popupMask';
popcont = document.createElement('div'); var popcont = document.createElement('div');
popcont.id = 'popupContainer'; popcont.id = 'popupContainer';
popcont.innerHTML = '' + popcont.innerHTML = '' +
'<div id="popupInner">' + '<div id="popupInner">' +
'<div id="popupTitleBar">' + '<div id="popupTitleBar">' +
'<div id="popupTitle"></div>' + '<div id="popupTitle"></div>' +
'<div id="popupControls">' + '<div id="popupControls">' +
'<img src="close.gif" onclick="hidePopWin(false);" id="popCloseBox" />' + '<img src="close.gif" onclick="hidePopWin(false);" id="popCloseBox" />' +
'</div>' + '</div>' +
'</div>' + '</div>' +
'<iframe src="'+ gDefaultPage + '<iframe src="' + gDefaultPage +
'" style="width:100%;height:100%;background-color:transparent;" scrolling="auto"' + '" style="width:100%;height:100%;background-color:transparent;" scrolling="auto"' +
' frameborder="0" allowtransparency="true" id="popupFrame" name="popupFrame" ' + ' frameborder="0" allowtransparency="true" id="popupFrame" name="popupFrame" ' +
' width="100%" height="100%"></iframe>' + ' width="100%" height="100%"></iframe>' +
'</div>'; '</div>';
theBody.appendChild(popmask); theBody.appendChild(popmask);
theBody.appendChild(popcont); theBody.appendChild(popcont);
@ -55,19 +55,20 @@ function initPopUp() {
// Add onclick handlers to 'a' elements of class submodal or submodal-width-height // Add onclick handlers to 'a' elements of class submodal or submodal-width-height
var elms = document.getElementsByTagName('a'); var elms = document.getElementsByTagName('a');
for (i = 0; i < elms.length; i++) { for (var i = 0; i < elms.length; i++) {
if (elms[i].className.indexOf("submodal") == 0) { if (elms[i].className.indexOf("submodal") == 0) {
elms[i].onclick = function(){ elms[i].onclick = function() {
// default width and height // default width and height
var width = 400; var width = 400;
var height = 200; var height = 200;
// Parse out optional width and height from className // Parse out optional width and height from className
params = this.className.split('-'); var params = this.className.split('-');
if (params.length == 3) { if (params.length == 3) {
width = parseInt(params[1]); width = parseInt(params[1]);
height = parseInt(params[2]); height = parseInt(params[2]);
} }
showPopWin(this.href,width,height,null); return false; showPopWin(this.href,width,height,null);
return false;
} }
} }
} }
@ -83,7 +84,7 @@ addEvent(window, "load", initPopUp);
*/ */
function showPopWin(url, width, height, returnFunc, showCloseBox) { function showPopWin(url, width, height, returnFunc, showCloseBox) {
// show or hide the window close widget // show or hide the window close widget
if (showCloseBox == null || showCloseBox == true) { if (showCloseBox === null || showCloseBox == true) {
document.getElementById("popCloseBox").style.display = "block"; document.getElementById("popCloseBox").style.display = "block";
} else { } else {
document.getElementById("popCloseBox").style.display = "none"; document.getElementById("popCloseBox").style.display = "none";
@ -120,7 +121,7 @@ function showPopWin(url, width, height, returnFunc, showCloseBox) {
var gi = 0; var gi = 0;
function centerPopWin(width, height) { function centerPopWin(width, height) {
if (gPopupIsShown == true) { if (gPopupIsShown == true) {
if (width == null || isNaN(width)) { if (width === null || isNaN(width)) {
width = gPopupContainer.offsetWidth; width = gPopupContainer.offsetWidth;
} }
if (height == null) { if (height == null) {
@ -128,8 +129,8 @@ function centerPopWin(width, height) {
} }
var theBody = document.getElementsByTagName("BODY")[0]; var theBody = document.getElementsByTagName("BODY")[0];
var scTop = parseInt(getScrollTop(),10); var scTop = parseInt(getScrollTop(), 10);
var scLeft = parseInt(theBody.scrollLeft,10); var scLeft = parseInt(theBody.scrollLeft, 10);
setMaskSize(); setMaskSize();
@ -155,6 +156,7 @@ function setMaskSize() {
var fullHeight = getViewportHeight(); var fullHeight = getViewportHeight();
var fullWidth = getViewportWidth(); var fullWidth = getViewportWidth();
var popHeight;
// Determine what's bigger, scrollHeight or fullHeight / width // Determine what's bigger, scrollHeight or fullHeight / width
if (fullHeight > theBody.scrollHeight) { if (fullHeight > theBody.scrollHeight) {
@ -252,7 +254,7 @@ function restoreTabIndexes() {
function hideSelectBoxes() { function hideSelectBoxes() {
var x = document.getElementsByTagName("SELECT"); var x = document.getElementsByTagName("SELECT");
for (i=0;x && i < x.length; i++) { for (var i=0;x && i < x.length; i++) {
x[i].style.visibility = "hidden"; x[i].style.visibility = "hidden";
} }
} }
@ -267,7 +269,7 @@ function hideSelectBoxes() {
function displaySelectBoxes() { function displaySelectBoxes() {
var x = document.getElementsByTagName("SELECT"); var x = document.getElementsByTagName("SELECT");
for (i=0;x && i < x.length; i++){ for (var i=0;x && i < x.length; i++){
x[i].style.visibility = "visible"; x[i].style.visibility = "visible";
} }
} }

Loading…
Cancel
Save