Web UI for ARGUS server
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.

115 lines
3.8 KiB

6 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  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.DayHeaderView"></div>/**
  16. * @class Ext.calendar.DayHeaderView
  17. * @extends Ext.calendar.MonthView
  18. * <p>This is the header area container within the day and week views where all-day events are displayed.
  19. * Normally you should not need to use this class directly -- instead you should use {@link Ext.calendar.DayView DayView}
  20. * which aggregates this class and the {@link Ext.calendar.DayBodyView DayBodyView} into the single unified view
  21. * presented by {@link Ext.calendar.CalendarPanel CalendarPanel}.</p>
  22. * @constructor
  23. * @param {Object} config The config object
  24. */
  25. Ext.calendar.DayHeaderView = Ext.extend(Ext.calendar.MonthView, {
  26. // private configs
  27. weekCount: 1,
  28. dayCount: 1,
  29. allDayOnly: true,
  30. monitorResize: false,
  31. <div id="event-Ext.calendar.DayHeaderView-dayclick"></div>/**
  32. * @event dayclick
  33. * Fires after the user clicks within the day view container and not on an event element
  34. * @param {Ext.calendar.DayBodyView} this
  35. * @param {Date} dt The date/time that was clicked on
  36. * @param {Boolean} allday True if the day clicked on represents an all-day box, else false. Clicks within the
  37. * DayHeaderView always return true for this param.
  38. * @param {Ext.Element} el The Element that was clicked on
  39. */
  40. // private
  41. afterRender: function() {
  42. if (!this.tpl) {
  43. this.tpl = new Ext.calendar.DayHeaderTemplate({
  44. id: this.id,
  45. showTodayText: this.showTodayText,
  46. todayText: this.todayText,
  47. showTime: this.showTime
  48. });
  49. }
  50. this.tpl.compile();
  51. this.addClass('ext-cal-day-header');
  52. Ext.calendar.DayHeaderView.superclass.afterRender.call(this);
  53. },
  54. // private
  55. forceSize: Ext.emptyFn,
  56. // private
  57. refresh: function() {
  58. Ext.calendar.DayHeaderView.superclass.refresh.call(this);
  59. this.recalcHeaderBox();
  60. },
  61. // private
  62. recalcHeaderBox: function() {
  63. var tbl = this.el.child('.ext-cal-evt-tbl'),
  64. h = tbl.getHeight();
  65. this.el.setHeight(h + 7);
  66. if (Ext.isIE && Ext.isStrict) {
  67. this.el.child('.ext-cal-hd-ad-inner').setHeight(h + 4);
  68. }
  69. if (Ext.isOpera) {
  70. //TODO: figure out why Opera refuses to refresh height when
  71. //the new height is lower than the previous one
  72. // var ct = this.el.child('.ext-cal-hd-ct');
  73. // ct.repaint();
  74. }
  75. },
  76. // private
  77. moveNext: function(noRefresh) {
  78. this.moveDays(this.dayCount, noRefresh);
  79. },
  80. // private
  81. movePrev: function(noRefresh) {
  82. this.moveDays( - this.dayCount, noRefresh);
  83. },
  84. // private
  85. onClick: function(e, t) {
  86. var el = e.getTarget('td', 3),
  87. parts,
  88. dt;
  89. if (el) {
  90. if (el.id && el.id.indexOf(this.dayElIdDelimiter) > -1) {
  91. parts = el.id.split(this.dayElIdDelimiter);
  92. dt = parts[parts.length - 1];
  93. this.fireEvent('dayclick', this, Date.parseDate(dt, 'Ymd'), true, Ext.get(this.getDayId(dt)));
  94. return;
  95. }
  96. }
  97. Ext.calendar.DayHeaderView.superclass.onClick.apply(this, arguments);
  98. }
  99. });
  100. Ext.reg('dayheaderview', Ext.calendar.DayHeaderView);
  101. </pre>
  102. </body>
  103. </html>