JS ES6

Javascript code posted
created at 10 Nov 01:42, updated at 18 Nov 19:03

Edit | Back
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
require([ 'bowser' ], function(bowser) {

  if (bowser.msie) {
    alert("Sorry, but this application does not currently work in Internet Explorer.\nUntil support for Internet Explorer is added, please use Google Chrome.");
    // window.location.href = '/unsupported-browser';
    return;
  }


  require([ 'global/polyfills' ]);


  // region Vendor Dependencies

  require([ 'backbone' ]);
  require([ 'jquery.ui' ]);
  require([ 'jquery.multiple-select' ]);

  require([ 'moment' ],                        function(moment)                     { window.moment = window.Moment = moment; });                         // eslint-disable-line brace-style
  require([ 'multi-select-dropdown-element' ], function(MultiSelectDropdownElement) { window.MultiSelectDropdownElement = MultiSelectDropdownElement; }); // eslint-disable-line brace-style
  require([ 'sticky-table-headers' ],          function(StickyTableHeaders)         { window.STH = StickyTableHeaders; });                                // eslint-disable-line brace-style

  // endregion


  // region Global Scripts

  require([ 'global/_' ]);
  require([ 'global/$$' ]);
  require([ 'global/backbone' ]);
  require([ 'global/object' ]);
  require([ 'global/array' ]);
  require([ 'global/node-list' ]);
  require([ 'global/string' ]);
  require([ 'global/_old/styles' ]); // FIXME: Remove need for 'global/_old/styles'


  require([ 'global/moment' ], function(momentExts) {
    Object.assign(window.moment,           momentExts.static);
    Object.assign(window.moment.prototype, momentExts.instance);
  });

  // endregion


  require([ 'template-helpers/template-helpers', 'application' ], function(templateHelpers, Application) {
    _.templateSettings.imports = Object.assign(_.templateSettings.imports, templateHelpers);

    require([ '_generated/templates' ], function(templates) {
      window.app = new Application(templates);
      window.app.start();
    });
  });
});
1.95 KB in 7 ms with coderay