Sergey Astanin avatar Sergey Astanin committed 579d4dd

rename script, update README

Comments (0)

Files changed (3)

Hide_Navigation_Bar_in_Gmail.user.js

+// ==UserScript==
+// @name        Minimize Navigation Bar in Gmail
+// @namespace   https://github.com/astanin
+// @include     https://mail.google.tld/*
+// @version     1.0
+// @grant       none
+// ==/UserScript==
+
+function addToggleButton() {
+    var tb = document.getElementById("toggle_google_bars");
+    var gb = document.getElementById("gb");
+
+    if (tb) {
+        return;
+    }
+    if (!gb) { // try to add toggle button later (several times)
+        window.triedToAddToggleButton += 1;
+        if (window.triedToAddToggleButton < 5) {
+            setTimeout(addToggleButton, 2000);
+        }
+        return;
+    }
+
+    // create toggle button
+    var tb = document.createElement("div");
+    tb.setAttribute("id","toggle_google_bars");
+
+    // styles
+    tb.style.background = "url('https://ssl.gstatic.com/ui/v1/zippy/arrow_down.png') no-repeat center #f2f2f2";
+    tb.style.height = "8px";
+    tb.style.width = "100%";
+    gb.style.display = "none";
+
+    // insert toggle button after google bars
+    gb.parentNode.insertBefore(tb, gb.nextSibling);
+
+    // add callback
+    tb.addEventListener("click", function() {
+        var gb = document.getElementById("gb");
+        var tb = document.getElementById("toggle_google_bars");
+        if (gb && (gb.style.display == "block")) {
+            gb.style.display = "none";
+            tb.style.MozTransform = "rotate(0deg)";
+        } else {
+            gb.style.display = "block";
+            tb.style.MozTransform = "rotate(180deg)";
+        }
+        return false;
+    }, false);
+
+    return;
+}
+
+// wait until google bars appear, check every second
+setTimeout(addToggleButton, 1000);
+window.triedToAddToggleButton = 0;

Minimize_Navigation_Bars_in_Gmail.user.js

-// ==UserScript==
-// @name        Minimize Navigation Bars in Gmail
-// @namespace   https://github.com/astanin
-// @include     https://mail.google.tld/*
-// @version     1.0
-// @grant       none
-// ==/UserScript==
-
-function addToggleButton() {
-    var tb = document.getElementById("toggle_google_bars");
-    var gb = document.getElementById("gb");
-
-    if (tb) {
-        return;
-    }
-    if (!gb) { // try to add toggle button later (several times)
-        window.triedToAddToggleButton += 1;
-        if (window.triedToAddToggleButton < 5) {
-            setTimeout(addToggleButton, 2000);
-        }
-        return;
-    }
-
-    // create toggle button
-    var tb = document.createElement("div");
-    tb.setAttribute("id","toggle_google_bars");
-
-    // styles
-    tb.style.background = "url('https://ssl.gstatic.com/ui/v1/zippy/arrow_down.png') no-repeat center #f2f2f2";
-    tb.style.height = "8px";
-    tb.style.width = "100%";
-    gb.style.display = "none";
-
-    // insert toggle button after google bars
-    gb.parentNode.insertBefore(tb, gb.nextSibling);
-
-    // add callback
-    tb.addEventListener("click", function() {
-        var gb = document.getElementById("gb");
-        var tb = document.getElementById("toggle_google_bars");
-        if (gb && (gb.style.display == "block")) {
-            gb.style.display = "none";
-            tb.style.MozTransform = "rotate(0deg)";
-        } else {
-            gb.style.display = "block";
-            tb.style.MozTransform = "rotate(180deg)";
-        }
-        return false;
-    }, false);
-
-    return;
-}
-
-// wait until google bars appear, check every second
-setTimeout(addToggleButton, 1000);
-window.triedToAddToggleButton = 0;
 
 ### Description
 
-_Minimize Navigation Bars in Gmail_ script hides +You menu and search
-bar in Gmail interface. It places a new narrow button which allows to
-show hidden bars when you need them (like if you want to search in
-Gmail). When you don't need them, the same button helps to collapse
+_Minimize Navigation Bar in Gmail_ script hides +You menu and search
+bar in Gmail interface. It creates a new narrow button which allows to
+show hidden tool bars when you need them (like if you want to search in
+Gmail). When you don't need them, the same button allows to collapse
 Google tool bars again.
 
-![screenshot](http://i.imgur.com/uxjts.gif)
+![screenshot][screenshot]
+
+### How to install
+
+* Install [Greasemonkey][gm] addon on Firefox (or Tampermonkey on Chrome)
+* Go to script [homepage][homepage] and press [Install][directlink]
 
 ### Similar scripts
 
 [Hide Search Bar in Google Reader][readerscript]
 
-[reader]: (http://userscripts.org/scripts/show/146144)
+[screenshot]: http://i.imgur.com/uxjts.gif
+[readerscript]: http://userscripts.org/scripts/show/146144
+[gm]: https://addons.mozilla.org/intl/firefox/addon/greasemonkey/
+[homepage]: http://userscripts.org/scripts/show/150392
+[directlink]: http://userscripts.org/scripts/source/150392.user.js
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.