I was starting to explore how to integrate Wordpress into the browser. The default way to blog something is to use the current browserwindow to go to the post page, and the results are that you’re navigating away from the page you want to blog about. Since the Blog button is just a bunch of javascripts, I’ve decided to make it blog in a new window. A Quick google search for “javascript location browser.open” gave me:
Displaying Popup Windows
With a example that shows a hyperlink using the window.open method to open a new browser window.
The Button/Favorite link/bookmark now holds this: Remember to fix example.com to your domain. Here is my modified WordPress Blog button:
javascript:if(navigator.userAgent.indexOf('Safari') >= 0){Q=getSelection();}else{Q=document.selection?document.selection.createRange().text:document.getSelection();}window.open('http://www.example.com/wp-admin/post.php?text='+encodeURIComponent(Q)+'&popupurl='+encodeURIComponent(location.href)+'&popuptitle='+encodeURIComponent(document.title), 'blog');void(0);
If you’re new here, you may want to subscribe to my RSS feed.
Thanks for visiting!


Recent Comments