PageSourceSearch

https://www.esprit-paillettes.com/wp-content/plugins/wyde-core/shortcodes/js/shortcodes.js?ver=3.1.2

js esprit-paillettes.com collected 2026-10-02 13:53:48 UTC 49,193 bytes, 1,528 lines download raw bytes

1(function ($) {
2    "use strict";
3
4    window.$ = $;
5
6    $.fn.wydeShortcode = function(){
7
8    };
9    /*****************************************
10    Counter Box
11    /*****************************************/
12    $.fn.wydeCounterBox = function () {
13
14        return this.each(function () {
15
16
17            $(this).waypoint(function () {
18
19                var $el = $(this).find(".counter-value");
20
21                var start = parseInt($el.text());
22                var value = parseInt($el.data("value"));
23                var unit = $el.data("unit");
24
25                $el.countTo({
26                    from: start,
27                    to: value,
28                    unit: unit
29                });
30
31            }, {
32                offset: "90%",
33                triggerOnce: true
34            });
35
36        });
37
38    };
39
40    $.fn.countTo = function (options) {
41
42        var defaults = {
43            from: 0,
44            to: 100,
45            speed: 1000,
46            refreshInterval: (1000 / 60) * 2,
47            unit: ""
48        };
49
50        var settings = $.extend({}, defaults, options || {});
51
52        var loops = Math.ceil(settings.speed / settings.refreshInterval);
53        var step = (settings.to - settings.from) / loops;
54
55        return this.each(function () {
56
57            var $el = $(this);
58            var value = settings.from;
59            var unit = settings.unit;
60
61            var loopCount = 0;
62            var interval = setInterval(updateTimer, settings.refreshInterval);
63
64            function updateTimer() {
65                value += step;
66                loopCount++;
67                $el.html(value.toFixed(0) + unit);
68                if (loopCount >= loops) {
69                    clearInterval(interval);
70                    value = settings.to;
71                }
72            }
73
74        });
75    };
76
77
78    /*****************************************
79    Link Icon
80    /*****************************************/
81    $.fn.wydeLinkIcon = function () {
82
83        return this.each(function () {
84            var $el = $(this);
85            var color = hex2rgb($el.data("color"), "0.10");
86            $el.css({ "color": color });
87            $(":after", this).css({ "box-shadow-color": color });
88            $el.hover(function () {
89                $el.css("color", hex2rgb($el.data("color"), "1"));
90            }, function () {
91                $el.css("color", hex2rgb($el.data("color"), "0.10"));
92            });
93
94        });
95
96    };
97
98
99    /*****************************************
100    Animated Element
101    /*****************************************/
102    $.fn.wydeAnimated = function () {
103
104        return this.each(function () {
105
106            var $el = $(this);
107
108            var animation = $el.data("animation");
109            if (!animation) return;
110
111            $el.addClass("animated-element " + animation);
112
113            var delay = $el.data("animationDelay");
114            if (delay) delay = parseFloat(delay);
115
116            if (!delay) delay = 0;
117
118            delay = delay * 1000;
119
120            var offset = "100%";
121
122            $el.waypoint(function () {
123
124                setTimeout(function () {
125
126                    $el.removeClass("animated-element").addClass("animated").one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend", function(){
127                        $(this).removeClass(animation + " animated");
128                    });              
129
130                }, delay);
131
132            }, {
133                offset: offset,
134                triggerOnce: true
135            });
136
137
138        });
139
140    };
141
142
143    /*****************************************
144    Google Maps
145    /*****************************************/
146    $.fn.wydeGMaps = function (options) {
147
148        var defaults = {
149                icon: "",
150                gmaps: {
151                    locations:[
152                        {
153                            address: "",
154                            position: { lat: 37.6, lng: -95.665 }                    
155                        }
156                    ],
157                    zoom: 8,
158                    type: 2,
159                    center: { lat: 37.6, lng: -95.665 }
160                },
161                color: "#ff0000",
162                height: 500,
163                mapStyles : []
164        };
165
166        return this.each(function () {
167
168            if( typeof google == "undefined" ) return;
169
170            var $el = $(this);           
171            
172            var settings = $.extend({}, defaults, options || {});            
173
174            var mapCanvas = $el.find(".w-map-canvas").height(settings.height).get(0);
175            var locations = settings.gmaps.locations;
176            var center = new google.maps.LatLng(settings.gmaps.center.lat, settings.gmaps.center.lng);
177            var zoom = settings.gmaps.zoom;
178            var type = settings.gmaps.type;
179            var mapStyles = settings.mapStyles;
180
181            var wydeMapType = new google.maps.StyledMapType(mapStyles, { name: "Wyde Map" });
182
183            var mapOptions = {
184                center: center,
185                zoom: zoom,
186                scrollwheel: false,
187                draggable: !wyde.browser.touch,
188                zoomControl: true,
189                zoomControlOptions: {
190                    style: google.maps.ZoomControlStyle.SMALL,
191                    position: google.maps.ControlPosition.RIGHT_CENTER
192                },
193                scaleControl: false,
194                scaleControlOptions: {
195                    position: google.maps.ControlPosition.LEFT_CENTER
196                },
197                streetViewControl: false,
198                streetViewControlOptions: {
199                    position: google.maps.ControlPosition.LEFT_CENTER
200                },
201                panControl: false,
202                panControlOptions: {
203                    position: google.maps.ControlPosition.LEFT_CENTER
204                },
205                mapTypeControl: false,
206                mapTypeControlOptions: {
207                    mapTypeIds: [type, "wyde_map"],
208                    style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR,
209                    position: google.maps.ControlPosition.LEFT_CENTER
210                },
211                mapTypeId: "wyde_map"
212            };
213
214            var map = new google.maps.Map(mapCanvas, mapOptions);
215            map.mapTypes.set("wyde_map", wydeMapType);          
216
217            if (locations) {
218
219                $.each(locations, function(){
220                    var location = this;
221                    var marker = new google.maps.Marker({
222                        map: map,
223                        position: location.position,
224                        animation: google.maps.Animation.DROP,
225                        icon: settings.icon
226                    });
227
228                    var infowindow = new google.maps.InfoWindow({
229                        content: location.address
230                    });
231
232                    google.maps.event.addListener(marker, "click", function () {
233                        infowindow.open(map, marker);
234                    });
235
236                });
237                
238            }
239
240        });
241
242    };
243
244
245    /*****************************************
246    Tabs
247    /*****************************************/
248    function WydeTabs(element, options, callback) {   
249
250            var defaults = {
251                interval: 0,
252                selectedIndex: 0,
253                changed: function(){}
254            };
255
256            var settings = $.extend({}, defaults, options || {});
257
258            var $el = $(element);            
259            var timer = null;
260            var selectedIndex = settings.selectedIndex;
261            var items = $el.find(".w-tabs-nav li").length;
262            var playing = false;
263
264            var self = this;
265
266            this.select = function (idx) {
267
268                if(idx >= 0) selectedIndex = idx;
269
270                if (selectedIndex < 0 || selectedIndex >= items) selectedIndex = 0;            
271
272                $el.find(".w-tabs-nav li").removeClass("active");
273                $el.find(".w-tabs-nav li").eq(selectedIndex).addClass("active");
274
275                $el.find(".w-tab").removeClass("active");
276                $el.find(".w-tab").eq(selectedIndex).addClass("active");
277                $el.find(".w-tab-wrapper").css("min-height", $el.find(".w-tab").eq(selectedIndex).height());
278                if(typeof settings.changed == "function"){
279                    settings.changed();
280                }
281            };
282
283            this.play = function () {
284                if (!playing) {
285                    timer = setInterval(function () {
286                        selectedIndex++;
287                        self.select();
288                    }, settings.interval * 1000);
289                    playing = true;
290                }
291            };
292
293            this.pause = function () {
294                if (timer) clearInterval(timer);
295                playing = false;
296            };
297
298            $el.find(".w-tabs-nav li").each(function(){
299                var $nav = $(this);
300                var idx = $el.find(".w-tabs-nav li").index($nav);
301                var link = $nav.find("a").attr("href");
302                //Find all links (including other buttons) matching tab id so allow them to open this tab section.
303                var $button = $nav.find("a");
304
305                if(link && link.length>1){
306
307                    $("a[href*='"+link+"']").not($button).off("click").on("click", function (event) {
308                        event.preventDefault();
309                        self.pause();                    
310                        wyde.page.scrollTo($nav, {
311                            onAfter: function() {                       
312                                self.select(idx);
313                            }
314                        });
315                        
316                        return false;
317                    });
318
319                }
320
321                $button.off("click").on("click", function(event){
322                    event.preventDefault();
323                    self.pause();                                           
324                    self.select(idx);                                         
325                    return false;
326                });
327
328            });
329
330            this.select(selectedIndex);
331
332            if (settings.interval > 2) {
333                self.play();
334                $el.hover(function () {
335                    self.pause();
336                }, function () {
337                    self.play();
338                });
339                $(window).scroll(function () {
340                    if ($el.isOnScreen()) {
341                        self.play();
342                    } else {
343                        self.pause();
344                    }
345                });
346            }
347    
348    };
349    //jQuery proxy
350    $.fn.wydeTabs = function (options, callbackMap) {
351        var method, methodArgs;
352
353        // Attributes logic
354        if (!$.isPlainObject(options)) {
355            if (typeof options === "string" || options === false) {
356                method = options === false ? "destroy" : options;
357                methodArgs = Array.prototype.slice.call(arguments, 1);
358            }
359            options = {};
360        }
361
362        // Apply to all elements
363        return this.each(function (i, element) {
364            // Call with prevention against multiple instantiations
365            var plugin = $.data(element, "wydeTabs");
366
367            if (!plugin && !method) {                
368                // Create a new object if it doesn't exist yet
369                plugin = $.data(element, "wydeTabs", new WydeTabs(element, options, callbackMap));
370            } else if (plugin && method) {
371                // Call method
372                if (plugin[method]) {
373                    plugin[method].apply(plugin, methodArgs);
374                }
375            }
376        });
377    };
378
379
380    /*****************************************
381    Accordion
382    /*****************************************/
383    $.fn.wydeAccordion = function () {
384
385
386        return this.each(function () {
387            var $el = $(this);
388            var color = $el.data("color");
389            //if (color) color = hex2rgb(color, '0.3');
390
391            if (color) $el.find(".acd-header").css("color", color);
392
393            var activeTab = $el.data("active");
394            if (activeTab !== "false" && activeTab != "") {
395                $el.find(".acd-content").eq(parseInt(activeTab) - 1).slideDown(300, function () {
396                    $(this).parent().addClass("active");
397                    if (color) $(this).parent().find(".acd-header").css({ color: "", "background-color": color });
398                });
399            }
400
401
402
403            var collapsible = $el.data("collapsible");
404
405            $el.find(".acd-header").click(function (event) {
406                var $parent = $(this).parents(".w-accordion-tab");
407
408                if ($parent.hasClass("active")) {
409                    return false;
410                } else {
411                    var $content = $parent.find(".acd-content");
412                    if (!collapsible) {
413                        $el.find(".acd-content").not($content).slideUp(300, function () {
414                            $(this).parent().removeClass("active");
415                            if (color) $(this).parent().find(".acd-header").css({ color: color, "background-color": "" });
416                        });
417                    }
418
419                    $content.slideDown(300, function () {
420                        $parent.addClass("active");
421                        if (color) $parent.find(".acd-header").css({ color: "", "background-color": color });
422
423                    });
424                }
425
426            });
427
428        });
429    };
430
431
432    /*****************************************
433    Toggle
434    /*****************************************/
435    $.fn.wydeToggle = function () {
436
437        return this.each(function () {
438
439            var $el = $(this);
440            /*
441            var color = $el.data("color");
442            //if (color) color = hex2rgb(color, '0.3');
443            $el.find(".acd-header").css("color", color);
444
445            if (color && $el.hasClass("active")) {
446                $el.find(">h3").css({ "color": color });
447            }
448            */
449            $el.on("click", function () {
450                $el.find("> div").slideToggle(300, function () {
451                    $el.toggleClass("active ");
452                    /*
453                    if ($el.hasClass("active")) {
454                        $el.find(">h3").css({ "color": color });
455                    } else {
456                        $el.find(">h3").css({ "color": "" });
457                    }*/
458                });
459            });
460
461
462        });
463    };
464
465
466    /*****************************************
467    Progress Bar
468    /*****************************************/
469    $.fn.wydeProgressBar = function () {
470
471        return this.each(function () {
472            var $el = $(this);
473
474            // Collect and sanitize user input
475            var value = parseInt($el.data("value")) || 0;
476            var unit = $el.data("unit");
477            var xPos = 100 - value;
478            $el.waypoint(function () {
479
480                $el.find(".w-bar").css(wyde.browser.prefix + "transform", "translateX(-" + xPos + "%)");
481
482                var $counter = $el.find(".w-counter");
483                if ($counter.length) {
484
485                    if(!wyde.browser.xs) {
486                        $counter.css(wyde.browser.prefix + "transform", "translateX(-" + xPos + "%)");
487                    } 
488
489                    $({ counterValue: 0 }).animate({ counterValue: value }, {
490                        duration: 1500,
491                        easing: "easeOutCirc",
492                        step: function () {
493                            $counter.text(Math.round(this.counterValue) + " " + unit);
494                        }
495                    });
496                }
497
498            }, {
499                offset: "90%",
500                triggerOnce: true
501            });
502
503        });
504    };
505
506    /*****************************************
507    Facebook Like Box
508    /*****************************************/
509    $.fn.wydeFacebookLike = function (options, callback) {
510
511        var defaults = {
512            page_url: "",
513            height: 500,
514            show_facepile: true,
515            small_header: false,
516            tabs:'timeline'
517        };        
518
519        return this.each(function () {
520
521            var settings = $.extend({}, defaults, options || {});
522
523            var self = this;
524
525            var $el = $(this);          
526
527            var $iframe = $("<iframe></iframe>");  
528
529
530
531            this.refresh = function(){
532
533                 if ($el.data("width")){
534                    settings.width = parseInt($el.data("width"));
535                }else{
536                    settings.width = $el.width();
537                }
538
539                if ($el.data("height")){
540                    settings.height = parseInt($el.data("height"));
541                }else{
542                    settings.height = 500;
543                }
544
545                if ($el.data("show_facepile")) settings.show_facepile = $el.data("show_facepile");
546                if ($el.data("small_header")) settings.small_header = $el.data("small_header");
547                if ($el.data("tabs")) settings.tabs = $el.data("tabs");
548                if ($el.data("page_url")) settings.page_url = $el.data("page_url");
549                
550
551                $iframe.attr("src", String.format("https://www.facebook.com/v2.5/plugins/page.php?width={0}&height={1}&show_facepile={2}&small_header={3}&tabs={4}&href={5}",
552                        settings.width,
553                        settings.height,
554                        settings.show_facepile,
555                        settings.small_header,
556                        settings.tabs,
557                        encodeURI( settings.page_url )
558                    )
559                );
560
561                $el.html("");
562
563                $el.append( $iframe );
564
565            };
566
567            this.refresh();
568
569            $(window).smartresize(function(){
570                self.refresh();
571            });
572
573           
574        });
575    };
576
577    /*****************************************
578    Flickr Stream
579    /*****************************************/
580    $.fn.wydeFlickrStream = function (options, callback) {
581
582        var defaults = {
583            apiUrl: {
584                user: "https://api.flickr.com/services/feeds/photos_public.gne",
585                group: "https://api.flickr.com/services/feeds/groups_pool.gne"
586            },
587            count: 9,
588            columns: 3,
589            size: "_q",
590            type: "user",
591            lang: "en-us",
592            format: "json",
593            jsoncallback: "?"
594
595        };        
596
597        return this.each(function () {
598
599            var settings = $.extend({}, defaults, options || {});
600
601            var $el = $(this);
602
603            if ($el.data("type")) settings.type = $el.data("type");
604            if ($el.data("count")) settings.count = parseInt($el.data("count"));
605            if ($el.data("columns")) settings.columns = parseInt($el.data("columns"));
606            if ($el.data("id")) settings.id = $el.data("id");
607
608            if (!settings.id){
609                $el.find(".w-content").html("");
610                return;
611            } 
612
613            var apiUri = settings.apiUrl.user;
614            if (settings.type == "group") {
615                apiUri = settings.apiUrl.group;
616            }
617
618            apiUri = String.format("{0}?lang={1}&format={2}&id={3}&jsoncallback={4}", apiUri, settings.lang, settings.format, settings.id, settings.jsoncallback);
619
620            var colName = "";
621            if (settings.columns != 5) {
622                colName = "col-" + Math.abs(Math.floor(12 / settings.columns));
623            } else {
624                colName = "five-cols";
625            }
626
627            $.getJSON(apiUri, function (data) {
628                var list = $("<ul></ul>").addClass("image-list clear");
629                $el.find(".w-content").html("").append(list);
630                $.each(data.items, function (i, item) {
631                    if (i < settings.count) {
632                        list.append(String.format("<li class=\"{0}\"><a href=\"{1}\" title=\"{2}\" target=\"_blank\"><img src=\"{3}\" alt=\"{2}\" /></a></li>", colName, item.link, item.title, item.media.m.replace("_m", settings.size)));
633                    }
634                });
635
636                if (typeof callback == "function") {
637                    callback();
638                }
639
640            });
641        });
642    };
643
644
645    /*****************************************
646    TwitterFeed
647    /*****************************************/
648    $.fn.wydeTwitterFeed = function (options) {
649
650        var defaults = {
651            username: "",
652            count: 5,
653            profileImage: false,
654            showTime: false,
655            mediaSize: ""  //values: thumb, small, medium, large 
656
657        };
658
659        function xTimeAgo(time) {
660            var nd = new Date();
661            //var gmtDate = Date.UTC(nd.getFullYear(), nd.getMonth(), nd.getDate(), nd.getHours(), nd.getMinutes(), nd.getMilliseconds());
662            var gmtDate = Date.parse(nd);
663            var tweetedTime = time * 1000; //convert seconds to milliseconds
664            var timeDiff = (gmtDate - tweetedTime) / 1000; //convert milliseconds to seconds
665
666            var second = 1, minute = 60, hour = 60 * 60, day = 60 * 60 * 24, week = 60 * 60 * 24 * 7, month 
666= 60 * 60 * 24 * 30, year = 60 * 60 * 24 * 365;
667
668            if (timeDiff > second && timeDiff < minute) {
669                return Math.round(timeDiff / second) + " seconds ago";
670            } else if (timeDiff >= minute && timeDiff < hour) {
671                return Math.round(timeDiff / minute) + " minutes ago";
672            } else if (timeDiff >= hour && timeDiff < day) {
673                return Math.round(timeDiff / hour) + " hours ago";
674            } else if (timeDiff >= day && timeDiff < week) {
675                return Math.round(timeDiff / day) + " days ago";
676            } else if (timeDiff >= week && timeDiff < month) {
677                return Math.round(timeDiff / week) + " weeks ago";
678            } else if (timeDiff >= month && timeDiff < year) {
679                return Math.round(timeDiff / month) + " months ago";
680            } else {
681                return "over a year ago";
682            }
683
684        }
685
686
687        return this.each(function () {
688
689            var $el = $(this);
690
691            var settings = $.extend({}, defaults, options || {});
692
693            if ($el.data("username")) settings.username = $el.data("username");
694            if ($el.data("count")) settings.count = parseInt($el.data("count"));
695            if ($el.data("profileImage")) settings.profileImage = $el.data("profileImage");
696            if ($el.data("showTime")) settings.showTime = $el.data("showTime");
697            if ($el.data("mediaSize")) settings.mediaSize = $el.data("mediaSize");
698
699            var urlpattern = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig;
700            var media = "";
701
702            $.getJSON("https://www.api.tweecool.com/?screenname=" + settings.username + "&count=" + settings.count, function (data) {
703
704                if (data.errors || data == null) {
705                    $el.html("No tweets available.");
706                    return false;
707                }
708
709                $el.html("");
710
711                var profileImage = "";
712
713                if (settings.profileImage) {
714                    profileImage = "<a href=\"https://twitter.com/" + settings.username + "\" target=\"_blank\"><img src=\"" + data.user.profile_image_url.replace("normal", "bigger") + "\" alt=\"" + settings.username + "\" /></a>";
715                } else {
716                    profileImage = "<i class=\"flora-icon-twitter\"></i>";
717                }
718
719                profileImage = "<div class=\"profile-image\">" + profileImage + "</div>";
720
721                $el.append(profileImage);
722
723                var $list = $("<div/>").appendTo($el);
724
725                $.each(data.tweets, function (i, field) {
726
727                    if (settings.showTime) {
728                        var timestamp = xTimeAgo(field.timestamp);
729                    } else {
730                        var timestamp = '';
731                    }
732
733                    if (settings.mediaSize != "" && field.media_url) {
734                        media = "<a href=\"https://twitter.com/" + settings.username + "\" target=\"_blank\" class=\"tweet-media\"><img src=\"" + field.media_url + ":" + settings.mediaSize + "\" alt=\"" + settings.username + "\" /></a>";
735                    } else {
736                        media = "";
737                    }
738
739                    $list.append("<div class=\"tweet-item\">" + field.text.replace(urlpattern, "<a href=\"$1\" target=\"_blank\">$1</a>") + media + " <span class=\"tweet-date\">" + timestamp + "</span></div>");
740                });
741
742
743                $list.owlCarousel({
744                    autoHeight: true,
745                    autoplayHoverPause: true,
746                    navText: ["", ""],
747                    items: 1,
748                    autoplay: 5000,
749                    nav: false,
750                    dots: true,
751                    loop: true,
752                    themeClass: "",
753                    animateIn: "fadeIn",
754                    animateOut: "fadeOut"
755                });
756
757            }).fail(function (jqxhr, textStatus, error) {
758                $el.html("No tweets available");
759            });
760
761        });
762
763    };
764
765
766    /*****************************************
767    Fade SlideShow
768    /*****************************************/
769    $.fn.wydeFadeSlider = function (options) {
770
771        var defaults = {
772            autoplayTimeout: 100,
773            interval: 1500,
774            activeClass: "active",
775            animateIn: "fadeIn",
776            animateOut: "fadeOut",
777            autoplay: false
778        };
779
780        var settings = $.extend({}, defaults, options || {});
781
782        return this.each(function () {
783
784            var $el = $(this);
785
786            var $slides = $el.find("> *");
787
788            if( $slides.length < 2){
789                $el.removeClass("w-fadeslider");
790                return;
791            }
792
793            $el.addClass("w-fadeslider");
794
795            $slides.addClass("slide").addClass(settings.animateOut);
796
797            var slideCount = $slides.length - 1;
798
799            var activeSlide = 0;
800
801            $slides.eq(activeSlide).addClass(settings.activeClass).removeClass(settings.animateOut).addClass(settings.animateIn);
802
803            var timer = false;
804
805            var play = function () {
806
807                var timeOut = settings.autoplayTimeout;
808                timer = setTimeout(function () {
809
810                    $slides.eq(activeSlide).removeClass(settings.activeClass).removeClass(settings.animateIn).addClass(settings.animateOut);
811
812                    if (activeSlide >= slideCount) {
813                        activeSlide = 0;
814                    } else {
815                        activeSlide = activeSlide + 1;
816                    }
817
818                    $slides.eq(activeSlide).removeClass(settings.animateOut).addClass(settings.animateIn).addClass(settings.activeClass);
819
820                    timeOut = settings.interval;
821
822                    timer = setTimeout(function () {
823                        play();
824                    }, timeOut);
825
826                }, timeOut);
827
828            }
829
830            var stop = function () {
831                clearInterval(timer);
832                timer = false;
833            }
834
835            if (settings.autoplay) {
836                play();
837                $el.hover(function () {
838                    stop();
839                }, function () {
840                    play();
841                });
842            } else {
843                $el.hover(function () {
844                    play();
845                }, function () {
846                    stop();
847                });
848            }
849        });
850
851    }
852
853    /*****************************************
854    Donut Chart
855    /*****************************************/
856    $.fn.wydeDonutChart = function (options, callback) {
857
858        var defaults = {
859            startdegree: 0,
860            color: "#21242a",
861            bgcolor: "#eee",
862            fill: false,
863            width: 15,
864            dimension: 250,
865            value: 50,
866            animationstep: 1.0,
867            border: "default",
868            complete: null
869        };
870       
871
872        return this.each(function () {
873
874            var settings = $.extend({}, defaults, options || {});
875
876            var customSettings = ["color", "bgcolor", "fill", "width", "dimension", "animationstep", "endPercent", "border", "startdegree"];
877
878            var percent;
879            var endPercent = 0;
880            var el = $(this);
881            var fill = false;
882            var type = "";
883
884            checkDataAttributes(el);
885
886            type = el.data("type");
887
888
889            if (el.data("total") != undefined && el.data("part") != undefined) {
890                var total = el.data("total") / 100;
891
892                percent = ((el.data("part") / total) / 100).toFixed(3);
893                endPercent = (el.data("part") / total).toFixed(3);
894            } else {
895                if (el.data("value") != undefined) {
896                    percent = el.data("value") / 100;
897                    endPercent = el.data("value");
898                } else {
899                    percent = defaults.value / 100;
900                }
901            }
902
903
904            el.width(settings.dimension + "px");
905
906            if (type == "half") {
907                el.height(settings.dimension / 2);
908            }
909
910            var size = settings.dimension,
911                canvas = $("<canvas></canvas>").attr({
912                    width: size,
913                    height: size
914                }).appendTo(el).get(0);
915
916            var context = canvas.getContext("2d");
917
918            var dpr = window.devicePixelRatio;
919            if (dpr) {
920                var $canvas = $(canvas);
921                $canvas.css("width", size);
922                $canvas.css("height", size);
923                $canvas.attr("width", size * dpr);
924                $canvas.attr("height", size * dpr);
925
926                context.scale(dpr, dpr);
927            }
928
929            var container = $(canvas).parent();
930            var x = size / 2;
931            var y = size / 2;
932            var radius = size / 2.5;
933            var degrees = settings.value * 360.0;
934            var radians = degrees * (Math.PI / 180);
935            var startAngle = 2.3 * Math.PI;
936            var endAngle = 0;
937            var counterClockwise = false;
938            var curPerc = settings.animationstep === 0.0 ? endPercent : 0.0;
939            var curStep = Math.max(settings.animationstep, 0.0);
940            var circ = Math.PI * 2;
941            var quart = Math.PI / 2;
942            var fireCallback = true;
943            var additionalAngelPI = (settings.startdegree / 180) * Math.PI;
944
945
946            if (type == "half") {
947                startAngle = 2.0 * Math.PI;
948                endAngle = 3.13;
949                circ = Math.PI;
950                quart = Math.PI / 0.996;
951            } else if (type == "angle") {
952                startAngle = 2.25 * Math.PI;
953                endAngle = 2.4;
954                circ = 1.53 + Math.PI;
955                quart = 0.73 + Math.PI / 0.996;
956            }
957
958            function checkDataAttributes(el) {
959                $.each(customSettings, function (index, attribute) {
960                    if (el.data(attribute) != undefined) {
961                        settings[attribute] = el.data(attribute);
962                    } else {
963                        settings[attribute] = $(defaults).attr(attribute);
964                    }
965
966                    if (attribute == "fill" && el.data("fill") != undefined) {
967                        fill = true;
968                    }
969                });
970            }
971
972            function animate(current) {
973
974                context.clearRect(0, 0, canvas.width, canvas.height);
975
976                context.beginPath();
977                context.arc(x, y, radius, endAngle, startAngle, false);
978
979                if (fill) {
980                    context.fillStyle = settings.fill;
981                    context.fill();
982                }
983
984                context.lineWidth = settings.width;
985
986                context.strokeStyle = settings.bgcolor;
987                context.stroke();                
988
989                context.beginPath();
990                context.arc(x, y, radius, -(quart) + additionalAngelPI, ((circ) * current) - quart + additionalAngelPI, false);
991
992                var borderWidth = settings.width;
993                if (settings.border == "outline") {
994                    borderWidth = settings.width + 10;
995                } else if (settings.border == "inline") {
996                    borderWidth = settings.width - 10;
997                }
998
999                context.lineWidth = borderWidth;
1000                context.strokeStyle = settings.color;
1001                context.stroke();
1002
1003                if (curPerc < endPercent) {
1004                    curPerc += curStep;
1005                    window.requestAnimationFrame(function () {
1006                        animate(Math.min(curPerc, endPercent) / 100);
1007                    });
1008                }
1009
1010                if (curPerc == endPercent && fireCallback && typeof (sett
1010ings) != "undefined") {
1011                    if ($.isFunction(settings.complete)) {
1012                        settings.complete();
1013
1014                        fireCallback = false;
1015                    }
1016                }
1017            }
1018
1019            el.waypoint(function () {
1020                animate(curPerc / 100);
1021            }, {
1022                offset: "100%",
1023                triggerOnce: true
1024            });
1025
1026
1027
1028
1029
1030        });
1031    };
1032
1033
1034    /*****************************************
1035    Scroll More
1036    /*****************************************/
1037    $.fn.wydeScrollmore = function (options) {
1038
1039        var defaults = {
1040            autoTriggers: 0,
1041            nextSelector: ".w-next",
1042            contentSelector: ".w-item",
1043            loaderClass: "ball-pulse",
1044            callback: false
1045        };
1046
1047        var settings = $.extend({}, defaults, options || {});
1048
1049        return this.each(function () {
1050
1051            var $el = $(this);
1052            var loading = false;
1053            var $next;
1054            var elIndex = $(".w-scrollmore").index($el);
1055
1056            function loadContent() {
1057
1058                if (loading == true) return;
1059
1060                var $loader = $("<div class=\"post-loader\"><div></div><div></div><div></div></div>");
1061                $loader.addClass(settings.loaderClass);
1062
1063                var url = $next.attr("href");
1064
1065                if (!url) return;
1066
1067                $next.replaceWith($loader);
1068
1069                loading = true;
1070
1071                $.ajax({
1072                    type: "GET",
1073                    url: url,
1074                    dataType: "html",
1075                    success: function (response) {
1076
1077                        var $data = $(response);
1078
1079                        var $newItems = $data.find(".w-scrollmore:eq(" + elIndex + ") " + settings.contentSelector).css({ opacity: 0 });
1080
1081                        if ($newItems.length > 0) {
1082
1083                            var $parent = $el.find(settings.contentSelector).parent();
1084                            $parent.append($newItems);
1085                            $parent.waitForImages({
1086                                finished: function () {
1087
1088                                    $newItems.css({ opacity: 1 });
1089
1090                                    $loader.replaceWith($data.find(".w-scrollmore:eq(" + elIndex + ") " + settings.nextSelector));
1091
1092                                    if (typeof settings.callback == "function") {
1093                                        settings.callback($newItems);
1094                                    }
1095
1096                                    $loader.css("opacity", 0);                                    
1097
1098                                    loading = false;
1099
1100                                    setTimeout(function(){
1101                                        init();
1102                                    }, 500);
1103
1104                                },
1105                                waitForAll: false
1106                            });
1107                        }
1108
1109
1110                    },
1111                    error: function (jqXHR, textStatus, errorThrown) {
1112                        loading = false;
1113                    }
1114                });
1115
1116
1117
1118            }
1119
1120            function init() {
1121
1122                $next = $el.find(settings.nextSelector);
1123
1124                if (settings.autoTriggers) {
1125                    $next.waypoint(function () {
1126                        loadContent();
1127                    }, {
1128                        offset: "100%"
1129                    });
1130                }
1131
1132                $next.off("click").on("click", function (event) {
1133                    event.preventDefault();
1134                    loadContent();
1135                    return false;
1136                });
1137            }
1138
1139            init();
1140
1141
1142        });
1143    };
1144
1145
1146    /*****************************************
1147    Parallax Background
1148    /*****************************************/
1149    $.fn.wydeParallax = function (options) {
1150
1151        var defaults = {
1152            speed: 0.3
1153        };
1154
1155        var settings = $.extend({}, defaults, options || {});
1156
1157        var $doc = $(document), $win = $(window);
1158
1159        var winHeight = $win.height();
1160        var docHeight = $doc.height();
1161
1162        return this.each(function () {
1163
1164            var $el = $(this);
1165            var isBusy = false;
1166
1167            var boxPos = $el.offset().top;
1168            var boxHeight = $el.height();
1169            var speed = settings.speed;
1170
1171            var reverse = $el.hasClass("w-reverse");
1172            var fade = $el.hasClass("w-fadeout");
1173
1174            var $bg = $el.find(".bg-image");
1175            var $content, contentHeight, contentTop, contentHalf, winHalf;
1176
1177            function refresh() {
1178                boxHeight = $el.height();
1179                if (reverse || fade) {
1180                    $content = $el.find(" > .row");
1181                    contentHeight = $content.height();
1182                    contentTop = $content.offset().top;
1183                    contentHalf = contentHeight / 2;
1184                } else {
1185                    speed = 44 / (winHeight + boxHeight);
1186                }
1187            }
1188
1189            function render() {
1190
1191                if ($el.isOnScreen()) {
1192
1193                    var scrollPos = $win.scrollTop();
1194                    boxPos = $el.offset().top;
1195                    if (reverse || fade) {
1196
1197                        var yPos = Math.round((scrollPos - (boxPos)) * speed);
1198                        $bg.css(wyde.browser.prefix + "transform", "translate3d(0px, " + yPos + "px, 0px)");
1199
1200                        if (fade) {
1201                            var viewport = getViewPort();
1202                            winHalf = winHeight / 2;
1203                            if (viewport.bottom > (contentTop + contentHeight - contentHalf + winHalf)) {
1204                                var o = 1 - ((scrollPos + contentHeight - contentTop) / contentHeight);
1205                                $content.css('opacity', o);
1206                            }
1207
1208                        } else {
1209                            $content.css('opacity', '1');
1210                        }
1211
1212                    } else {
1213                        var yPos = Math.abs(scrollPos - (boxPos - winHeight)) * speed * -1;
1214                        $bg.css(wyde.browser.prefix + "transform", "translate3d(0px, " + yPos + "%, 0px)");
1215                    }
1216                }
1217
1218            }
1219
1220            function requestRender() {
1221                if (!isBusy) {
1222                    isBusy = true;
1223                    window.requestAnimationFrame(function () {
1224                        render();
1225                        isBusy = false;
1226                    });
1227                }
1228            }
1229
1230            $win.on("scroll", function () {
1231                requestRender();
1232            });
1233
1234            $(window).smartresize(function () {
1235                winHeight = $win.height();
1236                docHeight = $doc.height();
1237                refresh();
1238            });
1239
1240            refresh();
1241            requestRender();
1242
1243        });
1244
1245    };
1246
1247    /*****************************************
1248    Wyde Scroller
1249    /*****************************************/
1250    function WydeScroller(element, options, callback) {
1251
1252        var defaults = {
1253            height: null,
1254            scrollbar: true
1255        };
1256
1257        var settings = $.extend({}, defaults, options || {});
1258
1259        var $el = $(element);
1260
1261        var maxHeight = settings.height ? settings.height : $el.height();
1262
1263        $el.bind("mousewheel", function () {
1264            return false;
1265        });
1266
1267        $el.wrapInner("<div class=\"w-scroller scroll-loading\"><div class=\"w-wrapper\"><div class=\"w-content-inner\"></div></div></div>");
1268
1269        var $content = $el.find(".w-content-inner");
1270        var hasScroll = $content.outerHeight() > maxHeight;
1271
1272        var $container = $el.find(".w-scroller");
1273        var $scrollbar = $("<div class=\"w-scrollbar\"><div class=\"w-bar\"><div class=\"w-holder\"></div></div>");
1274        $container.append($scrollbar);
1275
1276        if (hasScroll) {
1277            $container.addClass("active");
1278        } else {
1279            $scrollbar.hide();
1280        }
1281
1282        if (!settings.scrollbar) {
1283            $scrollbar.hide();
1284        }
1285
1286        var $wrapper = $el.find(".w-wrapper");        
1287        $wrapper.css("max-height", maxHeight);
1288
1289        $wrapper.sly({
1290            scrollBar: $scrollbar,
1291            easing: "easeOutExpo",
1292            speed: 800,
1293            scrollBy: 120,
1294            syncSpeed: 0.1,
1295            dragHandle: 1,
1296            dynamicHandle: 1,
1297            clickBar: 1,
1298            mouseDragging: 1,
1299            touchDragging: 1,
1300            releaseSwing: 1,
1301            elasticBounds: 1
1302        });
1303
1304        this.refresh = function (height) {
1305
1306            $container.addClass("scroll-loading");
1307            
1308            maxHeight = height ? height : $el.height();
1309
1310            $wrapper.css("max-height", maxHeight);
1311
1312            hasScroll = $content.outerHeight() > maxHeight;
1313
1314            if (hasScroll) {
1315                $container.addClass("active");
1316                if (settings.scrollbar) $scrollbar.show();
1317            } else {
1318                $container.removeClass("active");
1319                $scrollbar.hide();
1320            }
1321
1322            setTimeout(function(){
1323                $wrapper.sly("reload");
1324            }, 500);
1325            
1326
1327            setTimeout(function () {
1328                $container.removeClass("scroll-loading");
1329            }, 1500);
1330        };
1331
1332        this.destroy = function () {
1333            $el.unbind("mousewheel");
1334            $wrapper.sly(false);
1335        };
1336
1337        var self = this;
1338        $(window).smartresize(function () {
1339            self.refresh();
1340        });
1341
1342        setTimeout(function () {
1343            $container.removeClass("scroll-loading");
1344        }, 1500);
1345
1346    }
1347    //jQuery proxy
1348    $.fn.wydeScroller = function (options, callbackMap) {
1349        var method, methodArgs;
1350
1351        // Attributes logic
1352        if (!$.isPlainObject(options)) {
1353            if (typeof options === "string" || options === false) {
1354                method = options === false ? "destroy" : options;
1355                methodArgs = Array.prototype.slice.call(arguments, 1);
1356            }
1357            options = {};
1358        }
1359
1360        // Apply to all elements
1361        return this.each(function (i, element) {
1362            // Call with prevention against multiple instantiations
1363            var plugin = $.data(element, "wydeScroller");
1364
1365            if (!plugin && !method) {
1366                // Create a new object if it doesn't exist yet
1367                plugin = $.data(element, "wydeScroller", new WydeScroller(element, options, callbackMap));
1368            } else if (plugin && method) {
1369                // Call method
1370                if (plugin[method]) {
1371                    plugin[method].apply(plugin, methodArgs);
1372                }
1373            }
1374        });
1375    };
1376
1377    /*****************************************
1378    Vertical Menu
1379    /*****************************************/
1380    function WydeVerticalMenu(element, options, callback) {
1381   
1382
1383        var defaults = {
1384            saveState: false,
1385            changed: function () { }
1386        };
1387
1388        var settings = $.extend({}, defaults, options || {});       
1389
1390        var $el = $(element);
1391        var self = this;
1392
1393        var menuDepth = 0;
1394
1395        this.menuSelected = function(menuItem, depth) {
1396
1397            if(depth) menuDepth = depth;
1398
1399            var $sub = $(menuItem);
1400            var h = $sub.height();
1401            $el.css("height", h);
1402            if (wyde.browser.css3) {
1403                $el.find(".vertical-menu").css(wyde.browser.prefix + "transform", "translateX(" + (-menuDepth * 100) + "%)");
1404            } else {
1405                $el.find(".vertical-menu").animate({ left: -(menuDepth * 100) + "%" }, 300);
1406            }
1407
1408            setTimeout(function () {
1409                settings.changed($el);
1410            }, 300);
1411        }
1412
1413        $el.find(".vertical-menu .sub-menu").each(function () {
1414            var $sub = $(this);
1415            var padTop = $el.offset().top + parseInt($el.css("padding-top"));
1416            $sub.css("top", -parseInt($sub.offset().top) + padTop);
1417        }).each(function () {
1418            $(this).hide();
1419        });
1420
1421        this.refresh = function(){          
1422
1423            $el.find(".vertical-menu ul > li.back-to-parent span").on("click", function (event) {
1424                menuDepth--;
1425                if (menuDepth < 0) menuDepth = 0;
1426                var $sub = $(this).closest(".sub-menu");
1427                $sub.fadeOut(300);
1428                self.menuSelected($sub.closest(".menu-item-has-children").closest("ul"));                
1429                return false;
1430            });
1431
1432            $el.find(".vertical-menu li.menu-item-has-children > a").each(function(){
1433
1434                var $menu = $(this);
1435                var $sub = $menu.parent().find("> ul");               
1436                if ($sub.length > 0) {  
1437
1438                    var $button = $menu.find("> span");
1439
1440                    if( $menu.attr("href") == "#" || ( settings.saveState && this.pathname == window.location.pathname ) ){
1441                        $button = $menu;
1442                    }
1443                    
1444                    $button.on("click", function (event) { 
1445                        event.preventDefault();
1446                        menuDepth++;
1447                        $sub.fadeIn(300);
1448                        self.menuSelected($sub);     
1449                        return false;                                         
1450                    });                                      
1451                }
1452
1453            });                   
1454            
1455            $el.css("height", $el.height());
1456            var delay = 0;            
1457            delay = self.openSubMenu();            
1458
1459            setTimeout(function(){
1460                if( typeof settings.changed == "function" ){
1461                    settings.changed($el);
1462                } 
1463            }, (delay*300+100) );
1464
1465           
1466        };
1467
1468        this.openSubMenu = function(){
1469            // Select sub menu item  
1470            var $selectedItem = $el.find(".current-menu-item");
1471            var $parents = $selectedItem.parents(".current-menu-ancestor");
1472            
1473            menuDepth = $parents.length;               
1474
1475            if( menuDepth > 0 ){
1476                var $sub = $parents.first().find("> ul").first();
1477                $parents.find("> ul").fadeIn(300);
1478                
1479                if( $selectedItem.find("> ul").length ){
1480                    var $subs = $selectedItem.find("> ul");
1481                    $subs.fadeIn(300);
1482                    $sub = $subs.first();
1483                    menuDepth += 1;   
1484                }   
1485
1486                this.menuSelected($sub, menuDepth); 
1487
1488                return menuDepth; 
1489
1490            } 
1491        };
1492
1493        this.refresh();
1494
1495     
1496    };
1497    //jQuery proxy
1498    $.fn.wydeVerticalMenu = function (options, callbackMap) {
1499        var method, methodArgs;
1500
1501        // Attributes logic
1502        if (!$.isPlainObject(options)) {
1503            if (typeof options === "string" || options === false) {
1504                method = options === false ? "destroy" : options;
1505                methodArgs = Array.prototype.slice.call(arguments, 1);
1506            }
1507            options = {};
1508        }
1509
1510        // Apply to all elements
1511        return this.each(function (i, element) {
1512            // Call with prevention against multiple instantiations
1513            var plugin = $.data(element, "wydeVerticalMenu");
1514
1515            if (!plugin && !method) {
1516                // Create a new object if it doesn't exist yet
1517                plugin = $.data(element, "wydeVerticalMenu", new WydeVerticalMenu(element, options, callbackMap));
1518            } else if (plugin && method) {
1519                // Call method
1520                if (plugin[method]) {
1521                    plugin[method].apply(plugin, methodArgs);
1522                }
1523            }
1524        });
1525    };
1526    
1527
1528})(jQuery);

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.