-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathadmin.html
686 lines (672 loc) · 36.1 KB
/
admin.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
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
<!--
Blog tools for client to edit and publish posts to webserver
CSCI-2356 Project: Phase 3
author: Mohak Shrivastava (A00445470)
author: Nayem Imtiaz (A00448982)
author: Naziya Tasnim (A00447506)
author: Sheikh Saad Abdullah (A00447871)
-->
<!DOCTYPE html>
<html lang="en">
<head>
<!-- HEAD:
Header information for the HTML document,
specifying stylesheets, scripts, and metadata
author: Sheikh Saad Abdullah (A00447871)
-->
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, shrink-to-fit=no"
/>
<meta name="description" content="Blog tools for Northwood Project" />
<title>Blog Tools</title>
<!-- Custom CSS -->
<link rel="stylesheet" href="assets/css/admin.css" />
<!-- JQuery JS -->
<script
src="https://code.jquery.com/jquery-3.6.0.min.js"
integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4="
crossorigin="anonymous"
></script>
<!-- Custom JS -->
<script src="assets/js/admin.js"></script>
<!-- Alpine.js -->
<script
defer
src="https://unpkg.com/alpinejs@3.x.x/dist/cdn.min.js"
></script>
</head>
<body x-data="staticData" x-init="load" x-cloak>
<div
class="row justify-content-center d-flex justify-content-center m-1"
>
<div class="col-8">
<!-- Blog List:
Display list of blogs with options
to edit and publish via toggle switches
author: Mohak Shrivastava (A00445470)
author: Sheikh Saad Abdullah (A00447871)
-->
<!-- Start: Blog List -->
<div
class="row justify-content-center"
x-show="!editOn"
x-transition
>
<div class="col">
<!-- Start: Blog Headers -->
<div class="row justify-content-center mt-5">
<div class="col">
<h2
class="d-flex justify-content-center bl-header"
>
Blog
</h2>
</div>
<div class="col">
<h2
class="d-flex justify-content-center bl-header"
>
Edit
</h2>
</div>
<div class="col">
<h2
class="d-flex justify-content-center bl-header"
>
Publish
</h2>
</div>
</div>
<!-- End: Blog Headers -->
<hr class="my-2" />
<!-- Start: Blog Entries -->
<div class="row justify-content-center">
<div class="col">
<!-- Start: Entry Row -->
<template
x-for="(publishState, index) in publishStates"
>
<div
class="row justify-content-center my-1"
:id="$id('bl-entry')"
>
<div
class="col-4 d-flex justify-content-center align-items-center form-check form-switch"
:id="$id('bl-name-box')"
>
<h3
class="bl-name my-1"
x-text="index + 1"
></h3>
</div>
<div
class="col-4 d-flex justify-content-center align-items-center form-check form-switch"
:id="$id('bl-edit-box')"
>
<input
class="bl-edit form-check-input my-1"
type="checkbox"
role="switch"
:id="$id('bl-edit')"
@change="editText($el, index)"
/>
</div>
<div
class="col-4 d-flex justify-content-center align-items-center form-check form-switch"
:id="$id('bl-publish-box')"
>
<input
class="bl-publish form-check-input my-1"
type="checkbox"
role="switch"
:id="$id('bl-publish')"
@change="publish($el, index)"
:checked="publishState"
/>
</div>
</div>
</template>
<!-- End: Entry Row -->
</div>
</div>
<!-- End: Blog Entries -->
</div>
</div>
<!-- End: Blog List -->
<!-- Start: Edit Group -->
<div
class="row justify-content-center"
x-show="editOn"
x-transition
x-cloak
>
<div class="col">
<!-- Edit Area:
Text area to edit blog posts in,
with Save and Cancel functionality
author: Nayem Imtiaz (A00448982)
-->
<!-- Start: Edit Area -->
<div class="row justify-content-center my-2">
<div class="col text-center">
<!-- Start: Buttons -->
<div class="row justify-content-center my-4">
<div class="col text-center">
<div
class="d-flex justify-content-between"
role="group"
>
<button
type="button"
class="btn btn-save"
data-bs-target="#save-confirm"
data-bs-toggle="modal"
>
Save
</button>
<button
type="button"
class="btn btn-cancel"
data-bs-target="#cancel-confirm"
data-bs-toggle="modal"
>
Undo All
</button>
<button
type="button"
class="btn btn-undo"
@mousedown="undo"
>
Undo
</button>
<button
type="button"
class="btn btn-outline-danger"
data-bs-target="#close-confirm"
data-bs-toggle="modal"
>
Close
</button>
</div>
</div>
</div>
<!-- End: Buttons -->
<!-- Start: Text Area -->
<textarea
id="editbox"
rows="8"
cols="100"
@focus="kbdFocus = $el"
></textarea>
<!-- End: Text Area -->
<!-- Modal Group:
Modals to confirm important actions
with potentially irreversible consequences
author: Sheikh Saad Abdullah (A00447871)
-->
<!-- Start: Save Modals -->
<div
class="modal fade"
id="save-confirm"
aria-hidden="true"
aria-labelledby="save-confirm-label"
tabindex="-1"
>
<div
class="modal-dialog modal-dialog-centered"
>
<div class="modal-content">
<div class="modal-header">
<h5
class="modal-title"
id="save-confirm-label"
>
Confirmation
</h5>
</div>
<div class="modal-body">
Are you sure you want to SAVE?
</div>
<div class="modal-footer">
<button
type="button"
class="btn btn-outline-success"
data-bs-target="#save-reconfirm"
data-bs-toggle="modal"
>
Yes
</button>
<button
type="button"
class="btn btn-outline-danger"
data-bs-dismiss="modal"
aria-label="Close"
>
No
</button>
</div>
</div>
</div>
</div>
<div
class="modal fade"
id="save-reconfirm"
aria-hidden="true"
aria-labelledby="save-reconfirm-label"
tabindex="-1"
>
<div
class="modal-dialog modal-dialog-centered"
>
<div class="modal-content">
<div class="modal-header">
<h5
class="modal-title"
id="save-reconfirm-label"
>
Re-confirmation
</h5>
</div>
<div class="modal-body">
Are you REALLY sure you want to
SAVE?
</div>
<div class="modal-footer">
<button
type="button"
class="btn btn-outline-success"
data-bs-dismiss="modal"
@mousedown="save"
>
Yes
</button>
<button
type="button"
class="btn btn-outline-danger"
data-bs-dismiss="modal"
aria-label="Close"
>
No
</button>
</div>
</div>
</div>
</div>
<!-- End: Save Modals -->
<!-- Start: Cancel Modals -->
<div
class="modal fade"
id="cancel-confirm"
aria-hidden="true"
aria-labelledby="cancel-confirm-label"
tabindex="-1"
>
<div
class="modal-dialog modal-dialog-centered"
>
<div class="modal-content">
<div class="modal-header">
<h5
class="modal-title"
id="cancel-confirm-label"
>
Confirmation
</h5>
</div>
<div class="modal-body">
Are you sure you want to UNDO
ALL?
</div>
<div class="modal-footer">
<button
type="button"
class="btn btn-outline-success"
data-bs-target="#cancel-reconfirm"
data-bs-toggle="modal"
>
Yes
</button>
<button
type="button"
class="btn btn-outline-danger"
data-bs-dismiss="modal"
aria-label="Close"
>
No
</button>
</div>
</div>
</div>
</div>
<div
class="modal fade"
id="cancel-reconfirm"
aria-hidden="true"
aria-labelledby="cancel-reconfirm-label"
tabindex="-1"
>
<div
class="modal-dialog modal-dialog-centered"
>
<div class="modal-content">
<div class="modal-header">
<h5
class="modal-title"
id="cancel-reconfirm-label"
>
Re-confirmation
</h5>
</div>
<div class="modal-body">
Are you REALLY sure you want to
UNDO ALL?
</div>
<div class="modal-footer">
<button
type="button"
class="btn btn-outline-success"
data-bs-dismiss="modal"
@mousedown="cancel"
>
Yes
</button>
<button
type="button"
class="btn btn-outline-danger"
data-bs-dismiss="modal"
aria-label="Close"
>
No
</button>
</div>
</div>
</div>
</div>
<!-- End: Cancel Modals -->
<!-- Start: Close Modals -->
<div
class="modal fade"
id="close-confirm"
aria-hidden="true"
aria-labelledby="close-confirm-label"
tabindex="-1"
>
<div
class="modal-dialog modal-dialog-centered"
>
<div class="modal-content">
<div class="modal-header">
<h5
class="modal-title"
id="close-confirm-label"
>
Confirmation
</h5>
</div>
<div class="modal-body">
Are you sure you want to CLOSE?
</div>
<div class="modal-footer">
<button
type="button"
class="btn btn-outline-success"
data-bs-target="#close-reconfirm"
data-bs-toggle="modal"
>
Yes
</button>
<button
type="button"
class="btn btn-outline-danger"
data-bs-dismiss="modal"
aria-label="Close"
>
No
</button>
</div>
</div>
</div>
</div>
<div
class="modal fade"
id="close-reconfirm"
aria-hidden="true"
aria-labelledby="close-reconfirm-label"
tabindex="-1"
>
<div
class="modal-dialog modal-dialog-centered"
>
<div class="modal-content">
<div class="modal-header">
<h5
class="modal-title"
id="close-reconfirm-label"
>
Re-confirmation
</h5>
</div>
<div class="modal-body">
Are you REALLY sure you want to
CLOSE?
</div>
<div class="modal-footer">
<button
type="button"
class="btn btn-outline-success"
data-bs-dismiss="modal"
@mousedown="closeEdit"
>
Yes
</button>
<button
type="button"
class="btn btn-outline-danger"
data-bs-dismiss="modal"
aria-label="Close"
>
No
</button>
</div>
</div>
</div>
</div>
<!-- End: Close Modals -->
<!-- End: Modal Group -->
</div>
</div>
<!-- End: Edit Area -->
<!-- Keyboard:
Accessible on-screen keyboard
for client to operate using mouse
author: Naziya Tasnim (A00447506)
-->
<!-- Start: Keyboard -->
<div class="row justify-content-center my-4">
<div class="col d-grid gap-4 kbd">
<!-- Start: Caps Key -->
<button
type="button"
id="kbd-caps"
class="btn kbd-sp"
:data-pressed="capsOn"
@mousedown="if (!shiftOn) capsOn = !capsOn"
x-text="capsOn ? sp.caps.toUpperCase() : sp.caps"
></button>
<!-- End: Caps Key -->
<!-- Start: Shift Key -->
<button
type="button"
id="kbd-shift"
class="btn kbd-sp"
:data-pressed="shiftOn"
@mousedown="if (!capsOn) shiftOn = !shiftOn"
x-text="shiftOn ? sp.shift.toUpperCase() : sp.shift"
></button>
<!-- End: Shift Key -->
<!-- Start: Delete Key -->
<button
type="button"
id="kbd-del"
class="btn kbd-sp"
@mousedown="addText('del')"
x-text="sp.delete"
></button>
<!-- End: Delete Key -->
<!-- Start: Return Key -->
<button
type="button"
id="kbd-cr"
class="btn kbd-sp"
@mousedown="addText('\n')"
x-text="sp.return"
></button>
<!-- End: Return Key -->
<!-- Start: Space Key -->
<button
type="button"
id="kbd-spc"
class="btn kbd-sp"
@mousedown="addText(' ')"
x-text="sp.space"
></button>
<!-- End: Space Key -->
<!-- Start: Character Keys -->
<template x-for="glyph in glyphs">
<button
type="button"
class="btn kbd-char"
@mousedown="addText(key(glyph))"
x-text="key(glyph)"
></button>
</template>
<!-- End: Character Keys -->
<!-- Word Bank:
Storage of repetitive words
for convenient re-entering
author: Mohak Shrivastava (A00445470)
author: Sheikh Saad Abdullah (A00447871)
-->
<!-- Start: Word Suggestions -->
<button
type="button"
id="suggest"
class="btn kbd-wb"
data-bs-target="#suggestions-list"
data-bs-toggle="modal"
@mousedown="loadWB"
>
Words
</button>
<input
type="text"
id="wb"
class="kbd-wb"
@focus="kbdFocus = $el"
value
/>
<button
type="button"
id="fav"
class="btn kbd-wb"
@mousedown="saveWord"
>
Add
</button>
<!-- End: Word Suggestions -->
<div
class="modal fade"
id="suggestions-list"
aria-hidden="true"
aria-labelledby="exampleModalToggleLabel"
tabindex="-1"
>
<div
class="modal-dialog modal-dialog-centered modal-lg"
>
<div class="modal-content">
<div class="modal-header">
<h5
class="modal-title"
id="exampleModalToggleLabel"
>
Word Bank
</h5>
<input
type="checkbox"
class="btn-check"
id="wb-del"
autocomplete="off"
x-model="deleteOn"
/>
<label
class="btn btn-outline-dark"
for="wb-del"
>Delete
</label>
<button
type="button"
class="btn btn-outline-danger"
data-bs-dismiss="modal"
aria-role="Close"
@mousedown="closeWB"
>
Close
</button>
</div>
<div
class="modal-body d-flex justify-content-center flex-wrap"
>
<template
x-if="wordBank.length === 0"
><p>
No words added to the
word bank yet.
</p>
</template>
<template
x-for="word in wordBank"
>
<button
type="button"
class="btn wb-word m-2"
@mousedown="putWord(word)"
x-text="word"
></button>
</template>
</div>
</div>
</div>
</div>
<!-- End: Word Bank -->
</div>
</div>
<!-- End: Keyboard -->
</div>
</div>
<!-- End: Edit Group -->
<!-- Toast:
Alert that appears when
word bank runs out of space
author: Sheikh Saad Abdullah (A00447871)
-->
<div
id="add-word-toast"
class="toast align-items-center position-fixed bottom-0 end-0 p-3 m-2"
style="z-index: 11"
role="alert"
aria-live="assertive"
aria-atomic="true"
data-bs-delay="3000"
>
No more space in word bank.
</div>
<!-- End: Toast -->
</div>
</div>
<!-- Bootstrap JS -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>