-
Notifications
You must be signed in to change notification settings - Fork 1
/
SidebarPrepSheets.html
106 lines (103 loc) · 3.82 KB
/
SidebarPrepSheets.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
<!DOCTYPE html>
<html>
<head>
<base target="_top">
</head>
<body>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>
var elems=""
var options=""
</script>
<script>
$(document).ready(function(){
M.updateTextFields();
})
</script>
<div class="container">
<h6><b>There are only three steps of this process, and you just ran the first one</b></h6>
<blockquote>
<h6><b>Start</b> - SPOGOU prepared the worksheets.</h6>
</blockquote>
<h6><b>Prepare passwords</b></h6>
<h6><b>Set passwords</b></h6>
<div class="card-panel blue lighten-2">
<h6>Fill in group and teacher emails below, make a choice whether you want to force a password reset on
first login, and then click <i>Save Data</i>, followed by <i>Next</i>.</h6>
</div>
<div class="row">
<div class="input-field col s10">
<input placeholder="Enter group email here" type="text" id="groupemail" class="card-panel #f5f5f5 grey lighten-4" oninput="validate()"><br>
<input placeholder="Enter teacher email here" type="text" id="teacheremail" class="card-panel #f5f5f5 grey lighten-4" oninput="validate()">
</div>
<div class="input-field col s10">
<select id="changePass">
<option value="FALSE">FALSE</option>
<option value="TRUE">TRUE</option>
</select>
<label>Change Password TRUE/FALSE</label>
Select TRUE if you want to force a password reset on first login
</div>
<div class="col s4">
<button type="button" class="btn-small waves-effect waves-light " id="btnSaveData" disabled>Save data</button>
</div>
<div class="col s4">
<button type="button" class="btn-small waves-effect waves-light" id="btnPrepPass" disabled>Next</button>
</div>
</div>
</div>
<script>
document.addEventListener('DOMContentLoaded', function() {
var elems = document.querySelectorAll('select');
var instance = M.FormSelect.init(elems, options);
});
var instance = M.FormSelect.getInstance(elems);
document.getElementById("btnSaveData").addEventListener("click",goSaveData);
var field1 = document.getElementById("groupemail");
var field2 = document.getElementById("teacheremail");
var buttonSave = document.getElementById("btnSaveData");
var buttonNext = document.getElementById("btnPrepPass");
function validate(){
if(!isEmpty(field1)&&!isEmpty(field2)){
buttonSave.disabled=false;
}else{
buttonSave.disabled=true;
}
}
function isEmpty(element){
if(element.value.length==0){
return true;
}else{
return false;
}
}
function goSaveData(){
var groupemail1 = document.getElementById("groupemail").value;
var teacheremail1 = document.getElementById("teacheremail").value;
var changePass1 = document.getElementById("changePass").value;
google.script.run
.withSuccessHandler(printutData)
.saveData(groupemail1,teacheremail1,changePass1);
}
window.printutData = function(utData) {
var i,innerArray;
var L = utData.length;
for (i=0;i<L;i++) {
innerArray = utData[i];
value1 = innerArray[0];
value2 = innerArray[1];
value3 = innerArray[2];
value4 = innerArray[3];
}
buttonNext.disabled=false;
}
document.getElementById("btnPrepPass").addEventListener("click",goPrepPass);
function goPrepPass(){
google.script.run.openSidebarPrepPasswords();
}
</script>
</body>
</html>