view template/bookmarklets.jade.mustache @ 10:e054949143e9

reworking addlink and shareWith support Ignore-this: b1665b776f3964f7fde219acadc51f32
author drewp@bigasterisk.com
date Fri, 15 Mar 2013 00:29:53 -0700
parents
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