Content deleted Content added
-1.1 |
-1.2 |
||
Line 2:
// Minor link helpers
// ResourceLoader: compatible; dependencies: user, mediawiki.util
/// 2014-12-
/// Fingerprint: #0#0#
/// <nowiki>
Line 11:
( function ( mw, $ ) {
"use strict";
var VERSION = -1.
Env, PLH;
function feature( applied ) {
// Check for user option
// applied -- option keyword
// Postcondition:
// Returns value, or undefined
// 2014-12-07 PerfektesChaos@de.wikipedia
var r; // = undefined
if ( typeof mw.libs.pageLinkHelper === "object" ) {
PLH = mw.libs.pageLinkHelper;
if ( typeof PLH[ applied ] !== "undefined" ) {
}
}
}
return r;
} // feature()
Line 29 ⟶ 55:
var sign = "pageLinkHelperDifflink",
$div = $( "#" + sign ),
if ( ! $div.length ) {
$container = $( "#contentSub" );
Line 35 ⟶ 61:
if ( Env.wgCanonicalSpecialPageName ) {
// 2014 redirected to &diff=
re
got
if ( got ) {
id1 = got[ 1 ];
Line 46 ⟶ 72:
}
if ( id1 ) {
if ( id2 ) {
id1 =
} else
j = parseInt(
}
}
}
}
if ( id1 ) {
show = "[["
+ mw.config.get( "wgFormattedNamespaces" )[ "-1" ]
Line 65 ⟶ 104:
$div = $( "<div>" );
$div.attr( { "id": sign } );
$div.css( { "float": "right"
$div.append( $span );
$container.append( $div );
Line 82 ⟶ 122:
// user resources loaded
// Uses:
▲ // > VERSION;
▲ // >< PLH
// >< Env
// feature()
// mw.config.get()
// mw.util.getUrl()
// mw.util.addPortletLink()
// 2014-12-
var
say = "PURGE this page from server cache",
seed = null,
slot = "p-cactions",
Line 95 ⟶ 135:
start = "ca",
got, re, swap;
if (
break;
case "string" :
seed = opt;
re = /^([a-z]+)-(.+)$/;
got = re.exec( seed );
if ( got ) {
switch ( got[ 1 ] ) {
seed = false;
▲ break;
▲ case "string" :
▲ seed = PLH.purge;
▲ re = /^([a-z]+)-(.+)$/;
▲ got = re.exec( seed );
▲ if ( got ) {
▲ switch ( got[ 1 ] ) {
▲ case "p" :
▲ slot = seed;
▲ seed = false;
▲ switch ( got[ 2 ] ) {
▲ case "navigation" :
▲ start = "n";
▲ break;
▲ case "tb" :
▲ start = "t";
▲ break;
} // switch got.2▼
break;
case "
start = "t";
break;
}
case "ca"
slot =
} // switch got.1
}
break;
} // switch typeof opt
if ( slot && seed === null ) {
Env.skin = mw.config.get( "skin" );
Line 167 ⟶ 201:
// Redirected from somewhere
// Precondition:
▲ // DOM.ready
// mediawiki.util loaded
// Uses:
Line 175 ⟶ 208:
// >< Env
// mw.util.getUrl()
// feature()
// history.___pushState()
// history.___replaceState()
// 2014-12-
var
if ( typeof window.history.___pushState === "function" &&
typeof window.history.___replaceState === "function" ) {
Line 188 ⟶ 222:
}
if ( ! last ) {
if ( opts &&
typeof opts === "object" &&
typeof opts.legacy === "boolean" ) {
legacy = opts.legacy;
}
caused = { caused: "pageLinkHelper" };
showed = window.document.title;
}
show = "#REDIRECT " + Env.wgRedirectedFrom;
window.history.___replaceState( caused, show, swap );
window.history.___pushState( caused, showed, state );
}
}
Line 208 ⟶ 252:
// mw.config.get()
// mw.util.getParamValue()
▲ // mw.loader.using()
// flip()
// fresh()
Line 221 ⟶ 264:
} else if ( ! Env.wgCanonicalSpecialPageName
&& Env.wgAction === "view" ) {
▲ fresh );
if ( Env.wgRedirectedFrom ) {
from();
Line 233 ⟶ 275:
if ( mw.loader.state( "ext.gadget.pageLinkHelper" ) !== "ready" ) {
mw.loader.state( "ext.gadget.pageLinkHelper", "ready" );
mw.loader.using( [ "mediawiki.util",
"user" ],
function () {
} );
}
}( window.mediaWiki, window.jQuery ) );
|