Browse Source

don't include quotes if no text is selected

pull/5/head
Aaron Parecki 10 years ago
parent
commit
766fdc0660
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      views/partials/bookmark-bookmarklet.php

+ 1
- 1
views/partials/bookmark-bookmarklet.php View File

@ -1,5 +1,5 @@
javascript:(function(){ javascript:(function(){
var t;try{t=((window.getSelection&&window.getSelection())||(document.getSelection&&document.getSelection())||(document.selection&&document.selection.createRange&&document.selection.createRange().text));}catch(e){t="";}; var t;try{t=((window.getSelection&&window.getSelection())||(document.getSelection&&document.getSelection())||(document.selection&&document.selection.createRange&&document.selection.createRange().text));}catch(e){t="";};
window.location="<?= Config::$base_url ?>bookmark?url="+encodeURIComponent(window.location.href)+"&content="+encodeURIComponent('"'+t+'"')+"&name="+encodeURIComponent(document.title)+"&token=<?= $this->token ?>";
window.location="<?= Config::$base_url ?>bookmark?url="+encodeURIComponent(window.location.href)+"&content="+encodeURIComponent((t ? '"'+t+'"' : ''))+"&name="+encodeURIComponent(document.title)+"&token=<?= $this->token ?>";
})(); })();

Loading…
Cancel
Save