From 10be57aec4991bd17ece1b05a1a7a6c9656c1f81 Mon Sep 17 00:00:00 2001 From: JC Brand Date: Thu, 28 Feb 2013 20:42:08 +0200 Subject: [PATCH] Add strinclude function --- converse.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/converse.js b/converse.js index 9702fb6ff..c570c5b5b 100644 --- a/converse.js +++ b/converse.js @@ -76,6 +76,12 @@ var xmppchat = {}; xmppchat.msg_counter = 0; + var strinclude = function(str, needle){ + if (needle === '') { return true; } + if (str === null) { return false; } + return String(str).indexOf(needle) !== -1; + }; + xmppchat.toISOString = function (date) { if (typeof date.toISOString !== 'undefined') { return date.toISOString();