Index: trunk/extensions/SemanticForms/libs/SF_autoedit.js |
— | — | @@ -8,7 +8,7 @@ |
9 | 9 | |
10 | 10 | $('.autoedit-trigger').click(function(){ |
11 | 11 | |
12 | | - if ( wgUserName == null ) { |
| 12 | + if ( mw.config.get( 'wgUserName' ) == null ) { |
13 | 13 | if ( confirm( sfgAnonEditWarning ) ) { |
14 | 14 | handleAutoEdit( this ); |
15 | 15 | } |
Index: trunk/extensions/SemanticForms/libs/SF_submit.js |
— | — | @@ -7,7 +7,7 @@ |
8 | 8 | var sacButtons; |
9 | 9 | var form; |
10 | 10 | |
11 | | - if ( wgAction == "formedit" || wgCanonicalSpecialPageName == "FormEdit" ) { |
| 11 | + if ( mw.config.get( 'wgAction' ) == "formedit" || mw.config.get( 'wgCanonicalSpecialPageName' ) == "FormEdit" ) { |
12 | 12 | |
13 | 13 | form = $('#sfForm'); |
14 | 14 | |
— | — | @@ -132,16 +132,16 @@ |
133 | 133 | |
134 | 134 | } |
135 | 135 | |
136 | | - if (wgAction == "formedit") { |
137 | | - params += "&target=" + encodeURIComponent( wgPageName ); |
138 | | - } else if ( wgCanonicalSpecialPageName == "FormEdit") { |
| 136 | + if (mw.config.get( 'wgAction' ) == "formedit") { |
| 137 | + params += "&target=" + encodeURIComponent( mw.config.get( 'wgPageName' ) ); |
| 138 | + } else if ( mw.config.get( 'wgCanonicalSpecialPageName' ) == "FormEdit") { |
139 | 139 | |
140 | 140 | var url = String(window.location); |
141 | 141 | |
142 | 142 | var stop = url.indexOf("?"); |
143 | 143 | if ( stop > 0 ) url = url.substring(0, stop); |
144 | 144 | |
145 | | - var start = url.indexOf( wgPageName ); // find start of page name |
| 145 | + var start = url.indexOf( mw.config.get( 'wgPageName' ) ); // find start of page name |
146 | 146 | start = url.indexOf("/", start) + 1; // find start of subpage |
147 | 147 | |
148 | 148 | if ( start >= 0 ) { |
Index: trunk/extensions/SemanticForms/libs/SF_imagePreview.js |
— | — | @@ -11,7 +11,7 @@ |
12 | 12 | |
13 | 13 | this.getPreviewImage = function( args, callback ) { |
14 | 14 | $.getJSON( |
15 | | - wgScriptPath + '/api.php', |
| 15 | + mw.config.get( 'wgScriptPath' ) + '/api.php', |
16 | 16 | { |
17 | 17 | 'action': 'query', |
18 | 18 | 'format': 'json', |
Index: trunk/extensions/SemanticForms/libs/SF_ajax_form_preview.js |
— | — | @@ -10,7 +10,7 @@ |
11 | 11 | |
12 | 12 | function ajaxFormPreviewInit(){ |
13 | 13 | |
14 | | - if ((wgNamespaceNumber % 2 == 0) && /\.(js|css)$/.test(wgTitle)) return; |
| 14 | + if ((mw.config.get( 'mw.config.get( 'wgNamespaceNumber' )' ) % 2 == 0) && /\.(js|css)$/.test(mw.config.get( 'wgTitle' ))) return; |
15 | 15 | |
16 | 16 | if(!document.getElementById('wikiPreview')) return; |
17 | 17 | |
— | — | @@ -63,7 +63,7 @@ |
64 | 64 | |
65 | 65 | //prepare |
66 | 66 | var action = document.URL; |
67 | | - if (wgAction=='formedit') action += '&live'; |
| 67 | + if (mw.config.get( 'wgAction' )=='formedit') action += '&live'; |
68 | 68 | |
69 | 69 | var boundary = '--------123xyz'; |
70 | 70 | var data = ''; |
— | — | @@ -253,7 +253,7 @@ |
254 | 254 | } |
255 | 255 | } |
256 | 256 | |
257 | | -if (wgAction=='formedit' || wgCanonicalSpecialPageName == 'FormEdit') { |
| 257 | +if (mw.config.get( 'wgAction' )=='formedit' || mw.config.get( 'wgCanonicalSpecialPageName' ) == 'FormEdit') { |
258 | 258 | if ( typeof( addOnloadHook ) != 'undefined' ) addOnloadHook(ajaxFormPreviewInit); |
259 | 259 | else if ( typeof( jQuery ) != 'undefined' ) jQuery(function(){ |
260 | 260 | ajaxFormPreviewInit() |