r95164 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95163‎ | r95164 | r95165 >
Date:18:11, 21 August 2011
Author:maxsem
Status:ok
Tags:
Comment:
Use mw.util.wikiScript()
Modified paths:
  • /trunk/extensions/ApiSandbox/ext.apiSandbox.js (modified) (history)
  • /trunk/extensions/wikihiero/modules/ext.wikihiero.Special.js (modified) (history)

Diff [purge]

Index: trunk/extensions/ApiSandbox/ext.apiSandbox.js
@@ -22,11 +22,10 @@
2323 var actionCache = [],
2424 propCache = [],
2525 namespaces = [],
26 - currentInfo = {},
27 - apiPhp = mw.config.get( 'wgServer' ) + mw.config.get( 'wgScriptPath' ) + '/api' + mw.config.get( 'wgScriptExtension' );
 26+ currentInfo = {};
2827
2928 // load namespaces
30 - $.getJSON( apiPhp,
 29+ $.getJSON( mw.util.wikiScript( 'api' ),
3130 { format: 'json', action: 'query', meta: 'siteinfo', siprop: 'namespaces' },
3231 function( data ) {
3332 if ( isset( data.query ) && isset( data.query.namespaces ) ) {
@@ -50,7 +49,7 @@
5150 $query.change( updateBasics );
5251
5352 $submit.click( function() {
54 - var url = apiPhp + '?action=' + $action.val(),
 53+ var url = mw.util.wikiScript( 'api' ) + '?action=' + $action.val(),
5554 info = currentInfo; // in case it changes later
5655 if ( $action.val() == 'query' ) {
5756 url += '&' + $query.val();
Index: trunk/extensions/wikihiero/modules/ext.wikihiero.Special.js
@@ -23,7 +23,7 @@
2424 'text': '<hiero>' + text + '</hiero>',
2525 'disablepp': ''
2626 };
27 - $.getJSON( mw.config.get( 'wgScriptPath' ) + '/api' + mw.config.get( 'wgScriptExtension' ),
 27+ $.getJSON( mw.util.wikiScript( 'api' ),
2828 data,
2929 function( data ) {
3030 var html = '<table class="wikitable">'

Status & tagging log