1// tfsmartresize helper 2!function(a,b){var c=function(a,b,c){var d;return function(){function g(){c||a.apply(e,f),d=null}var e=this,f=arguments;d?clearTimeout(d):c&&a.apply(e,f),d=setTimeout(g,b||100)}};jQuery.fn[b]=function(a){return a?this.bind("resize",c(a)):this.trigger(b)}}(jQuery,"tfsmartresize"); 3 4var Themify, ThemifyGallery; 5(function ($, window, document, undefined) { 6 'use strict'; 7 8 /* window load fires only once in IE */ 9 window.addEventListener( "load", function () { 10 window.loaded = true; 11 Themify.triggerEvent( window, 'resize' ); 12 $( 'body' ).addClass( 'page-loaded' ); 13 }); 14 15 Themify = { 16 wow: null, 17 triggerEvent: function (a, b) { 18 var c; 19 document.createEvent ? (c = document.createEvent("HTMLEvents"), c.initEvent(b, !0, !0)) : document.createEventObject && (c = document.createEventObject(), c.eventType = b), c.eventName = b, a.dispatchEvent ? a.dispatchEvent(c) : a.fireEvent && htmlEvents["on" + b] ? a.fireEvent("on" + c.eventType, c) : a[b] ? a[b]() : a["on" + b] && a["on" + b]() 20 }, 21 Init: function () { 22 if (typeof tbLocalScript !== 'undefined' && tbLocalScript) { 23 var $self = Themify; 24 $(document).ready(function () { 25 tbLocalScript.isTouch = $('body').hasClass('touch'); 26 $self.LoadAsync(tbLocalScript.builder_url + '/js/themify.builder.script.js'); // this script should be always loaded even there is no builder content because it's also requires for themify_shortcode for exp: animation js 27 }); 28 $('body').on('builderscriptsloaded.themify', function () { 29 $self.LoadAsync(tbLocalScript.builder_url + '/js/themify.builder.script.js'); 30 }); 31 } 32 else { 33 this.bindEvents(); 34 } 35 }, 36 bindEvents: function () { 37 var $self = Themify; 38 if (window.loaded) { 39 $('.shortcode.slider, .shortcode.post-slider, .slideshow-wrap').css({'height': 'auto', 'visibility': 'visible'}); 40 $self.InitCarousel(); 41 $self.InitGallery(); 42 $self.InitMap(); 43 $self.wowInit(); 44 $self.loadTFIcons(); 45 } 46 else { 47 $(window).load(function () { 48 $('.shortcode.slider, .shortcode.post-slider, .slideshow-wrap').css({'height': 'auto', 'visibility': 'visible'}); 49 $self.InitGallery(); 50 }); 51 $(document).ready(function () { 52 $self.InitCarousel(); 53 $self.InitMap(); 54 $self.wowInit(); 55 $self.loadTFIcons(); 56 }); 57 } 58 $('body').on('builder_load_module_partial builder_toggle_frontend', this.InitMap); // builder toggle/update module map. 59 }, 60 loadTFIcons : function() { 61 if( $( 'span[class*="ti-"], i[class*="ti-"]' ).length ) { 62 this.LoadCss(themify_vars.url + '/themify-icons/themify-icons.css', null); 63 } 64 }, 65 InitCarousel: function () { 66 if ($('.slides[data-slider]').length > 0) { 67 var $self = this; 68 $self.LoadAsync(themify_vars.url + '/js/jquery.imagesloaded.min.js', function () { 69 if('undefined' === typeof $.fn.carouFredSel){ 70 $self.LoadAsync(themify_vars.url + '/js/carousel.js', $self.carouselCalback, null, null, function () { 71 return ('undefined' !== typeof $.fn.carouFredSel); 72 }); 73 } 74 else{ 75 $self.carouselCalback(); 76 } 77 }, null, null, function () { 78 return ('undefined' !== typeof $.fn.imagesLoaded); 79 }); 80 } 81 }, 82 carouselCalback: function () { 83 84 $('.slides[data-slider]').each(function () { 85 $(this).find("> br, > p").remove(); 86 var $this = $(this), 87 $data = JSON.parse(window.atob($(this).data('slider'))), 88 height = (typeof $data.height === 'undefined') ? 'auto' : $data.height, 89 $numsldr = $data.numsldr, 90 $slideContainer = 'undefined' !== typeof $data.custom_numsldr ? '#' + $data.custom_numsldr : '#slider-' + $numsldr, 91 $speed = $data.speed >= 1000 ? $data.speed : 1000 * $data.speed, 92 $args = { 93 responsive: true, 94 swipe: true, 95 circular: $data.wrapvar, 96 infinite: $data.wrapvar, 97 auto: { 98 play: $data.auto == 0 ? false : true, 99 timeoutDuration: $data.auto >= 1000 ? $data.auto : 1000 * $data.auto, 100 duration: $speed, 101 pauseOnHover: $data.pause_hover 102 }, 103 scroll: { 104 items: parseInt($data.scroll), 105 duration: $speed, 106 fx: $data.effect
107 }, 108 items: { 109 visible: { 110 min: 1, 111 max: parseInt($data.visible) 112 }, 113 width: 120, 114 height: height 115 }, 116 onCreate: function (items) { 117 $this.closest('.caroufredsel_wrapper').outerHeight($this.outerHeight(true)); 118 $($slideContainer).css({'visibility': 'visible', 'height': 'auto'}); 119 } 120 }; 121 if ($data.slider_nav) { 122 $args.prev = $slideContainer + ' .carousel-prev'; 123 $args.next = $slideContainer + ' .carousel-next'; 124 } 125 if ($data.pager) { 126 $args.pagination = $slideContainer + ' .carousel-pager'; 127 } 128 $this.imagesLoaded().always(function () { 129 $this.carouFredSel($args); 130 }); 131 }); 132 133 var tscpsDidResize = false; 134 $(window).on("resize", function () { 135 tscpsDidResize = true; 136 }); 137 setInterval(function () { 138 if (tscpsDidResize) { 139 tscpsDidResize = false; 140 $(".slides[data-slider]").each(function () { 141 var heights = [], 142 newHeight, 143 $self = $(this); 144 $self.find("li").each(function () { 145 heights.push($(this).outerHeight(true)); 146 }); 147 newHeight = Math.max.apply(Math, heights); 148 $self.outerHeight(newHeight); 149 $self.parent().outerHeight(newHeight); 150 }); 151 } 152 }, 500); 153 154 }, 155 InitMap: function () { 156 var $self = Themify; 157 if ($('.themify_map').length > 0) { 158 if (typeof google !== 'object' || typeof google.maps !== 'object') { 159 if(!themify_vars.map_key){ 160 themify_vars.map_key = ''; 161 } 162 $self.LoadAsync('//maps.googleapis.com/maps/api/js?v=3.exp&callback=Themify.MapCallback&key='+themify_vars.map_key, false, true, true); 163 } else { 164 if( themify_vars.isCached && themify_vars.isCached === 'enable' ) { 165 google.maps = { __gjsload__: function() { return; } }; 166 $self.LoadAsync('//maps.googleapis.com/maps/api/js?v=3.exp&callback=Themify.MapCallback&key='+themify_vars.map_key, false, true, true); 167 } else { 168 $self.MapCallback(); 169 } 170 } 171 } 172 }, 173 MapCallback: function () { 174 var $maps = $('.themify_map'); 175 $maps.each(function ($i) { 176 var $data = JSON.parse(window.atob($(this).data('map'))), 177 address = $data.address, 178 zoom = parseInt($data.zoom), 179 type = $data.type, 180 scroll = $data.scroll, 181 drag = $data.drag, 182 node = this; 183 var delay = $i * 1000; 184 setTimeout(function () { 185 var geo = new google.maps.Geocoder(), 186 latlng = new google.maps.LatLng(-34.397, 150.644), 187 mapOptions = { 188 zoom: zoom, 189 center: latlng, 190 mapTypeId: google.maps.MapTypeId.ROADMAP, 191 scrollwheel: scroll, 192 draggable: drag 193 }; 194 switch (type.toUpperCase()) { 195 case 'ROADMAP': 196 mapOptions.mapTypeId = google.maps.MapTypeId.ROADMAP; 197 break; 198 case 'SATELLITE': 199 mapOptions.mapTypeId = google.maps.MapTypeId.SATELLITE; 200 break; 201 case 'HYBRID': 202 mapOptions.mapTypeId = google.maps.MapTypeId.HYBRID; 203 break; 204 case 'TERRAIN': 205 mapOptions.mapTypeId = google.maps.MapTypeId.TERRAIN; 206 break; 207 } 208 209 var map = new google.maps.Map(node, mapOptions), 210 revGeocoding = $(node).data('reverse-geocoding') ? true : false; 211 212 google.maps.event.addListenerOnce( map, 'idle', function(){ 213 $( 'body' ).trigger( 'themify_map_loaded', [ $(node), map ] ); 214 }); 215 216 /* store a copy of the map object in the dom node, for future reference */ 217 $(node).data( 'gmap_object', map ); 218 219 if (revGeocoding) { 220 var latlngStr = address.split(',', 2), 221 lat = parseFloat(latlngStr[0]), 222 lng = parseFloat(latlngStr[1]), 223 geolatlng = new google.maps.LatLng(lat, lng), 224 geoParams = {'latLng': geolatlng}; 225 } else { 226 var geoParams = {'address': address}; 227 } 228 229 geo.geocode(geoParams, function (results, status) { 230 if (status == google.maps.GeocoderStatus.OK) { 231 var position = revGeocoding ? geolatlng : results[0].geometry.location; 232 map.setCenter(position); 233 var marker = new google.maps.Marker({ 234 map: map, 235 position: position 236 }), 237 info = $(node).data('info-window'); 238 if (undefined !== info) { 239 var contentString = '<div class="themify_builder_map_info_window">' + info + '</div>', 240 infowindow = new google.maps.InfoWindow({ 241 content: contentString 242 }); 243 244 google.maps.event.addListener(marker, 'click', function () { 245 infowindow.open(map, marker); 246 }); 247 } 248 } 249 }); 250 }, delay); 251 }); 252 }, 253 wowInit: function () { 254 if ((typeof tbLocalScript === 'undefined' || !tbLocalScript) || (typeof tbLocalScript.animationInviewSelectors!=='undefined' && tbLocalScript.animationInviewSelectors.length > 0)) { 255 if (!Themify.wow) { 256 Themify.LoadAsync(themify_vars.url + '/js/wow.js', Themify.wowCallback, null, null, function () { 257 return (Themify.wow); 258 }); 259 } 260 else { 261 Themify.wowCallback(); 262 return (Themify.wow); 263 } 264 } 265 }, 266 wowCallback: function () { 267 var self = Themify; 268 if (themify_vars.TB) { 269 ThemifyBuilderModuleJs.animationOnScroll(); 270 } 271 self.wow = new WOW({ 272 live: true, 273 offset: typeof tbLocalScript !== 'undefined' && tbLocalScript ? parseInt(tbLocalScript.animationOffset)
273: 100 274 }); 275 self.wow.init(); 276 277 $('body').on('builder_load_module_partial builder_toggle_frontend', function () { 278 self.wow.doSync(); 279 self.wow.sync(); 280 }); 281 282 // duck-punching WOW to get delay and iteration from classnames 283 if (typeof self.wow.__proto__ !== 'undefined') { 284 self.wow.__proto__.applyStyle = function (box, hidden) { 285 var delay, duration, iteration; 286 duration = box.getAttribute('data-wow-duration'); 287 delay = box.getAttribute('class').match(/animation_effect_delay_((?:\d+\.?\d*|\.\d+))/); 288 if (null != delay) 289 delay = delay[1] + 's'; 290 iteration = box.getAttribute('class').match(/animation_effect_repeat_(\d*)/); 291 if (null != iteration) 292 iteration = iteration[1]; 293 return this.animate((function (_this) { 294 return function () { 295 return _this.customStyle(box, hidden, duration, delay, iteration); 296 }; 297 })(this)); 298 }; 299 } 300 }, 301 LoadAsync: function (src, callback, version, defer, test) { 302 var id = src.split("/").pop().replace(/\./g, '_'), // Make script filename as ID 303 existElemens = document.getElementById(id); 304 305 if (existElemens) { 306 if (callback) { 307 if (test) { 308 var callbackTimer = setInterval(function () { 309 var call = false; 310 try { 311 call = test.call(); 312 } catch (e) { 313 } 314 315 if (call) { 316 clearInterval(callbackTimer); 317 callback.call(); 318 } 319 }, 100); 320 } else { 321 setTimeout(callback, 110); 322 } 323 } 324 return; 325 } 326 var s, r, t; 327 r = false; 328 s = document.createElement('script'); 329 s.type = 'text/javascript'; 330 s.id = id; 331 s.src = !version && 'undefined' !== typeof tbLocalScript ? src + '?version=' + tbLocalScript.version : src; 332 if (!defer) { 333 s.async = true; 334 } 335 else { 336 s.defer = true; 337 } 338 s.onload = s.onreadystatechange = function () { 339 if (!r && (!this.readyState || this.readyState === 'complete')) 340 { 341 r = true; 342 if (callback) { 343 callback(); 344 } 345 } 346 }; 347 t = document.getElementsByTagName('script')[0]; 348 t.parentNode.insertBefore(s, t); 349 }, 350 LoadCss: function (href, version, before, media) { 351 352 if ($("link[href='" + href + "']").length > 0) { 353 return; 354 } 355 var doc = window.document; 356 var ss = doc.createElement("link"); 357 var ref; 358 if (before) { 359 ref = before; 360 } 361 else { 362 var refs = (doc.body || doc.getElementsByTagName("head")[ 0 ]).childNodes; 363 ref = refs[ refs.length - 1]; 364 } 365 366 var sheets = doc.styleSheets; 367 ss.rel = "stylesheet"; 368 ss.href = version ? href + '?version=' + version : href; 369 // temporarily set media to something inapplicable to ensure it'll fetch without blocking render 370 ss.media = "only x"; 371 ss.async = 'async'; 372 373 // Inject link 374 // Note: `insertBefore` is used instead of `appendChild`, for safety re: http://www.paulirish.com/2011/surefire-dom-element-insertion/ 375 ref.parentNode.insertBefore(ss, (before ? ref : ref.nextSibling)); 376 // A method (exposed on return object for external use) that mimics onload by polling until document.styleSheets until it includes the new sheet. 377 var onloadcssdefined = function (cb) { 378 var resolvedHref = ss.href; 379 var i = sheets.length; 380 while (i--) { 381 if (sheets[ i ].href === resolvedHref) { 382 return cb(); 383 } 384 } 385 setTimeout(function () { 386 onloadcssdefined(cb); 387 }); 388 }; 389 390 // once loaded, set link's media back to `all` so that the stylesheet applies once it loads 391 ss.onloadcssdefined = onloadcssdefined; 392 onloadcssdefined(function () { 393 ss.media = media || "all"; 394 }); 395 return ss; 396 }, 397 video: function () { 398 if ($('.themify_video_desktop a').length > 0) { 399 if (typeof flowplayer === 'undefined') { 400 this.LoadAsync(themify_vars.url + '/js/flowplayer-3.2.4.min.js', this.videoCalback); 401 } 402 else { 403 this.videoCalback(); 404 } 405 } 406 }, 407 videoCalback: function () { 408 $('.themify_video_desktop a').each(function () { 409 flowplayer( 410 $(this).attr('id'), 411 themify_vars.url + "/js/flowplayer-3.2.5.swf", 412 { 413 clip: {autoPlay: false} 414 } 415 ); 416 }); 417 }, 418 lightboxCallback: function ($el, $args) { 419 this.LoadAsync(themify_vars.url + '/js/themify.gallery.js', function () { 420 Themify.GalleryCallBack($el, $args); 421 }, null, null, function () { 422 return ('undefined' !== typeof ThemifyGallery); 423 }); 424 }, 425 InitGallery: function ($el, $args) { 426 var lightboxConditions = typeof themifyScript === 'object' && ((themifyScript.lightbox.lightboxContentImages && $(themifyScript.lightbox.c
426ontentImagesAreas).length>0) || $(themifyScript.lightbox.lightboxSelector).length > 0); 427 if(!lightboxConditions){ 428 lightboxConditions = typeof themifyScript === 'object' && themifyScript.lightbox.lightboxGalleryOn && ($(themifyScript.lightbox.lightboxContentImagesSelector).length > 0 || (typeof themifyScript.lightbox.gallerySelector!=='undefined' && $(themifyScript.lightbox.gallerySelector).length > 0)); 429 } 430 var self = this; 431 if (lightboxConditions || $('.module.module-gallery').length > 0 || $('.module.module-image').length > 0) { 432 this.LoadCss(themify_vars.url + '/css/lightbox.css', null); 433 this.LoadAsync(themify_vars.url + '/js/lightbox.js', function () { 434 Themify.lightboxCallback($el, $args); 435 }, null, null, function () { 436 return ('undefined' !== typeof $.fn.magnificPopup); 437 }); 438 439 if( $( '.gallery-masonry' ).length ) { 440 this.LoadAsync(themify_vars.includesURL + 'js/imagesloaded.min.js', function () { 441 self.LoadAsync(themify_vars.includesURL + 'js/masonry.min.js', function () { 442 $( '.gallery-masonry' ).imagesLoaded(function() { 443 $( '.gallery-masonry' ).masonry({ 444 itemSelector: '.gallery-item', 445 columnWidth: 1, 446 originLeft : ! $( 'body' ).hasClass( 'rtl' ) 447 }); 448 }); 449 }, null, null, function () { 450 return ('undefined' !== typeof $.fn.masonry); 451 }); 452 }, null, null, function () { 453 return ('undefined' !== typeof $.fn.imagesLoaded); 454 }); 455 } 456 } else { 457 $('body').addClass('themify_lightbox_loaded').removeClass('themify_lightboxed_images'); 458 } 459 }, 460 GalleryCallBack: function ($el, $args) { 461 if (!$el) { 462 $el = $(themifyScript.lightboxContext); 463 } 464 $args = !$args && themifyScript.extraLightboxArgs ? themifyScript.extraLightboxArgs : {}; 465 ThemifyGallery.init({'context': $el, 'extraLightboxArgs': $args}); 466 $('body').addClass('themify_lightbox_loaded').removeClass('themify_lightboxed_images'); 467 }, 468 isPageHasBuilderContent: function () { 469 var check_builder = $('.themify_builder_content').filter(function () { 470 return $.trim($(this).html().toString()).length > 0; 471 }); 472 return check_builder.length; 473 } 474 }; 475 476 Themify.Init(); 477 478}(jQuery, window, document));
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.