r56033 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r56032‎ | r56033 | r56034 >
Date:15:06, 8 September 2009
Author:dale
Status:deferred
Tags:
Comment:
* updated mwe-error_load_lib error msg
Modified paths:
  • /trunk/phase3/js2/mwEmbed/mv_embed.js (modified) (history)
  • /trunk/phase3/js2/mwEmbed/php/languages/mwEmbed.i18n.php (modified) (history)

Diff [purge]

Index: trunk/phase3/js2/mwEmbed/php/languages/mwEmbed.i18n.php
@@ -102,6 +102,7 @@
103103 'mwe-size-megabytes' => '$1 MB',
104104 'mwe-size-kilobytes' => '$1 K',
105105 'mwe-size-bytes' => '$1 B',
 106+ 'mwe-error_load_lib' => 'Error:: Javascript $1 was not retrievable OR does not define $2',
106107
107108 /*
108109 * js file: /libAddMedia/mvFirefogg.js
@@ -228,8 +229,6 @@
229230 'mwe-loading_plugin' => 'loading plugin <blink>...</blink>',
230231 'mwe-select_playback' => 'Set playback preference',
231232 'mwe-link_back' => 'Link back',
232 - 'mwe-error_load_lib' => 'Error: mv_embed was unable to load required JavaScript libraries.
233 -Insert script via DOM has failed. Please try reloading this page.',
234233 'mwe-error_swap_vid' => 'Error: mv_embed was unable to swap the video tag for the mv_embed interface',
235234 'mwe-add_to_end_of_sequence' => 'Add to end of sequence',
236235 'mwe-missing_video_stream' => 'The video file for this stream is missing',
Index: trunk/phase3/js2/mwEmbed/mv_embed.js
@@ -118,7 +118,7 @@
119119 "mwe-size-megabytes" : "$1 MB",
120120 "mwe-size-kilobytes" : "$1 K",
121121 "mwe-size-bytes" : "$1 B",
122 - "mwe-error_load_lib" : "Error: mv_embed was unable to load required JavaScript libraries.\nInsert script via DOM has failed. Please try reloading this page."
 122+ "mwe-error_load_lib" : "Error:: Javascript $1 was not retrievable OR does not define $2"
123123 });
124124
125125 /**
@@ -462,8 +462,11 @@
463463 this.callbacks.push( callback );
464464 }
465465 if( this.checkLoading() ) {
466 - if( this.load_time++ > 2000 ){ // Time out after ~80 seconds
467 - js_error( gM('mwe-error_load_lib') + this.missing_path );
 466+ //@@todo we should check the <script> Element .onLoad property to
 467+ //make sure its just not a very slow connection
 468+
 469+ if( this.load_time++ > 4000 ){ // Time out after ~80 seconds
 470+ js_error( gM('mwe-error_load_lib', mvGetClassPath(this.missing_path), this.missing_path) );
468471 this.load_error = true;
469472 } else {
470473 setTimeout( 'mvJsLoader.doLoad()', 20 );
@@ -524,7 +527,6 @@
525528 if( !this.libreq[i] ) {
526529 loadExternalJs( this.libs[i] );
527530 }
528 -
529531 this.libreq[i] = 1;
530532 //js_log("has not yet loaded: " + i);
531533 loading = 1;
@@ -541,7 +543,7 @@
542544 cur_path = (cur_path == '') ? cur_path + objPath[p] : cur_path + '.' + objPath[p];
543545 eval( 'var ptest = typeof ( '+ cur_path + ' ); ');
544546 if( ptest == 'undefined' ) {
545 - this.missing_path = cur_path;
 547+ this.missing_path = cur_path;
546548 return false;
547549 }
548550 }

Status & tagging log