source: Dev/trunk/src/client/dojox/widget/_CalendarView.js @ 485

Last change on this file since 485 was 483, checked in by hendrikvanantwerpen, 11 years ago

Added Dojo 1.9.3 release.

File size: 2.1 KB
Line 
1define([
2        "dojo/_base/declare",
3        "dijit/_WidgetBase",
4        "dojo/dom-construct",
5        "dojo/query",
6        "dojo/date",
7        "dojo/_base/window"
8], function(declare, _WidgetBase, domConstruct, query, dojoDate, win){
9        return declare("dojox.widget._CalendarView", _WidgetBase, {
10                // summary:
11                //              Base implementation for all view mixins.
12                //              All calendar views should extend this widget.
13                headerClass: "",
14
15                useHeader: true,
16
17                cloneClass: function(clazz, n, before){
18                        // summary:
19                        //              Clones all nodes with the class 'clazz' in a widget
20                        var template = query(clazz, this.domNode)[0];
21                        var i;
22                        if(!before){
23                                for(i = 0; i < n; i++){
24                                        template.parentNode.appendChild(template.cloneNode(true));
25                                }
26                        }else{
27                                // XXX: this is the same as template!
28                                var bNode = query(clazz, this.domNode)[0];
29                                for(i = 0; i < n; i++){
30                                        template.parentNode.insertBefore(template.cloneNode(true), bNode);
31                                }
32                        }
33                },
34
35                _setText: function(node, text){
36                        // summary:
37                        //              Sets the text inside a node
38                        if(node.innerHTML != text){
39                                domConstruct.empty(node);
40                                node.appendChild(win.doc.createTextNode(text));
41                        }
42                },
43
44                getHeader: function(){
45                        // summary:
46                        //              Returns the header node of a view. If none exists,
47                        //              an empty DIV is created and returned.
48                        return this.header || (this.header = domConstruct.create("span", { "class":this.headerClass }));
49                },
50
51                onValueSelected: function(date){
52                        //Stub function called when a date is selected
53                },
54
55                adjustDate: function(date, amount){
56                        // summary:
57                        //              Adds or subtracts values from a date.
58                        //              The unit, e.g. "day", "month" or "year", is
59                        //              specified in the "datePart" property of the
60                        //              calendar view mixin.
61                        return dojoDate.add(date, this.datePart, amount);
62                },
63
64                onDisplay: function(){
65                        // summary:
66                        //              Stub function that can be used to tell a view when it is shown.
67                },
68
69                onBeforeDisplay: function(){
70                        // summary:
71                        //              Stub function that can be used to tell a view it is about to be shown.
72                },
73
74                onBeforeUnDisplay: function(){
75                        // summary:
76                        //              Stub function that can be used to tell
77                        //              a view when it is no longer shown.
78                }
79        });
80});
Note: See TracBrowser for help on using the repository browser.