Monotone-Parent: ed1968caab1223af1ac0a41cf3fd4504a3dfa473

Monotone-Revision: 4d2697a35bcf482dfa9095d58087ffb8469eada5

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2008-07-18T19:25:26
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2008-07-18 19:25:26 +00:00
parent dcc47678c3
commit b75d761539
29 changed files with 512 additions and 272 deletions
+106 -123
View File
@@ -1,6 +1,6 @@
String.prototype.trim = function() {
return this.replace(/(^\s+|\s+$)/g, '');
}
};
String.prototype.formatted = function() {
var newString = this;
@@ -9,31 +9,31 @@ String.prototype.formatted = function() {
newString = newString.replace("%{" + i + "}", arguments[i], "g");
return newString;
}
};
String.prototype.repeat = function(count) {
var newString = "";
for (var i = 0; i < count; i++) {
newString += this;
}
var newString = "";
for (var i = 0; i < count; i++) {
newString += this;
}
return newString;
}
return newString;
};
String.prototype.capitalize = function() {
return this.replace(/\w+/g,
function(a) {
return ( a.charAt(0).toUpperCase()
+ a.substr(1).toLowerCase() );
});
}
function(a) {
return ( a.charAt(0).toUpperCase()
+ a.substr(1).toLowerCase() );
});
};
String.prototype.decodeEntities = function() {
return this.replace(/&#(\d+);/g,
function(wholematch, parenmatch1) {
return String.fromCharCode(+parenmatch1);
});
}
function(wholematch, parenmatch1) {
return String.fromCharCode(+parenmatch1);
});
};
String.prototype.asDate = function () {
var newDate;
@@ -43,18 +43,18 @@ String.prototype.asDate = function () {
else {
date = this.split("-");
if (date.length == 3)
newDate = new Date(date[0], date[1] - 1, date[2]);
newDate = new Date(date[0], date[1] - 1, date[2]);
else {
if (this.length == 8) {
newDate = new Date(this.substring(0, 4),
this.substring(4, 6) - 1,
this.substring(6, 8));
}
if (this.length == 8) {
newDate = new Date(this.substring(0, 4),
this.substring(4, 6) - 1,
this.substring(6, 8));
}
}
}
return newDate;
}
};
Date.prototype.sogoDayName = function() {
var dayName = "";
@@ -77,7 +77,7 @@ Date.prototype.sogoDayName = function() {
}
return dayName;
}
};
Date.prototype.daysUpTo = function(otherDate) {
var days = new Array();
@@ -89,14 +89,14 @@ Date.prototype.daysUpTo = function(otherDate) {
day1 = day2;
day2 = tmp;
}
// var day1Date = new Date();
// day1Date.setTime(this.getTime());
// day1Date.setHours(0, 0, 0, 0);
// var day2Date = new Date();
// day2Date.setTime(otherDate.getTime());
// day2Date.setHours(23, 59, 59, 999);
// var day1 = day1Date.getTime();
// var day2 = day2Date.getTime();
// var day1Date = new Date();
// day1Date.setTime(this.getTime());
// day1Date.setHours(0, 0, 0, 0);
// var day2Date = new Date();
// day2Date.setTime(otherDate.getTime());
// day2Date.setHours(23, 59, 59, 999);
// var day1 = day1Date.getTime();
// var day2 = day2Date.getTime();
var nbrDays = Math.floor((day2 - day1) / 86400000) + 1;
for (var i = 0; i < nbrDays; i++) {
@@ -106,42 +106,42 @@ Date.prototype.daysUpTo = function(otherDate) {
}
return days;
}
};
Date.prototype.getDayString = function() {
var newString = this.getYear();
if (newString < 1000) newString += 1900;
var month = '' + (this.getMonth() + 1);
if (month.length == 1)
month = '0' + month;
newString += month;
var day = '' + this.getDate();
if (day.length == 1)
day = '0' + day;
newString += day;
var newString = this.getYear();
if (newString < 1000) newString += 1900;
var month = '' + (this.getMonth() + 1);
if (month.length == 1)
month = '0' + month;
newString += month;
var day = '' + this.getDate();
if (day.length == 1)
day = '0' + day;
newString += day;
return newString;
}
return newString;
};
Date.prototype.getHourString = function() {
var newString = this.getHours() + '00';
if (newString.length == 3)
newString = '0' + newString;
var newString = this.getHours() + '00';
if (newString.length == 3)
newString = '0' + newString;
return newString;
}
return newString;
};
Date.prototype.getDisplayHoursString = function() {
var hoursString = "" + this.getUTCHours();
if (hoursString.length == 1)
hoursString = '0' + hoursString;
var hoursString = "" + this.getUTCHours();
if (hoursString.length == 1)
hoursString = '0' + hoursString;
var minutesString = "" + this.getUTCMinutes();
if (minutesString.length == 1)
minutesString = '0' + minutesString;
var minutesString = "" + this.getUTCMinutes();
if (minutesString.length == 1)
minutesString = '0' + minutesString;
return hoursString + ":" + minutesString;
}
return hoursString + ":" + minutesString;
};
Date.prototype.stringWithSeparator = function(separator) {
var month = '' + (this.getMonth() + 1);
@@ -160,81 +160,64 @@ Date.prototype.stringWithSeparator = function(separator) {
str = day + '/' + month + '/' + year;
return str;
}
};
Date.prototype.sogoFreeBusyStringWithSeparator = function(separator) {
return this.sogoDayName() + ", " + this.stringWithSeparator(separator);
}
};
Date.prototype.addDays = function(nbrDays) {
var milliSeconds = this.getTime();
milliSeconds += 86400000 * nbrDays;
this.setTime(milliSeconds);
}
var milliSeconds = this.getTime();
milliSeconds += 86400000 * nbrDays;
this.setTime(milliSeconds);
};
Date.prototype.earlierDate = function(otherDate) {
var workDate = new Date();
workDate.setTime(otherDate.getTime());
workDate.setHours(0);
return ((this.getTime() < workDate.getTime())
? this : otherDate);
}
var workDate = new Date();
workDate.setTime(otherDate.getTime());
workDate.setHours(0);
return ((this.getTime() < workDate.getTime())
? this : otherDate);
};
Date.prototype.laterDate = function(otherDate) {
var workDate = new Date();
workDate.setTime(otherDate.getTime());
workDate.setHours(23);
workDate.setMinutes(59);
workDate.setSeconds(59);
workDate.setMilliseconds(999);
return ((this.getTime() < workDate.getTime())
? otherDate : this);
}
var workDate = new Date();
workDate.setTime(otherDate.getTime());
workDate.setHours(23);
workDate.setMinutes(59);
workDate.setSeconds(59);
workDate.setMilliseconds(999);
return ((this.getTime() < workDate.getTime())
? otherDate : this);
};
Date.prototype.beginOfWeek = function() {
var beginNumber;
var dayNumber = this.getDay();
if (weekStartIsMonday) {
beginNumber = 1;
if (dayNumber == 0)
dayNumber = 7;
}
else
beginNumber = 0;
var offset = firstDayOfWeek - this.getDay();
if (offset > 0)
offset -= 7;
var beginOfWeek = new Date();
beginOfWeek.setTime(this.getTime());
beginOfWeek.addDays(beginNumber - dayNumber);
beginOfWeek.setHours(0);
beginOfWeek.setMinutes(0);
beginOfWeek.setSeconds(0);
beginOfWeek.setMilliseconds(0);
return beginOfWeek;
}
var beginOfWeek = new Date();
beginOfWeek.setTime(this.getTime());
beginOfWeek.addDays(offset);
beginOfWeek.setHours(0);
beginOfWeek.setMinutes(0);
beginOfWeek.setSeconds(0);
beginOfWeek.setMilliseconds(0);
return beginOfWeek;
};
Date.prototype.endOfWeek = function() {
var beginNumber;
var dayNumber = this.getDay();
if (weekStartIsMonday) {
beginNumber = 1;
if (dayNumber == 0)
dayNumber = 7;
}
else
beginNumber = 0;
var endOfWeek = this.beginOfWeek();
endOfWeek.addDays(6);
var endOfWeek = new Date();
endOfWeek.setTime(this.getTime());
endOfWeek.addDays(6 + beginNumber - dayNumber);
endOfWeek.setHours(23);
endOfWeek.setMinutes(59);
endOfWeek.setSeconds(59);
endOfWeek.setMilliseconds(999);
return endOfWeek;
}
endOfWeek.setHours(23);
endOfWeek.setMinutes(59);
endOfWeek.setSeconds(59);
endOfWeek.setMilliseconds(999);
return endOfWeek;
};
String.prototype._base64_keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
String.prototype.base64encode = function () {
@@ -357,7 +340,7 @@ String.prototype.cssSafeString = function() {
newString = newString.replace("@", "_", "g");
return newString;
}
};
window.width = function() {
if (window.innerWidth)
@@ -366,7 +349,7 @@ window.width = function() {
return document.body.offsetWidth;
else
return 0;
}
};
window.height = function() {
if (window.innerHeight)
@@ -375,4 +358,4 @@ window.height = function() {
return document.body.offsetHeight;
else
return 0;
}
};
+20 -12
View File
@@ -521,8 +521,12 @@ DIV.monthView > DIV.headerDay
DIV.dayOfToday
{ background-color: #deebf7; }
DIV.weekEndDay
{ background-color: #fffbe7; }
DIV.dayOfToday DIV.outOfDay
{ background-color: #d6dfe9; }
DIV.outOfDay, DIV.weekEndDay,
DIV.weekEndDay DIV.outOfDay
{ background-color: #f4f4f4; }
DIV.dayOfAnotherMonth
{ background-color: #e7efef; }
@@ -530,6 +534,10 @@ DIV.dayOfAnotherMonth
DIV.selectedDay
{ background-color: #ffe79c; }
DIV.selectedDay.weekEndDay,
DIV.selectedDay DIV.outOfDay
{ background-color: #f5dd92; }
DIV.monthView DIV.dayHeader
{ margin-left: 1em;
cursor: pointer;
@@ -651,35 +659,35 @@ DIV.monthView DIV.day,
DIV.daysViewFor7Days DIV.day
{ width: 14.2857%; }
DIV.monthView DIV.day0,
DIV.daysViewFor7Days DIV.day0
{ left: 0px; }
DIV.monthView DIV.day1,
DIV.daysViewFor7Days DIV.day1
{ left: 0px; }
{ left: 14.2857%; }
DIV.monthView DIV.day2,
DIV.daysViewFor7Days DIV.day2
{ left: 14.2857%; }
{ left: 28.5714%; }
DIV.monthView DIV.day3,
DIV.daysViewFor7Days DIV.day3
{ left: 28.5714%; }
{ left: 42.8571%; }
DIV.monthView DIV.day4,
DIV.daysViewFor7Days DIV.day4
{ left: 42.8571%; }
{ left: 57.1428%; }
DIV.monthView DIV.day5,
DIV.daysViewFor7Days DIV.day5
{ left: 57.1428%; }
DIV.monthView DIV.day6,
DIV.daysViewFor7Days DIV.day6
{ left: 71.4285%; }
DIV.monthView DIV.day0
DIV.monthView DIV.day6
{ left: 85.7142%;
border-right: 2px solid #397d94; }
DIV.daysViewFor7Days DIV.day0
DIV.daysViewFor7Days DIV.day6
{ left: 85.7142%;
border-right: 1px solid #397d94; }
+12 -15
View File
@@ -3,9 +3,6 @@ var address;
var awaitingFreeBusyRequests = new Array();
var additionalDays = 2;
var dayStartHour = 8;
var dayEndHour = 18;
var attendeesEditor = {
delay: 500,
delayedSearch: false,
@@ -221,20 +218,20 @@ function redisplayFreeBusyZone() {
var stMinute = parseInt($("startTime_time_minute").value) / 15;
var etHour = parseInt($("endTime_time_hour").value);
var etMinute = parseInt($("endTime_time_minute").value) / 15;
if (stHour < 8) {
stHour = 8;
if (stHour < dayStartHour) {
stHour = dayStartHour;
stMinute = 0;
}
if (stHour > 19) {
stHour = 19
if (stHour > dayEndHour + 1) {
stHour = dayEndHour + 1;
stMinute = 0;
}
if (etHour < 8) {
etHour = 8;
if (etHour < dayStartHour) {
etHour = dayStartHour;
etMinute = 0;
}
if (etHour > 19) {
etHour = 19;
if (etHour > dayEndHour + 1) {
etHour = dayEndHour;
etMinute = 0;
}
if (stHour > etHour) {
@@ -252,9 +249,9 @@ function redisplayFreeBusyZone() {
}
}
var deltaCells = (etHour - stHour) + (11 * addDays);
var deltaCells = (etHour - stHour) + ((dayEndHour - dayStartHour + 1) * addDays);
var deltaSpans = (deltaCells * 4 ) + (etMinute - stMinute);
var currentCellNbr = stHour - 7 - 1;
var currentCellNbr = stHour - dayStartHour;
var currentCell = row.cells[currentCellNbr];
var currentSpanNbr = stMinute;
var spans = $(currentCell).childNodesWithTag("span");
@@ -389,8 +386,8 @@ function setSlot(tds, nbr, status) {
days = Math.floor(tdnbr / 24);
tdnbr -= (days * 24);
}
if (tdnbr > 7 && tdnbr < 19) {
var i = (days * 11 + tdnbr - 7);
if (tdnbr > (dayStartHour - 1) && tdnbr < (dayEndHour + 1)) {
var i = (days * (dayEndHour - dayStartHour + 1) + tdnbr - (dayStartHour - 1));
var td = tds[i - 1];
var spans = $(td).childNodesWithTag("span");
if (status == '2')
-2
View File
@@ -33,8 +33,6 @@ var sorting = {};
var lastClickedRow = -1;
var weekStartIsMonday = true;
// logArea = null;
var allDocumentElements = null;