Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a hotkey to select pages #246

Open
Franck-Nein opened this issue Aug 10, 2023 · 2 comments
Open

Use a hotkey to select pages #246

Franck-Nein opened this issue Aug 10, 2023 · 2 comments

Comments

@Franck-Nein
Copy link

Franck-Nein commented Aug 10, 2023

Something like this:

tmp-2023-08-10_18.19.04.mp4

If you want to download a few separate page ranges, it is kind of annoying to have to remember the page numbers and then write them into the range field
I implemented it on my fork, but I don't really have much experience with JavaScript, so while it works, it probably has problems.

@ccloli
Copy link
Owner

ccloli commented Aug 19, 2023

Sorry for the late reply, I just checked your implementation, it looks great, and even compatible with EX Better Thumbnails, a userscript I'm using that can autoload thumbnails of next page.

Normalizing selected pages into pages range (1,2,3,4,5 -> 1-5) is not necessary I think, but happy to see it happens.

Would be great if it supports batch selection like drag a rectangle to select, or hold E key and move your mouse to select (it works somehow but has bug). Or keep selected pages range when you're navigate to next page (like using sessionStorage stuff).

If it's not easy for you to implement this, I could made such changes. Though when it comes out will be Soon™, I don't have a decent plan to complete recent features.

@Franck-Nein
Copy link
Author

Franck-Nein commented Aug 20, 2023

I used sessionStorage to store ranges between page changes on the same day I opened the issue. However, I think I did it in a messy way. So, I decided not to update the issue in case I figure out a better solution.

jtmp-2023-08-20_13.10.30.mp4

I store the page list using the gallery ID as the key. This way, if you open a different gallery in the same tab, it doesn't cause any issues.
I use the key "Clear" to remove it the next time the user selects something after clicking the Clear button.
Screenshot from 2023-08-20 13-23-09

The batch selection/drag-to-select is causing me a lot of trouble. I did make it work using a different key. You press the key to select the first item and then press it again for the last item of the range. But, it doesn't update the selection in real-time, so it's not great. Also, I couldn't get the "hold to select range" to work. It seems to sometimes detect an extra key press when releasing the held key.

I also included a temporary "clear selection" button until I can work out how to update the range when the user manually changes or deletes the ranges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants