r50057 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r50056‎ | r50057 | r50058 >
Date:23:37, 29 April 2009
Author:dale
Status:deferred
Tags:
Comment:
upload fixes
Modified paths:
  • /trunk/extensions/MetavidWiki/skins/mv_embed/example_usage/sample_smil.smil.xml (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/example_usage/sample_xspf.xml (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/libAddMedia/mvFirefogg.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/libAddMedia/mvUploader.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/libAddMedia/remoteSearchDriver.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/libClipEdit/mvClipEdit.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/libSequencer/mvSequencer.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/mv_embed.js (modified) (history)

Diff [purge]

Index: trunk/extensions/MetavidWiki/skins/mv_embed/example_usage/sample_xspf.xml
@@ -11,7 +11,7 @@
1212 knobs in there, you've got sand. in. and try to. do a picture. on. etch-a-sketch
1313 gone gone to. china. I mean, they're all gone
1414 </annotation>
15 - <location>http://128.114.20.64/media/senate_11-14-05.ogg?t=0:42:14/0:42:56</location>
 15+ <location>http://metavidstorage01.ucsc.edu/media/senate_11-14-05.ogg?t=0:42:14/0:42:56</location>
1616 <image>http://metavid.org/w/index.php?action=ajax&amp;rs=mv_frame_server&amp;stream_id=14&amp;t=0:42:00&amp;size=400x300</image>
1717 <info>http://metavid.ucsc.edu/overlay/video_player/webview?stream_name=senate_11-14-05&amp;t=0:42:14/0:42:56</info>
1818 </track>
@@ -19,7 +19,7 @@
2020 <title>we know better</title>
2121 <annotation>&lt;b&gt;Byran Dorgan:&lt;/b&gt;that 1.4 trillion in combined debut we know better than that we know what to do
2222 </annotation>
23 - <location>http://128.114.20.64/media/senate_proceeding_02-10-06.ogg?t=01:30:59/01:31:24</location>
 23+ <location>http://metavidstorage01.ucsc.edu/media/senate_proceeding_02-10-06.ogg?t=01:30:59/01:31:24</location>
2424 <image>http://metavid.org/w/index.php?action=ajax&amp;rs=mv_frame_server&amp;stream_name=senate_proceeding_02-10-06&amp;t=1:30:59&amp;size=400x300</image>
2525 <info>http://metavid.ucsc.edu/overlay/video_player/webview?stream_name=senate_proceeding_02-10-06&amp;t=01:30:59/01:31:24</info>
2626 </track>
@@ -27,7 +27,7 @@
2828 <title>random clip</title>
2929 <annotation>example annotation
3030 </annotation>
31 - <location>http://128.114.20.64/media/senate_11-14-05.ogg?t=0:44:14/0:45:56</location>
 31+ <location>http://metavidstorage01.ucsc.edu/media/senate_11-14-05.ogg?t=0:44:14/0:45:56</location>
3232 <image>http://metavid.org/w/index.php?action=ajax&amp;rs=mv_frame_server&amp;stream_name=senate_proceeding_06-08-06&amp;t=0:44:14&amp;size=400x300</image>
3333 <info>http://metavid.ucsc.edu/overlay/video_player/webview?stream_name=senate_proceeding_06-08-06&amp;t=0:44:14/0:45:56</info>
3434 </track>
Index: trunk/extensions/MetavidWiki/skins/mv_embed/example_usage/sample_smil.smil.xml
@@ -28,14 +28,14 @@
2929 transOut="xFade"
3030 type="video/ogg"
3131 fill="transition"
32 - dur="12s"
 32+ dur="7s"
3333 poster="sample_fish.jpg"/>
3434
35 - <video src="sample_eclipse.ogg?t=0:0:0/0:0:06"
 35+ <video src="sample_jellyfish.ogg?t=0:0:0/0:0:10"
3636 region="video_region"
3737 fill="transition"
3838 type="video/ogg"
39 - poster="sample_eclipse.jpg"/>
 39+ poster="sample_jellyfish.jpg"/>
4040 </seq>
4141 </body>
4242 </smil>
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libAddMedia/mvFirefogg.js
@@ -3,31 +3,29 @@
44 */
55
66 loadGM( {
7 - "mv_upload_done" : "Your upload <i>should be<\/i> accessible <a href=\"$1\">here<\/a>",
 7+ "mv_upload_done" : "Your upload <i>should be<\/i> accessible <a href=\"$1\">here<\/a>",
88 "mv_upload_completed" : "Upload Completed"
99 });
1010
1111 var default_firefogg_options = {
1212 'upload_done_action':'redirect',
13 - 'enabled':false,
14 - 'api_url':false
 13+ 'fogg_enabled':false,
 14+ 'api_url':null
1515 }
1616 var mvFirefogg = function(initObj){
1717 return this.init( initObj );
1818 }
19 -mvFirefogg.prototype = {
 19+mvFirefogg.prototype = { //extends mvBaseUploadInterface
2020
2121 min_firefogg_version : '0.9.5',
22 - enabled : false, //if firefogg is enabled or not.
23 - upload_mode:'autodetect', //can be 'post', 'chunks' or autodetect. (autodetect issues an api call)
 22+ fogg_enabled : false, //if firefogg is enabled or not.
2423 encoder_settings:{ //@@todo allow server to set this
2524 'maxSize': 400,
2625 'videoBitrate': 400,
2726 'noUpscaling':true
2827 },
29 - formData:{}, //the form to be submitted
3028
31 - init : function( iObj ){
 29+ init: function( iObj ){
3230 if(!iObj)
3331 iObj = {};
3432 //inherit iObj properties:
@@ -38,10 +36,22 @@
3937 this[i] = default_firefogg_options[i];
4038 }
4139 }
42 - this.setupFirefogg();
 40+ var myBUI = new mvBaseUploadInterface( iObj );
 41+ //standard extends code:
 42+ for(var i in myBUI){
 43+ if(this[i]){
 44+ this['pe_'+ i] = myBUI[i];
 45+ }else{
 46+ this[i] = myBUI[i];
 47+ }
 48+ }
4349 },
44 - setupFirefogg : function(){
 50+ setupForm: function(){
4551 var _this = this;
 52+ //call the parent form setup
 53+ _this.pe_setupForm();
 54+
 55+ //do all firefogg form setup:
4656 if(typeof(Firefogg) == 'undefined'){
4757 $j('#wgfogg_not_installed').show();
4858 return false;
@@ -62,11 +72,11 @@
6373 $j('#wgfogg_installed').hide();
6474 }
6575 //make sure the checkbox accurately reflects the current state per config:
66 - $j('#wgEnableFirefogg').get(0).checked = this.enabled;
 76+ $j('#wgEnableFirefogg').get(0).checked = this.fogg_enabled;
6777
6878 //setup the click bindding:
6979 $j('#wgEnableFirefogg').click( function(){
70 - if( _this.enabled ){
 80+ if( _this.fogg_enabled ){
7181 _this.disable_fogg();
7282 }else{
7383 _this.enable_fogg();
@@ -80,17 +90,16 @@
8191 var _this = this;
8292
8393 //enable the FOGG_TOGGLE
84 - this.enabled=true;
 94+ this.fogg_enabled=true;
8595
8696 //make sure file is "checked"
8797 if($j( '#wpSourceTypeFile' ).length != 0)
8898 $j( '#wpSourceTypeFile' ).get(0).checked = true;
8999
90100 //hide normal file upload stuff
91 - $j( '#wg-base-upload' ).hide();
92 -
 101+ $j( '#wg-base-upload' ).hide();
93102 //setup the form pointer:
94 - _this.editForm = $j( '#mw-upload-form' ).get(0);
 103+ _this.getEditForm();
95104
96105 //show fogg & add click binding:
97106 $j( '#fogg-video-file' ).unbind().show().click( function(){
@@ -100,19 +109,12 @@
101110 disable_fogg:function(){
102111 var _this = this;
103112 //not enabled:
104 - this.enabled=false;
 113+ this.fogg_enabled=false;
105114
106115 $j( '#wg-base-upload' ).show();
107116
108117 //hide any errors warnings and video select:
109 - $j( '#wgfogg_waring_ogg_upload,#wgfogg_waring_bad_extension,#fogg-video-file' ).hide();
110 -
111 - //restore the orignal
112 - if( _this.org_onsubmit ){
113 - _this.editForm.onsubmit = _this.org_onsubmit;
114 - }else{
115 - _this.editForm.onsubmit = function(){ return true; };
116 - }
 118+ $j( '#wgfogg_waring_ogg_upload,#wgfogg_waring_bad_extension,#fogg-video-file' ).hide();
117119 },
118120 fogg_update_progress:function(progress){
119121 $j( '#fogg-progressbar' ).css( 'width', parseInt(progress*100) +'%');
@@ -148,78 +150,30 @@
149151 }
150152 //run the onClick hanndle:
151153 if( toggleFilenameFiller )
152 - toggleFilenameFiller();
153 -
154 - //set up the org_onsubmit if not set:
155 - if( typeof( _this.org_onsubmit ) == 'undefined' )
156 - _this.org_onsubmit = _this.editForm.onsubmit;
157 -
158 - _this.editForm.onsubmit = function() {
159 -
160 - //run the original onsubmit (if not run yet set flag to avoid excessive chaining )
161 - if( typeof( _this.org_onsubmit ) == 'function' ){
162 - if( ! _this.org_onsubmit() ){
163 - //error in org submit return false;
164 - return false;
165 - }
166 - }
167 - //get the input form data in flat json:
168 - var tmpAryData = $j( _this.editForm ).serializeArray();
169 - for(var i=0; i < tmpAryData.length; i++){
170 - if( tmpAryData[i]['name'] )
171 - _this.formData[ tmpAryData[i]['name'] ] = tmpAryData[i]['value'];
172 - }
173 -
174 - //display the loader:
175 - $j('#dlbox-centered,#dlbox-overlay').show();
176 -
177 - //for some unknown reason we have to drop down the #p-search z-index:
178 - $j('#p-search').css('z-index', 1);
179 -
180 - //select upload mode:
181 - _this.doUploadSwitch();
182 - //don't submit the form (firefogg will handle that)
183 - return false;
184 - }
 154+ toggleFilenameFiller();
185155 }
186156 },
187 - doUploadSwitch:function(){
 157+ getProgressTitle:function(){
 158+ //return the parent if we don't have fogg turned on:
 159+ if(! this.fogg_enabled )
 160+ return this.pe_getProgressTitle();
 161+
 162+ return gM('upload-transcode-in-progress');
 163+ },
 164+ doUploadSwitch:function(){
188165 var _this = this;
189 - //check the upload mode:
190 - if( _this.upload_mode == 'autodetect' ){
191 - if( ! _this.api_url )
192 - return js_error( 'Error: can\'t autodetect mode without api url' );
193 - do_api_req( {
194 - 'data':{ 'action':'paraminfo','modules':'upload' },
195 - 'url':_this.api_url
196 - }, function(data){
197 - if( typeof data.paraminfo == 'undefined' || typeof data.paraminfo.modules == 'undefined' )
198 - return js_error( 'Error: bad api results' );
199 - if( typeof data.paraminfo.modules[0].classname == 'undefined'){
200 - js_log( 'Autodetect Upload Mode: \'post\' ');
201 - _this.upload_mode = 'post';
202 - }else{
203 - for( var i in data.paraminfo.modules[0].parameters ){
204 - var pname = data.paraminfo.modules[0].parameters[i].name;
205 - if( pname == 'enablechunks' ){
206 - js_log( 'Autodetect Upload Mode: chunks ' );
207 - _this.upload_mode = 'chunks';
208 - break;
209 - }
210 - }
211 - if( _this.upload_mode != 'chunks'){
212 - return js_error('Upload API without chunks param is not supported');
213 - }
214 - }
215 - _this.doUploadSwitch();
216 - });
217 - }else if( _this.upload_mode == 'post') {
 166+ //make sure firefogg is enabled otherwise do parent UploadSwich:
 167+ if( ! this.fogg_enabled )
 168+ return _this.pe_doUploadSwitch();
 169+
 170+ //check what mode to use firefogg in:
 171+ if( _this.upload_mode == 'post' ){
218172 _this.doEncUpload();
219 - }else if( _this.upload_mode == 'chunks'){
 173+ }else if( _this.upload_mode == 'api' && _this.chunks_supported){ //if api mode and chunks supported do chunkUpload
220174 _this.doChunkUpload();
221 - }else{
 175+ }else{
222176 js_error( 'Error: unrecongized upload mode: ' + _this.upload_mode );
223 - }
 177+ }
224178 },
225179 //doChunkUpload does both uploading and encoding at the same time and uploads one meg chunks as they are ready
226180 doChunkUpload : function(){
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libAddMedia/remoteSearchDriver.js
@@ -833,13 +833,13 @@
834834
835835 $j('#rsd_edit_img').remove();//remove any existing rsd_edit_img
836836
837 - //left side holds the image right size the controls /
 837+ //left side holds the image right size the controls /
838838 $j(rsdElement).clone().attr('id', 'rsd_edit_img').appendTo('#clip_edit_disp').css({
839839 'position':'absolute',
840840 'top':'40%',
841841 'left':'20%',
842842 'opacity':0
843 - });
 843+ });
844844
845845
846846 //assume we keep aspect ratio for the thumbnail that we clicked:
@@ -857,9 +857,11 @@
858858 'height': parseInt( tRatio * maxWidth) + 'px'
859859 }, "slow"); // do it slow to give it a chance to finish loading the HQ version
860860
861 - _this.loadHQImg(rObj, {'width':maxWidth}, 'rsd_edit_img', function(){
862 - $j('.mv_img_loader').remove();
863 - });
 861+ if( mediaType == 'image' ){
 862+ _this.loadHQImg(rObj, {'width':maxWidth}, 'rsd_edit_img', function(){
 863+ $j('.mv_img_loader').remove();
 864+ });
 865+ }
864866 //also fade in the container:
865867 $j('#rsd_resource_edit').animate({
866868 'opacity':1,
@@ -916,15 +918,15 @@
917919 'control_ct': 'clip_edit_ctrl',
918920 'media_type': mediaType,
919921 'p_rsdObj': _this
920 - };
921 - var loadLibs = {'mvClipEdit':'libClipEdit/mvClipEdit.js'};
 922+ };
 923+ var clibs = {'mvClipEdit':'libClipEdit/mvClipEdit.js'};
922924 if( mediaType == 'image'){
923925 //load the crop library:
924926 //loadLibs['$j.Jcrop']='jquery/plugins/Jcrop/js/jquery.Jcrop.js';
925927 //@@todo integrate css calls into mvJsLoader or move jcrop css
926928 //loadExternalCss( mv_embed_path + 'jquery/plugins/Jcrop/css/jquery.Jcrop.css');
927929 //display the mvClipEdit obj once we are done loading:
928 - mvJsLoader.doLoad( loadLibs,function(){
 930+ mvJsLoader.doLoad( clibs,function(){
929931 //run the image clip tools
930932 _this.cEdit = new mvClipEdit( mvClipInit );
931933 });
@@ -935,15 +937,15 @@
936938 rObj.pSobj.getEmbedHTML( rObj, {id:'embed_vid'})
937939 );
938940 //rewrite by id handldes getting any libs we are missing:
939 - rewrite_by_id('embed_vid',function(){
940 - //hide the rsd_edit_img:
941 - $j('#rsd_edit_img').hide();
 941+ rewrite_by_id('embed_vid',function(){
942942 //grab any information that we got from the ROE xml or parsed from the media file
943943 rObj = rObj.pSobj.getEmbedObjParsedInfo( rObj, 'embed_vid' );
944 - //add the re-sizable to the doLoad request:
945 - loadLibs['$j.ui.resizable'] = 'jquery/jquery.ui-1.5.2/ui/minified/ui.resizable.min.js',
946 - loadLibs['$j.fn.hoverIntent'] = 'jquery/plugins/jquery.hoverIntent.js';
947 - mvJsLoader.doLoad( loadLibs,function(){
 944+ //add the re-sizable to the doLoad request:
 945+ clibs['$j.ui.resizable'] ='jquery/jquery.ui-1.5.2/ui/minified/ui.resizable.min.js';
 946+ clibs['$j.fn.hoverIntent'] ='jquery/plugins/jquery.hoverIntent.js';
 947+ mvJsLoader.doLoad(clibs, function(){
 948+ //make sure the rsd_edit_img is hidden:
 949+ $j('#rsd_edit_img').hide();
948950 //run the image clip tools
949951 _this.cEdit = new mvClipEdit( mvClipInit );
950952 });
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libAddMedia/mvUploader.js
@@ -6,7 +6,8 @@
77 loadGM( {
88 "upload-enable-converter" : "Enable video converter (to upload source video not yet converted to theora format) <a href=\"http://commons.wikimedia.org/wiki/Commons:Firefogg\">more info</a>",
99 "upload-fogg_not_installed": "If you want to upload video consider installing <a href=\"http://firefogg.org\">firefogg.org</a>, <a href=\"http://commons.wikimedia.org/wiki/Commons:Firefogg\">more info</a>",
10 - "upload-in-progress":"Doing Transcode & Upload (do not close this window)",
 10+ "upload-transcode-in-progress":"Doing Transcode & Upload (do not close this window)",
 11+ "upload-in-progress": "Upload in Progress (do not close this window)",
1112 "upload-transcoded-status": "Transcoded",
1213 "uploaded-status": "Uploaded",
1314 "upload-select-file": "Select File...",
@@ -66,11 +67,27 @@
6768 });
6869 });
6970 }else{
70 - _this.setupFirefogg();
 71+ //@@could check if firefogg is enabled here:
 72+ _this.setupFirefogg();
 73+ //if only want httpUploadFrom help enable it here:
7174 }
7275 }
7376 );
7477 },
 78+ /**
 79+ * setupBaseUpInterface supports intefaces for progress indication if the browser supports it
 80+ * also sets up ajax progress updates for http posts
 81+ * //pre
 82+ */
 83+ setupBaseUpInterface:function(){
 84+ //check if this feature is not false (we want it on by default (null) instances that don't have the upload api or any modifications)
 85+ this.upForm = new mvBaseUploadInterface( {
 86+ 'api_url' : this.api_url,
 87+ 'parent_uploader': this
 88+ }
 89+ );
 90+ this.upForm.setupForm();
 91+ },
7592 setupFirefogg:function(){
7693 var _this = this;
7794 //add firefogg html if not already there: ( same as $wgEnableFirebug added in SpecialUpload.php )
@@ -93,10 +110,10 @@
94111 };
95112 if( _this.api_url )
96113 intFirefoggObj['api_url'] = _this.api_url;
97 - js_log('new mvFirefogg');
98 - //if firefog is not taking over the submit we can here:
99 - _this.fogg = new mvFirefogg( intFirefoggObj );
100 -
 114+
 115+ js_log('new mvFirefogg extends mvUploader (this)');
 116+ this.fogg = new mvFirefogg( intFirefoggObj );
 117+ this.fogg.setupForm();
101118 },
102119 //same add code as specialUpload if($wgEnableFirefogg){
103120 addFirefoggHtml:function(){
@@ -123,22 +140,171 @@
124141 "<span id='wgfogg_installed' style='display:none' >"+
125142 '<input id="wgEnableFirefogg" type="checkbox" name="wgEnableFirefogg" >' +
126143 gM('upload-enable-converter') +
127 - '</span><br></p>');
128 - //add in loader dl box:
129 - //hard code style (since not always easy to import style sheets)
130 - $j('body').append('<div id="dlbox-centered" class="dlbox-centered" style="display:none;'+
131 - 'position:fixed;background:#DDD;border:3px solid #AAA;font-size:115%;width:40%;'+
132 - 'height:300px;padding: 10px;z-index:100;top:100px;bottom:40%;left:20%;" >'+
133 - '<h5>' + gM('upload-in-progress') + '</h5>' +
134 - '<div id="fogg-pbar-container" style="border:solid thin gray;width:90%;height:15px;" >' +
135 - '<div id="fogg-progressbar" style="background:#AAC;width:0%;height:15px;"></div>' +
136 - '</div>' +
137 - '<span id="fogg-pstatus">0%</span>' +
138 - '<span id="fogg-status-transcode">' + gM('upload-transcoded-status') + '</span>'+
139 - '<span style="display:none" id="fogg-status-upload">' + gM('uploaded-status') + '</span>' +
140 - '</div>' +
141 - '<div id="dlbox-overlay" class="dlbox-overlay" style="display:none;background:#000;cursor:wait;height:100%;'+
142 - 'left:0;top:0;position:fixed;width:100%;z-index:99;filter:alpha(opacity=60);'+
143 - '-moz-opacity: 0.6; opacity: 0.6;" ></div>');
 144+ '</span><br></p>');
144145 }
 146+}
 147+/**
 148+ * the base Upload Interface extended via firefogg
 149+ */
 150+var default_bui_options = {
 151+ 'api_url':null,
 152+ 'parent_uploader':null
 153+}
 154+var mvBaseUploadInterface = function( iObj ){
 155+ return this.init( iObj );
 156+}
 157+mvBaseUploadInterface.prototype = {
 158+ parent_uploader:false,
 159+ formData:{}, //the form to be submitted
 160+ upload_mode:'autodetect', //can be 'post', 'chunks' or autodetect. (autodetect issues an api call)
 161+ chunks_supported:false,
 162+ form_post_override:false,
 163+ init: function( iObj ){
 164+ if(!iObj)
 165+ iObj = {};
 166+ //inherit iObj properties:
 167+ for(var i in default_bui_options){
 168+ if(iObj[i]){
 169+ this[i] = iObj[i];
 170+ }else{
 171+ this[i] = default_bui_options[i];
 172+ }
 173+ }
 174+ },
 175+ setupForm:function(){
 176+ var _this = this;
 177+ //set up the local pointer to the edit form:
 178+ _this.getEditForm();
 179+
 180+ if(_this.editForm){
 181+ //set up the org_onsubmit if not set:
 182+ if( typeof( _this.org_onsubmit ) == 'undefined' )
 183+ _this.org_onsubmit = _this.editForm.onsubmit;
 184+
 185+ //bind the onSubmit the base onSubmit action:
 186+ js_log("should have ...remove org:: " + _this.editForm.onsubmit);
 187+
 188+ //have to define the onsubmit function inline or its hard to pass the "_this" instance
 189+ _this.editForm.onsubmit = function(){
 190+ //run the original onsubmit (if not run yet set flag to avoid excessive chaining )
 191+ if( typeof( _this.org_onsubmit ) == 'function' ){
 192+ if( ! _this.org_onsubmit() ){
 193+ //error in org submit return false;
 194+ return false;
 195+ }
 196+ }
 197+
 198+ //check for post action override:
 199+ if( _this.form_post_override ){
 200+ alert('woudld submit here');
 201+ //return true;
 202+ }
 203+
 204+
 205+ //get the input form data in flat json:
 206+ var tmpAryData = $j( _this.editForm ).serializeArray();
 207+ for(var i=0; i < tmpAryData.length; i++){
 208+ if( tmpAryData[i]['name'] )
 209+ _this.formData[ tmpAryData[i]['name'] ] = tmpAryData[i]['value'];
 210+ }
 211+
 212+ //display the loader:
 213+ _this.dispProgressOverlay();
 214+
 215+ //for some unknown reason we have to drop down the #p-search z-index:
 216+ $j('#p-search').css('z-index', 1);
 217+
 218+ //select upload mode:
 219+
 220+ _this.detectUploadMode();
 221+
 222+ //don't submit the form we will do the post in ajax
 223+ return false;
 224+ };
 225+ }
 226+
 227+ },
 228+ detectUploadMode:function( callback ){
 229+ var _this = this;
 230+ js_log('detectUploadMode::' + _this.upload_mode + ' api:' + _this.api_url);
 231+ //check the upload mode:
 232+ if( _this.upload_mode == 'autodetect' ){
 233+ if( ! _this.api_url )
 234+ return js_error( 'Error: can\'t autodetect mode without api url' );
 235+ do_api_req( {
 236+ 'data':{ 'action':'paraminfo','modules':'upload' },
 237+ 'url':_this.api_url
 238+ }, function(data){
 239+ if( typeof data.paraminfo == 'undefined' || typeof data.paraminfo.modules == 'undefined' )
 240+ return js_error( 'Error: bad api results' );
 241+ if( typeof data.paraminfo.modules[0].classname == 'undefined'){
 242+ js_log( 'Autodetect Upload Mode: \'post\' ');
 243+ _this.upload_mode = 'post';
 244+ }else{
 245+ js_log( 'Autodetect Upload Mode: api ' );
 246+ _this.upload_mode = 'api';
 247+ //make sure chunks are supported:
 248+ for( var i in data.paraminfo.modules[0].parameters ){
 249+ var pname = data.paraminfo.modules[0].parameters[i].name;
 250+ if( pname == 'enablechunks' ){
 251+ js_log( 'this.chunks_supported = true' );
 252+ _this.chunks_supported = true;
 253+ break;
 254+ }
 255+ }
 256+ }
 257+ _this.doUploadSwitch();
 258+ });
 259+ }else{
 260+ _this.doUploadSwitch();
 261+ }
 262+ },
 263+ doUploadSwitch:function(){
 264+ js_log('mvUPload:doUploadSwitch()');
 265+ var _this = this;
 266+ //issue a post req:
 267+ if( _this.upload_mode == 'post' || $j('#wpSourceTypeFile').get(0).checked ){
 268+ //update the status
 269+ $j('#dlbox-centered').html('<h5>' + _this.getProgressTitle() + '</h5>' +
 270+ mv_get_loading_img( 'left:40%;top:20%')
 271+ );
 272+
 273+ //do normal post upload no status indicators (also since its a file I think we have to submit the form)
 274+ _this.form_post_override=true;
 275+ //js_log('run form submit!!');
 276+ _this.editForm.submit();
 277+ }else if( _this.upload_mode == 'api'){
 278+ //do api upload
 279+ }else{
 280+ js_error( 'Error: unrecongized upload mode: ' + _this.upload_mode );
 281+ }
 282+ },
 283+ getProgressTitle:function(){
 284+ return gM('upload-in-progress');
 285+ },
 286+ getEditForm:function(){
 287+ this.editForm = $j( '#mw-upload-form' ).get(0);
 288+ },
 289+ dispProgressOverlay:function(){
 290+ var _this = this;
 291+ //add in loader dl box if not present:
 292+ if( $j('#dlbox-centered').length ==0 ){
 293+ //hard code style (since not always easy to import style sheets)
 294+ $j('body').append('<div id="dlbox-centered" class="dlbox-centered" style="'+
 295+ 'position:fixed;background:#DDD;border:3px solid #AAA;font-size:115%;width:40%;'+
 296+ 'height:300px;padding: 10px;z-index:100;top:100px;bottom:40%;left:20%;" >'+
 297+ '<h5>' + _this.getProgressTitle() + '</h5>' +
 298+ '<div id="fogg-pbar-container" style="border:solid thin gray;width:90%;height:15px;" >' +
 299+ '<div id="fogg-progressbar" style="background:#AAC;width:0%;height:15px;"></div>' +
 300+ '</div>' +
 301+ '<span id="fogg-pstatus">0%</span>' +
 302+ '<span id="fogg-status-transcode">' + gM('upload-transcoded-status') + '</span>'+
 303+ '<span style="display:none" id="fogg-status-upload">' + gM('uploaded-status') + '</span>' +
 304+ '</div>' +
 305+ '<div id="dlbox-overlay" class="dlbox-overlay" style="background:#000;cursor:wait;height:100%;'+
 306+ 'left:0;top:0;position:fixed;width:100%;z-index:99;filter:alpha(opacity=60);'+
 307+ '-moz-opacity: 0.6; opacity: 0.6;" ></div>');
 308+ }
 309+ }
 310+
145311 }
\ No newline at end of file
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libSequencer/mvSequencer.js
@@ -444,7 +444,7 @@
445445 }
446446 },
447447 getLocalApiUrl:function(){
448 - return this.plObj.interface_url.replace(/index\.php/, 'api.php');
 448+ return this.plObj.interface_url;
449449 },
450450 plReadyInit:function(){
451451 var this_seq = this;
@@ -740,7 +740,8 @@
741741 js_log('error: presently we can\'t copy clips across domains');
742742 }else{
743743 if( this_seq.clipboardEditToken ){
744 - var req_url = this_seq.plObj.interface_url + '?action=ajax&rs=mv_seqtool_clipboard&rsargs[]=copy';
 744+ //@@todo we need a api entry point to store a "clipboard"
 745+ var req_url = this_seq.plObj.interface_url.replace(/api.php/, 'index.php') + '?action=ajax&rs=mv_seqtool_clipboard&rsargs[]=copy';
745746 $j.ajax({
746747 type: "POST",
747748 url:req_url,
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libClipEdit/mvClipEdit.js
@@ -192,7 +192,7 @@
193193 'rvprop':'content'
194194 };
195195 //get the interface uri from the plObject
196 - var api_url = _this.p_seqObj.plObj.interface_url.replace(/index\.php/, 'api.php');
 196+ var api_url = _this.p_seqObj.plObj.interface_url;
197197 //first check
198198 do_api_req( {
199199 'data':reqObj,
Index: trunk/extensions/MetavidWiki/skins/mv_embed/mv_embed.js
@@ -1134,7 +1134,7 @@
11351135 //force format to json (if not already set)
11361136 options.data['format'] = 'json';
11371137
1138 - js_log('do api req: ' + options.url +' data' + JSON.stringify( options.data ) );
 1138+ js_log('do api req: ' + options.url +' data' + options.data );
11391139 //build request string:
11401140 if( parseUri( document.URL ).host == parseUri( options.url ).host ){
11411141 //local request do api request directly

Status & tagging log