User:Cacycle/wikEd dev.js: Difference between revisions

Content deleted Content added
0.9.145 pre testing
Maintenance: Remove use of deprecated wgEnableAPI (always true) - mw:RL/MGU
 
Line 2,039:
 
// parse global-context (MediaWiki) variables into hash (for Greasemonkey)
var globalNames = ['skin', 'wgServer', 'wgTitle', 'wgCanonicalNamespace', 'wgArticlePath', 'wgScript', 'wgScriptPath', 'wgUserName', 'wgCurRevisionId', 'wgContentLanguage', 'wgUserLanguage', 'wgEnableAPI', 'wgPageName', 'wgNamespaceIds', 'wgFormattedNamespaces', 'wgUseAutomaticEditSummaries', 'wgVersion', 'wgPageContentModel'];
if (wikEd.greasemonkey === true) {
globalNames.push('wikEdConfig', 'wikEdText');
Line 3,496:
if (wikEd.fixRegExTypo !== null) {
wikEd.fixRegExTypo.style.display = 'none';
}
 
// hide buttons if API is not available
if ( (wikEd.wikiGlobals.wgEnableAPI !== true) && (wikEd.wikiGlobals.wgEnableAPI != 'true') ) {
var fixRedirect = document.getElementById('wikEdFixRedirect');
if (fixRedirect !== null) {
fixRedirect.style.display = 'none';
}
}
 
Line 8,547 ⟶ 8,539:
// check for named references defined outside edited section
if (
true
wikEd.wikiGlobals.wgEnableAPI === true ||
wikEd.wikiGlobals.wgEnableAPI === 'true'
) {
 
Line 8,634 ⟶ 8,625:
 
// API request
if ( ( wikEd.wikiGlobals.wgEnableAPI === true || wikEd.wikiGlobals.wgEnableAPI === 'true' ) && livePreview === true ) {
 
// get summary
Line 10,876 ⟶ 10,867:
 
// check if api is enabled
if ( ( (wikEd.wikiGlobals.wgEnableAPI !== true) && (wikEd.wikiGlobals.wgEnableAPI != 'true') ) || (wikEd.scriptURL === '') ) {
return;
}