main.js 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. var config;
  2. if (typeof(require) === 'undefined') {
  3. /* XXX: Hack to work around r.js's stupid parsing.
  4. * We want to save the configuration in a variable so that we can reuse it in
  5. * tests/main.js.
  6. */
  7. require = {
  8. config: function (c) {
  9. config = c;
  10. }
  11. };
  12. }
  13. require.config({
  14. baseUrl: '.',
  15. paths: {
  16. "backbone": "components/backbone/backbone",
  17. "backbone.browserStorage": "components/backbone.browserStorage/backbone.browserStorage",
  18. "backbone.overview": "components/backbone.overview/backbone.overview",
  19. "bootstrap": "components/bootstrap/dist/js/bootstrap", // XXX: Only required for https://conversejs.org website
  20. "bootstrapJS": "components/bootstrapJS/index", // XXX: Only required for https://conversejs.org website
  21. "converse-dependencies": "src/deps-website",
  22. "converse-templates": "src/templates",
  23. "eventemitter": "components/otr/build/dep/eventemitter",
  24. "jquery": "components/jquery/dist/jquery",
  25. "jquery-private": "src/jquery-private",
  26. "jquery.browser": "components/jquery.browser/index",
  27. "jquery.easing": "components/jquery-easing-original/index", // XXX: Only required for https://conversejs.org website
  28. "moment": "components/momentjs/moment",
  29. "strophe": "components/strophe/strophe",
  30. "strophe.disco": "components/strophejs-plugins/disco/strophe.disco",
  31. "strophe.muc": "components/strophe.muc/index",
  32. "strophe.roster": "src/strophe.roster",
  33. "strophe.vcard": "components/strophejs-plugins/vcard/strophe.vcard",
  34. "text": 'components/requirejs-text/text',
  35. "tpl": 'components/requirejs-tpl-jcbrand/tpl',
  36. "typeahead": "components/typeahead.js/index",
  37. "underscore": "components/underscore/underscore",
  38. "utils": "src/utils",
  39. // Off-the-record-encryption
  40. "bigint": "src/bigint",
  41. "crypto": "src/crypto",
  42. "crypto.aes": "components/otr/vendor/cryptojs/aes",
  43. "crypto.cipher-core": "components/otr/vendor/cryptojs/cipher-core",
  44. "crypto.core": "components/otr/vendor/cryptojs/core",
  45. "crypto.enc-base64": "components/otr/vendor/cryptojs/enc-base64",
  46. "crypto.evpkdf": "components/crypto-js-evanvosberg/src/evpkdf",
  47. "crypto.hmac": "components/otr/vendor/cryptojs/hmac",
  48. "crypto.md5": "components/crypto-js-evanvosberg/src/md5",
  49. "crypto.mode-ctr": "components/otr/vendor/cryptojs/mode-ctr",
  50. "crypto.pad-nopadding": "components/otr/vendor/cryptojs/pad-nopadding",
  51. "crypto.sha1": "components/otr/vendor/cryptojs/sha1",
  52. "crypto.sha256": "components/otr/vendor/cryptojs/sha256",
  53. "salsa20": "components/otr/build/dep/salsa20",
  54. "otr": "src/otr",
  55. // Locales paths
  56. "locales": "locale/locales",
  57. "jed": "components/jed/jed",
  58. "af": "locale/af/LC_MESSAGES/af",
  59. "de": "locale/de/LC_MESSAGES/de",
  60. "en": "locale/en/LC_MESSAGES/en",
  61. "es": "locale/es/LC_MESSAGES/es",
  62. "fr": "locale/fr/LC_MESSAGES/fr",
  63. "he": "locale/he/LC_MESSAGES/he",
  64. "hu": "locale/hu/LC_MESSAGES/hu",
  65. "id": "locale/id/LC_MESSAGES/id",
  66. "it": "locale/it/LC_MESSAGES/it",
  67. "ja": "locale/ja/LC_MESSAGES/ja",
  68. "nb": "locale/nb/LC_MESSAGES/nb",
  69. "nl": "locale/nl/LC_MESSAGES/nl",
  70. "pt_BR": "locale/pt_BR/LC_MESSAGES/pt_BR",
  71. "ru": "locale/ru/LC_MESSAGES/ru",
  72. "zh": "locale/zh/LC_MESSAGES/zh",
  73. // Templates
  74. "action": "src/templates/action",
  75. "add_contact_dropdown": "src/templates/add_contact_dropdown",
  76. "add_contact_form": "src/templates/add_contact_form",
  77. "change_status_message": "src/templates/change_status_message",
  78. "chat_status": "src/templates/chat_status",
  79. "chatarea": "src/templates/chatarea",
  80. "chatbox": "src/templates/chatbox",
  81. "chatroom": "src/templates/chatroom",
  82. "chatroom_password_form": "src/templates/chatroom_password_form",
  83. "chatroom_sidebar": "src/templates/chatroom_sidebar",
  84. "chatrooms_tab": "src/templates/chatrooms_tab",
  85. "chats_panel": "src/templates/chats_panel",
  86. "choose_status": "src/templates/choose_status",
  87. "contacts_panel": "src/templates/contacts_panel",
  88. "contacts_tab": "src/templates/contacts_tab",
  89. "controlbox": "src/templates/controlbox",
  90. "controlbox_toggle": "src/templates/controlbox_toggle",
  91. "field": "src/templates/field",
  92. "form_captcha": "src/templates/form_captcha",
  93. "form_checkbox": "src/templates/form_checkbox",
  94. "form_input": "src/templates/form_input",
  95. "form_select": "src/templates/form_select",
  96. "form_textarea": "src/templates/form_textarea",
  97. "form_username": "src/templates/form_username",
  98. "group_header": "src/templates/group_header",
  99. "info": "src/templates/info",
  100. "login_panel": "src/templates/login_panel",
  101. "login_tab": "src/templates/login_tab",
  102. "message": "src/templates/message",
  103. "new_day": "src/templates/new_day",
  104. "occupant": "src/templates/occupant",
  105. "pending_contact": "src/templates/pending_contact",
  106. "pending_contacts": "src/templates/pending_contacts",
  107. "register_panel": "src/templates/register_panel",
  108. "register_tab": "src/templates/register_tab",
  109. "registration_form": "src/templates/registration_form",
  110. "registration_request": "src/templates/registration_request",
  111. "requesting_contact": "src/templates/requesting_contact",
  112. "requesting_contacts": "src/templates/requesting_contacts",
  113. "room_description": "src/templates/room_description",
  114. "room_item": "src/templates/room_item",
  115. "room_panel": "src/templates/room_panel",
  116. "roster": "src/templates/roster",
  117. "roster_item": "src/templates/roster_item",
  118. "search_contact": "src/templates/search_contact",
  119. "select_option": "src/templates/select_option",
  120. "status_option": "src/templates/status_option",
  121. "toggle_chats": "src/templates/toggle_chats",
  122. "toolbar": "src/templates/toolbar",
  123. "trimmed_chat": "src/templates/trimmed_chat"
  124. },
  125. map: {
  126. // '*' means all modules will get 'jquery-private'
  127. // for their 'jquery' dependency.
  128. '*': { 'jquery': 'jquery-private' },
  129. // 'jquery-private' wants the real jQuery module
  130. // though. If this line was not here, there would
  131. // be an unresolvable cyclic dependency.
  132. 'jquery-private': { 'jquery': 'jquery' }
  133. },
  134. tpl: {
  135. // Configuration for requirejs-tpl
  136. // Use Mustache style syntax for variable interpolation
  137. templateSettings: {
  138. evaluate : /\{\[([\s\S]+?)\]\}/g,
  139. interpolate : /\{\{([\s\S]+?)\}\}/g
  140. }
  141. },
  142. // define module dependencies for modules not using define
  143. shim: {
  144. 'underscore': { exports: '_' },
  145. 'crypto.aes': { deps: ['crypto.cipher-core'] },
  146. 'crypto.cipher-core': { deps: ['crypto.enc-base64', 'crypto.evpkdf'] },
  147. 'crypto.enc-base64': { deps: ['crypto.core'] },
  148. 'crypto.evpkdf': { deps: ['crypto.md5'] },
  149. 'crypto.hmac': { deps: ['crypto.core'] },
  150. 'crypto.md5': { deps: ['crypto.core'] },
  151. 'crypto.mode-ctr': { deps: ['crypto.cipher-core'] },
  152. 'crypto.pad-nopadding': { deps: ['crypto.cipher-core'] },
  153. 'crypto.sha1': { deps: ['crypto.core'] },
  154. 'crypto.sha256': { deps: ['crypto.core'] },
  155. 'bigint': { deps: ['crypto'] },
  156. 'strophe': { exports: 'Strophe' },
  157. 'strophe.disco': { deps: ['strophe'] },
  158. 'strophe.muc': { deps: ['strophe'] },
  159. 'strophe.register': { deps: ['strophe'] },
  160. 'strophe.roster': { deps: ['strophe'] },
  161. 'strophe.vcard': { deps: ['strophe'] }
  162. }
  163. });
  164. if (typeof(require) === 'function') {
  165. require(["converse"], function(converse) {
  166. window.converse = converse;
  167. });
  168. }