From 33ef246fd925e583c4b5b74bd2d3346df475dbf9 Mon Sep 17 00:00:00 2001 From: Adam Shaw Date: Sun, 15 Jun 2014 11:34:06 -0700 Subject: [PATCH] version 2.0.1 --- bower.json | 2 +- dist/fullcalendar.css | 2 +- dist/fullcalendar.js | 354 +++++++++++++++++++++--------------- dist/fullcalendar.min.js | 6 +- dist/fullcalendar.print.css | 2 +- dist/gcal.js | 2 +- dist/lang-all.js | 6 +- dist/lang/ar-ma.js | 2 +- dist/lang/ar-sa.js | 1 + dist/lang/ar.js | 2 +- dist/lang/cs.js | 2 +- dist/lang/da.js | 2 +- dist/lang/de-at.js | 1 + dist/lang/el.js | 2 +- dist/lang/id.js | 1 + dist/lang/is.js | 1 + dist/lang/it.js | 2 +- dist/lang/lt.js | 2 +- dist/lang/pt.js | 2 +- dist/lang/ru.js | 2 +- dist/lang/sr-cyr.js | 1 - dist/lang/sr-cyrl.js | 1 + dist/lang/sr.js | 2 +- fullcalendar.jquery.json | 2 +- package.json | 2 +- 25 files changed, 232 insertions(+), 172 deletions(-) create mode 100644 dist/lang/ar-sa.js create mode 100644 dist/lang/de-at.js create mode 100644 dist/lang/id.js create mode 100644 dist/lang/is.js delete mode 100644 dist/lang/sr-cyr.js create mode 100644 dist/lang/sr-cyrl.js diff --git a/bower.json b/bower.json index ddb24e1..4b32a42 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "fullcalendar", - "version": "2.0.0", + "version": "2.0.1", "description": "Full-sized drag & drop event calendar", "keywords": [ "calendar", "event", "full-sized" ], diff --git a/dist/fullcalendar.css b/dist/fullcalendar.css index 5486157..21e150b 100644 --- a/dist/fullcalendar.css +++ b/dist/fullcalendar.css @@ -1,5 +1,5 @@ /*! - * FullCalendar v2.0.0 Stylesheet + * FullCalendar v2.0.1 Stylesheet * Docs & License: http://arshaw.com/fullcalendar/ * (c) 2013 Adam Shaw */ diff --git a/dist/fullcalendar.js b/dist/fullcalendar.js index 6ccc266..735974e 100644 --- a/dist/fullcalendar.js +++ b/dist/fullcalendar.js @@ -1,5 +1,5 @@ /*! - * FullCalendar v2.0.0 + * FullCalendar v2.0.1 * Docs & License: http://arshaw.com/fullcalendar/ * (c) 2013 Adam Shaw */ @@ -64,6 +64,12 @@ var defaults = { timeFormat: { // for event elements 'default': generateShortTimeFormat }, + + displayEventEnd: { + month: false, + basicWeek: false, + 'default': true + }, // locale isRTL: false, @@ -99,7 +105,8 @@ var defaults = { dropAccept: '*', - handleWindowResize: true + handleWindowResize: true, + windowResizeDelay: 200 // milliseconds before a rerender happens }; @@ -159,7 +166,7 @@ var rtlDefaults = { ;; -var fc = $.fullCalendar = { version: "2.0.0" }; +var fc = $.fullCalendar = { version: "2.0.1" }; var fcViews = fc.views = {}; @@ -646,9 +653,19 @@ function Calendar(element, instanceOptions) { $(window).unbind('resize', windowResize); + if (options.droppable) { + $(document) + .off('dragstart', droppableDragStart) + .off('dragstop', droppableDragStop); + } + + if (currentView.selectionManagerDestroy) { + currentView.selectionManagerDestroy(); + } + header.destroy(); content.remove(); - element.removeClass('fc fc-rtl ui-widget'); + element.removeClass('fc fc-ltr fc-rtl ui-widget'); } @@ -789,8 +806,11 @@ function Calendar(element, instanceOptions) { } - function windowResize() { - if (!ignoreWindowResize) { + function windowResize(ev) { + if ( + !ignoreWindowResize && + ev.target === window // so we don't process jqui "resize" events that have bubbled up + ) { if (currentView.start) { // view has already been rendered var uid = ++resizeUID; setTimeout(function() { // add a delay @@ -802,7 +822,7 @@ function Calendar(element, instanceOptions) { ignoreWindowResize--; } } - }, 200); + }, options.windowResizeDelay); }else{ // calendar must have been initialized in a 0x0 iframe that has just been resized lateRender(); @@ -1028,23 +1048,28 @@ function Calendar(element, instanceOptions) { if (options.droppable) { // TODO: unbind on destroy $(document) - .bind('dragstart', function(ev, ui) { - var _e = ev.target; - var e = $(_e); - if (!e.parents('.fc').length) { // not already inside a calendar - var accept = options.dropAccept; - if ($.isFunction(accept) ? accept.call(_e, e) : e.is(accept)) { - _dragElement = _e; - currentView.dragStart(_dragElement, ev, ui); - } - } - }) - .bind('dragstop', function(ev, ui) { - if (_dragElement) { - currentView.dragStop(_dragElement, ev, ui); - _dragElement = null; - } - }); + .on('dragstart', droppableDragStart) + .on('dragstop', droppableDragStop); + // this is undone in destroy + } + + function droppableDragStart(ev, ui) { + var _e = ev.target; + var e = $(_e); + if (!e.parents('.fc').length) { // not already inside a calendar + var accept = options.dropAccept; + if ($.isFunction(accept) ? accept.call(_e, e) : e.is(accept)) { + _dragElement = _e; + currentView.dragStart(_dragElement, ev, ui); + } + } + } + + function droppableDragStop(ev, ui) { + if (_dragElement) { + currentView.dragStop(_dragElement, ev, ui); + _dragElement = null; + } } @@ -1270,17 +1295,15 @@ function EventManager(options) { // assumed to be a calendar var cache = []; - - var _sources = options.eventSources || []; - // TODO: don't mutate eventSources (see issue 954 and automated tests for constructor.js) - - if (options.events) { - _sources.push(options.events); - } - - for (var i=0; i<_sources.length; i++) { - _addEventSource(_sources[i]); - } + $.each( + (options.events ? [ options.events ] : []).concat(options.eventSources || []), + function(i, sourceInput) { + var source = buildEventSource(sourceInput); + if (source) { + sources.push(source); + } + } + ); @@ -1446,29 +1469,44 @@ function EventManager(options) { // assumed to be a calendar -----------------------------------------------------------------------------*/ - function addEventSource(source) { - source = _addEventSource(source); + function addEventSource(sourceInput) { + var source = buildEventSource(sourceInput); if (source) { pendingSourceCnt++; fetchEventSource(source, currentFetchID); // will eventually call reportEvents } } - - - function _addEventSource(source) { - if ($.isFunction(source) || $.isArray(source)) { - source = { events: source }; + + + function buildEventSource(sourceInput) { // will return undefined if invalid source + var normalizers = fc.sourceNormalizers; + var source; + var i; + + if ($.isFunction(sourceInput) || $.isArray(sourceInput)) { + source = { events: sourceInput }; } - else if (typeof source == 'string') { - source = { url: source }; + else if (typeof sourceInput === 'string') { + source = { url: sourceInput }; } - if (typeof source == 'object') { - normalizeSource(source); - sources.push(source); + else if (typeof sourceInput === 'object') { + source = $.extend({}, sourceInput); // shallow copy + + if (typeof source.className === 'string') { + // TODO: repeat code, same code for event classNames + source.className = source.className.split(/\s+/); + } + } + + if (source) { + for (i=0; i