PageSourceSearch

https://www.subaru.pl/assets/scripts/common_dt_v3.js

js subaru.pl collected 2026-10-05 06:48:04 UTC 9,662 bytes, 393 lines download raw bytes

1/*! 2016 © Fuji Heavy Industries Ltd. All rights reserved. */
2(function(window, $, App, undefined){
3  'use strict';
4  var Common = window.Common = {}; //インスタンス化した機能のコレクション
5
6  // jQueryがなかったらすべての処理をやらずに終える
7  if($ === undefined) {
8    window.alert('jQueryが見つかりません');
9    return;
10  }
11
12  $(function(){
13
14    // Header
15    Common.header = [];
16    $('.js_header').each(function(i){
17      var config = {
18        idx: i,
19        base: this
20      };
21      Common.header[i] = new App.Header();
22      Common.header[i].init(config);
23    });
24
25    // Preload
26    Common.preload = [];
27    $('.js_preload').each(function(i){
28      var config = {
29        idx: i,
30        base: this,
31        progress: '.js_progress'
32      };
33      Common.preload[i] = new App.Preload();
34      Common.preload[i].init(config);
35    });
36
37    // Collapse
38    Common.collapse = [];
39    $('.js_collapse').each(function(i){
40      var config = {
41        idx: i,
42        base: this
43      };
44      Common.collapse[i] = new App.Collapse();
45      Common.collapse[i].init(config);
46    });
47
48    // Collapse Button
49    Common.collapseButton = [];
50    $('.js_collapse_button').each(function(i){
51      var config = {
52        idx: i,
53        base: this
54      };
55      Common.collapseButton[i] = new App.CollapseButton();
56      Common.collapseButton[i].init(config);
57    });
58
59    // Gallery
60    Common.gallery = [];
61    $('.js_gallery').each(function(i){
62      var config = {
63        idx: i,
64        base: this
65      };
66      Common.gallery[i] = new App.Gallery();
67      Common.gallery[i].init(config);
68    });
69
70    // Interaction, News
71    Common.displaySwitch = [];
72    $('.js_displaySwitch').each(function(i){
73      var config = {
74        idx: i,
75        base: this
76      };
77      Common.displaySwitch[i] = new App.DisplaySwitch();
78      Common.displaySwitch[i].init(config);
79    });
80
81    // News Year
82    Common.yearSwitch = [];
83    $('.js_yearSwitch').each(function(i){
84      var config = {
85        idx: i,
86        base: this,
87        content: '.js_yearSwitch_content',
88        menu: '.js_yearSwitch_menu',
89        menuItem: '.js_yearSwitch_menu-item'
90      };
91      Common.yearSwitch[i] = new App.DisplaySwitch();
92      Common.yearSwitch[i].init(config);
93    });
94
95    // lineup Contens
96    Common.contentsSwitch = [];
97    $('.js_contentsSwitch').each(function(i){
98      var config = {
99        idx: i,
100        base: this,
101        content: '.js_contentsSwitch_content',
102        menu: '.js_contentsSwitch_menu',
103        menuItem: '.js_contentsSwitch_menu-item'
104      };
105      Common.contentsSwitch[i] = new App.DisplaySwitch();
106      Common.contentsSwitch[i].init(config);
107    });
108
109    // lineup Overview
110    Common.overviewSwitch = [];
111    $('.js_overviewSwitch').each(function(i){
112      var config = {
113        idx: i,
114        base: this,
115        content: '.js_overviewSwitch_content',
116        menu: '.js_overviewSwitch_menu',
117        menuItem: '.js_overviewSwitch_menu-item'
118      };
119      Common.overviewSwitch[i] = new App.DisplaySwitch();
120      Common.overviewSwitch[i].init(config);
121    });
122
123    // Overview
124    Common.overview = [];
125    $('.js_overview').each(function(i){
126      var config = {
127        idx: i,
128        base: this
129      };
130      Common.overview[i] = new App.Overview();
131      Common.overview[i].init(config);
132    });
133
134    // View360
135    Common.view360 = [];
136    $('.js_view360').each(function(i){
137      var config = {
138        idx: i,
139        base: this
140      };
141      Common.view360[i] = new App.View360();
142      Common.view360[i].init(config);
143    });
144
145    // News Year
146    Common.selectAccordion = [];
147    $('.js_selectAccordion').each(function(i){
148      var config = {
149        idx: i,
150        base: this
151      };
152      Common.selectAccordion[i] = new App.SelectAccordion();
153      Common.selectAccordion[i].init(config);
154    });
155
156    // VideoModal
157    Common.videoModal = [];
158    $('.js_videoModal').each(function(i){
159      var config = {
160        idx: i,
161        self: this
162      };
163      Common.videoModal[i] = new App.VideoModal();
164      Common.videoModal[i].init(config);
165    });
166
167    // popup
168    Common.popup = [];
169    $('.js_popup').each(function(i){
170      var config = {
171        idx: i,
172        self: this
173      };
174      Common.popup[i] = new App.Popup();
175      Common.popup[i].init(config);
176    });
177
178    // Notes
179    Common.notesAccordion = [];
180    $('.js_notesAccording').each(function(i){
181      var config = {
182        idx: i,
183        self: this
184      };
185      Common.notesAccordion[i] = new App.NotesAccordion();
186      Common.notesAccordion[i].init(config);
187    });
188
189    // sticky
190    Common.sticky = [];
191    $('.js_sticky').each(function(i){
192      var config = {
193        idx: i,
194        self: this
195      };
196      Common.sticky[i] = new App.Sticky();
197      Common.sticky[i].init(config);
198    });
199
200    // heritage
201    Common.heritage = [];
202    $('.js_heritage').each(function(i){
203      var config = {
204        idx: i,
205        self: this,
206        stickyIdx: i //連動させるstickyインスタンスのインデックス
207      };
208      Common.heritage[i] = new App.Heritage();
209      Common.heritage[i].init(config);
210    });
211
212    // facebookPost
213    Common.facebookPost = [];
214    $('.js_facebookPost').each(function(i){
215      var config = {
216        idx: i,
217        self: this
218      };
219      Common.facebookPost[i] = new App.FBP();
220      Common.facebookPost[i].init(config);
221    });
222
223    // FollowNav
224    Common.followNav = [];
225    $('.js_followNav').each(function(i){
226      var config = {
227        idx: i,
228        self: this,
229        keepWrapHeight: true
230      };
231      Common.followNav[i] = new App.FollowNav();
232      Common.followNav[i].init(config);
233    });
234
235    // moveTo
236    Common.moveTo = [];
237    $('.js_moveTo').each(function(i){
238      var config = {
239        idx: i,
240        self: this
241      };
242      Common.moveTo[i] = new App.MoveTo();
243      Common.moveTo[i].init(config);
244    });
245
246    // moveTo Performance
247    Common.performanceMoveTo = [];
248    $('.js_pMoveTo').each(function(i){
249      var config = {
250        idx: i,
251        self: this
252      };
253      Common.performanceMoveTo[i] = new App.PerformanceMoveTo();
254      Common.performanceMoveTo[i].init(config);
255    });
256
257    // pageTop
258    Common.pageTop = [];
259    $('.js_pageTop').each(function(i){
260      var config = {
261        idx: i,
262        self: this
263      };
264      Common.pageTop[i] = new App.PageTop();
265      Common.pageTop[i].init(config);
266    });
267
268    // ScrollCurrent
269    Common.scrollCurrent = [];
270    $('.js_scrollCurrent').each(function(i){
271      var config = {
272        idx: i,
273        self: this
274      };
275      Common.scrollCurrent[i] = new App.ScrollCurrent();
276      Common.scrollCurrent[i].init(config);
277    });
278
279    // SwipeDiff
280    Common.swipeDiff = [];
281    $('.js_swipeDiff').each(function(i){
282      var config = {
283        idx: i,
284        self: this
285      };
286      Common.swipeDiff[i] = new App.SwipeDiff();
287      Common.swipeDiff[i].init(config);
288    });
289
290    // MoreCard
291    Common.moreCard = [];
292    $('.js_moreCard').each(function(i){
293      var config = {
294        idx: i,
295        self: this
296      };
297      Common.moreCard[i] = new App.MoreCard();
298      Common.moreCard[i].init(config);
299    });
300  });
301
302  // Lineup Interaction
303  var lineupInteraction = function() {
304    var lineupFlag = 0;
305    $('.js_lineup_button').on('click', function() {
306      var $contents = $('.js_lineup_contents');
307      var $gallery1 = $('.js_lineup_gallery1');
308      var $gallery2 = $('.js_lineup_gallery2');
309
310      $gallery1.toggleClass('is_hidden');
311      $gallery2.toggleClass('is_hidden');
312
313      if(lineupFlag) {
314        $contents.removeClass('col2_wrap');
315        lineupFlag--;
316      } else {
317        $contents.addClass('col2_wrap');
318        lineupFlag++;
319      }
320    });
321  };
322  lineupInteraction();
323
324  // Slick
325  Common.responsiveSlick = [];
326  $('.js_rslick').each(function(i){
327    var config = {
328      idx: i,
329      base: this
330    };
331    Common.responsiveSlick[i] = new App.ResponsiveSlick();
332    Common.responsiveSlick[i].init(config);
333  });
334
335  // Slick
336  Common.tabletSlick = [];
337  $('.js_tablet_slick').each(function(i){
338    var config = {
339      idx: i,
340      base: this
341    };
342    Common.tabletSlick[i] = new App.TabletSlick();
343    Common.tabletSlick[i].init(config);
344  });
345
346  // ハッシュをみて、Lineupのタブを開く
347  var lineupTab = function() {
348    var getHash = window.location.hash;
349    // ハッシュがなければ、falseを返す
350    if(getHash.indexOf('lineup-contents') === -1) {
351      return false;
352    }
353    var getContentsNumber = getHash.replace(/#lineup-contents(\d+)/gi, '$1');
354
355    var $nav        = $('.c_nav_lineup_list');
356    var $contents   = $('.c_lineup_contents');
357    var activeClass = 'is_active';
358
359    $nav.find('li').removeClass(activeClass);
360    $contents.removeClass(activeClass);
361
362    $('#lineup-nav' + getContentsNumber).addClass(activeClass);
363    $(getHash).addClass(activeClass);
364
365    window.location.hash = '';
366  };
367  lineupTab();
368
369  // HandleImage
370  var lineupHandleImage = function() {
371    var $overviewBox = $('.c_lineup_overview_gallery_item');
372
373    if($overviewBox.length === 0) {
374      return false;
375    }
376    var elementMaxWidth = 0;
377    $overviewBox.each(function(i, self) {
378      var getWidth = $(self).width();
379      if(getWidth > elementMaxWidth) {
380        elementMaxWidth = getWidth;
381      }
382    });
383
384    var navLink = $('.c_nav_lineup_list').find('a');
385    navLink.on('click', function() {
386      $('.js_swipeDiff_img').css('minWidth', elementMaxWidth);
387    });
388  };
389  lineupHandleImage();
390
391}
391)(this, this.jQuery, this.App);
392
393//# sourceMappingURL=common.js.map

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.