{"id":372,"date":"2014-10-20T17:41:21","date_gmt":"2014-10-21T00:41:21","guid":{"rendered":"http:\/\/alexboisvert.com\/musings\/?p=372"},"modified":"2014-10-20T17:46:22","modified_gmt":"2014-10-21T00:46:22","slug":"rot-13-bookmarklet","status":"publish","type":"post","link":"https:\/\/alexboisvert.com\/musings\/2014\/10\/20\/rot-13-bookmarklet\/","title":{"rendered":"Rot-13 Bookmarklet"},"content":{"rendered":"<p><a href=\"javascript:(function(){javascript:var%20coding=&quot;abcdefghijklmnopqrstuvwxyzabcdefghijklmABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLM&quot;;function%20rot13(t){for(var%20r=&quot;&quot;,i=0;i<t.length;i++){character=t.charAt(i);position=coding.indexOf(character);if(position>-1)character=coding.charAt(position+13);r+=character;}return%20r;}function%20getSelText(){var%20txt=&quot;&quot;;if(window.getSelection){txt=window.getSelection();}else%20if(document.getSelection){txt=document.getSelection();}else%20if(document.selection){txt=document.selection.createRange().text;}else%20return;return%20txt;}S=getSelText();function%20t(N){return%20N.nodeType==N.TEXT_NODE;}function%20r(N){if(t(N))N.data=rot13(N.data);}for(j=0;j<S.rangeCount;++j){var%20g=S.getRangeAt(j),e=g.startContainer,f=g.endContainer,E=g.startOffset,F=g.endOffset,m=(e==f);if(!m||!t(e)){q=document.createTreeWalker(g.commonAncestorContainer,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,null,false);q.currentNode=e;for(N=q.nextNode();N&#038;&#038;N!=f;N=q.nextNode())r(N);}if(t(f))f.splitText(F);if(!m)r(f);if(t(e)){r(k=e.splitText(E));if(m)f=k;e=k;}if(t(f))g.setEnd(f,f.data.length);}void%200})();\">Rot-13<\/a><\/p>\n<p>Drag this link into the bookmark toolbar of Firefox or Chrome.  When you highlight text in your browser and click the bookmarklet, it will automatically be encrypted (or decrypted) with Rot-13.  Want to try it out?  Highlight the following and click the bookmarklet.<\/p>\n<blockquote><p>Url, pbatenghyngvbaf, vg ybbxf yvxr vg\u2019f jbexvat!<\/p><\/blockquote>\n<p>The code is based on <a href=\"https:\/\/www.squarefree.com\/bookmarklets\/pagedata.html\">the Rot-13 bookmarklet found here<\/a>, with extra functionality for selecting more highlighted info <a href=\"http:\/\/stackoverflow.com\/a\/2377947\">from this StackOverflow answer<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Rot-13 Drag this link into the bookmark toolbar of Firefox or Chrome. When you highlight text in your browser and click the bookmarklet, it will automatically be encrypted (or decrypted) with Rot-13. Want to try it out? Highlight the following &hellip; <a href=\"https:\/\/alexboisvert.com\/musings\/2014\/10\/20\/rot-13-bookmarklet\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,6],"tags":[],"class_list":["post-372","post","type-post","status-publish","format-standard","hentry","category-coding","category-miscellaneous"],"_links":{"self":[{"href":"https:\/\/alexboisvert.com\/musings\/wp-json\/wp\/v2\/posts\/372","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alexboisvert.com\/musings\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/alexboisvert.com\/musings\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/alexboisvert.com\/musings\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/alexboisvert.com\/musings\/wp-json\/wp\/v2\/comments?post=372"}],"version-history":[{"count":7,"href":"https:\/\/alexboisvert.com\/musings\/wp-json\/wp\/v2\/posts\/372\/revisions"}],"predecessor-version":[{"id":379,"href":"https:\/\/alexboisvert.com\/musings\/wp-json\/wp\/v2\/posts\/372\/revisions\/379"}],"wp:attachment":[{"href":"https:\/\/alexboisvert.com\/musings\/wp-json\/wp\/v2\/media?parent=372"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alexboisvert.com\/musings\/wp-json\/wp\/v2\/categories?post=372"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alexboisvert.com\/musings\/wp-json\/wp\/v2\/tags?post=372"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}