-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsidebar.html
150 lines (134 loc) · 4.07 KB
/
sidebar.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
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
<!DOCTYPE html>
<html>
<head>
<base target="_top">
<link rel="stylesheet" href="https://ssl.gstatic.com/docs/script/css/add-ons1.css">
<style>
body {
background-color: #525252;
background-image: linear-gradient(to right, #525252, #d6d6d6, #525252);
font-family: Roboto;
color: #131b21;
}
.action-group {
padding: 2rem 2rem;
border-bottom: 1px solid #242a2e;
border-bottom-color: rgba(255, 255, 255, 0.5);
text-align: center;
margin: auto;
}
#course-summary, #course-details {
margin-left: auto;
margin-right: auto;
}
#status-space {
padding: 1rem 1rem;
text-align: center;
margin: auto;
margin-left: auto;
margin-right: auto;
width: 100%;
height: 1rem;
background-color: #f5f3c6;
border: 1px solid #b5b391;
}
</style>
<script src="https://code.jquery.com/jquery-1.9.1.min.js"></script>
</head>
<body>
<div class="action-group">
<h2> All Courses Summary Spreadsheet </h2>
<form>
<button class="red" id="course-summary"> Generate </button>
<button class="gray" id="delete-course-sheet"> Delete </button>
</form>
</div>
<div class="action-group">
<h2> Individual Course Spreadsheets </h2>
<form>
<button class="red" id="course-details"> Generate </button>
<button class="gray" id="delete-individual-sheet"> Delete </button>
</form>
</div>
<div id="status-space" class="bottom"> </div>
<script>
$(function() {
$('#course-summary').click(getCourseSummary);
$('#course-details').click(getCourseDetails);
$('#delete-individual-sheet').click(deleteIndividual);
$('#delete-course-sheet').click(deleteSummary);
});
function getCourseSummary() {
showStatus("Generating course summary sheet...");
this.disabled = true;
google.script.run
.withSuccessHandler(
function(returnValue, element) {
showStatus(returnValue);
element.disabled = false;
})
.withFailureHandler(
function(errorMsg, element) {
showStatus(errorMsg);
element.disabled = false;
})
.withUserObject(this)
.populateCourseSummary();
}
function getCourseDetails() {
showStatus("Generating individual course sheets...");
this.disabled = true;
google.script.run
.withSuccessHandler(
function(returnValue, element) {
showStatus(returnValue);
element.disabled = false;
})
.withFailureHandler(
function(errorMsg, element) {
showStatus(errorMsg);
element.disabled = false;
})
.withUserObject(this)
.populateCourseDetails();
}
function deleteIndividual() {
showStatus("Deleting individual course sheets...");
this.disabled = true;
google.script.run
.withSuccessHandler(
function(returnValue, element) {
showStatus(returnValue);
element.disabled = false;
})
.withFailureHandler(
function(errorMsg, element) {
showStatus(errorMsg);
element.disabled = false;
})
.withUserObject(this)
.deleteIndividualSheets();
}
function deleteSummary() {
showStatus("Deleting course summary sheet...");
this.disabled = true;
google.script.run
.withSuccessHandler(
function(returnValue, element) {
showStatus(returnValue);
element.disabled = false;
})
.withFailureHandler(
function(errorMsg, element) {
showStatus(errorMsg);
element.disabled = false;
})
.withUserObject(this)
.deleteCourseSummarySheet();
}
function showStatus(statusMsg) {
$('#status-space').html(statusMsg);
}
</script>
</body>
</html>