1(function (window){ 2 'use strict'; 3 4 if (window.JMagnetVotes) 5 return; 6 7 window.JMagnetVotes = function (arParams) 8 { 9 var _ = this; 10 this.container = false; 11 this.params = arParams; 12 13 if (!!this.params.CONTAINER_ID) 14 this.container = $('#' + this.params.CONTAINER_ID); 15 16 this.container.find('.star-active').on('click', function (event) { 17 event.preventDefault(); 18 var voteValue = parseInt($(this).data('value')) 19 20 if (voteValue <= 0) 21 return false; 22 23 BX.ajax.post( 24 _.params.AJAX_URL, 25 { 26 vote: 'Y', 27 vote_id: _.params.ITEM_ID, 28 rating: voteValue, 29 AJAX_CALL: 'Y', 30 PAGE_PARAMS: { 31 ELEMENT_ID: _.params.ITEM_ID 32 }, 33 SESSION_PARAMS: _.params.SESSION_PARAMS, 34 sessid: _.params.SESSION_ID 35 }, 36 function (result) { 37 if (!!result && result.length > 0) 38 { 39 var ajaxContent = $(result); 40 _.container.html(ajaxContent.html()); 41 } 42 } 43 ); 44 45 return false; 46 }); 47 48 this.container.find('.star-active').on('mouseover', function () { 49 var current = parseInt($(this).data('value')); 50 $(this).closest('tr').find('.star-active').each(function (index, value) { 51 if (current >= index) 52 $(this).addClass('star-over'); 53 }); 54 55 56 }); 57 58 this.container.find('.star-active').on('mouseout', function () { 59 $(this).closest('tr').find('.star-active').removeClass('star-over'); 60 }); 61 62 } 63 64})(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.