-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.js
166 lines (166 loc) · 4.18 KB
/
config.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
var config = {
//The name of the stylesheet which modifies the boxes/background. Currently working: neon
style:'neon',
//Number of seconds until boxes are checked if update is needed
updateTick:10,
//The diffrent types of boxes you can use which will be initialized/maintained diffrently. Currently working: custom
boxTypes: [
'custom',
'slides',
'subgrid',
'iframe'
],
states: [
'nominal',
'warning',
'alert',
'normal',
'shadow'
],
//The defaults will be used for the boxes with no own property
defaults: {
updateFreq:120,
update:function () {return ['No update function set!', 2]},
state:0
},
//Try to get data from db (NOT IMPLEMENTED YET)
dbConnection:false,
//Boxes to generate if no dbConnection is present
noDBBoxes:[
{
//See the types in config.boxTypes
type:0,
//The default html to be displayed in the displayBox
content:'testbox1',
//The index of the state as in config.states
state:0,
//Function called on refresh; return will be an array of the html to put into the box(at 0) and the index of the state(at 1)
update:function () {return ['testbox1<br>' + Date(), 0]},
//how long to wait until next update in seconds
updateFreq:10,
positioning: {
//width of box
sizeX:8,
//height of box
sizeY:4,
row:1,
col:1
}
},
{
type:0,
content:'testbox2',
update:function () {return ['testbox2<br>' + Date(), 1]},
state:1,
updateFreq:10,
positioning: {
sizeX:8,
sizeY:4,
row:1,
col:9
}
},
{
//See the types in config.boxTypes
type:2,
update:function (boxObj) { /* Handling for the subboxes */ },
//State shadow as we don't want a border around the subboxes
state:4,
//how long to wait until next update in seconds
updateFreq:10,
//number of rows of the subgrid
rows:2,
//number of columns of the subgrid
cols:2,
//Array of subboxes generated on startup
subboxes: [
{
//Html to be displayed in the subbox
content:'Testsubbox1',
state:0,
positioning: {
sizeX:1,
sizeY:1,
row:1,
col:1
}
},
{
content:'Testsubbox2',
state:1,
positioning: {
sizeX:1,
sizeY:1,
row:1,
col:2
}
},
{
content:'Testsubbox3',
state:2,
positioning: {
sizeX:1,
sizeY:1,
row:2,
col:1
}
},
{
content:'Testsubbox4',
state:3,
positioning: {
sizeX:1,
sizeY:1,
row:2,
col:2
}
}
],
positioning: {
sizeX:8,
sizeY:4,
row:5,
col:1
}
},
{
//See the types in config.boxTypes
type:1,
//The default html to be displayed in the displayBox
content:'testbox4',
//The diffrent slides that will be cycled through with every update
slides: [
{
//Function called on refresh; return will be an array of the html to put into the box(at 0) and the index of the state(at 1)
update:function () {return ['testslide1<br>' + Date(), 0]},
//how many seconds this slide is active
updateFreq:10
},
{
update:function () {return ['testslide2<br>' + Date(), 1]},
updateFreq:10
},
{
update:function () {return ['testslide3<br>' + Date(), 2]},
updateFreq:20
},
{
update:function () {return ['testslide4<br>' + Date(), 3]},
updateFreq:10
},
],
//The index of the state as in config.states
state:3,
//how long to wait until next update in seconds; gets overwritten by the currently active slide
updateFreq:10,
positioning: {
//width of box
sizeX:8,
//height of box
sizeY:4,
row:5,
col:9
}
}
]
}