For a while it's been bothering me that the song list can't be sorted by difficulty, both for consistency and because sometimes I want to find the longest or shortest songs. Now that I know JavaScript, I would be very happy to write the code for it if I could see where the rest of the sorting is. Couldn't find it with the Chrome dev tools.
Sort songs list by length
Collapse
X
-
Sort songs list by length
Two-handed alt (now main) account of Bobogoobo
Best AAAs: Gacha Gacha Cute Figu atto Mate [56], Song of the second moon [52], Musicmaker RX [52], Wish (Reprise) [51], Nyanyanyanyanyanyanya! [51], Exogenesis [51]
Quest for Scarhand: 3+ blackflags on Pure In Asia, blackflag on Iced Innocence
2020 update: all of these got bumped up 4 (rip Scarhand unlock), rusty, new AAA Power Rocket [56?]
2021 semiannual return: Connect (HOUSE SOUL REMIX) [57] (was blackflag from 2013), second blackflag on Call Upon the Seaponies; 2023: Polar 240 [56]
BFs: 127 and counting (as of 2013-11-10)Tags: None -
Re: Sort songs list by length
While I'm here, is there a reason that styles don't apply to the block for regular tokens?Two-handed alt (now main) account of Bobogoobo
Best AAAs: Gacha Gacha Cute Figu atto Mate [56], Song of the second moon [52], Musicmaker RX [52], Wish (Reprise) [51], Nyanyanyanyanyanyanya! [51], Exogenesis [51]
Quest for Scarhand: 3+ blackflags on Pure In Asia, blackflag on Iced Innocence
2020 update: all of these got bumped up 4 (rip Scarhand unlock), rusty, new AAA Power Rocket [56?]
2021 semiannual return: Connect (HOUSE SOUL REMIX) [57] (was blackflag from 2013), second blackflag on Call Upon the Seaponies; 2023: Polar 240 [56]
BFs: 127 and counting (as of 2013-11-10) -
-
Comment
-
Re: Sort songs list by length
"Cannot" is a strong word. It should be fairly simple to do even without jQuery, by, as you said, converting it to a value of seconds (though I'm pretty sure sorting it as a string would work similarly except for songs longer than ten minutes, which is what, two songs?). How would that be meaningless? Yes, there is a thread for that information, but being able to sort the song list, which is always up to date and more convenient, would be better. Plus, as I said, I don't like it being the only unsortable column for no reason.Two-handed alt (now main) account of Bobogoobo
Best AAAs: Gacha Gacha Cute Figu atto Mate [56], Song of the second moon [52], Musicmaker RX [52], Wish (Reprise) [51], Nyanyanyanyanyanyanya! [51], Exogenesis [51]
Quest for Scarhand: 3+ blackflags on Pure In Asia, blackflag on Iced Innocence
2020 update: all of these got bumped up 4 (rip Scarhand unlock), rusty, new AAA Power Rocket [56?]
2021 semiannual return: Connect (HOUSE SOUL REMIX) [57] (was blackflag from 2013), second blackflag on Call Upon the Seaponies; 2023: Polar 240 [56]
BFs: 127 and counting (as of 2013-11-10)Comment
-
Re: Sort songs list by length
But it's a problem for songs more than 1 minute. In most languages it would be simple but I assume flash isn't good at handling such things. There is such a thread for it, but it's from when there were only about 500 songs. If only it were something like Java you could just tostring all the times and then split the strings back up to get the information from them. Or you could just change all the times of the songs to just be in seconds and have the stuff with the colon be a calculated field, but I assume it's probably too late to realistically make that kind of change. I don't think there's any easy way it can be done.
Comment
-
Re: Sort songs list by length
I honestly would like to know that a song is 2:34 and not 154 seconds. Just for sake of standard representation. I can't get a lot of context from 342 seconds worth of music, other than it's probably long to some degree.
I wonder if there's a way to sort by seconds, and then convert that value into the more conventional time as shown with a colon.Comment
-
Re: Sort songs list by length
I linked to the page I was talking about in my first post; it's nothing about in-game information. And I meant that in the JavaScript code that does the sorting, it would internally convert to a seconds value and use that for sorting. I'll just go write the code, though it'll use jQuery and would need adjustment to work without it, which I can do if you'd like to implement this on the page (though I assume incorporating it into existing code would be more efficient). Though it probably wouldn't be terrible to import jQuery for this one page.
Well, I'm not done yet, but here's a preview. Go to Chrome's JS console (Ctrl+Shift+J) and paste this code, then click the Length header.
Code:(function() { var head= document.getElementsByTagName('head')[0]; var script= document.createElement('script'); script.type= 'text/javascript'; script.src= 'http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js'; head.appendChild(script); }()); $(document).ready(function() { $('table:first tr:first th:nth-child(7)').replaceWith('<th id="lengthSort" nowrap><a>Length</a></th>'); $('#lengthSort').css({'color':'#4A84B5', 'cursor':'pointer'}).on('click', function() { var rows = $('table:first tr').toArray(), rowsString = ''; rows.shift(); rows.sort(function(a, b) { var time1 = $(a).children('td:nth-child(7)').text().split(':'), time2 = $(b).children('td:nth-child(7)').text().split(':'); time1 = time1[0] * 60 + time1[1] * 1; time2 = time2[0] * 60 + time2[1] * 1; return time1 - time2; }); for (var i = 0; i < rows.length; i++) { rowsString += $(rows[i])[0].outerHTML; } $('table:first').replaceWith('<table width="770">' + $('table:first tr:first')[0].outerHTML + rowsString + '</table>'); }); });Last edited by Viisbyxa; 06-22-2013, 06:44 AM.Two-handed alt (now main) account of Bobogoobo
Best AAAs: Gacha Gacha Cute Figu atto Mate [56], Song of the second moon [52], Musicmaker RX [52], Wish (Reprise) [51], Nyanyanyanyanyanyanya! [51], Exogenesis [51]
Quest for Scarhand: 3+ blackflags on Pure In Asia, blackflag on Iced Innocence
2020 update: all of these got bumped up 4 (rip Scarhand unlock), rusty, new AAA Power Rocket [56?]
2021 semiannual return: Connect (HOUSE SOUL REMIX) [57] (was blackflag from 2013), second blackflag on Call Upon the Seaponies; 2023: Polar 240 [56]
BFs: 127 and counting (as of 2013-11-10)Comment
-
-
Re: Sort songs list by length
And so it is, thanks.Two-handed alt (now main) account of Bobogoobo
Best AAAs: Gacha Gacha Cute Figu atto Mate [56], Song of the second moon [52], Musicmaker RX [52], Wish (Reprise) [51], Nyanyanyanyanyanyanya! [51], Exogenesis [51]
Quest for Scarhand: 3+ blackflags on Pure In Asia, blackflag on Iced Innocence
2020 update: all of these got bumped up 4 (rip Scarhand unlock), rusty, new AAA Power Rocket [56?]
2021 semiannual return: Connect (HOUSE SOUL REMIX) [57] (was blackflag from 2013), second blackflag on Call Upon the Seaponies; 2023: Polar 240 [56]
BFs: 127 and counting (as of 2013-11-10)Comment



Comment