-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcalender_student.html
More file actions
748 lines (712 loc) · 43.5 KB
/
Copy pathcalender_student.html
File metadata and controls
748 lines (712 loc) · 43.5 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
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
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Calender</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="robots" content="all,follow">
<!-- Bootstrap CSS-->
<link rel="stylesheet" href="vendor/bootstrap/css/bootstrap.min.css">
<!-- Font Awesome CSS-->
<link rel="stylesheet" href="vendor/font-awesome/css/font-awesome.min.css">
<!-- Fontastic Custom icon font-->
<link rel="stylesheet" href="css/fontastic.css">
<!-- Google fonts - Poppins -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Poppins:300,400,700">
<!-- theme stylesheet-->
<link rel="stylesheet" href="css/style.default.css" id="theme-stylesheet">
<!-- Custom stylesheet - for your changes-->
<link rel="stylesheet" href="css/custom.css">
<link rel="stylesheet" href="css/calender.css">
<!-- lazy loading-->
<!-- <script src="js/jquery.lazy.min.js"></script> -->
<!-- Favicon-->
<link rel="shortcut icon" href="img/favicon.ico">
<!-- Tweaks for older IEs--><!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script><![endif]-->
<style>
.calendar-day {
width: 100px;
min-width: 100px;
max-width: 100px;
height: 80px;
}
.calendar-table {
margin: 0 auto;
width: 700px;
}
.selected {
background-color: #eee;
}
.outside .date {
color: #ccc;
}
.timetitle {
white-space: nowrap;
text-align: right;
}
.event {
border-top: 1px solid #b2dba1;
border-bottom: 1px solid #b2dba1;
background-image: linear-gradient(to bottom, #dff0d8 0px, #c8e5bc 100%);
background-repeat: repeat-x;
color: #3c763d;
border-width: 1px;
font-size: .75em;
padding: 0 .75em;
line-height: 2em;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
margin-bottom: 1px;
}
.event.begin {
border-left: 1px solid #b2dba1;
border-top-left-radius: 4px;
border-bottom-left-radius: 4px;
}
.event.end {
border-right: 1px solid #b2dba1;
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
}
.event.all-day {
border-top: 1px solid #9acfea;
border-bottom: 1px solid #9acfea;
background-image: linear-gradient(to bottom, #d9edf7 0px, #b9def0 100%);
background-repeat: repeat-x;
color: #31708f;
border-width: 1px;
}
.event.all-day.begin {
border-left: 1px solid #9acfea;
border-top-left-radius: 4px;
border-bottom-left-radius: 4px;
}
.event.all-day.end {
border-right: 1px solid #9acfea;
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
}
.event.clear {
background: none;
border: 1px solid transparent;
}
.table-tight > thead > tr > th,
.table-tight > tbody > tr > th,
.table-tight > tfoot > tr > th,
.table-tight > thead > tr > td,
.table-tight > tbody > tr > td,
.table-tight > tfoot > tr > td {
padding-left: 0;
padding-right: 0;
}
.table-tight-vert > thead > tr > th,
.table-tight-vert > tbody > tr > th,
.table-tight-vert > tfoot > tr > th,
.table-tight-vert > thead > tr > td,
.table-tight-vert > tbody > tr > td,
.table-tight-vert > tfoot > tr > td {
padding-top: 0;
padding-bottom: 0;
}
</style>
</head>
<body>
<div class="page">
<!-- Main Navbar-->
<header class="header">
<nav class="navbar navbar-expand-lg navbar-light top-navbar" data-toggle="sticky-onscroll"">
<!-- Search Box-->
<div class="search-box">
<button class="dismiss"><i class="icon-close"></i></button>
<form id="searchForm" action="#" role="search">
<input type="search" placeholder="What are you looking for..." class="form-control">
</form>
</div>
<div class="container-fluid">
<div class="navbar-holder d-flex align-items-center justify-content-between">
<!-- Navbar Header-->
<div class="navbar-header">
<!-- Navbar Brand --><a href="index_student.html" class="navbar-brand d-none d-sm-inline-block">
<img src="icons-reference/icon_logo.png" style="height:50px; width:auto;">
<!-- Toggle Button--><a id="toggle-btn" href="#" class="menu-btn active"><span></span><span></span><span></span></a>
</div>
<!-- Navbar Menu -->
<ul class="nav-menu list-unstyled d-flex flex-md-row align-items-md-center">
<!-- Search-->
<li class="nav-item d-flex align-items-center"><a id="search" href="#"><i class="icon-search"></i></a></li>
<!-- Notifications-->
<li class="nav-item dropdown"> <a id="notifications" rel="nofollow" data-target="#" href="#" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" class="nav-link"><i class="fa fa-bell-o"></i><span class="badge bg-red badge-corner">12</span></a>
<ul aria-labelledby="notifications" class="dropdown-menu">
<li><a rel="nofollow" href="#" class="dropdown-item">
<div class="notification">
<div class="notification-content"><i class="fa fa-envelope bg-green"></i>You have 6 new messages </div>
<div class="notification-time"><small>4 minutes ago</small></div>
</div></a></li>
<li><a rel="nofollow" href="#" class="dropdown-item">
<div class="notification">
<div class="notification-content"><i class="fa fa-twitter bg-blue"></i>You have 2 followers</div>
<div class="notification-time"><small>4 minutes ago</small></div>
</div></a></li>
<li><a rel="nofollow" href="#" class="dropdown-item">
<div class="notification">
<div class="notification-content"><i class="fa fa-upload bg-orange"></i>Server Rebooted</div>
<div class="notification-time"><small>4 minutes ago</small></div>
</div></a></li>
<li><a rel="nofollow" href="#" class="dropdown-item">
<div class="notification">
<div class="notification-content"><i class="fa fa-twitter bg-blue"></i>You have 2 followers</div>
<div class="notification-time"><small>10 minutes ago</small></div>
</div></a></li>
<li><a rel="nofollow" href="#" class="dropdown-item all-notifications text-center"> <strong>view all notifications </strong></a></li>
</ul>
</li>
<!-- Messages -->
<li class="nav-item dropdown"> <a id="messages" rel="nofollow" data-target="#" href="#" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" class="nav-link"><i class="fa fa-envelope-o"></i><span class="badge bg-orange badge-corner">10</span></a>
<ul aria-labelledby="notifications" class="dropdown-menu">
<li><a rel="nofollow" href="#" class="dropdown-item d-flex">
<div class="msg-profile"> <img src="img/avatar-1.jpg" alt="..." class="img-fluid rounded-circle"></div>
<div class="msg-body">
<h3 class="h5">Jason Doe</h3><span>Sent You Message</span>
</div></a></li>
<li><a rel="nofollow" href="#" class="dropdown-item d-flex">
<div class="msg-profile"> <img src="img/avatar-2.jpg" alt="..." class="img-fluid rounded-circle"></div>
<div class="msg-body">
<h3 class="h5">Frank Williams</h3><span>Sent You Message</span>
</div></a></li>
<li><a rel="nofollow" href="#" class="dropdown-item d-flex">
<div class="msg-profile"> <img src="img/avatar-3.jpg" alt="..." class="img-fluid rounded-circle"></div>
<div class="msg-body">
<h3 class="h5">Ashley Wood</h3><span>Sent You Message</span>
</div></a></li>
<li><a rel="nofollow" href="#" class="dropdown-item all-notifications text-center"> <strong>Read all messages </strong></a></li>
</ul>
</li>
<!-- Languages dropdown -->
<li class="nav-item dropdown"><a id="languages" rel="nofollow" data-target="#" href="#" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" class="nav-link language dropdown-toggle"><img src="img/flags/16/GB.png" alt="English"><span class="d-none d-sm-inline-block">English</span></a>
<ul aria-labelledby="languages" class="dropdown-menu">
<li><a rel="nofollow" href="#" class="dropdown-item"> <img src="img/flags/16/DE.png" alt="English" class="mr-2">German</a></li>
<li><a rel="nofollow" href="#" class="dropdown-item"> <img src="img/flags/16/FR.png" alt="English" class="mr-2">French </a></li>
</ul>
</li>
<!-- Logout -->
<li class="nav-item"><a href="login-option.html" class="nav-link logout"> <span class="d-none d-sm-inline">Logout</span><i class="fa fa-sign-out"></i></a></li>
</ul>
</div>
</div>
</nav>
</header>
<div class="page-content d-flex align-items-stretch">
<!-- Side Navbar -->
<nav class="side-navbar">
<!-- Sidebar Header-->
<div class="sidebar-header d-flex align-items-center">
<div class="avatar"><img src="img/avatar-8.jpg" alt="..." class="img-fluid rounded-circle"></div>
<div class="title">
<h1 class="h4">Sarah Khan</h1>
<p>Web Designer</p>
</div>
</div>
<!-- Sidebar Navidation Menus--><span class="heading">Main</span>
<ul class="list-unstyled">
<li><a href="index_student.html"> <i class="icon-home"></i>Home </a></li>
<li class="active"><a href="calender_student.html"> <i class="icon-grid"></i>Calender </a></li>
<li><a href="Mail_student.html"> <i class="icon-mail"></i>Mail </a></li>
<li><a href="forms_student.html"> <i class="icon-padnote"></i>Edit Profile </a></li>
<li><a onclick="document.getElementById('id01').style.display='block'" style="width:auto;"><i class="icon-interface-windows"></i>Invite</a></li>
<li><a href="login-option.html"> <i class="icon-interface-windows"></i>Logout</a></li>
</ul>
<!-- invite-->
<div id="id01" class="modal">
<span onclick="document.getElementById('id01').style.display='none'" class="close" title="Close Modal">×</span>
<form class="modal-content" action="/action_page.php">
<div class="containerinvite">
<label for="Message"><b>Message</b></label>
<input class="inputinvite" type="text" placeholder="Enter Message" name="message" required>
<label for="email"><b>Email</b></label>
<input class="inputinvite" type="text" placeholder="Enter Email" name="email" required>
<div class="clearfix">
<button type="button" onclick="document.getElementById('id01').style.display='none'" class="cancelbtn">Cancel</button>
<button type="submit" class="sendbtn">Send</button>
</div>
</div>
</form>
</div>
</nav>
<div class="content-inner">
<!-- Page Header-->
<header class="page-header">
<div class="container-fluid">
<h2 class="no-margin-bottom">Calender</h2>
</div>
</header>
<!-- Breadcrumb-->
<div class="breadcrumb-holder container-fluid">
<ul class="breadcrumb">
<li class="breadcrumb-item"><a href="index.html">Home</a></li>
<li class="breadcrumb-item active">Calender </li>
</ul>
</div>
<section class="Calender">
<div class="container-fluid">
<div class="row">
<script
src="https://code.jquery.com/jquery-3.3.1.min.js"
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
crossorigin="anonymous"></script>
<div class="calender-cell-overlay" style="position: absolute; z-index: 3; top: 137px; left: 256px; width: 128px; height: 106px; display: none;"></div>
<div class="container theme-showcase">
<h1>Calender</h1>
<div id="holder" class="row" ></div>
</div>
<script type="text/tmpl" id="tmpl">
{{
var date = date || new Date(),
month = date.getMonth(),
year = date.getFullYear(),
first = new Date(year, month, 1),
last = new Date(year, month + 1, 0),
startingDay = first.getDay(),
thedate = new Date(year, month, 1 - startingDay),
dayclass = lastmonthcss,
today = new Date(),
i, j;
if (mode === 'week') {
thedate = new Date(date);
thedate.setDate(date.getDate() - date.getDay());
first = new Date(thedate);
last = new Date(thedate);
last.setDate(last.getDate()+6);
} else if (mode === 'day') {
thedate = new Date(date);
first = new Date(thedate);
last = new Date(thedate);
last.setDate(thedate.getDate() + 1);
}
}}
<table class="calendar-table table table-condensed table-tight">
<thead>
<tr>
<td colspan="7" style="text-align: center">
<table style="white-space: nowrap; width: 100%">
<tr>
<td style="text-align: left;">
<span class="btn-group">
<button class="js-cal-prev btn btn-default"><</button>
<button class="js-cal-next btn btn-default">></button>
</span>
<button class="js-cal-option btn btn-default {{: first.toDateInt() <= today.toDateInt() && today.toDateInt() <= last.toDateInt() ? 'active':'' }}" data-date="{{: today.toISOString()}}" data-mode="month">{{: todayname }}</button>
</td>
<td>
<span class="btn-group btn-group-lg">
{{ if (mode !== 'day') { }}
{{ if (mode === 'month') { }}<button class="js-cal-option btn btn-link" data-mode="year">{{: months[month] }}</button>{{ } }}
{{ if (mode ==='week') { }}
<button class="btn btn-link disabled">{{: shortMonths[first.getMonth()] }} {{: first.getDate() }} - {{: shortMonths[last.getMonth()] }} {{: last.getDate() }}</button>
{{ } }}
<button class="js-cal-years btn btn-link">{{: year}}</button>
{{ } else { }}
<button class="btn btn-link disabled">{{: date.toDateString() }}</button>
{{ } }}
</span>
</td>
<td style="text-align: right">
<span class="btn-group">
<button class="js-cal-option btn btn-default {{: mode==='year'? 'active':'' }}" data-mode="year">Year</button>
<button class="js-cal-option btn btn-default {{: mode==='month'? 'active':'' }}" data-mode="month">Month</button>
<button class="js-cal-option btn btn-default {{: mode==='week'? 'active':'' }}" data-mode="week">Week</button>
<button class="js-cal-option btn btn-default {{: mode==='day'? 'active':'' }}" data-mode="day">Day</button>
</span>
</td>
</tr>
</table>
</td>
</tr>
</thead>
{{ if (mode ==='year') {
month = 0;
}}
<tbody>
{{ for (j = 0; j < 3; j++) { }}
<tr>
{{ for (i = 0; i < 4; i++) { }}
<td class="calendar-month month-{{:month}} js-cal-option" data-date="{{: new Date(year, month, 1).toISOString() }}" data-mode="month">
{{: months[month] }}
{{ month++;}}
</td>
{{ } }}
</tr>
{{ } }}
</tbody>
{{ } }}
{{ if (mode ==='month' || mode ==='week') { }}
<thead>
<tr class="c-weeks">
{{ for (i = 0; i < 7; i++) { }}
<th class="c-name">
{{: days[i] }}
</th>
{{ } }}
</tr>
</thead>
<tbody>
{{ for (j = 0; j < 6 && (j < 1 || mode === 'month'); j++) { }}
<tr>
{{ for (i = 0; i < 7; i++) { }}
{{ if (thedate > last) { dayclass = nextmonthcss; } else if (thedate >= first) { dayclass = thismonthcss; } }}
<td class="calendar-day {{: dayclass }} {{: thedate.toDateCssClass() }} {{: date.toDateCssClass() === thedate.toDateCssClass() ? 'selected':'' }} {{: daycss[i] }} js-cal-option" data-date="{{: thedate.toISOString() }}">
<div class="date">{{: thedate.getDate() }}</div>
{{ thedate.setDate(thedate.getDate() + 1);}}
</td>
{{ } }}
</tr>
{{ } }}
</tbody>
{{ } }}
{{ if (mode ==='day') { }}
<tbody>
<tr>
<td colspan="7">
<table class="table table-striped table-condensed table-tight-vert" >
<thead>
<tr>
<th> </th>
<th style="text-align: center; width: 100%">{{: days[date.getDay()] }}</th>
</tr>
</thead>
<tbody>
<tr>
<th class="timetitle" >All Day</th>
<td class="{{: date.toDateCssClass() }}"> </td>
</tr>
<tr>
<th class="timetitle" >Before 6 AM</th>
<td class="time-0-0"> </td>
</tr>
{{for (i = 6; i < 22; i++) { }}
<tr>
<th class="timetitle" >{{: i <= 12 ? i : i - 12 }} {{: i < 12 ? "AM" : "PM"}}</th>
<td class="time-{{: i}}-0"> </td>
</tr>
<tr>
<th class="timetitle" >{{: i <= 12 ? i : i - 12 }}:30 {{: i < 12 ? "AM" : "PM"}}</th>
<td class="time-{{: i}}-30"> </td>
</tr>
{{ } }}
<tr>
<th class="timetitle" >After 10 PM</th>
<td class="time-22-0"> </td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
{{ } }}
</table>
</script>
<script>
var $currentPopover = null;
$(document).on('shown.bs.popover', function (ev) {
var $target = $(ev.target);
if ($currentPopover && ($currentPopover.get(0) != $target.get(0))) {
$currentPopover.popover('toggle');
}
$currentPopover = $target;
}).on('hidden.bs.popover', function (ev) {
var $target = $(ev.target);
if ($currentPopover && ($currentPopover.get(0) == $target.get(0))) {
$currentPopover = null;
}
});
//quicktmpl is a simple template language I threw together a while ago; it is not remotely secure to xss and probably has plenty of bugs that I haven't considered, but it basically works
//the design is a function I read in a blog post by John Resig (http://ejohn.org/blog/javascript-micro-templating/) and it is intended to be loosely translateable to a more comprehensive template language like mustache easily
$.extend({
quicktmpl: function (template) {return new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+template.replace(/[\r\t\n]/g," ").split("{{").join("\t").replace(/((^|\}\})[^\t]*)'/g,"$1\r").replace(/\t:(.*?)\}\}/g,"',$1,'").split("\t").join("');").split("}}").join("p.push('").split("\r").join("\\'")+"');}return p.join('');")}
});
$.extend(Date.prototype, {
//provides a string that is _year_month_day, intended to be widely usable as a css class
toDateCssClass: function () {
return '_' + this.getFullYear() + '_' + (this.getMonth() + 1) + '_' + this.getDate();
},
//this generates a number useful for comparing two dates;
toDateInt: function () {
return ((this.getFullYear()*12) + this.getMonth())*32 + this.getDate();
},
toTimeString: function() {
var hours = this.getHours(),
minutes = this.getMinutes(),
hour = (hours > 12) ? (hours - 12) : hours,
ampm = (hours >= 12) ? ' pm' : ' am';
if (hours === 0 && minutes===0) { return ''; }
if (minutes > 0) {
return hour + ':' + minutes + ampm;
}
return hour + ampm;
}
});
(function ($) {
//t here is a function which gets passed an options object and returns a string of html. I am using quicktmpl to create it based on the template located over in the html block
var t = $.quicktmpl($('#tmpl').get(0).innerHTML);
function calendar($el, options) {
//actions aren't currently in the template, but could be added easily...
$el.on('click', '.js-cal-prev', function () {
switch(options.mode) {
case 'year': options.date.setFullYear(options.date.getFullYear() - 1); break;
case 'month': options.date.setMonth(options.date.getMonth() - 1); break;
case 'week': options.date.setDate(options.date.getDate() - 7); break;
case 'day': options.date.setDate(options.date.getDate() - 1); break;
}
draw();
}).on('click', '.js-cal-next', function () {
switch(options.mode) {
case 'year': options.date.setFullYear(options.date.getFullYear() + 1); break;
case 'month': options.date.setMonth(options.date.getMonth() + 1); break;
case 'week': options.date.setDate(options.date.getDate() + 7); break;
case 'day': options.date.setDate(options.date.getDate() + 1); break;
}
draw();
}).on('click', '.js-cal-option', function () {
var $t = $(this), o = $t.data();
if (o.date) { o.date = new Date(o.date); }
$.extend(options, o);
draw();
}).on('click', '.js-cal-years', function () {
var $t = $(this),
haspop = $t.data('popover'),
s = '',
y = options.date.getFullYear() - 2,
l = y + 5;
if (haspop) { return true; }
for (; y < l; y++) {
s += '<button type="button" class="btn btn-default btn-lg btn-block js-cal-option" data-date="' + (new Date(y, 1, 1)).toISOString() + '" data-mode="year">'+y + '</button>';
}
$t.popover({content: s, html: true, placement: 'auto top'}).popover('toggle');
return false;
}).on('click', '.event', function () {
var $t = $(this),
index = +($t.attr('data-index')),
haspop = $t.data('popover'),
data, time;
if (haspop || isNaN(index)) { return true; }
data = options.data[index];
time = data.start.toTimeString();
if (time && data.end) { time = time + ' - ' + data.end.toTimeString(); }
$t.data('popover',true);
$t.popover({content: '<p><strong>' + time + '</strong></p>'+data.text, html: true, placement: 'auto left'}).popover('toggle');
return false;
});
function dayAddEvent(index, event) {
if (!!event.allDay) {
monthAddEvent(index, event);
return;
}
var $event = $('<div/>', {'class': 'event', text: event.title, title: event.title, 'data-index': index}),
start = event.start,
end = event.end || start,
time = event.start.toTimeString(),
hour = start.getHours(),
timeclass = '.time-22-0',
startint = start.toDateInt(),
dateint = options.date.toDateInt(),
endint = end.toDateInt();
if (startint > dateint || endint < dateint) { return; }
if (!!time) {
$event.html('<strong>' + time + '</strong> ' + $event.html());
}
$event.toggleClass('begin', startint === dateint);
$event.toggleClass('end', endint === dateint);
if (hour < 6) {
timeclass = '.time-0-0';
}
if (hour < 22) {
timeclass = '.time-' + hour + '-' + (start.getMinutes() < 30 ? '0' : '30');
}
$(timeclass).append($event);
}
function monthAddEvent(index, event) {
var $event = $('<div/>', {'class': 'event', text: event.title, title: event.title, 'data-index': index}),
e = new Date(event.start),
dateclass = e.toDateCssClass(),
day = $('.' + e.toDateCssClass()),
empty = $('<div/>', {'class':'clear event', html:' '}),
numbevents = 0,
time = event.start.toTimeString(),
endday = event.end && $('.' + event.end.toDateCssClass()).length > 0,
checkanyway = new Date(e.getFullYear(), e.getMonth(), e.getDate()+40),
existing,
i;
$event.toggleClass('all-day', !!event.allDay);
if (!!time) {
$event.html('<strong>' + time + '</strong> ' + $event.html());
}
if (!event.end) {
$event.addClass('begin end');
$('.' + event.start.toDateCssClass()).append($event);
return;
}
while (e <= event.end && (day.length || endday || options.date < checkanyway)) {
if(day.length) {
existing = day.find('.event').length;
numbevents = Math.max(numbevents, existing);
for(i = 0; i < numbevents - existing; i++) {
day.append(empty.clone());
}
day.append(
$event.
toggleClass('begin', dateclass === event.start.toDateCssClass()).
toggleClass('end', dateclass === event.end.toDateCssClass())
);
$event = $event.clone();
$event.html(' ');
}
e.setDate(e.getDate() + 1);
dateclass = e.toDateCssClass();
day = $('.' + dateclass);
}
}
function yearAddEvents(events, year) {
var counts = [0,0,0,0,0,0,0,0,0,0,0,0];
$.each(events, function (i, v) {
if (v.start.getFullYear() === year) {
counts[v.start.getMonth()]++;
}
});
$.each(counts, function (i, v) {
if (v!==0) {
$('.month-'+i).append('<span class="badge">'+v+'</span>');
}
});
}
function draw() {
$el.html(t(options));
//potential optimization (untested), this object could be keyed into a dictionary on the dateclass string; the object would need to be reset and the first entry would have to be made here
$('.' + (new Date()).toDateCssClass()).addClass('today');
if (options.data && options.data.length) {
if (options.mode === 'year') {
yearAddEvents(options.data, options.date.getFullYear());
} else if (options.mode === 'month' || options.mode === 'week') {
$.each(options.data, monthAddEvent);
} else {
$.each(options.data, dayAddEvent);
}
}
}
draw();
}
;(function (defaults, $, window, document) {
$.extend({
calendar: function (options) {
return $.extend(defaults, options);
}
}).fn.extend({
calendar: function (options) {
options = $.extend({}, defaults, options);
return $(this).each(function () {
var $this = $(this);
calendar($this, options);
});
}
});
})({
days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
shortMonths: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
date: (new Date()),
daycss: ["c-sunday", "", "", "", "", "", "c-saturday"],
todayname: "Return",
thismonthcss: "current",
lastmonthcss: "outside",
nextmonthcss: "outside",
mode: "month",
data: []
}, jQuery, window, document);
})(jQuery);
var data = [],
date = new Date(),
d = date.getDate(),
d1 = d,
m = date.getMonth(),
y = date.getFullYear(),
i,
end,
j,
c = 1063,
c1 = 3329,
h,
m,
names = ['All Day Event', 'Long Event', 'Birthday Party', 'Repeating Event', 'Training', 'Meeting', 'Mr. Behnke', 'Date', 'Ms. Tubbs'],
slipsum = ["Now that we know who you are, I know who I am. I'm not a mistake! It all makes sense! In a comic, you know how you can tell who the arch-villain's going to be? He's the exact opposite of the hero. And most times they're friends, like you and me! I should've known way back when... You know why, David? Because of the kids. They called me Mr Glass.", "You see? It's curious. Ted did figure it out - time travel. And when we get back, we gonna tell everyone. How it's possible, how it's done, what the dangers are. But then why fifty years in the future when the spacecraft encounters a black hole does the computer call it an 'unknown entry event'? Why don't they know? If they don't know, that means we never told anyone. And if we never told anyone it means we never made it back. Hence we die down here. Just as a matter of deductive logic.", "Your bones don't break, mine do. That's clear. Your cells react to bacteria and viruses differently than mine. You don't get sick, I do. That's also clear. But for some reason, you and I react the exact same way to water. We swallow it too fast, we choke. We get some in our lungs, we drown. However unreal it may seem, we are connected, you and I. We're on the same curve, just on opposite ends.", "Well, the way they make shows is, they make one show. That show's called a pilot. Then they show that show to the people who make shows, and on the strength of that one show they decide if they're going to make more shows. Some pilots get picked and become television programs. Some don't, become nothing. She starred in one of the ones that became nothing.", "Yeah, I like animals better than people sometimes... Especially dogs. Dogs are the best. Every time you come home, they act like they haven't seen you in a year. And the good thing about dogs... is they got different dogs for different people. Like pit bulls. The dog of dogs. Pit bull can be the right man's best friend... or the wrong man's worst enemy. You going to give me a dog for a pet, give me a pit bull. Give me... Raoul. Right, Omar? Give me Raoul.", "Like you, I used to think the world was this great place where everybody lived by the same standards I did, then some kid with a nail showed me I was living in his world, a world where chaos rules not order, a world where righteousness is not rewarded. That's Cesar's world, and if you're not willing to play by his rules, then you're gonna have to pay the price.", "You think water moves fast? You should see ice. It moves like it has a mind. Like it knows it killed the world once and got a taste for murder. After the avalanche, it took us a week to climb out. Now, I don't know exactly when we turned on each other, but I know that seven of us survived the slide... and only five made it out. Now we took an oath, that I'm breaking now. We said we'd say it was the snow that killed the other two, but it wasn't. Nature is lethal but it doesn't hold a candle to man.", "You see? It's curious. Ted did figure it out - time travel. And when we get back, we gonna tell everyone. How it's possible, how it's done, what the dangers are. But then why fifty years in the future when the spacecraft encounters a black hole does the computer call it an 'unknown entry event'? Why don't they know? If they don't know, that means we never told anyone. And if we never told anyone it means we never made it back. Hence we die down here. Just as a matter of deductive logic.", "Like you, I used to think the world was this great place where everybody lived by the same standards I did, then some kid with a nail showed me I was living in his world, a world where chaos rules not order, a world where righteousness is not rewarded. That's Cesar's world, and if you're not willing to play by his rules, then you're gonna have to pay the price.", "You think water moves fast? You should see ice. It moves like it has a mind. Like it knows it killed the world once and got a taste for murder. After the avalanche, it took us a week to climb out. Now, I don't know exactly when we turned on each other, but I know that seven of us survived the slide... and only five made it out. Now we took an oath, that I'm breaking now. We said we'd say it was the snow that killed the other two, but it wasn't. Nature is lethal but it doesn't hold a candle to man."];
for(i = 0; i < 500; i++) {
j = Math.max(i % 15 - 10, 0);
//c and c1 jump around to provide an illusion of random data
c = (c * 1063) % 1061;
c1 = (c1 * 3329) % 3331;
d = (d1 + c + c1) % 839 - 440;
h = i % 36;
m = (i % 4) * 15;
if (h < 18) { h = 0; m = 0; } else { h = Math.max(h - 24, 0) + 8; }
end = !j ? null : new Date(y, m, d + j, h + 2, m);
data.push({ title: names[c1 % names.length], start: new Date(y, m, d, h, m), end: end, allDay: !(i % 6), text: slipsum[c % slipsum.length ] });
}
data.sort(function(a,b) { return (+a.start) - (+b.start); });
//data must be sorted by start date
//Actually do everything
$('#holder').calendar({
data: data
});
</script>
</div>
</div>
</section>
<!-- Page Footer-->
</div>
</div>
</div>
<!-- JavaScript files-->
<script src="vendor/jquery/jquery.min.js"></script>
<script src="vendor/popper.js/umd/popper.min.js"> </script>
<script src="vendor/bootstrap/js/bootstrap.min.js"></script>
<script src="vendor/jquery.cookie/jquery.cookie.js"> </script>
<script src="vendor/chart.js/Chart.min.js"></script>
<script src="vendor/jquery-validation/jquery.validate.min.js"></script>
<script>
// Sticky navbar
// =========================
$(document).ready(function () {
// Custom function which toggles between sticky class (is-sticky)
var stickyToggle = function (sticky, stickyWrapper, scrollElement) {
var stickyHeight = sticky.outerHeight();
var stickyTop = stickyWrapper.offset().top;
if (scrollElement.scrollTop() >= stickyTop) {
stickyWrapper.height(stickyHeight);
sticky.addClass("is-sticky");
}
else {
sticky.removeClass("is-sticky");
stickyWrapper.height('auto');
}
};
// Find all data-toggle="sticky-onscroll" elements
$('[data-toggle="sticky-onscroll"]').each(function () {
var sticky = $(this);
var stickyWrapper = $('<div>').addClass('sticky-wrapper'); // insert hidden element to maintain actual top offset on page
sticky.before(stickyWrapper);
sticky.addClass('sticky');
// Scroll & resize events
$(window).on('scroll.sticky-onscroll resize.sticky-onscroll', function () {
stickyToggle(sticky, stickyWrapper, $(this));
});
// On page load
stickyToggle(sticky, stickyWrapper, $(window));
});
});
</script>
<!-- Main File-->
<script src="js/front.js"></script>
</body>
</html>