Index: branches/js2-work/phase3/js/mwEmbed/tests/Firefogg_GUI.html |
— | — | @@ -83,10 +83,12 @@ |
84 | 84 | </a><br> |
85 | 85 | Make Ogg Video</h1> |
86 | 86 | <br> |
| 87 | +<div style="margin-right:auto;margin-left:auto;width:500px;"> |
| 88 | +Note: Your video file will be locally encoded and not upload to any server |
| 89 | +</div> |
87 | 90 | <br> |
88 | 91 | |
89 | | - <div style="margin-right:auto;margin-left:auto;width:500px;" id="firefogg_app"> |
90 | | - Loading firefogg... |
| 92 | + <div style="margin-right:auto;margin-left:auto;width:500px;" id="firefogg_app"> |
91 | 93 | </div> |
92 | 94 | |
93 | 95 | <div style="height:295px"></div> |
Index: branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/mw.Firefogg.js |
— | — | @@ -362,7 +362,7 @@ |
363 | 363 | */ |
364 | 364 | setupForm: function() { |
365 | 365 | mw.log( 'firefogg::setupForm::' ); |
366 | | - var _this = this; |
| 366 | + var _this = this; |
367 | 367 | // Set up the parent if we are in upload mode |
368 | 368 | if ( this.form_type == 'upload' ) { |
369 | 369 | this.pe_setupForm(); |
— | — | @@ -547,7 +547,7 @@ |
548 | 548 | * Returns false if it can't be found. |
549 | 549 | * Overrides mw.BaseUploadInterface.getForm(). |
550 | 550 | */ |
551 | | - getForm: function() { |
| 551 | + getForm: function() { |
552 | 552 | if ( this.form_selector ) { |
553 | 553 | return this.pe_getForm(); |
554 | 554 | } else { |
— | — | @@ -826,6 +826,22 @@ |
827 | 827 | _this.pe_doUpload(); |
828 | 828 | return; |
829 | 829 | } |
| 830 | + // Get the input form data into an array |
| 831 | + mw.log( 'get this.formData ::' ); |
| 832 | + var data = $j( this.form ).serializeArray(); |
| 833 | + this.formData = {}; |
| 834 | + for ( var i = 0; i < data.length; i++ ) { |
| 835 | + if ( data[i]['name'] ){ |
| 836 | + // Special case of upload.js commons hack: |
| 837 | + if( data[i]['name'] == 'wpUploadDescription' ){ |
| 838 | + this.formData[ 'comment' ] = data[i]['value']; |
| 839 | + }else{ |
| 840 | + this.formData[ data[i]['name'] ] = data[i]['value']; |
| 841 | + } |
| 842 | + } |
| 843 | + } |
| 844 | + |
| 845 | + |
830 | 846 | // We can do a chunk upload |
831 | 847 | if( _this.upload_mode == 'post' && _this.enable_chunks ){ |
832 | 848 | _this.doChunkUpload(); |
Index: branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/mw.RemoteSearchDriver.js |
— | — | @@ -956,13 +956,13 @@ |
957 | 957 | var wTitle = resultData['filename']; |
958 | 958 | // Add a loading div |
959 | 959 | _this.addResourceEditLoader(); |
960 | | - |
961 | 960 | //Add the uploaded result |
962 | 961 | provider.sObj.addByTitle( wTitle, function( resource ) { |
963 | 962 | // Redraw ( with added result if new ) |
964 | 963 | _this.showResults(); |
965 | 964 | // Pull up resource editor: |
966 | | - _this.showResourceEditor( resource, $j( '#res_upload__' + resource.id ).get( 0 ) ); |
| 965 | + debugger; |
| 966 | + _this.showResourceEditor( resource, $j( '#res_this_wiki_' + resource.id ).get( 0 ) ); |
967 | 967 | } ); |
968 | 968 | // Return false to close progress window: |
969 | 969 | return false; |
— | — | @@ -1607,7 +1607,7 @@ |
1608 | 1608 | $j( _this.target_container ).dialog( 'option', 'title', dialogTitle ); |
1609 | 1609 | mw.log( 'did append to: ' + _this.target_container ); |
1610 | 1610 | |
1611 | | - // Left side holds the image right size the controls / |
| 1611 | + // Left side holds the image right size the controls |
1612 | 1612 | $j( rsdElement ) |
1613 | 1613 | .clone() |
1614 | 1614 | .attr( 'id', 'rsd_edit_img' ) |
— | — | @@ -2504,7 +2504,7 @@ |
2505 | 2505 | setTimeout( |
2506 | 2506 | function() { |
2507 | 2507 | $j( _this.target_container ).dialog( 'close' ); |
2508 | | - $j( '#rsd_modal_target').remove(); |
| 2508 | + $j( _this.target_container ).remove(); |
2509 | 2509 | }, 25 |
2510 | 2510 | ); |
2511 | 2511 | }, |
Index: branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/jquery.simpleUploadForm.js |
— | — | @@ -46,15 +46,15 @@ |
47 | 47 | } |
48 | 48 | |
49 | 49 | // Get an edit Token for "uploading" |
50 | | - mw.getToken( 'File:MyRandomFileTokenCheck', options.api_target, function( eToken ) { |
| 50 | + mw.getToken( 'File:MyRandomFileTokenCheck.jpg', options.api_target, function( eToken ) { |
51 | 51 | if ( !eToken || eToken == '+\\' ) { |
52 | | - $( this.selector ).html( gM( 'mwe-error_not_loggedin' ) ); |
| 52 | + $( _this.selector ).html( gM( 'mwe-error_not_loggedin' ) ); |
53 | 53 | return false; |
54 | 54 | } |
55 | 55 | |
56 | 56 | // Build an upload form: |
57 | 57 | var o = '<div>' + |
58 | | - '<form id="suf-upload" enctype="multipart/form-data" action="' + options.api_target + '" method="post">' + |
| 58 | + '<form id="suf_upload" name="suf_upload" enctype="multipart/form-data" action="' + options.api_target + '" method="post">' + |
59 | 59 | // hidden input: |
60 | 60 | '<input type="hidden" name="action" value="upload">' + |
61 | 61 | '<input type="hidden" name="format" value="jsonfm">' + |
— | — | @@ -149,7 +149,7 @@ |
150 | 150 | // MediaWiki API supports chunk uploads: |
151 | 151 | 'enable_chunks' : true, |
152 | 152 | |
153 | | - 'edit_form_selector' : '#suf-upload', |
| 153 | + 'form_selector' : '#suf_upload', |
154 | 154 | 'new_source_cb' : function( orgFilename, oggName ) { |
155 | 155 | $j( "#wpDestFile" ).val( oggName ).doDestCheck( { |
156 | 156 | warn_target: "#wpDestFile-warning" |
Index: branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/mw.BaseUploadInterface.js |
— | — | @@ -74,25 +74,28 @@ |
75 | 75 | setupForm: function() { |
76 | 76 | mw.log( "Base::setupForm::" ); |
77 | 77 | var _this = this; |
| 78 | + |
78 | 79 | // Set up the local pointer to the edit form: |
79 | | - this.form = this.getForm(); |
| 80 | + this.form = this.getForm(); |
| 81 | + |
80 | 82 | if ( !this.form ) { |
81 | 83 | mw.log( "Upload form not found!" ); |
82 | 84 | return; |
83 | | - } |
| 85 | + } |
84 | 86 | |
85 | | - // If we're in API mode, re-map the upload form to API. |
86 | | - if ( this.upload_mode == 'api' ) { |
87 | | - this.remapFormToApi(); |
88 | | - } |
89 | | - |
90 | 87 | // Set up the orig_onsubmit if not set: |
91 | 88 | if ( typeof( this.orig_onsubmit ) == 'undefined' && this.form.onsubmit ) { |
92 | 89 | this.orig_onsubmit = this.form.onsubmit; |
93 | 90 | } |
94 | 91 | |
95 | 92 | // Set up the submit action: |
96 | | - $j( this.form ).submit( function() { |
| 93 | + $j( this.form ).submit( function() { |
| 94 | + mw.log( "FORM SUBMIT::" ); |
| 95 | + var data = $j( this ).serializeArray(); |
| 96 | + for ( var i = 0; i < data.length; i++ ) { |
| 97 | + mw.log( $j( data[i] ).attr('name') + ' : ' + $j(data[i]).val() ); |
| 98 | + } |
| 99 | + |
97 | 100 | return _this.onSubmit(); |
98 | 101 | } ); |
99 | 102 | }, |
— | — | @@ -110,30 +113,18 @@ |
111 | 114 | return false; |
112 | 115 | } |
113 | 116 | } |
| 117 | + // Remap the upload form to the "api" form: |
| 118 | + this.remapFormToApi(); |
| 119 | + |
114 | 120 | // Check for post action override |
115 | 121 | if ( this.form_post_override ) { |
116 | 122 | mw.log( 'form_post_override is true, do ordinary form submit' ); |
117 | 123 | return true; |
118 | | - } |
119 | | - |
120 | | - // Get the input form data into an array |
121 | | - mw.log( 'update formData::' ); |
122 | | - var data = $j( this.form ).serializeArray(); |
123 | | - this.formData = {}; |
124 | | - for ( var i = 0; i < data.length; i++ ) { |
125 | | - if ( data[i]['name'] ){ |
126 | | - // Special case of upload.js commons hack: |
127 | | - if( data[i]['name'] == 'wpUploadDescription' ){ |
128 | | - this.formData[ 'comment' ] = data[i]['value']; |
129 | | - }else{ |
130 | | - this.formData[ data[i]['name'] ] = data[i]['value']; |
131 | | - } |
132 | | - } |
133 | | - } |
134 | | - |
| 124 | + } |
| 125 | + |
| 126 | + |
135 | 127 | // Put into a try catch so we are sure to return false: |
136 | | - try { |
137 | | - |
| 128 | + try { |
138 | 129 | // Display a progress dialog |
139 | 130 | _this.displayProgressOverlay(); |
140 | 131 | |
— | — | @@ -165,6 +156,7 @@ |
166 | 157 | detectUploadMode: function( callback ) { |
167 | 158 | var _this = this; |
168 | 159 | mw.log( 'detectUploadMode::' + _this.upload_mode ); |
| 160 | + //debugger; |
169 | 161 | // Check the upload mode |
170 | 162 | if ( _this.upload_mode == 'detect_in_progress' ) { |
171 | 163 | // Don't send another request, wait for the pending one. |
— | — | @@ -182,6 +174,7 @@ |
183 | 175 | |
184 | 176 | // FIXME: move this to configuration and avoid this API request |
185 | 177 | mw.getJSON( _this.api_url, { 'action' : 'paraminfo', 'modules' : 'upload' }, function( data ) { |
| 178 | + debugger; |
186 | 179 | if ( typeof data.paraminfo == 'undefined' |
187 | 180 | || typeof data.paraminfo.modules == 'undefined' ) |
188 | 181 | { |
— | — | @@ -219,7 +212,8 @@ |
220 | 213 | /** |
221 | 214 | * Do an upload, with the mode given by this.upload_mode |
222 | 215 | */ |
223 | | - doUpload: function() { |
| 216 | + doUpload: function() { |
| 217 | + // Note "api" should be called "http_copy_upload" and /post/ should be "form_upload" |
224 | 218 | if ( this.upload_mode == 'api' ) { |
225 | 219 | this.doApiCopyUpload(); |
226 | 220 | } else if ( this.upload_mode == 'post' ) { |
— | — | @@ -236,32 +230,42 @@ |
237 | 231 | * This is rather ugly, but solutions are constrained by the fact that |
238 | 232 | * file inputs can't be moved around or recreated after the user has |
239 | 233 | * selected a file in them, which they may well do before DOM ready. |
| 234 | + * |
| 235 | + * It is also constrained by upload form hacks on commons. |
240 | 236 | */ |
241 | 237 | remapFormToApi: function() { |
242 | 238 | var _this = this; |
243 | | - if ( !this.api_url ) |
| 239 | + // |
| 240 | + mw.log("remapFormToApi:: " + this.api_url + ' form: ' + this.form); |
| 241 | + |
| 242 | + if ( !this.api_url ){ |
| 243 | + mw.log( 'Error: no api url target' ); |
244 | 244 | return false; |
| 245 | + } |
| 246 | + var $form = $j( this.form_selector ); |
245 | 247 | |
246 | | - var form = $j( this.form ); |
247 | | - |
248 | 248 | // Set the form action |
249 | | - form.attr('action', _this.api_url); |
| 249 | + $form.attr('action', _this.api_url); |
250 | 250 | |
251 | 251 | // Add API action |
252 | | - if ( form.find( "[name='action']" ).length == 0 ) |
253 | | - form.append( '<input type="hidden" name="action" value="upload">' ); |
| 252 | + if ( $form.find( "[name='action']" ).length == 0 ){ |
| 253 | + $form.append( '<input type="hidden" name="action" value="upload">' ); |
| 254 | + } |
254 | 255 | |
255 | | - // Add JSON format |
256 | | - if ( form.find( "[name='format']" ).length == 0 ) |
257 | | - form.append( '<input type="hidden" name="format" value="jsonfm">' ); |
| 256 | + // Add JSON response format |
| 257 | + if ( $form.find( "[name='format']" ).length == 0 ){ |
| 258 | + $form.append( '<input type="hidden" name="format" value="jsonfm">' ); |
| 259 | + } |
258 | 260 | |
259 | 261 | // Map a new hidden form |
260 | | - form.find( "[name='wpUploadFile']" ).attr( 'name', 'file' ); |
261 | | - form.find( "[name='wpDestFile']" ).attr( 'name', 'filename' ); |
262 | | - form.find( "[name='wpUploadDescription']" ).attr( 'name', 'comment' ); |
263 | | - form.find( "[name='wpEditToken']" ).attr( 'name', 'token' ); |
264 | | - form.find( "[name='wpIgnoreWarning']" ).attr( 'name', 'ignorewarnings' ); |
265 | | - form.find( "[name='wpWatchthis']" ).attr( 'name', 'watch' ); |
| 262 | + $form.find( "[name='wpUploadFile']" ).attr( 'name', 'file' ); |
| 263 | + $form.find( "[name='wpDestFile']" ).attr( 'name', 'filename' ); |
| 264 | + $form.find( "[name='wpUploadDescription']" ).attr( 'name', 'comment' ); |
| 265 | + $form.find( "[name='wpEditToken']" ).attr( 'name', 'token' ); |
| 266 | + $form.find( "[name='wpIgnoreWarning']" ).attr( 'name', 'ignorewarnings' ); |
| 267 | + $form.find( "[name='wpWatchthis']" ).attr( 'name', 'watch' ); |
| 268 | + |
| 269 | + //mw.log( 'comment: ' + $form.find( "[name='comment']" ).val() ); |
266 | 270 | }, |
267 | 271 | |
268 | 272 | /** |
— | — | @@ -283,23 +287,26 @@ |
284 | 288 | */ |
285 | 289 | doPostUpload: function() { |
286 | 290 | var _this = this; |
287 | | - var form = $j( _this.form ); |
| 291 | + var $form = $j( _this.form ); |
288 | 292 | mw.log( 'mvBaseUploadInterface.doPostUpload' ); |
289 | | - |
290 | 293 | // Issue a normal post request |
291 | 294 | // Get the token from the page |
292 | 295 | _this.editToken = $j( "#wpEditToken" ).val(); |
293 | 296 | |
294 | 297 | //@@TODO check for sendAsBinary to support Firefox/HTML5 progress on upload |
295 | | - |
296 | | - |
| 298 | + |
| 299 | + //Update the progress dialog (no bar without XHR request) |
| 300 | + $j( '#upProgressDialog' ).html( |
| 301 | + mw.loading_spinner() |
| 302 | + ); |
| 303 | + |
297 | 304 | // Add the iframe |
298 | 305 | _this.iframeId = 'f_' + ( $j( 'iframe' ).length + 1 ); |
299 | 306 | $j( "body" ).append( '<iframe src="javascript:false;" id="' + _this.iframeId + '" ' + |
300 | 307 | 'name="' + _this.iframeId + '" style="display:none;" ></iframe>' ); |
301 | 308 | |
302 | 309 | // Set the form target to the iframe |
303 | | - form.attr( 'target', _this.iframeId ); |
| 310 | + $form.attr( 'target', _this.iframeId ); |
304 | 311 | |
305 | 312 | // Set up the completion callback |
306 | 313 | $j( '#' + _this.iframeId ).load( function() { |
— | — | @@ -307,17 +314,18 @@ |
308 | 315 | }); |
309 | 316 | |
310 | 317 | // Set the action to the API URL: |
311 | | - form.attr( 'action', _this.api_url ); |
| 318 | + $form.attr( 'action', _this.api_url ); |
312 | 319 | |
313 | | - mw.log( 'Do iframe form submit to: ' + form.attr( 'target' ) ); |
314 | | - mw.log( ' destName:' + form.find( "[name='filename']" ).val() ); |
| 320 | + mw.log( 'Do iframe form submit of: ' + $form.attr( 'target' ) + ' to: ' + $form.attr('action') ); |
| 321 | + mw.log( ' destName:' + $form.find( "[name='filename']" ).val() ); |
| 322 | + mw.log( ' content:' + $form.find( "[name='comment']" ).val() ); |
315 | 323 | |
316 | 324 | // Do post override |
317 | 325 | _this.form_post_override = true; |
| 326 | + |
318 | 327 | // Reset the done with action flag |
319 | | - _this.action_done = false; |
320 | | - |
321 | | - form.submit(); |
| 328 | + _this.action_done = false; |
| 329 | + $form.submit(); |
322 | 330 | }, |
323 | 331 | |
324 | 332 | /** |
— | — | @@ -749,7 +757,7 @@ |
750 | 758 | */ |
751 | 759 | processApiResult: function( apiRes ) { |
752 | 760 | var _this = this; |
753 | | - mw.log( 'processApiResult::' ); |
| 761 | + mw.log( 'processApiResult::' ); |
754 | 762 | if ( !_this.isApiSuccess( apiRes ) ) { |
755 | 763 | // Error detected, show it to the user |
756 | 764 | _this.showApiError( apiRes ); |
— | — | @@ -838,6 +846,18 @@ |
839 | 847 | * Returns false if it can't be found. |
840 | 848 | */ |
841 | 849 | getForm: function() { |
| 850 | + |
| 851 | + /*debugger; |
| 852 | + var cat = this.form_selector; |
| 853 | + var forms = document.getElementsByTagName('form'); |
| 854 | + mw.log('got ' + forms.length + ' foms '); |
| 855 | + for( var i in forms ){ |
| 856 | + var fish = forms[ i ]; |
| 857 | + mw.log( 'fish: ' + fish.id ); |
| 858 | + } |
| 859 | + var cat = $j( this.form_selector ).get(0); |
| 860 | + mw.log( 'getForm::' + cat.id ); |
| 861 | + */ |
842 | 862 | if ( this.form_selector && $j( this.form_selector ).length != 0 ) { |
843 | 863 | return $j( this.form_selector ).get( 0 ); |
844 | 864 | } else { |
— | — | @@ -886,6 +906,8 @@ |
887 | 907 | }, |
888 | 908 | buttons: _this.getCancelButton() |
889 | 909 | } ); |
| 910 | + mw.log( 'upProgressDialog::dialog done' ); |
| 911 | + |
890 | 912 | $j( '#upProgressDialog' ).html( |
891 | 913 | '<div id="up-pbar-container" style="width:90%;height:15px;" >' + |
892 | 914 | '<div id="up-progressbar" style="height:15px;"></div>' + |
— | — | @@ -905,13 +927,14 @@ |
906 | 928 | }, |
907 | 929 | |
908 | 930 | /** |
909 | | - * Get a standard cancel button in the jQuery.ui dialog format |
910 | | - */ |
| 931 | + * Get a standard cancel button in the jQuery.ui dialog format |
| 932 | + */ |
911 | 933 | getCancelButton: function() { |
912 | 934 | var _this = this; |
913 | | - var cancelBtn = new Array(); |
| 935 | + mw.log( 'f: getCancelButton()' ); |
| 936 | + var cancelBtn = []; |
914 | 937 | cancelBtn[ gM( 'mwe-cancel' ) ] = function() { |
915 | | - return _this.onCancel( this ) |
| 938 | + $j( dlElm ).dialog( 'close' ); |
916 | 939 | }; |
917 | 940 | return cancelBtn; |
918 | 941 | }, |
— | — | @@ -925,7 +948,7 @@ |
926 | 949 | //confirm: |
927 | 950 | if ( confirm( gM( 'mwe-cancel-confim' ) ) ) { |
928 | 951 | //@@todo (cancel the encode / upload) |
929 | | - $j( this ).dialog( 'close' ); |
| 952 | + $j( dlElm ).dialog( 'close' ); |
930 | 953 | } |
931 | 954 | } |
932 | 955 | }; |
Index: branches/js2-work/phase3/js/mwEmbed/modules/Sequencer/mw.FirefoggRender.js |
— | — | @@ -138,7 +138,10 @@ |
139 | 139 | _this.doNextFrame(); |
140 | 140 | }); |
141 | 141 | }, |
142 | | - // Do the next frame in the render target |
| 142 | + |
| 143 | + /** |
| 144 | + * Do the next frame in the render target |
| 145 | + */ |
143 | 146 | doNextFrame: function(){ |
144 | 147 | var _this = this; |
145 | 148 | // internal function to handle updates: |
— | — | @@ -149,7 +152,7 @@ |
150 | 153 | //mw.log( 'addFrame:' + $j( _this.player_target ).attr( 'id' ) ); |
151 | 154 | _this.fogg.addFrame( $j( _this.player_target ).attr( 'id' ) ); |
152 | 155 | _this.render_time += _this.interval; |
153 | | - if ( _this.render_time >= _this.player.getDuration() && _this.continue_rendering) { |
| 156 | + if ( _this.render_time >= _this.player.getDuration() || ! _this.continue_rendering ) { |
154 | 157 | _this.doFinalRender(); |
155 | 158 | } else { |
156 | 159 | _this.doNextFrame(); |
— | — | @@ -160,7 +163,7 @@ |
161 | 164 | /** |
162 | 165 | * Stop the current render proccess on the next frame |
163 | 166 | */ |
164 | | - stopRender:function() { |
| 167 | + stopRender: function() { |
165 | 168 | this.continue_rendering = false; |
166 | 169 | }, |
167 | 170 | |
Index: branches/js2-work/phase3/js/mwEmbed/modules/Sequencer/mw.Sequencer.js |
— | — | @@ -836,10 +836,10 @@ |
837 | 837 | mw.load( [ |
838 | 838 | 'mw.ClipEdit' |
839 | 839 | ], function() { |
840 | | - // Zero out the current editor: |
| 840 | + // Zero out the current editor: |
841 | 841 | _this.myClipEditor = { }; |
842 | 842 | // Setup the cliploader options |
843 | | - _this.myClipEditor = new mvClipEdit( { |
| 843 | + _this.myClipEditor = new mw.ClipEdit( { |
844 | 844 | 'resource' : resource, |
845 | 845 | 'target_control_display' : 'clipedit_ic', |
846 | 846 | 'target_clip_display' : resource.id, |
Index: branches/js2-work/phase3/js/mwEmbed/modules/Sequencer/mw.PlayList.js |
— | — | @@ -448,10 +448,12 @@ |
449 | 449 | |
450 | 450 | // Update the target player: |
451 | 451 | this.$interface = $j( this ).parent( '.interface_wrap' ); |
| 452 | + |
| 453 | + // Empty out the old interface: |
452 | 454 | this.ctrlBuilder.embedPlayer = this; |
453 | 455 | |
454 | | - if ( this.controls == true ) { |
455 | | - // prepend the title (ontop) |
| 456 | + if ( this.controls == true && $j('#ptitle_' + this.id).length == 0 ) { |
| 457 | + // prepend the title (ontop) if not there |
456 | 458 | this.$interface.prepend( |
457 | 459 | $j('<div>') |
458 | 460 | .css({ |
Index: branches/js2-work/phase3/js/mwEmbed/mwEmbed.js |
— | — | @@ -25,6 +25,11 @@ |
26 | 26 | window['mw'] = { } |
27 | 27 | } |
28 | 28 | |
| 29 | +/* |
| 30 | +* Set the mwEmbedVersion ( not set by stopgap ) |
| 31 | +*/ |
| 32 | +var MW_EMBED_VERSION = '1.0'; |
| 33 | + |
29 | 34 | /** |
30 | 35 | * The set of modules that you want enable. |
31 | 36 | * |
— | — | @@ -57,10 +62,8 @@ |
58 | 63 | */ |
59 | 64 | var mwDefaultConf = { |
60 | 65 | |
61 | | - |
62 | 66 | 'enabledModules' : mwEnabledModuleList, |
63 | 67 | |
64 | | - |
65 | 68 | // Default skin name |
66 | 69 | 'skinName' : 'mvpcf', |
67 | 70 | |
— | — | @@ -92,7 +95,7 @@ |
93 | 96 | // The mediaWiki path of mvEmbed |
94 | 97 | 'mediaWiki_mwEmbedPath' : 'js/mwEmbed/', |
95 | 98 | |
96 | | - // Api actions that must be submited in a POST, and need an api proxy for cross domain calls |
| 99 | + // Api actions that must be submitted in a POST, and need an api proxy for cross domain calls |
97 | 100 | 'apiPostActions': [ 'login', 'purge', 'rollback', 'delete', 'undelete', |
98 | 101 | 'protect', 'block', 'unblock', 'move', 'edit', 'upload', 'emailuser', |
99 | 102 | 'import', 'userrights' ], |
— | — | @@ -2262,7 +2265,7 @@ |
2263 | 2266 | * so avoid calling this function where possible and |
2264 | 2267 | * cache its result |
2265 | 2268 | * |
2266 | | - * Note this only works when mwEmbed is on the same domain as the style sheets |
| 2269 | + * Note this only works for style sheets on the same domain :( |
2267 | 2270 | * |
2268 | 2271 | * @param {String} styleRule Style rule name to check |
2269 | 2272 | * @return |
— | — | @@ -2274,7 +2277,7 @@ |
2275 | 2278 | // Set up the skin paths configuration |
2276 | 2279 | for( var i=0 ; i < document.styleSheets.length ; i++ ){ |
2277 | 2280 | var rules = null; |
2278 | | - try { |
| 2281 | + try{ |
2279 | 2282 | if ( document.styleSheets[i].cssRules ) |
2280 | 2283 | rules = document.styleSheets[i].cssRules |
2281 | 2284 | else if (document.styleSheets[0].rules) |
— | — | @@ -2285,8 +2288,8 @@ |
2286 | 2289 | return true; |
2287 | 2290 | } |
2288 | 2291 | } |
2289 | | - } catch ( e ){ |
2290 | | - mw.log( 'Error: cross domain style sheet:' + document.styleSheets[i].href); |
| 2292 | + }catch ( e ){ |
| 2293 | + mw.log( 'Error: cant check rule on cross domain style sheet:' + document.styleSheets[i].href ); |
2291 | 2294 | } |
2292 | 2295 | } |
2293 | 2296 | return false; |
Index: branches/js2-work/phase3/js/mwEmbed/remotes/mediaWiki.js |
— | — | @@ -4,7 +4,7 @@ |
5 | 5 | */ |
6 | 6 | var urlparts = getRemoteEmbedPath(); |
7 | 7 | var mwEmbedHostPath = urlparts[0]; |
8 | | -var mwRemoteVersion = 'r74'; |
| 8 | +var mwRemoteVersion = 'r75'; |
9 | 9 | var mwUseScriptLoader = true; |
10 | 10 | |
11 | 11 | // Setup up request Params: |
— | — | @@ -36,7 +36,7 @@ |
37 | 37 | return ; |
38 | 38 | ranRewrites = 'done'; |
39 | 39 | // Add media wizard |
40 | | - if ( wgAction == 'edit' || wgAction == 'submit' ) { |
| 40 | + if ( wgAction == 'edit' || wgAction == 'submit' ) { |
41 | 41 | loadMwEmbed( [ |
42 | 42 | 'mw.RemoteSearchDriver', |
43 | 43 | '$j.fn.textSelection', |
— | — | @@ -319,7 +319,7 @@ |
320 | 320 | callback = classSet; |
321 | 321 | |
322 | 322 | // Inject mwEmbed if needed |
323 | | - if ( typeof mw == 'undefined' ) { |
| 323 | + if ( typeof MW_EMBED_VERSION == 'undefined' ) { |
324 | 324 | if ( ( mwReqParam['uselang'] || mwReqParam[ 'useloader' ] ) && mwUseScriptLoader ) { |
325 | 325 | var rurl = mwEmbedHostPath + '/mwEmbed/jsScriptLoader.php?class=mwEmbed'; |
326 | 326 | |
Index: branches/js2-work/phase3/js/uploadPage.js |
— | — | @@ -21,7 +21,7 @@ |
22 | 22 | 'form_rewrite': true, |
23 | 23 | // MediaWiki API supports chunk uploads: |
24 | 24 | 'enable_chunks' : true, |
25 | | - 'edit_form_selector': mwUploadFormSelector, |
| 25 | + 'form_selector': mwUploadFormSelector, |
26 | 26 | 'new_source_cb': function( orgFilename, oggName ) { |
27 | 27 | $j( '#wpDestFile' ).val( oggName ); |
28 | 28 | $j( '#wpDestFile' ).doDestCheck( { |