A sorter site for Idolm@ster Characters
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add license, warning for nested filter & 0/1-character sort

execfera 363a89e0 4b669815

+17 -2
+7
LICENSE.md
··· 1 + Copyright 2018 Frelia (@execfera) 2 + 3 + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 + 5 + The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 + 7 + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+1 -1
src/js/data/2018-02-20.js
··· 660 660 }, 661 661 { 662 662 name: "Imaizumi Kagerou", 663 - img: "b5UMjD8.png", 663 + img: "qwwL0bB.png", 664 664 opts: { 665 665 series: ["DDC", "ISC"], 666 666 stage: ["st3"]
+9 -1
src/js/main.js
··· 138 138 characterDataToSort = characterData.slice(0); 139 139 140 140 /** Check selected options and convert to boolean array form. */ 141 + optTaken = []; 142 + 141 143 options.forEach(opt => { 142 144 if ('sub' in opt) { 143 145 if (!document.getElementById(`cbgroup-${opt.key}`).checked) optTaken.push(false); ··· 180 182 return subList; 181 183 }, []); 182 184 characterDataToSort = characterDataToSort.filter(char => { 183 - return char.opts[opt.key].some(key => subArray.includes(key)); 185 + if (!(opt.key in char.opts)) console.warn(`Warning: ${opt.key} not set for ${char.name}.`); 186 + return opt.key in char.opts && char.opts[opt.key].some(key => subArray.includes(key)); 184 187 }); 185 188 } 186 189 } else if (optTaken[index]) { 187 190 characterDataToSort = characterDataToSort.filter(char => !char.opts[opt.key]); 188 191 } 189 192 }); 193 + 194 + if (characterDataToSort.length < 2) { 195 + alert('Cannot sort with less than two characters. Please reselect.'); 196 + return; 197 + } 190 198 191 199 /** Shuffle character array with timestamp seed. */ 192 200 timestamp = timestamp || new Date().getTime();