From 9585a1877b7b10600f2f8ca92139da15e4180697 Mon Sep 17 00:00:00 2001 From: JesseWeinstein Date: Mon, 10 Nov 2014 23:16:31 -0800 Subject: [PATCH] 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 --- app/helpers/application_helper.rb | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 2a8999d3b..a51b99a53 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -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)+'¬es='+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)" \ + "+'¬es='+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