PageSourceSearch

https://techsposanfrancisco.com/wp-content/themes/Impreza/js/us.widgets.js

js techsposanfrancisco.com collected 2026-10-04 10:20:27 UTC 16,644 bytes, 455 lines download raw bytes

1/* G-Alert */
2(function ($) {
3    "use strict";
4
5    $.fn.gAlert = function () {
6
7        return this.each(function () {
8            var alert = $(this),
9                alertClose = alert.find('.g-alert-close');
10
11            if (alertClose) {
12                alertClose.click(function(){
13                    alert.animate({ height: '0', margin: 0}, 400, function(){
14                        alert.css('display', 'none');
15                    });
16                });
17            }
18        });
19    };
20})(jQuery);
21
22jQuery(document).ready(function() {
23    "use strict";
24
25    jQuery('.g-alert').gAlert();
26});
27
28/* W-Lang */
29(function ($) {
30    "use strict";
31
32    $.fn.wLang = function () {
33
34        return this.each(function () {
35            var langList = $(this).find('.w-lang-list'),
36                currentLang = $(this).find('.w-lang-current'),
37                that = this,
38                langListHeight = langList.height();
39
40            langList.css({height: 0, display: 'none'});
41
42
43            currentLang.click(function() {
44                currentLang.addClass('active');
45                langList.css({display: 'block'});
46                langList.animate({height: langListHeight}, 200);
47            });
48
49            $(document).mouseup(function (e)
50            {
51                if ($(that).has(e.target).length === 0)
52                {
53                    langList.animate({height: 0}, 200, function() {
54                        langList.css({display: 'none'});
55                        currentLang.removeClass('active');
56
57                    });
58                }
59            });
60        });
61    };
62})(jQuery);
63
64jQuery(document).ready(function() {
65    "use strict";
66
67    jQuery('.w-lang').wLang();
68});
69
70/* W-Search */
71(function ($) {
72    "use strict";
73
74    $.fn.wSearch = function () {
75
76
77        return this.each(function () {
78            var searchForm = $(this).find('.w-search-form'),
79                searchShow = $(this).find('.w-search-show'),
80                searchClose = $(this).find('.w-search-close'),
81                searchInput = searchForm.find('.w-search-input input');
82
83            if (searchShow) {
84                searchShow.click(function(){
85                    searchForm.animate({ top: '0px'}, 250, function(){
86                        searchInput.focus();
87                    });
88                });
89            }
90
91            searchInput.keyup(function(e) {
92                if (e.keyCode == 27) {
93                    searchForm.animate({ top: '-100%'}, 250);
94                }
95            });
96
97            if (searchClose) {
98                searchClose.click(function(){
99                    searchForm.animate({ top: '-100%'}, 250);
100                });
101            }
102        });
103    };
104})(jQuery);
105
106jQuery(document).ready(function() {
107    "use strict";
108
109    jQuery('.w-search').wSearch();
110});
111
112/* W-Tabs */
113(function ($) {
114    "use strict";
115
116    $.fn.wTabs = function () {
117
118
119        return this.each(function () {
120            var tabs = $(this),
121                items = tabs.find('.w-tabs-item'),
122                sections = tabs.find('.w-tabs-section'),
123                resizeTimer = null,
124                itemsWidth = 0,
125                running = false,
126                firstActiveItem = tabs.find('.w-tabs-item.active').first(),
127                firstActiveSection = tabs.find('.w-tabs-section.active').first();
128
129
130
131            if ( ! tabs.hasClass('layout_accordion')) {
132                if ( ! firstActiveItem.length) {
133                    firstActiveItem = tabs.find('.w-tabs-item').first();
134                    firstActiveSection = tabs.find('.w-tabs-section').first();
135                }
136            }
137
138            if (firstActiveItem.length) {
139                tabs.find('.w-tabs-item.active').removeClass('active');
140                tabs.find('.w-tabs-section.active').removeClass('active');
141
142                firstActiveItem.addClass('active');
143                firstActiveSection.addClass('active');
144            }
145
146
147
148
149            items.each(function(){
150                itemsWidth += $(this).outerWidth(true);
151            });
152
153            function tabs_resize(){
154                if ( ! (tabs.hasClass('layout_accordion') && ! tabs.data('accordionLayoutDynamic'))) {
155                    if (itemsWidth > tabs.width()) {
156                        tabs.data('accordionLayoutDynamic', true);
157                        if ( ! tabs.hasClass('layout_accordion')) {
158                            tabs.addClass('layout_accordion');
159                        }
160                    } else {
161                        if (tabs.hasClass('layout_accordion')) {
162                            tabs.removeClass('layout_accordion');
163                        }
164                    }
165                }
166            }
167
168            tabs_resize();
169
170            $(window).resize(function(){
171                window.clearTimeout(resizeTimer);
172                resizeTimer = window.setTimeout(function(){
173                    tabs_resize();
174                }, 50);
175
176            });
177
178            sections.each(function(index){
179                var item = $(items[index]),
180                    section = $(sections[index]),
181                    section_title = section.find('.w-tabs-section-title'),
182                    section_content = section.find('.w-tabs-section-content');
183
184                if (section.hasClass('active')) {
185                    section_content.slideDown();
186                }
187
188                section_title.click(function(){
189                    if (tabs.hasClass('type_toggle')) {
190                        if ( ! running) {
191                            if (section.hasClass('active')) {
192                                running = true;
193                                if (item) {
194                                    item.removeClass('active');
195                                }
196                                section_content.slideUp(null, function(){
197                                    section.removeClass('active');
198                                    running = false;
199                                });
200                            } else {
201                                running = true;
202                                if (item) {
203                                    item.addClass('active');
204                                }
205                                section_content.slideDown(null, function(){
206                                    section.addClass('active');
207                                    running = false;
208                                });
209                            }
210                        }
211
212
213                    } else if (( ! section.hasClass('active')) && ( ! running)) {
214                        running = true;
215                        items.each(function(){
216                            if ($(this).hasClass('active')) {
217                                $(this).removeClass('active');
218                            }
219                        });
220                        if (item) {
221                            item.addClass('active');
222                        }
223
224                        sections.each(function(){
225                            if ($(this).hasClass('active')) {
226                                $(this).find('.w-tabs-section-content').slideUp();
227                            }
228                        });
229
230                        section_content.slideDown(null, function(){
231                            sections.each(function(){
232                                if ($(this).hasClass('active')) {
233                                    $(this).removeClass('active');
234                                }
235                            });
236                            section.addClass('active');
237                            running = false;
238                        });
239
240                    }
241
242                });
243
244                if (item)
245                {
246                    item.click(function(){
247                        section_title.click();
248                    });
249                }
250
251
252            });
253
254        });
255    };
256})(jQuery);
257
258jQuery(document).ready(function() {
259    "use strict";
260
261    jQuery('.w-tabs').wTabs();
262});
263
264/* W-Timeline */
265(function ($) {
266    "use strict";
267
268    $.fn.wTimeline = function () {
269
270        return this.each(function () {
271            var timeline = $(this),
272                items = timeline.find('.w-timeline-item'),
273                sections = timeline.find('.w-timeline-section'),
274                running = false,
275                sectionsWrapper = timeline.find('.w-timeline-sections'),
276                sumWidth = 0,
277                sectionsContainer = $('<div></div>', {id: 'section_container'}).css({position: 'relative'}),
278                resizeTimer = null,
279                sectionsPadding = $(sections[0]).innerWidth() - $(sections[0]).width(),
280                activeIndex = 0,
281                activeIndexFound = 0,
282                sectionsContainerPresent,
283                firstActiveItem = timeline.find('.w-timeline-item.active').first(),
284                firstActiveSection = timeline.find('.w-timeline-section.active').first();
285
286            if ( ! firstActiveItem.length) {
287                firstActiveItem = timeline.find('.w-timeline-item').first();
288                firstActiveSection = timeline.find('.w-timeline-section').first();
289            }
290
291            timeline.find('.w-timeline-item.active').removeClass('active');
292            timeline.find('.w-timeline-section.active').removeClass('active');
293
294            firstActiveItem.addClass('active');
295            firstActiveSection.addClass('active');
296
297            $(sections).each(function(sectionIndex, section) {
298                if ($(section).hasClass('active')) {
299                    activeIndex = sectionIndex;
300                }
301            });
302
303            $(sections).css({display: 'block'});
304            $(sectionsWrapper).css({position: 'relative'});
305
306
307
308            function timeline_resize(){
309                sectionsWrapper.css({width: timeline.innerWidth()-sectionsWrapper.css('border-left-width')-sectionsWrapper.css('border-right-width')+'px'});
310                $(sections).css({width: sectionsWrapper.innerWidth()-sectionsPadding+'px'});
311
312                if ($(window).width() < 768) {
313                    if ( ! timeline.hasClass('type_vertical')) {
314                        timeline.addClass('type_vertical');
315                    }
316                    if (sectionsContainerPresent === true || sectionsContainerPresent === undefined ){
317                        sectionsWrapper.css({ height: 'auto', overflow: 'visible'});
318                        $(sections).css({float: 'none'});
319                        $(sections).each(function(sectionIndex, section) {
320                            var section_content = $(section).find('.w-timeline-section-content');
321                            if (!$(section).hasClass('active')) {
322                                section_content.css('display', 'none');
323                            }
324                            sectionsWrapper.append(section);
325                        });
326                        sectionsContainer.remove();
327                        sectionsContainerPresent = false;
328                    }
329                } else {
330                    if (timeline.hasClass('type_vertical')) {
331                        timeline.removeClass('type_vertical');
332                    }
333                    sectionsWrapper.css({ height: $(sections[activeIndex]).outerHeight()+'px', overflow: 'hidden'});
334                    sumWidth = sections.length*(sectionsWrapper.innerWidth());
335                    var leftPos = -activeIndex*(sectionsWrapper.innerWidth());
336                    sectionsContainer.css({width: sumWidth+'px', height: $(sections[activeIndex]).outerHeight()+'px', left: leftPos});
337                    if (sectionsContainerPresent === false || sectionsContainerPresent === undefined){
338                        sectionsContainer = $('<div></div>', {id: 'section_container'}).css({position: 'relative'});
339                        $(sections).css({float: 'left'});
340                        $(sections).each(function(sectionIndex, section) {
341                            var section_content = $(section).find('.w-timeline-section-content');
342                            section_content.css({'display': 'block', 'height': 'auto'});
343                            sectionsContainer.append(section);
344                        });
345
346                        sectionsContainer.css({width: sumWidth+'px', height: $(sections[activeIndex]).outerHeight()+'px', left: leftPos});
347                        sectionsWrapper.append(sectionsContainer);
348                        sectionsContainerPresent = true;
349                    }
350                }
351            }
352
353            timeline_resize();
354
355            $(window).resize(function(){
356                window.clearTimeout(resizeTimer);
357                resizeTimer = window.setTimeout(function(){
358                    timeline_resize();
359                }, 50);
360
361            });
362
363            sections.each(function(index, element){
364                var section = $(element),
365                    item = $(items[index]),
366                    section_title = section.find('.w-timeline-section-title'),
367                    section_content = section.find('.w-timeline-section-content');
368
369                if(item.length)
370                {
371                    item.click(function(){
372                        if (( ! section.hasClass('active')) && ( ! running)) {
373                            running = true;
374                            items.each(function(){
375                                if ($(this).hasClass('active')) {
376                                    $(this).removeClass('active');
377                                }
378                            });
379                            if (item.length) {
380                                item.addClass('active');
381                            }
382
383                            var leftPos = -index*(sectionsWrapper.innerWidth());
384                            sectionsWrapper.animate({height: section.outerHeight()}, 300);
385                            sectionsContainer.animate({left: leftPos}, 300, function(){
386                                sections.each(function(){
387                                    if ($(this).hasClass('active')) {
388                                        $(this).removeClass('active');
389                                    }
390                                });
391                                section.addClass('active');
392                                activeIndex = index;
393                                running = false;
394                            });
395
396                        }
397                    });
398                }
399
400                if(section_title.length)
401                {
402                    section_title.click(function() {
403                        if (( ! section.hasClass('active')) && ( ! running)) {
404                            running = true;
405                            var currentHeight, newHeight;
406                            items.each(function(){
407                                if ($(this).hasClass('active')) {
408                                    $(this).removeClass('active');
409                                }
410                            });
411                            if (item.length) {
412                                item.addClass('active');
413                            }
414
415                            sections.each(function(){
416                                if ($(this).hasClass('active')) {
417                                    currentHeight = $(this).find('.w-timeline-section-content').height();
418                                    $(this).find('.w-timeline-section-content').slideUp();
419                                }
420                            });
421
422                            newHeight = section_content.height();
423
424                            if (activeIndex < index) {
425
426                                $('html').animate({scrollTop: $('html').scrollTop() - currentHeight});
427                            }
428
429                            section_content.slideDown(null, function(){
430                                sections.each(function(){
431                                    if ($(this).hasClass('active')) {
432                                        $(this).removeClass('active');
433                                    }
434                                });
435                                section.addClass('active');
436                                activeIndex = index;
437                                running = false;
438                            });
439
440                        }
441                    });
442                }
443
444
445            });
446
447        });
448    };
449})(jQuery);
450
451jQuery(document).ready(function() {
452    "use strict";
453
454    jQuery('.w-timeline').wTimeline();
455});

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.