Index: branches/js2-work/phase3/js/mwEmbed/languages/classes/LanguageEn.js |
— | — | @@ -25,10 +25,10 @@ |
26 | 26 | * @param forms Array: different plural forms |
27 | 27 | * @return string Correct form of plural for count in this language |
28 | 28 | */ |
29 | | - |
| 29 | + |
30 | 30 | mw.lang.convertPlural = function( count, forms ){ |
31 | | - if ( forms.length == 0 ) { |
| 31 | + if ( !forms || forms.length == 0 ) { |
32 | 32 | return ''; |
33 | 33 | } |
34 | 34 | 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 @@ |
101 | 101 | |
102 | 102 | // Tell mwEmbed to run setup |
103 | 103 | mw.setConfig( 'runSetupMwEmbed', true ); |
| 104 | + |
104 | 105 | mw.log(" run setup is: " + mw.getConfig( 'runSetupMwEmbed' ) ); |
105 | 106 | } |
106 | 107 | }); |
Index: branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/mw.EmbedPlayer.js |
— | — | @@ -516,7 +516,7 @@ |
517 | 517 | uri:null, |
518 | 518 | |
519 | 519 | // Title of the source. |
520 | | - title:null, |
| 520 | + title: null, |
521 | 521 | |
522 | 522 | // True if the source has been marked as the default. |
523 | 523 | marked_default:false, |
— | — | @@ -604,8 +604,9 @@ |
605 | 605 | */ |
606 | 606 | updateSource: function( element ) { |
607 | 607 | // for now just update the title: |
608 | | - if ( $j( element ).attr( "title" ) ) |
| 608 | + if ( $j( element ).attr( "title" ) ) { |
609 | 609 | this.title = $j( element ).attr( "title" ); |
| 610 | + } |
610 | 611 | }, |
611 | 612 | |
612 | 613 | /** |
Index: branches/js2-work/phase3/js/mwEmbed/mwEmbed.js |
— | — | @@ -339,7 +339,7 @@ |
340 | 340 | if( tObj.arg && tObj.param && mw.lang.convertPlural) { |
341 | 341 | // Check if we have forms to replace |
342 | 342 | if ( tObj.param.length == 0 ) { |
343 | | - return ''; |
| 343 | + return ''; |
344 | 344 | } |
345 | 345 | // Restore the count into a Number ( if it got converted earlier ) |
346 | 346 | var count = mw.lang.convertNumber( tObj.arg, true ); |
Index: branches/js2-work/phase3/js/mwEmbed/jsScriptLoader.php |
— | — | @@ -591,8 +591,10 @@ |
592 | 592 | wfRestoreWarnings(); |
593 | 593 | |
594 | 594 | if ( $str === false ) { |
| 595 | + $fname = explode( '/',$filePath); |
| 596 | + $fname = last( $fname ); |
595 | 597 | // 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"; |
597 | 599 | return false; |
598 | 600 | } |
599 | 601 | return $str; |