PageSourceSearch

https://cuhk.edu.cn/themes/custom/dyniva_ui/js/modules/laydate.js?tm4nm2

js cuhk.edu.cn collected 2026-10-01 10:23:46 UTC 1,581 bytes, 68 lines download raw bytes

1(function ($) {
2  /**
3   * readme https: //www.layui.com/laydate/
4   */
5  Drupal.behaviors.dyniva_laydate = {
6    _dates: {},
7    first: true,
8    attach: function (context) {
9      var that = this;
10
11      if(that.first) {
12        that.init(context);
13
14        that.first = false;
15      }
16    },
17    init: function (context) {  
18      var that = this;
19      var $date = $('[data-toggle="date"]', context);
20
21      $date.each(function (index) {
22        that.render(this, index);
23      })
24    },
25    render: function (ele, key) {
26      var $ele = $(ele);
27      var that = this;
28
29      $ele.addClass('dy-date-' + key);
30
31      var defaults = {
32        elem: '.dy-date-' + key,
33        ready: function (date) {
34          $ele.trigger('laydate.ready', { date: date });
35        },
36        change: function (value, date, endDate) {
37          $ele.trigger('laydate.change', { value: value, date: date, endDate: endDate })
38        },
39        done: function (value, date, endDate) {
40          $ele.trigger('laydate.done', { value: value, date: date, endDate: endDate })
41        }
42      };
43      
44      var options = null;
45
46      // 参数为JSON字符串
47      try {
48        options = JSON.parse($ele.attr('data-options'))
49      } catch (error) {
50        options = {}
51      }
52
53      var optionMark = that.getMarks($ele);
54
55      var marks = optionMark ? {
56        mark: optionMark
57      } : {};
58
59      var configs = $.extend(defaults, options, marks)
60
61      that._dates[key] = laydate.render(configs);
62    },
63    getMarks: function ($ele) {
64      return $ele.data('mark')
65    }
66  }
67
68}(jQuery));

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.