1'use strict'; 2 3// ãªã»ããã弿°(resets)ã«é ç®åãããã°ãã®é ç®ã®ã¿å®è¡ãããªããã°å ¨ã¦å®è¡ã 4app.resetChart = function (...resets) { 5 const resetAll = resets.length <= 0; // 弿°ããªãå ´åã¯å ¨ã¦ãªã»ãã 6 7 if (resetAll || resets.includes('page')) { 8 app.pageNum = 1; // ãã¼ã¸çªå·ãªã»ãã 9 } 10 11 if (resetAll || resets.includes('scroll')) { 12 // ã¹ã¯ãã¼ã«ä½ç½®ã®ãªã»ãã 13 const scrTopMgn = 160; 14 let sctWrapPos = $('.ranking-sct-wrap').offset().top - scrTopMgn; 15 if (app.sp) { 16 sctWrapPos = $('.ranking-sct-wrap').offset().top - $('#header > .inner').height() - scrTopMgn; 17 spScrollPos = $('.ranking-sct').scrollLeft(); 18 } 19 $win.scrollTop(sctWrapPos); 20 } 21 22 if (resetAll || resets.includes('refine')) { 23 // ä½è©å®¶ã»ä½æ²å®¶ã»ã¢ã¼ãã£ã¹ãåçµãè¾¼ã¿ã®ãªã»ãã 24 $('.ranking-refine-select').removeClass('-selected'); 25 $refineLyricist.prop('selectedIndex', 0); 26 $refineComposer.prop('selectedIndex', 0); 27 $refineArtist.prop('selectedIndex', 0); 28 $('.ranking-sct-cont > .ranking-list').removeClass('-hide'); 29 $('.ranking-ttl-wrap').add('.ranking-sct').removeClass('-hide'); 30 $('.ranking-sct-nohit').removeClass('-show'); 31 $('.-hit').removeClass('-hit'); 32 } 33 34 if (resetAll || resets.includes('inview')) { 35 // inviewããªã¬ã¼ã®ãªã»ãã 36 app.inviewFlag = false; // inviewããªã¬ã¼ãã©ã°ãªã»ãã 37 if (app.kind === 'heatseekers' || (app.type === 2 && app.kind === 'anime')) { 38 $inviewTarget.removeClass('inview'); 39 } else { 40 $inviewTarget.addClass('inview'); 41 } 42 } 43 44 if (resetAll || resets.includes('table')) { 45 $('.ranking-sct-cont').empty(); // ãã£ã¼ããã¼ãã«å ã®è¦ç´ ãå ¨åé¤ 46 } 47}; 48 49// ã¸ã£ã³ã«(kind)åãæ¿ããâ»ã¤ã³ãµã¤ãéå® 50function switchKind(kind) { 51 app.kind = kind; // ã¯ãªãã¯ããããã¿ã³ã«è¨å®ãããå¤ãå ã«ã¸ã£ã³ã«åãæ¿ã 52 app.datapoint = kind === 'artist' || kind === 'lyricist' || kind === 'composer' ? 'insight_artist' : 'insight_data'; // ãã¼ã¿ãã¤ã³ã夿´ 53 $('.main-sct-wrap > .tab li').removeClass('active'); // ã¸ã£ã³ã«ã¡ãã¥ã¼ãã.activeãé¤å» 54 const $li = $(`.main-sct-wrap > .tab [data-id="${kind}"]`).parent(); // æ¼ããããã¿ã³ã®è¦ªè¦ç´ ã®liãåå¾ 55 $li.addClass('active'); // ç¾å¨ã®ã¸ã£ã³ã«ã¡ãã¥ã¼ã«.activeãä»ä¸ 56 $body.removeClass('hot-albums heatseekers -patternB'); // bodyè¦ç´ ã®ã¸ã£ã³ã«å¥ã¯ã©ã¹ãªã»ãã 57 if (app.kind === 'h100' || app.kind === 'anime' || app.kind === 'heatseekers') { 58 if (app.kind === 'h100') $popupTheaderUgc.text('UGC \nâ»UGCã¯Hot 100ãæ§æããææ¨ã«å«ã¾ãã¾ãã'); // ãããã¢ããã®UGCããã¹ã夿´ 59 $refineSection.show(); 60 $tableTitle.text('æ¥½æ²æ å ±'); // ãã¼ãã«ã¿ã¤ãã«å¤æ´ 61 $seekButton.text('楽æ²ãæ¢ã'); 62 $modalTitle.text('⪠楽æ²ãæ¢ã'); 63 $toggleSongButton.text('楽æ²').attr('data-switch-artist-song', 'song'); 64 } else if (app.kind === 'albums') { 65 $refineSection.hide(); 66 $tableTitle.text('æ¥½æ²æ å ±'); // ãã¼ãã«ã¿ã¤ãã«å¤æ´ 67 $seekButton.text('ã¢ã«ãã ãæ¢ã'); 68 $modalTitle.text('⪠ã¢ã«ãã ãæ¢ã'); 69 $toggleSongButton.text('ã¢ã«ãã ').attr('data-switch-artist-song', 'album'); 70 } else if (app.kind === 'artist') { 71 $refineSection.hide(); 72 $tableTitle.text('ã¢ã¼ãã£ã¹ãå'); // ãã¼ãã«ã¿ã¤ãã«å¤æ´ 73 $popupTheaderUgc.text('UGC \nâ»UGCã¯Artist 100ãæ§æããææ¨ã«å«ã¾ãã¾ãã'); // ãããã¢ããã®UGCããã¹ã夿´ 74 $seekButton.text('ã¢ã¼ãã£ã¹ããæ¢ã'); 75 $modalTitle.text('⪠ã¢ã¼ãã£ã¹ããæ¢ã'); 76 } else if (app.kind === 'lyricist') { 77 $refineSection.hide(); 78 $tableTitle.text('ä½è©å®¶'); // ãã¼ãã«ã¿ã¤ãã«å¤æ´ 79 $popupTheaderUgc.text('UGC \nâ»UGCã¯Hot100 Lyricistsãæ§æããææ¨ã«å«ã¾ãã¾ãã'); // ãããã¢ããã®UGCããã¹ã夿´ 80 $seekButton.text('ä½è©å®¶ãæ¢ã'); 81 $modalTitle.text('⪠ä½è©å®¶ãæ¢ã'); 82 } else if (app.kind === 'composer') { 83 $refineSection.hide(); 84 $tableTitle.text('使²å®¶'); // ãã¼ãã«ã¿ã¤ãã«å¤æ´ 85 $popupTheaderUgc.text('UGC \nâ»UGCã¯Hot100 Composersãæ§æããææ¨ã«å«ã¾ãã¾ãã'); // ãããã¢ããã®UGCããã¹ã夿´ 86 $seekButton.text('使²å®¶ãæ¢ã'); 87 $modalTitle.text('âª ä½æ²å®¶ãæ¢ã'); 88 } 89 if (app.kind === 'anime') { 90 app.type !== 2 && app.type !== 3 && $('#new-member-num').text('20'); // æä¸é¨ã®ãâ¯ä½ã¾ã§é²è¦§å¯è½ï¼æé¡ï¼330åï¼ãããã¹ã夿´ 91 $popupTheaderUgc.text('UGC \nâ»UGCã¯Hot Animationãæ§æããææ¨ã«å«ã¾ãã¾ãã'); // ãããã¢ããã®UGCããã¹ã夿´ 92 } else { 93 app.type !== 2 && app.type !== 3 && $('#new-member-num').text('100'); // æä¸é¨ã®ãâ¯ä½ã¾ã§é²è¦§å¯è½ï¼æé¡ï¼330åï¼ãããã¹ã夿´ 94 } 95 if (app.kind === 'albums') { 96 $body.addClass('hot-albums'); 97 } 98 if (app.kind === 'heatseekers') { 99 $body.addClass('heatseekers'); 100 $popupTheaderUgc.text('UGC \nâ»UGCã¯Heatseekers Songsãæ§æããææ¨ã«å«ã¾ãã¾ãã'); // ãããã¢ããã®UGCããã¹ã夿´ 101 } 102 if (app.kind === 'artist' || app.kind === 'lyricist' || app.kind === 'composer') { 103 $body.addClass('-patternB'); 104 } 105} 106 107// 表示æéçµãè¾¼ã¿ã®ãã«ãã¦ã³ã«å¤ãæ¿å ¥ããææ°é±ãé¸æç¶æ ã«ããã 108function initPeriod() { 109 const latestYear = Number(yearArray[yearArray.length - 1]); // ææ°å¹´
110 const latestMonth = Number(monthArray[monthArray.length - 1].m); // ææ°æ 111 const lastWeek = dayArray[dayArray.length - 2] || dayArray[0]; // åé±ããªããã°æåã®é± 112 const matchMonths = monthArray.filter(function (ele) { 113 return ele.y === latestYear; 114 }); 115 const matchDays = dayArray.filter(function (ele) { 116 return ele.y === latestYear && ele.m === latestMonth; 117 }); 118 const lastMonths = monthArray.filter(function (ele) { 119 return ele.y === lastWeek.y; 120 }); 121 const lastDays = dayArray.filter(function (ele) { 122 return ele.y === lastWeek.y && ele.m === lastWeek.m; 123 }); 124 125 for (let i = 0; i < yearArray.length; i++) { 126 let item = `<option value="${yearArray[i]}">${yearArray[i]}å¹´</option>`; 127 $('.w_year').append(item); 128 } 129 for (let i = 0; i < matchMonths.length; i++) { 130 let item = `<option value="${matchMonths[i].m}">${matchMonths[i].m}æ</option>`; 131 $('#period-week-month').append(item); 132 $('#period-to-month').append(item); 133 } 134 for (let i = 0; i < matchDays.length; i++) { 135 let item = `<option value="${matchDays[i].v}">${matchDays[i].d}</option>`; 136 $('#period-week-day').append(item); 137 $('#period-to-day').append(item); 138 } 139 for (let i = 0; i < lastMonths.length; i++) { 140 let itemMonth = `<option value="${lastMonths[i].m}">${lastMonths[i].m}æ</option>`; 141 $('#period-from-month').append(itemMonth); 142 } 143 for (let i = 0; i < lastDays.length; i++) { 144 let item = `<option value="${lastDays[i].v}">${lastDays[i].d}</option>`; 145 $('#period-from-day').append(item); 146 } 147 148 $('.w_year').each(function () { 149 $(this) 150 .find('option') 151 .eq(yearArray.length - 1) 152 .prop('selected', true); 153 }); 154 $('.w_month').each(function () { 155 $(this) 156 .find('option') 157 .eq(matchMonths.length - 1) 158 .prop('selected', true); 159 }); 160 $('.w_week').each(function () { 161 $(this) 162 .find('option') 163 .eq(matchDays.length - 1) 164 .prop('selected', true); 165 }); 166 $('#period-from-year').find(`option[value="${lastWeek.y}"]`).prop('selected', true); 167 $('#period-from-month').find(`option[value="${lastWeek.m}"]`).prop('selected', true); 168 $('#period-from-day').find(`option[value="${lastWeek.v}"]`).prop('selected', true); 169} 170 171// ç¾å¨ã®é±ãdates.jsonå ã§æ¤ç´¢ããããã°ãã®é±ãé¸æç¶æ ã«ããã 172function changePeriod() { 173 if (app.period.from && app.period.to && (app.type === 2 || app.type === 3)) { 174 const from = app.formatDate(app.period.from, '/'); // jsonããæ¤ç´¢ãããã/ããã«å¤æ 175 const to = app.formatDate(app.period.to, '/'); // jsonããæ¤ç´¢ãããã/ããã«å¤æ 176 if (app.datesJson.indexOf(from) !== -1 && app.datesJson.indexOf(to) !== -1) { 177 // dates.jsonã«fromã¨toãããå ´å 178 const fromDate = new Date(app.period.from); 179 const toDate = new Date(app.period.to); 180 fromDate.setDate(fromDate.getDate() - 14); // -14æ¥ 181 toDate.setDate(toDate.getDate() - 14); // -14æ¥ 182 $('#period-from-year').val(String(fromDate.getFullYear())).change(); 183 $('#period-from-month') 184 .val(String(fromDate.getMonth() + 1)) 185 .change(); 186 $('#period-from-day').val(String(fromDate.getDate())).change(); 187 $('#period-to-year').val(String(toDate.getFullYear())).change(); 188 $('#period-to-month') 189 .val(String(toDate.getMonth() + 1)) 190 .change(); 191 $('#period-to-day').val(String(toDate.getDate())).change(); 192 $('#period_radio_term').prop('checked', true); 193 } else { 194 // dates.jsonã«fromã¨toããªãå ´å 195 app.period.from = app.formatDate(app.datesJson[app.datesJson.length - 2], '-'); 196 app.period.to = app.formatDate(app.datesJson[app.datesJson.length - 1], '-'); 197 } 198 } else if (app.period.week) { 199 const week = app.formatDate(app.period.week, '/'); // jsonããæ¤ç´¢ãããã/ããã«å¤æ 200 if (app.datesJson.indexOf(week) !== -1) { 201 // dates.jsonã«weekãããå ´å 202 const weekDate = new Date(app.period.week); 203 weekDate.setDate(weekDate.getDate() - 14); // -14æ¥ 204 $('#period-week-year').val(String(weekDate.getFullYear())).change(); 205 $('#period-week-month') 206 .val(String(weekDate.getMonth() + 1)) 207 .change(); 208 $('#period-week-day').val(String(weekDate.getDate())).change(); 209 $('#period_radio_week').prop('checked', true); 210 } else {
211 // dates.jsonã«weekããªãå ´å 212 app.period.week = app.formatDate(app.datesJson[app.datesJson.length - 1], '-'); 213 } 214 } 215} 216 217// 表示æéçµãè¾¼ã¿ã®é¸æããããã«ãã¦ã³ã®id(id)ã®æ¹ã®ã©ã¸ãªãã¿ã³ãæ¬ä¼¼æ¼ä¸ã 218function selectTrigger(id) { 219 if (id === 'period-week-year' || id === 'period-week-month' || id === 'period-week-day') { 220 $('#period_radio_week').trigger('click'); 221 } else { 222 $('#period_radio_term').trigger('click'); 223 } 224} 225 226// 表示æéçµãè¾¼ã¿ã®å ¬éæ¥è¡¨è¨ã夿´ã 227function changeReleased() { 228 if (app.period.from && app.period.to && (app.type === 2 || app.type === 3)) { 229 const from = app.formatDate(app.period.from, '/', false, -5); // -5æ¥ 230 const to = app.formatDate(app.period.to, '/', false, -5); // -5æ¥ 231 $('#period-released').text(`[ ${from} å ¬é ã ${to} å ¬é ]`); 232 } else if (app.period.week) { 233 const week = app.formatDate(app.period.week, '/', false, -5); // -5æ¥ 234 $('#period-released').text(`[ ${week} å ¬é ]`); 235 } 236} 237 238// 239function createDatesArray(result) { 240 // 忥ä»ã2é±éåã«å¤æ 241 let newArray = []; 242 for (let n = 0; n < result.length; n++) { 243 let day = new Date(result[n]); 244 day = app.getNowYMD(new Date(day.setDate(day.getDate() - 14))); 245 newArray.push(day); 246 } 247 248 // é åã« 249 for (let i = 0; i < newArray.length; i++) { 250 // year 251 let year = String(newArray[i].split('/', 1)); 252 if (yearArray.indexOf(year) === -1) yearArray.push(year); 253 254 // month 255 let month = { 256 y: Number(newArray[i].split('/', 2)[0]), 257 m: Number(newArray[i].split('/', 2)[1]), 258 }; 259 if (monthArray.length !== 0) { 260 if (monthArray[monthArray.length - 1].m !== month.m) monthArray.push(month); 261 } else { 262 monthArray.push(month); 263 } 264 265 // day 266 let day = { 267 y: Number(newArray[i].split('/', 3)[0]), 268 m: Number(newArray[i].split('/', 3)[1]), 269 d: Number(newArray[i].split('/', 3)[2]), 270 v: Number(newArray[i].split('/', 3)[2]), 271 }; 272 let date = new Date(day.y, day.m - 1, day.d); 273 date.setDate(date.getDate() + 6); 274 day.d = day.d + 'æ¥ã' + date.getDate() + 'æ¥'; 275 dayArray.push(day); // 鱿¥ä»ãã¼ã¿ãé åã«æ¿å ¥ 276 } 277} 278 279// ãã³ãã¬ã¼ãã®ã¬ã³ããªã³ã° 280const theaderTemplate = Handlebars.compile($('#theader-template').html()); // åææ¨(å½)ã®ææ°é±é ä½ãã³ãã¬ã¼ã使 281const kindsOnly = app.sorts.slice(1); // ç·å以å¤ã®ææ¨(å½)ã®é å 282$('#ranking-list-nav').append( 283 theaderTemplate({ 284 kinds: kindsOnly, 285 }) 286); 287 288// ã¤ã³ã¹ã¿ã³ã¹ 289const seekView = new SeekView(); 290const seekPresenter = new SeekPresenter(seekView); 291const commonView = new CommonView(); 292const commonPresenter = new CommonPresenter(commonView); 293 294// DOM 295const $document = $(document); 296const $win = $(window); 297const $body = $('body'); 298const $kindTabs = $('.main-sct-wrap > .tab button'); // ã¸ã£ã³ã«ã¡ãã¥ã¼ 299const $updatePeriod = $('#update_btn_period'); // 表示æéçµãè¾¼ã¿ã®ãæ´æ°ããã¿ã³ 300const $selectboxes = $('.ranking-refine-inner select'); // ã¢ã¼ãã£ã¹ãé¡çµãè¾¼ã¿ãã«ãã¦ã³ 301const $refineButton = $('#ranking-refine'); // ã¢ã¼ãã£ã¹ãé¡çµãè¾¼ã¿ã®ãçµãè¾¼ãããã¿ã³ 302const $refineReset = $('#ranking-refine-reset'); // ã¢ã¼ãã£ã¹ãé¡çµãè¾¼ã¿ã®ãçµãè¾¼ã¿æ¡ä»¶ãã¯ãªã¢ããã¿ã³ 303const $refineLyricist = $('#refine-lyricist'); 304const $refineComposer = $('#refine-composer'); 305const $refineArtist = $('#refine-artist'); 306const $rankingTtl = $('.ranking-ttl-wrap'); 307const $rankingNav = $('#ranking-list-nav'); 308const $rankNavItemLink = $('#ranking-list-nav a'); // ãã£ã¼ããã¼ãã«ã®ãããã¼ä¸¦ã³æ¿ã 309const $sortRelease = $('#releaseDate'); // çºå£²æ¥ãã«ãã¦ã³ 310const $rankSct = $('.ranking-sct'); 311const $inviewTarget = $('#load-target'); 312const $seekButton = $('#research-songs-label'); // ãæ¥½æ²ãæ¢ãããã¿ã³ 313const $refineSection = $('.ranking-refine'); // ã¢ã¼ãã£ã¹ãçµãè¾¼ã¿ã»ã¯ã·ã§ã³ 314const $tableTitle = $('#ranking-ttl-label'); // ãã£ã¼ããã¼ãã«ã¿ã¤ãã« 315const $popupTheaderUgc = $('#js-popup-theader-ugc > span'); // ãã£ã¼ããã¼ãã«ã®ãããã¼ãããã¢ãã 316const $modalTitle = $('.type3_song_list_modal .other_song_list_ttl h4'); // ã¢ã¼ãã«ã¿ã¤ãã« 317const $modalPlaceholder = $('.type3_song_list_modal .other_song_list_body .input_artist_name'); // ã¢ã¼ãã«ã®å ¥åãã£ã¼ã«ãã®ãã¬ã¼ã¹ãã«ãã¼ 318const $toggleSongButton = $('[data-switch-artist-song="song"]'); // ã¢ã¼ãã«ã®ã楽æ²ããã¿ã³ 319 320// å¤ 321let headerHeight = $('#header > .inner').height(); // ãããã¼ã®é«ã 322let spScrollPos = 0; // SPãã£ã¼ãã®æ¨ªã¹ã¯ãã¼ã«ä½ç½® 323let yearArray = []; // å ¨ã¦ã®å¹´ä¸è¦§ 324let monthArray = []; // å ¨ã¦ã®å¹´ã»æä¸è¦§ 325let dayArray = []; // å ¨ã¦ã®å¹´ã»æã»é±ä¸è¦§ 326 327// position: stickyæªå¯¾å¿ãã©ã¦ã¶ã«sticky-state.jsãé©ç¨ 328const $div = document.createElement('div'); // ãã¹ãç¨divã使 329$div.style.position = 'sticky'; 330const stickySupport = $div.style.position.indexOf('sticky') !== -1; // ãã©ã¦ã¶ãposition: sticky;
330ã«å¯¾å¿ãã¦ãããã©ãã 331if (!stickySupport && ieInit) { 332 new StickyState(document.querySelector('.ranking-ttl-wrap')); // sticy-stateãé©ç¨ 333} 334 335switchKind(app.kind); // ã¸ã£ã³ã«åãæ¿ã 336app.resetChart('inview'); // ãªã»ãã 337app.switchOption('artist'); // æ¤ç´¢ç¨®å¥ãªã»ãã 338 339// dates.jsonã®ãªã¯ã¨ã¹ã 340if (app.datesJqxhr) app.datesJqxhr.abort(); // äºéãªã¯ã¨ã¹ã鲿¢ 341app.datesJqxhr = app.get(`dates.json${app.requestQuery()}`, function (result) { 342 app.datesJson = result; 343 createDatesArray(result); // dates.jsonã®é å使 344 // ã°ãã¼ãã«å¤æ°åæè¨å® 345 if (!app.query['date'] && !app.query['from'] && !app.query['to']) { 346 app.period.week = app.formatDate(app.datesJson[app.datesJson.length - 1], '-'); // jsonã®ææ°é±ãè¨å® 347 } else if (app.query['from'] && app.query['to'] && (app.type === 2 || app.type === 3)) { 348 app.period.from = app.formatDate(app.query['from'], '-'); // URLã®ã¯ã¨ãªããè¨å® 349 app.period.to = app.formatDate(app.query['to'], '-'); // URLã®ã¯ã¨ãªããè¨å® 350 } else if (app.query['date']) { 351 app.period.week = app.formatDate(app.query['date'], '-'); // URLã®ã¯ã¨ãªããè¨å® 352 } 353 if (app.query['sort'] === 'buzz' || app.query['sort'] === 'contact' || app.query['sort'] === 'sales') { 354 app.hybrid = app.query['sort']; // URLã®sortããã¤ããªããã®å ´åãã°ãã¼ãã«å¤æ°ã«å¤ãè¨å® 355 } 356 initPeriod(); // ãã«ãã¦ã³ã«ãã¼ã¿ãæ¿å ¥ãææ°é±ã鏿 357 changePeriod(); // ãã«ãã¦ã³ãæ¬ä¼¼é¸æ 358 changeReleased(); // å ¬éæ¥ããã¹ã夿´ 359 app.chartRequest(); // chart.jsonã®ãªã¯ã¨ã¹ã 360}); 361 362// ã¸ã£ã³ã«ã¡ãã¥ã¼æ¼ä¸æã â»ã¤ã³ãµã¤ãéå® 363$kindTabs.on('click', function (e) { 364 if ($('body').hasClass('-loading')) return; 365 yearArray = []; 366 monthArray = []; 367 dayArray = []; 368 369 $('#period_radio_week').click(); // ã©ã¸ãªãã¿ã³ãªã»ãã 370 $('.w_year, .w_month, .w_week').children().remove(); // ãã«ãã¦ã³ãªã»ãã 371 372 switchKind($(e.currentTarget).attr('data-id')); // ã¸ã£ã³ã«åãæ¿ã 373 app.switchOption('artist'); // æ¤ç´¢ç¨®å¥ãªã»ãã 374 375 // dates.jsonã®ãªã¯ã¨ã¹ã 376 if (app.datesJqxhr) app.datesJqxhr.abort(); // äºéãªã¯ã¨ã¹ã鲿¢ 377 app.datesJqxhr = app.get(`dates.json${app.requestQuery()}`, function (result) { 378 app.datesJson = result; 379 createDatesArray(result); // dates.jsonã®é å使 380 initPeriod(); // ãã«ãã¦ã³ã«ãã¼ã¿ãæ¿å ¥ãææ°é±ã鏿 381 changePeriod(); // ãã«ãã¦ã³ãæ¬ä¼¼é¸æ 382 changeReleased(); // å ¬éæ¥ããã¹ã夿´ 383 app.resetChart(); 384 app.chartRequest(); // chart.jsonã®ãªã¯ã¨ã¹ã 385 }); 386}); 387 388// ã表示æéã®å¤æ´ãã®å¹´ã®å¤æ´æã 389$('.w_year').on('change', function () { 390 const $monthTgt = $(this).parents('.period-date').find('.w_month'); 391 const $weekTgt = $(this).parents('.period-date').find('.w_week'); 392 let year = $(this).val(); 393 let month; 394 let matchMonthArray = []; 395 let matchDayArray = []; 396 397 // month 398 matchMonthArray = monthArray.filter(function (ele) { 399 return ele.y === Number(year); 400 }); 401 402 $monthTgt.empty(); 403 404 for (let i = 0; i < matchMonthArray.length; i++) { 405 let item = `<option value="${matchMonthArray[i].m}">${matchMonthArray[i].m}æ</option>`; 406 $monthTgt.append(item); 407 } 408 409 // week 410 month = Number($monthTgt.val()); 411 matchDayArray = dayArray.filter(function (ele) { 412 return ele.y === Number(year) && ele.m === Number(month); 413 }); 414 415 $weekTgt.empty(); 416 417 for (let i = 0; i < matchDayArray.length; i++) { 418 let item = `<option value="${matchDayArray[i].v}">${matchDayArray[i].d}</option>`; 419 $weekTgt.append(item); 420 } 421 selectTrigger($(this).attr('id')); // ãã«ãã¦ã³ã鏿ãããæ¹ã®ã©ã¸ãªãã¿ã³ãæ¬ä¼¼æ¼ä¸ 422}); 423 424// ã表示æéã®å¤æ´ãã®æã®å¤æ´æã 425$('.w_month').on('change', function () { 426 const $weekTgt = $(this).parents('.period-date').find('.w_week'); 427 let year = $(this).parents('.period-date').find('.w_year').val(); 428 let month = $(this).val(); 429 let matchDayArray = []; 430 431 matchDayArray = dayArray.filter(function (ele) { 432 return ele.y === Number(year) && ele.m === Number(month); 433 }); 434 435 $weekTgt.empty(); 436 437 for (let i = 0; i < matchDayArray.length; i++) { 438 let item = `<option value="${matchDayArray[i].v}">${matchDayArray[i].d}</option>`; 439 $weekTgt.append(item); 440 } 441 selectTrigger($(this).attr('id')); // ãã«ãã¦ã³ã鏿ãããæ¹ã®ã©ã¸ãªãã¿ã³ãæ¬ä¼¼æ¼ä¸ 442}); 443 444// ã表示æéã®å¤æ´ãã®æ¥ã®å¤æ´æã 445$('.w_week').on('change', function () { 446 selectTrigger($(this).attr('id')); // ãã«ãã¦ã³ã鏿ãããæ¹ã®ã©ã¸ãªãã¿ã³ãæ¬ä¼¼æ¼ä¸ 447}); 448 449// ã表示æéã®å¤æ´ãã®ãæ´æ°ããã¿ã³æ¼ä¸æã 450$updatePeriod.on('click', function () { 451 // çµãè¾¼ã¿ãªã»ãã 452 if ($('#period_radio_term').prop('checked') === true && (app.type === 2 || app.type === 3)) { 453 const from = new Date($('#period-from-year').val(), $('#period-from-month').val() - 1, Number($('#period-from-day').val()) + 14); // Dateãªãã¸ã§ã¯ããçæ 454 const to = new Date($('#period-to-year').val(), $('#period-to-month').val() - 1, Number($('#period-to-day').val()) + 14); // Dateãªãã¸ã§ã¯ããçæ 455 app.period.from = app.formatDate(from, '-'); 456 app.period.to = app.formatDate(to, '-'); 457 app.period.week = ''; 458 } else { 459 const week = new Date($('#period-week-year').val(), $('#period-week-month').val() - 1, Number($('#period-week-day').val()) + 14); // Dateãªãã¸ã§ã¯ããçæ 460 app.period.week = app.formatDate(week, '-'); 461 app.period.from = ''; 462 app.period.to = ''; 463 } 464 changeReleased(); // å ¬éæ¥ããã¹ã夿´ 465 app.resetChart();
466 app.chartRequest(); 467}); 468 469// ãã£ã¼ããã¼ãã«ãããã¼ã¡ãã¥ã¼æ¼ä¸æã 470$rankNavItemLink.on('click', function (e) { 471 e.preventDefault(); 472 const $parentLi = $(this).parent(); 473 const id = $(this).attr('data-id'); // data-idãåå¾ 474 app.sort = id === 'hybrid' ? app.hybrid : $(this).attr('data-id'); // ã°ãã¼ãã«å¤æ°ãæ´æ° 475 476 $sortRelease.prop('selectedIndex', 0); // çºå£²æ¥ãã«ãã¦ã³ãªã»ãã 477 if (!$parentLi.hasClass(app.className.act)) { 478 $('#ranking-list-nav li').removeClass(app.className.act); // ãã¼ãã«ãããã¼ã®ã¢ã¯ãã£ãããªã»ãã 479 $('.ranking-list li').removeClass(app.className.act); // ãã¼ãã«ããã£ã®ã¢ã¯ãã£ãããªã»ãã 480 481 app.resetChart(); 482 app.chartRequest(); // chart.jsonã®ãªã¯ã¨ã¹ã 483 } 484}); 485 486// ãã£ã¼ããã¼ãã«ãããã¼ãã«ãã¦ã³æ¼ä¸æã 487$sortRelease.on('change', function () { 488 app.sort = $(this).val(); // ã°ãã¼ãã«å¤æ°ãæ´æ° 489 if (app.sort === 'chart') { 490 $('#ranking-list-nav .list-rank a').trigger('click'); 491 } else { 492 $('#ranking-list-nav li').removeClass(app.className.act); // ãã¼ãã«ãããã¼ã®ã¢ã¯ãã£ãããªã»ãã 493 $('.ranking-list li').removeClass(app.className.act); // ãã¼ãã«ããã£ã®ã¢ã¯ãã£ãããªã»ãã 494 app.resetChart(); 495 app.chartRequest(); // chart.jsonã®ãªã¯ã¨ã¹ã 496 } 497}); 498 499// ã¢ã¼ãã£ã¹ãé¡çµãè¾¼ã¿ãã«ãã¦ã³å¤æ´æã â»ã¤ã³ãµã¤ãéå® 500$selectboxes.on('change', function () { 501 const $parent = $(this).parents('.ranking-refine-select'); 502 $parent.toggleClass('-selected', $(this).val() !== ''); // ãã¬ã¼ã¹ãã«ãã¼ã®è¦ãç®å¤æ´ã¯ã©ã¹ä»ä¸ 503}); 504 505// ã¢ã¼ãã£ã¹ãé¡çµãè¾¼ã¿ã®ãçµãè¾¼ãããã¿ã³æ¼ä¸æã â»ã¤ã³ãµã¤ãéå® 506$refineButton.on('click', function () { 507 if ($refineLyricist.val() === '' && $refineComposer.val() === '' && $refineArtist.val() === '') return alert('æ¡ä»¶ã鏿ãã¦ãã ãã'); // 空ã®å ´åã¯å¦ç䏿¢ 508 $('.ranking-sct-cont').addClass('-loading'); // ãã¼ãã£ã³ã°ä»ä¸ 509 510 app.resetChart('inview', 'scroll', 'table'); // ã¹ã¯ãã¼ã«ä½ç½®ã»ãã£ã¼ããã¼ãã«ãªã»ãã 511 $inviewTarget.removeClass('inview'); 512 app.pageNum = ''; // ãã¼ã¸çªå·ã空㫠513 app.chartRequest(function () { 514 app.inviewFlag = false; // inviewã追å èªã¿è¾¼ã¿ãããªã 515 $('.ranking-sct-cont').removeClass('-loading'); // ãã¼ãã£ã³ã°é¤å» 516 const $listBoxInfo = $('.list-ttl-box-name'); 517 $listBoxInfo.each(function () { 518 const $listLyricist = $(this).find('.list-ttl-box-name-lyricist'); 519 const $listComposer = $(this).find('.list-ttl-box-name-composer'); 520 const $listArtist = $(this).find('.list-ttl-box-name-airtist'); 521 522 // ãã©ã° 523 let hideLyricist = false; 524 let hideComposer = false; 525 let hideArtist = false; 526 527 if ($refineLyricist.val() !== '') { 528 if ($listLyricist.text() !== $refineLyricist.val()) { 529 hideLyricist = true; 530 $listLyricist.removeClass('-hit'); 531 } else { 532 $listLyricist.addClass('-hit'); 533 } 534 } else { 535 $listLyricist.removeClass('-hit'); 536 } 537 538 if ($refineComposer.val() !== '') { 539 if ($listComposer.text() !== $refineComposer.val()) { 540 hideComposer = true; 541 $listComposer.removeClass('-hit'); 542 } else { 543 $listComposer.addClass('-hit'); 544 } 545 } else { 546 $listComposer.removeClass('-hit'); 547 } 548 549 if ($refineArtist.val() !== '') { 550 if ($listArtist.text() !== $refineArtist.val()) { 551 hideArtist = true; 552 $listArtist.removeClass('-hit'); 553 } else { 554 $listArtist.addClass('-hit'); 555 } 556 } else { 557 $listArtist.removeClass('-hit'); 558 } 559 560 // çµã込㿠561 $(this) 562 .parents('.ranking-list') 563 .toggleClass('-hide', hideLyricist || hideComposer || hideArtist); 564 }); 565 566 // 0ä»¶ã®å ´å 567 if ($('.ranking-list.-hide').length === $('.ranking-sct-cont > .ranking-list').length) { 568 $('.ranking-ttl-wrap').add('.ranking-sct').addClass('-hide'); 569 $('.ranking-sct-nohit').addClass('-show'); 570 } else { 571 $('.ranking-ttl-wrap').add('.ranking-sct').removeClass('-hide'); 572 $('.ranking-sct-nohit').removeClass('-show'); 573 } 574 }); // chart.jsonã®ãªã¯ã¨ã¹ã 575}); 576 577// ãçµãè¾¼ã¿æ¡ä»¶ãã¯ãªã¢ããã¿ã³æ¼ä¸æã â»ã¤ã³ãµã¤ãéå® 578$refineReset.on('click', function (e) { 579 app.resetChart();
580 app.chartRequest(); 581}); 582 583// ãã£ã¼ããã¼ãã«ã®æ¥½æ²åä¸ã®ã¢ã¼ãã£ã¹ãåé¡ãæ¼ä¸æãâ»ã¤ã³ãµã¤ãéå® 584$document.on('click', '.list-ttl-box-name > button', function () { 585 const refineName = $(this).text(); // æ¼ä¸ããååãåå¾ 586 const $refineSelect = $(`#${$(this).data('refine')}`); // æ¼ä¸ãããã¿ã³ããã»ã¬ã¯ãããã¯ã¹è¦ç´ ãåå¾ 587 588 if (refineName === $refineSelect.val()) { 589 $refineSelect.prop('selectedIndex', 0); // 対象ã»ã¬ã¯ãããã¯ã¹ã§ãåãååã鏿ããã¦ããããªã»ãã 590 } else { 591 $refineSelect.find('option').each(function () { 592 if ($(this).attr('value') === refineName) $(this).attr('selected', true); // 対象ã»ã¬ã¯ãããã¯ã¹ã®è©²å½ãªãã·ã§ã³ã«selectedãä»ä¸ 593 }); 594 } 595 $refineSelect.trigger('change'); // 対象ã»ã¬ã¯ãããã¯ã¹ãæ¬ä¼¼é¸æ 596 if ($refineLyricist.val() === '' && $refineComposer.val() === '' && $refineArtist.val() === '') { 597 $refineReset.trigger('click'); // ã»ã¬ã¯ãããã¯ã¹ãå ¨ã¦ç©ºãªããçµãè¾¼ã¿æ¡ä»¶ãã¯ãªã¢ããã¿ã³ãæ¬ä¼¼æ¼ä¸ 598 } else { 599 $refineButton.trigger('click'); // ã»ã¬ã¯ãããã¯ã¹ã空ã§ãªããã°ãçµãè¾¼ãããã¿ã³ãæ¬ä¼¼æ¼ä¸ 600 } 601}); 602 603// ã¹ã¯ãã¼ã«ãã¦ãã¥ã¼ãã¼ãã«è¦ç´ ã表示æã 604$document.on('inview', '.inview', (event, isInView) => { 605 if (app.type !== 2 && app.type !== 3) return; // Pro, Biz以å¤ã¯å¦ççµäº 606 if (app.inviewFlag && isInView) { 607 // ãã©ã°ãtrueã§ããªã¬ã¼è¦ç´ ããã¥ã¼ãã¼ãã«å ¥ã£ãå ´å 608 app.pageNum++; 609 if (app.type === 2) { 610 $inviewTarget.removeClass('inview'); // ä¸åº¦çºç«ããããããªã¬ã¼ãå¤ã 611 } 612 app.chartRequest(); 613 } 614}); 615 616// SPãã£ã¼ããã¼ãã«ã®æ¨ªã¹ã¯ãã¼ã«æã 617$rankSct.on('scroll', function () { 618 if (!app.sp) return; // SP以å¤ã¯å¦ççµäº 619 $rankingTtl.scrollLeft($(this).scrollLeft()); 620}); 621$rankingTtl.on('scroll', function () { 622 if (!app.sp) return; // SP以å¤ã¯å¦ççµäº 623 $rankSct.scrollLeft($(this).scrollLeft()); 624}); 625 626// SPãã£ã¼ãå³ä¸ã®æ¨ªã¹ã¯ãã¼ã«ç¢å°ãã¿ã³æ¼ä¸æã 627$('#scroll-back').on('click', () => { 628 if (!app.sp) return; // SP以å¤ã¯å¦ççµäº 629 $rankingTtl.animate({ scrollLeft: 0 }, 250); 630}); 631$('#scroll-go').on('click', () => { 632 if (!app.sp) return; // SP以å¤ã¯å¦ççµäº 633 let scrLimit = $rankingNav.width() - $rankingTtl.width(); 634 $rankingTtl.animate({ scrollLeft: scrLimit }, 250); 635}); 636 637// ã¦ã£ã³ãã¦ãªãµã¤ãºæãSPãã¼ãã«ãããã¼ã®Stickyä½ç½®èª¿æ´ã 638app.sp && $rankingTtl.css('top', `${headerHeight}px`); 639$win.on('resize', () => { 640 if (!app.sp) return; // SP以å¤ã¯å¦ççµäº 641 headerHeight = $('#header > .inner').height(); 642 window.innerWidth <= app.breakpoint ? $rankingTtl.css('top', `${headerHeight}px`) : $rankingTtl.css('top', '0'); 643});
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.