MDL-15498: Completion system: tweak so that AJAX version correctly updates alt, title of manual completion icons

This commit is contained in:
sam_marshall 2008-08-21 16:03:13 +00:00
parent bba0beaee2
commit e3e661a20a
2 changed files with 12 additions and 2 deletions

View 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

View File

@ -201,7 +201,12 @@
// 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.