function(){
var%20url%20=%20location.href;
var%20title%20=%20document.title%20||%20url;
+ var%20desc=document.getSelection().toString();
+ if(desc.length>4000){
+ desc=desc.substr(0,4000)+'...';
+ alert('{function="str_replace(' ', '%20', t('The selected text is too long, it will be truncated.'))"}');
+ }
window.open(
'{$pageabsaddr}?post='%20+%20encodeURIComponent(url)+
'&title='%20+%20encodeURIComponent(title)+
- '&description='%20+%20encodeURIComponent(document.getSelection())+
+ '&description='%20+%20encodeURIComponent(desc)+
'&source=bookmarklet','_blank','menubar=no,height=800,width=600,toolbar=no,scrollbars=yes,status=no,dialog=1'
);
}
<div class="tools-item">
<a title="{'Drag this link to your bookmarks toolbar or right-click it and Bookmark This Link'|t},
{'Then click ✚Add Note button anytime to start composing a private Note (text post) to your Shaarli'|t}"
- href="?private=1&post="
- class="bookmarklet-link">
+ class="bookmarklet-link"
+ href="javascript:(
+ function(){
+ var%20desc=document.getSelection().toString();
+ if(desc.length>4000){
+ desc=desc.substr(0,4000)+'...';
+ alert('{function="str_replace(' ', '%20', t('The selected text is too long, it will be truncated.'))"}');
+ }
+ window.open(
+ '{$pageabsaddr}?private=1&post='+
+ '&description='%20+%20encodeURIComponent(desc)+
+ '&source=bookmarklet','_blank','menubar=no,height=800,width=600,toolbar=no,scrollbars=yes,status=no,dialog=1'
+ );
+ }
+ )();">
<span class="pure-button pure-u-lg-2-3 pure-u-3-4">✚ {'Add Note'|t}</span>
</a>
</div>
value="{'Drag this link to your bookmarks toolbar, or right-click it and choose Bookmark This Link'|t}">
</body>
</html>
-