root / trunk / web / dojo / dojox / widget / CalendarViews.js @ 12
History | View | Annotate | Download (3.78 KB)
1 | 9 | andrej.cim | /*
|
---|---|---|---|
2 | Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved.
|
||
3 | Available via Academic Free License >= 2.1 OR the modified BSD license.
|
||
4 | see: http://dojotoolkit.org/license for details
|
||
5 | */
|
||
6 | |||
7 | |||
8 | if(!dojo._hasResource["dojox.widget.CalendarViews"]){ |
||
9 | dojo._hasResource["dojox.widget.CalendarViews"]=true; |
||
10 | dojo.provide("dojox.widget.CalendarViews");
|
||
11 | dojo.experimental("dojox.widget.CalendarViews");
|
||
12 | dojo.require("dojox.widget.Calendar");
|
||
13 | dojo.declare("dojox.widget._CalendarMonth",null,{constructor:function(){ |
||
14 | this._addView(dojox.widget._CalendarMonthView);
|
||
15 | }}); |
||
16 | dojo.declare("dojox.widget._CalendarMonthView",[dojox.widget._CalendarView,dijit._Templated],{templateString:dojo.cache("dojox.widget","Calendar/CalendarMonth.html","<div class=\"dojoxCalendarMonthLabels\" style=\"left: 0px;\" \n\tdojoAttachPoint=\"monthContainer\" dojoAttachEvent=\"onclick: onClick\">\n <table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" style=\"margin: auto;\">\n <tbody>\n <tr class=\"dojoxCalendarMonthGroupTemplate\">\n <td class=\"dojoxCalendarMonthTemplate\">\n <div class=\"dojoxCalendarMonthLabel\"></div>\n </td>\n </tr>\n </tbody>\n </table>\n</div>\n"),datePart:"year",headerClass:"dojoxCalendarMonthHeader",postCreate:function(){ |
||
17 | this.cloneClass(".dojoxCalendarMonthTemplate",3); |
||
18 | this.cloneClass(".dojoxCalendarMonthGroupTemplate",2); |
||
19 | this._populateMonths();
|
||
20 | this.addFx(".dojoxCalendarMonthLabel",this.domNode); |
||
21 | },_setValueAttr:function(_1){ |
||
22 | this.header.innerHTML=_1.getFullYear();
|
||
23 | },_getMonthNames:dojox.widget._CalendarMonthYearView.prototype._getMonthNames,_populateMonths:dojox.widget._CalendarMonthYearView.prototype._populateMonths,onClick:function(_2){ |
||
24 | if(!dojo.hasClass(_2.target,"dojoxCalendarMonthLabel")){ |
||
25 | dojo.stopEvent(_2); |
||
26 | return;
|
||
27 | } |
||
28 | var _3=_2.target.parentNode.cellIndex+(_2.target.parentNode.parentNode.rowIndex*4); |
||
29 | var _4=this.get("value"); |
||
30 | _4.setMonth(_3); |
||
31 | this.onValueSelected(_4,_3);
|
||
32 | }}); |
||
33 | dojo.declare("dojox.widget._CalendarYear",null,{parent:null,constructor:function(){ |
||
34 | this._addView(dojox.widget._CalendarYearView);
|
||
35 | }}); |
||
36 | dojo.declare("dojox.widget._CalendarYearView",[dojox.widget._CalendarView,dijit._Templated],{templateString:dojo.cache("dojox.widget","Calendar/CalendarYear.html","<div class=\"dojoxCalendarYearLabels\" style=\"left: 0px;\" dojoAttachPoint=\"yearContainer\">\n <table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" style=\"margin: auto;\" dojoAttachEvent=\"onclick: onClick\">\n <tbody>\n <tr class=\"dojoxCalendarYearGroupTemplate\">\n <td class=\"dojoxCalendarNextMonth dojoxCalendarYearTemplate\">\n <div class=\"dojoxCalendarYearLabel\">\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n</div>\n"),displayedYears:6,postCreate:function(){ |
||
37 | this.cloneClass(".dojoxCalendarYearTemplate",3); |
||
38 | this.cloneClass(".dojoxCalendarYearGroupTemplate",2); |
||
39 | this._populateYears();
|
||
40 | this.addFx(".dojoxCalendarYearLabel",this.domNode); |
||
41 | },_setValueAttr:function(_5){ |
||
42 | this._populateYears(_5.getFullYear());
|
||
43 | },_populateYears:dojox.widget._CalendarMonthYearView.prototype._populateYears,adjustDate:function(_6,_7){ |
||
44 | return dojo.date.add(_6,"year",_7*12); |
||
45 | },onClick:function(_8){ |
||
46 | if(!dojo.hasClass(_8.target,"dojoxCalendarYearLabel")){ |
||
47 | dojo.stopEvent(_8); |
||
48 | return;
|
||
49 | } |
||
50 | var _9=Number(_8.target.innerHTML);
|
||
51 | var _a=this.get("value"); |
||
52 | _a.setYear(_9); |
||
53 | this.onValueSelected(_a,_9);
|
||
54 | }}); |
||
55 | dojo.declare("dojox.widget.Calendar3Pane",[dojox.widget._CalendarBase,dojox.widget._CalendarDay,dojox.widget._CalendarMonth,dojox.widget._CalendarYear],{});
|
||
56 | dojo.declare("dojox.widget.MonthlyCalendar",[dojox.widget._CalendarBase,dojox.widget._CalendarMonth],{});
|
||
57 | dojo.declare("dojox.widget.YearlyCalendar",[dojox.widget._CalendarBase,dojox.widget._CalendarYear],{});
|
||
58 | } |