-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.js
85 lines (81 loc) · 2.7 KB
/
index.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/*jslint node: true, vars: true, indent: 4 */
(function (module) {
"use strict";
var path = require("path"),
bootstrap = require("jolira-bootstrap"),
templates = path.join(__dirname, "templates"),
pubdir = path.join(__dirname, "public"),
clientInit = require("./lib/client-init"),
clientLogger = require("./lib/client-logger"),
dispatcher = require("./lib/dispatcher");
function addDefaults(defaults) {
defaults.scripts.push("socket.io/socket.io.js");
[
"js/libs/underscore/underscore-1.3.3.js",
"js/libs/jquery/jquery-1.8.1.js",
"js/libs/backbone/backbone-0.9.2.js",
"js/bootstrap-collapse.js",
"js/bootstrap-dropdown.js",
"js/app-utils.js",
"js/app-starter.js",
"js/app-store.js",
"js/app-middle.js",
"js/app-backbone.js",
"js/app-container.js",
"js/app-menu.js"
].forEach(function (dir) {
defaults.trailingScripts.push(dir);
});
[
{
"name":"HandheldFriendly",
"content":"True"
},
{
"name":"viewport",
"content":"width=device-width,initial-scale=1.0,maximum-scale=1.0"
},
{
"name":"apple-mobile-web-app-capable",
"content":"yes"
},
{
"name":"apple-mobile-web-app-status-bar-style",
"content":"black"
}
].forEach(function (meta) {
defaults.metas.push(meta);
});
[
bootstrap,
pubdir
].forEach(function (dir) {
defaults["public"].unshift(dir);
});
defaults.htmlFiles = [
path.join(templates, "container.html")
];
defaults.templateFiles = [
path.join(templates, "menu.html")
];
[
"img/glyphicons-halflings.png",
"img/glyphicons-halflings-white.png"
].forEach(function (file) {
defaults.manifest.push(file);
});
defaults.links.push({
rel:"apple-touch-startup-image",
href:"startup.png"
});
defaults.useRequireJS = false;
}
module.exports = function (defaults, app, lopts, gopts, cb) {
dispatcher(defaults, app, lopts, gopts, function (err, dispatcher) {
dispatcher.on(clientLogger(app.logger));
dispatcher.on(clientInit(app.logger));
addDefaults(defaults);
return cb(undefined, defaults, dispatcher);
});
};
})(module);