summaryrefslogtreecommitdiffstats
path: root/modules-available/roomplanner/js/init.js
blob: 1d3c18fb2b76130ba59ed5157bf920027419aa2c (plain) (blame)
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
167
168
169
170
171
172
173
174
/* */

function initRoomplanner() {
	
	console.log('initRoomplanner');

	/* make it fullscreen, otherwise there are too many positioning bugs */
	$('.sidebar-bg, .navbar').hide();
	$('#mainpage').css('position', 'static').css('width', '100%').css('max-width', '100%').css('left', '0px');


	$('#drawarea').css('top',(-roomplanner.settings.scale*10)+'px');
	$('#drawarea').css('left',(-roomplanner.settings.scale*10)+'px');
	
	roomplanner.computerAttributes = [
	"muuid",
	"mac_address",
	"ip",
	"hostname"
	];
	
	$("#loadButton").click(function() {
		roomplanner.load($('#serializedRoom').val());
	});

	$("#serializeButton").click(function() {
		$('#serializedRoom').val(roomplanner.serialize());
	});

	$("#saveBtn").click(function() {
		$('#serializedRoom').val(roomplanner.serialize());
		$('#roomForm').submit();
	});
}

var translation = {
	"muuid" : "Machine UUID",
	"mac_address" : "MAC Adresse",
	"ip" : "IP Adresse",
	"hostname": "Rechnername",
	
	"wall-horizontal" : "Wand (horizontal)",
	"wall-vertical" : "Mauer (vertikal)",
	"window-horizontal" : "Fenster",
	"window-vertical" : "Fenster",
	"door-nw" : "Tür",
	"door-ne" : "Tür",
	"door-sw" : "Tür",
	"door-se" : "Tür",
	"door-wn" : "Tür",
	"door-ws" : "Tür",
	"door-en" : "Tür",
	"door-es" : "Tür",			
	//"pc" : "PC",
	"pc-east" : "PC",
	"pc-south" : "PC",
	"pc-west" : "PC",
	"pc-north" : "PC",
	"copier" : "Kopierer",
	"printer" : "Drucker",
	"telephone" : "Telefon",
	"flatscreen" : "Flatscreen",
	"lamp" : "Schreibtischlampe",
	"tvcamera" : "Projektor",
	"4chairs1squaretable" : "4 Stühle und ein quadratischer Tisch",
	//"6chairs1table" : "6 Stühle und ein Tisch",
	"6chairs1table-horizontal" : "6 Stühle und ein Tisch",
	"6chairs1table-vertical" : "6 Stühle und ein Tisch",
	//"8chairs1conferencetable" : "8 Stühle und 1 Konferenztisch",
	"8chairs1conferencetable-horizontal" : "8 Stühle und 1 Konferenztisch",
	"8chairs1conferencetable-vertical" : "8 Stühle und 1 Konferenztisch",
	//"armchair" : "Sessel",
	"armchair-east" : "Sessel",
	"armchair-south" : "Sessel",
	"armchair-west" : "Sessel",
	"armchair-north" : "Sessel",
	//"chair" : "Stuhl",
	"chair-east" : "Stuhl",
	"chair-south" : "Stuhl",
	"chair-west" : "Stuhl",
	"chair-north" : "Stuhl",
	//"chair2" : "Stuhl",
	"chair2-east" : "Stuhl",
	"chair2-south" : "Stuhl",
	"chair2-west" : "Stuhl",
	"chair2-north" : "Stuhl",
	//"classroomdesk" : "Klassenzimmerpult",
	"classroomdesk-east" : "Klassenzimmerpult",
	"classroomdesk-south" : "Klassenzimmerpult",
	"classroomdesk-west" : "Klassenzimmerpult",
	"classroomdesk-north" : "Klassenzimmerpult",
	//"classroomdeskchair" : "Klassenzimmerpult mit Stuhl",
	"classroomdeskchair-east" : "Klassenzimmerpult mit Stuhl",
	"classroomdeskchair-south" : "Klassenzimmerpult mit Stuhl",
	"classroomdeskchair-west" : "Klassenzimmerpult mit Stuhl",
	"classroomdeskchair-north" : "Klassenzimmerpult mit Stuhl",
	//"classroomtable" : "Klassenzimmertisch",
	"classroomtable-east" : "Klassenzimmertisch",
	"classroomtable-south" : "Klassenzimmertisch",
	"classroomtable-west" : "Klassenzimmertisch",
	"classroomtable-north" : "Klassenzimmertisch",
	//"classroomtablechair" : "Klassenzimmertisch mit Stuhl",
	"classroomtablechair-east" : "Klassenzimmertisch mit Stuhl",
	"classroomtablechair-south" : "Klassenzimmertisch mit Stuhl",
	"classroomtablechair-west" : "Klassenzimmertisch mit Stuhl",
	"classroomtablechair-north" : "Klassenzimmertisch mit Stuhl",
	//"coatrack" : "Garderobe",
	"coatrack-east" : "Garderobe",
	"coatrack-south" : "Garderobe",
	"coatrack-west" : "Garderobe",
	"coatrack-north" : "Garderobe",
	//"conferencetable" : "Konferenztisch",
	"conferencetable-horizontal" : "Konferenztisch",
	"conferencetable-vertical" : "Konferenztisch",
	//"couch" : "Couch",
	"couch-east" : "Couch",
	"couch-south" : "Couch",
	"couch-west" : "Couch",
	"couch-north" : "Couch",
	//"greenchair" : "Stuhl",
	"greenchair-east" : "Stuhl",
	"greenchair-south" : "Stuhl",
	"greenchair-west" : "Stuhl",
	"greenchair-north" : "Stuhl",
	"lecturetheaterrow" : "Vorlesungssaalreihe mit Stühlen",
	"lecturetheaterrowseats" : "Vorlesungssaalstuhlreihe",
	//"locker" : "Schließfach",
	"locker-east" : "Schließfach",
	"locker-south" : "Schließfach",
	"locker-west" : "Schließfach",
	"locker-north" : "Schließfach",
	//"podium" : "Podium",
	"podium-east" : "Podium",
	"podium-south" : "Podium",
	"podium-west" : "Podium",
	"podium-north" : "Podium",
	//"roundeddesk" : "Eckschreibtisch",
	"roundeddesk-east" : "Eckschreibtisch",
	"roundeddesk-south" : "Eckschreibtisch",
	"roundeddesk-west" : "Eckschreibtisch",
	"roundeddesk-north" : "Eckschreibtisch",
	"roundtable" : "Runder Tisch",
	//"semicirculartable" : "Nierentisch",
	"semicirculartable-east" : "Nierentisch",
	"semicirculartable-south" : "Nierentisch",
	"semicirculartable-west" : "Nierentisch",
	"semicirculartable-north" : "Nierentisch",
	"squaretable" : "Quadratischer Tisch",
	//"studentdesk" : "Schülerpult",
	"studentdesk-east" : "Schülerpult",
	"studentdesk-south" : "Schülerpult",
	"studentdesk-west" : "Schülerpult",
	"studentdesk-north" : "Schülerpult",
	//"studentdeskchair" : "Schülerpult mit Stuhl",
	"studentdeskchair-east" : "Schülerpult mit Stuhl",
	"studentdeskchair-south" : "Schülerpult mit Stuhl",
	"studentdeskchair-west" : "Schülerpult mit Stuhl",
	"studentdeskchair-north" : "Schülerpult mit Stuhl",
	"papertray" : "Papierfach",
	"wastecan" : "Papierkorb",
	"plant" : "Pflanze",
	"plant2" : "Pflanze",
	"plant3" : "Pflanze",
	"projectionscreen" : "Projektionswand",
	"are you sure" : "Sind Sie sicher?"
};

function __(key) {
	if (translation[key]) {
		return translation[key];
	}

	return key;
}