]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-15498: Completion system: tweak so that AJAX version correctly updates alt, title...
authorsam_marshall <sam_marshall>
Thu, 21 Aug 2008 16:03:13 +0000 (16:03 +0000)
committersam_marshall <sam_marshall>
Thu, 21 Aug 2008 16:03:13 +0000 (16:03 +0000)
course/completion.js
course/view.php

index 3471f5d8daf4572cae0f4064a969c21bbad0a86c..67480482583425d02c5b674147d5fd088c49acf7 100644 (file)
@@ -1,4 +1,5 @@
-var completion_strsaved;
+var completion_strsaved, completion_strtitley, completion_strtitlen, 
+  completion_stralty, completion_straltn;
 var completion_wwwroot;
 
 function completion_init() { 
@@ -41,9 +42,13 @@ function completion_handle_response(o) {
   // Change image
   if(this.otherState==1) {
     this.image.src=this.image.src.replace(/n\.gif$/,'y.gif');
+    this.image.title=completion_strtitley;
+    this.image.alt=completion_stralty;
     this.otherState=0;
   } else {
     this.image.src=this.image.src.replace(/y\.gif$/,'n.gif');
+    this.image.title=completion_strtitlen;
+    this.image.alt=completion_straltn;
     this.otherState=1;
   }
   // Start animation
index 264ff2166cced5de70e876a91cf110cdf017d51e..56ad16ca38097f22c2755c8f4e9b76d3c89de57c 100644 (file)
         // Need to do this after the header because it requires the YUI stuff
         // to be loaded already
         print '<script type="text/javascript" src="completion.js"></script>'.
-            '<script type="text/javascript">completion_strsaved="'.get_string('saved','completion').'"</script>';
+            '<script type="text/javascript">completion_strsaved="'.get_string('saved','completion').
+            '"; completion_strtitley="'.get_string('completion-title-manual-y','completion').
+            '"; completion_strtitlen="'.get_string('completion-title-manual-n','completion').
+            '"; completion_stralty="'.get_string('completion-alt-manual-y','completion').
+            '"; completion_straltn="'.get_string('completion-alt-manual-n','completion').
+            '"; </script>';
     }
 
     // Course wrapper start.