r52412 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r52411‎ | r52412 | r52413 >
Date:20:55, 25 June 2009
Author:dale
Status:deferred
Tags:
Comment:
fix for array loop type (prototype's lib array.prototype compatibility)
Modified paths:
  • /branches/new-upload/phase3/js2/mwEmbed/libAddMedia/remoteSearchDriver.js (modified) (history)
  • /branches/new-upload/phase3/js2/mwEmbed/libClipEdit/mvClipEdit.js (modified) (history)
  • /branches/new-upload/phase3/js2/mwEmbed/mv_embed.js (modified) (history)

Diff [purge]

Index: branches/new-upload/phase3/js2/mwEmbed/libAddMedia/remoteSearchDriver.js
@@ -991,15 +991,15 @@
992992 //scale up image and to swap with high res version
993993 $j('#rsd_edit_img').animate({
994994 'opacity':1,
995 - 'top':'0px',
996 - 'left':'0px',
 995+ 'top':'5px',
 996+ 'left':'5px',
997997 'width': maxWidth + 'px',
998998 'height': parseInt( tRatio * maxWidth) + 'px'
999999 }, "slow"); // do it slow to give it a chance to finish loading the HQ version
10001000
10011001 if( mediaType == 'image' ){
1002 - _this.loadHQImg(rObj, {'width':maxWidth}, 'rsd_edit_img', function(){
1003 - $j('.mv_img_loader').remove();
 1002+ _this.loadHQImg(rObj, {'width':maxWidth}, 'rsd_edit_img', function(){
 1003+ $j('.mv_loading_img').remove();
10041004 });
10051005 }
10061006 //also fade in the container:
@@ -1103,7 +1103,7 @@
11041104 //make sure we have the embedVideo libs:
11051105 mvJsLoader.embedVideoCheck( function(){
11061106 js_log('append html: ' + rObj.pSobj.getEmbedHTML( rObj, {id:'embed_vid'}) );
1107 - $j('#clip_edit_disp').append(
 1107+ $j('#clip_edit_disp').html(
11081108 rObj.pSobj.getEmbedHTML( rObj, {id:'embed_vid'})
11091109 );
11101110 //rewrite by id
@@ -1247,7 +1247,8 @@
12481248
12491249 '</div>'+
12501250 //output the rendered and non-renderd version of description for easy swiching:
1251 - '</div>');
 1251+ '</div>');
 1252+ //add hover:
12521253 //update video tag
12531254 rewrite_by_id(_this.target_container + '_rsd_pv_vid');
12541255 //load the preview text:
@@ -1265,7 +1266,7 @@
12661267 $j('#rsd_import_desc').html(o);
12671268 });
12681269 });
1269 - $j(_this.target_container + ' .rsd_import_doimport').click(function(){
 1270+ $j(_this.target_container + ' .rsd_import_doimport').btnBind().click(function(){
12701271 //check import mode:
12711272 if(_this.import_url_mode=='form'){
12721273 _this.doImportSpecialPage( rObj, cir_callback );
@@ -1275,7 +1276,7 @@
12761277 js_log("Error: import mode is not form or API (can not copy asset)");
12771278 }
12781279 });
1279 - $j( _this.target_container + ' .rsd_import_acancel').click(function(){
 1280+ $j( _this.target_container + ' .rsd_import_acancel').btnBind().click(function(){
12801281 $j('#rsd_resource_import').fadeOut("fast",function(){
12811282 $j(this).remove();
12821283 });
Index: branches/new-upload/phase3/js2/mwEmbed/libClipEdit/mvClipEdit.js
@@ -472,36 +472,40 @@
473473 switch(cbType){
474474 case 'insert_seq':
475475 $j(b_target).append( $j.btnHtml(gM('mv_insert_into_sequence'), 'mv_insert_sequence', 'check' ) + ' ' )
476 - .children('.mv_insert_sequence').btnBind()
 476+ .children('.mv_insert_sequence')
477477 .click(function(){
478478 _this.applyEdit();
479479 _this.controlActionsCb['insert_seq']( _this.rObj );
480480 });
 481+ $j('.mv_insert_sequence').btnBind();
481482 break;
482483 case 'insert':
483484 $j(b_target).append( $j.btnHtml(gM('mv_insert_image_page'), 'mv_insert_image_page', 'check' ) + ' ' )
484 - .children('.mv_insert_image_page').btnBind()
 485+ .children('.mv_insert_image_page')
485486 .click(function(){
486487 _this.applyEdit();
487488 _this.controlActionsCb['insert']( _this.rObj );
488489 }).show('slow');
 490+ $j('.mv_insert_image_page').btnBind();
489491 break;
490492 case 'preview':
491493 $j(b_target).append( $j.btnHtml( gM('mv_preview_insert'), 'mv_preview_insert', 'refresh') + ' ' )
492 - .children('.mv_preview_insert').btnBind()
 494+ .children('.mv_preview_insert')
493495 .click(function(){
494496 _this.applyEdit();
495497 _this.controlActionsCb['preview']( _this.rObj );
496498 }).show('slow');
 499+ $j('.mv_preview_insert').btnBind();
497500 break;
498501 case 'cancel':
499502 $j(b_target).append( $j.btnHtml( gM('mv_cancel_image_insert'), 'mv_cancel_img_edit', 'close') + ' ')
500 - .children('.mv_cancel_img_edit').btnBind()
 503+ .children('.mv_cancel_img_edit')
501504 .click(function(){
502505 //no cancel action;
503 - _this.controlActionsCb['cancel']( _this.rObj );
 506+ _this.controlActionsCb['cancel']( _this.rObj );
504507 }).show('slow');
505 - break;
 508+ $j('.mv_cancel_img_edit').btnBind();
 509+ break;
506510 }
507511 }
508512 },
Index: branches/new-upload/phase3/js2/mwEmbed/mv_embed.js
@@ -20,7 +20,7 @@
2121 MV_DO_INIT=false;
2222 }
2323 //used to grab fresh copies of scripts. (should be changed on commit)
24 -var MV_EMBED_VERSION = '1.0r16';
 24+var MV_EMBED_VERSION = '1.0r17';
2525
2626 /*
2727 * Configuration variables (can be set from some precceding script)
@@ -110,13 +110,16 @@
111111 opt['j_replace'] = 'jquery.';
112112 if(!path)
113113 path = '';
114 - for(var i in gClasses){
115 - //check if its an array:
116 - if( gClasses.length ){
 114+ if(gClasses.length){
 115+ //do array loop:
 116+ for(var i=0;i<gClasses.length;i++){
117117 //setup normal replacement of j with jquery
118118 var jsName = ( gClasses[i].substr(0,3) == '$j.' ) ? opt['j_replace'] + gClasses[i].substr(3) : gClasses[i];
119119 mvClassPaths[ gClasses[i] ] = path + jsName + '.js';
120 - }else{
 120+ }
 121+ }else{
 122+ //do object loop:
 123+ for(var i in gClasses){
121124 //assume object with key:path:
122125 mvClassPaths[i] = path + gClasses[ i ];
123126 }

Status & tagging log