MDL-15484 Avoid JavaScript errors after a popup has been blocked.

Also clean up coding style of some nearby functions.
This commit is contained in:
tjhunt 2009-03-31 03:24:21 +00:00
parent 8af809df9d
commit 214f5850d1

View File

@ -10,21 +10,21 @@ function popupchecker(msg) {
}
function checkall() {
var el = document.getElementsByTagName('input');
for(var i=0; i<el.length; i++) {
if(el[i].type == 'checkbox') {
el[i].checked = true;
var inputs = document.getElementsByTagName('input');
for (var i = 0; i < inputs.length; i++) {
if (inputs[i].type == 'checkbox') {
inputs[i].checked = true;
}
}
}
}
function checknone() {
var el = document.getElementsByTagName('input');
for(var i=0; i<el.length; i++) {
if(el[i].type == 'checkbox') {
el[i].checked = false;
var inputs = document.getElementsByTagName('input');
for (var i = 0; i < inputs.length; i++) {
if (inputs[i].type == 'checkbox') {
inputs[i].checked = false;
}
}
}
}
function lockoptions(formid, master, subitems) {
@ -770,9 +770,12 @@ function getElementsByClassName(oElm, strTagName, oClassNames) {
function openpopup(url, name, options, fullscreen) {
var fullurl = url;
if (!url.match(/https?:\/\//)) {
var fullurl = moodle_cfg.wwwroot + url;
fullurl = moodle_cfg.wwwroot + url;
}
var windowobj = window.open(fullurl,name,options);
if (!windowobj) {
return true;
}
if (fullscreen) {
windowobj.moveTo(0,0);
windowobj.resizeTo(screen.availWidth,screen.availHeight);