5 items
NAME ↑ SIZE MODIFIED PERMS ACTIONS
.. / Parent Directory
calendar.js — 8.91 KB
2025-05-10 09:19 · rw-rw-rw-
8.91 KB 2025-05-10 09:19 rw-rw-rw-
custom.js — 10.24 KB
2025-05-10 09:19 · rw-rw-rw-
10.24 KB 2025-05-10 09:19 rw-rw-rw-
demo-chart-js.js — 12.15 KB
2025-05-10 09:19 · rw-rw-rw-
12.15 KB 2025-05-10 09:19 rw-rw-rw-
demo.js — 1.63 KB
2025-05-10 09:19 · rw-rw-rw-
1.63 KB 2025-05-10 09:19 rw-rw-rw-
dt_design.js — 32.72 KB
2025-05-10 09:19 · rw-rw-rw-
32.72 KB 2025-05-10 09:19 rw-rw-rw-
ONLINE
js
5 items
15:32:40
TERMINAL FM
Edit
Preview
Download
Rename
Copy
Chmod
Delete
"use strict"; (function($, window){ function startOfDay(date) { const clonedDate = new Date(date); clonedDate.setHours(0); clonedDate.setMinutes(0); clonedDate.setSeconds(0); clonedDate.setMilliseconds(0); return clonedDate; } function startOfMonth(date) { const clonedDate = startOfDay(new Date(date)); clonedDate.setDate(1); return clonedDate; } function getCalendarHeight() { if (window.matchMedia('(min-width: 1600px)').matches) { return '100%'; } else { return 'auto'; } } $('#calendar').each(function () { const calendarEl = this; const curYear = (new Date()).getFullYear(); const curMonth = ('0' + ((new Date()).getMonth() + 1)).substr(-2); const eventsSources = [ { events: [ { title: 'E3 Electronic Entertainment Expo', start: curYear + '-' + curMonth + '-01', end: curYear + '-' + curMonth + '-05', color: '#DB4343', textColor: '#fff', }, { title: 'Adam\'s birthday', start: curYear + '-' + curMonth + '-06', color: '#f69a2f', textColor: '#fff', }, { title: 'dt HTML release', start: curYear + '-' + curMonth + '-19', color: '#FAB207', textColor: '#212529', }, { title: 'dt Angular release', start: curYear + '-' + curMonth + '-28', color: '#dd0032', textColor: '#fff', }, { title: 'dt React release', start: curYear + '-' + curMonth + '-14', color: '#61dafd', textColor: '#292c36', }, { title: 'dt Vue release', start: curYear + '-' + curMonth + '-02', color: '#43b885', textColor: '#fff', }, { title: 'Annual leave', start: curYear + '-' + curMonth + '-24', end: curYear + '-' + curMonth + '-28', color: '#4275c2', textColor: '#fff', }, { title: 'Moscow JavaScript Conference', start: curYear + '-' + curMonth + '-11', end: curYear + '-' + curMonth + '-13', color: '#7a42c2', textColor: '#fff', }, { title: 'Russian Hacker\'s Day', start: curYear + '-' + curMonth + '-16', color: '#c33994', textColor: '#fff', }, ], } ]; const datepicker = $('.sa-calendar-datepicker').datepicker({ language: 'en', classes: 'datepicker-sa-embedded', inline: true, onRenderCell: function (date, cellType) { if (cellType === 'day') { const currentDay = date.getTime(); let dotsHtml = ''; eventsSources.forEach(function(eventSource) { eventSource.events.map(function(event) { const startDate = startOfDay(new Date(event.start)).getTime(); const endDate = event.end ? startOfDay(new Date(event.end)).getTime() : startDate; if ( (startDate < currentDay && endDate > currentDay) || (startDate === currentDay) ) { dotsHtml += '
'; } }); }); if (dotsHtml) { return { html: date.getDate() + '
' + dotsHtml + '
' } } } }, onSelect: function onSelect(fd, date) { if (date) { calendar.changeView('timeGridDay', date); } else if (calendar.view.type === 'timeGridDay') { calendar.changeView('dayGridMonth'); } }, }).data('datepicker'); const calendar = new FullCalendar.Calendar(calendarEl, { initialView: 'dayGridMonth', customButtons: { 'sa-sidebar': { text: '', click: function() { window.dt.layoutSidebar.open(); } } }, viewDidMount: function() { calendarEl.querySelectorAll('.fc-sa-sidebar-button').forEach((button) => { if (button.classList.contains('fc-sa-sidebar-button')) { button.innerHTML = ''; } }); }, headerToolbar: { left: 'sa-sidebar prev,next today', center: 'title', right: 'dayGridMonth,timeGridWeek,timeGridDay,listWeek' }, height: getCalendarHeight(), navLinks: true, buttonText: { today: 'Today', month: 'Month', week: 'Week', day: 'Day', list: 'List', }, editable: true, selectable: true, selectMirror: true, droppable: true, select: function(info) { const eventTitle = prompt('Enter a title for the new event:'); if (eventTitle) { calendar.addEvent({ title: eventTitle, start: info.start, end: info.end, allDay: info.allDay, }); } calendar.unselect(); }, eventClick: function(info) { if (confirm('Are you sure you want to delete this event?')) { info.event.remove(); } }, eventSources: eventsSources, datesSet: function(event) { if (['dayGridMonth', 'timeGridWeek', 'listWeek'].includes(event.view.type)) { datepicker.clear(); const startMonth = startOfMonth(event.start); if (event.view.type === 'dayGridMonth' && event.start.getDate() !== 1) { startMonth.setMonth(startMonth.getMonth() + 1); } if (startMonth.getTime() !== startOfMonth(datepicker.date).getTime()) { datepicker.date = startMonth; } } else if (event.view.type === 'timeGridDay') { const selectedDates = datepicker.selectedDates.map(function(date) { return startOfDay(date).getTime(); }); if (selectedDates.length !== 1 || selectedDates[0] !== startOfDay(event.start).getTime()) { datepicker.selectDate(event.start); } } }, windowResize: function() { calendar.setOption('height', getCalendarHeight()); }, }); calendar.render(); }); }(jQuery, window));