Index: trunk/extensions/MetavidWiki/skins/mv_embed/libAddMedia/searchLibs/mediaWikiSearch.js |
— | — | @@ -200,10 +200,10 @@ |
201 | 201 | } |
202 | 202 | var style_attr = 'style="width:' + outOpt.width + 'px;height:' + outOpt.height +'px"'; |
203 | 203 | var id_attr = (options['id'])?' id = "' + options['id'] +'" ': ''; |
204 | | - |
| 204 | + var cat = rObj; |
205 | 205 | //return the html type: |
206 | 206 | if(rObj.mime.indexOf('image')!=-1){ |
207 | | - return '<img ' + id_attr + ' src="' + rObj.url + '"' + style_attr + ' >'; |
| 207 | + return '<img ' + id_attr + ' src="' + rObj.edit_url + '"' + style_attr + ' >'; |
208 | 208 | } |
209 | 209 | var ahtml=''; |
210 | 210 | if(rObj.mime == 'application/ogg' || rObj.mime == 'audio/ogg'){ |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libAddMedia/seqRemoteSearchDriver.js |
— | — | @@ -28,7 +28,7 @@ |
29 | 29 | var insert_key='na'; |
30 | 30 | var clip_key =''; |
31 | 31 | |
32 | | - //@@todo support multiple tracks |
| 32 | + //@@todo support multiple target tracks |
33 | 33 | $j('.mv_clip_box_result').draggable({ |
34 | 34 | start:function(){ |
35 | 35 | source_pos = $j(this).offset(); |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libAddMedia/remoteSearchDriver.js |
— | — | @@ -325,7 +325,7 @@ |
326 | 326 | var _this = this; |
327 | 327 | var dq = (this.default_query)? this.default_query : ''; |
328 | 328 | var out = '<div class="rsd_control_container" style="width:100%">' + |
329 | | - '<form id="rsd_form" action="" method="GET">'+ |
| 329 | + '<form id="rsd_form" action="javascript:return false;" method="GET">'+ |
330 | 330 | '<table style="width:100%;background-color:transparent;">' + |
331 | 331 | '<tr>'+ |
332 | 332 | '<td style="width:110px">'+ |
— | — | @@ -402,7 +402,7 @@ |
403 | 403 | } |
404 | 404 | }); |
405 | 405 | //set form bindings |
406 | | - $j('#rsd_form').submit(function(){ |
| 406 | + $j('#rsd_form').unbind().submit(function(){ |
407 | 407 | _this.runSearch(); |
408 | 408 | //don't submit the form |
409 | 409 | return false; |
— | — | @@ -453,9 +453,9 @@ |
454 | 454 | //check if we need to update: |
455 | 455 | if( typeof cp.sObj != 'undefined' ){ |
456 | 456 | if(cp.sObj.last_query == $j('#rsd_q').val() && cp.sObj.last_offset == cp.offset){ |
457 | | - js_log('last query is: ' + cp.sObj.last_query + ' matches: ' + $j('#rsd_q').val()); |
| 457 | + js_log('last query is: ' + cp.sObj.last_query + ' matches: ' + $j('#rsd_q').val() ); |
458 | 458 | }else{ |
459 | | - js_log('last query is: ' + cp.sObj.last_query + ' not match: ' + $j('#rsd_q').val()); |
| 459 | + js_log('last query is: ' + cp.sObj.last_query + ' not match: ' + $j('#rsd_q').val() ); |
460 | 460 | draw_direct_flag = false; |
461 | 461 | } |
462 | 462 | }else{ |
— | — | @@ -477,7 +477,7 @@ |
478 | 478 | //this check can be avoided by setting the this.import_url_mode = 'api' | 'form' | insted of 'autodetect' or 'none' |
479 | 479 | checkForCopyURLSupport:function ( callback ){ |
480 | 480 | var _this = this; |
481 | | - js_log('checkForCopyURLSupport'); |
| 481 | + js_log('checkForCopyURLSupport:: ' + wgArticlePath); |
482 | 482 | if( this.import_url_mode == 'autodetect' ){ |
483 | 483 | do_api_req( { |
484 | 484 | 'data':{ 'action':'paraminfo','modules':'upload' }, |
— | — | @@ -489,20 +489,20 @@ |
490 | 490 | $j.ajax({ |
491 | 491 | type: "GET", |
492 | 492 | dataType: 'html', |
493 | | - url: wgArticlePath.replace('$1', 'Special:Upload'), //@@todo may have problems in localized special pages |
| 493 | + url: wgArticlePath.replace( '$1', 'Special:Upload' ), //@@todo may have problems in localized special pages |
494 | 494 | //(could hit meta=siteinfo & specialpagealiases ) |
495 | | - // but might be overkill for now. |
| 495 | + // but might be overkill for now cuz we want to switch to new-upload branch soon. |
496 | 496 | success: function( form_html ){ |
497 | 497 | if( form_html.indexOf( 'wpUploadFileURL' ) != -1){ |
498 | | - _this.import_url_mode= 'form'; |
| 498 | + _this.import_url_mode = 'form'; |
499 | 499 | }else{ |
500 | | - _this.import_url_mode= 'none'; |
| 500 | + _this.import_url_mode = 'none'; |
501 | 501 | } |
502 | 502 | callback(); |
503 | 503 | }, |
504 | 504 | error: function(){ |
505 | 505 | js_log('error in getting Special:Upload page'); |
506 | | - _this.import_url_mode= 'none'; |
| 506 | + _this.import_url_mode = 'none'; |
507 | 507 | callback(); |
508 | 508 | } |
509 | 509 | }); |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libSequencer/mvSequencer.js |
— | — | @@ -129,7 +129,8 @@ |
130 | 130 | }, function(){ |
131 | 131 | this_seq.mySearch = new seqRemoteSearchDriver({ |
132 | 132 | 'p_seq':this_seq, |
133 | | - 'target_id':'cliplib_ic', |
| 133 | + 'target_id':'cliplib_ic', |
| 134 | + 'local_wiki_api_url': this_seq.getLocalApiUrl(), |
134 | 135 | 'instance_name': this_seq.instance_name + '.mySearch' |
135 | 136 | }); |
136 | 137 | this_seq.mySearch.doInitDisplay(); |
— | — | @@ -433,6 +434,9 @@ |
434 | 435 | } |
435 | 436 | } |
436 | 437 | }, |
| 438 | + getLocalApiUrl:function(){ |
| 439 | + return this.plObj.interface_url.replace(/index\.php/, 'api.php'); |
| 440 | + }, |
437 | 441 | plReadyInit:function(){ |
438 | 442 | var this_seq = this; |
439 | 443 | //debugger; |
— | — | @@ -456,10 +460,10 @@ |
457 | 461 | 'intoken':'edit', |
458 | 462 | 'titles': this_seq.plObj.mTitle |
459 | 463 | }; |
460 | | - var api_url = this.plObj.interface_url.replace(/index\.php/, 'api.php'); |
| 464 | + |
461 | 465 | do_api_req( { |
462 | | - 'data':reqObj, |
463 | | - 'url':api_url |
| 466 | + 'data': reqObj, |
| 467 | + 'url' : this_seq.getLocalApiUrl() |
464 | 468 | },function(data){ |
465 | 469 | for(var i in data.query.pages){ |
466 | 470 | if(data.query.pages[i]['edittoken']) |
— | — | @@ -470,8 +474,8 @@ |
471 | 475 | ); |
472 | 476 | reqObj['titles']=this_seq.plObj.mTalk; |
473 | 477 | do_api_req( { |
474 | | - 'data':reqObj, |
475 | | - 'url':api_url |
| 478 | + 'data': reqObj, |
| 479 | + 'url' : this_seq.getLocalApiUrl() |
476 | 480 | }, function( data ){ |
477 | 481 | for(var j in data.query.pages){ |
478 | 482 | if(data.query.pages[j]['edittoken']) |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libClipEdit/mvClipEdit.js |
— | — | @@ -62,13 +62,13 @@ |
63 | 63 | } |
64 | 64 | |
65 | 65 | //if media type was not supplied detect for resource if possible: |
66 | | - //@@todo more advanced detection. |
| 66 | + //@@todo more advanced detection. |
67 | 67 | if(!this.media_type){ |
68 | | - if( this.rObj.mime.indexOf("image/") === 0){ |
| 68 | + if( this.rObj.type.indexOf("image/") === 0){ |
69 | 69 | this.media_type = 'image'; |
70 | | - }else if( this.rObj.mime.indexOf("video/") === 0){ |
| 70 | + }else if( this.rObj.type.indexOf("video/") === 0){ |
71 | 71 | this.media_type = 'video'; |
72 | | - }else if( this.rObj.mime.indexOf("text/") === 0){ |
| 72 | + }else if( this.rObj.type.indexOf("text/") === 0){ |
73 | 73 | this.media_type = 'template'; |
74 | 74 | } |
75 | 75 | } |
— | — | @@ -110,9 +110,11 @@ |
111 | 111 | var end_ntp = ( _this.rObj.embed.end_ntp) ? _this.rObj.embed.end_ntp : _this.rObj.embed.getDuration(); |
112 | 112 | if(!end_ntp) |
113 | 113 | end_ntp = seconds2ntp( _this.rObj.dur ); |
| 114 | + |
| 115 | + var start_ntp = (_this.rObj.embed.start_ntp) ? _this.rObj.embed.start_ntp : seconds2ntp( 0 ); |
114 | 116 | $j('#sub_cliplib_ic').html( |
115 | 117 | _this.getSetInOut({ |
116 | | - 'start_ntp' : _this.rObj.embed.start_ntp, |
| 118 | + 'start_ntp' : start_ntp, |
117 | 119 | 'end_ntp' : end_ntp |
118 | 120 | }) |
119 | 121 | ); |