r63587 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r63586‎ | r63587 | r63588 >
Date:08:33, 11 March 2010
Author:dale
Status:deferred
Tags:
Comment:
only use the last part of the file name in error
convertPlural fix
Modified paths:
  • /branches/js2-work/phase3/js/mwEmbed/jsScriptLoader.php (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/languages/classes/LanguageEn.js (replaced) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/loader.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/mw.EmbedPlayer.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/mwEmbed.js (modified) (history)

Diff [purge]

Index: branches/js2-work/phase3/js/mwEmbed/languages/classes/LanguageEn.js
@@ -25,10 +25,10 @@
2626 * @param forms Array: different plural forms
2727 * @return string Correct form of plural for count in this language
2828 */
29 -
 29+
3030 mw.lang.convertPlural = function( count, forms ){
31 - if ( forms.length == 0 ) {
 31+ if ( !forms || forms.length == 0 ) {
3232 return '';
3333 }
3434 return ( parseInt( count ) == 1 ) ? forms[0] : forms[1];
35 -}
 35+};
Index: branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/loader.js
@@ -100,6 +100,7 @@
101101
102102 // Tell mwEmbed to run setup
103103 mw.setConfig( 'runSetupMwEmbed', true );
 104+
104105 mw.log(" run setup is: " + mw.getConfig( 'runSetupMwEmbed' ) );
105106 }
106107 });
Index: branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/mw.EmbedPlayer.js
@@ -516,7 +516,7 @@
517517 uri:null,
518518
519519 // Title of the source.
520 - title:null,
 520+ title: null,
521521
522522 // True if the source has been marked as the default.
523523 marked_default:false,
@@ -604,8 +604,9 @@
605605 */
606606 updateSource: function( element ) {
607607 // for now just update the title:
608 - if ( $j( element ).attr( "title" ) )
 608+ if ( $j( element ).attr( "title" ) ) {
609609 this.title = $j( element ).attr( "title" );
 610+ }
610611 },
611612
612613 /**
Index: branches/js2-work/phase3/js/mwEmbed/mwEmbed.js
@@ -339,7 +339,7 @@
340340 if( tObj.arg && tObj.param && mw.lang.convertPlural) {
341341 // Check if we have forms to replace
342342 if ( tObj.param.length == 0 ) {
343 - return '';
 343+ return '';
344344 }
345345 // Restore the count into a Number ( if it got converted earlier )
346346 var count = mw.lang.convertNumber( tObj.arg, true );
Index: branches/js2-work/phase3/js/mwEmbed/jsScriptLoader.php
@@ -591,8 +591,10 @@
592592 wfRestoreWarnings();
593593
594594 if ( $str === false ) {
 595+ $fname = explode( '/',$filePath);
 596+ $fname = last( $fname );
595597 // NOTE: check PHP error level. Don't want to expose paths if errors are hidden.
596 - $this->errorMsg .= 'Requested File: ' . htmlspecialchars( $IP.'/'.$filePath ) . ' could not be read' . "\n";
 598+ $this->errorMsg .= 'Requested File: ' . htmlspecialchars( $fname ) . ' could not be read' . "\n";
597599 return false;
598600 }
599601 return $str;

Status & tagging log