Web Interface For Lite Argus Control modules
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

99 lines
3.8 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  4. <title>The source code</title>
  5. <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
  6. <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
  7. </head>
  8. <body onload="prettyPrint();">
  9. <pre class="prettyprint lang-js">/*!
  10. * Ext JS Library 3.3.1
  11. * Copyright(c) 2006-2010 Sencha Inc.
  12. * licensing@sencha.com
  13. * http://www.sencha.com/license
  14. */
  15. <div id="cls-Ext.calendar.DayBodyTemplate"></div>/**
  16. * @class Ext.calendar.DayBodyTemplate
  17. * @extends Ext.XTemplate
  18. * <p>This is the template used to render the scrolling body container used in {@link Ext.calendar.DayView DayView} and
  19. * {@link Ext.calendar.WeekView WeekView}. This template is automatically bound to the underlying event store by the
  20. * calendar components and expects records of type {@link Ext.calendar.EventRecord}.</p>
  21. * <p>Note that this template would not normally be used directly. Instead you would use the {@link Ext.calendar.DayViewTemplate}
  22. * that internally creates an instance of this template along with a {@link Ext.calendar.DayHeaderTemplate}.</p>
  23. * @constructor
  24. * @param {Object} config The config object
  25. */
  26. Ext.calendar.DayBodyTemplate = function(config){
  27. Ext.apply(this, config);
  28. Ext.calendar.DayBodyTemplate.superclass.constructor.call(this,
  29. '<table class="ext-cal-bg-tbl" cellspacing="0" cellpadding="0">',
  30. '<tbody>',
  31. '<tr height="1">',
  32. '<td class="ext-cal-gutter"></td>',
  33. '<td colspan="{dayCount}">',
  34. '<div class="ext-cal-bg-rows">',
  35. '<div class="ext-cal-bg-rows-inner">',
  36. '<tpl for="times">',
  37. '<div class="ext-cal-bg-row">',
  38. '<div class="ext-cal-bg-row-div ext-row-{[xindex]}"></div>',
  39. '</div>',
  40. '</tpl>',
  41. '</div>',
  42. '</div>',
  43. '</td>',
  44. '</tr>',
  45. '<tr>',
  46. '<td class="ext-cal-day-times">',
  47. '<tpl for="times">',
  48. '<div class="ext-cal-bg-row">',
  49. '<div class="ext-cal-day-time-inner">{.}</div>',
  50. '</div>',
  51. '</tpl>',
  52. '</td>',
  53. '<tpl for="days">',
  54. '<td class="ext-cal-day-col">',
  55. '<div class="ext-cal-day-col-inner">',
  56. '<div id="{[this.id]}-day-col-{.:date("Ymd")}" class="ext-cal-day-col-gutter"></div>',
  57. '</div>',
  58. '</td>',
  59. '</tpl>',
  60. '</tr>',
  61. '</tbody>',
  62. '</table>'
  63. );
  64. };
  65. Ext.extend(Ext.calendar.DayBodyTemplate, Ext.XTemplate, {
  66. // private
  67. applyTemplate : function(o){
  68. this.today = new Date().clearTime();
  69. this.dayCount = this.dayCount || 1;
  70. var i = 0, days = [],
  71. dt = o.viewStart.clone(),
  72. times;
  73. for(; i<this.dayCount; i++){
  74. days[i] = dt.add(Date.DAY, i);
  75. }
  76. times = [];
  77. dt = new Date().clearTime();
  78. for(i=0; i<24; i++){
  79. times.push(dt.format('ga'));
  80. dt = dt.add(Date.HOUR, 1);
  81. }
  82. return Ext.calendar.DayBodyTemplate.superclass.applyTemplate.call(this, {
  83. days: days,
  84. dayCount: days.length,
  85. times: times
  86. });
  87. }
  88. });
  89. Ext.calendar.DayBodyTemplate.prototype.apply = Ext.calendar.DayBodyTemplate.prototype.applyTemplate;
  90. </pre>
  91. </body>
  92. </html>