forked from born2net/studio-lite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
StudioLite.js
64 lines (58 loc) · 2.5 KB
/
StudioLite.js
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
55
56
57
58
59
60
61
62
63
64
/**
StudioLite MediaSignage Inc (c) open source digital signage project.
Visit Github for licenses and docs: http://git.digitalsignage.com
@class StudioLite
@constructor
@return {Object} instantiated StudioLite
**/
define(['underscore', 'jquery', 'backbone', 'bootstrap', 'backbone.controller', 'ComBroker', 'Lib', 'Pepper', 'PepperHelper', 'Elements', 'bootbox', 'platform'], function (_, $, Backbone, Bootstrap, backbonecontroller, ComBroker, Lib, Pepper, PepperHelper, Elements, bootbox, platform) {
var StudioLite = Backbone.Controller.extend({
// app init
initialize: function () {
var self = this;
window.BB = Backbone;
window.bootbox = bootbox;
BB.globs = {};
BB.globs['CREDENTIALS'] = '';
BB.SERVICES = {};
BB.EVENTS = {};
BB.CONSTS = {};
BB.globs['UNIQUE_COUNTER'] = 0;
BB.globs['RC4KEY'] = '226a3a42f34ddd778ed2c3ba56644315';
BB.lib = new Lib();
BB.lib.addBackboneViewOptions();
BB.lib.selectionSwitcher();
BB.comBroker = new ComBroker();
BB.comBroker.name = 'AppBroker';
BB.Pepper = new Pepper();
_.extend(BB.Pepper, BB.comBroker);
BB.Pepper.clearServices();
BB.Pepper.name = 'JalapenoBroker';
BB.PepperHelper = new PepperHelper();
window.pepper = BB.Pepper;
window.log = BB.lib.log;
BB.platform = platform;
BB.lib.forceBrowserCompatibility();
BB.lib.promptOnExit();
$.ajaxSetup({cache: false});
// localization
require(['LanguageSelectorView', 'Elements'], function (LanguageSelectorView, Elements) {
new LanguageSelectorView({appendTo: Elements.LANGUAGE_SELECTION_LOGIN});
});
// theme
require(['simplestorage'], function (simplestorage) {
var theme = simplestorage.get('theme');
if (theme && theme != 'light')
BB.lib.loadCss('style_' + theme + '.css');
BB.CONSTS['THEME'] = _.isUndefined(theme) ? 'light' : theme;
});
// router init
require(['LayoutRouter', 'Events'], function (LayoutRouter) {
var LayoutRouter = new LayoutRouter();
BB.history.start();
LayoutRouter.navigate('authenticate/_/_', {trigger: true});
});
}
});
return StudioLite;
});