diff options
Diffstat (limited to 'tpl/default/tools.html')
-rw-r--r-- | tpl/default/tools.html | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/tpl/default/tools.html b/tpl/default/tools.html index baa033af..35173d17 100644 --- a/tpl/default/tools.html +++ b/tpl/default/tools.html | |||
@@ -72,10 +72,15 @@ | |||
72 | function(){ | 72 | function(){ |
73 | var%20url%20=%20location.href; | 73 | var%20url%20=%20location.href; |
74 | var%20title%20=%20document.title%20||%20url; | 74 | var%20title%20=%20document.title%20||%20url; |
75 | var%20desc=document.getSelection().toString(); | ||
76 | if(desc.length>4000){ | ||
77 | desc=desc.substr(0,4000)+'...'; | ||
78 | alert('{function="str_replace(' ', '%20', t('The selected text is too long, it will be truncated.'))"}'); | ||
79 | } | ||
75 | window.open( | 80 | window.open( |
76 | '{$pageabsaddr}?post='%20+%20encodeURIComponent(url)+ | 81 | '{$pageabsaddr}?post='%20+%20encodeURIComponent(url)+ |
77 | '&title='%20+%20encodeURIComponent(title)+ | 82 | '&title='%20+%20encodeURIComponent(title)+ |
78 | '&description='%20+%20encodeURIComponent(document.getSelection())+ | 83 | '&description='%20+%20encodeURIComponent(desc)+ |
79 | '&source=bookmarklet','_blank','menubar=no,height=800,width=600,toolbar=no,scrollbars=yes,status=no,dialog=1' | 84 | '&source=bookmarklet','_blank','menubar=no,height=800,width=600,toolbar=no,scrollbars=yes,status=no,dialog=1' |
80 | ); | 85 | ); |
81 | } | 86 | } |
@@ -86,8 +91,21 @@ | |||
86 | <div class="tools-item"> | 91 | <div class="tools-item"> |
87 | <a title="{'Drag this link to your bookmarks toolbar or right-click it and Bookmark This Link'|t}, | 92 | <a title="{'Drag this link to your bookmarks toolbar or right-click it and Bookmark This Link'|t}, |
88 | {'Then click ✚Add Note button anytime to start composing a private Note (text post) to your Shaarli'|t}" | 93 | {'Then click ✚Add Note button anytime to start composing a private Note (text post) to your Shaarli'|t}" |
89 | href="?private=1&post=" | 94 | class="bookmarklet-link" |
90 | class="bookmarklet-link"> | 95 | href="javascript:( |
96 | function(){ | ||
97 | var%20desc=document.getSelection().toString(); | ||
98 | if(desc.length>4000){ | ||
99 | desc=desc.substr(0,4000)+'...'; | ||
100 | alert("{function="str_replace(' ', '%20', t('The selected text is too long, it will be truncated.'))"}"); | ||
101 | } | ||
102 | window.open( | ||
103 | '{$pageabsaddr}?private=1&post='+ | ||
104 | '&description='%20+%20encodeURIComponent(desc)+ | ||
105 | '&source=bookmarklet','_blank','menubar=no,height=800,width=600,toolbar=no,scrollbars=yes,status=no,dialog=1' | ||
106 | ); | ||
107 | } | ||
108 | )();"> | ||
91 | <span class="pure-button pure-u-lg-2-3 pure-u-3-4">✚ {'Add Note'|t}</span> | 109 | <span class="pure-button pure-u-lg-2-3 pure-u-3-4">✚ {'Add Note'|t}</span> |
92 | </a> | 110 | </a> |
93 | </div> | 111 | </div> |
@@ -146,4 +164,3 @@ | |||
146 | value="{'Drag this link to your bookmarks toolbar, or right-click it and choose Bookmark This Link'|t}"> | 164 | value="{'Drag this link to your bookmarks toolbar, or right-click it and choose Bookmark This Link'|t}"> |
147 | </body> | 165 | </body> |
148 | </html> | 166 | </html> |
149 | |||