User:PerfektesChaos/js/pageLinkHelper/d.js: Difference between revisions

Content deleted Content added
-1.93
-1.94
Line 1:
/// Gadget-pageLinkHelper.js
// Some minor link helpers
/// 2015-01-0411 PerfektesChaos@de.wikipedia
// ResourceLoader: compatible;
// dependencies: user, user.options, mediawiki.user, mediawiki.util
Line 13:
( function ( mw, $ ) {
"use strict";
var Version = -1.9394,
Sign = "pageLinkHelper",
Signature = "ext.gadget." + Sign,
Line 42:
de: "Seite purgen" },
qqxTip: { en: "Reload"
+ " and show interface element IDs" },
"float": de: "rightNeu laden",
+ " und MediaWiki-IDs zeigen" },
qqxTitle: { en: "lang=qqx" },
translate: { "als" : "de",
Line 59 ⟶ 61:
"stq" : "de",
"vmf" : "de" }
}; // 20142015-1201-2206 PerfektesChaos@de.wikipedia
 
 
Line 113 ⟶ 115:
// access -- distinguishing selector ID
// Uses:
// > Env.ltr
// > Sign
// 20142015-1201-1906 PerfektesChaos@de.wikipedia
var space = "4px",
style = "#B0C4DE 1px solid",
Line 121 ⟶ 124:
"id": access } );
$r.css( { "border-bottom": style,
"border-left": style,
"background-color": "#FFFFFF",
"background": "rgba(255, 255, 255, 0.5)",
"float": "right",
"font-family": "monospace",
"margin-bottom": "1em",
"margin-left": "1em",
"margin-top": space,
"padding-bottom": space,
"padding-right": space,
"padding-left": space } );
if ( Env.ltr ) {
$r.css( { "border-left": style,
"float": "right",
"margin-left": "1em", } );
} else {
$r.css( { "border-right": style,
"float": "left",
"margin-right": "1em" } );
}
return $r;
} // $factory()
Line 148 ⟶ 157:
// > Sign
// >< Env
// 2015-01-0306 PerfektesChaos@de.wikipedia
var r, // = undefined
sequence, suitable, $anchor, $clear;
if ( typeof Env.$corner === "undefined" ) {
Env.ltr = ( ! $( "body.sitedir-rtl" ).length );
Env.$corner = $( "<div>" );
Env.$corner.attr( { "class": Sign,
Line 188 ⟶ 198:
$anchor[ sequence ]( Env.$corner );
$clear = $( "<div>" );
$clear.css( { "clear": ( Env.ltr ? "left" : "right" ) } );
Env.$corner.after( $clear );
} else {
Line 554 ⟶ 564:
// freezer()
// (feed)
// 2015-01-0307 PerfektesChaos@de.wikipedia
var link = false,
msec = 200500,
opt = OPTS.facet( "diff" ),
sign = Sign + "Difflink",
Line 698 ⟶ 708:
// Uses:
// mw.util.getParamValue()
// 2015-01-0311 PerfektesChaos@de.wikipedia
var $results = $( "#mw-content-text li" ),
n = $results.length,
Line 711 ⟶ 721:
$a = $li.eq( j );
strip = $a.attr( "href" );
startif = mw.util.getParamValue( "oldid",strip strip );&&
if strip.substr( start0, 3 ) === "/w/" ) { // wikidata
stripstart = stripmw.replaceutil.getParamValue( /&"oldid=\d+\b/", ""strip );
if .replace( /&curid=\d+\b/,start "") );{
shift strip = mwstrip.util.getParamValuereplace( "diff"/&oldid=\d+\b/, strip"" );
if .replace( shift/&curid=\d+\b/, )"" {);
stripshift = stripmw.replaceutil.getParamValue( /&"diff=\d+\b/", ""strip );
shiftif =( "Diff/"shift +) start + "/" + shift;{
} else if strip = strip.replace( alike/&diff=\d+\b/, )"" {);
shift = false"Diff/" + start + "/" + shift;
} else if ( alike ) {
shift = "PermaLink/" +shift = startfalse;
} else {
if ( shift )= "PermaLink/" + {start;
shift = special + shift + "$1";}
stripif = strip.replace( /^.+(\?title=.+shift )$/, {
shift = special + shift + shift )"$1";
$a.attr( "href", strip = strip.replace( /^.+(\?title=.+);$/,
shift );
$a.attr( "href", strip );
}
}
}
Line 1,057 ⟶ 1,070:
// > Version
// < Env
// mw.user.options.seset()
// mw.config.get()
// mw.util.getParamValue()
// forward()
// flip()
// mw.user.options.get()
// further()
// freeze()
Line 1,071 ⟶ 1,085:
// freshest()
// flat()
// 2015-01-0407 PerfektesChaos@de.wikipedia
var linkUpdate;
mw.user.options.set( "gadget-" + Sign, Version );
Line 1,089 ⟶ 1,103:
case "Recentchanges" :
case "Watchlist" :
forwardif ( 1! mw.user.options.get( "gadget-navigation-popups" ); ) {
forward( 1 );
}
break;
case "Gadgets" :