Index: trunk/extensions/LiquidThreads/newmessages.js |
— | — | @@ -28,7 +28,7 @@ |
29 | 29 | title = title.replace( ' ', '_' ); |
30 | 30 | title = encodeURIComponent(title); |
31 | 31 | title = title.replace( '%2F', '/' ); |
32 | | - var url = wgArticlePath.replace( '$1', title ); |
| 32 | + var url = mw.config.get( 'wgArticlePath' ).replace( '$1', title ); |
33 | 33 | var link = $j('<a/>').attr('href', url).text(subject); |
34 | 34 | elem.append(link); |
35 | 35 | |
— | — | @@ -39,7 +39,7 @@ |
40 | 40 | } |
41 | 41 | |
42 | 42 | // Add the "undo" link. |
43 | | - var undoURL = wgArticlePath.replace( '$1', wgPageName ); |
| 43 | + var undoURL = mw.config.get( 'wgArticlePath' ).replace( '$1', mw.config.get( 'wgPageName' ) ); |
44 | 44 | var query = 'lqt_method=mark_as_unread&lqt_operand='+operand; |
45 | 45 | if ( undoURL.indexOf('?') == -1 ) { |
46 | 46 | query = '?'+query; |
Index: trunk/extensions/LiquidThreads/lqt.js |
— | — | @@ -259,7 +259,7 @@ |
260 | 260 | if ( typeof doLivePreview == 'function' ) { |
261 | 261 | doLivePreview(e); |
262 | 262 | } else { |
263 | | - $j.getScript( stylepath+'/common/preview.js', |
| 263 | + $j.getScript( mw.config.get( 'stylepath' ) +'/common/preview.js', |
264 | 264 | function() { doLivePreview(e); }); |
265 | 265 | } |
266 | 266 | }, |
— | — | @@ -538,7 +538,7 @@ |
539 | 539 | var getData = { 'action' : 'query', 'list' : 'threads', 'thid' : threads.join('|'), |
540 | 540 | 'format' : 'json', 'thprop' : 'id|subject|parent|modified' }; |
541 | 541 | |
542 | | - $j.get( wgScriptPath+'/api.php', getData, |
| 542 | + $j.get( mw.util.wikiScript( 'api' ), getData, |
543 | 543 | function(data) { |
544 | 544 | var threads = data.query.threads; |
545 | 545 | |
— | — | @@ -596,7 +596,7 @@ |
597 | 597 | var apiReq = { 'action' : 'query', 'list' : 'threads', 'thid' : threadId, |
598 | 598 | 'format' : 'json', 'thrender' : 1 }; |
599 | 599 | |
600 | | - $j.get( wgScriptPath+'/api.php', apiReq, |
| 600 | + $j.get( mw.util.wikiScript( 'api' ), apiReq, |
601 | 601 | function(data) { |
602 | 602 | // Load data from JSON |
603 | 603 | var html = data.query.threads[threadId].content; |
— | — | @@ -716,7 +716,7 @@ |
717 | 717 | var apiParams = { 'action' : 'query', 'list' : 'threads', 'thid' : threadId, |
718 | 718 | 'format' : 'json', 'thrender' : '1', 'thprop' : 'id' }; |
719 | 719 | |
720 | | - $j.get( wgScriptPath+'/api'+wgScriptExtension, apiParams, |
| 720 | + $j.get( mw.util.wikiScript( 'api' ), apiParams, |
721 | 721 | function(data) { |
722 | 722 | // Interpret |
723 | 723 | var content = data.query.threads[threadId].content; |
— | — | @@ -765,7 +765,7 @@ |
766 | 766 | 'format' : 'json', 'thrender' : '1', 'thprop' : 'id', |
767 | 767 | 'threnderstartrepliesat' : startAt }; |
768 | 768 | |
769 | | - $j.get( wgScriptPath+'/api.php', apiParams, |
| 769 | + $j.get( mw.util.wikiScript( 'api' ), apiParams, |
770 | 770 | function(data) { |
771 | 771 | var content = data.query.threads[threadId].content; |
772 | 772 | content = $j(content).find('.lqt-thread-replies')[0]; |
— | — | @@ -820,7 +820,7 @@ |
821 | 821 | apiParams.unwatch = 'yes'; |
822 | 822 | } |
823 | 823 | |
824 | | - $j.get( wgScriptPath+'/api'+wgScriptExtension, apiParams, |
| 824 | + $j.get( mw.util.wikiScript( 'api' ), apiParams, |
825 | 825 | function( data ) { |
826 | 826 | threadLevelCommands.load( window.location.href+' '+ |
827 | 827 | '#'+threadLevelCommands.attr('id')+' > *' ); |
— | — | @@ -833,8 +833,8 @@ |
834 | 834 | e.preventDefault(); |
835 | 835 | var thread = $j(this).closest('.lqt_thread'); |
836 | 836 | var linkTitle = thread.find('.lqt-thread-title-metadata').val(); |
837 | | - var linkURL = wgArticlePath.replace( "$1", linkTitle.replace(/ /g, '_' ) ); |
838 | | - linkURL = wgServer + linkURL; |
| 837 | + var linkURL = mw.config.get( 'wgArticlePath' ).replace( "$1", linkTitle.replace(/ /g, '_' ) ); |
| 838 | + linkURL = mw.config.get( 'wgServer' ) + linkURL; |
839 | 839 | if ( linkURL.substr( 0, 2 ) == '//' ) { |
840 | 840 | linkURL = window.location.protocol + linkURL; |
841 | 841 | } |
— | — | @@ -884,7 +884,7 @@ |
885 | 885 | 'format' : 'json' |
886 | 886 | }; |
887 | 887 | |
888 | | - $j.post( wgScriptPath+'/api'+wgScriptExtension, getTokenParams, |
| 888 | + $j.post( mw.util.wikiScript( 'api' ), getTokenParams, |
889 | 889 | function( data ) { |
890 | 890 | var token = data.threadaction.token; |
891 | 891 | |
— | — | @@ -1072,7 +1072,7 @@ |
1073 | 1073 | newTopicParams.signature = signature; |
1074 | 1074 | } |
1075 | 1075 | |
1076 | | - $j.post( wgScriptPath+'/api'+wgScriptExtension, newTopicParams, |
| 1076 | + $j.post( mw.util.wikiScript( 'api' ), newTopicParams, |
1077 | 1077 | function(data) { |
1078 | 1078 | if (callback) { |
1079 | 1079 | callback(data); |
— | — | @@ -1109,7 +1109,7 @@ |
1110 | 1110 | replyParams.signature = signature; |
1111 | 1111 | } |
1112 | 1112 | |
1113 | | - $j.post( wgScriptPath+'/api'+wgScriptExtension, replyParams, |
| 1113 | + $j.post( mw.util.wikiScript( 'api' ), replyParams, |
1114 | 1114 | function(data) { |
1115 | 1115 | if (callback) { |
1116 | 1116 | callback(data); |
— | — | @@ -1180,8 +1180,7 @@ |
1181 | 1181 | |
1182 | 1182 | request.format = 'json'; |
1183 | 1183 | |
1184 | | - var path = wgScriptPath+'/api'+wgScriptExtension; |
1185 | | - $j.post( path, request, |
| 1184 | + $j.post( mw.util.wikiScript( 'api' ), request, |
1186 | 1185 | function(data) { |
1187 | 1186 | if (callback) { |
1188 | 1187 | callback(data); |
Index: trunk/extensions/LiquidThreads/js/lqt.toolbar.js |
— | — | @@ -857,7 +857,7 @@ |
858 | 858 | { |
859 | 859 | 'description': { htmlMsg: 'wikieditor-toolbar-help-content-file-description' }, |
860 | 860 | 'syntax': { htmlMsg: 'wikieditor-toolbar-help-content-file-syntax' }, |
861 | | - 'result': { htmlMsg: [ 'wikieditor-toolbar-help-content-file-result', stylepath ] } |
| 861 | + 'result': { htmlMsg: [ 'wikieditor-toolbar-help-content-file-result', mw.config.get( 'stylepath' ) ] } |
862 | 862 | } |
863 | 863 | ] |
864 | 864 | }, |
— | — | @@ -954,7 +954,7 @@ |
955 | 955 | if ( typeof arguments.callee.regex == 'undefined' ) { |
956 | 956 | // Cache the regex |
957 | 957 | arguments.callee.regex = |
958 | | - new RegExp( "^(" + wgUrlProtocols + "|www\\.)", 'i'); |
| 958 | + new RegExp( "^(" + mw.config.get( 'wgUrlProtocols' ) + "|www\\.)", 'i'); |
959 | 959 | } |
960 | 960 | return s.match( arguments.callee.regex ); |
961 | 961 | } |
— | — | @@ -1015,7 +1015,7 @@ |
1016 | 1016 | $j( '#wikieditor-toolbar-link-int-target-status' ).data( |
1017 | 1017 | 'request', |
1018 | 1018 | $j.ajax( { |
1019 | | - url: wgScriptPath + '/api.php', |
| 1019 | + url: mw.util.wikiScript( 'api' ), |
1020 | 1020 | dataType: 'json', |
1021 | 1021 | data: { |
1022 | 1022 | 'action': 'query', |
— | — | @@ -1212,7 +1212,7 @@ |
1213 | 1213 | } |
1214 | 1214 | |
1215 | 1215 | var request = $j.ajax( { |
1216 | | - url: wgScriptPath + '/api.php', |
| 1216 | + url: mw.util.wikiScript( 'api' ), |
1217 | 1217 | data: { |
1218 | 1218 | 'action': 'opensearch', |
1219 | 1219 | 'search': title, |
— | — | @@ -1344,7 +1344,7 @@ |
1345 | 1345 | open: function() { |
1346 | 1346 | // Cache the articlepath regex |
1347 | 1347 | $j(this).data( 'articlePathRegex', new RegExp( |
1348 | | - '^' + $.escapeRE( wgServer + wgArticlePath ) |
| 1348 | + '^' + $.escapeRE( mw.config.get( 'wgServer' ) + mw.config.get( 'wgArticlePath' ) ) |
1349 | 1349 | .replace( /\\\$1/g, '(.*)' ) + '$' |
1350 | 1350 | ) ); |
1351 | 1351 | // Pre-fill the text fields based on the current selection |