r55640 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r55639‎ | r55640 | r55641 >
Date:18:26, 27 August 2009
Author:dale
Status:deferred
Tags:
Comment:
* some js2 cleanup and refactoring for upload support
* some minor work needed to finish cleaning up inline add media wizard upload across all upload modes (firefogg / normal http post)
Modified paths:
  • /trunk/phase3/js2/mwEmbed/libAddMedia/mvBaseUploadInterface.js (modified) (history)
  • /trunk/phase3/js2/mwEmbed/libAddMedia/mvFirefogg.js (modified) (history)
  • /trunk/phase3/js2/mwEmbed/libAddMedia/remoteSearchDriver.js (modified) (history)
  • /trunk/phase3/js2/mwEmbed/libAddMedia/simpleUploadForm.js (modified) (history)
  • /trunk/phase3/js2/mwEmbed/libEmbedVideo/embedVideo.js (modified) (history)
  • /trunk/phase3/js2/mwEmbed/mv_embed.js (modified) (history)
  • /trunk/phase3/js2/uploadPage.js (modified) (history)

Diff [purge]

Index: trunk/phase3/js2/mwEmbed/libAddMedia/mvFirefogg.js
@@ -442,7 +442,7 @@
443443 //check what mode to use firefogg in:
444444 if( _this.upload_mode == 'post' ){
445445 _this.doEncode();
446 - }else if( _this.upload_mode == 'api' && _this.chunks_supported){ //if api mode and chunks supported do chunkUpload
 446+ }else if( _this.upload_mode == 'api' ){ //if api mode and chunks supported do chunkUpload
447447 _this.doChunkUpload();
448448 }else{
449449 js_error( 'Error: unrecongized upload mode: ' + _this.upload_mode );
@@ -450,36 +450,38 @@
451451 },
452452 //doChunkUpload does both uploading and encoding at the same time and uploads one meg chunks as they are ready
453453 doChunkUpload : function(){
454 - js_log('doChunkUpload::');
 454+ js_log('firefogg::doChunkUpload');
455455 var _this = this;
456456 _this.action_done = false;
 457+
457458 //extension should already be ogg but since its user editable,
458459 //check again
459460 //we are transcoding so we know it will be an ogg
460461 //(should not be done for passthrough mode)
461 - var sf = _this.formData['wpDestFile'];
 462+ var sf = _this.formData['filename'];
462463 var ext = '';
463464 if( sf.lastIndexOf('.') != -1){
464465 ext = sf.substring( sf.lastIndexOf('.') ).toLowerCase();
465466 }
466 - if(!_this.encoder_settings['passthrough'] && $j.inArray(ext.substr(1), _this.ogg_extensions) == -1 ){
 467+ if( !_this.encoder_settings['passthrough'] && $j.inArray(ext.substr(1), _this.ogg_extensions) == -1 ){
467468 var extreg = new RegExp(ext + '$', 'i');
468 - _this.formData['wpDestFile'] = sf.replace(extreg, '.ogg');
 469+ _this.formData['filename'] = sf.replace(extreg, '.ogg');
469470 }
470471 //add chunk response hook to build the resultURL when uploading chunks
471472
472473 //check for editToken:
473474 if(!this.etoken){
474 - if( _this.formData['wpEditToken']){
475 - _this.etoken = _this.formData['wpEditToken'];
 475+ js_log('missing token try ' + _this.formData['token']);
 476+ if( _this.formData['token']){
 477+ _this.etoken = _this.formData['token'];
476478 _this.doChunkWithFormData();
477479 }else{
478480 get_mw_token(
479 - 'File:'+ _this.formData['wpDestFile'],
 481+ 'File:'+ _this.formData['filename'],
480482 _this.api_url,
481483 function( eToken ){
482484 if( !eToken || eToken == '+\\' ){
483 - _this.updateProgressWin(gM('fogg-badtoken'), gM('fogg-badtoken'));
 485+ _this.updateProgressWin( gM('fogg-badtoken'), gM('fogg-badtoken') );
484486 return false;
485487 }
486488 _this.etoken = eToken;
@@ -488,29 +490,30 @@
489491 );
490492 }
491493 }else{
 494+ js_log('we already have token: ' + this.etoken);
492495 _this.doChunkWithFormData();
493496 }
494497 },
495498 doChunkWithFormData:function(){
496499 var _this = this;
497 - js_log("doChunkWithFormData::" + _this.etoken);
 500+ js_log("firefogg::doChunkWithFormData" + _this.etoken);
498501 //build the api url:
499502 var aReq ={
500503 'action': 'upload',
501504 'format': 'json',
502 - 'filename': _this.formData['wpDestFile'],
503 - 'comment': _this.formData['wpUploadDescription'],
 505+ 'filename': _this.formData['filename'],
 506+ 'comment': _this.formData['comment'],
504507 'enablechunks': 'true'
505508 };
506509
507510 if( _this.etoken )
508511 aReq['token'] = this.etoken;
509512
510 - if( _this.formData['wpWatchthis'] )
511 - aReq['watch'] = _this.formData['wpWatchthis'];
 513+ if( _this.formData['watch'] )
 514+ aReq['watch'] = _this.formData['watch'];
512515
513 - if( _this.formData['wpIgnoreWarning'] )
514 - aReq['ignorewarnings'] = _this.formData['wpIgnoreWarning'];
 516+ if( _this.formData['ignorewarnings'] )
 517+ aReq['ignorewarnings'] = _this.formData['ignorewarnings'];
515518
516519 js_log('do fogg upload/encode call: '+ _this.api_url + ' :: ' + JSON.stringify( aReq ) );
517520 js_log('foggEncode: '+ JSON.stringify( _this.encoder_settings ) );
@@ -562,7 +565,7 @@
563566 _this.formData[ 'wpSourceType' ] = 'upload';
564567 _this.formData[ 'action' ] = 'submit';
565568 //wpUploadFile is set by firefogg
566 - delete _this.formData[ 'wpUploadFile' ];
 569+ delete _this.formData[ 'file' ];
567570
568571 _this.fogg.post( _this.editForm.action, 'wpUploadFile', JSON.stringify( _this.formData ) );
569572 //update upload status:
@@ -606,7 +609,7 @@
607610 var apiResult = eval( response_text );
608611 }catch(e){
609612 var apiResult = null;
610 - }
 613+ }
611614 }
612615 if(apiResult && _this.apiUpdateErrorCheck( apiResult ) === false){
613616 //stop status update we have an error
@@ -621,14 +624,13 @@
622625 //loop to get new status if still uploading (could also be encoding if we are in chunk upload mode)
623626 if( _this.fogg.state == 'encoding' || _this.fogg.state == 'uploading') {
624627 setTimeout(uploadStatus, 100);
625 -
626628 }//check upload state
627629 else if( _this.fogg.state == 'upload done' ||
628630 _this.fogg.state == 'done' ||
629631 _this.fogg.state == 'encoding done' ) {
630632 //if in "post" upload mode read the html response (should be depricated):
631633 if( _this.upload_mode == 'api' ){
632 - if( apiResult.resultUrl ){
 634+ if( apiResult && apiResult.resultUrl ){
633635 var buttons ={};
634636 buttons[gM('mwe-go-to-resource')] = function(){
635637 window.location = apiResult.resultUrl;
@@ -686,10 +688,10 @@
687689 procPageResponse:function( result_page ){
688690 var _this = this;
689691 js_log('f:procPageResponse');
690 - var sstring = 'var wgTitle = "' + this.formData['wpDestFile'].replace('_',' ');
 692+ var sstring = 'var wgTitle = "' + this.formData['filename'].replace('_',' ');
691693
692694 if(wgArticlePath){
693 - var result_txt = gM('mwe-upload_done', wgArticlePath.replace(/\$1/, 'File:' + _this.formData['wpDestFile'] ) );
 695+ var result_txt = gM('mwe-upload_done', wgArticlePath.replace(/\$1/, 'File:' + _this.formData['filename'] ) );
694696 }else{
695697 result_txt = 'File has uploaded but api "done" URL was provided. Check the log for result page output';
696698 }
Index: trunk/phase3/js2/mwEmbed/libAddMedia/remoteSearchDriver.js
@@ -34,10 +34,8 @@
3535 "mwe-results_from" : "Results from <a href=\"$1\" target=\"_new\" >$2<\/a>",
3636 "mwe-missing_desc_see_source" : "This asset is missing a description. Please see the [$1 orginal source] and help describe it.",
3737 "rsd_config_error" : "Add media wizard configuration error: $1",
38 -
3938 "mwe-your_recent_uploads" : "Your recent uploads",
4039 "mwe-upload_a_file" : "Upload a new file",
41 -
4240 "mwe-resource_page_desc" : "Resource page description:",
4341 "mwe-edit_resource_desc" : "Edit wiki text resource description:",
4442 "mwe-local_resource_title" : "Local resource title:",
Index: trunk/phase3/js2/mwEmbed/libAddMedia/simpleUploadForm.js
@@ -55,10 +55,10 @@
5656
5757 //form name set:
5858 '<label for="wpUploadFile">' + gM('mwe-select_file') + '</label><br>'+
59 - '<input type="file" style="display: inline;" name="wpUploadFile" size="15"/><br>' +
 59+ '<input id="wpUploadFile" type="file" style="display: inline;" name="wpUploadFile" size="15"/><br>' +
6060
6161 '<label for="wpDestFile">' +gM('mwe-destfilename') + '</label><br>'+
62 - '<input type="text" name="wpDestFile" size="30" /><br>'+
 62+ '<input type="text" id="wpDestFile" name="wpDestFile" size="30" /><br>'+
6363
6464 '<label for="wpUploadDescription">' + gM('mwe-summary') + ':</label><br>' +
6565 '<textarea cols="30" rows="3" name="wpUploadDescription" tabindex="3"/><br>'+
@@ -124,7 +124,7 @@
125125
126126 //set up the binding per the config
127127 if( opt.enable_fogg ){
128 - $j("#suf-upload [name='wpUploadFile']").firefogg({
 128+ $j("#wpUploadFile").firefogg({
129129 //an api url (we won't submit directly to action of the form)
130130 'api_url' : opt.api_target,
131131 'form_rewrite': true,
Index: trunk/phase3/js2/mwEmbed/libAddMedia/mvBaseUploadInterface.js
@@ -39,8 +39,8 @@
4040 'done_upload_cb': null,
4141 'target_edit_from':null,
4242
43 - //upload_mode can be 'post', 'api' or 'autodetect'. (autodetect issues an api call)
44 - 'upload_mode': 'autodetect'
 43+ //default upload mode is 'api' but if no api_url will try tp post
 44+ 'upload_mode': 'api'
4545
4646 }
4747 var mvBaseUploadInterface = function( iObj ){
@@ -72,13 +72,19 @@
7373 //set up the local pointer to the edit form:
7474 _this.editForm = _this.getEditForm();
7575 if( _this.editForm ){
 76+
 77+ //if in api re-map the upload form to api: (we have to do this BEFORE the users selects a file)
 78+ if(_this.upload_mode == 'api'){
 79+ _this.doRemapFormToApi();
 80+ }
 81+
7682 //set up the org_onsubmit if not set:
7783 if( typeof( _this.org_onsubmit ) == 'undefined' && _this.editForm.onsubmit )
7884 _this.org_onsubmit = _this.editForm.onsubmit;
7985
8086 //set up the submit action:
8187 $j( _this.editForm ).submit( function(){
82 - js_log('j.onSubmit');
 88+ js_log('setupForm.onSubmit:');
8389 //run the original onsubmit (if not run yet set flag to avoid excessive chaining )
8490 if( typeof( _this.org_onsubmit ) == 'function' ){
8591 if( ! _this.org_onsubmit() ){
@@ -92,6 +98,7 @@
9399 return true;
94100 }
95101 //get the input form data in flat json:
 102+ js_log('update formData::');
96103 var tmpAryData = $j( _this.editForm ).serializeArray();
97104 for(var i=0; i < tmpAryData.length; i++){
98105 if( tmpAryData[i]['name'] )
@@ -105,10 +112,10 @@
106113 //for some unknown reason we have to drop down the #p-search z-index:
107114 $j('#p-search').css('z-index', 1);
108115
109 - //select upload mode:
 116+ //select upload mode:
110117 _this.detectUploadMode();
111118 }catch(e){
112 -
 119+ js_log('::error in dispProgressOverlay or detectUploadMode');
113120 }
114121
115122 //don't submit the form we will do the post in ajax
@@ -119,14 +126,15 @@
120127 },
121128 detectUploadMode:function( callback ){
122129 var _this = this;
 130+ js_log('detectUploadMode::' + _this.upload_mode);
123131 //check the upload mode:
124132 if( _this.upload_mode == 'autodetect' ){
125133 js_log('detectUploadMode::' + _this.upload_mode + ' api:' + _this.api_url);
126134 if( ! _this.api_url )
127135 return js_error( 'Error: can\'t autodetect mode without api url' );
128136 do_api_req( {
129 - 'data':{ 'action':'paraminfo','modules':'upload' },
130 - 'url' :_this.api_url
 137+ 'data': { 'action' : 'paraminfo', 'modules' : 'upload' },
 138+ 'url' : _this.api_url
131139 }, function(data){
132140 if( typeof data.paraminfo == 'undefined' || typeof data.paraminfo.modules == 'undefined' )
133141 return js_error( 'Error: bad api results' );
@@ -153,6 +161,37 @@
154162 _this.doUploadSwitch();
155163 }
156164 },
 165+ //@@NOTE this could probably be depricated to just have a special:upload page that uses api keys?
 166+ // or maybe its usefull to seperate js and non-js submits
 167+ doRemapFormToApi:function(){
 168+ var _this = this;
 169+ if( !_this.api_url )
 170+ return false;
 171+
 172+ //add the action api
 173+ $j(_this.editForm).attr('action', _this.api_url);
 174+
 175+ //add api url
 176+ //add api action:
 177+ if( $j(_this.editForm).find("[name='action']").length == 0)
 178+ $j(_this.editForm).append('<input type="hidden" name="action" value="upload">');
 179+
 180+ //add json format
 181+ if( $j(_this.editForm).find("[name='format']").length == 0)
 182+ $j(_this.editForm).append('<input type="hidden" name="format" value="jsonfm">');
 183+
 184+ //map a new hidden form
 185+ $j(_this.editForm).find("[name='wpUploadFile']").attr('name', 'file');
 186+ $j(_this.editForm).find("[name='wpDestFile']").attr('name', 'filename');
 187+ $j(_this.editForm).find("[name='wpUploadDescription']").attr('name', 'comment');
 188+ $j(_this.editForm).find("[name='wpEditToken']").attr('name', 'token');
 189+ $j(_this.editForm).find("[name='wpIgnoreWarning']").attr('name', 'ignorewarnings');
 190+ $j(_this.editForm).find("[name='wpWatchthis']").attr('name', 'watch');
 191+
 192+ //update the status to 100% progress bar (no status in iframe submit)
 193+ $j('#up-progressbar' ).progressbar( 'value', parseInt( 100 ) );
 194+ $j('#up-status-container').html( gM('mwe-upload-in-progress') );
 195+ },
157196 doUploadSwitch:function(){
158197 var _this = this;
159198 js_log('mvUPload:doUploadSwitch():' + _this.upload_mode);
@@ -165,61 +204,46 @@
166205 );
167206 //do normal post
168207 _this.form_post_override = true;
 208+ js_log('doUploadSwitch:: submit call');
169209 //do the submit :
170210 _this.editForm.submit();
171211 }else if(
172 - _this.upload_mode=='api' &&
 212+ _this.upload_mode == 'api' &&
173213 ( $j('#wpSourceTypeFile').length == 0 || $j('#wpSourceTypeFile').get(0).checked )
174214 ){
175215 //@@TODO check for sendAsBinnary to support firefox 3.5 progress
176216
177 - //set the form target to iframe target:
178 - _this.iframeId = 'f_' + ($j('iframe').length + 1);
179 - $j(_this.editForm).attr('target', _this.iframeId);
180 -
 217+ //set the form target to iframe target:
 218+ _this.iframeId = 'f_' + ($j('iframe').length + 1);
181219 //add the iframe
182220 $j("body").append('<iframe src="javascript:false;" id="' + _this.iframeId + '" ' +
183 - 'name="' + _this.iframeId + '" style="display:none;" ></iframe>');
 221+ 'name="' + _this.iframeId + '" style="display:none;" ></iframe>');
 222+ $j(_this.editForm).attr('target', _this.iframeId);
184223
185224 //set up the done binding
186225 $j('#' + _this.iframeId).load(function(){
187226 _this.proccessIframeResult( $j(this).get(0) );
188227 });
189 -
190 - //set the editForm iframe target
191 - //$j(_this.editForm).attr('target', id);
192 -
193228 //set the action to the api url:
194229 $j(_this.editForm).attr('action', _this.api_url );
195 - //add api action:
196 - if( $j(_this.editForm).find("[name='action']").length == 0)
197 - $j(_this.editForm).append('<input type="hidden" name="action" value="upload">');
198 -
199 - //add json format
200 - if( $j(_this.editForm).find("[name='format']").length == 0)
201 - $j(_this.editForm).append('<input type="hidden" name="format" value="jsonfm">');
202 -
203 - //map the form vars to api vars:
204 - $j(_this.editForm).find("[name='wpUploadFile']").attr('name', 'file');
205 - $j(_this.editForm).find("[name='wpDestFile']").attr('name', 'filename');
206 - $j(_this.editForm).find("[name='wpUploadDescription']").attr('name', 'comment');
207 - $j(_this.editForm).find("[name='wpEditToken']").attr('name', 'token');
208 - $j(_this.editForm).find("[name='wpIgnoreWarning']").attr('name', 'ignorewarnings');
209 - $j(_this.editForm).find("[name='wpWatchthis']").attr('name', 'watch');
210 -
211 - //update the status to 100% progress bar (no status in iframe submit)
212 - $j('#up-progressbar' ).progressbar('value', parseInt( 100 ) );
213 - $j('#up-status-container').html( gM('mwe-upload-in-progress') );
214 -
215 - js_log('do iframe form submit to: ' + $j(_this.editForm).attr('target'));
216 -
 230+
 231+ js_log('do iframe form submit to: ' + $j(_this.editForm).attr('target')
 232+ + ' destName:' + $j(_this.editForm).find("[name='filename']").val() );
 233+
 234+
217235 //do post override
218236 _this.form_post_override = true;
219237 //reset the done with action flag:
220238 _this.action_done = false;
 239+
 240+ js_log('run editForm submit()');
 241+ var tmpAryData = $j('#mw-upload-form' ).serializeArray();
 242+ for(var i=0; i < tmpAryData.length; i++){
 243+ if( tmpAryData[i]['name'] )
 244+ js_log('name: ' + tmpAryData[i]['name'] + ' = ' + tmpAryData[i]['value']);
 245+ }
 246+ $j('#mw-upload-form').submit();
221247
222 - _this.editForm.submit();
223 -
224248 return false;
225249 }else if( _this.upload_mode == 'api' && $j('#wpSourceTypeURL').get(0).checked){
226250 js_log('doHttpUpload (no form submit) ');
@@ -263,6 +287,7 @@
264288 } else if (doc.body){
265289 // get the json str:
266290 json_str = $j(doc.body).find('pre').html();
 291+ js_log('iframe:json::' + json_str + "\nbody:" + $j(doc.body).html() );
267292 //htmlentties
268293 if (json_str) {
269294 response = window["eval"]("(" +json_str + ")");
@@ -329,14 +354,14 @@
330355 });
331356 },
332357 doAjaxUploadStatus:function() {
333 - var _this = this;
334 -
 358+ var _this = this;
 359+
335360 //set up the progress display for status updates:
336361 _this.dispProgressOverlay();
337362 var req = {
338 - 'action' : 'upload',
339 - 'httpstatus' : 'true',
340 - 'sessionkey' : _this.upload_session_key
 363+ 'action' : 'upload',
 364+ 'httpstatus' : 'true',
 365+ 'sessionkey' : _this.upload_session_key
341366 };
342367 //add token if present:
343368 if(this.etoken)
@@ -540,6 +565,7 @@
541566 _this.warnings_sessionkey = apiRes.upload.warnings.sessionkey;
542567 var bObj = {};
543568 bObj[ gM('mwe-ignorewarning') ] = function() {
 569+ js_log('ignorewarning req:')
544570 //re-inciate the upload proccess
545571 $j('#wpIgnoreWarning').attr('checked', true);
546572 $j( '#mw-upload-form' ).submit();
@@ -556,7 +582,7 @@
557583 },
558584 processApiResult: function( apiRes ){
559585 var _this = this;
560 - js_log('processApiResult::');
 586+ js_log('processApiResult::');
561587 //check for upload api error:
562588 // {"upload":{"result":"Failure","error":"unknown-error","code":{"status":5,"filtered":"NGC2207%2BIC2163.jpg"}}}
563589 if( _this.apiUpdateErrorCheck(apiRes) === false){
@@ -637,6 +663,7 @@
638664 /*update to jQuery.ui progress display type */
639665 dispProgressOverlay:function(){
640666 var _this = this;
 667+
641668 //remove old instance:
642669 if($j('#upProgressDialog').length!=0){
643670 $j('#upProgressDialog').dialog( 'destroy' ).remove();
@@ -706,25 +733,27 @@
707734 */
708735 $.fn.doDestCheck = function( opt ){
709736 var _this = this;
710 - var destFile = this.selector;
 737+ js_log('doDestCheck::' + _this.selector);
 738+
711739 //set up option defaults;
712740 if(!opt.warn_target)
713741 opt.warn_target = '#wpDestFile-warning';
714742
715743 //empty target warn:
716 - $j(opt.warn_target).empty();
717 -
718 - //show loading
719 - $j(destFile).after('<img id = "mw-spinner-wpDestFile" src ="'+ stylepath + '/common/images/spinner.gif" />');
 744+ $j( opt.warn_target ).empty();
 745+
 746+ //show loading
 747+ $j( _this.selector ).append('<img id="mw-spinner-wpDestFile" src ="'+ stylepath + '/common/images/spinner.gif" />');
 748+
720749 //try and get a thumb of the current file (check its destination)
721750 do_api_req({
722751 'data':{
723 - 'titles': 'File:' + $j(destFile).val(),//@@todo we may need a more clever way to get a the filename
 752+ 'titles': 'File:' + $j(_this.selector).val(),//@@todo we may need a more clever way to get a the filename
724753 'prop': 'imageinfo',
725754 'iiprop':'url|mime|size',
726755 'iiurlwidth': 150
727756 }
728 - },function(data){
 757+ },function(data){
729758 //remove spinner:
730759 $j('#mw-spinner-wpDestFile').remove();
731760 if(data && data.query && data.query.pages){
Index: trunk/phase3/js2/mwEmbed/mv_embed.js
@@ -842,7 +842,7 @@
843843 var sElm = $j(this.selector).get(0);
844844 if(sElm['firefogg']){
845845 if(sElm['firefogg']=='loading'){
846 - js_log("Error: called firefogg operations on Firefogg selector that is not done loading");
 846+ js_log("Error: called firefogg operations on Firefogg selector that is not done loading");
847847 return false;
848848 }
849849 //update properties:
@@ -887,7 +887,7 @@
888888 }else{
889889 var myFogg = new mvFirefogg( iObj );
890890 }
891 - if(myFogg){
 891+ if(myFogg){
892892 myFogg.doRewrite( callback );
893893 var selectorElement = $j( iObj.selector ).get(0);
894894 selectorElement['firefogg']=myFogg;
Index: trunk/phase3/js2/mwEmbed/libEmbedVideo/embedVideo.js
@@ -45,11 +45,11 @@
4646 "mwe-ogg-player-selected" : "(selected)",
4747 "mwe-ogg-player-omtkplayer" : "OMTK Flash Vorbis",
4848 "mwe-generic_missing_plugin" : "You browser does not appear to support the following playback type: <b>$1<\/b><br \/>Visit the <a href=\"http:\/\/commons.wikimedia.org\/wiki\/Commons:Media_help\">Playback Methods<\/a> page to download a player.<br \/>",
49 - "mwe-for_best_experience" : "For a better video playback experience we recommend: <b><a href=\"http:\/\/www.mozilla.com\/en-US\/firefox\/upgrade.html?from=mwEmbed\">Firefox 3.5<\/a>.<\/b>",
 49+ "mwe-for_best_experience" : "For a better video playback experience we recommend:<br \/><b><a href=\"http:\/\/www.mozilla.com\/en-US\/firefox\/upgrade.html?from=mwEmbed\">Firefox 3.5<\/a>.<\/b>",
5050 "mwe-do_not_warn_again" : "Dissmiss for now.",
5151 "mwe-playerselect" : "Players",
5252 "mwe-read_before_embed" : "Please <a href=\"http:\/\/mediawiki.org\/wiki\/Security_Notes_on_Remote_Embedding\" target=\"_new\">Read This<\/a> before embeding!",
53 - "mwe-embed_site_or_blog" : "Embed on your site or blog",
 53+ "mwe-embed_site_or_blog" : "Embed on your site or blog",
5454 "mwe_related_videos" : "Related Videos"
5555 });
5656
@@ -1094,14 +1094,14 @@
10951095 var _this = this;
10961096 js_log('switch video Relational' );
10971097 var reqObj = {
1098 - 'action':'query',
1099 - 'titles': this.wikiTitleKey,
1100 - 'generator':'categories'
 1098+ 'action' : 'query',
 1099+ 'titles' : this.wikiTitleKey,
 1100+ 'generator' : 'categories'
11011101 };
11021102 var req_categories= new Array();
11031103 do_api_req( {
1104 - 'data':reqObj,
1105 - 'url': commons_api_url
 1104+ 'data' : reqObj,
 1105+ 'url' : commons_api_url
11061106 }, function(data){
11071107 req_categories = Array();
11081108 if(data.query && data.query.pages){
@@ -1133,8 +1133,6 @@
11341134 }, function(data){
11351135 //empty the videos:
11361136 $j('#dc_'+ _this.id + ' .related_vids ul').html(' ');
1137 - var leyenda="";
1138 - var titule="";
11391137
11401138 for(var j in data.query.pages){
11411139 //setup poster default:
@@ -1152,17 +1150,15 @@
11531151 var liout = '<li>' +
11541152 '<a href="' + descriptionurl + '" >' +
11551153 '<img src="' + local_poster + '">' +
1156 - '</a>' +
1157 - '<div>' +
1158 - '<a title="' + title_str + '" target="_blank" ' +
1159 - 'href="'+ descriptionurl +'">' + title_str + '</a>' +
1160 - '</div>' +
 1154+ '</a>' +
 1155+ ' <a title="' + title_str + '" target="_blank" ' +
 1156+ 'href="'+ descriptionurl +'">' + title_str + '</a>' +
11611157 '</li>';
11621158 $j('#dc_'+ _this.id + ' .related_vids ul').append(liout) ;
11631159 }
11641160 }
11651161 };
1166 - js_log( 'content: ' + $j('#dc_'+ _this.id + ' .related_vids ul').html() );
 1162+ //js_log( 'content: ' + $j('#dc_'+ _this.id + ' .related_vids ul').html() );
11671163 }); //end do_api_req
11681164 };
11691165 },
@@ -1378,7 +1374,7 @@
13791375 time_req + '\'); return false; "';
13801376 }
13811377 html+=' title="' + title_msg + '">' +
1382 - gM(link_type+'_clip_msg') +
 1378+ gM('mwe-' + link_type+'_clip_msg') +
13831379 '</a><br><span style="font-size:small">'+ title_msg +'<span></p>';
13841380 }
13851381 }
Index: trunk/phase3/js2/uploadPage.js
@@ -7,8 +7,7 @@
88 });
99 var mwUploadFormTarget = '#mw-upload-form';
1010 //set up the upoload form bindings once all dom manipluation is done
11 -var mwUploadHelper = {
12 - firefogg_installed:false,
 11+var mwUploadHelper = {
1312 init:function(){
1413 var _this = this;
1514 //if not boolean false set to true:
@@ -23,21 +22,13 @@
2423 'form_rewrite': true,
2524 'target_edit_from' : mwUploadFormTarget,
2625 'new_source_cb' : function( orgFilename, oggName ){
27 - if($j('#wpDestFile').val() == "")
28 - $j('#wpDestFile').val( oggName );
29 - $j('#wpDestFile').doDestCheck({
30 - 'warn_target':'#wpDestFile-warning'
31 - });
32 - },
33 - 'detect_cb':function( fogg_installed ){
34 - if(fogg_installed){
35 - _this.firefogg_installed=true;
36 - }else{
37 - _this.firefogg_installed=false;
38 - }
39 - }
40 - });
41 -
 26+ if($j('#wpDestFile').val() == "")
 27+ $j('#wpDestFile').val( oggName );
 28+ $j('#wpDestFile').doDestCheck({
 29+ 'warn_target':'#wpDestFile-warning'
 30+ });
 31+ }
 32+ });
4233 }else{
4334 //Add basic upload profile support ( http status monitoring, progress box for browsers that support it etc.)
4435 if($j('#wpUploadFileURL').length != 0){
@@ -51,7 +42,7 @@
5243 if( wgAjaxUploadDestCheck ){
5344 //do destination check:
5445 $j('#wpDestFile').change(function(){
55 - $j(this).doDestCheck({
 46+ $j('#wpDestFile').doDestCheck({
5647 'warn_target':'#wpDestFile-warning'
5748 });
5849 });

Status & tagging log