From d1bc5dc529cef80bd43352efed45b620ed4baedd Mon Sep 17 00:00:00 2001 From: Adam Shaw Date: Mon, 19 Oct 2009 08:53:07 +0000 Subject: [PATCH] final tweaks for 1.4 --- Makefile | 4 +++- changelog.txt | 3 ++- src/agenda.js | 19 +++++++++++++++---- src/css/main.css | 5 ++++- src/grid.js | 2 +- src/main.js | 9 +++++++-- src/misc/head.txt | 2 -- src/util.js | 2 +- tests/locale.html | 9 ++++++--- tests/methods.html | 8 +++++--- tests/options.html | 13 ++++++------- tests/theming.html | 15 ++++++++++++--- tests/triggers.html | 3 ++- 13 files changed, 64 insertions(+), 30 deletions(-) diff --git a/Makefile b/Makefile index f7b8177..d3269a5 100644 --- a/Makefile +++ b/Makefile @@ -6,12 +6,14 @@ REV = `svn info | grep Rev: | sed 's/.*: //g'` JS_SRC_FILES =\ main.js\ grid.js\ + agenda.js\ view.js\ util.js CSS_SRC_FILES =\ main.css\ - grid.css + grid.css\ + agenda.css OTHER_FILES =\ src/gcal.js\ diff --git a/changelog.txt b/changelog.txt index 3065a0d..715684a 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,6 +1,6 @@ version 1.4 (10/19/09) - - agendaWeek and agendaDay views !!! + - agendaWeek and agendaDay views - added some options for agenda views: - allDaySlot - allDayText @@ -16,6 +16,7 @@ version 1.4 (10/19/09) - added 'prevYear' and 'nextYear' for buttons in header - minor change for theme users, ui-state-hover not applied to active/inactive buttons - added event-color-changing example in docs + - better defaults for right-to-left themed button icons version 1.3.2 (10/13/09) - Bugfixes (please upgrade from 1.3.1!) diff --git a/src/agenda.js b/src/agenda.js index 822dbc1..b7ef144 100755 --- a/src/agenda.js +++ b/src/agenda.js @@ -52,7 +52,7 @@ function Agenda(element, options, methods) { var head, body, bodyContent, bodyTable, bg, colCnt, - axisWidth, colWidth, slotHeight, // todo: axisWidth -> axisWidth, slotHeight->slotHeight ? + axisWidth, colWidth, slotHeight, cachedDaySegs, cachedSlotSegs, tm, firstDay, rtl, dis, dit, // day index sign / translate @@ -229,7 +229,15 @@ function Agenda(element, options, methods) { var d0 = new Date(1970, 0, 1), scrollDate = cloneDate(d0); scrollDate.setHours(options.firstHour); - body.scrollTop(timePosition(d0, scrollDate) + 1); // +1 for the border + var go = function() { + body.scrollTop(timePosition(d0, scrollDate) + 1); // +1 for the border + // TODO: +1 doesn't apply when firstHour=0 + } + if ($.browser.opera) { + setTimeout(go, 0); // opera 10 (and earlier?) needs this + }else{ + go(); + } } @@ -254,8 +262,7 @@ function Agenda(element, options, methods) { .width('') .each(function() { axisWidth = Math.max(axisWidth, $(this).outerWidth()); - }) - .add(stripeTDs.eq(0)), + }), axisWidth ); @@ -273,6 +280,10 @@ function Agenda(element, options, methods) { }); slotHeight = body.find('tr:first div').height() + 1; + + // TODO: + //reportTBody(bodyTable.find('tbody')); + // Opera 9.25 doesn't detect the bug when called from agenda } function slotClick(ev) { diff --git a/src/css/main.css b/src/css/main.css index 0460f9c..84a67c7 100755 --- a/src/css/main.css +++ b/src/css/main.css @@ -252,12 +252,15 @@ table.fc-header { * color: red; * } */ + +.fc-event { + text-align: left; + } .fc-event a { overflow: hidden; font-size: .85em; text-decoration: none; - text-align: left; cursor: pointer; } diff --git a/src/grid.js b/src/grid.js index fe2d614..4824827 100755 --- a/src/grid.js +++ b/src/grid.js @@ -239,7 +239,7 @@ function Grid(element, options, methods) { } - updateSize(); // BUG: quirky widths with weekMode:variable + updateSize(); fetchEvents(renderEvents); }; diff --git a/src/main.js b/src/main.js index 35d19f3..52fcbbe 100755 --- a/src/main.js +++ b/src/main.js @@ -83,6 +83,10 @@ var rtlDefaults = { next: ' ◄ ', prevYear: ' >> ', nextYear: ' << ' + }, + buttonIcons: { + prev: 'circle-triangle-e', + next: 'circle-triangle-w' } }; @@ -560,8 +564,7 @@ $.fn.fullCalendar = function(options) { tr.append(""); } var prevButton; - $.each(this.split(','), function(j) { - var buttonName = this; // TODO: make this an arg one line above + $.each(this.split(','), function(j, buttonName) { if (buttonName == 'title') { tr.append("

"); if (prevButton) { @@ -658,6 +661,8 @@ $.fn.fullCalendar = function(options) { overflow: 'hidden', height: Math.round(content.width() / options.aspectRatio) }); + // TODO: previous action might have caused scrollbars + // which will make the window width more narrow, possibly changing the aspect ratio } } diff --git a/src/misc/head.txt b/src/misc/head.txt index 2836634..94d252d 100755 --- a/src/misc/head.txt +++ b/src/misc/head.txt @@ -11,8 +11,6 @@ * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html * - * Date: - * Revision: */ (function($) { diff --git a/src/util.js b/src/util.js index 689b45a..6a08185 100755 --- a/src/util.js +++ b/src/util.js @@ -276,7 +276,7 @@ function setOuterHeight(element, height, includeMargins) { var operaPositionBug; -function reportTBody(tbody) { // TODO: have agenda use this too +function reportTBody(tbody) { if (operaPositionBug == undefined) { operaPositionBug = tbody.position().top != tbody.find('tr').position().top; } diff --git a/tests/locale.html b/tests/locale.html index 7c462c7..8c53d97 100644 --- a/tests/locale.html +++ b/tests/locale.html @@ -31,13 +31,15 @@ weekMode: 'variable', - dayClick: function(dayDate, view) { - console.log('dayClick - ' + dayDate + ' - ' + view.title); + dayClick: function(dayDate, allDay, ev, view) { + console.log('dayClick - ' + dayDate + ' - allDay:' + allDay + ' --- ' + view.title); }, - eventDrop: function(event, dayDelta, minuteDelta, revertFunc, jsEvent, ui, view) { + eventDrop: function(event, dayDelta, minuteDelta, allDay, revertFunc, jsEvent, ui, view) { console.log('DROP ' + event.title); console.log(dayDelta + ' days'); + console.log(minuteDelta + ' minutes'); + console.log('allDay: ' + allDay); console.log(event.start); //console.log(minuteDelta + ' minutes'); }, @@ -45,6 +47,7 @@ eventResize: function(event, dayDelta, minuteDelta, revertFunc, jsEvent, ui, view) { console.log('RESIZE!! ' + event.title); console.log(dayDelta + ' days'); + console.log(minuteDelta + ' minutes'); console.log(event.end); //console.log(minuteDelta + ' minutes'); }, diff --git a/tests/methods.html b/tests/methods.html index a345d1d..b65c2f3 100644 --- a/tests/methods.html +++ b/tests/methods.html @@ -78,8 +78,10 @@ function updateEventStart() { var event = cal.fullCalendar('clientEvents', 777)[0]; - event.start = new Date(y, m, 25, 10, 30); - event.end = new Date(y, m, 26); + event.start = new Date(y, m, d, 13, 30); + event.end = new Date(y, m, d, 14, 50); + //event.start = new Date(y, m, 25, 10, 30); // move big days + //event.end = new Date(y, m, 26); //event.allDay = true; cal.fullCalendar('updateEvent', event); } @@ -88,7 +90,7 @@ var event = cal.fullCalendar('clientEvents', 999)[0]; event.start = new Date(y, m, 4, 13, 30); event.end = new Date(y, m, 5, 2, 0); - event.allDay = false; + event.allDay = true; event.title = "repeat yo"; //event.editable = false; event.url = "http://google.com/"; diff --git a/tests/options.html b/tests/options.html index b144c0f..ae24410 100644 --- a/tests/options.html +++ b/tests/options.html @@ -12,15 +12,14 @@ $(document).ready(function() { $('#calendar').fullCalendar({ - /* - year: 2010, - month: 0, - date: 0, + //year: 2010, + //month: 0, + //date: 1, - defaultView: 'basicDay', + //defaultView: 'basicDay', + + //aspectRatio: 1, - aspectRatio: 1, - */ header: { left: 'title', diff --git a/tests/theming.html b/tests/theming.html index 17f1caf..5438a1b 100755 --- a/tests/theming.html +++ b/tests/theming.html @@ -16,19 +16,28 @@ theme: true, editable: true, - //isRTL: true, - header: { - left: 'prev,next today', + left: 'prevYear,prev,next,nextYear today', center: 'title', right: 'month,agendaWeek,basicWeek,agendaDay,basicDay' }, + /* buttonIcons: { prev: 'triangle-1-w', next: 'triangle-1-e', today: 'home' }, + */ + + /* + isRTL: true, + header: { + left: 'nextYear,next,prev,prevYear today', + center: 'title', + right: 'month,agendaWeek,basicWeek,agendaDay,basicDay' + }, + */ events: [ { diff --git a/tests/triggers.html b/tests/triggers.html index d37dc88..61a162a 100755 --- a/tests/triggers.html +++ b/tests/triggers.html @@ -141,7 +141,8 @@ { id: 888, title: 'Meeting', - start: new Date(y, m, d, 10, 30) + start: new Date(y, m, d, 10, 30), + allDay: false }, { id: 777,