소스 검색

Fix non_amd.html

- converse-muc.js was overriding the global "converse" variable
  with undefind (the factory function didn't return anything)
- locales was not defined in utils.js in non AMD (not passed in
  the factory function)
rlanvin 9 년 전
부모
커밋
00caccd1a3
3개의 변경된 파일5개의 추가작업 그리고 4개의 파일을 삭제
  1. 2 1
      non_amd.html
  2. 1 1
      src/converse-muc.js
  3. 2 2
      src/utils.js

+ 2 - 1
non_amd.html

@@ -47,7 +47,8 @@
     <script type="text/javascript" src="builds/locales.js"></script>
     <script type="text/javascript" src="builds/locales.js"></script>
     <script type="text/javascript" src="builds/templates.js"></script>
     <script type="text/javascript" src="builds/templates.js"></script>
     <script type="text/javascript" src="src/utils.js"></script>
     <script type="text/javascript" src="src/utils.js"></script>
-    <script type="text/javascript" src="converse.js"></script>
+    <script type="text/javascript" src="src/converse-core.js"></script>
+    <script type="text/javascript" src="src/converse-muc.js"></script>
 </head>
 </head>
 <body id="page-top" data-spy="scroll" data-target=".navbar-custom">
 <body id="page-top" data-spy="scroll" data-target=".navbar-custom">
     <section class="intro">
     <section class="intro">

+ 1 - 1
src/converse-muc.js

@@ -19,7 +19,7 @@
         // In this case, the dependencies need to be available already as
         // In this case, the dependencies need to be available already as
         // global variables, and should be loaded separately via *script* tags.
         // global variables, and should be loaded separately via *script* tags.
         // See the file **non_amd.html** for an example of this usecase.
         // See the file **non_amd.html** for an example of this usecase.
-        root.converse = factory(converse, utils);
+        factory(converse, utils);
     }
     }
 }(this, function (converse_api, utils) {
 }(this, function (converse_api, utils) {
     // Strophe methods for building stanzas
     // Strophe methods for building stanzas

+ 2 - 2
src/utils.js

@@ -1,9 +1,9 @@
-/*global jQuery, templates, escape, Jed, _ */
+/*global jQuery, templates, escape, Jed, _, locales */
 (function (root, factory) {
 (function (root, factory) {
     if (typeof define === 'function' && define.amd) {
     if (typeof define === 'function' && define.amd) {
         define(["jquery", "underscore", "converse-templates", "locales"], factory);
         define(["jquery", "underscore", "converse-templates", "locales"], factory);
     } else {
     } else {
-        root.utils = factory(jQuery, _, templates);
+        root.utils = factory(jQuery, _, templates, locales);
     }
     }
 }(this, function ($, _, templates, locales) {
 }(this, function ($, _, templates, locales) {
     "use strict";
     "use strict";