~ubuntu-branches/ubuntu/precise/maas/precise-security

« back to all changes in this revision

Viewing changes to src/maasserver/static/jslibs/yui/3.4.1/tests/calendar/tests/calendar-base-manual/calendar.js

Tags: 1.2+bzr1373+dfsg-0ubuntu1~12.04.4
* SECURITY UPDATE: failure to authenticate downloaded content (LP: #1039513)
  - debian/patches/CVE-2013-1058.patch: Authenticate downloaded files with
    GnuPG and MD5SUM files. Thanks to Julian Edwards.
  - CVE-2013-1058
* SECURITY UPDATE: configuration options may be loaded from current working
  directory (LP: #1158425)
  - debian/patches/CVE-2013-1057-1-2.patch: Do not load configuration
    options from the current working directory. Thanks to Julian Edwards.
  - CVE-2013-1057

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
YUI({
2
 
    base: '../../../../build/',
3
 
    filter: 'RAW',
4
 
    debug: true
5
 
}).use('calendar-base',  function(Y) {
6
 
   
7
 
 
8
 
Y.CalendarBase.CONTENT_TEMPLATE = '<div class="yui3-g {calendar_pane_class}" id="{calendar_id}">' +     
9
 
                                                '{header_template}' +
10
 
                                              '<div class="yui3-u-1-3">' +
11
 
                                                '{calendar_grid_template}' +
12
 
                                              '</div>' +
13
 
                                              '<div class="yui3-u-1-3">' +
14
 
                                                '{calendar_grid_template}' +
15
 
                                              '</div>' +                        
16
 
                                              '<div class="yui3-u-1-3">' +
17
 
                                                '{calendar_grid_template}' +
18
 
                                              '</div>' +                
19
 
                                              '<div class="yui3-u-1-3">' +
20
 
                                                '{calendar_grid_template}' +
21
 
                                              '</div>' +
22
 
                                              '<div class="yui3-u-1-3">' +
23
 
                                                '{calendar_grid_template}' +
24
 
                                              '</div>' +                        
25
 
                                              '<div class="yui3-u-1-3">' +
26
 
                                                '{calendar_grid_template}' +
27
 
                                              '</div>' +
28
 
                                              '<div class="yui3-u-1-3">' +
29
 
                                                '{calendar_grid_template}' +
30
 
                                              '</div>' +
31
 
                                              '<div class="yui3-u-1-3">' +
32
 
                                                '{calendar_grid_template}' +
33
 
                                              '</div>' +                        
34
 
                                              '<div class="yui3-u-1-3">' +
35
 
                                                '{calendar_grid_template}' +
36
 
                                              '</div>' +                
37
 
                                              '<div class="yui3-u-1-3">' +
38
 
                                                '{calendar_grid_template}' +
39
 
                                              '</div>' +
40
 
                                              '<div class="yui3-u-1-3">' +
41
 
                                                '{calendar_grid_template}' +
42
 
                                              '</div>' +                        
43
 
                                              '<div class="yui3-u-1-3">' +
44
 
                                                '{calendar_grid_template}' +
45
 
                                              '</div>' +                                                                                           
46
 
                                   '</div>';
47
 
 
48
 
 
49
 
         var calendar = new Y.CalendarBase({
50
 
                contentBox: "#mycalendar",
51
 
                        height:'200px',
52
 
                        width:'600px',
53
 
                        showPrevMonth: true,
54
 
                        showNextMonth: true,
55
 
                        date: new Date(2029, 11)}).render();
56
 
 
57
 
 
58
 
             var curDate = calendar.get("date");
59
 
 
60
 
             calendar.set("headerRenderer", function (curDate) {
61
 
                var ydate = Y.DataType.Date,
62
 
                    output = ydate.format(curDate, {format: "%B, %Y"}) +
63
 
                             " &mdash; " +
64
 
                             ydate.format(ydate.addMonths(curDate, calendar._paneNumber-1), {format: "%B, %Y"});
65
 
                console.log("Output: " + output);
66
 
                return output;
67
 
             });
68
 
                        
69
 
                Y.one("#updateCalendar").on('click', function () {
70
 
              curDate = new Date(1950 + Math.round(Math.random()*100), 
71
 
                                                Math.round(Math.random()*12.49), 1);
72
 
                  calendar.set('date', curDate);        
73
 
                  Y.one("#currentDate").setContent(calendar.get("date").toString());    
74
 
                });
75
 
 
76
 
                Y.one("#togglePrevMonth").on('click', function () {
77
 
                  calendar.set('showPrevMonth', !(calendar.get("showPrevMonth")));                      
78
 
                });
79
 
                Y.one("#toggleNextMonth").on('click', function () {
80
 
                  calendar.set('showNextMonth', !(calendar.get("showNextMonth")));                      
81
 
                });
82
 
 
83
 
                Y.one("#toggleSelection").on('click', function () {
84
 
                  calendar.select(new Date (curDate.getFullYear(), curDate.getMonth(), 23));
85
 
                });
86
 
 
87
 
});
88