Skip to content

Instantly share code, notes, and snippets.

@KingBain
Last active August 25, 2022 12:43
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KingBain/a3387b740b7d94813ae04c814ffd1886 to your computer and use it in GitHub Desktop.
Save KingBain/a3387b740b7d94813ae04c814ffd1886 to your computer and use it in GitHub Desktop.
Removes the left nav panel for wiki.js users, works in tampermonkey and greasemonkey
// ==UserScript==
// @name hide-wikijs-panel
// @author John Bain
// @version 0.2.1
// @match https://docs.scienceprogram.cloud/*
// @exclude https://docs.scienceprogram.cloud/a/*
// @description Hides the Nav Panel in Wiki.js
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js
// @require https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js
// @grant GM_addStyle
// @grant GM.getValue
// ==/UserScript==
//- The @grant directives are needed to restore the proper sandbox.
/* global $, waitForKeyElements */
//resize main panel to full width... remove the padding via css
GM_addStyle ( '.v-main {padding: 0px !important;}' );
//wait for nav bar to load and remove it once it loads
waitForKeyElements ("#app > div > nav", removeNode);
function removeNode (jNode) {
jNode.remove ();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment