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.