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:
JesseWeinstein 2014-11-10 23:41:34 -08:00
parent ea33ef9e0b
commit fb51e9aa43

View file

@ -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(){" \