1'use strict'; 2 3(function($) { 4 5 $.runQueue = function(queue) { 6 $.each(queue, function(method) { 7 var f = queue[method]; 8 if ($.isFunction(f)) { 9 f.call(queue); 10 } 11 }); 12 }; 13 14})(jQuery); 15 16(function($, self) { 17 18 var tpl = { 19 queue: {}, 20 init: function() { 21 22 $(function() { 23 $.runQueue(tpl.queue); 24 }); 25 } 26 }; 27 28 tpl.queue = { 29 rating: function() { 30 31 $('form .tpl-stars').each(function() { 32 var $this = $(this), 33 selected = null, 34 stars = $this.children('span'), 35 input = $this.children('input'); 36 37 function choose(elem) { 38 elem = $(elem); 39 stars.removeClass('tpl-active'); 40 elem.addClass('tpl-active').prevAll().addClass('tpl-active'); 41 } 42 43 $this.on({ 44 click: function(e) { 45 selected = e.target; 46 input.val($(selected).index() + 1); 47 }, 48 mousemove: function(e) { 49 choose(e.target); 50 }, 51 mouseleave: function(e) { 52 choose(selected); 53 } 54 }); 55 56 }); 57 58 } 59 }; 60 61 tpl.init(); 62 63 self.tpl = tpl; 64 65})(jQuery, window);
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.