1jQuery(function(){ 2 jQuery('.rr_review_text').each(function(event){ 3 var max_length = 150; 4 5 if ( typeof php_vars == 'object') { 6 if (typeof php_vars.excerpt_length == 'string') { 7 custom_length = parseInt(php_vars.excerpt_length); 8 max_length = custom_length; 9 } 10 } 11 12 if (jQuery(this).html().length > max_length){ 13 var short_content = jQuery(this).html().substr(0,max_length); 14 var long_content = jQuery(this).html().substr(max_length); 15 jQuery(this).html(short_content+'<span class="ellipses">... </span><a href="#" class="read_more"><br />'+translation.read_more+'</a>'+'<span class="more_text" style="display:none;">'+long_content+' <br /><a href="#" class="show_less" style="display:none;">'+translation.less+'</a></span>'); 16 jQuery(this).find('a.read_more').click(function(event){ 17 event.preventDefault(); 18 jQuery(this).hide(); 19 jQuery(this).parents('.rr_review_text').find('span.ellipses').hide(); 20 jQuery(this).parents('.rr_review_text').find('.more_text').show(); 21 jQuery(this).parents('.rr_review_text').find('a.show_less').show(); 22 console.log("culprit"); 23 }); 24 jQuery(this).find('a.show_less').click(function(event){ 25 event.preventDefault(); 26 jQuery(this).hide(); 27 jQuery(this).parents('.rr_review_text').find('.ellipses').show(); 28 jQuery(this).parents('.rr_review_text').find('.more_text').hide(); 29 jQuery(this).parents('.rr_review_text').find('a.read_more').show(); 30 }); 31 } 32 }); 33 34 jQuery('.rr_star').hover(function() { 35 renderStarRating(parseInt(jQuery(this).attr('id').charAt(8))); 36 }, function() { 37 renderStarRating(parseInt(jQuery('#rRating').val())); 38 }); 39 40 jQuery('.rr_star').click(function() { 41 jQuery('#rRating').val(jQuery(this).attr('id').charAt(8)); 42 }); 43 jQuery('select[id=markup_content_type]').change(function() { 44 45 jQuery("select[id=markup_content_type] option:selected").each(function() { 46 var value = jQuery(this).val(); 47 if (value == "Organization") { 48 jQuery('tr:nth-last-child(6)').hide(); 49 jQuery('tr:nth-last-child(5)').hide(); 50 jQuery('tr:nth-last-child(4)').hide(); 51 jQuery('tr:nth-last-child(3)').hide(); 52 jQuery('tr:nth-last-child(2)').hide(); 53 jQuery('tr:nth-last-child(1)').hide(); 54 jQuery('#submit').attr('disabled', false); 55 56 } else if (value == "Local business") { 57 jQuery('tr:nth-last-child(6)').show(); 58 jQuery('tr:nth-last-child(5)').show(); 59 jQuery('tr:nth-last-child(4)').show(); 60 jQuery('tr:nth-last-child(3)').show(); 61 jQuery('tr:nth-last-child(2)').show(); 62 jQuery('tr:nth-last-child(1)').hide(); 63 jQuery('#submit').attr('disabled', false); 64 65 } else if (value == "Product") { 66 jQuery('tr:nth-last-child(6)').hide(); 67 jQuery('tr:nth-last-child(5)').hide(); 68 jQuery('tr:nth-last-child(4)').hide(); 69 jQuery('tr:nth-last-child(3)').hide(); 70 jQuery('tr:nth-last-child(2)').hide(); 71 jQuery('tr:nth-last-child(1)').show(); 72 jQuery("tr:nth-last-child(1) p:last").addClass("markup_price_product"); 73 jQuery('#submit').attr('disabled', 'disabled'); 74 if(jQuery('#markup_price_product').is(":checked")){ 75 jQuery('#submit').attr('disabled', false); 76 } 77 else if(jQuery('#markup_price_product').is(":not(:checked)")){ 78 jQuery('#submit').attr('disabled', 'disabled'); 79 } 80 } 81 }); 82 }).change(); 83}); 84jQuery(document).ready(function(){ 85 jQuery('#markup_price_product').click(function(){ 86 if(jQuery(this).is(":checked")){ 87 jQuery('#submit').attr('disabled', false); 88 } 89 else if(jQuery(this).is(":not(:checked)")){ 90 jQuery('#submit').attr('disabled', 'disabled'); 91 } 92 }); 93 }); 94
95function renderStarRating(rating) { 96 for (var i=1; i<=5; i++) { 97 jQuery('#rr_star_'+i).removeClass('glyphicon-star'); 98 jQuery('#rr_star_'+i).removeClass('glyphicon-star-empty'); 99 if (i<=rating) { 100 jQuery('#rr_star_'+i).addClass('glyphicon-star'); 101 } else { 102 jQuery('#rr_star_'+i).addClass('glyphicon-star-empty'); 103 } 104 } 105}
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.