From b6fc31a3d406d77728686b5598f1e8a7b21f9dd2 Mon Sep 17 00:00:00 2001 From: Michael Dale Date: Sun, 16 Aug 2009 00:07:04 +0000 Subject: [PATCH] * fixed missing autoload mvTextInterface.js reference * removed deprecated ctypetext * moved simpleForm output to upload api names * fixed syntax error in libTimedText --- .../libAddMedia/mvBaseUploadInterface.js | 6 +- js2/mwEmbed/libAddMedia/remoteSearchDriver.js | 6 +- js2/mwEmbed/libAddMedia/simpleUploadForm.js | 36 ++- js2/mwEmbed/mv_embed.js | 7 +- js2/mwEmbed/php/jsAutoloadLocalClasses.php | 5 +- js2/mwEmbed/php/languages/mwEmbed.i18n.php | 281 +++++++++--------- .../php/maintenance/mergeJavascriptMsg.php | 2 +- 7 files changed, 181 insertions(+), 162 deletions(-) diff --git a/js2/mwEmbed/libAddMedia/mvBaseUploadInterface.js b/js2/mwEmbed/libAddMedia/mvBaseUploadInterface.js index 69ee3bbb9b..35fd85aa46 100644 --- a/js2/mwEmbed/libAddMedia/mvBaseUploadInterface.js +++ b/js2/mwEmbed/libAddMedia/mvBaseUploadInterface.js @@ -202,11 +202,7 @@ mvBaseUploadInterface.prototype = { //add json format if( $j(_this.editForm).find("[name='format']").length == 0) - $j(_this.editForm).append(''); - - //add text format type request (IE tries to "run"/download the script otherwise) - if( $j(_this.editForm).find("[name='ctypetext']").length == 0) - $j(_this.editForm).append(''); + $j(_this.editForm).append(''); //map the form vars to api vars: $j(_this.editForm).find('#wpUploadFile').attr('name', 'file'); diff --git a/js2/mwEmbed/libAddMedia/remoteSearchDriver.js b/js2/mwEmbed/libAddMedia/remoteSearchDriver.js index 45329ade67..b5a9eb8cdc 100644 --- a/js2/mwEmbed/libAddMedia/remoteSearchDriver.js +++ b/js2/mwEmbed/libAddMedia/remoteSearchDriver.js @@ -66,7 +66,7 @@ var default_remote_search_options = { //@@todo (should get that from the api or inpage vars) 'enable_upload_tab':true, // if we want to enable an uploads tab: - 'upload_api_target' : 'http://127.0.0.1/wiki_trunk/api.php' // can be local or the url of the upload api. + 'upload_api_target' : 'http://localhost/wiki_trunk/api.php' // can be local or the url of the upload api. } if(typeof wgServer == 'undefined') wgServer = ''; @@ -586,11 +586,11 @@ remoteSearchDriver.prototype = { "api_target" : _this.upload_api_target , "ondone_cb" : function( resultData ){ var cat = resultData; - debugger; + debugger; return false; } }) - }); + }); }else{ //setup the proxy js_log('do proxy:: ' + parseUri( _this.upload_api_target ).host); diff --git a/js2/mwEmbed/libAddMedia/simpleUploadForm.js b/js2/mwEmbed/libAddMedia/simpleUploadForm.js index 3094599e9e..0dfd001a1b 100644 --- a/js2/mwEmbed/libAddMedia/simpleUploadForm.js +++ b/js2/mwEmbed/libAddMedia/simpleUploadForm.js @@ -24,6 +24,7 @@ var default_form_options = { (function($) { $.fn.simpleUploadForm = function( opt , callback){ + var _this = this; //set the options: for(var i in default_form_options){ if(!opt[i]) @@ -38,30 +39,39 @@ var default_form_options = { //@@todo this is just a proof of concept //much todo to improved this web form - get_mw_token('File:MyRandomFileTokenCheck', opt.api_target, function(eToken){ - debugger; + get_mw_token('File:MyRandomFileTokenCheck', opt.api_target, function(eToken){ + if( !eToken || eToken == '+\\' ){ $(this.selector).html( gM('error_not_loggedin') ); return false; } - + //build the api based upload form: var o = '
'+ - '
' + - '
'+ - '
' + - '
'+ - '
'+ - '
' + - '