r48940 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r48939‎ | r48940 | r48941 >
Date:22:35, 27 March 2009
Author:dale
Status:deferred
Tags:
Comment:
* some form processing refactoring
* set commons as default
* added basic layout control
Modified paths:
  • /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/libAddMedia/searchLibs/mediaWikiSearch.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/libAddMedia/searchLibs/metavidSearch.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/libClipEdit/mvClipEdit.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/libEmbedObj/mv_vlcEmbed.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/mv_embed.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/images/image_layout_left.png (added) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/images/image_layout_right.png (added) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/styles.css (modified) (history)

Diff [purge]

Index: trunk/extensions/MetavidWiki/skins/mv_embed/libAddMedia/searchLibs/mediaWikiSearch.js
@@ -81,14 +81,14 @@
8282
8383 this.resultsObj[page_id]={
8484 'titleKey' : page.title,
85 - 'link' :page.imageinfo[0].descriptionurl,
86 - 'title' :page.title.replace(/File:|.jpg|.png|.svg|.ogg|.ogv|.oga/ig, ''),
87 - 'poster' :page.imageinfo[0].thumburl,
88 - 'thumbwidth' :page.imageinfo[0].thumbwidth,
89 - 'thumbheight':page.imageinfo[0].thumbheight,
90 - 'mime' :page.imageinfo[0].mime,
91 - 'src' :page.imageinfo[0].url,
92 - 'desc' :page.revisions[0]['*'],
 85+ 'link' : page.imageinfo[0].descriptionurl,
 86+ 'title' : page.title.replace(/File:|.jpg|.png|.svg|.ogg|.ogv|.oga/ig, ''),
 87+ 'poster' : page.imageinfo[0].thumburl,
 88+ 'thumbwidth' : page.imageinfo[0].thumbwidth,
 89+ 'thumbheight': page.imageinfo[0].thumbheight,
 90+ 'mime' : page.imageinfo[0].mime,
 91+ 'src' : page.imageinfo[0].url,
 92+ 'desc' : page.revisions[0]['*'],
9393 //add pointer to parent search obj:
9494 'pSobj' :_this,
9595 'meta':{
@@ -195,6 +195,18 @@
196196 }
197197 js_log('ERROR:unsupored mime type: ' + rObj.mime);
198198 },
 199+ getInlineDescWiki:function( rObj ){
 200+ var desc = this.parent_getInlineDescWiki( rObj );
 201+ //just grab the description tag for inline desc:
 202+ var descMatch = new RegExp(/Description=(\{\{en\|)?([^|]*|)/);
 203+ var dparts = desc.match(descMatch);
 204+
 205+ if( dparts && dparts.length > 1)
 206+ return (dparts.length == 2)? dparts[1] : dparts[2].replace('}}','');
 207+ //else return the title since we could not find the desc:
 208+ js_log('we could not find the Description tag in :' + desc );
 209+ return rObj.title;
 210+ },
199211 //returns the inline wikitext for insertion (template based crops for now)
200212 getEmbedWikiText: function( rObj ){
201213 //set default layout to right justified
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libAddMedia/searchLibs/metavidSearch.js
@@ -1,7 +1,7 @@
22 /*
33 * api modes (implementations should call these objects which inherit the mvBaseRemoteSearch
44 */
5 -var metavidSearch = function(initObj) {
 5+var metavidSearch = function(initObj) {
66 return this.init(initObj);
77 };
88 metavidSearch.prototype = {
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libAddMedia/mvFirefogg.js
@@ -374,10 +374,10 @@
375375 //@@todo fix this:
376376 //the mediaWiki upload system does not have an API so we can\'t read errors
377377 }else{
378 - var res = mvUploader.grabWikiFormError( result_page );
 378+ var res = grabWikiFormError( result_page );
379379
380380 if(res.error_txt)
381 - error_txt = opt.error_txt;
 381+ error_txt = res.error_txt;
382382
383383 if(res.form_txt)
384384 form_txt = res.form_txt;
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libAddMedia/remoteSearchDriver.js
@@ -116,7 +116,7 @@
117117 'wiki_commons':{
118118 'enabled':1,
119119 'checked':1,
120 - 'd' :0,
 120+ 'd' :1,
121121 'title' :'Wikipedia Commons',
122122 'desc' : 'Wikimedia Commons is a media file repository making available public domain '+
123123 'and freely-licensed educational media content (images, sound and video clips) to all.',
@@ -142,7 +142,7 @@
143143 'd' :0,
144144 'title' : 'Archive.org',
145145 'desc' : 'The Internet Archive, a digital library of cultural artifacts',
146 - 'homepage':'http://archive.org',
 146+ 'homepage':'http://www.archive.org/about/about.php',
147147
148148 'api_url':'http://homeserver7.us.archive.org:8983/solr/select',
149149 'lib' : 'archiveOrg',
@@ -153,7 +153,7 @@
154154 'metavid':{
155155 'enabled':1,
156156 'checked':1,
157 - 'd' :1,
 157+ 'd' :0,
158158 'title' :'Metavid.org',
159159 'homepage':'http://metavid.org',
160160 'desc' : 'Metavid hosts thousands of hours of US house and senate floor proceedings',
@@ -435,6 +435,7 @@
436436 });
437437 },
438438 runSearch: function(){
 439+ js_log("f:runSearch");
439440 //draw_direct_flag
440441 var draw_direct_flag = true;
441442 //set loading div:
@@ -470,14 +471,16 @@
471472 }
472473
473474 //draw the results without running a query
474 - if(draw_direct_flag)
475 - this.drawOutputResults();
 475+ if( draw_direct_flag ){
 476+ js_log('do drawOutputResults direct')
 477+ this.drawOutputResults();
 478+ }
476479 },
477480 //issue a api request & cache the result
478481 //this check can be avoided by setting the this.import_url_mode = 'api' | 'form' | insted of 'autodetect' or 'none'
479482 checkForCopyURLSupport:function ( callback ){
480483 var _this = this;
481 - js_log('checkForCopyURLSupport');
 484+ js_log('checkForCopyURLSupport');
482485 if( this.import_url_mode == 'autodetect' ){
483486 do_api_req( {
484487 'data':{ 'action':'paraminfo','modules':'upload' },
@@ -494,9 +497,9 @@
495498 // but might be overkill for now.
496499 success: function( form_html ){
497500 if( form_html.indexOf( 'wpUploadFileURL' ) != -1){
498 - _this.import_url_mode= 'form';
 501+ _this.import_url_mode= 'form';
499502 }else{
500 - _this.import_url_mode= 'none';
 503+ _this.import_url_mode= 'none';
501504 }
502505 callback();
503506 },
@@ -574,8 +577,8 @@
575578 return false;
576579 }
577580
578 - eval('var libLoadReq = {'+cp.lib+'Search: \'libAddMedia/searchLibs/' +cp.lib + 'Search.js\' };');
579 - mvJsLoader.doLoad( libLoadReq, function(){
 581+ eval('var libLoadReq = {'+cp.lib+'Search: \'libAddMedia/searchLibs/' +cp.lib + 'Search.js\' };');
 582+ mvJsLoader.doLoad( libLoadReq, function(){
580583 //else we need to run the search:
581584 var iObj = {'cp':cp, 'rsd':_this};
582585 eval('cp.sObj = new '+cp.lib+'Search( iObj );');
@@ -658,7 +661,7 @@
659662 'data':reqObj,
660663 'url':this.local_wiki_api_url
661664 }, function(data){
662 - //propogate the rO
 665+ //@@todo propogate the rObj
663666 var rObj = {};
664667 }
665668 );
@@ -794,11 +797,11 @@
795798 'style="position:absolute;top:0px;left:0px;width:100%;height:100%;background-color:#FFF;">' +
796799 '<h3 id="rsd_resource_title" style="margin:4px;">' + gM('rsd_resource_edit') + ' ' + rObj.title +'</h3>'+
797800 '<div id="clip_edit_disp" style="position:absolute;'+overflow_style+'top:35px;left:5px;bottom:0px;'+
798 - 'width:' + (maxWidth + 30) + 'px;" >' +
 801+ 'width:' + (maxWidth + 25) + 'px;" >' +
799802 mv_get_loading_img('position:absolute;top:30px;left:30px', 'mv_img_loader') +
800803 '</div>'+
801804 '<div id="clip_edit_ctrl" style="position:absolute;border:solid thin blue;'+
802 - 'top:35px;left:' + (maxWidth+30) +'px;bottom:0px;right:0px;padding:5px;overflow:auto;">'+
 805+ 'top:35px;left:' + ( maxWidth + 30 ) +'px;bottom:0px;right:0px;padding:5px;overflow:auto;">'+
803806 mv_get_loading_img() +
804807 '</div>'+
805808 '</div>');
@@ -983,25 +986,26 @@
984987 rObj.pSobj.updateDataForImport( rObj );
985988
986989 //setup the resource description from resource description:
987 - var base_resource_desc = '{{Information '+"\n"+
 990+ var wt = '{{Information '+"\n"+
988991 '|Description= ' + rObj.pSobj.getImportResourceDescWiki( rObj );
989992 //output person and bill info if
990 - base_resource_desc+='|Source=' + '[' + trimStr( rObj.link ) + ' Original Source]'+ "\n";
 993+ wt+='|Source=' + '[' + trimStr( rObj.link ) + ' Original Source]'+ "\n";
991994
992995 if( rObj.author )
993 - base_resource_desc+='|Author=' + rObj.author +"\n";
 996+ wt+='|Author=' + rObj.author +"\n";
994997
995998 if( rObj.date )
996 - base_resource_desc+='|Date=' + rObj.date +"\n";
 999+ wt+='|Date=' + rObj.date +"\n";
9971000
9981001 //add the Permision info:
999 - base_resource_desc+='|Permission=' + rObj.pSobj.getPermissionWikiTag( rObj ) +"\n";
 1002+ wt+='|Permission=' + rObj.pSobj.getPermissionWikiTag( rObj ) +"\n";
10001003
10011004 if( rObj.other_versions )
1002 - base_resource_desc+='|other_versions=' + rObj.other_versions + "\n";
 1005+ wt+='|other_versions=' + rObj.other_versions + "\n";
10031006
1004 - base_resource_desc+='}}';
1005 -
 1007+ wt+='}}';
 1008+ //get any extra categories or helpful links
 1009+ wt+= rObj.pSobj.getExtraResourceDescWiki( rObj );
10061010
10071011
10081012 $j('#rsd_resource_import').remove();//remove any old resource imports
@@ -1023,7 +1027,7 @@
10241028 '<input type="text" size="30" value="' + rObj.target_resource_title + '" readonly="true"><br>'+
10251029 '<strong>Edit WikiText Resource Description:</strong>(will be replaced by forms soon)'+
10261030 '<textarea id="rsd_import_ta" id="mv_img_desc" style="width:90%;" rows="8" cols="50">'+
1027 - base_resource_desc +
 1031+ wt +
10281032 '</textarea><br>'+
10291033 '<input type="checkbox" value="true" id="wpWatchthis" name="wpWatchthis" tabindex="7"/>'+
10301034 '<label for="wpWatchthis">Watch this page</label><br>'+
@@ -1034,7 +1038,7 @@
10351039 //output the rendered and non-renderd version of description for easy swiching:
10361040 '</div>');
10371041 //load the preview text:
1038 - _this.getParsedWikiText( base_resource_desc, _this.cFileNS +':'+ rObj.target_resource_title, function( o ){
 1042+ _this.getParsedWikiText( wt, _this.cFileNS +':'+ rObj.target_resource_title, function( o ){
10391043 $j('#rsd_import_desc').html(o);
10401044 });
10411045 //add bidings:
@@ -1103,22 +1107,24 @@
11041108 js_log('found: ' + sstring);
11051109 $j('#rsd_resource_import').remove();
11061110 cir_callback( rObj );
1107 - }else{
 1111+ }else{
11081112 js_log("Error or warning: (did not find: \"" + sstring + ' in output' );
11091113 pos_etitle = '<h1 class="firstHeading">';
1110 - var error_txt='';
1111 - if(data.indexOf(pos_etitle)!=-1){
1112 - var sp = data.indexOf(pos_etitle) + pos_etitle.length;
1113 - error_txt = data.substr(sp ,
1114 - (data.indexOf('</h1>',sp )-sp)
1115 - );
1116 - }
1117 - //var error_msg =
1118 - $j('#rsd_resource_import').html(
1119 - '<b>error importing asset (we should have better error handling soon)</b><br>'+
1120 - error_txt + '<br>'+
1121 - '<a href="#" id="rsd_import_error" >Cancel import</a>'
 1114+ var error_txt = form_txt = '';
 1115+ var res = grabWikiFormError( data );
 1116+
 1117+ if( res.error_txt )
 1118+ error_txt = res.error_txt;
 1119+
 1120+ if( res.form_txt )
 1121+ form_txt = res.form_txt;
 1122+
 1123+ js_log( 'error text is: ' + error_txt );
 1124+ $j( '#rsd_resource_import' ).html( '<h3>Error</h3>' + error_txt + '<br>' + form_txt +
 1125+ '<br>'+
 1126+ '<a href="#" id="rsd_import_error" >Cancel import</a>'
11221127 );
 1128+ //set up cancel action:
11231129 $j('#rsd_import_error').click(function(){
11241130 $j('#rsd_resource_import').remove();
11251131 });
@@ -1218,8 +1224,12 @@
12191225 var list_dark_url = mv_embed_path + 'skins/' + mv_skin_name + '/images/list_layout_icon_dark.png';
12201226 var list_light_url = mv_embed_path + 'skins/' + mv_skin_name + '/images/list_layout_icon.png';
12211227
1222 -
1223 - $j('#rsd_results').append('<div id="rds_results_bar">'+
 1228+ var about_desc ='';
 1229+ if( this.content_providers[this.disp_item] ){
 1230+ var cp = this.content_providers[this.disp_item];
 1231+ about_desc ='<div style="position:absolute;bottom:0px;left:5px;"><i>About <a href="'+ cp.homepage + '" target="_new" >'+ cp.title +'</a> </i></div>';
 1232+ }
 1233+ $j('#rsd_results').append( about_desc + '<div id="rds_results_bar">'+
12241234 '<span style="position:relative;top:-5px;font-style:italic;">'+
12251235 gM('rsd_layout')+' '+
12261236 '</span>'+
@@ -1369,7 +1379,7 @@
13701380 this[i] = initObj[i];
13711381 }
13721382 return this;
1373 - },
 1383+ },
13741384 getSearchResults:function(){
13751385 //empty out the current results before issuing a request
13761386 this.resultsObj = {};
@@ -1465,7 +1475,7 @@
14661476 _this.resultsObj[ inx ] = rObj;
14671477 _this.num_results++;
14681478 });
1469 - },
 1479+ },
14701480 //by default just return the existing image with callback
14711481 getImageObj:function( rObj, size, callback){
14721482 callback( {'url':rObj.poster} );
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libAddMedia/mvUploader.js
@@ -98,35 +98,6 @@
9999 _this.fogg = new mvFirefogg( intFirefoggObj );
100100
101101 },
102 - grabWikiFormError:function( result_page ){
103 - var res = {};
104 - sp = result_page.indexOf('<span class="error">');
105 - if(sp!=-1){
106 - se = result_page.indexOf('</span>', sp);
107 - res.error_txt = result_page.substr(sp, (sp-se)) + '</span>';
108 - }else{
109 - //look for warning:
110 - sp = result_page.indexOf('<ul class="warning">')
111 - if(sp!=-1){
112 - se = result_page.indexOf('</ul>', sp);
113 - error_txt = result_page.substr(sp, (se-sp)) + '</ul>';
114 - //try and add the ignore form item:
115 - sfp = result_page.indexOf('<form method="post"');
116 - if(sfp!=-1){
117 - sfe = result_page.indexOf('</form>', sfp);
118 - res.form_txt = result_page.substr(sfp, ( sfe - sfp )) + '</form>';
119 - }
120 - }else{
121 - //one more error type check:
122 - sp = result_page.indexOf('class="mw-warning-with-logexcerpt">')
123 - if(sp!=-1){
124 - se = result_page.indexOf('</div>', sp);
125 - res.error_txt = result_page.substr(sp, ( se - sp )) + '</div>';
126 - }
127 - }
128 - }
129 - return res;
130 - },
131102 //same add code as specialUpload if($wgEnableFirefogg){
132103 addFirefoggHtml:function(){
133104 var itd_html = $j('#mw-upload-table .mw-input:first').html();
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libClipEdit/mvClipEdit.js
@@ -433,16 +433,40 @@
434434 '<span style="display:none" class="mv_crop_msg_load">' + gM('loading_txt') + '</span> '+
435435 '<a href="#" style="display:none" class="mv_apply_crop">' + gM('mv_apply_crop') + '</a> '+
436436 '<a href="#" style="display:none" class="mv_rest_crop">' + gM('mv_reset_crop') + '</a> '+
437 - '<br style="clear:both"><br>'+
438 - /*'<div class="mv_edit_button mv_scale_button_base" id="mv_scale_button" alt="crop" title="'+gM('mv_scale')+'"></div>'+
 437+ '<hr style="clear:both"/><br>'+
 438+ '<span style="float:left;">Layout:</span>' +
 439+ '<input type="radio" name="mv_layout" id="mv_layout_left" style="float:left"><div id="mv_layout_left_img" title="'+gM('mv_layout_left')+'"/>'+
 440+ '<input type="radio" name="mv_layout" id="mv_layout_right" style="float:left"><div id="mv_layout_right_img" title="'+gM('mv_layout_left')+'"/>'+
 441+ '<hr style="clear:both" /><br>' +
 442+ _this.getInsertDescHtml() +
 443+ _this.getInsertAction()
 444+ );
 445+ /*scale:
 446+ '<div class="mv_edit_button mv_scale_button_base" id="mv_scale_button" alt="crop" title="'+gM('mv_scale')+'"></div>'+
439447 '<a href="#" class="mv_scale_msg">' + gM('mv_scale') + '</a><br>'+
440448 '<a href="#" style="display:none" class="mv_apply_scale">' + gM('mv_apply_scale') + '</a> '+
441449 '<a href="#" style="display:none" class="mv_rest_scale">' + gM('mv_reset_scale') + '</a><br> '+
442 - */
443 - _this.getInsertDescHtml() +
444 - _this.getInsertAction()
445 - );
446 - //add bindings:
 450+
 451+ */
 452+ //add bindings:
 453+
 454+ //make sure the default is reflected:
 455+ if( ! _this.rObj.layout )
 456+ _this.rObj.layout = 'right';
 457+ $j('#mv_layout_' + _this.rObj.layout)[0].checked = true;
 458+
 459+ //left radio click
 460+ $j('#mv_layout_left,#mv_layout_left_img').click(function(){
 461+ $j('#mv_layout_right')[0].checked = false;
 462+ $j('#mv_layout_left')[0].checked = true;
 463+ _this.rObj.layout = 'left';
 464+ });
 465+ //right radio click
 466+ $j('#mv_layout_right,#mv_layout_right_img').click(function(){
 467+ $j('#mv_layout_left')[0].checked = false;
 468+ $j('#mv_layout_right')[0].checked = true;
 469+ _this.rObj.layout = 'right';
 470+ });
447471 $j('#mv_crop_button,.mv_crop_msg,.mv_apply_crop').click(function(){
448472 js_log('click:mv_crop_button: base width: ' + _this.rObj.width + ' bh: ' + _this.rObj.height);
449473 if($j('#mv_crop_button').hasClass('mv_crop_button_selected')){
@@ -464,7 +488,9 @@
465489 this.applyInsertControlBindings();
466490 },
467491 applyVideoAdj:function(){
468 - js_log('applyVideoAdj::');
 492+ js_log('applyVideoAdj::');
 493+ //be sure to "stop the video (some plugins can't have DOM elements on top of them)
 494+ $j('#embed_vid').get(0).stop();
469495 //update video related keys
470496 this.rObj['start_time'] = $j('#mv_start_hr_rsd').val();
471497 this.rObj['end_time'] = $j('#mv_end_hr_rsd').val();
Index: trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/images/image_layout_right.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/images/image_layout_right.png
___________________________________________________________________
Name: svn:mime-type
472498 + application/octet-stream
Index: trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/images/image_layout_left.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/images/image_layout_left.png
___________________________________________________________________
Name: svn:mime-type
473499 + application/octet-stream
Index: trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/styles.css
@@ -612,6 +612,19 @@
613613 height:22px;
614614 float:left;
615615 }
 616+#mv_layout_left_img{
 617+ width:50px;
 618+ height:33px;
 619+ background-image: url('images/image_layout_left.png');
 620+ float:left;
 621+}
 622+#mv_layout_right_img{
 623+ width:50px;
 624+ height:33px;
 625+ background-image: url('images/image_layout_right.png');
 626+ float:left;
 627+}
 628+
616629 .mv_crop_button_base{
617630 background-image: url('images/stock-tool-button-crop.png');
618631 }
Index: trunk/extensions/MetavidWiki/skins/mv_embed/mv_embed.js
@@ -21,7 +21,7 @@
2222 MV_DO_INIT=false;
2323 }
2424 //used to grab fresh copies of scripts. (should be changed on commit)
25 -var MV_EMBED_VERSION = '1.0r12';
 25+var MV_EMBED_VERSION = '1.0r13';
2626
2727 //the name of the player skin (default is mvpcf)
2828 var mv_skin_name = 'mvpcf';
@@ -1154,6 +1154,36 @@
11551155 loadExternalJs( req_url );
11561156 }
11571157 }
 1158+
 1159+function grabWikiFormError ( result_page ){
 1160+ var res = {};
 1161+ sp = result_page.indexOf('<span class="error">');
 1162+ if(sp!=-1){
 1163+ se = result_page.indexOf('</span>', sp);
 1164+ res.error_txt = result_page.substr(sp, (sp-se)) + '</span>';
 1165+ }else{
 1166+ //look for warning:
 1167+ sp = result_page.indexOf('<ul class="warning">')
 1168+ if(sp != -1){
 1169+ se = result_page.indexOf('</ul>', sp);
 1170+ res.error_txt = result_page.substr(sp, (se-sp)) + '</ul>';
 1171+ //try and add the ignore form item:
 1172+ sfp = result_page.indexOf('<form method="post"');
 1173+ if(sfp!=-1){
 1174+ sfe = result_page.indexOf('</form>', sfp);
 1175+ res.form_txt = result_page.substr(sfp, ( sfe - sfp )) + '</form>';
 1176+ }
 1177+ }else{
 1178+ //one more error type check:
 1179+ sp = result_page.indexOf('class="mw-warning-with-logexcerpt">')
 1180+ if(sp!=-1){
 1181+ se = result_page.indexOf('</div>', sp);
 1182+ res.error_txt = result_page.substr(sp, ( se - sp )) + '</div>';
 1183+ }
 1184+ }
 1185+ }
 1186+ return res;
 1187+}
11581188 //do a "normal" request
11591189 function do_request(req_url, callback){
11601190 //if we are doing a request to the same domain or relative link do a normal GET:
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libEmbedObj/mv_vlcEmbed.js
@@ -179,22 +179,11 @@
180180 liveFeedRoll: 0,
181181 onPlaying: function(){
182182 if(this.seek_time_sec != 0 && !this.supportsURLTimeEncoding() )
183 - {
184 - // VLC seems to have a problem seeking into the future this way
185 - var ms_difference = this.seek_time_sec * 1000 - this.vlc.input.time;
186 - if(ms_difference <= 0)
187 - {
188 - js_log('Seeking to ' + this.seek_time_sec);
189 - this.vlc.input.time = this.seek_time_sec * 1000;
190 - this.vlc.input.rate=1.0;
191 - this.seek_time_sec = 0;
192 - }
193 - else if (this.vlc.input.rate == 1.0)
194 - {
195 - var rate = Math.max(2, ms_difference / 500)
196 - js_log('setting rate to: ' + rate);
197 - this.vlc.input.rate=rate;
198 - }
 183+ {
 184+ js_log('Seeking to ' + this.seek_time_sec);
 185+ this.vlc.input.time = this.seek_time_sec * 1000;
 186+ this.vlc.input.rate=1.0;
 187+ this.seek_time_sec = 0;
199188 }
200189 //for now trust the duration from url over vlc input.length
201190 if( ! this.media_element.selected_source.end_ntp && this.vlc.input.length>0)

Status & tagging log