From 261b88b39c94a5c306dc909c3689fd0e047617ce Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 3 Feb 2009 19:09:59 +0300 Subject: offline: render headlines list using local data --- functions.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'functions.js') diff --git a/functions.js b/functions.js index ecb41db2e..2b0370d39 100644 --- a/functions.js +++ b/functions.js @@ -2109,3 +2109,13 @@ function transport_error_check(transport) { return true; } +function strip_tags(s) { + return s.replace(/<\/?[^>]+(>|$)/g, ""); +} + +function truncate_string(s, length) { + if (!length) length = 30; + var tmp = s.substring(0, length); + if (s.length > length) tmp += "…"; + return tmp; +} -- cgit v1.2.3