Commit f37c5632 authored by Carsten  Rose's avatar Carsten Rose

Merge branch 'f8658-Calendar' into 'develop'

F8658 calendar

See merge request !243
parents a782b3e2 9d437acd
Pipeline #3144 passed with stages
in 2 minutes and 10 seconds
......@@ -273,6 +273,13 @@ module.exports = function (grunt) {
dest: "js/fullCalendar",
expand: true,
flatten: false
},
{
cwd: 'node_modules/@fullcalendar/',
src: '**',
dest: typo3_js + "/fullCalendar",
expand: true,
flatten: false
}
]
},
......@@ -494,6 +501,10 @@ module.exports = function (grunt) {
src: ['javascript/src/Plugins/qfq.fabric.js'],
dest: typo3_js + 'qfq.fabric.min.js'
},
fullCalendar: {
src: ['js/fullCalendar.js'],
dest: typo3_js + 'fullCalendar.min.js'
},
qfqValidator: {
src: ['javascript/src/Plugins/validator.js'],
dest: typo3_js + 'validator.min.js'
......@@ -502,6 +513,16 @@ module.exports = function (grunt) {
jshint: {
all: js_sources
},
concat: {
js: {
src: 'js/fullCalendar/*/main.js',
dest: 'js/fullCalendar.js'
},
css: {
src: 'js/fullCalendar/*/main.min.css',
dest: typo3_css + 'fullCalendar.min.css'
}
},
concat_in_order: {
debug_standalone: {
options: {
......@@ -611,7 +632,7 @@ module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-contrib-jasmine');
// Default task(s).
grunt.registerTask('default', ['jshint', 'concat_in_order', 'uglify', 'copy', 'less']);
grunt.registerTask('default', ['jshint', 'concat_in_order', 'concat', 'uglify', 'copy', 'less']);
grunt.registerTask('only-js', ['jshint', 'concat_in_order', 'uglify', 'copy:qfqPlugins', 'copy:worker']);
......
/**
* @author Benjamin Baer <benjamin.baer@math.uzh.ch>
*/
/* global console */
/* global FullCalendar */
/* global $ */
/**
* Qfq Namespace
*
* @namespace QfqNS
*/
var QfqNS = QfqNS || {};
/**
* Qfq Helper Namespace
*
* @namespace QfqNS.Helper
*/
QfqNS.Helper = QfqNS.Helper || {};
(function (n) {
'use strict';
/**
* Initializes fullcalendar.js.
*
* The Full Calendar configuration has to be provided in the `data-config` attribute as JSON. E.g.
*
* <div class="qfq-calendar" data-config='{ "plugins": [ 'dayGrid' ] }'></textarea>
*
* @function
*/
var fullCalendar = function (form) {
if (typeof FullCalendar === 'undefined') {
QfqNS.log.error("FullCalendar Plugin wasn't loaded correctly.");
return;
}
$("div.qfq-calendar").each(
function () {
var config = {};
var $this = $(this);
var element = $this.get(0);
var configData = $this.data('config');
if (configData) {
if (configData instanceof Object) {
// jQuery takes care of decoding data-config to JavaScript object.
config = configData;
} else {
QfqNS.Log.warning("'data-config' is invalid: " + configData);
}
}
var calendar = new FullCalendar.Calendar(element, configData);
calendar.render();
}
);
};
n.calendar = fullCalendar;
})(QfqNS.Helper);
\ No newline at end of file
......@@ -80,6 +80,7 @@ $(document).ready( function () {
});
});
n.Helper.calendar();
})(QfqNS);
});
\ No newline at end of file
......@@ -153,6 +153,7 @@ var QfqNS = QfqNS || {};
//n.Helper.jqxEditor();
n.Helper.tinyMce();
n.Helper.codemirror();
this.form.on('form.submit.before', n.Helper.tinyMce.prepareSave);
this.form.on('form.validation.before', n.Helper.tinyMce.prepareSave);
this.form.on('form.validation.failed', this.validationError);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment