quiz 'secure' mode MDL-21085 remove popup-blocker check.
authorTim Hunt <T.J.Hunt@open.ac.uk>
Tue, 2 Nov 2010 19:49:09 +0000 (19:49 +0000)
committerTim Hunt <T.J.Hunt@open.ac.uk>
Tue, 2 Nov 2010 19:49:09 +0000 (19:49 +0000)
It was unnecessary on modern browsers, since they let thought a pop-up if you just clicked on a link, so this check was just causing an annoying and misleading alert.

Since the popupchecker was only used here, and since it was implemented in a way that does not work on all browsers, I just deleted the function. If anyone ever finds that they acutally need this functionality, they can re-implement it in a way that works.

lib/javascript-static.js
mod/quiz/view.php

index 7d151f8..43ad7f7 100644 (file)
@@ -714,15 +714,6 @@ M.util.get_string = function(identifier, component, a) {
 
 //=== old legacy JS code, hopefully to be replaced soon by M.xx.yy and YUI3 code ===
 
-function popupchecker(msg) {
-    var testwindow = window.open('', '', 'width=1,height=1,left=0,top=0,scrollbars=no');
-    if (!testwindow) {
-        alert(msg);
-    } else {
-        testwindow.close();
-    }
-}
-
 function checkall() {
     var inputs = document.getElementsByTagName('input');
     for (var i = 0; i < inputs.length; i++) {
index 58f2114..36e1d94 100644 (file)
@@ -63,9 +63,6 @@
         $USER->editing = $edit;
     }
 
-    if ($accessmanager->securewindow_required($canpreview)) {
-        $PAGE->requires->js_function_call('popupchecker',array(get_string('popupblockerwarning', 'quiz')));
-    }
     $PAGE->requires->yui2_lib('event');
 
     // Note: MDL-19010 there will be further changes to printing header and blocks.