Index: trunk/extensions/WikiEditor/modules/jquery.wikiEditor.js |
— | — | @@ -75,7 +75,7 @@ |
76 | 76 | * Path to images - this is a bit messy, and it would need to change if this code (and images) gets moved into the |
77 | 77 | * core - or anywhere for that matter... |
78 | 78 | */ |
79 | | - 'imgPath' : wgExtensionAssetsPath + '/WikiEditor/modules/images/', |
| 79 | + 'imgPath' : mw.config.get( 'wgExtensionAssetsPath' ) + '/WikiEditor/modules/images/', |
80 | 80 | /** |
81 | 81 | * Checks the current browser against the browsers object to determine if the browser has been black-listed or not. |
82 | 82 | * Because these rules are often very complex, the object contains configurable operators and can check against |
— | — | @@ -158,7 +158,7 @@ |
159 | 159 | */ |
160 | 160 | 'autoLang': function( object, lang ) { |
161 | 161 | var defaultKey = $( 'body' ).hasClass( 'rtl' ) ? 'default-rtl' : 'default'; |
162 | | - return object[lang || wgUserLanguage] || object[defaultKey] || object['default'] || object; |
| 162 | + return object[lang || mw.config.get( 'wgUserLanguage' )] || object[defaultKey] || object['default'] || object; |
163 | 163 | }, |
164 | 164 | /** |
165 | 165 | * Provides a way to extract the path of an icon in a certain language, automatically appending a version number for |
— | — | @@ -175,7 +175,7 @@ |
176 | 176 | if ( src.substr( 0, 7 ) != 'http://' && src.substr( 0, 8 ) != 'https://' && src[0] != '/' ) { |
177 | 177 | src = path + src; |
178 | 178 | } |
179 | | - return src + '?' + mediaWiki.loader.version( 'jquery.wikiEditor' ); |
| 179 | + return src + '?' + mw.loader.version( 'jquery.wikiEditor' ); |
180 | 180 | }, |
181 | 181 | /** |
182 | 182 | * Get the sprite offset for a language if available, icon for a language if available, or the default offset or icon, |
— | — | @@ -186,7 +186,7 @@ |
187 | 187 | * @param lang Language code, defaults to wgUserLanguage |
188 | 188 | */ |
189 | 189 | 'autoIconOrOffset': function( icon, offset, path, lang ) { |
190 | | - lang = lang || wgUserLanguage; |
| 190 | + lang = lang || mw.config.get( 'wgUserLanguage' ); |
191 | 191 | if ( typeof offset == 'object' && lang in offset ) { |
192 | 192 | return offset[lang]; |
193 | 193 | } else if ( typeof icon == 'object' && lang in icon ) { |
Index: trunk/extensions/WikiEditor/modules/jquery.wikiEditor.iframe.js |
— | — | @@ -66,7 +66,7 @@ |
67 | 67 | return a.tabIndex - b.tabIndex; |
68 | 68 | } ); |
69 | 69 | for( var i=0; i < $tabindexList.length; i++ ) { |
70 | | - if( $tabindexList.eq( i ).attr('id') == context.$iframe.attr( 'id' ) ) { |
| 70 | + if( $tabindexList.eq( i ).attr( 'id' ) == context.$iframe.attr( 'id' ) ) { |
71 | 71 | $tabindexList.get( i + 1 ).focus(); |
72 | 72 | break; |
73 | 73 | } |
— | — | @@ -681,7 +681,7 @@ |
682 | 682 | 'frameBorder': 0, |
683 | 683 | 'border': 0, |
684 | 684 | 'tabindex': 1, |
685 | | - 'src': wgExtensionAssetsPath + '/WikiEditor/modules/jquery.wikiEditor.html?' + |
| 685 | + 'src': mw.config.get( 'wgExtensionAssetsPath' ) + '/WikiEditor/modules/jquery.wikiEditor.html?' + |
686 | 686 | 'instance=' + context.instance + '&ts=' + ( new Date() ).getTime() + '&is=content', |
687 | 687 | 'id': 'wikiEditor-iframe-' + context.instance |
688 | 688 | } ) |
Index: trunk/extensions/WikiEditor/modules/ext.wikiEditor.templates.js |
— | — | @@ -4,7 +4,7 @@ |
5 | 5 | |
6 | 6 | $( document ).ready( function() { |
7 | 7 | // Disable for template namespace |
8 | | - if ( mediaWiki.config.get( 'wgNamespaceNumber' ) == 10 ) { |
| 8 | + if ( mw.config.get( 'wgNamespaceNumber' ) == 10 ) { |
9 | 9 | return true; |
10 | 10 | } |
11 | 11 | // Add templates module |
Index: trunk/extensions/WikiEditor/modules/jquery.wikiEditor.preview.js |
— | — | @@ -51,10 +51,10 @@ |
52 | 52 | context.modules.preview.$preview.find( '.wikiEditor-preview-contents' ).empty(); |
53 | 53 | context.modules.preview.$preview.find( '.wikiEditor-preview-loading' ).show(); |
54 | 54 | $.post( |
55 | | - mediaWiki.config.get( 'wgScriptPath' ) + '/api.php', |
| 55 | + mw.util.wikiScript( 'api' ), |
56 | 56 | { |
57 | 57 | 'action': 'parse', |
58 | | - 'title': mediaWiki.config.get( 'wgPageName' ), |
| 58 | + 'title': mw.config.get( 'wgPageName' ), |
59 | 59 | 'text': wikitext, |
60 | 60 | 'prop': 'text', |
61 | 61 | 'pst': '', |
— | — | @@ -100,13 +100,13 @@ |
101 | 101 | 'format': 'json' |
102 | 102 | }; |
103 | 103 | |
104 | | - $.post( mediaWiki.config.get( 'wgScriptPath' ) + '/api.php', postdata, function( data ) { |
| 104 | + $.post( mw.util.wikiScript( 'api' ), postdata, function( data ) { |
105 | 105 | try { |
106 | 106 | var postdata2 = { |
107 | 107 | 'action': 'query', |
108 | 108 | 'indexpageids': '', |
109 | 109 | 'prop': 'revisions', |
110 | | - 'titles': mediaWiki.config.get( 'wgPageName' ), |
| 110 | + 'titles': mw.config.get( 'wgPageName' ), |
111 | 111 | 'rvdifftotext': data.parse.text['*'], |
112 | 112 | 'rvprop': '', |
113 | 113 | 'format': 'json' |
— | — | @@ -115,9 +115,9 @@ |
116 | 116 | if ( section != '' ) |
117 | 117 | postdata['rvsection'] = section; |
118 | 118 | |
119 | | - $.post( mediaWiki.config.get( 'wgScriptPath' ) + '/api.php', postdata2, function( data ) { |
| 119 | + $.post( mw.util.wikiScript( 'api' ) + postdata2, function( data ) { |
120 | 120 | // Add diff CSS |
121 | | - mediaWiki.loader.load( 'mediawiki.legacy.diff' ); |
| 121 | + mw.loader.load( 'mediawiki.legacy.diff' ); |
122 | 122 | try { |
123 | 123 | var diff = data.query.pages[data.query.pageids[0]] |
124 | 124 | .revisions[0].diff['*']; |
Index: trunk/extensions/WikiEditor/modules/jquery.wikiEditor.toc.js |
— | — | @@ -637,7 +637,7 @@ |
638 | 638 | // section 0, if needed |
639 | 639 | var structure = buildStructure( outline ); |
640 | 640 | if ( $( 'input[name=wpSection]' ).val() == '' ) { |
641 | | - structure.unshift( { 'text': wgPageName.replace( /_/g, ' ' ), 'level': 1, 'index': 0 } ); |
| 641 | + structure.unshift( { 'text': mw.config.get( 'wgPageName' ).replace( /_/g, ' ' ), 'level': 1, 'index': 0 } ); |
642 | 642 | } |
643 | 643 | context.modules.toc.$toc.html( buildList( structure ) ); |
644 | 644 | |
Index: trunk/extensions/WikiEditor/modules/jquery.wikiEditor.dialogs.config.js |
— | — | @@ -110,7 +110,7 @@ |
111 | 111 | if ( typeof arguments.callee.regex == 'undefined' ) { |
112 | 112 | // Cache the regex |
113 | 113 | arguments.callee.regex = |
114 | | - new RegExp( "^(" + wgUrlProtocols + "|www\\.)", 'i'); |
| 114 | + new RegExp( "^(" + mw.config.get( 'wgUrlProtocols' ) + "|www\\.)", 'i'); |
115 | 115 | } |
116 | 116 | return s.match( arguments.callee.regex ); |
117 | 117 | } |
— | — | @@ -174,7 +174,7 @@ |
175 | 175 | $( '#wikieditor-toolbar-link-int-target-status' ).data( |
176 | 176 | 'request', |
177 | 177 | $.ajax( { |
178 | | - url: wgScriptPath + '/api.php', |
| 178 | + url: mw.util.wikiScript( 'api' ), |
179 | 179 | dataType: 'json', |
180 | 180 | data: { |
181 | 181 | 'action': 'query', |
— | — | @@ -369,7 +369,7 @@ |
370 | 370 | } |
371 | 371 | |
372 | 372 | var request = $.ajax( { |
373 | | - url: wgScriptPath + '/api.php', |
| 373 | + url: mw.util.wikiScript( 'api' ), |
374 | 374 | data: { |
375 | 375 | 'action': 'opensearch', |
376 | 376 | 'search': title, |
— | — | @@ -504,7 +504,7 @@ |
505 | 505 | open: function() { |
506 | 506 | // Cache the articlepath regex |
507 | 507 | $(this).data( 'articlePathRegex', new RegExp( |
508 | | - '^' + $.escapeRE( wgServer + wgArticlePath ) |
| 508 | + '^' + $.escapeRE( mw.config.get( 'wgServer' ) + mw.config.get( 'wgArticlePath' ) ) |
509 | 509 | .replace( /\\\$1/g, '(.*)' ) + '$' |
510 | 510 | ) ); |
511 | 511 | // Pre-fill the text fields based on the current selection |
Index: trunk/extensions/WikiEditor/modules/jquery.wikiEditor.previewDialog.js |
— | — | @@ -85,10 +85,10 @@ |
86 | 86 | $dialog.find( '.wikiEditor-preview-dialog-contents' ).empty(); |
87 | 87 | $dialog.find( '.wikiEditor-ui-loading' ).show(); |
88 | 88 | $.post( |
89 | | - wgScriptPath + '/api.php', |
| 89 | + mw.util.wikiScript( 'api' ), |
90 | 90 | { |
91 | 91 | 'action': 'parse', |
92 | | - 'title': wgPageName, |
| 92 | + 'title': mw.config.get( 'wgPageName' ), |
93 | 93 | 'text': wikitext, |
94 | 94 | 'prop': 'text', |
95 | 95 | 'pst': '', |
— | — | @@ -105,7 +105,8 @@ |
106 | 106 | context.modules.preview.previewText = wikitext; |
107 | 107 | $dialog.find( '.wikiEditor-ui-loading' ).hide(); |
108 | 108 | $dialog.find( '.wikiEditor-preview-dialog-contents' ) |
109 | | - .html( '<h1 class="firstHeading" id="firstHeading">'+wgTitle+'</h1>' + |
| 109 | + .html( '<h1 class="firstHeading" id="firstHeading">' + |
| 110 | + mw.config.get( 'wgTitle' ) + '</h1>' + |
110 | 111 | data.parse.text['*'] ) |
111 | 112 | .find( 'a:not([href^=#])' ).click( function() { return false; } ); |
112 | 113 | }, |
Index: trunk/extensions/WikiEditor/modules/ext.wikiEditor.templateEditor.js |
— | — | @@ -4,7 +4,7 @@ |
5 | 5 | |
6 | 6 | $( document ).ready( function() { |
7 | 7 | // Disable in template namespace |
8 | | - if ( mediaWiki.config.get( 'wgNamespaceNumber' ) == 10 ) { |
| 8 | + if ( mw.config.get( 'wgNamespaceNumber' ) == 10 ) { |
9 | 9 | return true; |
10 | 10 | } |
11 | 11 | // Add template editor module |
Index: trunk/extensions/WikiEditor/modules/jquery.wikiEditor.toolbar.config.js |
— | — | @@ -4,7 +4,7 @@ |
5 | 5 | ( function( $ ) { $.wikiEditor.modules.toolbar.config = { |
6 | 6 | |
7 | 7 | getDefaultConfig: function() { |
8 | | - var fileNamespace = mediaWiki.config.get( 'wgFormattedNamespaces' )[6]; |
| 8 | + var fileNamespace = mw.config.get( 'wgFormattedNamespaces' )[6]; |
9 | 9 | return { 'toolbar': { |
10 | 10 | // Main section |
11 | 11 | 'main': { |
— | — | @@ -936,7 +936,7 @@ |
937 | 937 | { |
938 | 938 | 'description': { 'htmlMsg': 'wikieditor-toolbar-help-content-file-description' }, |
939 | 939 | 'syntax': { 'htmlMsg': [ 'wikieditor-toolbar-help-content-file-syntax', fileNamespace ] }, |
940 | | - 'result': { 'htmlMsg': [ 'wikieditor-toolbar-help-content-file-result', stylepath ] } |
| 940 | + 'result': { 'htmlMsg': [ 'wikieditor-toolbar-help-content-file-result', mw.get( 'stylepath' ) ] } |
941 | 941 | } |
942 | 942 | ] |
943 | 943 | }, |