2
0
Эх сурвалжийг харах

Fixes #608

The no-jquery build was broken
JC Brand 9 жил өмнө
parent
commit
d4c127e196

+ 1 - 1
src/build-no-dependencies.js

@@ -39,7 +39,7 @@
         "underscore"
     ],
     wrap: {
-        endFile: "wrapper-end.js"
+        endFile: ["wrapper-no-jquery.js", "wrapper-no-deps.js"]
     },
     insertRequire: ['converse'],
     mainConfigFile: '../converse.js'

+ 4 - 1
src/build-no-jquery.js

@@ -5,5 +5,8 @@
     include: ['converse'],
     exclude: ['jquery', 'jquery-private'],
     insertRequire: ['converse'],
-    mainConfigFile: '../converse.js'
+    mainConfigFile: '../converse.js',
+    wrap: {
+        endFile: "wrapper-no-jquery.js"
+    }
 })

+ 32 - 0
src/wrapper-no-deps.js

@@ -0,0 +1,32 @@
+/*global jQuery, _, moment, Strophe, $build, $iq, $msg, $pres, SHA1, Base64, MD5, DSA, OTR */
+define('jquery.browser', [], function () { return jQuery; });
+define('typeahead', [], function () { return jQuery; });
+define('underscore', [], function () { return _; });
+define('moment_with_locales', [], function () { return moment; });
+define('strophe', [], function () {
+    return {
+        'Strophe':         Strophe,
+        '$build':          $build,
+        '$iq':             $iq,
+        '$msg':            $msg,
+        '$pres':           $pres,
+        'SHA1':            SHA1,
+        'Base64':          Base64,
+        'MD5':             MD5,
+        'b64_hmac_sha1':   SHA1.b64_hmac_sha1,
+        'b64_sha1':        SHA1.b64_sha1,
+        'str_hmac_sha1':   SHA1.str_hmac_sha1,
+        'str_sha1':        SHA1.str_sha1
+    };
+});
+var strophePlugin = function () { return Strophe; };
+var emptyFunction = function () { };
+define('strophe.disco', ['strophe'], strophePlugin);
+define('strophe.ping', ['strophe'], strophePlugin);
+define('strophe.rsm', ['strophe'], strophePlugin);
+define('strophe.vcard', ['strophe'], strophePlugin);
+define('backbone', [], emptyFunction);
+define('backbone.browserStorage', ['backbone'], emptyFunction);
+define('backbone.overview', ['backbone'], emptyFunction);
+define('otr', [], function () { return { 'DSA': DSA, 'OTR': OTR };});
+define("locales", [], emptyFunction);

+ 3 - 0
src/wrapper-no-jquery.js

@@ -0,0 +1,3 @@
+/*global jQuery */
+define('jquery', [], function () { return jQuery; });
+define('jquery-private', [], function () { return jQuery; });