1var _____WB$wombat$assign$function_____=function(name){return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name))||self[name];};if(!self.__WB_pmw){self.__WB_pmw=function(obj){this.__WB_source=obj;return this;}}{ 2let window = _____WB$wombat$assign$function_____("window"); 3let self = _____WB$wombat$assign$function_____("self"); 4let document = _____WB$wombat$assign$function_____("document"); 5let location = _____WB$wombat$assign$function_____("location"); 6let top = _____WB$wombat$assign$function_____("top"); 7let parent = _____WB$wombat$assign$function_____("parent"); 8let frames = _____WB$wombat$assign$function_____("frames"); 9let opens = _____WB$wombat$assign$function_____("opens"); 10/** 11 * Setup Variables 12 */ 13 14var sliders; 15 16var fade_speed = 1000; 17var animate_speed = 1000; 18 19 20 21 22/** 23 * Initialize the Script 24 */ 25 26function mtphr_shortcodes_initialize_script() { 27 28 // Save variables 29 sliders = jQuery('.mtphr-post-slider'); 30 31 // If there are any sliders 32 if( sliders.length > 0 ) { 33 sliders.each( function(index) { 34 mtphr_shortcodes_setup_slider( jQuery(this) ); 35 }); 36 } 37} 38 39 40 41 42/** 43 * Setup the slider 44 * 45 * @since 1.0 46 */ 47function mtphr_shortcodes_setup_slider( $slider ) { 48 49 // Save variables 50 var rows = $slider.find( '.mtphr-post-slider-row' ), 51 num_rows = rows.length, 52 curr_row = 0, 53 $navigation = $slider.find( '.mtphr-post-slider-navigation' ); 54 $prev = $navigation.children( '.mtphr-post-slider-prev' ), 55 $next = $navigation.children( '.mtphr-post-slider-next' ); 56 57 // Show the first row 58 jQuery(rows[0]).fadeIn(); 59 60 if( num_rows == 1 ) { 61 // Remove nav buttons 62 $navigation.remove(); 63 } 64 65 // Add click listeners 66 $prev.click( function(e) { 67 68 e.preventDefault(); 69 70 var new_row = curr_row - 1; 71 if( new_row < 0 ) { 72 new_row = num_rows - 1; 73 } 74 75 // Remove the current row 76 jQuery(rows[curr_row]).hide(); 77 78 // Show the new row 79 jQuery(rows[new_row]).fadeIn(); 80 81 // Save the curr row 82 curr_row = new_row; 83 }); 84 $next.click( function(e) { 85 86 e.preventDefault(); 87 88 var new_row = curr_row + 1; 89 if( new_row >= num_rows ) { 90 new_row = 0; 91 } 92 93 // Remove the current row 94 jQuery(rows[curr_row]).hide(); 95 96 // Show the new row 97 jQuery(rows[new_row]).fadeIn(); 98 99 // Save the curr row 100 curr_row = new_row; 101 }); 102} 103 104 105 106 107 108 109/** 110 * Add Event Listeners 111 */ 112 113function mtphr_shortcodes_addEventListeners() { 114} 115 116 117 118 119/** 120 * Document ready listener 121 */ 122 123jQuery( document ).ready( function() { 124 125 // Initialize the packages 126 mtphr_shortcodes_initialize_script(); 127 128 // Add event listeners 129 mtphr_shortcodes_addEventListeners(); 130}); 131}
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.