Only include the quote markdown if needed
Intentionally do a converting-comparison against the empty string, to see if text is selected.
This commit is contained in:
parent
ea33ef9e0b
commit
fb51e9aa43
1 changed files with 4 additions and 4 deletions
|
|
@ -23,12 +23,12 @@ module ApplicationHelper
|
|||
|
||||
def bookmarklet_url( height = 400, width = 620)
|
||||
"javascript:(function(){" \
|
||||
"t=(window.getSelection?window.getSelection():" \
|
||||
"document.getSelection?document.getSelection():" \
|
||||
"document.selection.createRange().text);" \
|
||||
"f='#{AppConfig.pod_uri.to_s}bookmarklet" \
|
||||
"?content='+encodeURIComponent('##%20'+document.title+" \
|
||||
"'\n>%20'+"
|
||||
"(window.getSelection?window.getSelection():" \
|
||||
"document.getSelection?document.getSelection():" \
|
||||
"document.selection.createRange().text)" \
|
||||
"(t!=''?('\n>%20'+t):'')" \
|
||||
"+'\n\n'+window.location.href)" \
|
||||
"+'&v=1&';" \
|
||||
"a=function(){" \
|
||||
|
|
|
|||
Loading…
Reference in a new issue