view template/bookmarklets.jade.mustache @ 41:293a694304b8

reformat
author drewp@bigasterisk.com
date Sat, 19 Nov 2022 17:18:55 -0800
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