From 1cb53661fdf49d7608d83348c54b1968e0fd71ea Mon Sep 17 00:00:00 2001 From: Adam Shaw Date: Thu, 1 Oct 2009 05:39:02 +0000 Subject: [PATCH] version 1.3.1 --- changelog.txt | 10 +++++ examples/basic.html | 2 +- examples/gcal.html | 2 +- examples/json.html | 2 +- examples/views.html | 2 +- src/css/main.css | 13 +++--- src/grid.js | 1 + src/main.js | 101 +++++++++++++++++++++++--------------------- src/util.js | 43 ++++++++++++++----- src/view.js | 4 +- tests/basic.html | 79 ++++++++++++++++++++++++++++++++++ tests/loader.js | 5 +-- tests/methods.html | 6 +++ tests/options.html | 4 +- version.txt | 2 +- 15 files changed, 200 insertions(+), 76 deletions(-) create mode 100755 tests/basic.html diff --git a/changelog.txt b/changelog.txt index ba38dbf..fcb4554 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,14 @@ +version 1.3.1 (9/30/09) + - Important Bugfixes (please upgrade from 1.3!) + - When current date was late in the month, for long months, and prev/next buttons + were clicked in month-view, some months would be skipped/repeated + - In certain time zones, daylight savings time would cause certain days + to be misnumbered in month-view + - Subtle change in way week interval is chosen when switching from month to basicWeek/basicDay view + - Added 'allDayDefault' option + - Added 'changeView' and 'render' methods + version 1.3 (9/21/09) - different 'views': month/basicWeek/basicDay - more flexible 'header' system for buttons diff --git a/examples/basic.html b/examples/basic.html index ba34676..c765ead 100644 --- a/examples/basic.html +++ b/examples/basic.html @@ -78,7 +78,7 @@ body { margin-top: 40px; text-align: center; - font-size: 13px; + font-size: 14px; font-family: "Lucida Grande",Helvetica,Arial,Verdana,sans-serif; } diff --git a/examples/gcal.html b/examples/gcal.html index 1892c51..ff901d1 100644 --- a/examples/gcal.html +++ b/examples/gcal.html @@ -49,7 +49,7 @@ body { margin-top: 40px; text-align: center; - font-size: 13px; + font-size: 14px; font-family: "Lucida Grande",Helvetica,Arial,Verdana,sans-serif; } diff --git a/examples/json.html b/examples/json.html index 46547ab..1603965 100644 --- a/examples/json.html +++ b/examples/json.html @@ -53,7 +53,7 @@ body { margin-top: 40px; text-align: center; - font-size: 13px; + font-size: 14px; font-family: "Lucida Grande",Helvetica,Arial,Verdana,sans-serif; } diff --git a/examples/views.html b/examples/views.html index a769d65..54d277c 100755 --- a/examples/views.html +++ b/examples/views.html @@ -83,7 +83,7 @@ body { margin-top: 40px; text-align: center; - font-size: 13px; + font-size: 14px; font-family: "Lucida Grande",Helvetica,Arial,Verdana,sans-serif; text-align: left; } diff --git a/src/css/main.css b/src/css/main.css index a77b1d5..78fdd82 100755 --- a/src/css/main.css +++ b/src/css/main.css @@ -221,10 +221,10 @@ table.fc-header { .fc-event, .fc-event a { - color: #fff; - border-style: solid; - border-color: #36c; /* DEFAULT EVENT COLOR */ - background-color: #36c; /* */ + border-style: solid; + border-color: #36c; /* default BORDER color (probably the same as background-color) */ + background-color: #36c; /* default BACKGROUND color */ + color: #fff; /* default TEXT color */ } /* Use the 'className' CalEvent property and the following @@ -232,8 +232,9 @@ table.fc-header { * * .my-event-class, * .my-event-class a { - * border-color: red; - * background-color: red; + * border-color: black; + * background-color: black; + * color: red; * } */ diff --git a/src/grid.js b/src/grid.js index 958791c..e5f3c76 100755 --- a/src/grid.js +++ b/src/grid.js @@ -11,6 +11,7 @@ views.month = function(element, options) { render: function(date, delta, fetchEvents) { if (delta) { addMonths(date, delta); + date.setDate(1); } var start = this.start = cloneDate(date, true); start.setDate(1); diff --git a/src/main.js b/src/main.js index 75a6c38..e9c31a8 100755 --- a/src/main.js +++ b/src/main.js @@ -22,6 +22,8 @@ var defaults = { //disableDragging: false, //disableResizing: false, + allDayDefault: true, + // event ajax startParam: 'start', endParam: 'end', @@ -163,7 +165,7 @@ $.fn.fullCalendar = function(options) { /* View Rendering -----------------------------------------------------------------------------*/ - function switchView(v) { + function changeView(v) { if (v != viewName) { prevView = view; if (viewInstances[v]) { @@ -193,45 +195,47 @@ $.fn.fullCalendar = function(options) { } function render(inc) { - if (inc || !view.date || +view.date != +date) { // !view.date means it hasn't been rendered yet - ignoreWindowResizes = true; - view.render(date, inc || 0, function(callback) { - // dont refetch if new view contains the same events (or a subset) - if (!eventStart || view.visStart < eventStart || view.visEnd > eventEnd) { - fetchEvents(callback); - }else{ - callback(events); // no refetching - } - }); - ignoreWindowResizes = false; - view.date = cloneDate(date); - if (header) { - // enable/disable 'today' button - var today = new Date(); - if (today >= view.start && today < view.end) { - header.find('div.fc-button-today').addClass(tm + '-state-disabled'); - }else{ - header.find('div.fc-button-today').removeClass(tm + '-state-disabled'); + if (_element.offsetWidth !== 0) { // visible on the screen + if (inc || !view.date || +view.date != +date) { // !view.date means it hasn't been rendered yet + ignoreWindowResizes = true; + view.render(date, inc || 0, function(callback) { + // dont refetch if new view contains the same events (or a subset) + if (!eventStart || view.visStart < eventStart || view.visEnd > eventEnd) { + fetchEvents(callback); + }else{ + callback(events); // no refetching + } + }); + ignoreWindowResizes = false; + view.date = cloneDate(date); + if (header) { + // enable/disable 'today' button + var today = new Date(); + if (today >= view.start && today < view.end) { + header.find('div.fc-button-today').addClass(tm + '-state-disabled'); + }else{ + header.find('div.fc-button-today').removeClass(tm + '-state-disabled'); + } } } + else if (view.sizeDirty) { + view.updateSize(); + view.rerenderEvents(); + } + else if (view.eventsDirty) { + // ensure events are rerendered if another view messed with them + // pass in 'events' b/c event might have been added/removed + view.clearEvents(); + view.renderEvents(events); + } + if (header) { + // update title text + header.find('h2.fc-header-title').html(view.title); + } + view.sizeDirty = false; + view.eventsDirty = false; + view.trigger('viewDisplay', _element); } - else if (view.sizeDirty) { - view.updateSize(); - view.rerenderEvents(); - } - else if (view.eventsDirty) { - // ensure events are rerendered if another view messed with them - // pass in 'events' b/c event might have been added/removed - view.clearEvents(); - view.renderEvents(events); - } - if (header) { - // update title text - header.find('h2.fc-header-title').html(view.title); - } - view.sizeDirty = false; - view.eventsDirty = false; - view.trigger('viewDisplay', _element); } // marks other views' events as dirty @@ -292,7 +296,7 @@ $.fn.fullCalendar = function(options) { reportEvents = function(a) { if (prevViewName == view.name && +prevDate == +date) { // protects from fast switching for (var i=0; i + + + + + + + +
+ + \ No newline at end of file diff --git a/tests/loader.js b/tests/loader.js index aa36d2f..470b886 100755 --- a/tests/loader.js +++ b/tests/loader.js @@ -83,10 +83,7 @@ if (_build) { includeJS('../src/gcal.js'); } -var _userAgent = navigator.userAgent.toLowerCase(); -if (!/mozilla/.test(_userAgent) || /(compatible|webkit)/.test(_userAgent) || !window.console || !window.console.log) { - includeJS('firebug-lite/firebug-lite-compressed.js'); -} +includeJS('firebug-lite/firebug-lite-compressed.js'); window.onload = function() { $('body').append( diff --git a/tests/methods.html b/tests/methods.html index dfb3f4e..98e9773 100644 --- a/tests/methods.html +++ b/tests/methods.html @@ -153,6 +153,12 @@ +
+ + + + +

diff --git a/tests/options.html b/tests/options.html index f91c4a1..880fde8 100644 --- a/tests/options.html +++ b/tests/options.html @@ -35,6 +35,8 @@ weekMode: 'variable', + //allDayDefault: false, + /* titleFormat: { month: "'hey!'" @@ -45,7 +47,7 @@ month: "dddd" }, - timeFormat: "H(:mm)[T]{ - H(:mm)T}", + timeFormat: "h(:mm)[T]{ - h(:mm)T}", events: [ { diff --git a/version.txt b/version.txt index a58941b..6261a05 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.3 \ No newline at end of file +1.3.1 \ No newline at end of file