User:Anpang/orangehoney.js

/*  ____                             _    _                          / __ \                           | |  | |                        | |  | |_ __ __ _ _ __   __ _  ___| |__| | ___  _ __   ___ _   _  | |  | | '__/ _` | '_ \ / _` |/ _ \  __  |/ _ \| '_ \ / _ \ | | | | |__| | | | (_| | | | | (_| |  __/ |  | | (_) | | | |  __/ |_| |  \____/|_|  \__,_|_| |_|\__, |\___|_|  |_|\___/|_| |_|\___|\__, |                          __/ |                              __/ |                         |___/                              |___/       A less glitchier and more lite alternative to MoreMenu. EXPLANATION: This gadget adds a "Options" dropdown near the "More" dropdown and the search bar. The dropdown contains some useful things. Uses JavaScript and jQuery. Designed for Old Vector skin and default english (en) language Created and maintained by User:Anpang, special thanks to User:Arcversin Feel free to edit this page even if it's in a userspace or it's really minor.



// Functions function pagify(name) { return name.replace(" ","_"); }

// Autopurge if (mw.config.get("wgAction") == "purge") { $("form[action*=\"action=purge\"]").submit; }

// Set icons for namespace to icon var icon = ""; const tocheck = mw.html.escape(mw.config.get("wgCanonicalNamespace")); if (tocheck.toLowerCase.includes("talk")) { icon = "https://upload.wikimedia.org/wikipedia/commons/d/de/Speech_bubble_text.svg"; } else if (mw.html.escape(mw.config.get("wgPageName")).endsWith(".js")) { icon = "https://upload.wikimedia.org/wikipedia/commons/3/3b/Javascript_Logo.png"; } else if (tocheck == "User") { icon = "https://upload.wikimedia.org/wikipedia/commons/d/d8/Emblem-person-blue.svg"; } else if (tocheck == "Special") { icon = "https://upload.wikimedia.org/wikipedia/commons/2/20/Magic_wand.svg"; } else { icon = "https://upload.wikimedia.org/wikipedia/commons/4/48/Emblem-question.svg"; }

// First-heading improvements (namespace to icon, double-slash subpages, is this editable) var firstheading = mw.html.escape($("#firstHeading").html); $("#firstHeading").html(firstheading.replace(`${mw.html.escape(mw.config.get("wgCanonicalNamespace"))}:`," ").replace("/",` //  `)); $(``).prependTo("#firstHeading"); if (mw.config.get("wgIsProbablyEditable")) {}

// Options dropdown $(`   	 Options 	  expanded 	  collapsed 	 Subpages 	 Ask/tell  <ul class="vector-menu-content-list"><a href="${mw.html.escape(window.location.href)}?action=purge" title="Purge the cache to see the latest revision"> Purge cache </a></li></ul> (?) `).insertBefore("#p-search");