-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuilder.html
More file actions
223 lines (205 loc) · 6.71 KB
/
builder.html
File metadata and controls
223 lines (205 loc) · 6.71 KB
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
<!DOCTYPE html>
<!---
Geotagtext allows you to create map applications and record geomarkers in the app of your choosing.
Copyright (C) 2021 Robert Read, Diego Aspinwall and Neil Martis
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
-->
<html>
<head>
<meta charset="utf-8" />
<meta
name="author"
content="Robert Read, Diego Aspinwall and Neil Martis" />
<title>Build your own geotag map</title>
<meta
name="viewport"
content="initial-scale=1,maximum-scale=1,user-scalable=no" />
<link href="styles.css" rel="stylesheet" />
<!---added Bootstrap-->
<link
href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"
rel="stylesheet" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="navbar-collapse" id="navbarNav">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="index.html">User Page</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="builder.html"
>App Builder<span class="sr-only">(current)</span></a
>
</li>
</ul>
</div>
</nav>
<h1 class="center">Map Application Builder</h1>
<div id="redirect-anchor"></div>
<div class="mb-3">
<label for="app-name" class="marginleft">Name of Application</label>
<input type="text" id="app-name" class="marginleft" />
</div>
<br />
<div class="form-check marginleft">
<input
class="form-check-input"
type="radio"
name="name"
id="yes-name"
value="true" />
<label class="form-check-label" for="yes-name">
Ask for name of geotagger
</label>
</div>
<div class="form-check marginleft">
<input
class="form-check-input"
type="radio"
name="name"
id="no-name"
value="false"
checked />
<label class="form-check-label" for="no-name"> Don't ask for name </label>
</div>
<br />
<div class="form-check marginleft">
<input
class="form-check-input"
type="radio"
name="text"
id="yes-message"
value="true" />
<label class="form-check-label" for="yes-message">
Ask for a text message
</label>
</div>
<div class="form-check marginleft">
<input
class="form-check-input"
type="radio"
name="text"
id="no-message"
value="false"
checked />
<label class="form-check-label" for="no-message">
Don't ask for a message
</label>
</div>
<br />
<br />
<p class="marginleft">Select any colors you want for your icon</p>
<div class="form-check form-switch marginleft">
<input class="form-check-input" type="checkbox" id="red" checked />
<label class="form-check-label" for="red">Red</label>
</div>
<div class="form-check form-switch marginleft">
<input class="form-check-input" type="checkbox" id="blue" checked />
<label class="form-check-label" for="blue">Blue</label>
</div>
<div class="form-check form-switch marginleft">
<input class="form-check-input" type="checkbox" id="green" checked />
<label class="form-check-label" for="green">Green</label>
</div>
<br /><br />
<div class="form-check marginleft">
<input
class="form-check-input"
type="radio"
name="currentloc"
id="yes-currentloc"
value="true" />
<label class="form-check-label" for="yes-currentloc">
Display the user's current location
</label>
</div>
<div class="form-check marginleft">
<input
class="form-check-input"
type="radio"
name="currentloc"
id="no-currentloc"
value="false"
checked />
<label class="form-check-label" for="no-currentloc">
Don't display the user's current location
</label>
</div>
<br />
<button onclick="createApplication()" class="btn btn-primary">
Create Application
</button>
</body>
<script type="text/javascript" src="tagscript.js"></script>
<script>
async function createApplication() {
const name = !($("input[name=name]:checked").val() == "false");
const textmessage = !($("input[name=text]:checked").val() == "false");
const currentloc = !(
$("input[name=currentloc]:checked").val() == "false"
);
const red = $("#red").is(":checked");
const blue = $("#blue").is(":checked");
const green = $("#green").is(":checked");
const appName = $("#app-name").val();
function actuallyCreate(appName) {
if (
(blue == false && green == false && red == false) ||
appName == ""
) {
alert("Please fill out all fields");
} else {
var config = {
appname: appName,
obj: {
yesname: name,
yestextmessage: textmessage,
red: red,
blue: blue,
green: green,
tags: {},
currentlocation: currentloc,
},
};
$.ajax({
type: "GET",
url: "actuallyCreate",
dataType: "json",
data: config,
success: function (result) {
console.log("CONFIG sent successfully");
},
error: function (e) {
console.log("ERROR: ", e);
},
});
$("body > :not(#redirect-anchor)").hide();
$("#redirect-anchor").appendTo("body");
var link = "/index.html?app=" + appName;
$("#redirect-anchor").html(
"<br><a style='text-align: center;' href='" +
link +
"'>Your app link</a>"
);
}
}
const appThere = await checkForAppInDatabase(appName);
if (appThere && appName != "") {
alert("This app name already exists. Please find another one.");
} else {
actuallyCreate(appName);
}
}
</script>
</html>