Index: branches/wmf/1.17wmf1/resources/mediawiki.util/mediawiki.util.js |
— | — | @@ -125,6 +125,17 @@ |
126 | 126 | 'wikiGetlink' : function( str ) { |
127 | 127 | return wgServer + wgArticlePath.replace( '$1', this.wikiUrlencode( str ) ); |
128 | 128 | }, |
| 129 | + |
| 130 | + /** |
| 131 | + * Get address to a script in the wiki root. |
| 132 | + * For index.php use mw.config.get( 'wgScript' ) |
| 133 | + * |
| 134 | + * @param str string Name of script (eg. 'api'), defaults to 'index' |
| 135 | + * @return string Address to script (eg. '/w/api.php' ) |
| 136 | + */ |
| 137 | + 'wikiScript' : function( str ) { |
| 138 | + return mw.config.get( 'wgScriptPath' ) + '/' + ( str || 'index' ) + mw.config.get( 'wgScriptExtension' ); |
| 139 | + }, |
129 | 140 | |
130 | 141 | /** |
131 | 142 | * Grab the URL parameter value for the given parameter. |