Browse Source

phpdoc compatibility

MOODLE_20_STABLE
bdaloukas 8 years ago
parent
commit
26325ae71c
  1. 21
      export/html/snakes/js/subModal.js

21
export/html/snakes/js/subModal.js

@ -34,7 +34,10 @@ function initPopUp() {
'<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 +'" style="width:100%;height:100%;background-color:transparent;" scrolling="auto" frameborder="0" allowtransparency="true" id="popupFrame" name="popupFrame" width="100%" height="100%"></iframe>' + '<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>' +
'</div>'; '</div>';
theBody.appendChild(popmask); theBody.appendChild(popmask);
theBody.appendChild(popcont); theBody.appendChild(popcont);
@ -54,8 +57,6 @@ function initPopUp() {
var elms = document.getElementsByTagName('a'); var elms = document.getElementsByTagName('a');
for (i = 0; i < elms.length; i++) { for (i = 0; i < elms.length; i++) {
if (elms[i].className.indexOf("submodal") == 0) { if (elms[i].className.indexOf("submodal") == 0) {
// var onclick = 'function (){showPopWin(\''+elms[i].href+'\','+width+', '+height+', null);return false;};';
// elms[i].onclick = eval(onclick);
elms[i].onclick = function(){ elms[i].onclick = function(){
// default width and height // default width and height
var width = 400; var width = 400;
@ -96,7 +97,6 @@ function showPopWin(url, width, height, returnFunc, showCloseBox) {
var titleBarHeight = parseInt(document.getElementById("popupTitleBar").offsetHeight, 10); var titleBarHeight = parseInt(document.getElementById("popupTitleBar").offsetHeight, 10);
gPopupContainer.style.width = width + "px"; gPopupContainer.style.width = width + "px";
gPopupContainer.style.height = (height+titleBarHeight) + "px"; gPopupContainer.style.height = (height+titleBarHeight) + "px";
@ -117,7 +117,6 @@ 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) {
@ -128,16 +127,12 @@ function centerPopWin(width, height) {
height = gPopupContainer.offsetHeight; height = gPopupContainer.offsetHeight;
} }
//var theBody = document.documentElement;
var theBody = document.getElementsByTagName("BODY")[0]; var theBody = document.getElementsByTagName("BODY")[0];
//theBody.style.overflow = "hidden";
var scTop = parseInt(getScrollTop(),10); var scTop = parseInt(getScrollTop(),10);
var scLeft = parseInt(theBody.scrollLeft,10); var scLeft = parseInt(theBody.scrollLeft,10);
setMaskSize(); setMaskSize();
//window.status = gPopupMask.style.top + " " + gPopupMask.style.left + " " + gi++;
var titleBarHeight = parseInt(document.getElementById("popupTitleBar").offsetHeight, 10); var titleBarHeight = parseInt(document.getElementById("popupTitleBar").offsetHeight, 10);
var fullHeight = getViewportHeight(); var fullHeight = getViewportHeight();
@ -145,14 +140,12 @@ function centerPopWin(width, height) {
gPopupContainer.style.top = (scTop + ((fullHeight - (height+titleBarHeight)) / 2)) + "px"; gPopupContainer.style.top = (scTop + ((fullHeight - (height+titleBarHeight)) / 2)) + "px";
gPopupContainer.style.left = (scLeft + ((fullWidth - width) / 2)) + "px"; gPopupContainer.style.left = (scLeft + ((fullWidth - width) / 2)) + "px";
//alert(fullWidth + " " + width + " " + gPopupContainer.style.left);
} }
} }
addEvent(window, "resize", centerPopWin); addEvent(window, "resize", centerPopWin);
addEvent(window, "scroll", centerPopWin); addEvent(window, "scroll", centerPopWin);
window.onscroll = centerPopWin; window.onscroll = centerPopWin;
/** /**
* Sets the size of the popup mask. * Sets the size of the popup mask.
* *
@ -210,7 +203,9 @@ function hidePopWin(callReturnFunc) {
// Tab key trap. iff popup is shown and key was [TAB], suppress it. // Tab key trap. iff popup is shown and key was [TAB], suppress it.
// @argument e - event - keyboard event that caused this function to be called. // @argument e - event - keyboard event that caused this function to be called.
function keyDownHandler(e) { function keyDownHandler(e) {
if (gPopupIsShown && e.keyCode == 9) return false; if (gPopupIsShown && e.keyCode == 9) {
return false;
}
} }
// For IE. Go through predefined tags and disable tabbing into them. // For IE. Go through predefined tags and disable tabbing into them.
@ -230,7 +225,6 @@ function disableTabIndexes() {
function returnRefresh() function returnRefresh()
{ {
//alert("I am active!");
window.location.reload(); window.location.reload();
} }
@ -249,7 +243,6 @@ function restoreTabIndexes() {
} }
} }
/** /**
* Hides all drop down form select boxes on the screen so they do not appear above the mask layer. * Hides all drop down form select boxes on the screen so they do not appear above the mask layer.
* IE has a problem with wanted select form tags to always be the topmost z-index or layer * IE has a problem with wanted select form tags to always be the topmost z-index or layer

Loading…
Cancel
Save