1 <?xml version="1.0"?>
2 <!--
3 - ***** BEGIN LICENSE BLOCK *****
4 - Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 -
6 - The contents of this file are subject to the Mozilla Public License Version
7 - 1.1 (the "License"); you may not use this file except in compliance with
8 - the License. You may obtain a copy of the License at
9 - http://www.mozilla.org/MPL/
10 -
11 - Software distributed under the License is distributed on an "AS IS" basis,
12 - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 - for the specific language governing rights and limitations under the
14 - License.
15 -
16 - The Original Code is Calendar view code.
17 -
18 - The Initial Developer of the Original Code is
19 - Joey Minta <jminta@gmail.com>
20 - Portions created by the Initial Developer are Copyright (C) 2005
21 - the Initial Developer. All Rights Reserved.
22 -
23 - Contributor(s):
24 - Dan Mosedale <dan.mosedale@oracle.com>
25 -
26 - Alternatively, the contents of this file may be used under the terms of
27 - either the GNU General Public License Version 2 or later (the "GPL"), or
28 - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
29 - in which case the provisions of the GPL or the LGPL are applicable instead
30 - of those above. If you wish to allow use of your version of this file only
31 - under the terms of either the GPL or the LGPL, and not to allow others to
32 - use your version of this file under the terms of the MPL, indicate your
33 - decision by deleting the provisions above and replace them with the notice
34 - and other provisions required by the GPL or the LGPL. If you do not delete
35 - the provisions above, a recipient may use your version of this file under
36 - the terms of any one of the MPL, the GPL or the LGPL.
37 -
38 - ***** END LICENSE BLOCK *****
39 -->
40
41 <!-- Note that this file depends on helper functions in calUtils.js-->
42
43 <bindings id="calendar-specific-view-bindings"
44 xmlns="http://www.mozilla.org/xbl"
45 xmlns:html="http://www.w3.org/1999/xhtml"
46 xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
47 xmlns:xbl="http://www.mozilla.org/xbl">
48
49 <binding id="calendar-decorated-day-view"
50 extends="chrome://calendar/content/calendar-decorated-multiday-base-view.xml#calendar-decorated-multiday-base-view">
51 <content>
52 <xul:vbox anonid="main-box" flex="1">
53 <xul:calendar-navigation-buttons anonid="nav-control"/>
54 <xul:box flex="1">
55 <xul:calendar-multiday-view anonid="view-element" flex="1" orient="vertical" xbl:inherits="context,item-context"/>
56 </xul:box>
57 </xul:vbox>
58 </content>
59
60 <implementation implements="calIDecoratedView">
61 <property name="observerID">
62 <getter><![CDATA[
63 return "day-view-observer";
64 ]]></getter>
65 </property>
66
67 <!--Public methods-->
68 <method name="goToDay">
69 <parameter name="aDate"/>
70 <body><![CDATA[
71 var viewElement = this.viewElem;
72 viewElement.tasksInView = this.mTasksInView;
73 viewElement.showCompleted = this.mShowCompleted;
74
75 aDate = aDate.getInTimezone(viewElement.timezone);
76
77 this.setNavLabels(aDate)
78 viewElement.setDateRange(aDate, aDate);
79 viewElement.selectedDay = aDate;
80 ]]></body>
81 </method>
82 <method name="moveView">
83 <parameter name="aNumber"/>
84 <body><![CDATA[
85 var currentDay = this.startDay.clone();
86 currentDay.day += aNumber;
87 this.goToDay(currentDay);
88 ]]></body>
89 </method>
90 <method name="setNavLabels">
91 <parameter name="aDate"/>
92 <body><![CDATA[
93 var nameArray = new Array();
94 for (var i = -2; i < 3; i++) {
95 var index = ((aDate.weekday + i + 7) % 7) + 1;
96 nameArray.push(calGetString("dateFormat", "day."+index+".name"));
97 }
98 document.getAnonymousElementByAttribute(this, "anonid", "nav-control").setNames(nameArray, aDate);
99 ]]></body>
100 </method>
101 </implementation>
102 </binding>
103 </bindings>