~ubuntu-branches/ubuntu/quantal/maas/quantal-updates

« 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

  • Committer: Package Import Robot
  • Author(s): Andres Rodriguez
  • Date: 2012-07-03 17:42:37 UTC
  • mfrom: (1.1.13)
  • Revision ID: package-import@ubuntu.com-20120703174237-p8l0keuuznfg721k
Tags: 0.1+bzr709+dfsg-0ubuntu1
* New Upstream release
* debian/control:
  - Depends on python-celery, python-tempita, libjs-yui3-{full,min},
    libjs-raphael
* debian/maas.install:
  - Install apiclient, celeryconfig.py, maas-import-pxe-files, preseeds_v2.
  - Update to install various files from chroot, rather tha manually copy
    them from the source.
* debian/maas.links: symlink celeryconfig.py
* debian/maas.maas-celery.upstart: Add job.
* debian/rules:
  - Install celery upstart job.
  - Do not install jslibs as packages are now used.
  - Drop copying of maas_local_settings_sample.py as source now ships
    a maas_local_settings.py
* debian/patches:
  - 04-maas-http-fix.patch: Drop. Merged upstream.
  - 01-fix-database-settings.patch: Refreshed.
  - 99_enums_js.patch: Added until creation of enum.js / build process
    is fixed.
* debian/maas.postinst: Update bzr version to correctly handle upgrades.

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