logo       

[MediaWiki-CVS] SVN: [54071] trunk/phase3/js2/mwEmbed/mv_embed.js: msg#01449

mediawiki-cvs

Subject: [MediaWiki-CVS] SVN: [54071] trunk/phase3/js2/mwEmbed/mv_embed.js

http://www.mediawiki.org/wiki/Special:Code/MediaWiki/54071

Revision: 54071
Author: dale
Date: 2009-07-31 05:23:31 +0000 (Fri, 31 Jul 2009)

Log Message:
-----------
get local api url function abstraction

Modified Paths:
--------------
trunk/phase3/js2/mwEmbed/mv_embed.js

Modified: trunk/phase3/js2/mwEmbed/mv_embed.js
===================================================================
--- trunk/phase3/js2/mwEmbed/mv_embed.js 2009-07-31 03:22:03 UTC (rev
54070)
+++ trunk/phase3/js2/mwEmbed/mv_embed.js 2009-07-31 05:23:31 UTC (rev
54071)
@@ -1080,11 +1080,9 @@
if( typeof options.url == 'undefined' || options.url === false){
if(!wgServer || ! wgScriptPath){
return js_error('Error: no api url for api request');;
- }
- if (wgServer && wgScript)
- options.url = wgServer + wgScript;
+ }
//update to api.php (if index.php was in the wgScript path):
- options.url = options.url.replace(/index.php/, 'api.php');

+ options.url = mwGetLocalApiUrl();
}
if( typeof options.data == 'undefined' )
options.data = {};
@@ -1131,6 +1129,13 @@
loadExternalJs( req_url );
}
}
+function mwGetLocalApiUrl(url){
+ if (wgServer && wgScript){
+ url = wgServer + wgScript;
+ return url.replace(/index.php/, 'api.php');
+ }
+ return false;
+}
//grab wiki form error for wiki html page proccessing (should be depricated)
function grabWikiFormError ( result_page ){
var res = {};



_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@xxxxxxxxxxxxxxxxxxx
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | Mail Home | sitemap | FAQ | advertise