PageSourceSearch

https://www.klo.ua/wp-content/themes/klo/js/common.js

js klo.ua collected 2026-10-02 19:10:01 UTC 41,586 bytes, 1,371 lines download raw bytes

1'use strict';
2
3var BREAKPOINTS = {
4  lg: 1280,
5  md: 992,
6  sm: 768,
7  xs: 320
8};
9
10
11
12$(document).ready(function () {
13  $('.menu-tabs .anchor').tab();
14// 00000
15  const pilih = (s) => document.querySelector(s);
16
17//hide show nav onclick
18
19//hide/show drpdown onclick
20  pilih('.dropdown-toggle').addEventListener('click',(e)=>{
21    e.preventDefault();
22    pilih('.sub-menu').classList.toggle('show-dropdown');
23  });
24// 00000
25  var dropdowns = $(".language-select");
26
27  dropdowns.find(".language-select__current-wrap").click(function(){
28    dropdowns.find(".language-select__list").toggle();
29    // $(this).next().children().toggle();
30
31  });
32
33  dropdowns.find(".language-select__link").click(function(){
34    var leSpan = $(this).parents(".language-select").find(".language-select__current");
35
36    $(this).parents(".language-select").find('.language-select__link').each(function(){
37      $(this).removeClass('selected');
38    });
39
40    leSpan.html($(this).html());
41
42    if($(this).hasClass('default')){
43      leSpan.removeClass('selected')
44    }
45    else{
46      leSpan.addClass('selected');
47      $(this).addClass('selected');
48    }
49
50    $(this).parents(".language-select__list").hide();
51  });
52
53  $(document).bind('click', function(e){
54    if (! $(e.target).parents().hasClass("language-select")) $(".language-select__list").hide();
55  });
56
57
58  $('.select').niceSelect();
59  $(".job-item__head").click(function () {
60    $(this).closest(".job-item").find('.job-item__description').transition("fade", function () {
61    });
62    $(this).closest(".job-item").toggleClass('is-open');
63
64  });
65  $('.js-slider-stock').slick({
66    slidesToShow: 1,
67    arrows: true,
68    dots: false,
69    centerMode: false,
70    variableWidth: true,
71    mobileFirst: false,
72    infinite: true,
73    responsive: [{
74      breakpoint: 1800,
75      settings: {
76        slidesToShow: 4,
77        infinite: true,
78
79      }
80    },
81      {
82        breakpoint: 1190,
83        settings: {
84          slidesToShow: 3,
85          arrows: true,
86
87        }
88      },
89      {
90        breakpoint: 768,
91        settings: {
92          slidesToShow: 3,
93          centerMode: true,
94          arrows: false,
95
96        }
97      },
98      {
99        breakpoint: 480,
100        settings: {
101          slidesToShow: 1,
102          centerMode: true,
103          arrows: false,
104
105        }
106      }
107
108    ]
109  });
110  $('.js-slider').slick({
111    slidesToShow: 1,
112    arrows: false,
113    dots: true,
114    centerMode: true,
115    variableWidth: true,
116    mobileFirst: true,
117    responsive: [
118      {
119        breakpoint: 767,
120        settings: "unslick"
121
122      },
123      {
124        breakpoint: 480,
125        settings: {}
126      }
127
128    ]
129  });
130  $('.js-general-slider').slick({
131    slidesToScroll: 1,
132    arrows: false,
133    dots: false,
134    // vertical: true,
135    fade: true,
136    adaptiveHeight: true,
137    verticalSwiping: true,
138    mobileFirst: true,
139    autoplay: true,
140    autoplaySpeed: 5000,
141    responsive: [
142      {
143        breakpoint: 1200,
144        settings: {
145          dots: true,
146
147        }
148      },
149      {
150        breakpoint: 480,
151
152      }
153
154    ]
155  });
156  $('.js-slider-about').slick({
157    slidesToShow: 1,
158    arrows: false,
159    variableWidth: true,
160    mobileFirst: true,
161    infinite: false,
162
163    responsive: [{
164      breakpoint: 1024,
165      settings: {
166        arrows: true,
167
168      }
169    }
170
171    ]
172  });
173  $('.js-stock-slider-1').slick({
174    slidesToShow: 1,
175    slidesToScroll: 1,
176    arrows: false,
177    dots: false,
178    centerMode: true,
179    focusOnSelect: true,
180    mobileFirst: true,
181    swipeToSlide: true,
182
183    responsive: [{
184      breakpoint: 1024,
185      settings: "unslick"
186
187    },
188      {
189        breakpoint: 600,
190        settings: {
191          slidesToShow: 2,
192          slidesToScroll: 1
193        }
194      },
195      {
196        breakpoint: 330,
197        settings: {
198          slidesToShow: 1,
199          slidesToScroll: 1
200        }
201      }
202
203    ]
204  });
205
206  $('.btn-close-menu').click(function () {
207    $('.header').removeClass('is-open');
208    $(this).closest("body").removeClass('js-block-scroll');
209  });
210  $('.button-open-search').click(function () {
211    $(this).closest(".header").find('.search').toggleClass('is-open');
212  });
213
214  $('.btn-menu').click(function () {
215    $('.header').addClass('is-open');
216  });
217  $(function ($) {
218    $(document).mouseup(function (e) {
219      var block = $(".search");
220      if (!block.is(e.target)
221          && block.has(e.target).length === 0) {
222        $('.search').removeClass('is-open');
223      }
224    });
225  });
226  $(".anchor").on('click', function () {
227    var elementClick = $(this).attr("href")
228    var destination = $(elementClick).offset().top - 20;
229    $("html:not(:animated),body:not(:animated)").animate({scrollTop: destination}, 800);
230    return false;
231  });
232  // $('.js-title-cut').ellipsis({
233  // 	lines: 3,
234  // 	ellipClass: 'ellip',
235  // 	responsive: true
236  // });
237  // $('.js-title-cut-third').ellipsis({
238  // 	lines: 2,
239  // 	ellipClass: 'ellip',
240  // 	responsive: true
241  // });
242
243  $(".btn-more").click(function () {
244    $(this).closest(".js-projects-list").addClass('show-all');
245  });
246
247
248  $(".js-category-title").click(function () {
249    $(this).closest(".js-category-wrap").toggleClass('is-open');
250  });
251  $(".btn-menu").click(function () {
252    $(this).closest(".header").toggleClass('open');
253    $(this).closest("body").toggleClass('js-block-scroll');
254  });
255
256  $(".dropdown-menu").click(function () {
257    $(this).toggleClass('is-open');
258  });
259  // $('.dropdown').dropdown();
260
261
262  $('.js-open-popup').magnificPopup({
263    type: 'inline',
264    preloader: false
265  });
266  $('[data-fancybox^="gallery"]').fancybox({
267    loop: true,
268    gutter: 10,
269    keyboard: true,
270    arrows: true,
271    smallBtn: true,
272    toolbar: true,
273
274    thumbs: {
275      autoStart: false
276    },
277    helpers: {
278      title: {
279        type: 'inside'
280      }
281    },
282    buttons: [
283      'slideShow',
284      'fullScreen',
285      "thumbs",
286      'close'
287    ]
288  });
289  $(window).scroll(function () {
290    if ($(this).scrollTop() > 400) {
291      $('.to-top').fadeIn();
292    } else {
293      $('.to-top').fadeOut();
294    }
295  });
296
297  $('.to-top').click(function () {
298    $("html, body").animate({
299      scrollTop: 0
300    }, 400);
301    return false;
302  });
303});
304
305$(window).resize(function () {
306});
307$(window).on('resize orientationchange', function () {
308  $('.js-general-slider').slick('resize');
309});
310
311
312var pageOverlay = new (function() {
313  this.elSelector = '.el-page-overlay';
314	this.$el = $(this.elSelector);
315
316  this.init = function($newOverlay) {
317    var _overlay = this;
318
319    $(document).on('click', _overlay.elSelector, function() {
320      _overlay.close();
321    });
322  },
323
324	this.open = function($toEl) {
325    var $parent = $toEl.parent();
326    var $_overlay = $parent.find(this.elSelector);
327
328    if (!$_overlay.length) {
329      $_overlay = this.$el.clone()
330        .css('zIndex', $toEl.css('zIndex') - 1);
331
332      $parent.append($_overlay);
333      this.init($_overlay);
334    };
335
336    $('body').addClass('disabled-scroll');
337    $_overlay.addClass('open');
338	},
339
340	this.close = function() {
341    // this.onClose();
342		$(this.elSelector).removeClass('open');
343    $('body').removeClass('disabled-scroll');
344	}
345})();
346
347
348var formOverlayLoader = new (function() {
349  this.elSelector = '.el-form-loader';
350	this.$el = $(this.elSelector);
351
352	this.open = function($toEl) {
353    var $_overlay = $toEl.find(this.elSelector);
354    var toElPosition = $toEl.css('position') || null;
355
356    if ((!toElPosition) || (toElPosition == 'static')) {
357      $toEl.css('position', 'relative');
358    }
359
360    if (!$_overlay.length) {
361      $_overlay = this.$el.clone();
362
363      $toEl.append($_overlay);
364
365      $_overlay = $toEl.find(this.elSelector);
366      $_overlay.css('zIndex', getSiblingsMaxIndex($_overlay));
367    };
368
369    $_overlay.addClass('open');
370	},
371
372	this.close = function() {
373		$(this.elSelector).removeClass('open');
374	}
375})();
376
377
378// dropdown
379// https://github.com/Semantic-Org/Semantic-UI
380//-----------------------------------------------------------------------------------
381function Dropdown($el, options) {
382  this.$el = $el;
383  this.options = options || {};
384  this.config = $.extend({}, this.defaults, this.options);
385};
386
387Dropdown.prototype = {
388  defaults: {
389    transition: 'fade down'
390  },
391
392  init: function() {
393    var _this = this;
394
395    this.$el.dropdown( $.extend({}, _this.config, {
396      onChange: function(value, text, $choice) {
397        var $dropdown = $(this);
398
399        _this.inputValid($dropdown)
400      },
401      onHide: function() {
402        var $dropdown = $(this);
403        _this.inputValid($dropdown);
404      }
405    }) );
406  },
407
408  inputValid: function($dropdown) {
409    var $input = $dropdown.find('.js-select-val');
410
411    if ($input.length && !$dropdown.hasClass('mod-validate-disabled')) {
412      $input.valid();
413    }
414  }
415};
416
417// var select = new Dropdown($('.js-select'));
418// select.init();
419
420/*!
421 * # Semantic UI 2.4.2
vendor: 32,762 bytes, lines 421-1371
421 - Tab
422 * http://github.com/semantic-org/semantic-ui/
423 *
424 *
425 * Released under the MIT license
426 * http://opensource.org/licenses/MIT
427 *
428 */
429
430;(function ($, window, document, undefined) {
431
432'use strict';
433
434window = (typeof window != 'undefined' && window.Math == Math)
435  ? window
436  : (typeof self != 'undefined' && self.Math == Math)
437    ? self
438    : Function('return this')()
439;
440
441$.fn.tab = function(parameters) {
442
443  var
444    // use window context if none specified
445    $allModules     = $.isFunction(this)
446        ? $(window)
447        : $(this),
448
449    moduleSelector  = $allModules.selector || '',
450    time            = new Date().getTime(),
451    performance     = [],
452
453    query           = arguments[0],
454    methodInvoked   = (typeof query == 'string'),
455    queryArguments  = [].slice.call(arguments, 1),
456
457    initializedHistory = false,
458    returnedValue
459  ;
460
461  $allModules
462    .each(function() {
463      var
464
465        settings        = ( $.isPlainObject(parameters) )
466          ? $.extend(true, {}, $.fn.tab.settings, parameters)
467          : $.extend({}, $.fn.tab.settings),
468
469        className       = settings.className,
470        metadata        = settings.metadata,
471        selector        = settings.selector,
472        error           = settings.error,
473
474        eventNamespace  = '.' + settings.namespace,
475        moduleNamespace = 'module-' + settings.namespace,
476
477        $module         = $(this),
478        $context,
479        $tabs,
480
481        cache           = {},
482        firstLoad       = true,
483        recursionDepth  = 0,
484        element         = this,
485        instance        = $module.data(moduleNamespace),
486
487        activeTabPath,
488        parameterArray,
489        module,
490
491        historyEvent
492
493      ;
494
495      module = {
496
497        initialize: function() {
498          module.debug('Initializing tab menu item', $module);
499          module.fix.callbacks();
500          module.determineTabs();
501
502          module.debug('Determining tabs', settings.context, $tabs);
503          // set up automatic routing
504          if(settings.auto) {
505            module.set.auto();
506          }
507          module.bind.events();
508
509          if(settings.history && !initializedHistory) {
510            module.initializeHistory();
511            initializedHistory = true;
512          }
513
514          module.instantiate();
515        },
516
517        instantiate: function () {
518          module.verbose('Storing instance of module', module);
519          instance = module;
520          $module
521            .data(moduleNamespace, module)
522          ;
523        },
524
525        destroy: function() {
526          module.debug('Destroying tabs', $module);
527          $module
528            .removeData(moduleNamespace)
529            .off(eventNamespace)
530          ;
531        },
532
533        bind: {
534          events: function() {
535            // if using $.tab don't add events
536            if( !$.isWindow( element ) ) {
537              module.debug('Attaching tab activation events to element', $module);
538              $module
539                .on('click' + eventNamespace, module.event.click)
540              ;
541            }
542          }
543        },
544
545        determineTabs: function() {
546          var
547            $reference
548          ;
549
550          // determine tab context
551          if(settings.context === 'parent') {
552            if($module.closest(selector.ui).length > 0) {
553              $reference = $module.closest(selector.ui);
554              module.verbose('Using closest UI element as parent', $reference);
555            }
556            else {
557              $reference = $module;
558            }
559            $context = $reference.parent();
560            module.verbose('Determined parent element for creating context', $context);
561          }
562          else if(settings.context) {
563            $context = $(settings.context);
564            module.verbose('Using selector for tab context', settings.context, $context);
565          }
566          else {
567            $context = $('body');
568          }
569          // find tabs
570          if(settings.childrenOnly) {
571            $tabs = $context.children(selector.tabs);
572            module.debug('Searching tab context children for tabs', $context, $tabs);
573          }
574          else {
575            $tabs = $context.find(selector.tabs);
576            module.debug('Searching tab context for tabs', $context, $tabs);
577          }
578        },
579
580        fix: {
581          callbacks: function() {
582            if( $.isPlainObject(parameters) && (parameters.onTabLoad || parameters.onTabInit) ) {
583              if(parameters.onTabLoad) {
584                parameters.onLoad = parameters.onTabLoad;
585                delete parameters.onTabLoad;
586                module.error(error.legacyLoad, parameters.onLoad);
587              }
588              if(parameters.onTabInit) {
589                parameters.onFirstLoad = parameters.onTabInit;
590                delete parameters.onTabInit;
591                module.error(error.legacyInit, parameters.onFirstLoad);
592              }
593              settings = $.extend(true, {}, $.fn.tab.settings, parameters);
594            }
595          }
596        },
597
598        initializeHistory: function() {
599          module.debug('Initializing page state');
600          if( $.address === undefined ) {
601            module.error(error.state);
602            return false;
603          }
604          else {
605            if(settings.historyType == 'state') {
606              module.debug('Using HTML5 to manage state');
607              if(settings.path !== false) {
608                $.address
609                  .history(true)
610                  .state(settings.path)
611                ;
612              }
613              else {
614                module.error(error.path);
615                return false;
616              }
617            }
618            $.address
619              .bind('change', module.event.history.change)
620            ;
621          }
622        },
623
624        event: {
625          click: function(event) {
626            var
627              tabPath = $(this).data(metadata.tab)
628            ;
629            if(tabPath !== undefined) {
630              if(settings.history) {
631                module.verbose('Updating page state', event);
632                $.address.value(tabPath);
633              }
634              else {
635                module.verbose('Changing tab', event);
636                module.changeTab(tabPath);
637              }
638              event.preventDefault();
639            }
640            else {
641              module.debug('No tab specified');
642            }
643          },
644          history: {
645            change: function(event) {
646              var
647                tabPath   = event.pathNames.join('/') || module.get.initialPath(),
648                pageTitle = settings.templates.determineTitle(tabPath) || false
649              ;
650              module.performance.display();
651              module.debug('History change event', tabPath, event);
652              historyEvent = event;
653              if(tabPath !== undefined) {
654                module.changeTab(tabPath);
655              }
656              if(pageTitle) {
657                $.address.title(pageTitle);
658              }
659            }
660          }
661        },
662
663        refresh: function() {
664          if(activeTabPath) {
665            module.debug('Refreshing tab', activeTabPath);
666            module.changeTab(activeTabPath);
667          }
668        },
669
670        cache: {
671
672          read: function(cacheKey) {
673            return (cacheKey !== undefined)
674              ? cache[cacheKey]
675              : false
676            ;
677          },
678          add: function(cacheKey, content) {
679            cacheKey = cacheKey || activeTabPath;
680            module.debug('Adding cached content for', cacheKey);
681            cache[cacheKey] = content;
682          },
683          remove: function(cacheKey) {
684            cacheKey = cacheKey || activeTabPath;
685            module.debug('Removing cached content for', cacheKey);
686            delete cache[cacheKey];
687          }
688        },
689
690        set: {
691          auto: function() {
692            var
693              url = (typeof settings.path == 'string')
694                ? settings.path.replace(/\/$/, '') + '/{$tab}'
695                : '/{$tab}'
696            ;
697            module.verbose('Setting up automatic tab retrieval from server', url);
698            if($.isPlainObject(settings.apiSettings)) {
699              settings.apiSettings.url = url;
700            }
701            else {
702              settings.apiSettings = {
703                url: url
704              };
705            }
706          },
707          loading: function(tabPath) {
708            var
709              $tab      = module.get.tabElement(tabPath),
710              isLoading = $tab.hasClass(className.loading)
711            ;
712            if(!isLoading) {
713              module.verbose('Setting loading state for', $tab);
714              $tab
715                .addClass(className.loading)
716                .siblings($tabs)
717                  .removeClass(className.active + ' ' + className.loading)
718              ;
719              if($tab.length > 0) {
720                settings.onRequest.call($tab[0], tabPath);
721              }
722            }
723          },
724          state: function(state) {
725            $.address.value(state);
726          }
727        },
728
729        changeTab: function(tabPath) {
730          var
731            pushStateAvailable = (window.history && window.history.pushState),
732            shouldIgnoreLoad   = (pushStateAvailable && settings.ignoreFirstLoad && firstLoad),
733            remoteContent      = (settings.auto || $.isPlainObject(settings.apiSettings) ),
734            // only add default path if not remote content
735            pathArray = (remoteContent && !shouldIgnoreLoad)
736              ? module.utilities.pathToArray(tabPath)
737              : module.get.defaultPathArray(tabPath)
738          ;
739          tabPath = module.utilities.arrayToPath(pathArray);
740          $.each(pathArray, function(index, tab) {
741            var
742              currentPathArray   = pathArray.slice(0, index + 1),
743              currentPath        = module.utilities.arrayToPath(currentPathArray),
744
745              isTab              = module.is.tab(currentPath),
746              isLastIndex        = (index + 1 == pathArray.length),
747
748              $tab               = module.get.tabElement(currentPath),
749              $anchor,
750              nextPathArray,
751              nextPath,
752              isLastTab
753            ;
754            module.verbose('Looking for tab', tab);
755            if(isTab) {
756              module.verbose('Tab was found', tab);
757              // scope up
758              activeTabPath  = currentPath;
759              parameterArray = module.utilities.filterArray(pathArray, currentPathArray);
760
761              if(isLastIndex) {
762                isLastTab = true;
763              }
764              else {
765                nextPathArray = pathArray.slice(0, index + 2);
766                nextPath      = module.utilities.arrayToPath(nextPathArray);
767                isLastTab     = ( !module.is.tab(nextPath) );
768                if(isLastTab) {
769                  module.verbose('Tab parameters found', nextPathArray);
770                }
771              }
772              if(isLastTab && remoteContent) {
773                if(!shouldIgnoreLoad) {
774                  module.activate.navigation(currentPath);
775                  module.fetch.content(currentPath, tabPath);
776                }
777                else {
778                  module.debug('Ignoring remote content on first tab load', currentPath);
779                  firstLoad = false;
780                  module.cache.add(tabPath, $tab.html());
781                  module.activate.all(currentPath);
782                  settings.onFirstLoad.call($tab[0], currentPath, parameterArray, historyEvent);
783                  settings.onLoad.call($tab[0], currentPath, parameterArray, historyEvent);
784                }
785                return false;
786              }
787              else {
788                module.debug('Opened local tab', currentPath);
789                module.activate.all(currentPath);
790                if( !module.cache.read(currentPath) ) {
791                  module.cache.add(currentPath, true);
792                  module.debug('First time tab loaded calling tab init');
793                  settings.onFirstLoad.call($tab[0], currentPath, parameterArray, historyEvent);
794                }
795                settings.onLoad.call($tab[0], currentPath, parameterArray, historyEvent);
796              }
797
798            }
799            else if(tabPath.search('/') == -1 && tabPath !== '') {
800              // look for in page anchor
801              $anchor     = $('#' + tabPath + ', a[name="' + tabPath + '"]');
802              currentPath = $anchor.closest('[data-tab]').data(metadata.tab);
803              $tab        = module.get.tabElement(currentPath);
804              // if anchor exists use parent tab
805              if($anchor && $anchor.length > 0 && currentPath) {
806                module.debug('Anchor link used, opening parent tab', $tab, $anchor);
807                if( !$tab.hasClass(className.active) ) {
808                  setTimeout(function() {
809                    module.scrollTo($anchor);
810                  }, 0);
811                }
812                module.activate.all(currentPath);
813                if( !module.cache.read(currentPath) ) {
814                  module.cache.add(currentPath, true);
815                  module.debug('First time tab loaded calling tab init');
816                  settings.onFirstLoad.call($tab[0], currentPath, parameterArray, historyEvent);
817                }
818                settings.onLoad.call($tab[0], currentPath, parameterArray, historyEvent);
819                return false;
820              }
821            }
822            else {
823              module.error(error.missingTab, $module, $context, currentPath);
824              return false;
825            }
826          });
827        },
828
829        scrollTo: function($element) {
830          var
831            scrollOffset = ($element && $element.length > 0)
832              ? $element.offset().top
833              : false
834          ;
835          if(scrollOffset !== false) {
836            module.debug('Forcing scroll to an in-page link in a hidden tab', scrollOffset, $element);
837            $(document).scrollTop(scrollOffset);
838          }
839        },
840
841        update: {
842          content: function(tabPath, html, evaluateScripts) {
843            var
844              $tab = module.get.tabElement(tabPath),
845              tab  = $tab[0]
846            ;
847            evaluateScripts = (evaluateScripts !== undefined)
848              ? evaluateScripts
849              : settings.evaluateScripts
850            ;
851            if(typeof settings.cacheType == 'string' && settings.cacheType.toLowerCase() == 'dom' && typeof html !== 'string') {
852              $tab
853                .empty()
854                .append($(html).clone(true))
855              ;
856            }
857            else {
858              if(evaluateScripts) {
859                module.debug('Updating HTML and evaluating inline scripts', tabPath, html);
860                $tab.html(html);
861              }
862              else {
863                module.debug('Updating HTML', tabPath, html);
864                tab.innerHTML = html;
865              }
866            }
867          }
868        },
869
870        fetch: {
871
872          content: function(tabPath, fullTabPath) {
873            var
874              $tab        = module.get.tabElement(tabPath),
875              apiSettings = {
876                dataType         : 'html',
877                encodeParameters : false,
878                on               : 'now',
879                cache            : settings.alwaysRefresh,
880                headers          : {
881                  'X-Remote': true
882                },
883                onSuccess : function(response) {
884                  if(settings.cacheType == 'response') {
885                    module.cache.add(fullTabPath, response);
886                  }
887                  module.update.content(tabPath, response);
888                  if(tabPath == activeTabPath) {
889                    module.debug('Content loaded', tabPath);
890                    module.activate.tab(tabPath);
891                  }
892                  else {
893                    module.debug('Content loaded in background', tabPath);
894                  }
895                  settings.onFirstLoad.call($tab[0], tabPath, parameterArray, historyEvent);
896                  settings.onLoad.call($tab[0], tabPath, parameterArray, historyEvent);
897
898                  if(settings.loadOnce) {
899                    module.cache.add(fullTabPath, true);
900                  }
901                  else if(typeof settings.cacheType == 'string' && settings.cacheType.toLowerCase() == 'dom' && $tab.children().length > 0) {
902                    setTimeout(function() {
903                      var
904                        $clone = $tab.children().clone(true)
905                      ;
906                      $clone = $clone.not('script');
907                      module.cache.add(fullTabPath, $clone);
908                    }, 0);
909                  }
910                  else {
911                    module.cache.add(fullTabPath, $tab.html());
912                  }
913                },
914                urlData: {
915                  tab: fullTabPath
916                }
917              },
918              request         = $tab.api('get request') || false,
919              existingRequest = ( request && request.state() === 'pending' ),
920              requestSettings,
921              cachedContent
922            ;
923
924            fullTabPath   = fullTabPath || tabPath;
925            cachedContent = module.cache.read(fullTabPath);
926
927
928            if(settings.cache && cachedContent) {
929              module.activate.tab(tabPath);
930              module.debug('Adding cached content', fullTabPath);
931              if(!settings.loadOnce) {
932                if(settings.evaluateScripts == 'once') {
933                  module.update.content(tabPath, cachedContent, false);
934                }
935                else {
936                  module.update.content(tabPath, cachedContent);
937                }
938              }
939              settings.onLoad.call($tab[0], tabPath, parameterArray, historyEvent);
940            }
941            else if(existingRequest) {
942              module.set.loading(tabPath);
943              module.debug('Content is already loading', fullTabPath);
944            }
945            else if($.api !== undefined) {
946              requestSettings = $.extend(true, {}, settings.apiSettings, apiSettings);
947              module.debug('Retrieving remote content', fullTabPath, requestSettings);
948              module.set.loading(tabPath);
949              $tab.api(requestSettings);
950            }
951            else {
952              module.error(error.api);
953            }
954          }
955        },
956
957        activate: {
958          all: function(tabPath) {
959            module.activate.tab(tabPath);
960            module.activate.navigation(tabPath);
961          },
962          tab: function(tabPath) {
963            var
964              $tab          = module.get.tabElement(tabPath),
965              $deactiveTabs = (settings.deactivate == 'siblings')
966                ? $tab.siblings($tabs)
967                : $tabs.not($tab),
968              isActive      = $tab.hasClass(className.active)
969            ;
970            module.verbose('Showing tab content for', $tab);
971            if(!isActive) {
972              $tab
973                .addClass(className.active)
974              ;
975              $deactiveTabs
976                .removeClass(className.active + ' ' + className.loading)
977              ;
978              if($tab.length > 0) {
979                settings.onVisible.call($tab[0], tabPath);
980              }
981            }
982          },
983          navigation: function(tabPath) {
984            var
985              $navigation         = module.get.navElement(tabPath),
986              $deactiveNavigation = (settings.deactivate == 'siblings')
987                ? $navigation.siblings($allModules)
988                : $allModules.not($navigation),
989              isActive    = $navigation.hasClass(className.active)
990            ;
991            module.verbose('Activating tab navigation for', $navigation, tabPath);
992            if(!isActive) {
993              $navigation
994                .addClass(className.active)
995              ;
996              $deactiveNavigation
997                .removeClass(className.active + ' ' + className.loading)
998              ;
999            }
1000          }
1001        },
1002
1003        deactivate: {
1004          all: function() {
1005            module.deactivate.navigation();
1006            module.deactivate.tabs();
1007          },
1008          navigation: function() {
1009            $allModules
1010              .removeClass(className.active)
1011            ;
1012          },
1013          tabs: function() {
1014            $tabs
1015              .removeClass(className.active + ' ' + className.loading)
1016            ;
1017          }
1018        },
1019
1020        is: {
1021          tab: function(tabName) {
1022            return (tabName !== undefined)
1023              ? ( module.get.tabElement(tabName).length > 0 )
1024              : false
1025            ;
1026          }
1027        },
1028
1029        get: {
1030          initialPath: function() {
1031            return $allModules.eq(0).data(metadata.tab) || $tabs.eq(0).data(metadata.tab);
1032          },
1033          path: function() {
1034            return $.address.value();
1035          },
1036          // adds default tabs to tab path
1037          defaultPathArray: function(tabPath) {
1038            return module.utilities.pathToArray( module.get.defaultPath(tabPath) );
1039          },
1040          defaultPath: function(tabPath) {
1041            var
1042              $defaultNav = $allModules.filter('[data-' + metadata.tab + '^="' + tabPath + '/"]').eq(0),
1043              defaultTab  = $defaultNav.data(metadata.tab) || false
1044            ;
1045            if( defaultTab ) {
1046              module.debug('Found default tab', defaultTab);
1047              if(recursionDepth < settings.maxDepth) {
1048                recursionDepth++;
1049                return module.get.defaultPath(defaultTab);
1050              }
1051              module.error(error.recursion);
1052            }
1053            else {
1054              module.debug('No default tabs found for', tabPath, $tabs);
1055            }
1056            recursionDepth = 0;
1057            return tabPath;
1058          },
1059          navElement: function(tabPath) {
1060            tabPath = tabPath || activeTabPath;
1061            return $allModules.filter('[data-' + metadata.tab + '="' + tabPath + '"]');
1062          },
1063          tabElement: function(tabPath) {
1064            var
1065              $fullPathTab,
1066              $simplePathTab,
1067              tabPathArray,
1068              lastTab
1069            ;
1070            tabPath        = tabPath || activeTabPath;
1071            tabPathArray   = module.utilities.pathToArray(tabPath);
1072            lastTab        = module.utilities.last(tabPathArray);
1073            $fullPathTab   = $tabs.filter('[data-' + metadata.tab + '="' + tabPath + '"]');
1074            $simplePathTab = $tabs.filter('[data-' + metadata.tab + '="' + lastTab + '"]');
1075            return ($fullPathTab.length > 0)
1076              ? $fullPathTab
1077              : $simplePathTab
1078            ;
1079          },
1080          tab: function() {
1081            return activeTabPath;
1082          }
1083        },
1084
1085        utilities: {
1086          filterArray: function(keepArray, removeArray) {
1087            return $.grep(keepArray, function(keepValue) {
1088              return ( $.inArray(keepValue, removeArray) == -1);
1089            });
1090          },
1091          last: function(array) {
1092            return $.isArray(array)
1093              ? array[ array.length - 1]
1094              : false
1095            ;
1096          },
1097          pathToArray: function(pathName) {
1098            if(pathName === undefined) {
1099              pathName = activeTabPath;
1100            }
1101            return typeof pathName == 'string'
1102              ? pathName.split('/')
1103              : [pathName]
1104            ;
1105          },
1106          arrayToPath: function(pathArray) {
1107            return $.isArray(pathArray)
1108              ? pathArray.join('/')
1109              : false
1110            ;
1111          }
1112        },
1113
1114        setting: function(name, value) {
1115          module.debug('Changing setting', name, value);
1116          if( $.isPlainObject(name) ) {
1117            $.extend(true, settings, name);
1118          }
1119          else if(value !== undefined) {
1120            if($.isPlainObject(settings[name])) {
1121              $.extend(true, settings[name], value);
1122            }
1123            else {
1124              settings[name] = value;
1125            }
1126          }
1127          else {
1128            return settings[name];
1129          }
1130        },
1131        internal: function(name, value) {
1132          if( $.isPlainObject(name) ) {
1133            $.extend(true, module, name);
1134          }
1135          else if(value !== undefined) {
1136            module[name] = value;
1137          }
1138          else {
1139            return module[name];
1140          }
1141        },
1142        debug: function() {
1143          if(!settings.silent && settings.debug) {
1144            if(settings.performance) {
1145              module.performance.log(arguments);
1146            }
1147            else {
1148              module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
1149              module.debug.apply(console, arguments);
1150            }
1151          }
1152        },
1153        verbose: function() {
1154          if(!settings.silent && settings.verbose && settings.debug) {
1155            if(settings.performance) {
1156              module.performance.log(arguments);
1157            }
1158            else {
1159              module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
1160              module.verbose.apply(console, arguments);
1161            }
1162          }
1163        },
1164        error: function() {
1165          if(!settings.silent) {
1166            module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
1167            module.error.apply(console, arguments);
1168          }
1169        },
1170        performance: {
1171          log: function(message) {
1172            var
1173              currentTime,
1174              executionTime,
1175              previousTime
1176            ;
1177            if(settings.performance) {
1178              currentTime   = new Date().getTime();
1179              previousTime  = time || currentTime;
1180              executionTime = currentTime - previousTime;
1181              time          = currentTime;
1182              performance.push({
1183                'Name'           : message[0],
1184                'Arguments'      : [].slice.call(message, 1) || '',
1185                'Element'        : element,
1186                'Execution Time' : executionTime
1187              });
1188            }
1189            clearTimeout(module.performance.timer);
1190            module.performance.timer = setTimeout(module.performance.display, 500);
1191          },
1192          display: function() {
1193            var
1194              title = settings.name + ':',
1195              totalTime = 0
1196            ;
1197            time = false;
1198            clearTimeout(module.performance.timer);
1199            $.each(performance, function(index, data) {
1200              totalTime += data['Execution Time'];
1201            });
1202            title += ' ' + totalTime + 'ms';
1203            if(moduleSelector) {
1204              title += ' \'' + moduleSelector + '\'';
1205            }
1206            if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
1207              console.groupCollapsed(title);
1208              if(console.table) {
1209                console.table(performance);
1210              }
1211              else {
1212                $.each(performance, function(index, data) {
1213                  console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
1214                });
1215              }
1216              console.groupEnd();
1217            }
1218            performance = [];
1219          }
1220        },
1221        invoke: function(query, passedArguments, context) {
1222          var
1223            object = instance,
1224            maxDepth,
1225            found,
1226            response
1227          ;
1228          passedArguments = passedArguments || queryArguments;
1229          context         = element         || context;
1230          if(typeof query == 'string' && object !== undefined) {
1231            query    = query.split(/[\. ]/);
1232            maxDepth = query.length - 1;
1233            $.each(query, function(depth, value) {
1234              var camelCaseValue = (depth != maxDepth)
1235                ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
1236                : query
1237              ;
1238              if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) {
1239                object = object[camelCaseValue];
1240              }
1241              else if( object[camelCaseValue] !== undefined ) {
1242                found = object[camelCaseValue];
1243                return false;
1244              }
1245              else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) {
1246                object = object[value];
1247              }
1248              else if( object[value] !== undefined ) {
1249                found = object[value];
1250                return false;
1251              }
1252              else {
1253                module.error(error.method, query);
1254                return false;
1255              }
1256            });
1257          }
1258          if ( $.isFunction( found ) ) {
1259            response = found.apply(context, passedArguments);
1260          }
1261          else if(found !== undefined) {
1262            response = found;
1263          }
1264          if($.isArray(returnedValue)) {
1265            returnedValue.push(response);
1266          }
1267          else if(returnedValue !== undefined) {
1268            returnedValue = [returnedValue, response];
1269          }
1270          else if(response !== undefined) {
1271            returnedValue = response;
1272          }
1273          return found;
1274        }
1275      };
1276      if(methodInvoked) {
1277        if(instance === undefined) {
1278          module.initialize();
1279        }
1280        module.invoke(query);
1281      }
1282      else {
1283        if(instance !== undefined) {
1284          instance.invoke('destroy');
1285        }
1286        module.initialize();
1287      }
1288    })
1289  ;
1290  return (returnedValue !== undefined)
1291    ? returnedValue
1292    : this
1293  ;
1294
1295};
1296
1297// shortcut for tabbed content with no defined navigation
1298$.tab = function() {
1299  $(window).tab.apply(this, arguments);
1300};
1301
1302$.fn.tab.settings = {
1303
1304  name            : 'Tab',
1305  namespace       : 'tab',
1306
1307  silent          : false,
1308  debug           : false,
1309  verbose         : false,
1310  performance     : true,
1311
1312  auto            : false,      // uses pjax style endpoints fetching content from same url with remote-content headers
1313  history         : false,      // use browser history
1314  historyType     : 'hash',     // #/ or html5 state
1315  path            : false,      // base path of url
1316
1317  context         : false,      // specify a context that tabs must appear inside
1318  childrenOnly    : false,      // use only tabs that are children of context
1319  maxDepth        : 25,         // max depth a tab can be nested
1320
1321  deactivate      : 'siblings', // whether tabs should deactivate sibling menu elements or all elements initialized together
1322
1323  alwaysRefresh   : false,      // load tab content new every tab click
1324  cache           : true,       // cache the content requests to pull locally
1325  loadOnce        : false,      // Whether tab data should only be loaded once when using remote content
1326  cacheType       : 'response', // Whether to cache exact response, or to html cache contents after scripts execute
1327  ignoreFirstLoad : false,      // don't load remote content on first load
1328
1329  apiSettings     : false,      // settings for api call
1330  evaluateScripts : 'once',     // whether inline scripts should be parsed (true/false/once). Once will not re-evaluate on cached content
1331
1332  onFirstLoad : function(tabPath, parameterArray, historyEvent) {}, // called first time loaded
1333  onLoad      : function(tabPath, parameterArray, historyEvent) {}, // called on every load
1334  onVisible   : function(tabPath, parameterArray, historyEvent) {}, // called every time tab visible
1335  onRequest   : function(tabPath, parameterArray, historyEvent) {}, // called ever time a tab beings loading remote content
1336
1337  templates : {
1338    determineTitle: function(tabArray) {} // returns page title for path
1339  },
1340
1341  error: {
1342    api        : 'You attempted to load content without API module',
1343    method     : 'The method you called is not defined',
1344    missingTab : 'Activated tab cannot be found. Tabs are case-sensitive.',
1345    noContent  : 'The tab you specified is missing a content url.',
1346    path       : 'History enabled, but no path was specified',
1347    recursion  : 'Max recursive depth reached',
1348    legacyInit : 'onTabInit has been renamed to onFirstLoad in 2.0, please adjust your code.',
1349    legacyLoad : 'onTabLoad has been renamed to onLoad in 2.0. Please adjust your code',
1350    state      : 'History requires Asual\'s Address library <https://github.com/asual/jquery-address>'
1351  },
1352
1353  metadata : {
1354    tab    : 'tab',
1355    loaded : 'loaded',
1356    promise: 'promise'
1357  },
1358
1359  className   : {
1360    loading : 'loading',
1361    active  : 'active'
1362  },
1363
1364  selector    : {
1365    tabs : '.ui.tab',
1366    ui   : '.ui'
1367  }
1368
1369};
1370
1371}
vendor: 31 bytes, line 1371
1371)( 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.