Browse Source

phpdoc compatibility

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

30
export/html/snakes/js/subModal.js

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

Loading…
Cancel
Save