您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

app.js 2.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /* jshint -W117 */
  2. /* application specific logic */
  3. var APP =
  4. {
  5. init: function () {
  6. this.UI = require("./modules/UI/UI");
  7. this.API = require("./modules/API/API");
  8. this.connectionquality =
  9. require("./modules/connectionquality/connectionquality");
  10. this.statistics = require("./modules/statistics/statistics");
  11. this.RTC = require("./modules/RTC/RTC");
  12. this.desktopsharing =
  13. require("./modules/desktopsharing/desktopsharing");
  14. this.xmpp = require("./modules/xmpp/xmpp");
  15. this.keyboardshortcut =
  16. require("./modules/keyboardshortcut/keyboardshortcut");
  17. this.translation = require("./modules/translation/translation");
  18. this.settings = require("./modules/settings/Settings");
  19. //this.DTMF = require("./modules/DTMF/DTMF");
  20. this.members = require("./modules/members/MemberList");
  21. this.configFetch = require("./modules/config/HttpConfigFetch");
  22. }
  23. };
  24. function init() {
  25. APP.desktopsharing.init();
  26. APP.RTC.start();
  27. APP.xmpp.start();
  28. APP.statistics.start();
  29. APP.connectionquality.init();
  30. APP.keyboardshortcut.init();
  31. APP.members.start();
  32. }
  33. /**
  34. * If we have HTTP endpoint for getting confgi.json configured we're going to
  35. * read it and override properties from config.js and interfaceConfig.js.
  36. * If there is no endpoint we'll just continue with initialization.
  37. * Keep in mind that if the endpoint has been configured and we fail to obtain
  38. * the config for any reason then the conference won't start and error message
  39. * will be displayed to the user.
  40. */
  41. function obtainConfigAndInit() {
  42. if (config.configLocation) {
  43. APP.configFetch.obtainConfig(
  44. config.configLocation, APP.UI.getRoomNode(),
  45. // Get config result callback
  46. function(success, error) {
  47. if (success) {
  48. init();
  49. } else {
  50. // Show obtain config error,
  51. // pass the error object for report
  52. APP.UI.messageHandler.openReportDialog(
  53. null, "dialog.connectError", error);
  54. }
  55. });
  56. } else {
  57. init();
  58. }
  59. }
  60. $(document).ready(function () {
  61. var URLProcessor = require("./modules/config/URLProcessor");
  62. URLProcessor.setConfigParametersFromUrl();
  63. APP.init();
  64. APP.translation.init();
  65. if(APP.API.isEnabled())
  66. APP.API.init();
  67. APP.UI.start(obtainConfigAndInit);
  68. });
  69. $(window).bind('beforeunload', function () {
  70. if(APP.API.isEnabled())
  71. APP.API.dispose();
  72. });
  73. module.exports = APP;