theCrius / tildes-extended

Extension for Chrome and Firefox to enhance the UX/UI of https://tildes.net
ISC License
14 stars 5 forks source link

[Feature Request] Allow importing multiple styles #11

Closed Bauke closed 6 years ago

Bauke commented 6 years ago

Add the ability to add more input boxes for multiple custom styles. I've been working on a Tildes Compact style which doesn't change any of the colors or anything but instead modifies the layout (and makes it more compact).

Having the ability to add multiple custom styles somebody could use both a custom theme and something like Tildes Compact.

Something like this

image

theCrius commented 6 years ago

(closed by mistake)

Tetracyclic commented 6 years ago

I've implemented basic support for this. You can enter multiple comma separated stylesheets, as well as additional custom CSS which is all concatenated together and stored.

One caveat, I've not actually tested it, as I only have access to git and VSCode currently, but no build tools.

Here's the commit for it on my own branch, any chance you can take a look at it and see if this is going in the right direction?

theCrius commented 6 years ago

I just finished after a 3 hours working on some bug-fixes, I'll have lunch and give it a look between today and tomorrow.

As a generic heads up, I want to try and give the option UI a better look quite soon as new features are added quickly enough and I don't feel like keep adding stuff in a never-ending scrolling page.

This is to give you an heads up in not limiting yourself in a single text field with URL to be sent with a comma as separator. Especially because right now we've quite tech savvy users but in the future could not be the same.

having said that, for now don't worry about UI and go ahead, i'll check on it soon enough :)

And thanks!

Tetracyclic commented 6 years ago

Here's the branch for the change: https://github.com/theCrius/tildes-extended/tree/features/extended_css

theCrius commented 6 years ago

Working on it, there were some typos. I'm cleaning up. Will commit soon enough :)

theCrius commented 6 years ago

Ok , just pushed this 3d5f29dbadd98af205481b266d3452139897cc1d

I basically cleaned it up and fixed some typos and lines that has been eaten by the branching out.

The biggest issue was using .map() without assigning its returned value to anything. That was making everything just run empty :)

I used $.ajax synchronous for the sake of easier code to read but I'd like for it to be asynchrounous mostly because it locks the page and it's horrible to see (not that the user should do anything while we load css/save).
In my book it's not an high priority anyway so feel free to experiment with it if you want.

Imho we could join this into the develop branch and give it a full test. I don't have time today but to be honest the changes are quite limited to the dedicated feature's files and it's something I meant to be like that to avoid too broad side effects

If you feel like testing, compile it locally and try to load the unpackaged extension. I tested quickly with Dracula Theme + Compact + a custom css (changing colours around) and seems to be working.