-
Notifications
You must be signed in to change notification settings - Fork 0
/
MenuItems.gs
33 lines (31 loc) · 1.02 KB
/
MenuItems.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
function sideMenu() {
let html = HtmlService.createHtmlOutputFromFile("sidebar");
ui.showModalDialog(html,"Enter date range");
}
function clearToken(){
let response = ui.alert("Are you sure you want to clear your authentication token?",ui.ButtonSet.YES_NO);
if(response == ui.Button.YES) {
properties.deleteProperty("ApiAuth");
}
}
function authenticateScript() {
function promptInfo() {
ui.showModalDialog(HtmlService.createHtmlOutputFromFile("authPrompt"),"Authentication Info");
}
if(properties.getProperty("ApiAuth")) {
let response = ui.alert("Authentication has previously been entered. Are you sure you want to continue?",ui.ButtonSet.YES_NO);
if(response == ui.Button.YES) {
promptInfo();
} else if(response == ui.Button.NO) {
console.log("user clicked no");
return;
}
} else {
promptInfo();
}
}
let submit = submission => {
let encryptedSubmission = `Basic ${Utilities.base64Encode(submission)}`;
properties.setProperty("ApiAuth",encryptedSubmission);
return;
}