From 435e2dae0e9204afd7288c14748e88f680276969 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 11 Nov 2013 00:21:00 -0800 Subject: display encrypted text inline --- view/tpl/jot-header.tpl | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'view/tpl') diff --git a/view/tpl/jot-header.tpl b/view/tpl/jot-header.tpl index 05928bc32..4457a6d52 100755 --- a/view/tpl/jot-header.tpl +++ b/view/tpl/jot-header.tpl @@ -361,6 +361,42 @@ function enableOnUser(){ }; + function b2h(s) { + var y = s; + function rep(re, str) { + y = y.replace(re,str); + }; + + rep(/\n/gi,"
"); + rep(/\[b\]/gi,""); + rep(/\[\/b\]/gi,""); + rep(/\[i\]/gi,""); + rep(/\[\/i\]/gi,""); + rep(/\[u\]/gi,""); + rep(/\[\/u\]/gi,""); + rep(/\[hr\]/gi,"
"); + rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,"$2"); + rep(/\[url\](.*?)\[\/url\]/gi,"$1"); + rep(/\[img=(.*?)x(.*?)\](.*?)\[\/img\]/gi,""); + rep(/\[img\](.*?)\[\/img\]/gi,""); + + rep(/\[list\](.*?)\[\/list\]/gi, ''); + rep(/\[list=\](.*?)\[\/list\]/gi, ''); + rep(/\[list=1\](.*?)\[\/list\]/gi, ''); + rep(/\[list=i\](.*?)\[\/list\]/gi,''); + rep(/\[list=I\](.*?)\[\/list\]/gi, ''); + rep(/\[list=a\](.*?)\[\/list\]/gi, ''); + rep(/\[list=A\](.*?)\[\/list\]/gi, ''); + rep(/\[li\](.*?)\[\/li\]/gi, '
  • $1
  • '); + rep(/\[color=(.*?)\](.*?)\[\/color\]/gi,"$2"); + rep(/\[size=(.*?)\](.*?)\[\/size\]/gi,"$2"); + rep(/\[code\](.*?)\[\/code\]/gi,"$1"); + rep(/\[quote.*?\](.*?)\[\/quote\]/gi,"
    $1
    "); + + return y; + }; + + {{$geotag}} -- cgit v1.2.3