r55381 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r55380‎ | r55381 | r55382 >
Date:14:06, 20 August 2009
Author:dale
Status:deferred
Tags:
Comment:
* non firefogg add media wizard upload updates (only works once bug noted)
Modified paths:
  • /trunk/phase3/js2/mwEmbed/libAddMedia/mvBaseUploadInterface.js (modified) (history)
  • /trunk/phase3/js2/mwEmbed/libAddMedia/remoteSearchDriver.js (modified) (history)
  • /trunk/phase3/js2/mwEmbed/libAddMedia/simpleUploadForm.js (modified) (history)

Diff [purge]

Index: trunk/phase3/js2/mwEmbed/libAddMedia/remoteSearchDriver.js
@@ -934,7 +934,7 @@
935935 //js_log('getResourceFromId:' + rid );
936936 //strip out /res/ if preset:
937937 rid = rid.replace(/res_/, '');
938 - js_log("looking at: " + rid);
 938+ //js_log("looking at: " + rid);
939939 p = rid.split('_');
940940 var cp_id = p[0];
941941 var rid = p[1];
Index: trunk/phase3/js2/mwEmbed/libAddMedia/simpleUploadForm.js
@@ -86,7 +86,38 @@
8787 $j('#wpUploadBtn').attr('disabled', 'disabled');
8888 }
8989 });
90 -
 90+ //do destination fill:
 91+ //@@should integrate with doDestinationFill on upload page
 92+ $j("[name='wpUploadFile']").change(function(){
 93+ var path = $j(this).val();
 94+ // Find trailing part
 95+ var slash = path.lastIndexOf('/');
 96+ var backslash = path.lastIndexOf('\\');
 97+ var fname;
 98+ if (slash == -1 && backslash == -1) {
 99+ fname = path;
 100+ } else if (slash > backslash) {
 101+ fname = path.substring(slash+1, 10000);
 102+ } else {
 103+ fname = path.substring(backslash+1, 10000);
 104+ }
 105+ fname = fname.charAt(0).toUpperCase().concat(fname.substring(1,10000)).replace(/ /g, '_');
 106+ // Output result
 107+ $j("[name='wpDestFile']").val( fname );
 108+ //do destination check
 109+ $j("[name='wpDestFile']").doDestCheck({
 110+ 'warn_target':'#wpDestFile-warning'
 111+ });
 112+ });
 113+
 114+
 115+ //do destination check:
 116+ $j("[name='wpDestFile']").change(function(){
 117+ $j(this).doDestCheck({
 118+ 'warn_target':'#wpDestFile-warning'
 119+ });
 120+ });
 121+
91122 if(typeof opt.ondone_cb == 'undefined')
92123 opt.ondone_cb = false;
93124
Index: trunk/phase3/js2/mwEmbed/libAddMedia/mvBaseUploadInterface.js
@@ -198,12 +198,12 @@
199199 $j(_this.editForm).append('<input type="hidden" name="format" value="jsonfm">');
200200
201201 //map the form vars to api vars:
202 - $j(_this.editForm).find('#wpUploadFile').attr('name', 'file');
203 - $j(_this.editForm).find('#wpDestFile').attr('name', 'filename');
204 - $j(_this.editForm).find('#wpUploadDescription').attr('name', 'comment');
205 - $j(_this.editForm).find('#wpEditToken').attr('name', 'token');
206 - $j(_this.editForm).find('#wpIgnoreWarning').attr('name', 'ignorewarnings');
207 - $j(_this.editForm).find('#wpWatchthis').attr('name', 'watch');
 202+ $j(_this.editForm).find("[name='wpUploadFile']").attr('name', 'file');
 203+ $j(_this.editForm).find("[name='wpDestFile']").attr('name', 'filename');
 204+ $j(_this.editForm).find("[name='wpUploadDescription']").attr('name', 'comment');
 205+ $j(_this.editForm).find("[name='wpEditToken']").attr('name', 'token');
 206+ $j(_this.editForm).find("[name='wpIgnoreWarning']").attr('name', 'ignorewarnings');
 207+ $j(_this.editForm).find("[name='wpWatchthis']").attr('name', 'watch');
208208
209209 //update the status to 100% progress bar (no status in iframe submit)
210210 $j('#up-progressbar' ).progressbar('value', parseInt( 100 ) );

Status & tagging log