summaryrefslogtreecommitdiff
path: root/functions.js
diff options
context:
space:
mode:
Diffstat (limited to 'functions.js')
-rw-r--r--functions.js10
1 files changed, 10 insertions, 0 deletions
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 += "&hellip;";
+ return tmp;
+}