r53819 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r53818‎ | r53819 | r53820 >
Date:18:05, 27 July 2009
Author:dale
Status:deferred
Tags:
Comment:
some firefogg fixes for target form selection
Modified paths:
  • /trunk/phase3/js2/mwEmbed/libAddMedia/mvFirefogg.js (modified) (history)
  • /trunk/phase3/js2/mwEmbed/libEmbedVideo/embedVideo.js (modified) (history)
  • /trunk/phase3/js2/uploadPage.js (modified) (history)

Diff [purge]

Index: trunk/phase3/js2/mwEmbed/libAddMedia/mvFirefogg.js
@@ -292,8 +292,10 @@
293293 this.doControlBindings();
294294 },
295295 getEditForm:function(){
296 - js_log('get form: action=' + $j(this.selector).parents().find("form").attr('action'));
297 - return $j(this.selector).parents().find("form").get(0);
 296+ if( this.target_edit_from )
 297+ return this.pe_getEditForm();
 298+ //else try to get the parent "from" of the file selector:
 299+ return $j(this.selector).parents('form:first').get(0);
298300 },
299301 selectFogg:function(){
300302 var _this = this;
@@ -413,7 +415,7 @@
414416 },
415417 doUploadSwitch:function(){
416418 var _this = this;
417 - js_log("firefogg: doUploadSwitch:: " + this.fogg_enabled);
 419+ js_log("firefogg: doUploadSwitch:: " + this.fogg_enabled + ' up mode:' + _this.upload_mode);
418420 //make sure firefogg is enabled otherwise do parent UploadSwich:
419421 if( !this.fogg_enabled || !this.firefogg_form_action )
420422 return _this.pe_doUploadSwitch();
@@ -429,9 +431,9 @@
430432 },
431433 //doChunkUpload does both uploading and encoding at the same time and uploads one meg chunks as they are ready
432434 doChunkUpload : function(){
 435+ js_log('doChunkUpload::');
433436 var _this = this;
434 - _this.action_done = false;
435 -
 437+ _this.action_done = false;
436438 //extension should already be ogg but since its user editable,
437439 //check again
438440 //we are transcoding so we know it will be an ogg
@@ -449,17 +451,17 @@
450452
451453 //build the api url:
452454 var aReq ={
453 - 'action' : 'upload',
454 - 'format' : 'json',
455 - 'filename' : _this.formData['wpDestFile'],
456 - 'comment' : _this.formData['wpUploadDescription'],
457 - 'enablechunks': true
 455+ 'action' : 'upload',
 456+ 'format' : 'json',
 457+ 'filename' : _this.formData['wpDestFile'],
 458+ 'comment' : _this.formData['wpUploadDescription'],
 459+ 'enablechunks' : 'true'
458460 };
459461 //check for editToken:
460462 if(!this.etoken)
461463 this.etoken = _this.formData['wpEditToken'];
462464
463 - if(this.etoken)
 465+ if( this.etoken )
464466 aReq['token'] = this.etoken;
465467
466468 if( _this.formData['wpWatchthis'] )
@@ -634,7 +636,7 @@
635637 var sstring = 'var wgTitle = "' + this.formData['wpDestFile'].replace('_',' ');
636638
637639 if(wgArticlePath){
638 - var result_txt = gM('mv_upload_done', wgArticlePath.replace(/\$1/, 'File:' + this.formData['wpDestFile'] ) );
 640+ var result_txt = gM('mv_upload_done', wgArticlePath.replace(/\$1/, 'File:' + _this.formData['wpDestFile'] ) );
639641 }else{
640642 result_txt = 'File has uploaded but api "done" url was provided. Check the log for result page output';
641643 }
@@ -646,7 +648,7 @@
647649 js_log( 'upload done got redirect found: ' + sstring + ' r:' + _this.upload_done_action );
648650 if( _this.upload_done_action == 'redirect' ){
649651 $j( '#dlbox-centered' ).html( '<h3>Upload Completed:</h3>' + result_txt + '<br>' + form_txt);
650 - window.location = wgArticlePath.replace( /\$1/, 'File:' + formData['wpDestFile'] );
 652+ window.location = wgArticlePath.replace( /\$1/, 'File:' + _this.formData['wpDestFile'] );
651653 }else{
652654 //check if the add_done_action is a callback:
653655 if( typeof _this.upload_done_action == 'function' )
Index: trunk/phase3/js2/mwEmbed/libEmbedVideo/embedVideo.js
@@ -160,7 +160,7 @@
161161 //ie8 does not play well with the jQuery video,audio,playlist selector use native:
162162 if($j.browser.msie && $j.browser.version >= 8){
163163 jtags = j_selector.split(',');
164 - for(var i=0;i<jtags.length;i++){
 164+ for( var i=0; i < jtags.length; i++){
165165 $j( document.getElementsByTagName( jtags[i] )).each(function(){
166166 eAction(this);
167167 });
@@ -2094,12 +2094,11 @@
20952095 return false;
20962096 });
20972097 });
2098 - },
2099 - /*download list is too complicated ... rewrite for clarity: */
 2098+ },
21002099 showVideoDownload:function(){
21012100 //load the roe if available (to populate out download options:
21022101 //js_log('f:showVideoDownload '+ this.roe + ' ' + this.media_element.addedROEData);
2103 - if(this.roe && this.media_element.addedROEData==false){
 2102+ if(this.roe && this.media_element.addedROEData == false){
21042103 var _this = this;
21052104 this.displayHTML(gM('loading_txt'));
21062105 do_request(this.roe, function(data)
Index: trunk/phase3/js2/uploadPage.js
@@ -89,7 +89,6 @@
9090 },
9191 /**
9292 * doDestCheck checks the destination
93 - * @@todo we should be able to configure its "targets" via parent config
9493 */
9594 doDestCheck:function(){
9695 var _this = this;
@@ -135,7 +134,7 @@
136135 '<div class="magnify">' +
137136 '<a title="' + gM('thumbnail-more') + '" class="internal" ' +
138137 'href="' + img.descriptionurl +'"><img width="15" height="11" alt="" ' +
139 - 'src="' + stylepath +"/>" +
 138+ 'src="' + stylepath + "/common/images/magnify-clip.png\" />" +
140139 '</a>'+
141140 '</div>'+
142141 gM('fileexists-thumb') +
@@ -151,7 +150,6 @@
152151 },
153152 /**
154153 * doDestinationFill fills in a destination file-name based on a source asset name.
155 - * @@todo we should be able to configure its "targets" via parent config
156154 */
157155 doDestinationFill:function( targetElm ){
158156 js_log("doDestinationFill")

Status & tagging log