Mercurial > code > home > repos > href
view template/bookmarklets.jade.mustache @ 21:8008ec2fd763
fix up link page reloading. tried davisjs; may not need it
Ignore-this: d0021609f019f0734e779a61e3e73b62
author | Drew Perttula <drewp@bigasterisk.com> |
---|---|
date | Thu, 11 Jul 2013 00:45:55 -0700 |
parents | e054949143e9 |
children |
line wrap: on
line source
p Bookmarklet to jump to the add page from a given page: a(href="javascript:(function(){ window.location.href = '{{absRoot}}/addLink?url='+encodeURIComponent(window.location.href)+ '&title='+encodeURIComponent(document.title)+ '&selected='+encodeURIComponent(''+( window.getSelection ? window.getSelection(): document.getSelection? document.getSelection(): document.selection.createRange().text)); })()") addpage p Bookmarklet to get this form over any page (unfinished): a(href="javascript:(function(){ var s=document.createElement('div'); s.innerHTML='Loading...'; s.style.position='fixed'; s.style.zIndex='9999'; s.style.border='2px solid black'; s.style.top='40px'; s.style.right='40px'; s.style.bottom='40px'; s.style.left='40px'; s.style.background='white'; document.body.appendChild(s); s=document.createElement('script'); s.setAttribute('type','text/javascript'); s.setAttribute('src','{{absRoot}}/addOverlay'+ '?url='+encodeURIComponent(window.location.href)+ '&title='+encodeURIComponent(document.title)+ '&selected='+encodeURIComponent(''+( window.getSelection ? window.getSelection(): document.getSelection? document.getSelection(): document.selection.createRange().text)) ); document.body.appendChild(s); })();") addlink