Index: branches/MwEmbedStandAlone/remotes/mediaWiki.js |
— | — | @@ -49,7 +49,7 @@ |
50 | 50 | if( !mw.ready){ |
51 | 51 | mw.ready = function( fn ){ |
52 | 52 | preMwEmbedReady.push( fn ); |
53 | | - } |
| 53 | + }; |
54 | 54 | } |
55 | 55 | // Setup a preMwEmbedConfig var |
56 | 56 | if( ! preMwEmbedConfig ) { |
— | — | @@ -65,7 +65,7 @@ |
66 | 66 | preMwEmbedConfig[ i ] = set[i]; |
67 | 67 | } |
68 | 68 | } |
69 | | - } |
| 69 | + }; |
70 | 70 | } |
71 | 71 | |
72 | 72 | |
— | — | @@ -103,6 +103,7 @@ |
104 | 104 | // Add media wizard ( only if not on a sequence page |
105 | 105 | if ( wgAction == 'edit' || wgAction == 'submit' ) { |
106 | 106 | if( wgPageName.indexOf( "Sequence:" ) != 0 ){ |
| 107 | + // Add a timeout to give a chance for wikieditor to build out. |
107 | 108 | setTimeout(function(){ |
108 | 109 | loadMwEmbed( [ |
109 | 110 | 'mw.RemoteSearchDriver', |
— | — | @@ -124,7 +125,11 @@ |
125 | 126 | // Timed text display: |
126 | 127 | if ( wgPageName.indexOf( "TimedText:" ) === 0 |
127 | 128 | && |
128 | | - document.URL.indexOf('&diff=') == -1) { |
| 129 | + ( document.URL.indexOf('&diff=') == -1 |
| 130 | + && |
| 131 | + document.URL.indexOf('?diff=') == -1 |
| 132 | + ) |
| 133 | + ){ |
129 | 134 | if( wgAction == 'view' ){ |
130 | 135 | var orgBody = mwSetPageToLoading(); |
131 | 136 | //load the "player" ( includes call to loadMwEmbed ) |
— | — | @@ -152,7 +157,11 @@ |
153 | 158 | // If on a view page set content to "loading" |
154 | 159 | if( ( wgAction == 'view' || wgAction == 'edit' ) |
155 | 160 | && |
156 | | - document.URL.indexOf('&diff=') == -1 |
| 161 | + ( |
| 162 | + document.URL.indexOf('&diff=') == -1 |
| 163 | + && |
| 164 | + document.URL.indexOf('?diff=') == -1 |
| 165 | + ) |
157 | 166 | ){ |
158 | 167 | if( wgAction == 'view' ){ |
159 | 168 | var catLinksHtml = document.getElementById('catlinks'); |
— | — | @@ -180,7 +189,7 @@ |
181 | 190 | window.mwSequencerRemote.drawUI(); |
182 | 191 | |
183 | 192 | //setTimeout(function(){ |
184 | | - }) |
| 193 | + }); |
185 | 194 | } |
186 | 195 | |
187 | 196 | } |
— | — | @@ -208,7 +217,7 @@ |
209 | 218 | ]; |
210 | 219 | var scriptUrl = mwEmbedHostPath + '/remotes/' + scriptName + '?' + mwGetReqArgs(); |
211 | 220 | loadMwEmbed(libraries, function() { |
212 | | - mw.load( scriptUrl ) |
| 221 | + mw.load( scriptUrl ); |
213 | 222 | } ); |
214 | 223 | return ; |
215 | 224 | } |
— | — | @@ -255,7 +264,7 @@ |
256 | 265 | 'titleKey' : sequenceTitle, |
257 | 266 | 'target' : '#bodyContent' |
258 | 267 | }); |
259 | | - window.mwSequencerRemote.showViewFlattenedFile() |
| 268 | + window.mwSequencerRemote.showViewFlattenedFile(); |
260 | 269 | } |
261 | 270 | |
262 | 271 | // Do utility rewrite of OggHandler content: |
— | — | @@ -511,7 +520,7 @@ |
512 | 521 | // Issue an async request to rewrite the next clip |
513 | 522 | if ( vidIdList.length != 0 ) { |
514 | 523 | setTimeout( function() { |
515 | | - procVidId( vidIdList.pop() ) |
| 524 | + procVidId( vidIdList.pop() ); |
516 | 525 | }, 1 ); |
517 | 526 | } |
518 | 527 | } |
— | — | @@ -534,7 +543,7 @@ |
535 | 544 | reqStr = s.src.substr( s.src.indexOf( '?' ) ); |
536 | 545 | scriptPath = s.src.substr( 0, s.src.indexOf( '?' ) ).replace( '/mediaWiki.js', '' ); |
537 | 546 | } else { |
538 | | - scriptPath = s.src.replace( '/mediaWiki.js', '' ) |
| 547 | + scriptPath = s.src.replace( '/mediaWiki.js', '' ); |
539 | 548 | } |
540 | 549 | // Use the external_media_wizard path: |
541 | 550 | return [scriptPath + '/..', reqStr]; |
— | — | @@ -577,7 +586,7 @@ |
578 | 587 | callback = classSet; |
579 | 588 | } |
580 | 589 | if ( typeof MW_EMBED_VERSION != 'undefined' ) { |
581 | | - mw.load( classSet, callback) |
| 590 | + mw.load( classSet, callback); |
582 | 591 | return ; |
583 | 592 | } |
584 | 593 | // Inject mwEmbed |
— | — | @@ -642,10 +651,10 @@ |
643 | 652 | // Load the class set as part of mwReady callback |
644 | 653 | mw.load( classSet, function(){ |
645 | 654 | callback(); |
646 | | - }) |
| 655 | + }); |
647 | 656 | }); |
648 | 657 | } |
649 | | - } |
| 658 | + }; |
650 | 659 | waitForJQueryUpgrade(); |
651 | 660 | } |
652 | 661 | } |
— | — | @@ -667,7 +676,7 @@ |
668 | 677 | // All enabled pages should check if we have the gadget already installed |
669 | 678 | // if not offer a convenient button |
670 | 679 | mwCheckForGadget(); |
671 | | - }) |
| 680 | + }); |
672 | 681 | } |
673 | 682 | } |
674 | 683 | /** |
— | — | @@ -775,8 +784,8 @@ |
776 | 785 | $j('#gadget-form-loader') |
777 | 786 | .text( gM( 'mwe-enable-gadget-done' ) ); |
778 | 787 | } |
779 | | - } ) |
780 | | - }) |
| 788 | + } ); |
| 789 | + }); |
781 | 790 | } |
782 | 791 | function mwGetFormFromPage( pageHTML ){ |
783 | 792 | var form = {}; |
— | — | @@ -811,7 +820,7 @@ |
812 | 821 | function mwCheckObjectPath ( libVar ) { |
813 | 822 | if ( !libVar ) |
814 | 823 | return false; |
815 | | - var objPath = libVar.split( '.' ) |
| 824 | + var objPath = libVar.split( '.' ); |
816 | 825 | var cur_path = ''; |
817 | 826 | for ( var p = 0; p < objPath.length; p++ ) { |
818 | 827 | cur_path = ( cur_path == '' ) ? cur_path + objPath[p] : cur_path + '.' + objPath[p]; |