فهرست منبع

Add strinclude function

JC Brand 12 سال پیش
والد
کامیت
10be57aec4
1فایلهای تغییر یافته به همراه6 افزوده شده و 0 حذف شده
  1. 6 0
      converse.js

+ 6 - 0
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();