Normally, when navigating away from an empty format folder, it'll
disappear from the folder list. This keeps the folder visible if you
just opened it from a team selector or the 'New format folder'
button, so you can drag teams from other folders to that folder.
This was ridiculous, or, in other words, par for the course when
you're dealing with HTML5 drag-and-drop.
Folders are now clickable divs instead of buttons. This turned out
not to be necessary as it was a different issue that was causing
drag-and-drop to fail, but I'd already changed everything over when
I discovered the real bug. Oh well, some things are slightly nicer
this way.
You can now add formats to the teambuilder folderbar and select
teambuilder formats using the same Formats dropdown previously
used for challenges and searches.
It is no longer to move a team back to Uncategorized. A future
update will fix this.
The team selector now hides teams that aren't for the format, by
default. Other teams can still be selected with a 'more' button.
There's now a Teambuilder button to be taken straight to making
or editing teams for that format.
The folders are really just format filter views, but in theory, this
should be all people need.
This implementation is very basic but I'm pretty sure I've gotten all
the bugs out. On small screens, the folders simply don't appear, on
the assumption that this will only happen on mobile, where people
shouldn't be creating enough teams to need folders, anyway. (I'll
fully support mobile later.)
Third-party servers may need to re-style the Edit and Delete buttons,
since they're black on transparent, which may interact poorly with
certain edgy background styles.
There apparently exist very bad security software that MitMs HTTPS
connections to set X-Frame-Options when I didn't want that at all
and actually crossprotocol.html is intended for embedding in an
iframe.
Hopefully this header will allow aforementioned software to take
the hint.
Default backgrounds are still left-aligned, mainly for Horizon and
Waterfall which are designed for their left side to be visible, but
custom backgrounds are now centered on the assumption that that's
what most users want.
When loading a background, we use Color Thief to get a six-color
palette from the image, for use on the main menu buttons.
Only hue and lightness are extracted.
https://github.com/lokesh/color-thief/
Backgrounds are now stored in localStorage in the current origin,
rather than the prefs origin. This allows faster loading, as well
as different backgrounds for different origins, which other
servers should like since it means their backgrounds get seen
at least once before possibly being replaced.
Special thanks to Joim for the base code.