Skip to content
This repository
  • 2 commits
  • 2 files changed
  • 0 comments
  • 1 contributor
51  Resources/Core/css/selector.css
... ...
@@ -1,26 +1,27 @@
1  
-/* Selector CSS */
2  
-
3  
-.selector {
4  
-	background: black;
5  
-	height: 50px;
6  
-	color: #33B5E5;
7  
-}
8  
-
9  
-.selector p {
10  
-	border-bottom: 5px solid;
11  
-	float: left;
12  
-	padding: 13px;
13  
-	margin: 0px;
14  
-}
15  
-
16  
-.selector p:hover {
17  
-	color: #FFBB33;
18  
-}
19  
-
20  
-.selector p:focus {
21  
-	color: #FFBB33;
22  
-}
23  
-
24  
-.selected {
25  
-	color: white;
  1
+/* Selector CSS */
  2
+
  3
+.selector {
  4
+	background: black;
  5
+	height: 50px;
  6
+	color: #33B5E5;
  7
+}
  8
+
  9
+.selector p {
  10
+	border-bottom: 5px solid;
  11
+	float: left;
  12
+	padding: 13px;
  13
+	margin: 0px;
  14
+}
  15
+
  16
+.selector p:hover {
  17
+	color: #FFBB33;
  18
+	cursor: pointer;cursor: hand;
  19
+}
  20
+
  21
+.selector p:focus {
  22
+	color: #FFBB33;
  23
+}
  24
+
  25
+.selected {
  26
+	color: white;
26 27
 }
530  Resources/Core/js/scripts.js
... ...
@@ -1,266 +1,266 @@
1  
-//JavaScript Document
2  
-
3  
-var Selector = new selector;
4  
-var Cookie = new cookie;
5  
-var Dialog = new dialog;
6  
-var Page = new page;
7  
-var Variable = new variable;
8  
-
9  
-var lastAjax = "Not set";
10  
-
11  
-function load() {
12  
-	document.getElementById('splashcontinue').style.display = "block";
13  
-	//dragResizeLoad();
14  
-}
15  
-
16  
-function unveil() {
17  
-	document.getElementById('splashtext').className = 'unveil';
18  
-	delay("document.getElementById('splashcontinue').className = 'unveil'",250);
19  
-	delay("document.getElementById('splashtext').style.right = '100%'",950);
20  
-	delay("document.getElementById('splashcontinue').style.right = '100%'",1200);
21  
-	delay("document.getElementById('splash').style.display = 'none'",1200);
22  
-	delay("showContent()",1200);
23  
-}
24  
-
25  
-function showContent() {
26  
-	document.getElementById('content').style.display = 'block';
27  
-	document.getElementById('leftnav').style.display = 'block';
28  
-}
29  
-
30  
-function delay(command, time) {
31  
-	setTimeout(command, time);
32  
-}
33  
-
34  
-function logout() {
35  
-	var username = Cookie.getCookie("username");
36  
-	ajax("logout", username);
37  
-	Cookie.setCookie("sessionhash","0");
38  
-	Cookie.setCookie("username","0");
39  
-	delay('window.location.reload()',1500);
40  
-}
41  
-
42  
-function ajax(type, query) {
43  
-	var verify = Cookie.getCookie('sessionhash');
44  
-	var username = Cookie.getCookie('username');
45  
-	var xmlhttp;
46  
-	if (window.XMLHttpRequest) {
47  
-		// code for IE7+, Firefox, Chrome, Opera, Safari
48  
-	  	xmlhttp=new XMLHttpRequest();
49  
-	} else {
50  
-		// code for IE6, IE5
51  
-	  	xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
52  
-	}
53  
-	xmlhttp.onreadystatechange=function() {
54  
-	  if (xmlhttp.readyState==4 && xmlhttp.status==200) {
55  
-	  	console.log("Query successful");
56  
-	  	//console.log(xmlhttp.responseText);
57  
-		lastAjax = xmlhttp.responseText;
58  
-	    return(true);
59  
-	  } else {
60  
-	  	//console.log("Query failed");
61  
-	    return(false);
62  
-	  }
63  
-	}
64  
-	xmlhttp.open("GET","Resources/Core/ajax.php?type="+type+"&query="+query+"&verify="+verify+"&username="+username,true);
65  
-	xmlhttp.send();
66  
-}
67  
-
68  
-function selector() {
69  
-	this.setCurrent = function(id, group) {
70  
-		this.onColor = "#FFF";
71  
-		this.offColor = "#33B5E5";
72  
-		this.counter = new Array();
73  
-
74  
-		if (group == "overview") {
75  
-			if (id == "info") {
76  
-				this.counter[0] = "status"
77  
-			}
78  
-
79  
-			if (id == "status") {
80  
-				this.counter[0] = "info"
81  
-			}
82  
-		}
83  
-
84  
-		if (group == "variables") {
85  
-			if (id == "editVariables") {
86  
-				this.counter[0] = "search"
87  
-			}
88  
-
89  
-			if (id == "search") {
90  
-				this.counter[0] = "editVariables"
91  
-			}
92  
-		}
93  
-
94  
-		for (var i = this.counter.length - 1; i >= 0; i--) {
95  
-			this.turnOn(id);
96  
-			this.turnOff(this.counter[0]);
97  
-			this.show(id);
98  
-			this.hide(this.counter[0]);
99  
-		}
100  
-	}
101  
-
102  
-	this.turnOff = function(id) {
103  
-		document.getElementById(id+'Button').style.color = this.offColor;
104  
-	}
105  
-
106  
-	this.turnOn = function(id) {
107  
-		document.getElementById(id+'Button').style.color = this.onColor;
108  
-	}
109  
-
110  
-	this.show = function(id) {
111  
-		document.getElementById(id).style.display = "block";
112  
-	}
113  
-
114  
-	this.hide = function(id) {
115  
-		document.getElementById(id).style.display = "none";
116  
-	}
117  
-}
118  
-
119  
-function cookie() {
120  
-	this.getCookie = function(c_name) {
121  
-		var i,x,y,ARRcookies=document.cookie.split(";");
122  
-		for (i=0;i<ARRcookies.length;i++) {
123  
-	 		x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
124  
-	  		y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
125  
-	  		x=x.replace(/^\s+|\s+$/g,"");
126  
-		  	if (x==c_name) {
127  
-		  		return unescape(y);
128  
-		  	}
129  
-	 	}
130  
-	}
131  
-
132  
-	this.setCookie = function(c_name,value,exdays) {
133  
-		var exdate=new Date();
134  
-		exdate.setDate(exdate.getDate() + exdays);
135  
-		var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());
136  
-		document.cookie=c_name + "=" + c_value;
137  
-	}
138  
-}
139  
-
140  
-function page() {
141  
-	this.write = function(id, column) {
142  
-		//name = 0
143  
-		//title = 1
144  
-		//description = 2
145  
-		//location = 3
146  
-		var value = "ERROR";
147  
-		var query;
148  
-		var columnname;
149  
-		if (column == 0) {
150  
-			value = document.getElementById(id+'name').value;
151  
-			columnname = "name";
152  
-		} else if (column == 1) {
153  
-			value = document.getElementById(id+'title').value;
154  
-			columnname = "title";
155  
-		} else if (column == 2) {
156  
-			value = document.getElementById(id+'description').value;
157  
-			columnname = "description";
158  
-		} else if (column == 3) {
159  
-			value = document.getElementById(id+'location').value;
160  
-			columnname = "location";
161  
-		}
162  
-		if (value != "ERROR") {
163  
-			query = "UPDATE `pages` SET `"+columnname+"` = '"+value+"' WHERE `pages`.`id` = "+id+";";
164  
-			ajax("query",query);
165  
-		}
166  
-	}
167  
-
168  
-	this.remove = function(id) {
169  
-		var query = "DELETE FROM `pages` WHERE `id` = "+id;
170  
-		//console.log(query);
171  
-		ajax("query", query);
172  
-		delay('ajax("pages", "")', 200);
173  
-		delay("document.getElementById('pagestable').innerHTML = lastAjax", 1600);
174  
-	}
175  
-}
176  
-
177  
-function variable() {
178  
-	this.write = function(id) {
179  
-		var value = "ERROR";
180  
-		var name = "ERROR";
181  
-		var query;
182  
-		var columnname;
183  
-		value = document.getElementById(id+'varvalue').value;
184  
-		name = document.getElementById(id+'varname').value;
185  
-		if (value != "ERROR" && name != "ERROR") {
186  
-			query = "UPDATE `variables` SET `name` = '"+name+"', `text` = '"+value+"' WHERE `variables`.`id` = "+id+";";
187  
-			//console.log(query);
188  
-			ajax("query",query);
189  
-		}
190  
-	}
191  
-
192  
-	this.remove = function(id) {
193  
-		var query = "DELETE FROM `variables` WHERE `id` = "+id;
194  
-		//console.log(query);
195  
-		ajax("query", query);
196  
-		delay('ajax("variables", "")', 200);
197  
-		delay("document.getElementById('variablestable').innerHTML = lastAjax", 1600);
198  
-	}
199  
-	
200  
-	this.addDialog = function() {
201  
-		Dialog.open("Add Variable", "Please Wait...");
202  
-		Dialog.setContent('addvariable.php');
203  
-	}
204  
-	
205  
-	this.add = function() {
206  
-		var name = document.getElementById('newvariablename').value;
207  
-		var value = document.getElementById('newvariablevalue').value;
208  
-		var type = document.getElementById('newvariableselector').value;
209  
-		var query = "INVALID";
210  
-		if (type == 0) {
211  
-			query = "INSERT INTO `variables` (`name`, `type`, `num`, `text`, `location`, `zone`, `boolean`, `id`) VALUES ('"+name+"', '0', '"+value+"', NULL, NULL, NULL, NULL, NULL);";
212  
-		} else if (type == 1) {
213  
-			query = "INSERT INTO `variables` (`name`, `type`, `num`, `text`, `location`, `zone`, `boolean`, `id`) VALUES ('"+name+"', '1', NULL, '"+value+"', NULL, NULL, NULL, NULL);";
214  
-		} else if (type == 2) {
215  
-			query = "INSERT INTO `variables` (`name`, `type`, `num`, `text`, `location`, `zone`, `boolean`, `id`) VALUES ('"+name+"', '2', NULL, NULL, '"+value+"', NULL, NULL, NULL);";
216  
-		} else if (type == 3) {
217  
-			query = "INSERT INTO `variables` (`name`, `type`, `num`, `text`, `location`, `zone`, `boolean`, `id`) VALUES ('"+name+"', '3', NULL, NULL, NULL, '"+value+"', NULL, NULL);";
218  
-		} else if (type == 4) {
219  
-			query = "INSERT INTO `variables` (`name`, `type`, `num`, `text`, `location`, `zone`, `boolean`, `id`) VALUES ('"+name+"', '4', NULL, NULL, NULL, NULL, '"+value+"', NULL);";
220  
-		}
221  
-		ajax("query", query);
222  
-		delay('ajax("variables", "")', 200);
223  
-		delay("document.getElementById('variablestable').innerHTML = lastAjax", 1600);
224  
-		Dialog.close();
225  
-	}
226  
-	
227  
-	this.setAddFormType = function() {
228  
-		var type = document.getElementById('newvariableselector').value;
229  
-		if (type == 0) {
230  
-			document.getElementById('newvariablevalue').type = "number";
231  
-		} else if (type == 1) {
232  
-			document.getElementById('newvariablevalue').type = "text";
233  
-		} else if (type == 2) {
234  
-			document.getElementById('newvariablevalue').type = "text";
235  
-		} else if (type == 3) {
236  
-			document.getElementById('newvariablevalue').type = "text";
237  
-		} else if (type == 4) {
238  
-			document.getElementById('newvariablevalue').type = "number";
239  
-		}
240  
-	}
241  
-}
242  
-
243  
-function dialog() {
244  
-	this.open = function(title, content) {
245  
-		document.getElementById('dialog').style.display = "block";
246  
-		document.getElementById('dialogTitle').innerHTML = title;
247  
-		document.getElementById('dialogContent').innerHTML = content;
248  
-	}
249  
-	
250  
-	this.setContent = function(page) {
251  
-		ajax("content", page);
252  
-		delay("document.getElementById('dialogContent').innerHTML = lastAjax",1600);
253  
-	}
254  
-
255  
-	this.close = function() {
256  
-		document.getElementById('dialog').style.display = "none";
257  
-	}
258  
-}
259  
-
260  
-function is_int(value){ 
261  
-  if((parseFloat(value) == parseInt(value)) && !isNaN(value)){
262  
-      return true;
263  
-  } else { 
264  
-      return false;
265  
-  } 
  1
+//JavaScript Document
  2
+
  3
+var Selector = new selector;
  4
+var Cookie = new cookie;
  5
+var Dialog = new dialog;
  6
+var Page = new page;
  7
+var Variable = new variable;
  8
+
  9
+var lastAjax = "Not set";
  10
+
  11
+function load() {
  12
+	document.getElementById('splashcontinue').style.display = "block";
  13
+	//dragResizeLoad();
  14
+}
  15
+
  16
+function unveil() {
  17
+	document.getElementById('splashtext').className = 'unveil';
  18
+	delay("document.getElementById('splashcontinue').className = 'unveil'",250);
  19
+	delay("document.getElementById('splashtext').style.right = '100%'",950);
  20
+	delay("document.getElementById('splashcontinue').style.right = '100%'",1200);
  21
+	delay("document.getElementById('splash').style.display = 'none'",1200);
  22
+	delay("showContent()",1200);
  23
+}
  24
+
  25
+function showContent() {
  26
+	document.getElementById('content').style.display = 'block';
  27
+	document.getElementById('leftnav').style.display = 'block';
  28
+}
  29
+
  30
+function delay(command, time) {
  31
+	setTimeout(command, time);
  32
+}
  33
+
  34
+function logout() {
  35
+	var username = Cookie.getCookie("username");
  36
+	ajax("logout", username);
  37
+	Cookie.setCookie("sessionhash","0");
  38
+	Cookie.setCookie("username","0");
  39
+	delay('window.location.reload()',1500);
  40
+}
  41
+
  42
+function ajax(type, query) {
  43
+	var verify = Cookie.getCookie('sessionhash');
  44
+	var username = Cookie.getCookie('username');
  45
+	var xmlhttp;
  46
+	if (window.XMLHttpRequest) {
  47
+		// code for IE7+, Firefox, Chrome, Opera, Safari
  48
+	  	xmlhttp=new XMLHttpRequest();
  49
+	} else {
  50
+		// code for IE6, IE5
  51
+	  	xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  52
+	}
  53
+	xmlhttp.onreadystatechange=function() {
  54
+	  if (xmlhttp.readyState==4 && xmlhttp.status==200) {
  55
+	  	console.log("Query successful");
  56
+	  	//console.log(xmlhttp.responseText);
  57
+		lastAjax = xmlhttp.responseText;
  58
+	    return(true);
  59
+	  } else {
  60
+	  	//console.log("Query failed");
  61
+	    return(false);
  62
+	  }
  63
+	}
  64
+	xmlhttp.open("GET","Resources/Core/ajax.php?type="+type+"&query="+query+"&verify="+verify+"&username="+username,true);
  65
+	xmlhttp.send();
  66
+}
  67
+
  68
+function selector() {
  69
+	this.setCurrent = function(id, group) {
  70
+		this.onColor = "#FFF";
  71
+		this.offColor = "#33B5E5";
  72
+		this.counter = new Array();
  73
+
  74
+		if (group == "overview") {
  75
+			if (id == "info") {
  76
+				this.counter[0] = "status"
  77
+			}
  78
+
  79
+			if (id == "status") {
  80
+				this.counter[0] = "info"
  81
+			}
  82
+		}
  83
+
  84
+		if (group == "variables") {
  85
+			if (id == "editVariables") {
  86
+				this.counter[0] = "search"
  87
+			}
  88
+
  89
+			if (id == "search") {
  90
+				this.counter[0] = "editVariables"
  91
+			}
  92
+		}
  93
+
  94
+		for (var i = this.counter.length - 1; i >= 0; i--) {
  95
+			this.turnOn(id);
  96
+			this.turnOff(this.counter[0]);
  97
+			this.show(id);
  98
+			this.hide(this.counter[0]);
  99
+		}
  100
+	}
  101
+
  102
+	this.turnOff = function(id) {
  103
+		document.getElementById(id+'Button').setAttribute("class", "deselected");
  104
+	}
  105
+
  106
+	this.turnOn = function(id) {
  107
+		document.getElementById(id+'Button').setAttribute("class", "selected");
  108
+	}
  109
+
  110
+	this.show = function(id) {
  111
+		document.getElementById(id).style.display = "block";
  112
+	}
  113
+
  114
+	this.hide = function(id) {
  115
+		document.getElementById(id).style.display = "none";
  116
+	}
  117
+}
  118
+
  119
+function cookie() {
  120
+	this.getCookie = function(c_name) {
  121
+		var i,x,y,ARRcookies=document.cookie.split(";");
  122
+		for (i=0;i<ARRcookies.length;i++) {
  123
+	 		x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
  124
+	  		y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
  125
+	  		x=x.replace(/^\s+|\s+$/g,"");
  126
+		  	if (x==c_name) {
  127
+		  		return unescape(y);
  128
+		  	}
  129
+	 	}
  130
+	}
  131
+
  132
+	this.setCookie = function(c_name,value,exdays) {
  133
+		var exdate=new Date();
  134
+		exdate.setDate(exdate.getDate() + exdays);
  135
+		var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());
  136
+		document.cookie=c_name + "=" + c_value;
  137
+	}
  138
+}
  139
+
  140
+function page() {
  141
+	this.write = function(id, column) {
  142
+		//name = 0
  143
+		//title = 1
  144
+		//description = 2
  145
+		//location = 3
  146
+		var value = "ERROR";
  147
+		var query;
  148
+		var columnname;
  149
+		if (column == 0) {
  150
+			value = document.getElementById(id+'name').value;
  151
+			columnname = "name";
  152
+		} else if (column == 1) {
  153
+			value = document.getElementById(id+'title').value;
  154
+			columnname = "title";
  155
+		} else if (column == 2) {
  156
+			value = document.getElementById(id+'description').value;
  157
+			columnname = "description";
  158
+		} else if (column == 3) {
  159
+			value = document.getElementById(id+'location').value;
  160
+			columnname = "location";
  161
+		}
  162
+		if (value != "ERROR") {
  163
+			query = "UPDATE `pages` SET `"+columnname+"` = '"+value+"' WHERE `pages`.`id` = "+id+";";
  164
+			ajax("query",query);
  165
+		}
  166
+	}
  167
+
  168
+	this.remove = function(id) {
  169
+		var query = "DELETE FROM `pages` WHERE `id` = "+id;
  170
+		//console.log(query);
  171
+		ajax("query", query);
  172
+		delay('ajax("pages", "")', 200);
  173
+		delay("document.getElementById('pagestable').innerHTML = lastAjax", 1600);
  174
+	}
  175
+}
  176
+
  177
+function variable() {
  178
+	this.write = function(id) {
  179
+		var value = "ERROR";
  180
+		var name = "ERROR";
  181
+		var query;
  182
+		var columnname;
  183
+		value = document.getElementById(id+'varvalue').value;
  184
+		name = document.getElementById(id+'varname').value;
  185
+		if (value != "ERROR" && name != "ERROR") {
  186
+			query = "UPDATE `variables` SET `name` = '"+name+"', `text` = '"+value+"' WHERE `variables`.`id` = "+id+";";
  187
+			//console.log(query);
  188
+			ajax("query",query);
  189
+		}
  190
+	}
  191
+
  192
+	this.remove = function(id) {
  193
+		var query = "DELETE FROM `variables` WHERE `id` = "+id;
  194
+		//console.log(query);
  195
+		ajax("query", query);
  196
+		delay('ajax("variables", "")', 200);
  197
+		delay("document.getElementById('variablestable').innerHTML = lastAjax", 1600);
  198
+	}
  199
+	
  200
+	this.addDialog = function() {
  201
+		Dialog.open("Add Variable", "Please Wait...");
  202
+		Dialog.setContent('addvariable.php');
  203
+	}
  204
+	
  205
+	this.add = function() {
  206
+		var name = document.getElementById('newvariablename').value;
  207
+		var value = document.getElementById('newvariablevalue').value;
  208
+		var type = document.getElementById('newvariableselector').value;
  209
+		var query = "INVALID";
  210
+		if (type == 0) {
  211
+			query = "INSERT INTO `variables` (`name`, `type`, `num`, `text`, `location`, `zone`, `boolean`, `id`) VALUES ('"+name+"', '0', '"+value+"', NULL, NULL, NULL, NULL, NULL);";
  212
+		} else if (type == 1) {
  213
+			query = "INSERT INTO `variables` (`name`, `type`, `num`, `text`, `location`, `zone`, `boolean`, `id`) VALUES ('"+name+"', '1', NULL, '"+value+"', NULL, NULL, NULL, NULL);";
  214
+		} else if (type == 2) {
  215
+			query = "INSERT INTO `variables` (`name`, `type`, `num`, `text`, `location`, `zone`, `boolean`, `id`) VALUES ('"+name+"', '2', NULL, NULL, '"+value+"', NULL, NULL, NULL);";
  216
+		} else if (type == 3) {
  217
+			query = "INSERT INTO `variables` (`name`, `type`, `num`, `text`, `location`, `zone`, `boolean`, `id`) VALUES ('"+name+"', '3', NULL, NULL, NULL, '"+value+"', NULL, NULL);";
  218
+		} else if (type == 4) {
  219
+			query = "INSERT INTO `variables` (`name`, `type`, `num`, `text`, `location`, `zone`, `boolean`, `id`) VALUES ('"+name+"', '4', NULL, NULL, NULL, NULL, '"+value+"', NULL);";
  220
+		}
  221
+		ajax("query", query);
  222
+		delay('ajax("variables", "")', 200);
  223
+		delay("document.getElementById('variablestable').innerHTML = lastAjax", 1600);
  224
+		Dialog.close();
  225
+	}
  226
+	
  227
+	this.setAddFormType = function() {
  228
+		var type = document.getElementById('newvariableselector').value;
  229
+		if (type == 0) {
  230
+			document.getElementById('newvariablevalue').type = "number";
  231
+		} else if (type == 1) {
  232
+			document.getElementById('newvariablevalue').type = "text";
  233
+		} else if (type == 2) {
  234
+			document.getElementById('newvariablevalue').type = "text";
  235
+		} else if (type == 3) {
  236
+			document.getElementById('newvariablevalue').type = "text";
  237
+		} else if (type == 4) {
  238
+			document.getElementById('newvariablevalue').type = "number";
  239
+		}
  240
+	}
  241
+}
  242
+
  243
+function dialog() {
  244
+	this.open = function(title, content) {
  245
+		document.getElementById('dialog').style.display = "block";
  246
+		document.getElementById('dialogTitle').innerHTML = title;
  247
+		document.getElementById('dialogContent').innerHTML = content;
  248
+	}
  249
+	
  250
+	this.setContent = function(page) {
  251
+		ajax("content", page);
  252
+		delay("document.getElementById('dialogContent').innerHTML = lastAjax",1600);
  253
+	}
  254
+
  255
+	this.close = function() {
  256
+		document.getElementById('dialog').style.display = "none";
  257
+	}
  258
+}
  259
+
  260
+function is_int(value){ 
  261
+  if((parseFloat(value) == parseInt(value)) && !isNaN(value)){
  262
+      return true;
  263
+  } else { 
  264
+      return false;
  265
+  } 
266 266
 }

No commit comments for this range

Something went wrong with that request. Please try again.