1/** 2 * @file pint_date_selector.js 3 */ 4(function($) { 5 6 Drupal.behaviors.pintDateSelectorTheme = { 7 attach: function (context, settings) { 8 9 /** 10 * Global vars 11 */ 12 // get the user's current time (in seconds) 13 var now = $.now() / 1000; 14 // prepare some variables 15 var onNow = onNext = isLive = false; 16 17 /** 18 * Schedule 19 */ 20 if ($('[data-js=schedule]').length) { 21 var path = location.pathname.split('/'), 22 lastEl = path[path.length-1]; 23 24 // If the last URL argument is numeric, it's not today 25 if (!$.isNumeric(lastEl)) { 26 var loop = true; 27 $('[data-js=schedule]').find('.dule').each(function() { 28 // check the timestamp 29 var t = $(this).attr('data-js-schedule-timestamp'); 30 31 // Stop looping if future items 32 if (loop === false) { 33 return false; 34 } 35 36 if (t < now) isLive = $(this); 37 38 // If we've set isLive and we start hitting future items 39 // stop looping so we don't set a future item as live 40 if (t > now) loop = false; 41 }); 42 43 if (isLive) isLive.addClass('is-active').find('[data-js=schedule-live]').removeAttr('style'); 44 } 45 } 46 47 } 48 }; 49 50})(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.