Code refactoring and retouch

This commit is contained in:
Alexandre Cloutier committed 2014-04-28 13:54:29 -04:00
1 parent 9dc07fccc0
commit 78447d81ae
3 files changed
+65 -15

No files matched your search

+33 -7
View File
@@ -36,11 +36,11 @@ TABLE#eventsList .colorBox
/******************************/
/****** Print settings *******/
#title
{
INPUT#inputFieldTitle {
width:120px;
}
/******************************/
/****** What to print ********/
@@ -60,6 +60,10 @@ TABLE#eventsList .colorBox
vertical-align:8px;
}
TR.todo {
display:none;
}
/************************/
/****** Buttons ********/
@@ -143,9 +147,19 @@ DIV#calendarHeader DIV.dayLabels {
display:flex;
}
DIV#calendarHeader DIV.days {
position:relative;
display:block;
top:0;
height:33px;
width:93%;
}
DIV#daysView {
position:relative;
top:0;
display:inline-table;
width:100%;
}
DIV#daysView DIV.days {
@@ -190,26 +204,34 @@ SPAN.caption
background: linear-gradient(to bottom, #E6E7E6, #dddddd); /* Standard syntax (must be last) */
}
LABEL {
margin-left:0;
}
/**************************************************/
/****** Calling print(); from the browser ********/
@media print
{
.no-print, SPAN.caption
.no-print, SPAN.caption, SPAN.weeksHeader SPAN.week1, SPAN.daysHeader SPAN.day1
{
display:none;
}
SPAN.weeksHeader, SPAN.daysHeader {
border:none;
}
DIV#rightSide
{
position:relative;
position:static;
top:5px;
left:5px;
width:100%;
height:auto;
width:99%;
}
DIV#rightFrame, DIV#rightFrameEvents, DIV#rightFrameTasks
{
width:100%;
width:99%;
height:auto;
}
DIV#rightFrame
@@ -217,4 +239,8 @@ SPAN.caption
border:none;
overflow:visible;
}
DIV#calendarHeader {
width:99.5%;
}
}
+26 -2
View File
@@ -108,6 +108,7 @@ function previewDisplayCallback(http) {
$("listCollapse").remove();
// TODO : Month
_drawAllDayEvents(eventsBlocks[1], eventsBlocks[0]);
_drawEvents(eventsBlocks[2], eventsBlocks[0]);
}
else
@@ -244,6 +245,8 @@ function _drawTasksList(tasksBlocks) {
$("rightFrameTasks").innerHTML = tasksList;
}
// TODO : Maybe use the drawfunction from the scheduler.js
function _drawEvents(events, eventsData) {
var daysView = $("daysView");
var subdivs = daysView.childNodesWithTag("div");
@@ -263,6 +266,22 @@ function _drawEvents(events, eventsData) {
}
}
}
function _drawAllDayEvents(events, eventsData) {
var headerView = $("calendarHeader");
var subdivs = headerView.childNodesWithTag("div");
var days = subdivs[1].childNodesWithTag("div");
for (var i = 0; i < days.length; i++) {
var parentDiv = days[i];
for (var j = 0; j < events[i].length; j++) {
var eventRep = events[i][j];
var nbr = eventRep.nbr;
var eventCell = newAllDayEventDIV(eventRep, eventsData[nbr]);
parentDiv.appendChild(eventCell);
}
}
}
// todo : month
function newEventDIV(eventRep, event) {
@@ -497,8 +516,8 @@ function onPrintLayoutListChange() {
break;
case "1": // Day view
window.resizeTo(660,500);
ajustWindow(660,500);
window.resizeTo(1010,500);
ajustWindow(1010,500);
currentView = "dayview";
break;
@@ -608,6 +627,10 @@ function init() {
$("cancelButton").observe("click", onPrintCancelClick);
$("printButton").observe("click", onPrintClick);
// TODO : Selected and custom date must be implemented and finished.
document.getElementById("eventsTasks").disabled=true;
document.getElementById("customDate").disabled=true;
onPrintLayoutListChange();
}
@@ -621,6 +644,7 @@ function initializeWhatToPrint() {
'end': {'date': $("endingDate")}};
initTimeWidgets(widgets);
onPrintDateCheck();
}
/*function initializeOptions() {