Split bookmarklet_url literal string into lines

To improve the readabilit of diffs that modify it, per https://github.com/diaspora/diaspora/pull/5384#issuecomment-62443426
This commit is contained in:
JesseWeinstein 2014-11-10 23:16:31 -08:00
parent aec00f834f
commit 9585a1877b

View file

@ -22,7 +22,24 @@ module ApplicationHelper
end
def bookmarklet_url( height = 400, width = 620)
"javascript:(function(){f='#{AppConfig.pod_uri.to_s}bookmarklet?url='+encodeURIComponent(window.location.href)+'&title='+encodeURIComponent(document.title)+'&notes='+encodeURIComponent(''+(window.getSelection?window.getSelection():document.getSelection?document.getSelection():document.selection.createRange().text))+'&v=1&';a=function(){if(!window.open(f+'noui=1&jump=doclose','diasporav1','location=yes,links=no,scrollbars=yes,toolbar=no,width=#{width},height=#{height}'))location.href=f+'jump=yes'};if(/Firefox/.test(navigator.userAgent)){setTimeout(a,0)}else{a()}})()"
"javascript:(function(){" \
"f='#{AppConfig.pod_uri.to_s}bookmarklet" \
"?url='+encodeURIComponent(window.location.href)" \
"+'&title='+encodeURIComponent(document.title)" \
"+'&notes='+encodeURIComponent(''+" \
"(window.getSelection?window.getSelection():" \
"document.getSelection?document.getSelection():" \
"document.selection.createRange().text))" \
"+'&v=1&';" \
"a=function(){" \
"if(!window.open(f+'noui=1&jump=doclose'," \
"'diasporav1'," \
"'location=yes,links=no,scrollbars=yes,toolbar=no,width=#{width},height=#{height}'))" \
"location.href=f+'jump=yes'};" \
"if(/Firefox/.test(navigator.userAgent)){" \
"setTimeout(a,0)" \
"}else{a()}" \
"})()"
end
def contacts_link