]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Selection is now limited to 2k characters using bookmarklets
authorArthurHoaro <arthur@hoa.ro>
Thu, 25 May 2017 14:45:08 +0000 (16:45 +0200)
committerArthurHoaro <arthur@hoa.ro>
Thu, 25 May 2017 14:45:08 +0000 (16:45 +0200)
to avoid having too large URL

Fixes #528

tpl/default/tools.html

index 6951ad28b6a8d29c4d8edbccff3f7730926d81c4..bf6b6ca3d716c0c2d8af84450164f4c5d51e81e6 100644 (file)
@@ -75,7 +75,7 @@
             window.open(
               '{$pageabsaddr}?post='%20+%20encodeURIComponent(url)+
               '&amp;title='%20+%20encodeURIComponent(title)+
-              '&amp;description='%20+%20encodeURIComponent(document.getSelection())+
+              '&amp;description='%20+%20encodeURIComponent(document.getSelection().toString().substr(0, 2000))+
               '&amp;source=bookmarklet','_blank','menubar=no,height=800,width=600,toolbar=no,scrollbars=yes,status=no,dialog=1'
             );
           }
@@ -91,7 +91,7 @@
           function(){
             window.open(
               '{$pageabsaddr}?private=1&amp;post='+
-              '&amp;description='%20+%20encodeURIComponent(document.getSelection())+
+              '&amp;description='%20+%20encodeURIComponent(document.getSelection().toString().substr(0, 2000))+
               '&amp;source=bookmarklet','_blank','menubar=no,height=800,width=600,toolbar=no,scrollbars=yes,status=no,dialog=1'
             );
           }