1/** 2 * eTabs.js v3.6.7 3 */ 4 ;( function( window ) { 5 6 'use strict'; 7 8 function extend( a, b ) { 9 for( var key in b ) { 10 if( b.hasOwnProperty( key ) ) { 11 a[key] = b[key]; 12 } 13 } 14 return a; 15 } 16 function IW_Tabs( el, options ) { 17 this.el = el; 18 this.options = extend( {}, this.options ); 19 extend( this.options, options ); 20 this._init(); 21 } 22 IW_Tabs.prototype.options = { 23 start : 0 24 }; 25 IW_Tabs.prototype._init = function() { 26 // tabs elems 27 this.tabs = [].slice.call( this.el.querySelectorAll( 'nav > ul > li:not(.tab-heading)' ) ); 28 // content items 29 this.items = [].slice.call( this.el.querySelectorAll( '.et-content-wrap > section' ) ); 30 // current index 31 this.current = -1; 32 // show current content item 33 this._show(); 34 // init events 35 this._initEvents(); 36 }; 37 IW_Tabs.prototype._initEvents = function() { 38 var self = this; 39 this.tabs.forEach( function( tab, idx ) { 40 tab.addEventListener( 'click', function( ev ) { 41 var showHideAttr = jQuery( tab ).parents( '.et-tabs' ).data( 'show-hide' ), 42 show = self._showHideTab( jQuery( tab ).attr( 'class' ), showHideAttr ); 43 44 ev.preventDefault(); 45 46 jQuery(document).trigger("resize"); 47 48 if ( show ) { 49 self._show( idx ); 50 } 51 52 // Check if is sticky tab and scroll up to the tab content start position. 53 if ( jQuery( tab ).parents( '.et-tabs' ).hasClass( 'et-tabs-sticky' ) ) { 54 var headerHeight = jQuery( tab ).parents( '.et-tabs' ).attr( 'data-header-height' ); 55 headerHeight = parseInt( headerHeight ); 56 57 jQuery( 'html, body' ).animate( { scrollTop:( jQuery( tab ).parents( '.et-tabs' ).offset().top ) - ( headerHeight + 40 ) }, 300 ); 58 } 59 } ); 60 } ); 61 }; 62 IW_Tabs.prototype._show = function( idx ) { 63 if( this.current >= 0 ) { 64 this.tabs[ this.current ].className = this.items[ this.current ].className = ''; 65 }
66 this.tabs.forEach( function( tab, idx ) { 67 tab.className = ""; 68 }); 69 // change current 70 this.current = idx != undefined ? idx : this.options.start >= 0 && this.options.start < this.items.length ? this.options.start : 0; 71 var hash = jQuery( jQuery( this.tabs[ this.current ] ).find( 'a' )[0] ).data('href'); 72 hash = ( 'undefined' !== typeof hash ) ? hash.substr( hash.indexOf("#") ) : ''; 73 setTimeout( function(){ 74 jQuery(document).trigger("elegantTabSwitched",[hash]); 75 }, 100 ); 76 var anim = jQuery(this.items[ this.current ]).data('animation'); 77 this.items.forEach( function( tab, idx ) { 78 tab.className = ''; 79 } ); 80 81 // Make first tab inactive. 82 if ( -1 == this.options.start ) { 83 var loaded = jQuery( jQuery( this.tabs[ this.current ] ).parents( '.elegant-tabs-container' )[0] ).data( 'loaded' ); 84 85 if ( 'undefined' !== typeof loaded || loaded ) { 86 this.tabs[ this.current ].className = 'tab-current'; 87 this.items[ this.current ].className = 'content-current'; 88 jQuery( this.items[ this.current ] ).find( '.infi-content-wrapper' )[0].className = 'infi-content-wrapper animated '+anim; 89 } 90 jQuery( jQuery( this.tabs[ this.current ] ).parents( '.elegant-tabs-container' )[0] ).attr('data-loaded', true ); 91 } else { 92 this.tabs[ this.current ].className = 'tab-current'; 93 this.items[ this.current ].className = 'content-current'; 94 jQuery( this.items[ this.current ] ).find( '.infi-content-wrapper' )[0].className = 'infi-content-wrapper animated '+anim; 95 } 96 97 }, 98 99 IW_Tabs.prototype._showHideTab = function( cls, showHideAttr ) { 100 if ( showHideAttr ) { 101 102 this.items.forEach( function( tab, idx ) { 103 tab.className = ''; 104 } ); 105
106 this.tabs.forEach( function( tabContent, idx ) { 107 tabContent.className = ''; 108 } ); 109 110 if ( 'tab-current' === cls ) { 111 return false; 112 } else { 113 return true; 114 } 115 } else { 116 return true; 117 } 118 }; 119 120 // add to global namespace 121 window.IW_Tabs = IW_Tabs; 122 })( window ); 123 124 function checkHash( hashLink ) { 125 if ( hashLink !== '' ) { 126 hash = hashLink.substr(hashLink.indexOf("#") ); 127 if ( jQuery( hash ).length ) { 128 var animation = jQuery( hash ).data( 'animation' ), 129 tab_link = jQuery('a[data-href="'+hash+'"]').parents("ul").find('li'), 130 tabs = jQuery(hash).parents(".et-tabs").find("section"); 131 132 tab_link.removeClass('tab-current'); 133 tab_link.each(function(index, element) { 134 jQuery(this).removeClass('tab-current'); 135 }); 136 137 tabs.each(function(index, element) { 138 jQuery(this).removeClass('content-current'); 139 }); 140 141 jQuery('a[data-href="'+hash+'"]').parent('li').addClass('tab-current'); 142 jQuery( hash + ' > .infi-content-wrapper' )[0].className = 'infi-content-wrapper animated ' + animation; 143 jQuery(hash).addClass('content-current'); 144 setTimeout( function(){ 145 jQuery(document).trigger("elegantTabSwitched",[hash]); 146 }, 100 ); 147 } 148 } 149 } 150 151function checkHashPosition( hash ) { 152 var hashPosition = 0; 153 hashPosition = jQuery( 'a[data-href="' + hash + '"]' ).parent( 'li' ).index(); 154 return hashPosition; 155} 156 157function elegantAutoSwitchTabs( el, interval, startTab ) { 158 var timeInterval, tabCount = 0, currnetIndex = 1; 159 160 tabCount = jQuery( el ).find( 'li' ).length; 161 162 currnetIndex = startTab + 1; 163 164 changeTabIndex(); 165 timeInterval = setInterval( function () { changeTabIndex(); }, interval * 1000); 166 167 168 function changeTabIndex() { 169 if ( currnetIndex > tabCount ) { 170 currnetIndex = 1; 171 } 172 173 var currentAncorObj = jQuery( el ).find( 'li' ).eq( currnetIndex - 1 ); 174 175 jQuery( currentAncorObj ).trigger( 'click' ); 176 177 currnetIndex++; 178 }; 179 180 jQuery( el ).find( 'li' ).mouseenter( function () { 181 clearInterval( timeInterval ); 182 }).mouseleave( function () { 183 timeInterval = setInterval( function () { changeTabIndex(); }, interval * 1000); 184 }); 185} 186 187// Check if the device is touch capable. 188function isDeviceTouchEnabled( event ) { 189 // Checking with the screen type - necessary for IOS detection. 190 var isTouchCapable = 'ontouchstart' in window || window.DocumentTouch && document instanceof window.DocumentTouch || navigator.maxTouchPoints > 0 || window.navigator.msMaxTouchPoints > 0; 191 192 // Checking with pointer type detection. 193 switch( event.pointerType ) { 194 case "mouse": 195 // mouse input detected 196 isTouchCapable = false; 197 break; 198 199 case "pen": 200 // pen/stylus input detected 201 isTouchCapable = false; 202 break; 203 204 case "touch": 205 // touch input detected 206 isTouchCapable = true; 207 break; 208 209 default: 210 // default to the screen type. 211 break; 212 } 213 214 return isTouchCapable; 215} 216 217function etGenerateCSS() { 218 var css = '<style type="text/css" id="tabs-dynamic-css">', 219 st = '', 220 bg = '', 221 color = '', 222 bg_hover = '', 223 color_hover = ''; 224 225 [].slice.call( document.querySelectorAll( '.et-tabs' ) ).forEach( function( el ) { 226 227 var url = window.location; 228 hash = url.href, 229 hashPosition = 0, 230 listContainer = '', 231 autoSwitch = false, 232 autoSwitchInterval = 5; 233 234 if ( -1 !== hash.indexOf('#') ) { 235 hash = hash.replace( "/#", '#' ); 236 hash = hash.substr( hash.indexOf( "#" ) ); 237 238 if ( jQuery( el ).find( 'a[data-href="' + hash + '"]' ).length ) { 239 hashPosition = checkHashPosition( hash ); 240 setTimeout( function() { 241 jQuery( 'html, body' ).animate( { scrollTop:( ( jQuery( hash ) ).offset().top ) - 150 }, 300 ); 242 }, 500 ); 243 } else { 244 hashPosition = ( 'undefined' !== typeof jQuery( el ).data( 'active-tab' ) ) ? jQuery( el ).data( 'active-tab' ) : 0; 245 } 246 } else { 247 hashPosition = ( 'undefined' !== typeof jQuery( el ).data( 'active-tab' ) ) ? jQuery( el ).data( 'active-tab' ) : 0; 248 } 249 250 new IW_Tabs( el, { start: hashPosition } ); 251 252 listContainer = jQuery( el ).find( '.elegant-tabs-list-container' ); 253 autoSwitch = jQuery( el ).data( 'auto-switch-tab' ); 254 autoSwitchInterval = jQuery( el ).data( 'switch-interval' ); 255 256 if ( 'no' !== autoSwitch ) { 257 elegantAutoSwitchTabs( listContainer[0], autoSwitchInterval, hashPosition ); 258 } 259 260 var cn = el.className.split(" "), 261 cl = ''; 262 263 jQuery(cn).each(function(i,v){ 264 cl += ( '' !== v ) ? "."+v : ''; 265 }); 266 267 st = jQuery(cl).data("tab_style"); 268 bg = jQuery(cl).data("active-bg"); 269 color = jQuery(cl).data("active-text"); 270 bg_hover = jQuery(cl).data("hover-bg"); 271 color_hover = jQuery(cl).data("hover-text"); 272 273 css += cl+' .infi-tab-accordion.infi-active-tab .infi_accordion_
273item{background:'+bg+' !important; color:'+color+' !important;fill:'+color+' !important;}\n'; 274 css += cl+' .infi-tab-accordion.infi-active-tab .infi_accordion_item .infi-accordion-item-heading{color:'+color+' !important;}\n'; 275 css += cl+' .infi-tab-accordion.infi-active-tab .infi_accordion_item .infi-accordion-item-heading .iw-icons{color:'+color+' !important;}\n'; 276 switch(st){ 277 case 'bars': 278 css += cl+' li.tab-current a{background:'+bg+'; color:'+color+';}\n'; 279 css += cl+' nav ul li.tab-current a, '+cl+' nav ul li.tab-current a > i{color:'+color+' !important;}\n'; 280 css += cl+' li:not(.tab-current):not(.tab-heading) a:hover{background:'+bg_hover+'; color:'+color_hover+';}\n'; 281 css += cl+' nav ul li:not(.tab-current):not(.tab-heading) a:hover, '+cl+' nav ul li:not(.tab-current):not(.tab-heading):hover a > i{color:'+color_hover+' !important;}\n'; 282 break; 283 case 'iconbox': 284 case 'iconbox-iconlist': 285 css += cl+' li.tab-current a{background:'+bg+'; color:'+color+' !important;}\n'; 286 css += cl+' nav ul li.tab-current a > i{color:'+color+' !important;}\n'; 287 css += cl+' nav ul li.tab-current::after{color:'+bg+';}\n'; 288 css += cl+' nav ul li.tab-current{color:'+bg+' !important;}\n'; 289 css += cl+' li:not(.tab-current):not(.tab-heading) a:hover{background:'+bg_hover+'; color:'+color_hover+';}\n'; 290 css += cl+' nav ul li:not(.tab-current):not(.tab-heading) a:hover, '+cl+' nav ul li:not(.tab-current):not(.tab-heading):hover a > i{color:'+color_hover+' !important;}\n'; 291 break; 292 case 'underline': 293 css += cl+' nav ul li a::after{background:'+bg+';}\n'; 294 css += cl+' nav ul li.tab-current a, '+cl+' nav ul li.tab-current a > i{color:'+color+' !important;}\n'; 295 css += cl+' nav ul li:not(.tab-current):not(.tab-heading) a:hover:after{background:'+bg_hover+'; transform: translate3d(0,0,0);}\n'; 296 css += cl+' nav ul li:not(.tab-current):not(.tab-heading) a:hover, '+cl+' nav ul li:not(.tab-current):not(.tab-heading):hover a > i{color:'+color_hover+' !important;}\n'; 297 break; 298 case 'topline': 299 if ( '' == color ) { 300 color = bg; 301 } 302 css += cl+' nav ul li.tab-current a{box-shadow:inset 0px 3px 0px '+bg+';}\n'; 303 css += cl+' nav ul li.tab-current {border-top-color: '+color+';}\n'; 304 css += cl+' nav ul li.tab-current a, '+cl+' nav ul li.tab-current a > i{color:'+color+' !important;}\n'; 305 css += cl+' nav ul li:not(.tab-current):not(.tab-heading):hover a{box-shadow:inset 0px 3px 0px '+bg_hover+';}\n'; 306 css += cl+' nav ul li:not(.tab-current):not(.tab-heading):hover {border-top-color: '+color_hover+';}\n'; 307 css += cl+' nav ul li:not(.tab-current):not(.tab-heading):hover a, '+cl+' nav ul li:not(.tab-current):not(.tab-heading):hover a > i{color:'+color_hover+' !important;}\n'; 308 break; 309 case 'iconfall': 310 case 'circle': 311 case 'square': 312 css += cl+' nav ul li::before{background:'+bg+'; border-color:'+bg+';}\n'; 313 css += cl+' nav ul li.tab-current::after { border-color:'+bg+';}\n'; 314 css += cl+' nav ul li.tab-current a, '+cl+' nav ul li.tab-current a > i{color:'+color+' !important;}\n'; 315 css += cl+' nav ul li:not(.tab-current):not(.tab-heading):hover::before{background:'+bg_hover+'; border-color:'+bg_hover+'; transform: translate3d(0,0,0);}\n'; 316 css += cl+' nav ul li:not(.tab-current):not(.tab-heading):hover::after { border-color:'+bg_hover+';}\n'; 317 css += cl+' nav ul li:not(.tab-current):not(.tab-heading):hover a, '+cl+' nav ul li:not(.tab-current):not(.tab-heading):hover a > i{color:'+color_hover+' !important;}\n'; 318 break; 319 case 'line': 320 css += cl+' nav ul li.tab-current a{box-shadow:inset 0px -2px '+bg+' !important;}\n'; 321 css += cl+' nav ul li.tab-current a, '+cl+' nav ul li.tab-current a > i{color:'+color+' !important;}\n'; 322 css += cl+' nav ul li:not(.tab-current):not(.tab-heading):hover a{box-shadow:inset 0px -2px '+bg_hover+' !important;}\n'; 323 css += cl+' nav ul li:not(.tab-current):not(.tab-heading):hover a, '+cl+' nav ul li:not(.tab-current):not(.tab-heading):hover a > i{color:'+color_hover+' !important;}\n'; 324 break; 325 case 'linebox': 326 css += cl+' nav ul li a::after{background:'+bg+';}\n'; 327 css += cl+' nav ul li.tab-current a, '+cl+' nav ul li.tab-current a > i{color:'+color+' !important;}\n'; 328 css += cl+' nav ul li:not(.tab-current):not(.tab-heading):hover a::after{background:'+bg_hover+';
328 transform: translate3d(0,0,0);}\n'; 329 css += cl+' nav ul li:not(.tab-current):not(.tab-heading):hover a, '+cl+' nav ul li:not(.tab-current):not(.tab-heading):hover a > i{color:'+color_hover+' !important;}\n'; 330 break; 331 case 'flip': 332 css += cl+' nav ul li a::after, '+cl+' nav ul li.tab-current a{background:'+bg+';}\n'; 333 css += cl+' nav ul li.tab-current a, '+cl+' nav ul li.tab-current a > i{color:'+color+' !important;}\n'; 334 css += cl+' nav ul li:not(.tab-current):not(.tab-heading):hover a::after, '+cl+' nav ul li:not(.tab-current):not(.tab-heading):hover a{background:'+bg_hover+'; transform: translate3d(0,0,0);}\n'; 335 css += cl+' nav ul li:not(.tab-current):not(.tab-heading):hover a, '+cl+' nav ul li:not(.tab-current):not(.tab-heading):hover a > i{color:'+color_hover+' !important;}\n'; 336 break; 337 case 'tzoid': 338 var style = jQuery(cl + ' nav ul li').attr('style'); 339 css += cl+' nav ul li a::after{'+style+';}\n'; 340 css += cl+' li.tab-current a::after{background:'+bg+'; color:'+color+';}\n'; 341 css += cl+' nav ul li.tab-current a, '+cl+' nav ul li.tab-current a > i{color:'+color+' !important;}\n'; 342 css += cl+' li:not(.tab-current):not(.tab-heading):hover a::after{background:'+bg_hover+'; color:'+color_hover+'; transform: perspective(5px) rotateX(0.75deg) translateZ(-1px);}\n'; 343 css += cl+' nav ul li:not(.tab-current):not(.tab-heading):hover a, '+cl+' nav ul li:not(.tab-current):not(.tab-heading):hover a > i{color:'+color_hover+' !important;}\n'; 344 break; 345 case 'fillup': 346 css += cl+' nav ul li.tab-current a::after{background:'+bg+';}\n'; 347 css += cl+' nav ul li a::after{background:'+bg+'; border-color: '+bg+';}\n'; 348 css += cl+' nav ul li.tab-current a, '+cl+' nav ul li.tab-current a > i{color:'+color+' !important;}\n'; 349 css += cl+' nav ul li a {border-color:'+color+' !important;}\n'; 350 css += cl+' nav ul li:not(.tab-current):not(.tab-heading):hover a::after{background:'+bg_hover+'; translate3d(0,0,0)}\n'; 351 css += cl+' nav ul li:not(.tab-current):not(.tab-heading):hover a::after{background:'+bg_hover+'; border-color: '+bg_hover+'; transform: translate3d(0,0,0)}\n'; 352 css += cl+' nav ul li:not(.tab-current):not(.tab-heading):hover a {border-color:'+color_hover+' !important;}\n'; 353 css += cl+' nav ul li:not(.tab-current):not(.tab-heading):hover a, '+cl+' nav ul li:not(.tab-current):not(.tab-heading):hover a > i{color:'+color_hover+' !important;}\n'; 354 break; 355 } 356 // css += cl+' li.tab-current a{background:'+bg+'; color:'+color+';}\n'; 357 358 var listContainer = jQuery(cl).find('.elegant-tabs-list-container'); 359 listContainer.find('li').each(function(index, el) { 360 var textColor = jQuery(this).attr('data-tab-text-color'), 361 tabBGColor = jQuery(this).attr('data-tab-bg-color'), 362 $this = jQuery(this); 363 364 css += cl + ' .infi-responsive-tabs:nth-of-type(' + (index + 1) + ') .infi-tab-accordion.infi-active-tab .infi_accordion_item{background:' + tabBGColor + ' !important; color:' + textColor + ' !important;fill:' + textColor + ' !important}\n'; 365 css += cl + ' .infi-responsive-tabs:nth-of-type(' + (index + 1) + ') .infi-tab-accordion.infi-active-tab .infi_accordion_item .infi-accordion-item-heading{color:' + textColor + ' !important;}\n'; 366 css += cl + ' .infi-responsive-tabs:nth-of-type(' + (index + 1) + ') .infi-tab-accordion.infi-active-tab .infi_accordion_item .infi-accordion-item-heading .iw-icons{color:' + textColor + ' !important;}\n'; 367 368 switch (st) { 369 case 'bars': 370 css += cl + ' li:nth-child(' + (index + 1) + ') a{background:' + tabBGColor + '; color:' + textColor + ';}\n'; 371 css += cl + ' nav ul li:nth-child(' + (index + 1) + ') a, ' + cl + ' nav ul li:nth-child(' + (index + 1) + ') a > i{color:' + textColor + ' !important;}\n'; 372 break; 373 case 'iconbox': 374 case 'iconbox-iconlist': 375 css += cl + ' li:nth-child(' + (index + 1) + ') a{background:' + tabBGColor + '; color:' + textColor + ' !important;}\n'; 376 css += cl + ' nav ul li:nth-child(' + (index + 1) + ') a > i{color:' + textColor + ' !important;}\n'; 377 css += cl + ' nav ul li:nth-child(' + (index + 1) + ')::after{color:' + tabBGColor + ';}\n'; 378 css += cl + ' nav ul li:nth-child(' + (index + 1) + '){color:' + tabBGColor + ' !important;}\n'; 379 break; 380 case 'underline': 381 css += cl + ' nav ul li:nth-child(' + (index + 1) + ') a::after{background:' + tabBGColor + ';}\n'; 382 css += cl + ' nav ul li:nth-child(' + (index + 1) + ') a, ' + cl + ' nav ul li:nth-child(' + (index + 1) + ') a > i{color:' + textColor + ' !important;}\n'; 383 break; 384 case 'topline': 385 css += cl + ' nav ul li:nth-child(' + (index + 1) + ') a{box-shadow:inset 0px 3px 0px ' + tabBGColor + ' !important;}\n'; 386 css += cl + ' nav ul li:nth-child(' + (index + 1) + ') {border-top-color: ' + textColor + ' !important;}\n'; 387 css += cl + ' nav ul li:nth-child(' + (index + 1) + ') a, ' + cl + ' nav ul li:nth-child(' + (index + 1) + ') a > i{color:' + textColor + ' !important;}\n'; 388 break; 389 case 'iconfall': 390 case 'circle': 391 case 'square': 392 css += cl + ' nav ul li:nth-child(' + (index + 1) + ')::before{background:' + tabBGColor + '; border-color:' + tabBGColor + ';}\n'; 393 css += cl + ' nav ul li:nth-child(' + (index + 1) + ')::after { border-color:' + tabBGColor + ';}\n'; 394 css += cl + ' nav ul li:nth-child(' + (index + 1) + ') a, ' + cl + ' nav ul li:nth-child(' + (index + 1) + ') a > i{color:' + textColor + ' !important;}\n'; 395 break; 396 case 'line': 397 css += cl + ' nav ul li:nth-child(' + (index + 1) + ') a{box-shadow:inset 0px -2px ' + tabBGColor + ' !important;}\n'; 398 css += cl + ' nav ul li:nth-child(' + (index + 1) + ') a, ' + cl + ' nav ul li:nth-child(' + (index + 1) + ') a > i{color:' + textColor + ' !important;}\n'; 399 break; 400 case 'linebox': 401 css += cl + ' nav ul li:nth-child(' + (index + 1) + ') a::after{background:' + tabBGColor + ';}\n'; 402 css += cl + ' nav ul li:nth-child(' + (index + 1) + ') a, ' + cl + ' nav ul li:nth-child(' + (index + 1) + ') a > i{color:' + textColor + ' !important;}\n'; 403 break; 404 case 'flip': 405 css += cl + ' nav ul li:nth-child(' + (index + 1) + ').tab-current a::after, ' + cl + ' nav ul li:nth-child(' + (index + 1) + ').tab-current a{background:' + tabBGColor + ';}\n'; 406 css += cl + ' nav ul li:nth-child(' + (index + 1) + ') a, ' + cl + ' nav ul li:nth-child(' + (index + 1) + ') a > i{color:' + textColor + ' !important;}\n'; 407 css += cl + ' nav ul li:nth-child(' + (index + 1) + '):not(.tab-current):not(.tab-heading):hover a::after, ' + cl + ' nav ul li:nth-child(' + (index + 1) + '):not(.tab-current):not(.tab-heading):hover a{background:' + tabBGColor + ';
407 transform: translate3d(0,0,0);}\n'; 408 css += cl + ' nav ul li:nth-child(' + (index + 1) + '):not(.tab-current):not(.tab-heading):hover a, ' + cl + ' nav ul li:nth-child(' + (index + 1) + '):not(.tab-current):not(.tab-heading):hover a > i{color:' + textColor + ' !important;}\n'; 409 break; 410 case 'tzoid': 411 css += cl + ' nav ul li:nth-child(' + (index + 1) + ') a::after{background:' + tabBGColor + '; color:' + textColor + ';}\n'; 412 css += cl + ' li:nth-child(' + (index + 1) + ') a::after{background:' + tabBGColor + '; color:' + textColor + ';}\n'; 413 css += cl + ' nav ul li:nth-child(' + (index + 1) + ') a, ' + cl + ' nav ul li:nth-child(' + (index + 1) + ') a > i{color:' + textColor + ' !important;}\n'; 414 break; 415 case 'fillup': 416 css += cl + ' nav ul li:nth-child(' + (index + 1) + ') a::after{background:' + tabBGColor + '; border-color: ' + tabBGColor + ';}\n'; 417 css += cl + ' nav ul li:nth-child(' + (index + 1) + ') a::after{background:' + bg_hover + '; border-color: ' + bg_hover + ';}\n'; 418 css += cl + ' nav ul li:nth-child(' + (index + 1) + ') a, ' + cl + ' nav ul li:nth-child(' + (index + 1) + ') a > i{color:' + textColor + ' !important;}\n'; 419 css += cl + ' nav ul li:nth-child(' + (index + 1) + ') a {border-color:' + textColor + ' !important;}\n'; 420 break; 421 } 422 423 }); 424 425 }); 426 css += '</style>'; 427 jQuery("head").append(css); 428} 429 430/* Call tabs function */ 431(function() { 432 433 etGenerateCSS(); 434 435 [].slice.call( document.querySelectorAll( '.et-mobile-enabled' ) ).forEach( function( el ) { 436 // Create the dropdown base 437 var nav = jQuery(el).find("nav"); 438 jQuery("<select />", { "class":"et-mobile-tabs"}).appendTo( nav ); 439 440 // Populate dropdown with menu items 441 nav.find("a").each(function() { 442 var el = jQuery(this); 443 jQuery("<option />", { 444 "value" : el.attr("data-href"), 445 "text" : el.find('.et-tab-title').text() 446 }).appendTo(nav.find("select") ); 447 }); 448 nav.find( "select" ).change( function() { 449 var hashLink = jQuery( this ).find( "option:selected" ).val(); 450 checkHash( hashLink ); 451 }); 452 }); 453 454 jQuery("a").not('.et-anchor-tag').on( 'click', function(e) { 455 var url = jQuery(this).attr("href"); 456 if( url !== "" && typeof url !== "undefined"){ 457 var isHash = url.indexOf('#section'); 458 var isTabPage = ''; 459 hash = url.substring(url.indexOf('#section')); 460 if( isHash !== -1 ){ 461 isTabPage = jQuery(hash).length; 462 } 463 if( isHash !== -1 && isTabPage ) { 464 e.preventDefault(); 465 checkHash( url ); 466 jQuery( 'html, body' ).animate( { scrollTop:( ( jQuery(hash) ).offset().top ) - 150 }, 300 ); 467 } 468 } 469 }); 470 471 jQuery(".et-anchor-tag").on( 'hover mouseenter', function( e ) { 472 if ( ! jQuery(this).parent('li').hasClass('tab-current') ) { 473 var hover_src = jQuery(this).find('.elegant-tabs-image-icon').data( 'hover-src' ); 474 if ( '' !== hover_src ) { 475 jQuery(this).find('.elegant-tabs-image-icon').attr( 'src', hover_src ); 476 } 477 } 478 } ); 479 jQuery(".et-anchor-tag").on( 'mouseleave', function( e ) { 480 if ( ! jQuery(this).parent('li').hasClass('tab-current') ) { 481 var original_src = jQuery(this).find('.elegant-tabs-image-icon').data( 'original-src' ); 482 jQuery(this).find('.elegant-tabs-image-icon').attr( 'src', original_src ); 483 } 484 } ); 485 486 jQuery( '.et-switch-on-hover .et-anchor-tag' ).on( 'hover mouseenter', function() { 487 jQuery( this ).parent( 'li' ).trigger( 'click' ); 488 } ); 489 490 jQuery( '.et-switch-on-hover .et-anchor-tag' ).on( 'pointerdown MSPointerDown', function( event ) { 491 if ( jQuery( this ).hasClass( 'touchstart' ) ) { 492 jQuery( this ).removeClass( 'touchstart' ); 493 } 494 495 if ( isDeviceTouchEnabled( event ) && ! jQuery( this ).parent('li').hasClass( 'tab-current' ) ) { 496 if ( jQuery( this ).hasClass( 'title-link-double-tap' ) ) { 497 jQuery( this ).toggleClass( 'touchstart' ); 498 } 499 } else { 500 jQuery( this ).parent( 'li' ).trigger( 'click' ); 501 } 502 } ); 503 504 jQuery( '.et-anchor-tag.title-has-link' ).on( 'click', function( e ) { 505 var href = jQuery( this ).attr('href'), 506 target = jQuery( this ).attr('target'); 507 508 if ( ! jQuery( this ).hasClass( 'touchstart' ) ) { 509 if ( '_blank' === target ) { 510 window.open( href ); 511 } else { 512 window.location = href; 513 } 514 } 515 } ); 516 517 jQuery( document ).on( 'elegantTabSwitched', function( e, hash ) { 518 519 jQuery( document ).trigger( 'resize' ); 520 521 if ( typeof wpb_prepare_tab_content == 'function' ) { 522 wpb_prepare_tab_content( e, { newPanel: jQuery( '.et-content-wrap' ) } ); 523 } 524 525 jQuery( hash ).parents( '.et-tabs' ).find( '.et-mobile-tabs' ).val( hash ); 526 jQuery( hash ).parent( '.et-content-wrap' ).find( '.infi-tab-accordion' ).removeClass( 'infi-active-tab' ); 527 jQuery('div[data-href="'+hash+'"]').parents( '.infi-tab-accordion' ).addClass( 'infi-active-tab' ); 528 529 jQuery( hash ).siblings().find('iframe').each( function( i ) { 530 jQuery(this).attr('src', jQuery(this).attr('src')); 531 } ); 532 533 var hover_src = jQuery('[data-href*="'+hash+'"]').find('.elegant-tabs-image-icon').data( 'hover-src' ); 534 535 jQuery('a[data-href*="'+hash+'"]').parents( '.elegant-tabs-list-container' ).find( '.elegant-tabs-image-icon' ).each( function(){ 536 var original_src = jQuery(this).data( 'original-src' ); 537 jQuery(this).attr( 'src', original_src ); 538 }); 539
540 if ( '' !== hover_src ) { 541 jQuery('a[data-href*="'+hash+'"]').find('.elegant-tabs-image-icon').attr( 'src', hover_src ); 542 543 if ( ! jQuery( 'div[data-href*="'+hash+'"]' ).parents( '.et-tabs' ).hasClass( 'et-accordions-closed' ) ) { 544 jQuery('div[data-href*="'+hash+'"]').find('.elegant-tabs-image-icon').attr( 'src', hover_src ); 545 } 546 } 547 }); 548 549 // Responsive Tabs. 550 jQuery(document).ready( function(){ 551 var accHD = document.getElementsByClassName('infi-accordion-item-heading'); 552 553 for (i = 0; i < accHD.length; i++ ) { 554 jQuery( accHD[i] ).on( 'click', function( event ) { 555 toggleItem( i, event ); 556 } ); 557 } 558 559 function toggleItem( index, event ) { 560 var $this = jQuery( event.target ), 561 hash = $this.data('href'), 562 itemID, 563 animation, 564 hashLink, 565 hover_src = '', 566 showHideAccordion = $this.parents( '.et-tabs' ).data( 'show-hide-accordion' ); 567 568 if ( typeof hash == 'undefined' ) { 569 hash = $this.parent( '.infi-accordion-item-heading' ).data( 'href' ); 570 $this = $this.parent( '.infi-accordion-item-heading' ); 571 } 572 573 itemID = hash; 574 animation = jQuery( itemID ).data( 'animation' ); 575 576 if ( showHideAccordion ) { 577 if ( $this.parents( '.infi-tab-accordion' ).hasClass( 'infi-active-tab' ) ) { 578 $this.parents( '.infi-tab-accordion' ).removeClass( 'infi-active-tab' ); 579 jQuery( itemID )[0].className = ''; 580 jQuery( itemID + ' > .infi-content-wrapper' )[0].className = 'infi-content-wrapper animated ' + animation; 581 } else { 582 jQuery( itemID ).parents( '.et-tabs' ).find( 'a[data-href="' + itemID +'"]').parents( 'li' ).addClass( 'tab-current' ); 583 jQuery( itemID ).parent( '.et-content-wrap' ).find( 'section' ).removeClass( 'content-current' ); 584 jQuery( itemID ).parent( '.et-content-wrap' ).find( '.infi-tab-accordion' ).removeClass( 'infi-active-tab' ); 585 $this.parents( '.infi-tab-accordion' ).addClass( 'infi-active-tab' ); 586 587 hover_src = jQuery('.infi-accordion-item-heading[data-href*="'+hash+'"]').find('.elegant-tabs-image-icon').data( 'hover-src' ); 588 589 jQuery('.infi-accordion-item-heading[data-href*="'+hash+'"]').parents( '.et-content-wrap' ).find( '.elegant-tabs-image-icon' ).each( function(){ 590 var original_src = jQuery(this).data( 'original-src' ); 591 jQuery(this).attr( 'src', original_src ); 592 }); 593 594 if ( '' !== hover_src ) { 595 jQuery('.infi-accordion-item-heading[data-href*="'+hash+'"]').find('.elegant-tabs-image-icon').attr( 'src', hover_src ); 596 } 597 598 jQuery( itemID )[0].className = 'content-current'; 599 jQuery( itemID + ' > .infi-content-wrapper' )[0].className = 'infi-content-wrapper animated ' + animation; 600 jQuery( 'html, body' ).animate( { scrollTop:( ( $this ).offset().top ) - 85 }, 300 ); 601 } 602 } else { 603 jQuery( itemID ).parents( '.et-tabs' ).find( 'nav > ul li').removeClass( 'tab-current' ); 604 jQuery( itemID ).parents( '.et-tabs' ).find( 'a[data-href="' + itemID +'"]').parents( 'li' ).addClass( 'tab-current' ); 605 jQuery( itemID ).parent( '.et-content-wrap' ).find( 'section' ).removeClass( 'content-current' ); 606 jQuery( itemID ).parent( '.et-content-wrap' ).find( '.infi-tab-accordion' ).removeClass( 'infi-active-tab' ); 607 $this.parents( '.infi-tab-accordion' ).addClass( 'infi-active-tab' ); 608 609 hover_src = jQuery('.infi-accordion-item-heading[data-href*="'+hash+'"]').find('.elegant-tabs-image-icon').data( 'hover-src' ); 610 611 jQuery('.infi-accordion-item-heading[data-href*="'+hash+'"]').parents( '.et-content-wrap' ).find( '.elegant-tabs-image-icon' ).each( function(){ 612 var original_src = jQuery(this).data( 'original-src' ); 613 jQuery(this).attr( 'src', original_src ); 614 }); 615 616 if ( '' !== hover_src ) { 617 jQuery('.infi-accordion-item-heading[data-href*="'+hash+'"]').find('.elegant-tabs-image-icon').attr( 'src', hover_src ); 618 } 619 620 jQuery( itemID )[0].className = 'content-current'; 621 jQuery( itemID + ' > .infi-content-wrapper' )[0].className = 'infi-content-wrapper animated ' + animation; 622 jQuery( 'html, body' ).animate( { scrollTop:( ( $this ).offset().top ) - 85 }, 300 ); 623 } 624 } 625 626 // Set all accordions to closed. 627 if ( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) { 628 setTimeout( function() { 629 jQuery( '.et-tabs.et-accordions-closed' ).each( function( index, tabs ) { 630 jQuery( tabs ).find( '.content-current' ).removeClass( 'content-current' ); 631 jQuery( tabs ).find( '.infi-active-tab' ).removeClass( 'infi-active-tab' ); 632 } ); 633 }, 102 ); 634 } 635 }); 636 637 jQuery( document ).ready( function() { 638 639 jQuery( '.infi-accordion-icon' ).on( 'click', function() { 640 jQuery( this ).prev( '.infi-accordion-item-heading' ).trigger( 'click' ); 641 } ); 642 643 // Tabs to carousel. 644 jQuery( '.et-tabs.et-tabs-carousel:not(.et-vertical)' ).each( function() { 645 var $thisTabs = jQuery( this ), 646 tabNavContainer = $thisTabs.find( '.elegant-tabs-list-container' ), 647 tabNavContainerWidth = 0, 648 tabNavWidth = 0, 649 singletabNavWidth = 0,
650 singletabNavHeight = 0, 651 nextTabWidth = 0, 652 tabNavStyle = '', 653 tabIconColor = $thisTabs.attr( 'data-arrow-color' ), 654 tabIconBgColor = $thisTabs.attr( 'data-arrow-bg-color' ), 655 nextTabIcon = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Capa_1" x="0px" y="0px" viewBox="0 0 240.823 240.823" style="enable-background:new 0 0 240.823 240.823;width: 24px;height: 24px;fill:' + tabIconColor + ';" xml:space="preserve"><g xmlns="http://www.w3.org/2000/svg"><path id="Chevron_Right_1_" d="M183.189,111.816L74.892,3.555c-4.752-4.74-12.451-4.74-17.215,0c-4.752,4.74-4.752,12.439,0,17.179 l99.707,99.671l-99.695,99.671c-4.752,4.74-4.752,12.439,0,17.191c4.752,4.74,12.463,4.74,17.215,0l108.297-108.261 C187.881,124.315,187.881,116.495,183.189,111.816z"/></g></svg>', 656 prevTabIcon = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Capa_1" x="0px" y="0px" viewBox="0 0 240.823 240.823" style="enable-background:new 0 0 240.823 240.823;width: 24px;height: 24px;fill:' + tabIconColor + ';" xml:space="preserve"><g><path id="Chevron_Right" d="M57.633,129.007L165.93,237.268c4.752,4.74,12.451,4.74,17.215,0c4.752-4.74,4.752-12.439,0-17.179 l-99.707-99.671l99.695-99.671c4.752-4.74,4.752-12.439,0-17.191c-4.752-4.74-12.463-4.74-17.215,0L57.621,111.816 C52.942,116.507,52.942,124.327,57.633,129.007z"/></g></svg>'; 657 658 if ( tabNavContainer.length ) { 659 tabNavContainerWidth = tabNavContainer.width(); 660 } 661 662 jQuery( tabNavContainer ).find( 'li' ).each( function() { 663 tabNavWidth += jQuery( this ).width(); 664 singletabNavWidth = jQuery( this ).width(); 665 singletabNavHeight = jQuery( this ).height(); 666 } ); 667 668 if ( tabNavWidth > tabNavContainerWidth ) { 669 tabNavContainerWidth = tabNavContainerWidth - 32; 670 tabNavStyle = $thisTabs.find( '.elegant-tabs-nav' ).attr( 'style' ); 671 $thisTabs.find( '.elegant-tabs-nav' ).attr( 'style', tabNavStyle + ';width:' + tabNavContainerWidth + 'px;padding-left:32px;' + 'overflow: hidden !important;' ); 672 tabNavContainer.css( { width: tabNavWidth + 20 } ); 673 tabIconBgColor = ( 'undefined' !== typeof tabIconBgColor ) ? tabIconBgColor : '#ddd'; 674 675 jQuery( '<span class="et-prev-tab" data-width="' + singletabNavWidth + 'px" style="height:' + singletabNavHeight + 'px;background:' + tabIconBgColor + ';">' + prevTabIcon + '</span>' ).insertBefore( tabNavContainer ); 676 jQuery( '<span class="et-next-tab" data-width="' + singletabNavWidth + 'px" style="height:' + singletabNavHeight + 'px;background:' + tabIconBgColor + ';">' + nextTabIcon + '</span>' ).insertAfter( tabNavContainer ); 677 678 $thisTabs.find( '.et-prev-tab' ).on( 'click', function() { 679 var lastTab = jQuery( this ).next( '.elegant-tabs-list-container' ).find( 'li:last-child' ), 680 firstTab = jQuery( this ).next( '.elegant-tabs-list-container' ).find( 'li:first-child' ) 681 clone = jQuery( lastTab ).clone(); 682 683 if ( lastTab.length ) { 684 685 lastTabWidth = lastTab.width(); 686 687 lastTab.css( { marginLeft: -lastTabWidth } ); 688 // firstTab.css( { marginLeft: lastTabWidth } ); 689 tabNavContainer.css( { width: tabNavWidth + 500 } ); 690 tabNavContainer.prepend( lastTab ); 691 tabNavContainer.append( clone ); 692 693 setTimeout( function(){ 694 lastTab.css( { marginLeft: 0 } ); 695 firstTab.css( { marginLeft: 0 } ); 696 clone.remove(); 697 }); 698 } 699 } ); 700 701 $thisTabs.find( '.et-next-tab' ).on( 'click', function() { 702 var nextTab = jQuery( this ).prev( '.elegant-tabs-list-container' ).find( 'li:first-child' ), 703 clone = jQuery( nextTab ).clone(); 704 705 if ( nextTab.length ) { 706 707 nextTabWidth = nextTab.width(); 708 709 nextTab.css( { marginLeft: -nextTabWidth } ); 710 tabNavContainer.css( { width: tabNavWidth + 500 } ); 711 tabNavContainer.append( clone ); 712 setTimeout( function(){ 713 nextTab.css( { marginLeft: 0 } ); 714 tabNavContainer.append( nextTab ); 715 clone.remove(); 716 }, 200 ); 717 } 718 } ); 719 } 720 } ); 721 } ); 722})();
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.