Browse Source

Allow non-amd usage of converse.js without requiring OTR modules.

JC Brand 11 năm trước cách đây
mục cha
commit
9bce25109c
1 tập tin đã thay đổi với 5 bổ sung1 xóa
  1. 5 1
      converse.js

+ 5 - 1
converse.js

@@ -30,7 +30,11 @@
             evaluate : /\{\[([\s\S]+?)\]\}/g,
             interpolate : /\{\{([\s\S]+?)\}\}/g
         };
-        root.converse = factory(jQuery, _, OTR, DSA, console || {log: function(){}});
+        if ((typeof OTR !== "undefined") && (typeof DSA !== "undefined")) {
+            root.converse = factory(jQuery, _, OTR, DSA, console);
+        } else {
+            root.converse = factory(jQuery, _, undefined, undefined, console);
+        }
     }
 }(this, function ($, _, OTR, DSA, console) {
     $.fn.addHyperlinks = function() {