-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.gs
34 lines (29 loc) · 949 Bytes
/
init.gs
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
function onInstall(e) {
onOpen();
}
function onOpen(e) {
const sessions = getProperty(SESSIONS) || setProperty(SESSIONS, {});
console.log(sessions);
const participants = getProperty(PARTICIPANTS) || setProperty(PARTICIPANTS, {});
console.log(participants);
const numSessions = getProperty(NUM_SESSIONS) || setProperty(NUM_SESSIONS, 4);
console.log(numSessions);
const numChoices = getProperty(NUM_CHOICES) || setProperty(NUM_CHOICES, 8);
console.log(numChoices);
SpreadsheetApp.getUi().createAddonMenu()
.addItem("Show Sidebar", "doGet")
.addToUi();
};
function doGet(e) {
var html = HtmlService.createTemplateFromFile('sidebar')
.evaluate();
html
.setTitle('Group Assigner')
.setWidth(300);
SpreadsheetApp.getUi() // Or DocumentApp or SlidesApp or FormApp.
.showSidebar(html);
}
function include(filename) {
return HtmlService.createHtmlOutputFromFile(filename)
.getContent();
}