From: Michael Dale Date: Mon, 9 Nov 2009 07:15:46 +0000 (+0000) Subject: * some small bug & language fixes for mvTextInterface X-Git-Tag: 1.31.0-rc.0~38869 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=b19b656860fe5ccc03218b9ff5525209cc9c8fb8;p=lhc%2Fweb%2Fwiklou.git * some small bug & language fixes for mvTextInterface --- diff --git a/js2/mwEmbed/libTimedText/mvTextInterface.js b/js2/mwEmbed/libTimedText/mvTextInterface.js index 0de6ba7f6a..8a2a2d8881 100644 --- a/js2/mwEmbed/libTimedText/mvTextInterface.js +++ b/js2/mwEmbed/libTimedText/mvTextInterface.js @@ -55,8 +55,20 @@ mvTextInterface.prototype = { 'apprefix' : _this.pe.wikiTitleKey, 'apnamespace' : 102 } - }, function( subData ) { - _this.doProcSubPages( subData, wgServer + wgScriptPath); + }, function( subData ) { + if( subData.error && subData.error.code == 'apunknown_apnamespace'){ + do_api_req({ + 'url' : apiUrl, + 'data': { + 'list' : 'allpages', + 'apprefix' : 'TimedText:' + _this.pe.wikiTitleKey, + } + }, function( subData ) { + _this.doProcSubPages( subData, wgServer + wgScriptPath); + }); + }else{ + _this.doProcSubPages( subData, wgServer + wgScriptPath); + } }); } }else{ diff --git a/js2/mwEmbed/mv_embed.js b/js2/mwEmbed/mv_embed.js index b4c9e86afb..4d8255ea5f 100644 --- a/js2/mwEmbed/mv_embed.js +++ b/js2/mwEmbed/mv_embed.js @@ -146,7 +146,7 @@ lcPaths({ "mvTimedEffectsEdit": "libSequencer/mvTimedEffectsEdit.js", "mvTextInterface" : "libTimedText/mvTextInterface.js", - "mvTimedTextEdit" : "libTimedText/mvTimedTextEdit.js" + "mvTimeTextEdit" : "libTimedText/mvTimeTextEdit.js" }); // Dependency mapping for CSS files for self-contained included plugins: @@ -786,7 +786,7 @@ if( !mv_embed_path ) { })(window.$mw); //load in js2 stopgap into proper location: -if(gMsg){ +if( typeof gMsg != 'undefined'){ $mw.lang.loadGM( gMsg ) } diff --git a/js2/mwEmbed/php/languages/mwEmbed.i18n.php b/js2/mwEmbed/php/languages/mwEmbed.i18n.php index 779337a3a4..0a4bd35722 100644 --- a/js2/mwEmbed/php/languages/mwEmbed.i18n.php +++ b/js2/mwEmbed/php/languages/mwEmbed.i18n.php @@ -52,6 +52,14 @@ $messages['en'] = array( 'mwe-no_text_tracks_found' => 'No text subtitles found', 'mwe-add-edit-subs' => 'Add/edit subtitles', + /* + * js file: /libTimedText/mvTimeTextEdit.js + */ + 'mwe-add-subs-file' => 'Add/replace subtitle', + 'mwe-add-subs-file-title'=> 'Select subtitle to upload', + 'mwe-error-only-srt' => 'Only srt files can be uploaded right now.', + 'mwe-watch-video' => 'Watch video', + /* * js file: /libSequencer/mvTimedEffectsEdit.js */ diff --git a/js2/remoteMwEmbed.js b/js2/remoteMwEmbed.js index ba9e85ce9c..604cd7e38e 100644 --- a/js2/remoteMwEmbed.js +++ b/js2/remoteMwEmbed.js @@ -5,7 +5,7 @@ var urlparts = getRemoteEmbedPath(); var mwEmbedHostPath = urlparts[0]; -var mwRemoteVersion = '1.03'; +var mwRemoteVersion = '1.05'; reqArguments = urlparts[1]; @@ -36,7 +36,9 @@ function doPageSpecificRewrite() { //timed text display: if(wgPageName.indexOf("TimedText") === 0){ load_mv_embed(function(){ - loadExternalJs( mwEmbedHostPath + '/mwEmbed/libTimedText/mvTimeTextEdit.js' + reqArguments ); + $mw.load( ['mvTimeTextEdit'],function(){ + //could run init here (but mvTimeTextEdit included onLoad actions) + }); }); }