PageSourceSearch

https://nandemoya-gp.vercel.app/js/theme_chic/init.js

js nandemoya-gp.vercel.app collected 2026-10-03 07:21:55 UTC 6,356 bytes, 223 lines download raw bytes

1'use strict';
2
3/**
4 * Chic
5 * init.js
6 * ver.202006250000
7 */
8
9/**
10 * デバイス判定
11*/
12var viewMode = {
13    set: function() {
14        var target = $('.container');
15        var classList = 'pc-view tablet-view phone-view';
16
17        // スマホ
18        if (window.matchMedia('(max-width: 480px)').matches) {
19            target.removeClass(classList).addClass('phone-view');
20
21        // タブレット
22        } else if (window.matchMedia('(max-width: 768px)').matches) {
23            target.removeClass(classList).addClass('tablet-view');
24
25        // PC
26        } else {
27            target.removeClass(classList).addClass('pc-view');
28        }
29    },
30
31    get: function(classname) {
32        return $('.container').hasClass(classname);
33    }
34};
35
36/**
37 * ブラウザ判定
38*/
39var browser = {
40    set: function() {
41        var u = window.navigator.userAgent.toLowerCase();
42
43        // ie
44        if (u.match(/(MSIE|msie)/) || u.match(/(T|t)rident/) || u.match(/(E|e)dge/)) {
45            $('.container').addClass('ie');
46        }
47    }
48};
49
50/**
51 * ナビ制御
52*/
53var navigation = {
54    initialize: function() {
55        // navi:左端の項目にborder付加
56        if(viewMode.get('pc-view')) {
57            $('.navi li').each(function() {
58                var obj = $(this);
59                obj.removeClass('is-left');
60
61                if(obj.position().left === 0) {
62                    obj.addClass('is-left');
63                }
64            });
65        }
66    }
67};
68
69/**
70 * Initialize
71*/
72$(function() {
73    // デバイス制御init
74    viewMode.set();
75    browser.set();
76    navigation.initialize();
77
78    // header:contactボタン(navi連動)
79    if($('.navi .navi_contact').length) {
80        $('.header .button_contact').addClass('is-visible');
81    }
82
83    // スマホ用ナビ制御
84    $('.navi_trigger_mobile').on('click', function() {
85        $('.navi .navi_list').slideToggle(300);
86    });
87
88    // ページタイトルにリンク付加(top, free以外)
89    var siteURL = $('.header .logo a').attr('href') + '/' + $('body').attr('id');
90
91    if ($('body').attr('id') !== 'free' && $('body').attr('id') !== 'top' && $('body').attr('id') !== 'event-reservation') {
92        $('<a>'+ $('.page_title span').text() + '</a>').appendTo('.page_title').attr('href', siteURL);
93        $('.page_title span').remove();
94    }
95
96    // 電話番号
97    if($('.shop_tel div span').is(':empty')) {
98        $('.shop_tel').remove();
99    }
100
101    if (!viewMode.get('pc-view') && $('.shop_tel').css('display') === 'block') {
102        $('.shop_tel > div').wrap('<a href="tel:' + $('.shop_tel').data('shoptel') + '"></a>');
103    }
104
105    // pager(next・prev)をfont-awesomeに置換
106    $('.pager .prev').text('').attr('class', 'prev fa fa-angle-left');
107    $('.pager .next').text('').attr('class', 'next fa fa-angle-right');
108
109    // navi_parts(バナー/ウィジェット)を抽出して移動
110    var naviparts = $('#navi_parts');
111
112    if (naviparts.children().length !== 0) {
113        $('.gadgets .inner').append(naviparts);
114    } else {
115        $('.gadgets').remove();
116    }
117
118    // Schedule
119    if($('body').attr('id') === 'top') {
120        if ($('.today_area dd').length === 0) {
121            $('.today_area').remove();
122        } else {
123            if(viewMode.get('pc-view')) {
124                if($('.content .column_right .section:first').length !== 0) {
125                    $('.content .column_right .section:first').before($('.today_area'));
126                } else {
127                    $('.content .column_right').append($('.today_area'));
128                }
129            } else {
130                $('.content .column_right').append($('.today_area'));
131            }
132        }
133
134        $('.today_area .date').each(function() {
135            var text = $(this).html();
136            $(this).html(text.replace(/\./g, '<span> \/ </span>'));
137        });
138    } else {
139        $('.today_area').remove();
140    }
141
142    // Schedule, Counter, QRコードが全て非表示なら領域削除
143    if ($('.sidebar .block').children().length === 0) {
144        $('.sidebar').remove();
145    }
146
147    // Socialボタンが全て非表示なら領域削除
148    if ($('.social .inner').children().length === 0) {
149        $('.social').remove();
150    }
151
152    // facebookページウィジェットの手前に改行付加
153    $('.social_widget_facebook_likebox').before('<br />');
154
155    if ( $('.commoncontent').children().length === 0 ) {
156        $('.commoncontent').remove();
157    }
158
159    // Powered byをinlineに
160    if ($('.powered').css('display') === 'block') {
161        $('.powered').css('display', 'inline');
162    }
163
164    // RSSをinlineに
165    if ($('.shop_rss').css('display') === 'block') {
166        $('.shop_rss').css('display', 'inline');
167
168        if ($('.powered').css('display') !== 'none') {
169            $('.shop_rss span').css('display', 'inline');
170        }
171    }
172
173    if($('body').attr('id') === 'top' && viewMode.get('pc-view')) {
174        $('.content .wrap_column').addClass('is-float');
175        $('.content .column').each(function() {
176            if(!$(this).children().is('.section')) {
177                $('.content .wrap_column').removeClass('is-float');
178            }
179        });
180    } else {
181        $('.content .wrap_column').removeClass('is-float');
182    }
183
184    // colorbox(求人ページ・メルマガ除外)
185    $('.thickbox').not('.navi_recruit, .navi_melmaga').each(function() {
186        $(this).colorbox({
187            rel: $(this).attr('rel'),
188            className: 'cb',
189            width: '90%',
190            height: '90%',
191            transition: 'fade',
192            previous: '<i class="fa fa-angle-left"></i>',
193            next: '<i class="fa fa-angle-right"></i>',
194            close: '<i class="fa fa-close"></i>',
195            fixed: true
196        });
197    });
198
199    $(document).on('cbox_open cbox_closed', function(){
200        $('body').toggleClass('modal-open');
201    });
202
203    // backtotopボタン
204    var $pagetop = $('.totop .button');
205
206    $(window).on('scroll', function() {
207        if ($(this).scrollTop() > 100) {
208            $pagetop.addClass('is-visible');
209        } else {
210            $pagetop.removeClass('is-visible');
211        }
212    });
213
214    $pagetop.on('click', function() {
215        $('body, html').animate({ scrollTop: 0 }, 500);
216        return false;
217    });
218});
219
220$(window).on('load resize', function() {
221    viewMode.set();
222    navigation.initialize();
223});

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.