1jQuery(function ($) { 2 3 var reveal_text = function (ev) { 4 var trg_link = $(ev.currentTarget); 5 var testimonial = trg_link.parents('.easy_testimonial:first'); 6 var testimonial_body = trg_link.parents('.testimonial_body:first'); 7 var reveal_content = testimonial.find('.reveal_full_content:first'); 8 var reveal_content_html = testimonial.find('.reveal_full_content:first').html(); 9 10 // abort if already revealed, i.e., double-click 11 if ( testimonial_body.data('revealed') ) { 12 return; 13 } 14 15 // save excerpt 16 testimonial_body.data( 'save_excerpt', testimonial_body.html() ); 17 show_less_link = jQuery('<a href="#" class="show_less_link">' + easy_testimonials_reveal.show_less_text + '</a>'); 18 show_less_link.on('click', show_less); 19 20 // switch in full content and show it 21 testimonial_body.html(reveal_content_html); 22 testimonial_body.append( show_less_link ); 23 testimonial_body.data('revealed', true); 24 25 ev.preventDefault(); 26 return false; 27 }; 28 29 var show_less = function (ev) { 30 var trg_link = $(ev.currentTarget); 31 var testimonial = trg_link.parents('.easy_testimonial:first'); 32 var testimonial_body = trg_link.parents('.testimonial_body:first'); 33 var reveal_content_html = testimonial_body.data('save_excerpt'); 34 35 // switch excerpt back in and reset state 36 testimonial_body.html(reveal_content_html); 37 testimonial_body.data('revealed', false); 38 39 ev.preventDefault(); 40 return false; 41 }; 42 43 //jQuery('.easy_testimonial').on('click', '.testimonial_body .reveal_link a, .testimonial_body .more-link', reveal_text); 44});
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.