Monday, 27 February 2012

Bookmarklets FTW: Preview Your Blogspot Posts Like a Boss!

Bookmarklets FTW!
Bookmarklets are little (and sometimes not so little) script snippets which are stored as browser bookmarks, thus they can be invoked easily and quickly. They are tremendous help, especially for a lazy programmer like the one I always claim to be, always seeking shortcuts, scripts and automation. Let the computer do the work for you when possible, I say.
I keep a collection of my own home-made bookmarklets which I find handy, and I will share at least some of them here occasionally.
Bookmarklets work on all web browsers except on Internet Explorer, which means they work on all web browsers.
For Google Chrome there is even a option to convert bookmarklets into Chrome extensions!
Article Level:
You should have found this
out for youself!
Previewing Blogger (Blogspot) posts
Blogger (the free service on which I'm running this blog, also referred to by the domain name Blogspot) is quite a comfortable free platform. When editing a post there is an option to preview its live layout, with all relevant styles applied, just as it will eventually appear when published.
However, all clicks are blocked on this blog post preview. Clicking images, tags, hyperlinks does not work. This can be quite annoying, for example in order to check my links or to see if the Lightboxed images open properly (I do not use the built-in Google lightbox in my posts, but a different one based on jQuery).

The code
Here is the code used in this bookmarklet:
javascript: (function() { var alldivs=document.getElementsByTagName("div"); var clickTrapDiv=nullfor(var i=0; i < alldivs.length; i++) { if (alldivs[i].className == "blogger-clickTrap") {clickTrapDiv = alldivs[i]; break;}} if(clickTrapDiv == null) { alert("Couldn't find the div with class blogger-clickTrap. Better luck next time..."); } else { clickTrapDiv.style.display = "none"; alert("Click-blocking div removed successfully."); } })()
As always,corrections/improvements are welcome :-)

Add it to your browser
To add it to your browser, drag the following link to your browser's bookmarks bar:

Use it
To use the bookmarklet while previewing a post, just click it!
Click to see this screen capture demo:

28 comments:

  1. Replies
    1. IEEE Final Year projects Project Centers in Chennai are consistently sought after. Final Year Students Projects take a shot at them to improve their aptitudes. IEEE Final Year project centers ground for all fragments of CSE & IT engineers hoping to assemble.Final Year Projects for CSE

      Spring Framework has already made serious inroads as an integrated technology stack for building user-facing applications. Spring Framework Corporate TRaining .

      Specifically, Spring Framework provides various tasks are geared around preparing data for further analysis and visualization. Spring Training in Chennai

      The Angular Training covers a wide range of topics including Angular Directives, Angular Services, and Angular programmability.Angular Training

      Delete
  2. Thanks for sharing such a great blog Keep posting.
    Loadrunner Training in Delhi

    ReplyDelete
  3. Nice information, valuable and excellent design, as share good stuff with good ideas and concepts, lots of great information and inspiration, both of which I need, thanks to offer such a helpful information here. 안전놀이터

    ReplyDelete
  4. I finally found great post here.I will get back here. I just added your blog to my bookmark sites. thanks.Quality posts is the crucial to invite the visitors to visit the web page, that's what this web page is providing. 토토사이트

    ReplyDelete
  5. it was a wonderful chance to visit this kind of site and I am happy to know. thank you so much for giving us a chance to have this opportunity..


    Dot Net Training in Chennai | Dot Net Training in anna nagar | Dot Net Training in omr | Dot Net Training in porur | Dot Net Training in tambaram | Dot Net Training in velachery







    ReplyDelete
  6. I think this is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article. 먹튀검증

    ReplyDelete
  7. I should say convert pdf to word only that its awesome! The blog is informational and always produce amazing things

    ReplyDelete
  8.  definitely enjoying every little bit of it. It is a great website and nice share. I want to thank you. Good job! You guys do a great blog, and have some great contents. Keep up the good work google ad copy

    ReplyDelete
  9. An academic certificate is a document that certifies that a person has received specific education or has passed a test or series of tests. In many countries, a certificate is a qualification attained in secondary education. ... In many other countries, certificates are qualifications in higher education. master grower certification

    ReplyDelete
  10. Interested in the DevOps Training in Chennai with Placement opportunities? Infycle Technologies will help you for getting an excellent DevOps training in practical teaching methods along with 100% placement guidance. To get your first DevOps job with the highest salary package, get a free demo from us by dialing 7504633633 or 7502633633.

    ReplyDelete


  11. Infycle Technologies offers the best Python training in Chennai for tech professionals and freshers with New year offers. In addition to the Python Training Course, Infycle also offers other technical courses such as Data Science, Oracle, Java, Power BI, Digital Marketing, Big Data, etc., which will be trained with complete practical classes. Dial 7504633633 to get more info and a free demo.

    ReplyDelete
  12. Thank you - Just shared this post with a colleague who would benefit from reading this, really enjoyed it. Read about power apps online training from Maria Academy.

    ReplyDelete
  13. Congratulations on your article, it was very helpful and successful. 86a90a9c4dd644c728c2d8d3fb0a7d54
    sms onay
    numara onay
    website kurma

    ReplyDelete
  14. Thank you for your explanation, very good content. 83b10d0b2d16f0ff142610cef30502d6
    define dedektörü

    ReplyDelete