summaryrefslogtreecommitdiff
path: root/assets/js/components
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2017-04-01 15:43:36 -0400
committerFrederic Guillot <fred@kanboard.net>2017-04-01 15:43:36 -0400
commit253d5a9331e4b4775066ec8cb9664da9a2aa6ac9 (patch)
tree0d089bcbe3b7ea964e8b0ec651a0694dee86c9d1 /assets/js/components
parent99015d08fa194c5b8145f5d1315d61ebc20bd7a3 (diff)
Move calendar to external plugin
Diffstat (limited to 'assets/js/components')
-rw-r--r--assets/js/components/calendar.js65
-rw-r--r--assets/js/components/keyboard-shortcuts.js4
2 files changed, 0 insertions, 69 deletions
diff --git a/assets/js/components/calendar.js b/assets/js/components/calendar.js
deleted file mode 100644
index ed6916b2..00000000
--- a/assets/js/components/calendar.js
+++ /dev/null
@@ -1,65 +0,0 @@
-KB.component('calendar', function (containerElement, options) {
- var modeMapping = { // Let's have bookable pretty mode names
- month: 'month',
- week: 'agendaWeek',
- day: 'agendaDay'
- };
-
- this.render = function () {
- var calendar = $(containerElement);
- var mode = 'month';
- if (window.location.hash) { // Check if hash contains mode
- var hashMode = window.location.hash.substr(1);
- mode = modeMapping[hashMode] || mode;
- }
-
- calendar.fullCalendar({
- locale: $("body").data("js-lang"),
- editable: true,
- eventLimit: true,
- defaultView: mode,
- header: {
- left: 'prev,next today',
- center: 'title',
- right: 'month,agendaWeek,agendaDay'
- },
- eventDrop: function(event) {
- $.ajax({
- cache: false,
- url: options.saveUrl,
- contentType: "application/json",
- type: "POST",
- processData: false,
- data: JSON.stringify({
- "task_id": event.id,
- "date_due": event.start.format()
- })
- });
- },
- viewRender: function(view) {
- // Map view.name back and update location.hash
- for (var id in modeMapping) {
- if (modeMapping[id] === view.name) { // Found
- window.location.hash = id;
- break;
- }
- }
- var url = options.checkUrl;
- var params = {
- "start": calendar.fullCalendar('getView').start.format(),
- "end": calendar.fullCalendar('getView').end.format()
- };
-
- for (var key in params) {
- url += "&" + key + "=" + params[key];
- }
-
- $.getJSON(url, function(events) {
- calendar.fullCalendar('removeEvents');
- calendar.fullCalendar('addEventSource', events);
- calendar.fullCalendar('rerenderEvents');
- });
- }
- });
- };
-});
diff --git a/assets/js/components/keyboard-shortcuts.js b/assets/js/components/keyboard-shortcuts.js
index cffcd790..1eec4bbe 100644
--- a/assets/js/components/keyboard-shortcuts.js
+++ b/assets/js/components/keyboard-shortcuts.js
@@ -117,10 +117,6 @@ KB.keyboardShortcuts = function () {
goToLink('a.view-board');
});
- KB.onKey('v+c', function () {
- goToLink('a.view-calendar');
- });
-
KB.onKey('v+l', function () {
goToLink('a.view-listing');
});