From 6ff8a0b92001bc1bb4bfad079c7bde4ec71fee94 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Mon, 30 May 2016 11:16:56 +0200 Subject: [PATCH] Transform input tel|url in view to make it clickable. --- app/assets/javascripts/app/index.coffee | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/assets/javascripts/app/index.coffee b/app/assets/javascripts/app/index.coffee index e2c123e21..40b13500e 100644 --- a/app/assets/javascripts/app/index.coffee +++ b/app/assets/javascripts/app/index.coffee @@ -102,6 +102,15 @@ class App extends Spine.Controller isHtmlEscape = true result = App.i18n.translateDate(result) + # transform input tel|url to make it clickable + if attribute_config.tag is 'input' + isHtmlEscape = true + result = App.Utils.htmlEscape(result) + if attribute_config.type is 'tel' + result = "#{result}" + if attribute_config.type is 'url' + result = App.Utils.linkify(result) + # use pretty time for datetime else if attribute_config.tag is 'datetime' isHtmlEscape = true