1Flatsome.behavior('ux-countdown', { 2 attach: function (context) { 3 jQuery('[data-countdown]', context).each(function () { 4 var $this = jQuery(this), finalDate = jQuery(this).data('countdown'); 5 6 // Labels come from attributes and are rendered with .html(), so escape them as text. 7 var text = function (key) { 8 var value = $this.data(key); 9 return value == null ? '' : jQuery('<div>').text(String(value)).html(); 10 }; 11 12 var t_hour = text('text-hour'), 13 t_min = text('text-min'), 14 t_week = text('text-week'), 15 t_day = text('text-day'), 16 t_sec = text('text-sec'), 17 t_min_p = text('text-min-p'), 18 t_hour_p = text('text-hour-p'), 19 t_week_p = text('text-week-p'), 20 t_day_p = text('text-day-p'), 21 t_sec_p = text('text-sec-p'), 22 t_plural = text('text-plural'); 23 24 var hours_plural = t_hour+t_plural; 25 var days_plural = t_day+t_plural; 26 var weeks_plural = t_week+t_plural; 27 var min_plural = t_min; 28 var sec_plural = t_sec; 29 30 if(t_hour_p) hours_plural = t_hour_p; 31 if(t_min_p) min_plural = t_min_p; 32 if(t_week_p) weeks_plural = t_week_p; 33 if(t_day_p) days_plural = t_day_p; 34 if(t_sec_p) sec_plural = t_sec_p; 35 36 $this.countdown(finalDate).on('update.countdown', function (event) { 37 var format = '<span>%-H<strong>%!H:'+t_hour+','+hours_plural+';</strong></span><span>%-M<strong>%!M:'+t_min+','+min_plural+';</strong></span><span>%-S<strong>%!S:'+t_sec+','+sec_plural+';</strong></span>'; 38 39 if(event.offset.days > 0) { format = '<span>%-d<strong>%!d:'+t_day+','+days_plural+';</strong></span>' + format; } 40 if(event.offset.weeks > 0) { format = '<span>%-w<strong>%!w:'+t_week+','+weeks_plural+';</strong></span>' + format; } 41 42 jQuery(this).html(event.strftime(format)); 43 44 }).on('finish.countdown', function (event) { 45 var format = '<span>%-H<strong>%!H:'+t_hour+','+hours_plural+';</strong></span><span>%-M<strong>%!M:'+t_min+','+min_plural+';</strong></span><span>%-S<strong>%!S:'+t_sec+','+sec_plural+';</strong></span>'; 46 jQuery(this).html(event.strftime(format)); 47 }); 48 }); 49 } 50});
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.