]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-16706 - eliminate miscellaneous inine JavaScript
authortjhunt <tjhunt>
Fri, 26 Sep 2008 11:24:52 +0000 (11:24 +0000)
committertjhunt <tjhunt>
Fri, 26 Sep 2008 11:24:52 +0000 (11:24 +0000)
A few easy files in lib.

lib/filelib.php
lib/moodlelib.php
lib/recaptchalib.php

index dfc45f7af92c6e1d015d15e460909ef5effd96b9..af1f295f90117d423e7bc2bfa1779bdb5b24d4a6 100644 (file)
@@ -1543,7 +1543,7 @@ function file_modify_html_header($text) {
     $filters = explode(",", $CFG->textfilters);
     if (in_array('filter/mediaplugin', $filters)) {
         // this script is needed by most media filter plugins.
-        $ufo = "\n".'<script type="text/javascript" src="'.$CFG->wwwroot.'/lib/ufo.js"></script>'."\n";
+        $ufo = get_require_js_code(array($CFG->wwwroot . '/lib/ufo.js'));
     } else {
         $ufo = '';
     }
index 26782d3d3311ea2669f670f9c38f79f3f230d91c..71d0a29abec7f02441398a82549019545a850689 100644 (file)
@@ -7520,8 +7520,9 @@ function message_popup_window() {
                 if (get_user_preferences('message_showmessagewindow', 1) == 1) {
                     if ($DB->count_records_select('message', 'useridto = ? AND timecreated > ?', array($USER->id, $USER->message_lastpopup))) {
                         $USER->message_lastpopup = time();
-                        return '<script type="text/javascript">'."\n//<![CDATA[\n openpopup('/message/index.php', 'message',
-                        'menubar=0,location=0,scrollbars,status,resizable,width=400,height=500', 0);\n//]]>\n</script>";
+                        return print_js_call('openpopup', array('/message/index.php', 'message',
+                                'menubar=0,location=0,scrollbars,status,resizable,width=400,height=500',
+                                0), true);
                     }
                 }
             }
index baad668883d01d88c640a8be561a18fc4a0c0579..bebabe0dd32c8b7e64dcf4972eaac65df5850009 100644 (file)
@@ -134,12 +134,12 @@ function recaptcha_get_html ($pubkey, $error = null, $use_ssl = false) {
     $strgetanothercaptcha = get_string('getanothercaptcha', 'auth');
     $strgetanaudiocaptcha = get_string('getanaudiocaptcha', 'auth');
     $strgetanimagecaptcha = get_string('getanimagecaptcha', 'auth');
-    
-    $return = '<script type="text/javascript" src="'. $server . '/challenge?k=' . $pubkey . $errorpart . '"></script> 
-       <noscript>
+
+    $return = get_require_js_code(array($server . '/challenge?k=' . $pubkey . $errorpart)); 
+    $return .= '<noscript>
         <div id="recaptcha_widget_noscript">
         <div id="recaptcha_image_noscript"><img src="' . $image_url . '" alt="reCAPTCHA"/></div>';
-    
+
     if ($error == 'incorrect-captcha-sol') {
         $return .= '<div class="recaptcha_only_if_incorrect_sol" style="color:red">' . $strincorrectpleasetryagain . '</div>';
     }