| 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" |
| 2 | "http://www.w3.org/TR/html4/strict.dtd"> |
| 3 | <html> |
| 4 | |
| 5 | <head> |
| 6 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
| 7 | <title>Calendar Sample: Desktop</title> |
| 8 | <style type="text/css"> |
| 9 | @import "../themes/claro/Calendar.css"; |
| 10 | @import "../themes/claro/MonthColumnView.css"; |
| 11 | @import "calendar.css"; |
| 12 | @import "../../../dojo/resources/dojo.css"; |
| 13 | @import "../../../dijit/themes/dijit.css"; |
| 14 | @import "../../../dijit/themes/claro/claro.css"; |
| 15 | .greyCell{ |
| 16 | background-color: #F8F8F8 !important; |
| 17 | } |
| 18 | </style> |
| 19 | </head> |
| 20 | |
| 21 | <body class="claro"> |
| 22 | <script type="text/javascript" |
| 23 | data-dojo-config="async: true, parseOnLoad: true, paths : {'demo' : '../dojox/calendar/tests'}" |
| 24 | src="../../../dojo/dojo.js"></script> |
| 25 | |
| 26 | <script type="text/javascript"> |
| 27 | |
| 28 | require(["dojo/ready", "dojo/_base/lang", "dojo/_base/sniff", "dojo/_base/array", "dojo/_base/fx", "dojo/dom-class", "dojo/on", |
| 29 | "dojo/date/locale", "dojo/parser", "dojo/dom", "dojo/dom-construct", "dojo/store/Memory", |
| 30 | "dojo/store/Observable", "demo/ExtendedCalendar"], |
| 31 | |
| 32 | function(ready, lang, has, arr, fx, domClass, on, locale, parser, dom, domConstruct, |
| 33 | Memory, Observable, Calendar){ |
| 34 | |
| 35 | ready(function(){ |
| 36 | |
| 37 | var startOfWeek = calendar.floorToWeek(new calendar.dateClassObj()); |
| 38 | |
| 39 | calendar.set("date", startOfWeek); |
| 40 | |
| 41 | calendar.columnView.set("styleGridCellFunc", function(node, date, hours, minutes){ |
| 42 | // grey out Wednesday & time range between 12pm and 2pm |
| 43 | if(hours >= 12 && hours < 14 || date.getDay() == 3){ |
| 44 | domClass.add(node, "greyCell"); |
| 45 | } |
| 46 | this.defaultStyleGridCell(node, date, hours, minutes); |
| 47 | }); |
| 48 | |
| 49 | var func = function(node, date){ |
| 50 | // grey out Wednesday |
| 51 | if(date != null && date.getDay() == 3){ |
| 52 | domClass.add(node, "greyCell"); |
| 53 | } |
| 54 | this.defaultStyleGridCell(node, date); |
| 55 | }; |
| 56 | |
| 57 | calendar.columnView.secondarySheet.set("styleGridCellFunc", func); |
| 58 | calendar.matrixView.set("styleGridCellFunc", func); |
| 59 | calendar.monthColumnView.set("styleGridCellFunc", func); |
| 60 | |
| 61 | // Hide loading panel when application is ready |
| 62 | fx.fadeOut({ |
| 63 | node:"loadingPanel", |
| 64 | onEnd: function(node){ |
| 65 | node.parentNode.removeChild(node) |
| 66 | }}).play(500); |
| 67 | |
| 68 | |
| 69 | }); |
| 70 | }); |
| 71 | </script> |
| 72 | |
| 73 | <div id="loadingPanel" style="position:absolute;z-index:10;width:100%;height:100%;background:#ffffff"> |
| 74 | <span style="background: #DBEB8F;padding:2px">Loading...</span> |
| 75 | </div> |
| 76 | |
| 77 | <div data-dojo-id="calendar" data-dojo-type="demo.ExtendedCalendar" |
| 78 | style="position:absolute;left:10px;top:10px;bottom:10px;right:10px"> |
| 79 | </div> |
| 80 | |
| 81 | </div> |
| 82 | |
| 83 | </body> |
| 84 | </html> |