Transform input tel|url in view to make it clickable.

This commit is contained in:
Martin Edenhofer 2016-05-30 11:16:56 +02:00
parent 8e9739ec63
commit 6ff8a0b920

View file

@ -102,6 +102,15 @@ class App extends Spine.Controller
isHtmlEscape = true isHtmlEscape = true
result = App.i18n.translateDate(result) 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 = "<a href=\"tel://#{result}\">#{result}</a>"
if attribute_config.type is 'url'
result = App.Utils.linkify(result)
# use pretty time for datetime # use pretty time for datetime
else if attribute_config.tag is 'datetime' else if attribute_config.tag is 'datetime'
isHtmlEscape = true isHtmlEscape = true