User:Luqgreg/global.js

window.lastEdited = { avatarsize: 10, comment: false }; window.localnavdropdown = { "S:I/NPI": "Special:Insights/nonportableinfoboxes", "U:/Sandbox": "Special:MyPage/Sandbox", "MW:*.css": { "Common.css": "MediaWiki:Common.css", "Wikia.css": "MediaWiki:Wikia.css", "Themes.css": "MediaWiki:Themes.css", "Infoboksy.css": "MediaWiki:Infoboksy.css" },	"MW:*.js": { "Common.js": "MediaWiki:Common.js", "Wikia.js": "MediaWiki:Wikia.js", "ImportJS": "MediaWiki:ImportJS" },	"Wiki": { "S:T": "Special:Templates", "S:Log": "Special:Log", "S:LA": "Special:ListAdmins" } }

// Local nav dropdown mw.hook("dev.wds").add(function(wds) {	var dropicon = $(dev.wds.icon("menu-control-tiny")).attr("class", "wds-icon wds-icon-tiny wds-dropdown-chevron"),		dropdata  = window.localnavdropdown || {},		dropdown  = $(".wds-community-header__wiki-buttons .wds-dropdown .wds-list").empty;

function link(href, text) { return $("").append($("").attr("href", wgArticlePath.replace("$1", href)).text(text)) }	function group(text, links) { var list = $("").attr("class", "wds-list wds-is-linked").append(links) process(links, list) return $("") .attr("class", "wds-dropdown-level-2 wds-is-sticked-to-parent") .append([				$("").attr("class", "wds-dropdown-level-2__toggle")					.text(text)					.append(dropicon.clone),				$(" ").attr("class", "wds-is-not-scrollable wds-dropdown-level-2__content")					.append(list)				]) }	function process(data, parent) { Object.keys(data).forEach(function(k) {			var v = data[k]			if(typeof v === "object") parent.append(group(k, v))			else parent.append(link(v, k))		}) }

process(dropdata, dropdown) })

// Imports importArticles({	type: "script",	articles: [		"u:dev:AjaxRC/code.js",		"u:dev:LastEdited/code.js",		"u:dev:ReferencePopups/code.js",		"u:dev:View Source/code.js",		"u:dev:WDSIcons/code.js",		"u:dev:WhatLinksHere/code.js"	] });

// RC instead of WA under the icon in new nav & additional icon that links to S:Upload // Author: Nanaki (modified by me) $('.wds-community-header__wiki-buttons a[data-tracking="wiki-activity"]') .attr({href: wgArticlePath.replace("$1", "Special:RecentChanges"), title: "Ostatnie zmiany"}); $('.wds-community-header__wiki-buttons a[data-tracking="add-new-page"]').after(	$("").attr({ class: "wds-button wds-is-squished wds-is-secondary", href: wgArticlePath.replace("$1", "Special:Upload"), title: "Prześlij plik" }).html($('<path d="M 8.984375 0.98632812 A 1.0001 1.0001 0 0 0 8.203125 1.3828125 L 4.2929688 5.2929688 A 1.0001 1.0001 0 1 0 5.7070312 6.7070312 L 8 4.4140625 L 8 12 A 1.0001 1.0001 0 1 0 10 12 L 10 4.4140625 L 12.292969 6.7070312 A 1.0001 1.0001 0 1 0 13.707031 5.2929688 L 9.7910156 1.3769531 A 1.0001 1.0001 0 0 0 8.984375 0.98632812 z M 2.984375 10.986328 A 1.0001 1.0001 0 0 0 2 12 L 2 16 A 1.0001 1.0001 0 0 0 3 17 L 15 17 A 1.0001 1.0001 0 0 0 16 16 L 16 12 A 1.0001 1.0001 0 1 0 14 12 L 14 15 L 4 15 L 4 12 A 1.0001 1.0001 0 0 0 2.984375 10.986328 z"/> ')) )

// Bypass Special:InfoboxBuilder // Author: Nanaki if($(".template-classification-type-text").data("type") == "infobox") $("#ca-edit").attr("href", function(a) { return this.href + "&useeditor=source" })