浏览代码

Add a new build without OTR to be used on IE.

JC Brand 11 年之前
父节点
当前提交
3fea9a09a8
共有 5 个文件被更改,包括 80 次插入5 次删除
  1. 2 1
      Gruntfile.js
  2. 8 2
      index.html
  3. 2 2
      src/build-no-otr.js
  4. 49 0
      src/build-website-no-otr.js
  5. 19 0
      src/deps-website-no-otr.js

+ 2 - 1
Gruntfile.js

@@ -101,7 +101,8 @@ module.exports = function(grunt) {
         exec('./node_modules/requirejs/bin/r.js -o src/build.js && ' +
              './node_modules/requirejs/bin/r.js -o src/build-no-locales-no-otr.js && ' +
              './node_modules/requirejs/bin/r.js -o src/build-no-otr.js &&' +
-             './node_modules/requirejs/bin/r.js -o src/build-website.js', callback);
+             './node_modules/requirejs/bin/r.js -o src/build-website.js &&' + 
+             './node_modules/requirejs/bin/r.js -o src/build-website-no-otr.js', callback);
     });
 
     grunt.registerTask('minify', 'Create a new release', ['cssmin', 'jsmin']);

+ 8 - 2
index.html

@@ -12,8 +12,14 @@
     <link type="text/css" rel="stylesheet" media="screen" href="components/fontawesome/css/font-awesome.min.css" />
     <link type="text/css" rel="stylesheet" media="screen" href="css/theme.css" />
     <link type="text/css" rel="stylesheet" media="screen" href="css/converse.min.css" />
-    <!-- <script data-main="main" src="components/requirejs/require.js"></script> -->
-    <script src="builds/converse.website.min.js"></script>
+    <!-- Only for development: <script data-main="main" src="components/requirejs/require.js"></script> -->
+    <![if IE]>
+        <!-- Disable Off-the-record encryption for IE, which doesn't have a CSPRNG -->
+        <script src="builds/converse.website-no-otr.min.js"></script>
+    <![endif]>
+    <![if !IE]>
+        <script src="builds/converse.website.min.js"></script>
+    <![endif]>
 </head>
 
 <body id="page-top" data-spy="scroll" data-target=".navbar-custom">

+ 2 - 2
src/build-no-otr.js

@@ -21,13 +21,14 @@
         "fr": "locale/fr/LC_MESSAGES/fr",
         "he": "locale/he/LC_MESSAGES/he",
         "hu": "locale/hu/LC_MESSAGES/hu",
-        "it": "locale/it/LC_MESSAGES/it",
         "id": "locale/id/LC_MESSAGES/id",
+        "it": "locale/it/LC_MESSAGES/it",
         "ja": "locale/ja/LC_MESSAGES/ja",
         "nl": "locale/nl/LC_MESSAGES/nl",
         "pt_BR": "locale/pt_BR/LC_MESSAGES/pt_BR", 
         "ru": "locale/ru/LC_MESSAGES/ru",
         "zh": "locale/zh/LC_MESSAGES/zh",
+        "jquery.browser": "components/jquery.browser/dist/jquery.browser",
         "underscore": "components/underscore/underscore",
         "backbone": "components/backbone/backbone",
         "backbone.browserStorage": "components/backbone.browserStorage/backbone.browserStorage",
@@ -38,7 +39,6 @@
         "strophe.vcard": "components/strophe.vcard/index",
         "strophe.disco": "components/strophe.disco/index",
         "converse-dependencies": "src/deps-no-otr",
-        "jquery.browser": "components/jquery.browser/dist/jquery.browser",
         "moment":"components/momentjs/moment",
         "converse-templates":"src/templates",
         "tpl": "components/requirejs-tpl-jcbrand/tpl",

+ 49 - 0
src/build-website-no-otr.js

@@ -0,0 +1,49 @@
+({
+    baseUrl: "../",
+    name: "components/almond/almond.js",
+    out: "../builds/converse.website-no-otr.min.js",
+    include: ['main'],
+    tpl: {
+        // Use Mustache style syntax for variable interpolation
+        templateSettings: {
+            evaluate : /\{\[([\s\S]+?)\]\}/g,
+            interpolate : /\{\{([\s\S]+?)\}\}/g
+        }
+    },
+    paths: {
+        "jquery": "components/jquery/dist/jquery",
+        "jed": "components/jed/jed",
+        "locales": "locale/locales",
+        "af": "locale/af/LC_MESSAGES/af",
+        "de": "locale/de/LC_MESSAGES/de",
+        "en": "locale/en/LC_MESSAGES/en",
+        "es": "locale/es/LC_MESSAGES/es",
+        "fr": "locale/fr/LC_MESSAGES/fr",
+        "he": "locale/he/LC_MESSAGES/he",
+        "hu": "locale/hu/LC_MESSAGES/hu",
+        "id": "locale/id/LC_MESSAGES/id",
+        "it": "locale/it/LC_MESSAGES/it",
+        "ja": "locale/ja/LC_MESSAGES/ja",
+        "nl": "locale/nl/LC_MESSAGES/nl",
+        "pt_BR": "locale/pt_BR/LC_MESSAGES/pt_BR", 
+        "ru": "locale/ru/LC_MESSAGES/ru",
+        "zh": "locale/zh/LC_MESSAGES/zh",
+        "jquery.browser": "components/jquery.browser/dist/jquery.browser",
+        "underscore": "components/underscore/underscore",
+        "backbone": "components/backbone/backbone",
+        "backbone.browserStorage": "components/backbone.browserStorage/backbone.browserStorage",
+        "backbone.overview": "components/backbone.overview/backbone.overview",
+        "bootstrap": "components/bootstrap/dist/js/bootstrap",                  // XXX: Only required for https://conversejs.org website
+        "jquery.easing": "components/jquery-easing-original/jquery.easing.1.3", // XXX: Only required for https://conversejs.org website
+        "strophe": "components/strophe/strophe",
+        "strophe.muc": "components/strophe.muc/index",
+        "strophe.roster": "components/strophe.roster/index",
+        "strophe.vcard": "components/strophe.vcard/index",
+        "strophe.disco": "components/strophe.disco/index",
+        "converse-dependencies": "src/deps-website-no-otr",
+        "moment":"components/momentjs/moment",
+        "converse-templates":"src/templates",
+        "tpl": "components/requirejs-tpl-jcbrand/tpl",
+        "text": "components/requirejs-text/text"
+    }
+})

+ 19 - 0
src/deps-website-no-otr.js

@@ -0,0 +1,19 @@
+define("converse-dependencies", [
+    "moment",
+    "locales",
+    "bootstrap", // XXX: Can be removed, only for https://conversejs.org
+    "backbone.browserStorage",
+    "backbone.overview",
+    "jquery.browser",
+    "jquery.easing", // XXX: Can be removed, only for https://conversejs.org
+    "strophe",
+    "strophe.muc",
+    "strophe.roster",
+    "strophe.vcard",
+    "strophe.disco"
+], function(moment) {
+    return {
+        'otr': undefined,
+        'moment': moment
+    };
+});