1$(function() { 2 $("img.lazy").lazyload(); 3}); 4 5const buttonOpen = document.getElementById('modal_open'); 6const modal = document.getElementById('modal'); 7const buttonClose = document.getElementsByClassName('is-cancel')[0]; 8 9// ãã¿ã³ãã¯ãªãã¯ãããæ 10buttonOpen.addEventListener('click', modal_open); 11function modal_open() { 12 modal.style.display = 'block'; 13} 14 15// ããå°ãã¯ãªãã¯ãããæ 16buttonClose.addEventListener('click', modal_close); 17function modal_close() { 18 modal.style.display = 'none'; 19} 20 21// ã¢ã¼ãã«ã³ã³ãã³ã以å¤ãã¯ãªãã¯ãããæ 22addEventListener('click', outsideClose); 23function outsideClose(e) { 24 if (e.target == modal) { 25 modal.style.display = 'none'; 26 } 27} 28 29// ãã©ã¼ã éä¿¡æã«çµãè¾¼ã¿æ¡ä»¶ãURLã«è¿½å ãã 30document.querySelector('.search-form').addEventListener('submit', function(event) { 31 event.preventDefault(); // ããã©ã«ãã®ãã©ã¼ã éä¿¡ã鲿¢ 32 33 // çµãè¾¼ã¿æ¡ä»¶ãåå¾ 34 var registTerm = document.querySelector('input[name="regist_term"]').value; 35 var shibu = document.querySelector('select[name="shibu"]').value; 36 var a1 = document.querySelector('input[name="A1"]').checked ? 'A1' : ''; 37 var a2 = document.querySelector('input[name="A2"]').checked ? 'A2' : ''; 38 var b1 = document.querySelector('input[name="B1"]').checked ? 'B1' : ''; 39 var b2 = document.querySelector('input[name="B2"]').checked ? 'B2' : ''; 40 var male = document.querySelector('input[name="male"]').checked ? 'male' : ''; 41 var female = document.querySelector('input[name="female"]').checked ? 'female' : ''; 42 var favo = document.getElementsByName('favo'); 43 var favo_length = favo.length; 44 var fav_on = 0; 45 for (i = 0; i < favo_length; i++){ 46 if (favo.item(i).checked){ 47 fav_on = favo.item(i).value; 48 } 49 } 50 51 // çµãè¾¼ã¿æ¡ä»¶ã"/"åºåãã§çµã¿ç«ã¦ 52 var filterString = ''; 53 if (registTerm) filterString += 'term-' + registTerm + '/'; 54 if (a1 || a2 || b1 || b2) { 55 if (a1 && a2 && b1 && b2) { 56 ; // ä½ãããªã 57 } else { 58 filterString += 'class-' + [a1, a2, b1, b2].filter(Boolean).join(',') + '/'; 59 } 60 } 61 if (male || female) { 62 if (male && female) { 63 ; // ä½ãããªã 64 } else {
65 filterString += 'gender-' + [male, female].filter(Boolean).join(',') + '/'; 66 } 67 } 68 if (shibu) filterString += 'shibu-' + shibu + '/'; 69 if (fav_on === "1") filterString += '?favorite=1' + '/'; 70 71 // çµãè¾¼ã¿æ¡ä»¶ãURLã«è¿½å 72 var url = '/boatracer/search'; // ããã«ãã¼ã¹ã®URLãè¨å® 73 if (filterString) { 74 url += '/' + filterString.slice(0, -1); // æå¾ã® "/" ãåé¤ 75 } 76 77 // ãã¼ã¸ã®ãªãã¤ã¬ã¯ã 78 window.location.href = url; 79}); 80 81$('#sort_menu').click(function(e) { 82 $('#sort_list_back').toggle(); 83}); 84 85var sortRacers = function(cond) { 86 localStorage.setItem('sensyu_file_sort', cond); 87 88 var racers = $('.sensyu'); 89 90 // ã¢ã¤ã³ã³å¤æ´ 91 if (cond == 'popularity') { 92 $('#sort_menu').html('人æ°é <img id="sort_menu_img" src="/s/sp/premium/img/sensyu-file/arrow.svg" width="12" height="12" alt="">'); 93 } else if (cond == 'toban-asc') { 94 $('#sort_menu').html('ç»é²çªå· æé <img id="sort_menu_img" src="/s/sp/premium/img/sensyu-file/arrow.svg" width="12" height="12" alt="">'); 95 } else if (cond == 'toban-desc') { 96 $('#sort_menu').html('ç»é²çªå· éé <img id="sort_menu_img" src="/s/sp/premium/img/sensyu-file/arrow.svg" width="12" height="12" alt="">'); 97 } else if (cond == 'name-asc') { 98 $('#sort_menu').html('æ°å æé <img id="sort_menu_img" src="/s/sp/premium/img/sensyu-file/arrow.svg" width="12" height="12" alt="">'); 99 } else if (cond == 'name-desc') { 100 $('#sort_menu').html('æ°å éé <img id="sort_menu_img" src="/s/sp/premium/img/sensyu-file/arrow.svg" width="12" height="12" alt="">'); 101 } 102 103 // ã½ã¼ã 104 $('.sensyu').show(); 105 $('.no-favo').hide(); 106 if (cond == 'popularity') { 107 $('.p_off').hide(); 108 } else if (cond == 'favorite') { 109 $('.f_off').hide(); 110 $('.no-favo').show(); 111 } 112 113 racers.sort( function(a, b) { 114 if (cond == 'toban-asc') { 115 var toban_a = $(a).data('toban') 116 var toban_b = $(b).data('toban'); 117 if( toban_a < toban_b ) return -1; 118 if( toban_a > toban_b ) return 1; 119 return 0; 120 } 121 else if (cond == 'toban-desc') { 122 var toban_a = $(a).data('toban') 123 var toban_b = $(b).data('toban'); 124 if( toban_a < toban_b ) return 1; 125 if( toban_a > toban_b ) return -1; 126 return 0; 127 } 128 else if (cond == 'name-asc') { 129 var name_a = $(a).data('name') 130 var name_b = $(b).data('name'); 131 if( name_a < name_b ) return -1; 132 if( name_a > name_b ) return 1; 133 var toban_a = $(a).data('toban') 134 var toban_b = $(b).data('toban'); 135 if( toban_a < toban_b ) return -1; 136 if( toban_a > toban_b ) return 1; 137 return 0; 138 } 139 else if (cond == 'name-desc') { 140 var name_a = $(a).data('name') 141 var name_b = $(b).data('name'); 142 if( name_a < name_b ) return 1; 143 if( name_a > name_b ) return -1; 144 var toban_a = $(a).data('toban') 145 var toban_b = $(b).data('toban'); 146 if( toban_a < toban_b ) return -1; 147 if( toban_a > toban_b ) return 1; 148 return 0; 149 } 150 else if (cond == 'male') { 151 var seibetu_a = $(a).data('seibetu') 152 var seibetu_b = $(b).data('seibetu'); 153 if( seibetu_a < seibetu_b ) return -1; 154 if( seibetu_a > seibetu_b ) return 1; 155 var toban_a = $(a).data('toban') 156 var toban_b = $(b).data('toban'); 157 if( toban_a < toban_b ) return -1; 158 if( toban_a > toban_b ) return 1; 159 return 0; 160 } 161 else if (cond == 'female') { 162 var seibetu_a = $(a).data('seibetu') 163 var seibetu_b = $(b).data('seibetu'); 164 if( seibetu_a < seibetu_b ) return 1; 165 if( seibetu_a > seibetu_b ) return -1; 166 var toban_a = $(a).data('toban') 167 var toban_b = $(b).data('toban'); 168 if( toban_a < toban_b ) return -1; 169 if( toban_a > toban_b ) return 1; 170 return 0; 171 } 172 else if (cond == 'popularity') { 173 var favo_a = $(a).data('favo') 174 var favo_b = $(b).data('favo'); 175 if( favo_a < favo_b ) return 1; 176 if( favo_a > favo_b ) return -1; 177 178 var seibetu_a = $(a).data('seibetu') 179 var seibetu_b = $(b).data('seibetu'); 180 if( seibetu_a < seibetu_b ) return 1; 181 if( seibetu_a > seibetu_b ) return -1; 182 183 var toban_a = $(a).data('toban') 184 var toban_b = $(b).data('toban'); 185 if( toban_a < toban_b ) return 1; 186 if( toban_a > toban_b ) return -1; 187 return 0; 188 } 189 else if (cond == 'favorite') {
190 var toban_a = $(a).data('toban') 191 var toban_b = $(b).data('toban'); 192 if( toban_a < toban_b ) return -1; 193 if( toban_a > toban_b ) return 1; 194 return 0; 195 } 196 }); 197 $('#sensyu_list').empty(); 198 $('#sensyu_list').html(racers); 199 200 $('#sensyu_list').off('click', '.fav_star_on'); 201 $('#sensyu_list').on('click', '.fav_star_on', function() { 202 fav_star_on_fun($(this).data('toban')); 203 }); 204 $('#sensyu_list').off('click', '.fav_star_off'); 205 $('#sensyu_list').on('click', '.fav_star_off', function() { 206 fav_star_off_fun($(this).data('toban')); 207 }); 208}; 209 210$("#sort_list_back").click(function() { 211 $('#sort_list_back').hide(); 212}); 213 214$('#sort_list .pop_list li').click(function() { 215 $('#sort_list_back').hide(); 216 sortRacers( $(this).attr("id") ); 217 $("img.lazy").lazyload(); 218 return false; 219}); 220 221if(('localStorage' in window) && (window.localStorage !== null)) { 222 var sensyu_file_sort = localStorage.getItem('sensyu_file_sort'); 223 if ( sensyu_file_sort ) { 224 sortRacers( sensyu_file_sort ); 225 } 226} 227 228 229
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.