-
Notifications
You must be signed in to change notification settings - Fork 8
/
index.html
executable file
·248 lines (229 loc) · 10.5 KB
/
index.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
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
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>The Nexus</title>
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/styling.css">
</head>
<body>
<div class="container">
<h1>The Nexus</h1>
<!-- Search bar, redirects to google -->
<form action="https://google.com/search?" method="get">
<div class="form-group">
<input type="text" name="q" class="form-control" required placeholder="Search" required>
</div>
</form>
<!-- End of search bar -->
<!-- Individual section Backbone template -->
<script type="text/template" id="sectionTemplate">
<div class="wrapperSection">
<h2>
<%= name %>
<!-- Icons to edit and delete only visibles on hover, see scripts.js -->
<small><span style="display: none" class="glyphicon glyphicon-pencil editSection" title="Click to edit"> </span> </small>
<small><span style="display: none" class="glyphicon glyphicon-minus-sign deleteSection" title="Double click to delete"> </span> </small>
</h2>
</div>
</script>
<!-- End of section Backbone template -->
<!-- Individual url Backbone template -->
<script type="text/template" id="urlTemplate">
<div class="wrapperUrl">
<p>
<a href="<%= url %>" id='<%= reference %>' target="_blank" rel="noopener">
<%= name %>
</a>
<!-- Icons to edit and delete only visibles on hover, see scripts.js -->
<span style="display: none" class="glyphicon glyphicon-pencil editSite" title="Click to edit"></span>
<span style="display: none" class="glyphicon glyphicon-minus-sign deleteUrl" title="Double click to delete"> </span>
</p>
</div>
</script>
<!-- End of url Backbone template -->
<!-- Site edition form -->
<script type="text/template" id="editionForm">
<div class="EditForm">
<label for="EditFormName">Name:</label>
<div class="form-group">
<input type="text" class="editName form-control" id="EditFormName" value="<%= name %>" required>
</div>
<div class="form-group">
<label for="basic-url">URL:</label>
<div class="input-group">
<span class="input-group-addon" id="basic-addon3">https://</span>
<input type="text" class="editURL form-control" id="EditFormURL" value="<%= url %>" aria-describedby="basic-addon3">
</div>
</div>
<label for="Sections">Section:</label>
<select class="form-control" id="availableSections">
<!-- This section will be completed with javascript using section javascript variable, see script.js -->
</select>
<p></p>
<button class="btn btn-primary updateUrl">Save</button>
<button class="btn btn-warning closeEdit">Close</button>
<div class="successMsgEditUrl badge badge-success"></div>
<div class="warningMsgEditUrl badge badge-warning"></div>
</div>
</script>
<!-- End of site edit form -->
<!-- Section edition form -->
<script type="text/template" id="sectionEditionForm">
<div class="sectionEditForm">
<label for="EditSectionFormName">New section name:</label>
<div class="form-group">
<input type="text" class="editSectionName form-control" id="EditSectionNameForm" value="<%= name %>" required>
</div>
<button class="btn btn-primary editSectionModel">Save</button>
<button class="btn btn-warning closeSectionEdit">Close</button>
<div class="warningMsgEditSection badge badge-warning"></div>
</div>
</script>
<!-- End of Section edit form -->
<!-- Error Modal -->
<div class="modal fade" id="errorModal" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h3 class="modal-title" id="errorTitle"></h3>
</div>
<div class="modal-body">
<p id="errorText"></p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!-- End Error Modal -->
<div id="mainApp">
<!-- Icons -->
<span data-toggle="modal" data-target="#AddSectionModal" title="Add a section">
<span class="glyphicon glyphicon-th-list addSectionModal"></span></span>
<span data-toggle="modal" data-target="#AddUrlModal" title="Add a website">
<span class="glyphicon glyphicon-plus addUrl"></span></span>
<span data-toggle="modal" data-target="#DeleteWebsitesModal" title="Delete all websites">
<span class="glyphicon glyphicon-trash"></span></span>
<span title="Save all sites">
<span class="glyphicon glyphicon-save-file downloadSites"></span></span>
<span title="Upload saved sites">
<span class="glyphicon glyphicon-open-file uploadFile"></span></span>
<form id="fileForm">
<input type="file" id="fileElem" multiple accept=".txt" style="display:none">
</form>
<!-- End Icons -->
<!-- Modal to add url -->
<div id="AddUrlModal" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h3 class="modal-title">Add a Website</h3>
</div>
<div class="modal-body formulario">
<!-- Form to add url -->
<form id="AddUrlForm">
<fieldset>
<div class="form-group">
<label for="name">Name:</label><span id="ErrorName"></span>
<input type="text" class="form-control" id="name" placeholder="Site's name" required>
</div>
<div class="form-group">
<label for="basic-url">URL:</label>
<div class="input-group">
<span class="input-group-addon" id="basic-addon3">https://</span>
<input type="text" class="form-control" id="url" aria-describedby="basic-addon3">
</div>
</div>
<div class="form-group">
<label for="Sections">Section:</label><span id="errorSection"></span>
<select class="form-control" id="sections">
<!-- This section will be automatically completed -->
</select>
</div>
</fieldset>
</form>
<!-- End of form-->
</div>
<div class="modal-footer">
<span class="successMsg badge badge-success"></span>
<span class="warningMsg badge badge-warning"></span>
<button type="button" class="btn btn-primary createUrl">Add </button>
<button type="button" class="btn btn-default AddUrlModalClose" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!-- End of modal to add url -->
<!-- Modal to add sections -->
<div id="AddSectionModal" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h3 class="modal-title">Add a section</h3>
</div>
<div class="modal-body">
<!-- Form to add sections -->
<form id="AddSectionForm">
<fieldset>
<div class="form-group">
<label for="name">Section name</label><span id="SectionNameError"></span><span class="SectionNameError"></span>
<span class="SectionEmptyWarning badge badge-warning"></span>
<input type="text" class="form-control" id="sectionName" placeholder="Section name" required>
</div>
</fieldset>
</form>
<!-- End of form-->
<div id="renderedSections"></div>
</div>
<div class="modal-footer">
<span class="successMsgSection badge badge-success"></span>
<span class="warningMsgSection badge badge-warning"></span>
<button type="button" class="btn btn-primary addSection">Add Section</button>
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!-- End of modal to add sections -->
<!-- Modal to delete all websites -->
<div id="DeleteWebsitesModal" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h3 class="modal-title">Delete all websites</h3>
</div>
<div class="modal-body">
<p>Clicking the button will delete all your saved websites and sections. Are you sure?</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-danger deleteAllSites" data-dismiss="modal">Yes, delete all my saved websites</button>
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!-- End of modal to delete all websites -->
<div id="renderedSites"></div>
</div>
</div>
<script src="js/libraries/jquery-3.2.1.min.js" type="text/javascript"></script>
<script src="js/libraries/underscore-min.js" type="text/javascript"></script>
<script src="js/libraries/backbone-min.js" type="text/javascript"></script>
<script src="js/libraries/bootstrap.min.js" type="text/javascript"></script>
<script src="js/models/models.js" type="text/javascript"></script>
<script src="js/collections/collections.js" type="text/javascript"></script>
<script src="js/localstoragestart.js" type="text/javascript"></script>
<script src="js/views/views.js" type="text/javascript"></script>
<script src="js/scripts.js" type="text/javascript"></script>
</body>
</html>