Browse Source

Add strinclude function

JC Brand 12 năm trước cách đây
mục cha
commit
10be57aec4
1 tập tin đã thay đổi với 6 bổ sung0 xóa
  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();