From a6cd9728dc436bbf8018a317947156d6fc5a532a Mon Sep 17 00:00:00 2001 From: Jean Privat Date: Tue, 24 Feb 2015 04:34:35 +0700 Subject: [PATCH] nitrpg: add nitrpg.user.js for enhanced user experience Signed-off-by: Jean Privat --- contrib/nitrpg/nitrpg.user.js | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 contrib/nitrpg/nitrpg.user.js diff --git a/contrib/nitrpg/nitrpg.user.js b/contrib/nitrpg/nitrpg.user.js new file mode 100644 index 0000000..4440ea9 --- /dev/null +++ b/contrib/nitrpg/nitrpg.user.js @@ -0,0 +1,33 @@ +// ==UserScript== +// @name Github.com - Add RPG tab +// @namespace nitlanguage/github/rpg +// @description Adds a "Github RPG" Tab at the end of the tabs. +// @include https://github.com/privat/nit* +// @version 1 +// @grant none +// ==/UserScript== + +/* This script is a userscript to use in browsers with the appropriate plug-in to add a "RPG" tab on the github site. +*/ + +/* TODO: + * Link to the player page (if logged and is a player) + * Link to other games (not just `privat/nit` but other) +*/ + +// The nav bar with tabs +var nav = document.getElementsByClassName('repo-nav'); + +// The new tab +var html = '
  • \ + \ + Github RPG\ + \ +
  • '; + +// Create a new list to put the new tab +var group = document.createElement('ul'); +group.setAttribute( 'class', 'sunken-menu-group' ); +group.innerHTML = html; + +nav[0].appendChild(group); -- 1.7.9.5