Sergey Astanin avatar Sergey Astanin committed 6d5478f

version based on generic Minimize...in_Google_Webapps

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_in_Google_Webapps.user.js

-// ==UserScript==
-// @name        Minimize Navigation in Google Webapps
-// @namespace   https://github.com/astanin
-// @include     https://groups.google.tld/*
-// @include     https://mail.google.tld/*
-// @include     https://translate.google.tld/*
-// @include     http://translate.google.tld/*
-// @include     https://www.google.tld/calendar/*
-// @include     https://www.google.tld/reader/*
-// @include     http://www.google.tld/reader/*
-// @include     https://plus.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;
 bars in most of its products (+You menu, search bar, and
 context-sensitive tool bar). The first two are rarely used, but occupy
 as much as 9% of a typical modern screen. Install this script, and
-enjoy Gmail, Reader and other Google webapps as if you had a bigger
-screen.
+enjoy Gmail as if you had a bigger screen.
 
 ### Description
 
-_Minimize Navigation in Google Webapps_ script hides +You menu and search
-bar in
-
-  * Gmail
-  * Google Calendar
-  * Google Reader
-  * Google Groups
-  * Google Translate
-  * Google+
-
-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.
+_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][screenshot]
 
 
 ### Similar scripts
 
-This script duplicates functionality of other scripts which target
-separate webapps:
-
-* [Hide Search Bar in Google Reader][readerscript]
-* [Minimize Navigation Bar in Gmail][gmailscript]
+[Hide Search Bar in Google Reader][readerscript]
 
 [screenshot]: http://i.imgur.com/uxjts.gif
 [readerscript]: http://userscripts.org/scripts/show/146144
-[gmailscript]: http://userscripts.org/scripts/show/150392
 [gm]: https://addons.mozilla.org/intl/firefox/addon/greasemonkey/
-[homepage]: http://userscripts.org/scripts/show/150974
-[directlink]: http://userscripts.org/scripts/source/150974.user.js
+[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.