From: Michael Dale Date: Sun, 8 Nov 2009 14:58:40 +0000 (+0000) Subject: * updates to timed text inter-wiki links X-Git-Tag: 1.31.0-rc.0~38884 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/comptes/ajouter.php?a=commitdiff_plain;h=0bdb14f46061fb8133c1471917302d88cac170da;p=lhc%2Fweb%2Fwiklou.git * updates to timed text inter-wiki links --- diff --git a/js2/mwEmbed/libTimedText/mvTextInterface.js b/js2/mwEmbed/libTimedText/mvTextInterface.js index 108329e69f..41e9ae19fc 100644 --- a/js2/mwEmbed/libTimedText/mvTextInterface.js +++ b/js2/mwEmbed/libTimedText/mvTextInterface.js @@ -52,9 +52,10 @@ mvTextInterface.prototype = { 'url' : apiUrl, 'data': { 'list' : 'allpages', - 'apprefix' : 'TimedText:' + _this.pe.wikiTitleKey + 'apprefix' : _this.pe.wikiTitleKey, + 'apnamespace' : 102 } - }, function( subData ) { + }, function( subData ) { _this.doProcSubPages( subData, wgServer + wgScriptPath); }); } @@ -138,9 +139,9 @@ mvTextInterface.prototype = { 'titles': 'File:' + _this.pe.wikiTitleKey, 'prop' : 'imageinfo' } - },function( data ){ - js_log('image is shared checking commons for subtitles'); + },function( data ){ if( data.query.pages && data.query.pages['-1'] && data.query.pages['-1'].imagerepository == 'shared'){ + js_log('image is shared checking commons for subtitles'); //found shared repo assume commons: do_api_req({ 'url': 'http://commons.wikimedia.org/w/api.php', @@ -153,6 +154,9 @@ mvTextInterface.prototype = { _this.editlink = 'http://commons.wikimedia.org/wiki/TimedText:' + _this.pe.wikiTitleKey +'.'+ wgUserLanguage +'.srt'; _this.doProcSubPages( data, 'http://commons.wikimedia.org/w/' ); }); + }else{ + //no shared repo do normal proc + _this.getParseTimedText_rowReady(); } }); }, @@ -352,7 +356,7 @@ mvTextInterface.prototype = { selHTML+='' + ''; $j('#metaBox_'+_this.pe.id).append( selHTML ); - $j('.mvTsSelect').click(function(){ + $j('.mvTsSelect').click(function(){ _this.applyTsSelect(); }); }, @@ -374,6 +378,7 @@ mvTextInterface.prototype = { if(_this.availableTracks[track_id].display){ _this.availableTracks[track_id].display=false; //hide unchecked + alert('hide: ' + '#mmbody_'+_this.pe.id +' .tt_'+track_id + ' len: ' + $j('#mmbody_'+_this.pe.id +' .tt_'+track_id ).length ); $j('#mmbody_'+_this.pe.id +' .tt_'+track_id ).fadeOut("fast"); } } diff --git a/js2/mwEmbed/mv_embed.js b/js2/mwEmbed/mv_embed.js index 3c059c1555..dd4ff5b74c 100644 --- a/js2/mwEmbed/mv_embed.js +++ b/js2/mwEmbed/mv_embed.js @@ -1171,7 +1171,8 @@ function mwdomReady( force ) { } //js2AddOnloadHook: ensure jQuery and the DOM are ready -function js2AddOnloadHook( func ) { +function js2AddOnloadHook( func ) { + js_log('js2AddOnloadHook::'); // If we have already run the DOM-ready function, just run the function directly: if( mvJsLoader.doneReadyEvents ) { // Make sure jQuery is there: diff --git a/js2/remoteMwEmbed.js b/js2/remoteMwEmbed.js index bb9bcb99ab..e507288826 100644 --- a/js2/remoteMwEmbed.js +++ b/js2/remoteMwEmbed.js @@ -22,10 +22,11 @@ function doPageSpecificRewrite() { } //timed text dispaly: - if(wgPageName.indexOf("TimedText") === 0){ - load_mv_embed( function() { + if(wgPageName.indexOf("TimedText") === 0){ + load_mv_embed(function(){ + alert('wtf'); loadExternalJs( mwEmbedHostPath + '/mwEmbed/libTimedText/mvTimeTextEdit.js' + reqAguments ); - } ); + }); } // Firefogg integration