1'use strict'; 2 3 4(function () { 5 var $html = $('html'); 6 var $win = $(window); 7 var $doc = $(document); 8 var isIE8 = $html.hasClass('ie8'); 9 10 11 /** 12 * ã¦ã£ã³ãã¦å¹ ãåå¾ï¼IE8ã¯ã¹ã¯ãã¼ã«ãã¼ãå«ã¾ãªãå¹ ï¼ 13 * @returns {Number} ã¦ã£ã³ãã¦å¹ 14 */ 15 function getWinWidth() { 16 var w = window.innerWidth; 17 return (w !== undefined) ? w : $win.width(); 18 } 19 20 21 /** 22 * IE8ã®ã¿*-childçãªã¯ã©ã¹ãä»ãã 23 */ 24 (function () { 25 if (!isIE8) return; 26 for (var i = 2; i < 6; i++) { 27 var a = '.g-grid-' + i; 28 var b = ' > .g-grid_el:nth-child(' + i + 'n+1)'; 29 var c = 'g-grid_el-' + i + 'n'; 30 $(a + b).addClass(c); 31 $(a + 'b' + b).addClass(c); 32 } 33 $('.g-tabset').each(function () { 34 $('.g-tabset_section', this).each(function (n) { 35 $(this).addClass('g-tabset_section-' + (n + 1)); 36 }); 37 }); 38 $('th:last-child, td:last-child', '.g-table_el').addClass('lastChild'); 39 }()); 40 41 42 /** 43 * ãããã¼å æ¤ç´¢ã¨ãªã¢ã®å¶å¾¡ 44 */ 45 (function () { 46 var cls = 'g-page-search'; 47 var $body = $('body'); 48 var $wrapper = $('.g-wrapper'); 49 var $btn = $('.g-header_searchBtn a'); 50 var $searchBody = $('#g-header_search'); 51 52 $btn.on('click', function () { 53 $body.toggleClass(cls); 54 $searchBody.find('input[type="text"]').focus(); 55 if ($body.hasClass(cls)) { 56 $wrapper.one('click.search', function () { $body.removeClass(cls); }); 57 } 58 return false; 59 }); 60 61 $('i', $searchBody).on('click', function () { $wrapper.trigger('click'); }); 62 63 $searchBody.on('click', function (e) { 64 return e.target.tagName === 'BUTTON'; 65 }); 66 }()); 67 68 69 /** 70 * ã°ãããã®ã«ã¬ã³ãå¶å¾¡ 71 */ 72 (function () { 73 var URL = location.href; 74 var CUR = 'g-hnav_lv1_hd-cur'; 75 switch (true) { 76 case /test10400\.imjp\.co\.jp\/(index\.html)?(\?.*)?(#.*)?$/.test(URL): 77 $('.g-hnav_home > p').addClass(CUR); 78 break; 79 case /daikin\.co\.jp\/(index\.html)?(\?.*)?(#.*)?$/.test(URL): 80 $('.g-hnav_home > p').addClass(CUR); 81 break; 82 case /daikinaircon\.com\/(index\.html)?(\?.*)?(#.*)?$/.test(URL): 83 $('.g-hnav_consumer').addClass(CUR); 84 break; 85 case /daikinaircon\.com\/(business|partner)\/(index\.html)?(\?.*)?(#.*)?$/.test(URL): 86 $('.g-hnav_business').addClass(CUR); 87 break; 88 case /daikincc\.com/.test(URL): 89 $('.g-hnav_support').addClass(CUR); 90 break; 91 // no default 92 } 93 }()); 94 95 96 /** 97 * ã°ãããã®ééæã«ãªã¼ãã¼ã¬ã¤è¡¨ç¤º 98 */ 99 $doc.on('navopen', function () { 100 $html.addClass('overlay navopen'); 101 }) 102 .on('navclose', function () { 103 $html.removeClass('overlay navopen'); 104 }); 105 106 107 /** 108 * PCã°ãããã®å¦ç 109 */ 110 (function () { 111 var ON = 'g-hnav_lv1_hd-on'; 112 var BG_ON = 'g-hnav_bg-on';
113 var $overlay = $('.g-overlay'); 114 var $bg = $('.g-hnav_bg'); 115 var $btn = $('.g-hnav_lv1_hd:has(span)'); 116 117 function getCurEls() { 118 var $cur = $('.' + ON); 119 if ($cur.length > 0) { 120 return { 121 $head: $cur, 122 $body: $cur.next('.g-hnav_accBody') 123 }; 124 } 125 return undefined; 126 } 127 128 function deactivate(out) { 129 var cur = getCurEls(); 130 if (!cur) return; 131 if (out) { 132 $bg.stop().removeClass(BG_ON).height(0); 133 cur.$body.stop().css({ opacity: 1, height: 0, display: 'block' }); 134 } else { 135 cur.$body.stop().fadeOut(200); 136 } 137 cur.$head.removeClass(ON); 138 $doc.trigger('navclose'); 139 } 140 141 function activate(el) { 142 var $body = $(el).next('.g-hnav_accBody'); 143 var h; 144 if ($bg.hasClass(BG_ON)) { 145 $body.stop().css({ opacity: 1, height: 'auto', display: 'none' }); 146 h = $body.outerHeight(); 147 $body.delay(100).fadeIn(400); 148 } else { 149 $body.stop().css({ opacity: 1, height: 0, display: 'block' }); 150 h = $body[0].scrollHeight; 151 $body.animate({ height: h }, 400); 152 } 153 $bg.stop().addClass(BG_ON).animate({ height: h }, 400); 154 deactivate(); 155 $(el).addClass(ON); 156 $doc.trigger('navopen'); 157 } 158 159 if (Modernizr.touchevents) { 160 $('.g-hnav_lv1_body').on('click', function (e) { 161 return e.target.tagName === 'A'; 162 }); 163 $btn.on('click', function () { 164 var $el = $(this); 165 if (getWinWidth() < 960) return true; 166 if ($el.hasClass(ON)) { 167 $overlay.trigger('click'); 168 return false; 169 } 170 $overlay.off().one('click', deactivate); 171 $('.g-header, .g-hnav').off().one('click', function () { $overlay.trigger('click'); }); 172 deactivate(); 173 activate(this); 174 $el.addClass(ON); 175 return false; 176 }); 177 } else { 178 var timer; 179 $btn.parent().on('mouseleave', function () { 180 timer = setTimeout(function () { 181 if (!isIE8 && getWinWidth() < 960) return; 182 deactivate(true); 183 }, 100); 184 }); 185 $btn.on('mouseenter', function () { 186 clearTimeout(timer); 187 if ((!isIE8 && getWinWidth() < 960) || $(this).hasClass(ON)) return; 188 activate(this); 189 }); 190 } 191 }()); 192 193 194 /** 195 * SPã°ãããã®å¦ç 196 */ 197 (function () { 198 var ON = 'g-header_menu-on'; 199 var $wrapper = $('.g-wrapper');
200 var $overlay = $('.g-overlay'); 201 var $hnav = $('.g-hnav'); 202 var $btn = $('.g-header_menu'); 203 var $body = $('body'); 204 var localOpen = false; 205 206 function deactivate() { 207 if(!localOpen) { 208 $wrapper.css({ overflow: 'visible', height: 'auto' }); 209 } 210 $btn.removeClass(ON); 211 $hnav.slideUp(); 212 $doc.trigger('navclose'); 213 $body.removeClass('header-open'); 214 } 215 216 function activate() { 217 var style = $wrapper.attr('style'); 218 if(style) { 219 if(style.indexOf('auto') === -1) { 220 localOpen = true; 221 } else { 222 localOpen = false; 223 } 224 } 225 $wrapper.css({ overflow: 'hidden', height: $win.height() }); 226 $overlay.off().one('click', deactivate); 227 $btn.addClass(ON); 228 $hnav.slideDown().promise().done(function () { 229 $body.addClass('header-open'); 230 }); 231 $doc.trigger('navopen'); 232 } 233 234 $btn.on('click', function () { 235 if ($(this).hasClass(ON)) deactivate(); 236 else activate(); 237 }); 238 }()); 239 240 241 /** 242 * SPã°ãããå ã¢ã³ã¼ãã£ãªã³ã®å¦ç 243 */ 244 $('.g-hnav_accBtn').on('click', function (e) { 245 if (isIE8 || getWinWidth() > 959 246 || (e.target.tagName === 'A' && !$(e.target).is('.g-hnav_lv1_hd a'))) return; 247 $(this).toggleClass('g-hnav_accBtn-on').next('.g-hnav_accBody').slideToggle(); 248 e.preventDefault(); 249 }); 250 251 252 /** 253 * SPããã¿ã¼ããå ã¢ã³ã¼ãã£ãªã³ã®å¦ç 254 */ 255 $('.g-fnav_accBtn').on('click', function (e) { 256 if (isIE8 || getWinWidth() > 959 || (e.target.tagName === 'A')) return; 257 $(this).toggleClass('g-fnav_accBtn-on').next('.g-fnav_accBody').slideToggle(); 258 e.preventDefault(); 259 }); 260 261 262 /** 263 * ã°ãããã®PC/SPåãæ¿ãå¦ç 264 */ 265 (function () { 266 var isSpView = false; 267 268 function deactivateHnav() { 269 $('.g-hnav_accBtn').removeClass('g-hnav_accBtn-on g-hnav_lv1_hd-on') 270 .next('.g-hnav_accBody').height('auto').hide(); 271 } 272 273 $win.on('resize', _.debounce(function () { 274 if (isIE8) return; 275 var w = getWinWidth(); 276 if (w < 960 && !isSpView) { 277 isSpView = true; 278 $doc.trigger('navclose'); 279 deactivateHnav(); 280 $('.g-fnav_accBtn').removeClass('g-fnav_accBtn-on').next('.g-fnav_accBody').hide(); 281 } else if (w >= 960 && isSpView) { 282 isSpView = false; 283 $doc.trigger('navclose'); 284 deactivateHnav(); 285 $('.g-fnav_accBtn').addClass('g-fnav_accBtn-on').next('.g-fnav_accBody').show(); 286 } 287 }, 100)) 288 .trigger('resize'); 289 }()); 290 291 292 /** 293 * ãã¼ã¸å é ã¸æ»ããã¿ã³ã®å¦ç 294 */ 295 (function () { 296 var $pagetop = $('#g-pagetop'); 297 var visible = true; 298 299 $win.on('scroll', _.debounce(function () { 300 var on = $win.scrollTop() > 200; 301 if (on && !visible) { 302 visible = true; 303 $pagetop.fadeIn(); 304 } else if (!on && visible) { 305 visible = false; 306 $pagetop.fadeOut(); 307 } 308 }, 100)).trigger('scroll'); 309 310 $pagetop.on('click', function (e) { 311 $('html, body').animate({ scrollTop: 0 }, 700); 312 e.preventDefault(); 313 }); 314 }()); 315}());
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.