final tweaks for 1.4

This commit is contained in:
Adam Shaw 2009-10-19 08:53:07 +00:00
parent 067481b774
commit d1bc5dc529
13 changed files with 64 additions and 30 deletions

View file

@ -6,12 +6,14 @@ REV = `svn info | grep Rev: | sed 's/.*: //g'`
JS_SRC_FILES =\ JS_SRC_FILES =\
main.js\ main.js\
grid.js\ grid.js\
agenda.js\
view.js\ view.js\
util.js util.js
CSS_SRC_FILES =\ CSS_SRC_FILES =\
main.css\ main.css\
grid.css grid.css\
agenda.css
OTHER_FILES =\ OTHER_FILES =\
src/gcal.js\ src/gcal.js\

View file

@ -1,6 +1,6 @@
version 1.4 (10/19/09) version 1.4 (10/19/09)
- agendaWeek and agendaDay views !!! - agendaWeek and agendaDay views
- added some options for agenda views: - added some options for agenda views:
- allDaySlot - allDaySlot
- allDayText - allDayText
@ -16,6 +16,7 @@ version 1.4 (10/19/09)
- added 'prevYear' and 'nextYear' for buttons in header - added 'prevYear' and 'nextYear' for buttons in header
- minor change for theme users, ui-state-hover not applied to active/inactive buttons - minor change for theme users, ui-state-hover not applied to active/inactive buttons
- added event-color-changing example in docs - added event-color-changing example in docs
- better defaults for right-to-left themed button icons
version 1.3.2 (10/13/09) version 1.3.2 (10/13/09)
- Bugfixes (please upgrade from 1.3.1!) - Bugfixes (please upgrade from 1.3.1!)

View file

@ -52,7 +52,7 @@ function Agenda(element, options, methods) {
var head, body, bodyContent, bodyTable, bg, var head, body, bodyContent, bodyTable, bg,
colCnt, colCnt,
axisWidth, colWidth, slotHeight, // todo: axisWidth -> axisWidth, slotHeight->slotHeight ? axisWidth, colWidth, slotHeight,
cachedDaySegs, cachedSlotSegs, cachedDaySegs, cachedSlotSegs,
tm, firstDay, tm, firstDay,
rtl, dis, dit, // day index sign / translate rtl, dis, dit, // day index sign / translate
@ -229,7 +229,15 @@ function Agenda(element, options, methods) {
var d0 = new Date(1970, 0, 1), var d0 = new Date(1970, 0, 1),
scrollDate = cloneDate(d0); scrollDate = cloneDate(d0);
scrollDate.setHours(options.firstHour); scrollDate.setHours(options.firstHour);
var go = function() {
body.scrollTop(timePosition(d0, scrollDate) + 1); // +1 for the border 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('') .width('')
.each(function() { .each(function() {
axisWidth = Math.max(axisWidth, $(this).outerWidth()); axisWidth = Math.max(axisWidth, $(this).outerWidth());
}) }),
.add(stripeTDs.eq(0)),
axisWidth axisWidth
); );
@ -273,6 +280,10 @@ function Agenda(element, options, methods) {
}); });
slotHeight = body.find('tr:first div').height() + 1; 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) { function slotClick(ev) {

View file

@ -253,11 +253,14 @@ table.fc-header {
* } * }
*/ */
.fc-event {
text-align: left;
}
.fc-event a { .fc-event a {
overflow: hidden; overflow: hidden;
font-size: .85em; font-size: .85em;
text-decoration: none; text-decoration: none;
text-align: left;
cursor: pointer; cursor: pointer;
} }

View file

@ -239,7 +239,7 @@ function Grid(element, options, methods) {
} }
updateSize(); // BUG: quirky widths with weekMode:variable updateSize();
fetchEvents(renderEvents); fetchEvents(renderEvents);
}; };

View file

@ -83,6 +83,10 @@ var rtlDefaults = {
next: ' ◄ ', next: ' ◄ ',
prevYear: ' >> ', prevYear: ' >> ',
nextYear: ' << ' nextYear: ' << '
},
buttonIcons: {
prev: 'circle-triangle-e',
next: 'circle-triangle-w'
} }
}; };
@ -560,8 +564,7 @@ $.fn.fullCalendar = function(options) {
tr.append("<td><span class='fc-header-space'/></td>"); tr.append("<td><span class='fc-header-space'/></td>");
} }
var prevButton; var prevButton;
$.each(this.split(','), function(j) { $.each(this.split(','), function(j, buttonName) {
var buttonName = this; // TODO: make this an arg one line above
if (buttonName == 'title') { if (buttonName == 'title') {
tr.append("<td><h2 class='fc-header-title'/></td>"); tr.append("<td><h2 class='fc-header-title'/></td>");
if (prevButton) { if (prevButton) {
@ -658,6 +661,8 @@ $.fn.fullCalendar = function(options) {
overflow: 'hidden', overflow: 'hidden',
height: Math.round(content.width() / options.aspectRatio) 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
} }
} }

View file

@ -11,8 +11,6 @@
* http://www.opensource.org/licenses/mit-license.php * http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html * http://www.gnu.org/licenses/gpl.html
* *
* Date:
* Revision:
*/ */
(function($) { (function($) {

View file

@ -276,7 +276,7 @@ function setOuterHeight(element, height, includeMargins) {
var operaPositionBug; var operaPositionBug;
function reportTBody(tbody) { // TODO: have agenda use this too function reportTBody(tbody) {
if (operaPositionBug == undefined) { if (operaPositionBug == undefined) {
operaPositionBug = tbody.position().top != tbody.find('tr').position().top; operaPositionBug = tbody.position().top != tbody.find('tr').position().top;
} }

View file

@ -31,13 +31,15 @@
weekMode: 'variable', weekMode: 'variable',
dayClick: function(dayDate, view) { dayClick: function(dayDate, allDay, ev, view) {
console.log('dayClick - ' + dayDate + ' - ' + view.title); 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('DROP ' + event.title);
console.log(dayDelta + ' days'); console.log(dayDelta + ' days');
console.log(minuteDelta + ' minutes');
console.log('allDay: ' + allDay);
console.log(event.start); console.log(event.start);
//console.log(minuteDelta + ' minutes'); //console.log(minuteDelta + ' minutes');
}, },
@ -45,6 +47,7 @@
eventResize: function(event, dayDelta, minuteDelta, revertFunc, jsEvent, ui, view) { eventResize: function(event, dayDelta, minuteDelta, revertFunc, jsEvent, ui, view) {
console.log('RESIZE!! ' + event.title); console.log('RESIZE!! ' + event.title);
console.log(dayDelta + ' days'); console.log(dayDelta + ' days');
console.log(minuteDelta + ' minutes');
console.log(event.end); console.log(event.end);
//console.log(minuteDelta + ' minutes'); //console.log(minuteDelta + ' minutes');
}, },

View file

@ -78,8 +78,10 @@
function updateEventStart() { function updateEventStart() {
var event = cal.fullCalendar('clientEvents', 777)[0]; var event = cal.fullCalendar('clientEvents', 777)[0];
event.start = new Date(y, m, 25, 10, 30); event.start = new Date(y, m, d, 13, 30);
event.end = new Date(y, m, 26); 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; //event.allDay = true;
cal.fullCalendar('updateEvent', event); cal.fullCalendar('updateEvent', event);
} }
@ -88,7 +90,7 @@
var event = cal.fullCalendar('clientEvents', 999)[0]; var event = cal.fullCalendar('clientEvents', 999)[0];
event.start = new Date(y, m, 4, 13, 30); event.start = new Date(y, m, 4, 13, 30);
event.end = new Date(y, m, 5, 2, 0); event.end = new Date(y, m, 5, 2, 0);
event.allDay = false; event.allDay = true;
event.title = "repeat yo"; event.title = "repeat yo";
//event.editable = false; //event.editable = false;
event.url = "http://google.com/"; event.url = "http://google.com/";

View file

@ -12,15 +12,14 @@
$(document).ready(function() { $(document).ready(function() {
$('#calendar').fullCalendar({ $('#calendar').fullCalendar({
/* //year: 2010,
year: 2010, //month: 0,
month: 0, //date: 1,
date: 0,
defaultView: 'basicDay', //defaultView: 'basicDay',
//aspectRatio: 1,
aspectRatio: 1,
*/
header: { header: {
left: 'title', left: 'title',

View file

@ -16,19 +16,28 @@
theme: true, theme: true,
editable: true, editable: true,
//isRTL: true,
header: { header: {
left: 'prev,next today', left: 'prevYear,prev,next,nextYear today',
center: 'title', center: 'title',
right: 'month,agendaWeek,basicWeek,agendaDay,basicDay' right: 'month,agendaWeek,basicWeek,agendaDay,basicDay'
}, },
/*
buttonIcons: { buttonIcons: {
prev: 'triangle-1-w', prev: 'triangle-1-w',
next: 'triangle-1-e', next: 'triangle-1-e',
today: 'home' today: 'home'
}, },
*/
/*
isRTL: true,
header: {
left: 'nextYear,next,prev,prevYear today',
center: 'title',
right: 'month,agendaWeek,basicWeek,agendaDay,basicDay'
},
*/
events: [ events: [
{ {

View file

@ -141,7 +141,8 @@
{ {
id: 888, id: 888,
title: 'Meeting', title: 'Meeting',
start: new Date(y, m, d, 10, 30) start: new Date(y, m, d, 10, 30),
allDay: false
}, },
{ {
id: 777, id: 777,