1// genesis_switcher plugin v2.2 2(function($) 3{ 4 $.fn.genesis_shortcodes_switcher = function(options) 5 { 6 var defaults = 7 { 8 slides: '>div', 9 activeClass: 'active', 10 linksNav: '', 11 findParent: true, //use parent elements to define active states 12 lengthElement: 'li', //parent element, used only if findParent is set to true 13 useArrows: false, 14 arrowLeft: 'a#prev-arrow', 15 arrowRight: 'a#next-arrow', 16 auto: false, 17 autoSpeed: 5000, 18 slidePadding: '', 19 pauseOnHover: true, 20 fx: 'fade', 21 sliderType: '' 22 } 23 24 var options = $.extend(defaults, options); 25 26 return this.each(function() 27 { 28 var slidesContainer = jQuery(this).parent().css('position','relative'), 29 $slides = jQuery(this).css({'overflow':'hidden','position':'relative'}), 30 $slides_wrapper_box = slidesContainer.find('.genesis-tabs-content-wrapper'), 31 $slides_wrapper = $slides_wrapper_box.parent(), 32 $slide = $slides.find( '.genesis-tabs-content-wrapper' + options.slides), 33 slidesNum = $slide.length, 34 zIndex = slidesNum, 35 currentPosition = 1, 36 slideHeight = 0, 37 $activeSlide, 38 $nextSlide, 39 slides_wrapper_width = $slides_wrapper.width(), 40 $genesis_shortcodes_mobile_nav, 41 $genesis_shortcodes_mobile_controls; 42 43 if (options.fx === 'slide') { 44 $slide.css({ 'width' : slides_wrapper_width, 'visibility' : 'visible' }); 45 46 $slides_wrapper_box.append( $slide.filter(':first').clone().removeClass().addClass('genesis_slidecontent_cloned') ); 47 $slides_wrapper_box.prepend( $slide.filter(':last').clone().removeClass().addClass('genesis_slidecontent_cloned') ); 48 49 $slides_wrapper_box.css( 'left', -slides_wrapper_width ); 50 } 51 52 $slide.filter(':first').css({'display':'block'}).addClass('genesis_shortcode_slide_active'); 53 54 if (options.slidePadding != '') $slide.css('padding',options.slidePadding); 55 56 if (options.linksNav != '') { 57 var linkSwitcher = jQuery(options.linksNav); 58 59 var linkSwitcherTab = ''; 60 if (options.findParent) linkSwitcherTab = linkSwitcher.parent(); 61 else linkSwitcherTab = linkSwitcher; 62 63 if (!linkSwitcherTab.filter('.active').length) linkSwitcherTab.filter(':first').addClass('active'); 64 65 linkSwitcher.click(function(){ 66 67 var targetElement, orderNum; 68 69 if (options.findParent) targetElement = jQuery(this).parent(); 70 else targetElement = jQuery(this); 71 72 orderNum = targetElement.prevAll(options.lengthElement).length+1; 73 74 if (orderNum > currentPosition) gotoSlide(orderNum, 1); 75 else gotoSlide(orderNum, -1); 76 77 return false; 78 }); 79 } 80 81 82 if (options.useArrows) { 83 var $right_arrow = jQuery(options.arrowRight), 84 $left_arrow = jQuery(options.arrowLeft); 85 86 $right_arrow.click( function(){ 87 genesis_shortcodes_go_to_next_slide(); 88 return false; 89 } ); 90 91 $left_arrow.click( function(){ 92 genesis_shortcodes_go_to_previous_slide(); 93 return false; 94 } ); 95 96 } 97 98 function changeTab(){ 99 if (linkSwitcherTab != '') { 100 linkSwitcherTab.siblings().removeClass('active'); 101 linkSwitcherTab.filter(':eq('+(currentPosition-1)+')').addClass('active'); 102 } 103 } 104
105 function gotoSlide(slideNumber,dir){ 106 if ($slide.filter(':animated').length) return; 107 108 $activeSlide = $slide.parent().find('.genesis_slidecontent').filter(':eq('+(currentPosition-1)+')'); 109 110 if (currentPosition === slideNumber) return; 111 112 $activeSlide.removeClass('genesis_shortcode_slide_active'); 113 114 $nextSlide = $slide.parent().find('.genesis_slidecontent').filter(':eq('+(slideNumber-1)+')').addClass('genesis_shortcode_slide_active'); 115 116 if ((currentPosition > slideNumber || currentPosition === 1) && (dir === -1)) { 117 if (options.fx === 'slide') slideBack(500); 118 if (options.fx === 'fade') slideFade(500); 119 } else { 120 if (options.fx === 'slide') slideForward(500); 121 if (options.fx === 'fade') slideFade(500); 122 } 123 124 currentPosition = $nextSlide.prevAll('.genesis_slidecontent').length + 1; 125 126 if (options.linksNav != '') changeTab(); 127 128 if ( options.sliderType === 'images' || options.sliderType === 'simple' ){ 129 $genesis_shortcodes_mobile_controls.find('li').removeClass('genesis_shortcodes_active_control'); 130 $genesis_shortcodes_mobile_controls.find('li').eq(currentPosition-1).addClass('genesis_shortcodes_active_control'); 131 } 132 133 return false; 134 } 135 136 137 if (options.auto) { 138 auto_rotate(); 139 var pauseSlider = false;
140 } 141 142 if (options.pauseOnHover) { 143 slidesContainer.hover(function(){ 144 pauseSlider = true; 145 },function(){ 146 pauseSlider = false; 147 }); 148 } 149 150 function auto_rotate(){ 151 interval_shortcodes = setInterval(function(){ 152 if (!pauseSlider) { 153 if (currentPosition === slidesNum) 154 gotoSlide(1,1); 155 else 156 gotoSlide(currentPosition+1,1); 157 158 if (options.linksNav != '') changeTab(); 159 } 160 },options.autoSpeed); 161 } 162 163 function slideFade(speed){ 164 $activeSlide.css( { 'display' : 'none', 'opacity' : '0' } ); 165 166 $nextSlide.css({'opacity' : '0', 'display':'block'}).animate( { opacity : 1 }, 700 ); 167 } 168 169 function slideForward(speed){ 170 var next_slide_order = $nextSlide.prevAll('.genesis_slidecontent').length+1, 171 go_to_first_slide = false; 172 173 if ( $activeSlide.next('.genesis_slidecontent_cloned').length ) { 174 next_slide_order = $activeSlide.prevAll().length+1; 175 go_to_first_slide = true; 176 } 177 178 $slides_wrapper_box.animate( { left : - ( $slides_wrapper.width() * next_slide_order ) }, 500, function(){ 179 if ( go_to_first_slide ) $slides_wrapper_box.css( 'left', - ( $slides_wrapper.width() ) ); 180 } ); 181 } 182 183 function slideBack(speed){ 184 var next_slide_order = $nextSlide.prevAll('.genesis_slidecontent').length+1, 185 go_to_last_slide = false; 186 187 if ( $activeSlide.prev('.genesis_slidecontent_cloned').length ) { 188 next_slide_order = 0; 189 go_to_last_slide = true; 190 } 191 192 $slides_wrapper_box.animate( { left : - ( $slides_wrapper.width() * next_slide_order ) }, 500, function(){ 193 if ( go_to_last_slide ) $slides_wrapper_box.css( 'left', - ( $slides_wrapper.width() * slidesNum ) ); 194 } ); 195 } 196 197 if (options.fx === 'slide') { 198 $(window).resize( function(){ 199 $slides_wrapper_box.find('>div').css({ 'width' : $slides_wrapper.width() }); 200 $slides_wrapper_box.css( 'left', -( $slides_wrapper.width() * currentPosition ) ); 201 } ); 202 } 203 204 genesis_generate_mobile_nav(); 205 206 function genesis_generate_mobile_nav(){ 207 var genesis_shortcodes_slides_num = slidesContainer.find( '.genesis_slidecontent' ).length, 208 genesis_shortcodes_controllers_html = ''; 209 210 if ( genesis_shortcodes_slides_num > 1 && ( options.sliderType === 'images' || options.sliderType === 'simple' ) ){ 211 slidesContainer.append( '<div class="genesis_shortcodes_controller_nav">' + '<ul class="genesis_shortcodes_controls"></ul>' + '<ul class="genesis_shortcodes_controls_arrows"><li><a href="#" class="genesis_sc_nav_next">' + genesis_shortcodes_strings.next + '<span></span></a></li><li><a href="#" class="genesis_sc_nav_prev">' + genesis_shortcodes_strings.previous + '<span></span></a></li></ul>' + '</div>' ); 212 213 $genesis_shortcodes_mobile_controls = slidesContainer.find('.genesis_shortcodes_controls'); 214 for ( var i = 0; i < genesis_shortcodes_slides_num; i++ ) { 215 genesis_shortcodes_controllers_html += '<li><a href="#"></a></li>'; 216 } 217 $genesis_shortcodes_mobile_controls.prepend( genesis_shortcodes_controllers_html ); 218 $genesis_shortcodes_mobile_controls.find( 'li:first' ).addClass('genesis_shortcodes_active_control'); 219 $genesis_shortcodes_mobile_controls.find( 'a' ).click( function(){ 220 var $this_control = $(this), 221 $this_control_li = $this_control.parent('li'), 222 this_order = $this_control_li.prevAll().length+1; 223 224 if ( this_order == currentPosition ) return false; 225 226 if ( this_order > currentPosition ) gotoSlide(this_order, 1); 227 else gotoSlide(this_order, -1); 228 229 return false; 230 } ); 231 232 $genesis_shortcodes_mobile_nav = slidesContainer.find('.genesis_shortcodes_controls_arrows'); 233 $genesis_shortcodes_mobile_nav.find('a').click( function(){ 234 var $this_link = jQuery(this), 235 genesis_active_slide_order; 236 237 if ( $this_link.hasClass( 'genesis_sc_nav_next' ) ) 238 genesis_shortcodes_go_to_next_slide(); 239 240 if ( $this_link.hasClass( 'genesis_sc_nav_prev' ) ) 241 genesis_shortcodes_go_to_previous_slide(); 242 243 $genesis_shortcodes_mobile_controls.find('li').removeClass('genesis_shortcodes_active_control'); 244 245 genesis_active_slide_order = currentPosition - 1; 246 247 $genesis_shortcodes_mobile_controls.find('li').eq( genesis_active_slide_order ).addClass('genesis_shortcodes_active_control'); 248 249 return false;
250 } ); 251 } else if ( options.sliderType !== 'images' && options.sliderType !== 'simple' ) { 252 slidesContainer.prepend( '<ul class="genesis_shortcodes_mobile_nav"><li><a href="#" class="genesis_sc_nav_next">' + genesis_shortcodes_strings.next + '<span></span></a></li><li><a href="#" class="genesis_sc_nav_prev">' + genesis_shortcodes_strings.previous + '<span></span></a></li></ul>' ); 253 $genesis_shortcodes_mobile_nav = slidesContainer.find('.genesis_shortcodes_mobile_nav'); 254 $genesis_shortcodes_mobile_nav.find('a').click( function(){ 255 var $this_link = jQuery(this); 256 257 if ( $this_link.hasClass( 'genesis_sc_nav_next' ) ) 258 genesis_shortcodes_go_to_next_slide(); 259 260 if ( $this_link.hasClass( 'genesis_sc_nav_prev' ) ) 261 genesis_shortcodes_go_to_previous_slide(); 262 263 return false; 264 } ); 265 } 266 } 267 268 function genesis_shortcodes_go_to_next_slide(){ 269 if (currentPosition === slidesNum) 270 gotoSlide(1,1); 271 else 272 gotoSlide(currentPosition+1),1; 273 274 if (options.linksNav != '') changeTab(); 275 } 276 277 function genesis_shortcodes_go_to_previous_slide(){ 278 if (currentPosition === 1) 279 gotoSlide(slidesNum,-1); 280 else 281 gotoSlide(currentPosition-1,-1); 282 283 if (options.linksNav != '') changeTab(); 284 } 285 }); 286 } 287})(jQuery); 288// end genesis_switcher plugin v2 289 290/////// Shortcodes Javascript /////// 291jQuery(document).ready(function($){ 292 var $genesis_learn_more, $genesis_pricing_table_button, $genesis_shortcodes_tabs, $genesis_tooltip; 293 294 $genesis_tooltip = $('.genesis-tooltip'); 295 if ( $genesis_tooltip.length > 0 ) { 296 $genesis_tooltip.on('mouseover mouseout', function(event){ 297 if (event.type == 'mouseover') { 298 $(this).find('.genesis-tooltip-box').animate({ opacity: 'show', bottom: '25px' }, 300); 299 } else { 300 $(this).find('.genesis-tooltip-box').animate({ opacity: 'hide', bottom: '35px' }, 300); 301 } 302 }); 303 } 304 // learn more 305 $genesis_learn_more = $('.genesis-learn-more .heading-more'); 306 if ( $genesis_learn_more.length > 0 ) { 307 $genesis_learn_more.on('click', function() { 308 if ( $(this).hasClass('open') ) 309 $(this).removeClass('open'); 310 else 311 $(this).addClass('open'); 312 313 $(this).parent('.genesis-learn-more').find('.learn-more-content').animate({ opacity: 'toggle', height: 'toggle' }, 300); 314 }); 315 } 316 317 $('.genesis-learn-more').not('.genesis-open').find('.learn-more-content').css( { 'visibility' : 'visible', 'display' : 'none' } ); 318 319 $genesis_pricing_table_button = $('.pricing-table a.icon-button'); 320 321 if ( $genesis_pricing_table_button.length > 0 ) { 322 $genesis_pricing_table_button.each( function(){ 323 var $this_button = $(this), 324 this_button_width = $this_button.width(), 325 this_button_innerwidth = $this_button.innerWidth(); 326 327 $this_button.css( { width : this_button_width, 'marginLeft' : '-' + ( this_button_innerwidth / 2 ) + 'px', 'visibility' : 'visible' } ); 328 } ); 329 } 330 331 var $genesis_shortcodes_tabs = $('.genesis-tabs-container, .tabs-left, .genesis-simple-slider, .genesis-image-slider'); 332 333 if ( $genesis_shortcodes_tabs.length > 0 ) { 334 $genesis_shortcodes_tabs.each(function(i){ 335 var genesis_shortcodes_tab_class = $(this).attr('class'), 336 genesis_shortcodes_tab_autospeed_class_value = /genesis_sliderauto_speed_(\d+)/g, 337 genesis_shortcodes_tab_autospeed = genesis_shortcodes_tab_autospeed_class_value.exec( genesis_shortcodes_tab_class ), 338 genesis_shortcodes_tab_auto_class_value = /genesis_sliderauto_(\w+)/g, 339 genesis_shortcodes_tab_auto = genesis_shortcodes_tab_auto_class_value.exec( genesis_shortcodes_tab_class ), 340 genesis_shortcodes_tab_type_class_value = /genesis_slidertype_(\w+)/g, 341 genesis_shortcodes_tab_type = genesis_shortcodes_tab_type_class_value.exec( genesis_shortcodes_tab_class ), 342 genesis_shortcodes_tab_fx_class_value = /genesis_sliderfx_(\w+)/g, 343 genesis_shortcodes_tab_fx = genesis_shortcodes_tab_fx_class_value.exec( genesis_shortcodes_tab_class ), 344 genesis_shortcodes_tab_apply_to_element = '.genesis-tabs-content', 345 genesis_shortcodes_tab_settings = {}; 346 347 genesis_shortcodes_tab_settings.linksNav = $(this).find('.genesis-tabs-control li a'); 348 genesis_shortcodes_tab_settings.findParent = true; 349 genesis_shortcodes_tab_settings.fx = genesis_shortcodes_tab_fx[1];
350 genesis_shortcodes_tab_settings.auto = 'false' === genesis_shortcodes_tab_auto[1] ? false : true; 351 genesis_shortcodes_tab_settings.autoSpeed = genesis_shortcodes_tab_autospeed[1]; 352 353 if ( 'simple' === genesis_shortcodes_tab_type[1] ){ 354 genesis_shortcodes_tab_settings = {}; 355 genesis_shortcodes_tab_settings.fx = genesis_shortcodes_tab_fx[1]; 356 genesis_shortcodes_tab_settings.auto = 'false' === genesis_shortcodes_tab_auto[1] ? false : true; 357 genesis_shortcodes_tab_settings.autoSpeed = genesis_shortcodes_tab_autospeed[1]; 358 genesis_shortcodes_tab_settings.sliderType = 'simple'; 359 genesis_shortcodes_tab_apply_to_element = '.genesis-simple-slides'; 360 } else if ( 'images' === genesis_shortcodes_tab_type[1] ){ 361 genesis_shortcodes_tab_settings.sliderType = 'images'; 362 genesis_shortcodes_tab_settings.linksNav = '#' + $(this).attr('id') + ' .controllers a.switch'; 363 genesis_shortcodes_tab_settings.findParent = false; 364 genesis_shortcodes_tab_settings.lengthElement = '#' + $(this).attr('id') + ' a.switch'; 365 genesis_shortcodes_tab_apply_to_element = '.genesis-image-slides'; 366 } 367 368 $(this).find(genesis_shortcodes_tab_apply_to_element).genesis_shortcodes_switcher( genesis_shortcodes_tab_settings ); 369 }); 370 } 371});
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.