Last active
October 30, 2019 09:07
-
-
Save Erquint/ec4f688c7d6d9ea2ccddff8acb3a8415 to your computer and use it in GitHub Desktop.
FANDOM/Wikia PseudoMonobook+ Implements https://dev.fandom.com/wiki/PseudoMonobook on FANDOM wiki pages and gets rid of extra annoyances. Install with the following link: https://gist.githubusercontent.com/Erquint/ec4f688c7d6d9ea2ccddff8acb3a8415/raw/FWPMP.user.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name FANDOM/Wikia PseudoMonobook+ | |
// @description Implements https://dev.fandom.com/wiki/PseudoMonobook on FANDOM wiki pages and gets rid of extra annoyances. | |
// @version 1.8.0 | |
// @namespace [email protected] | |
// @author https://gist.github.com/Erquint | |
// @homepageURL https://gist.github.com/Erquint/ec4f688c7d6d9ea2ccddff8acb3a8415 | |
// @updateURL https://gist.githubusercontent.com/Erquint/ec4f688c7d6d9ea2ccddff8acb3a8415/raw/FWPMP.user.js | |
// @downloadURL https://gist.githubusercontent.com/Erquint/ec4f688c7d6d9ea2ccddff8acb3a8415/raw/FWPMP.user.js | |
// @match http*://*wikia.com/wiki/* | |
// @match http*://*fandom.com/wiki/* | |
// @resource PseudoMonobook https://dev.fandom.com/load.php?mode=articles&articles=u:dev:MediaWiki:PseudoMonobook.css&only=styles | |
// @run-at document-end | |
// @noframes | |
// @inject-into page | |
// @noframes | |
// @grant GM_addStyle | |
// @grant GM_getResourceURL | |
// ==/UserScript== | |
let searchToggle = document.getElementsByClassName('wds-global-navigation__search-toggle')[0]; | |
let searchInput = document.getElementsByClassName('wds-global-navigation__search-input')[0]; | |
let classicCategories = document.getElementsByClassName('category-layout-selector__item')[0]; | |
function removeId(i){i = document.getElementById(i); i && i.remove()}; | |
function removeClass(i){Array.from(document.getElementsByClassName(i)).forEach(e => e.remove())}; | |
//function removeTag(i){Array.from(document.getElementsByTagName(i)).forEach(e => e.remove())};//Unused | |
GM_addStyle(`@import '${GM_getResourceURL('PseudoMonobook')}'`); | |
GM_addStyle('.WikiaMainContent {width: 100% !important;}'); | |
GM_addStyle('.results-wrapper {width: 80% !important;}'); | |
removeId('ad-skin'); | |
removeId('WikiaRailWrapper'); | |
removeId('WikiaFooter'); | |
removeId('WikiaTopAds'); | |
removeClass('wds-global-navigation__logo'); | |
removeClass('wds-global-footer__header'); | |
removeClass('wds-global-footer__bottom-bar'); | |
removeClass('SearchAdsTopWrapper'); | |
searchInput.addEventListener('blur' ,e => searchToggle.click()); | |
searchToggle.click(); | |
searchInput.blur(); | |
classicCategories && classicCategories.click(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment