-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCode.js
More file actions
111 lines (104 loc) · 2.79 KB
/
Code.js
File metadata and controls
111 lines (104 loc) · 2.79 KB
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
var properties;
var maclab = {
room_name: "SDMS Lab 021",
type: "seatmap",
slideInfo: [
{
mode: 'signin',
type: 'textBox',
lastSlide: true,
directions: "Type your student ID and click Go"
},
{
mode: 'signout',
type: 'chooseSeat',
lastSlide: false,
directions: "Click on your name to sign out"
},
{
mode: 'signout',
type: 'dropDown',
lastSlide: true,
directions: "Choose your destination, then click Go",
options: ["cafeteria", "classroom", "mediacenter", "office", "nurse", "locker", "bathroom", "water"]
}
]
};
function setProperties(){
properties = {
room_name: "WHS Media Center",
type: "namelist",
slideInfo: [
{
mode: 'signin',
type: 'textBox',
lastSlide: false,
directions: "Type your student ID."
},
{
mode: 'signin',
type: 'dropDown',
lastSlide: false,
directions: "Choose assignment or purpose."
options: ["research", "independent-study", "homework-study", "nehs-writing-center", "work-study-volunteer", "check-out-book", "lunch-study", "other"]
},
{
mode: 'signin',
type: 'textBox',
lastSlide: true,
directions: "Enter name of subject teacher that signed your pass."
}
{
mode: 'signout',
type: 'chooseSeat',
lastSlide: false,
directions: "Click on your name to sign out"
},
{
mode: 'signout',
type: 'dropDown',
lastSlide: true,
directions: "Choose your destination, then click Go",
options: ["cafeteria", "classroom", "mediacenter", "office", "nurse", "locker", "bathroom", "water"]
}
]
};
}
function include(filename){
return HtmlService.createHtmlOutputFromFile(filename)
.setSandboxMode(HtmlService.SandboxMode.IFRAME)
.getContent();
}
function generateSlides() {
setProperties();
var slides = [];
var slideInfo = properties['slideInfo'];
for(var i in slideInfo){
var s = slideInfo[i];
var html = "<div id='slide-" + (i) + "' class='" + s.mode+"'>" + s.directions + " ";
switch(s.type){
case 'textBox':
html += "\n<input id='textBox-slide-" + (i) + "' type='text' />";
break;
case 'dropDown':
html += "\n<select name='dropDown-slide-" + (i) + "'>\n";
for(var o in s.options){
html +=" <option value='" + s.options[o] + "'>" + s.options[o] + "</option>\n";
}
html +="</select>\n";
break;
}
switch(s.lastSlide){
case true:
html+= "<div class='goButton' onclick='submit()'>Go!</div>";
break;
case false:
html += "<div class='nextButton' onclick='switchSlide()'> > </div>";
break;
}
html += "</div>\n";
slides.push(html);
}
Logger.log(slides);
return slides;
}