Content deleted Content added
-1.8 |
-1.9 |
||
Line 2:
// Some minor link helpers
// ResourceLoader: compatible; dependencies: user, mediawiki.util
/// 2014-12-
/// Fingerprint: #0#0#
/// [[w:en:User:PerfektesChaos/js/pageLinkHelper]]
/// <nowiki>
/*jshint bitwise:true, curly:true, eqeqeq:true, latedef:true,
Line 11 ⟶ 12:
( function ( mw, $ ) {
"use strict";
var Version = -1.
Sign = "pageLinkHelper",
Signature = "ext.gadget." + Sign,
Shop = "w:en:User:PerfektesChaos/js/",
Config, Env, PLH;
Line 21 ⟶ 23:
Redirect: { de: "Weiterleitung" },
permTitle: { "*": "PermaLink" },
purgeLURtip: { en: "PURGE this page"
+ " and force recursive link update",
de: "PURGE mit rekursivem Linkupdate" },
purgeLURtitle: { en: "Purge/rec. LU",
de: "Purge!! rek." },
purgeTip: { en: "PURGE this page from server cache",
de: "PURGE:"
Line 45 ⟶ 52:
"stq" : "de",
"vmf" : "de" }
}; // 2014-12-
Line 147 ⟶ 154:
// > Sign
// > Version
// > Shop
// >< PLH
// 2014-12-
if ( typeof mw.libs[ Sign ] === "object" &&
mw.libs[ Sign ] &&
Line 154 ⟶ 162:
PLH = mw.libs[ Sign ];
PLH.vsn = Version;
PLH.doc = "[[" + Shop + Sign + "]]";
}
} // face()
Line 238 ⟶ 247:
// facility()
// mw.config.get()
// 2014-12-
var el, r, say;
face();▼
if ( alter ) {
r = alter;
Line 246 ⟶ 254:
r = access;
}
▲ face();
if ( PLH &&
typeof PLH.config === "object" &&
Line 700 ⟶ 709:
if ( ahead ) {
favorite( { signature: "purge",
skins: true
fun: fresh,
show: "purgeTitle",
Line 713 ⟶ 722:
return r;
} // fresh()
function fresher( ahead ) {
// Provide forcerecursivelinkupdate purge link
// Precondition:
// ahead -- true if initializing, false to link
// DOM.ready
// mediawiki.util loaded
// user resources loaded
// Postcondition:
// Returns link, or undefined
// Uses:
// >< Env
// favorite()
// mw.config.get()
// mw.util.wikiScript()
// 2014-12-22 PerfektesChaos@de.wikipedia
var r;
if ( ahead ) {
if ( typeof Env.curid !== "number" ) {
Env.curid = mw.config.get( "wgArticleId" );
}
if ( Env.curid ) {
favorite( { signature: "forcerecursivelinkupdate",
skins: false,
fun: fresher,
show: "purgeLURtitle",
support: "purgeLURtip",
suffix: "purgeLinkUpdRec"
} );
}
} else {
r = mw.util.wikiScript( "api" )
+ "?action=purge&pageids=" + Env.curid
+ "&forcerecursivelinkupdate";
}
return r;
} // fresher()
Line 732 ⟶ 780:
// 2014-12-07 PerfektesChaos@de.wikipedia
var caused, opts, last, legacy, show, showed, state, swap;
if ( typeof window.history.___pushState === "function" &&
typeof window.history.___replaceState === "function" ) {
swap = mw.util.getUrl( Env.wgRedirectedFrom,
{ redirect: "no" } );
Line 822 ⟶ 870:
// from()
// facet()
// fresher()
// flat()
// 2014-12-
var linkUpdate;
Env = { skin: false,
wgCanonicalSpecialPageName:
Line 848 ⟶ 898:
flip();
} else {
linkUpdate = true;
Env.wgAction = mw.config.get( "wgAction" );
switch ( Env.wgAction ) {
Line 870 ⟶ 921:
fresh( true );
break;
case "edit" :
case "submit" :
linkUpdate = false;
// fall through
default:
freezer( true );
} // switch wgAction
if ( linkUpdate && facet( "forcerecursivelinkupdate" ) ) {
fresher( true );
}
}
}
|