r47382 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r47381‎ | r47382 | r47383 >
Date:22:04, 17 February 2009
Author:dale
Status:deferred
Tags:
Comment:
* fixes integration with commons upload handler
* makes sure it passes commons upload tests before proceeding to transcode.
Modified paths:
  • /trunk/extensions/MetavidWiki/skins/mv_embed/libAddMedia/firefogg.js (modified) (history)

Diff [purge]

Index: trunk/extensions/MetavidWiki/skins/mv_embed/libAddMedia/firefogg.js
@@ -116,19 +116,7 @@
117117 },
118118 select_fogg:function(){
119119 var _this = this;
120 - if(_this.fogg.selectVideo()) {
121 - var editForm = document.getElementById( 'mw-upload-form' );
122 - _this.org_onsubmit = editForm.onsubmit;
123 - _this.org_onsubmit_ran = false;
124 - editForm.onsubmit = function return_false(){
125 - //run the original onsubmit (if not run yet set flag to avoid excessive chaining )
126 - if( ! _this.org_onsubmit_ran && _this.org_onsubmit == 'function' ){
127 - _this.org_onsubmit_ran=true;
128 - _this.org_onsubmit();
129 - }
130 - return false;
131 - };
132 -
 120+ if(_this.fogg.selectVideo()) {
133121 //update destination filename:
134122 if( _this.fogg.sourceFilename ){
135123 var destFileInput = document.getElementById( 'wpDestFile');
@@ -159,11 +147,21 @@
160148 if(e)
161149 e.style.display='block';
162150 }
163 - }
164 - //set binding for "upload" button to call our transcode process
165 - addHandler( editForm, 'submit', function() {
166 - //call the onsubmit to run any script form value checks:
167 - editForm.onsubmit();
 151+ }
 152+ //setup the form handling
 153+ var editForm = document.getElementById( 'mw-upload-form' );
 154+ //set up the org_onsubmit if not set:
 155+ if( typeof( _this.org_onsubmit ) == 'undefined' )
 156+ _this.org_onsubmit = editForm.onsubmit;
 157+
 158+ editForm.onsubmit = function() {
 159+ //run the original onsubmit (if not run yet set flag to avoid excessive chaining )
 160+ if( typeof( _this.org_onsubmit ) == 'function' ){
 161+ //error in org submit return false;
 162+ if( ! _this.org_onsubmit()){
 163+ return false;
 164+ }
 165+ }
168166 //get the input
169167 var formData = _this.getEditFormData( editForm );
170168
@@ -276,7 +274,7 @@
277275 encodingStatus();
278276 //don't submit the form (let firefogg handle it)
279277 return false;
280 - }); //addHandler mapping
 278+ }; //addHandler mapping
281279 }else{
282280 //remove upload binding if no file was selected
283281 }

Status & tagging log