-
Notifications
You must be signed in to change notification settings - Fork 1
/
Settings.html
42 lines (34 loc) · 1.09 KB
/
Settings.html
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
<!DOCTYPE html>
<html>
<head>
<base target="_top">
<link rel="stylesheet" href="https://ssl.gstatic.com/docs/script/css/add-ons1.css">
</head>
<body onload="get()">
<form>
<label>What is your Discord Webhook URL?</label>
<input id="webhook-url" type="url" autofocus required placeholder="Discord Webhook Here">
<br><br>
<input type="button" value="Save" onclick="save()">
<script>
function save() {
var url = document.getElementById('webhook-url').value
google.script.run.withFailureHandler(() => {
Browser.msgbox("Error. Please try again.")
}).withSuccessHandler(() => {
google.script.run.withFailureHandler(() => {
Browser.msgbox("Error. Please try again.")
}).withSuccessHandler(() => {
google.script.host.close();
}).getSettings();
}).saveSettings(url);
}
function get() {
google.script.run.withSuccessHandler(settings => {
document.getElementById('webhook-url').value = settings;
}).getSettings();
}
</script>
</form>
</body>
</html>