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.