mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-08-21 05:45:13 +00:00
10 lines
709 B
JavaScript
10 lines
709 B
JavaScript
![]() |
NEWSBLUR.generate_bookmarklet = function() {
|
||
|
var href = "javascript:function newsblur_bookmarklet() { var d=document,z=d.createElement('scr'+'ipt'),b=d.body,l=d.location; try{ if(!b) { throw(0); } d.title = '(Adding...) ' + d.title; z.setAttribute('src',l.protocol+'//'+'nb.local.host:8000'+'/api/add_site_load_script/"+NEWSBLUR.Globals.secret_token+"?url='+encodeURIComponent(l.href)+'&time='+(new Date().getTime())); b.appendChild(z); } catch(e) {alert('Please wait until the page has loaded.');}}newsblur_bookmarklet();void(0)";
|
||
|
|
||
|
var $bookmarklet = $.make('a', {
|
||
|
className: 'NB-goodies-bookmarklet-button',
|
||
|
href: href
|
||
|
}, 'Add to NewsBlur');
|
||
|
|
||
|
return $bookmarklet;
|
||
|
};
|