by Rob Cottingham | May 11, 2012 | Social Signal
The (barely-tested) bookmarklet: Drag this link to your browser’s bookmarks bar: Hide toolbar | Restore toolbar
I love the administration toolbar that comes with Drupal 7, the one that puts the admin menu within easy reach at all times. It’s one of the most convenient developments in my online life.
But there are times when it’s really inconvenient – like when you I want to show an unpublished page the way an ordinary mortal will see it when they visit. There’s a shortcut bar underneath it, which you can hide or show at will… but that toolbar stays there, come hell or high water, as long as you’re logged in.
Short of installing a module (which would be rude of me, if I’m not the guy actually developing the site), I’ve resorted to hiding the toolbar by manually editing the CSS properties in my browser. A little “display:none” here, a sprinkle of “padding-top:0px” there, and we’re in business.
But that gets old pretty quickly. How about handling it in one click? The JavaScript is actually pretty straightforward (this is on a site where the body
‘s CSS “padding-top” value is zero throughout):
javascript:document.getElementById(“toolbar”).setAttribute(“style”, “display:none”);void(document.body.style.paddingTop=”0px”);
It works by hiding the contents of the toolbar, and resetting the body
‘s padding-top value to zero.
I tested it successfully in Safari, Firefox and Chrome, but I ran it through John Gruber’s JavaScript bookmark builder to work its magic encoding on the spaces and punctuation just to be safe. It now looks like this:
javascript:document.getElementById(%22toolbar%22).setAttribute(%22style%22,%20%22display:none%22);void(document.body.style.paddingTop=%220px%22);
Of course, you might want the toolbar back again. So:
javascript:document.getElementById(“toolbar”).setAttribute(“style”, “display:block”);void(document.body.style.paddingTop=”65px”);
…and, encoded:
javascript:document.getElementById(%22toolbar%22).setAttribute(%22style%22,%20%22display:block%22);void(document.body.style.paddingTop=%2265px%22);
Limitations:
- It only disables the toolbar until you reload the page or navigate to another one.
- I haven’t tested it in anything except the Mac versions of Safari 5.1.5, Firefox 11 and Chrome 19.0.1084.46. Oh, and I’ve tested it on all of one Drupal site.
- It assumes the
body
‘s padding-top CSS value is zero pixels.
Let me know if it works for you – or if you’ve found a more useful/robust solution.
Bookmarklets: Hide toolbar | Restore toolbar (or, if you get easily frustrated, Die, toolbar, die! | Restore toolbar)
by Rob Cottingham | May 11, 2012 | Social Signal
The (barely-tested) bookmarklet: Drag this link to your browser’s bookmarks bar: Hide toolbar | Restore toolbar
I love the administration toolbar that comes with Drupal 7, the one that puts the admin menu within easy reach at all times. It’s one of the most convenient developments in my online life.
But there are times when it’s really inconvenient – like when you I want to show an unpublished page the way an ordinary mortal will see it when they visit. There’s a shortcut bar underneath it, which you can hide or show at will… but that toolbar stays there, come hell or high water, as long as you’re logged in.
Short of installing a module (which would be rude of me, if I’m not the guy actually developing the site), I’ve resorted to hiding the toolbar by manually editing the CSS properties in my browser. A little “display:none” here, a sprinkle of “padding-top:0px” there, and we’re in business.
But that gets old pretty quickly. How about handling it in one click? The JavaScript is actually pretty straightforward (this is on a site where the body
‘s CSS “padding-top” value is zero throughout):
javascript:document.getElementById(“toolbar”).setAttribute(“style”, “display:none”);void(document.body.style.paddingTop=”0px”);
It works by hiding the contents of the toolbar, and resetting the body
‘s padding-top value to zero.
I tested it successfully in Safari, Firefox and Chrome, but I ran it through John Gruber’s JavaScript bookmark builder to work its magic encoding on the spaces and punctuation just to be safe. It now looks like this:
javascript:document.getElementById(%22toolbar%22).setAttribute(%22style%22,%20%22display:none%22);void(document.body.style.paddingTop=%220px%22);
Of course, you might want the toolbar back again. So:
javascript:document.getElementById(“toolbar”).setAttribute(“style”, “display:block”);void(document.body.style.paddingTop=”65px”);
…and, encoded:
javascript:document.getElementById(%22toolbar%22).setAttribute(%22style%22,%20%22display:block%22);void(document.body.style.paddingTop=%2265px%22);
Limitations:
- It only disables the toolbar until you reload the page or navigate to another one.
- I haven’t tested it in anything except the Mac versions of Safari 5.1.5, Firefox 11 and Chrome 19.0.1084.46. Oh, and I’ve tested it on all of one Drupal site.
- It assumes the
body
‘s padding-top CSS value is zero pixels.
Let me know if it works for you – or if you’ve found a more useful/robust solution.
Bookmarklets: Hide toolbar | Restore toolbar (or, if you get easily frustrated, Die, toolbar, die! | Restore toolbar)
by Rob Cottingham | May 4, 2012 | Social Signal
For several years now, Chris Brogan’s blog has been a must-read for anyone who wants to use social media productively. Add his thriving practice as a speaker, the fact that he co-founded PodCamp, and his New York Times bestseller Trust Agents (cowritte…
by Rob Cottingham | Apr 23, 2012 | Blogging, Social Signal
Mitch Joel has a lot to share with the world – including some brilliant insights and expertise on marketing, communications and community – so it’s now wonder he’s found so many ways to do it. He has a long-standing blog, a podcast that just passed the…
by Rob Cottingham | Apr 16, 2012 | Social Media, Social Signal, Speechwriting
With this episode, we flip the mic (metaphorically) and talk with someone who’s a lot more used to writing speeches than delivering them. That’s not to say Ian Griffin isn’t at home behind a lectern; he’s an accomplished speaker and a skilled communica…