From 7ae2321322357c12cd3ce9641fc631c3fc7688d9 Mon Sep 17 00:00:00 2001 From: Alexandre Cloutier Date: Wed, 25 Jun 2014 17:39:48 -0400 Subject: [PATCH] multiColumns print view + bugFixes --- .../English.lproj/Localizable.strings | 1 + UI/WebServerResources/SchedulerUI.js | 13 ++++++ UI/WebServerResources/UIxCalViewPrint.css | 1 + UI/WebServerResources/UIxCalViewPrint.js | 45 +++++++++++++++++++ 4 files changed, 60 insertions(+) diff --git a/UI/Scheduler/English.lproj/Localizable.strings b/UI/Scheduler/English.lproj/Localizable.strings index 5fa9dc173..bc26a5fb3 100644 --- a/UI/Scheduler/English.lproj/Localizable.strings +++ b/UI/Scheduler/English.lproj/Localizable.strings @@ -317,6 +317,7 @@ "Repeat" = "Repeat"; "Daily" = "Daily"; +"Multi-Columns" = "Multi-Columns"; "Weekly" = "Weekly"; "Monthly" = "Monthly"; "Yearly" = "Yearly"; diff --git a/UI/WebServerResources/SchedulerUI.js b/UI/WebServerResources/SchedulerUI.js index 9657a2cd8..050e9f00c 100644 --- a/UI/WebServerResources/SchedulerUI.js +++ b/UI/WebServerResources/SchedulerUI.js @@ -3821,6 +3821,19 @@ function drawNowLine() { } setTimeout("drawNowLine ();", 60000); // 1 min. } + else { + var target = targets[0].getElementsByClassName("clickableHourCell")[hours]; + if (target) { + var div = targets[0].getElementsByClassName("nowLineDisplay")[0]; + if (!div) + div = new Element("div", {'class': 'nowLineDisplay'}); + + div.style.top = parseInt((minutes * target.offsetHeight / 60) - 1) + "px"; + target.insertBefore(div, target.firstChild); + } + } + setTimeout("drawNowLine ();", 60000); // 1 min. + } } function onListCollapse(event, element) { diff --git a/UI/WebServerResources/UIxCalViewPrint.css b/UI/WebServerResources/UIxCalViewPrint.css index 6adafa0c5..c4062af94 100644 --- a/UI/WebServerResources/UIxCalViewPrint.css +++ b/UI/WebServerResources/UIxCalViewPrint.css @@ -621,6 +621,7 @@ LABEL { position:static; top:5px; left:5px; + } DIV#rightFrame { diff --git a/UI/WebServerResources/UIxCalViewPrint.js b/UI/WebServerResources/UIxCalViewPrint.js index 0fe3a6385..f50e21dc5 100644 --- a/UI/WebServerResources/UIxCalViewPrint.js +++ b/UI/WebServerResources/UIxCalViewPrint.js @@ -137,6 +137,19 @@ function addCalendarsColor () { } } +function addCalendarsColor () { + var activeCalendarsId = []; + var allCalendars = window.parent$("calendarList"); + var allColors = window.parentvar("UserSettings")['Calendar']['FolderColors']; + for (var i = 0; i < allCalendars.children.length; i++) { + if (allCalendars.children[i].down("input").checked){ + folderName = allCalendars.children[i].getAttribute("id").substr(1); + color = allColors["sogo1:Calendar/" + folderName]; + appendStyleElement(folderName, color); + } + } +} + function refreshEvents() { var todayDate = new Date(); @@ -532,6 +545,15 @@ function appendStyleElement(folderPath, color) { } } +function appendStyleElement(folderPath, color) { + if (document.styleSheets) { + var fgColor = getContrastingTextColor(color); + var styleElement = document.styleSheets[3]; + + styleElement.addRule(".calendarFolder" + folderPath, "background-color: " + color + " !important;" + " color: " + fgColor + " !important;", 1); + } +} + function _parseEvent(event) { // Localized strings : var start = _("Start:"); @@ -697,6 +719,29 @@ function _computeOffset(hoursCells) { return offset; } +function _computeOffset(hoursCells) { + var outOfDayCells = hoursCells.getElementsByClassName("outOfDay"); + var count = 1; + var offset = []; + var buffer; + var j = 1; + for (var i = 0; i < outOfDayCells.length; i++) { + hourCell1 = parseInt(outOfDayCells[i].getAttribute("hour")) + 100; + hourCell2 = parseInt(outOfDayCells[j].getAttribute("hour")); + if (hourCell1 == hourCell2) { + count += 1; + } + else { + break; + } + j ++; + } + offset.push(count * 4); + offset.push((hourCell2 / 100 * 4) - (count * 4)); + + return offset; +} + /************************************** Preview Navigation *****************************************/ function onCalendarGotoDay(node) {