Welcome Guest ( Log In | Register )

3 Pages V < 1 2 3 >  
Reply to this topicStart new topic
> [Script] EH Gallery Quick Favourite, No more popups, just hover and click

 
post Nov 28 2016, 05:33
Post #21
Ryo75



Regular Poster
*****
Group: Gold Star Club
Posts: 663
Joined: 25-March 12
Level 498 (Dovahkiin)


It's working again here as well. I can also see the custom name for each favorite category, making it even better. Thank you for fixing it! (IMG:[invalid] style_emoticons/default/smile.gif)

User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jan 21 2017, 16:52
Post #22
FabulousCupcake



Casual Poster
****
Group: Gold Star Club
Posts: 492
Joined: 15-April 14
Level 451 (Dovahkiin)


v2.0.3 released; it should work with the new gallery url pattern.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jan 23 2017, 08:46
Post #23
mondere



uʍop ǝpᴉsdn ǝɹ,noʎ
****
Group: Gold Star Club
Posts: 482
Joined: 17-September 08
Level 435 (Godslayer)


This script is a godsend

Is there any way to hotkey selecting a favorite category? Even if it's a bunch of keystrokes it would be fine, as I could still macro it. I'd pay money for that functionality.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jan 23 2017, 14:32
Post #24
FabulousCupcake



Casual Poster
****
Group: Gold Star Club
Posts: 492
Joined: 15-April 14
Level 451 (Dovahkiin)


QUOTE(mondere @ Jan 23 2017, 07:46) *

This script is a godsend

Is there any way to hotkey selecting a favorite category? Even if it's a bunch of keystrokes it would be fine, as I could still macro it. I'd pay money for that functionality.


It's done.
Fortunately the only thing that needs be written for this feature is just a keypress event listener.
We can then throw it to the already-existing logic to send the favouriting POST request.
And of course, work on the UI! (IMG:[invalid] style_emoticons/default/heh.gif)

v2.0.3 and v2.1.0 diff:
[www.diffchecker.com] https://www.diffchecker.com/Nn9k6CKb

This post has been edited by FabulousCupcake: Jan 23 2017, 14:33
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jan 23 2017, 20:41
Post #25
blue penguin



in umbra, igitur, pugnabimus
***********
Group: Gold Star Club
Posts: 10,046
Joined: 24-March 12
Level 500 (Godslayer)


I have cleaned my browser cache to test a couple of things and found out that the script does not pick up the favourite names unless you have opened the favourite popup at least once.

i.e. if i clear the cache the localStorage is not there so i get "Favourite 1", "Favourite 2", etc.

The problem is that to update the localStorage i need to run if ( isFavouritePopupPage() ), which will not happen as long as i am using the script. In other words, i can read the code and force the correct URL to get the favourites, but most users won't do it.

Maybe it would be better to do it in the following fashion:

1. if EHGQF-fav cannot be found in localStorage
1.1. fire a request to gallerypopups.php?addfav
1.2. update localStorage with favourite names
2. else do nothing
3. Updage #gdf with favourite names from localStorage

I'd take this part (inside updateCurrentFav):
CODE
    } else {
        // Fetch the Labels of the 10 Fav items
        var favLabels = [];
        for (i=0; i<10; i++) {
            var label = localStorage.getItem(`EHGQF-fav${i}`);
            if ( !label ) label = `Favorites ${i}`;
            favLabels.push(label);
        }
And transform into a procedure of its own. Then put a big if in there, that, if a certain fav label cannot be found fire a request to gallerypopups.php and scrap the labels from there.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jan 23 2017, 23:31
Post #26
FabulousCupcake



Casual Poster
****
Group: Gold Star Club
Posts: 492
Joined: 15-April 14
Level 451 (Dovahkiin)


Good idea.
I'll refactor the old code tomorrow, and make it immediately fetch the labels on the background upon the first run (also periodically every week maybe).
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jan 24 2017, 00:12
Post #27
blue penguin



in umbra, igitur, pugnabimus
***********
Group: Gold Star Club
Posts: 10,046
Joined: 24-March 12
Level 500 (Godslayer)


QUOTE(FabulousCupcake @ Jan 23 2017, 21:31) *
also periodically every week maybe
EH already gives the label on galleries that have been favourited. It may be more responsive to:

1. check the label on an open gallery before adding to #gdf
2. if the gallery is not a favourite already continue as normal
3. if the gallery is a favourite already EH did print the label there so we can:
3.1 get the label from the page
3.2 compare with the label we have in localStorage
3.2.1 if labels are equal (in gallery and in localStorage) continue with normal procedure
3.2.2 when the labels are different update the one in localStorage with the one on the gallery

The user will only see outdated labels when changing one type of favourite into another. And even then it will happen only once per each label.

It should be pretty efficient since most of the work happens in the uncommon case where the user changed a label in settings.

(Apologies for being annoying about this instead of writing a patch myself. I haven't written any JavaScript in months, am afraid I'll make some stupid mistake).
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jan 24 2017, 02:45
Post #28
mondere



uʍop ǝpᴉsdn ǝɹ,noʎ
****
Group: Gold Star Club
Posts: 482
Joined: 17-September 08
Level 435 (Godslayer)


QUOTE(FabulousCupcake @ Jan 23 2017, 07:32) *

It's done.
Fortunately the only thing that needs be written for this feature is just a keypress event listener.
We can then throw it to the already-existing logic to send the favouriting POST request.
And of course, work on the UI! (IMG:[invalid] style_emoticons/default/heh.gif)

v2.0.3 and v2.1.0 diff:
[www.diffchecker.com] https://www.diffchecker.com/Nn9k6CKb

Wow! that was fast.

It works great for the most part, but favorite 0 doesn't work with the new hotkeys. Reason is line 655, it's only calling the function if (favID), so it doesn't run when favID is 0.

Thanks!
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jan 25 2017, 18:57
Post #29
FabulousCupcake



Casual Poster
****
Group: Gold Star Club
Posts: 492
Joined: 15-April 14
Level 451 (Dovahkiin)


2.2.0 released

Ended up making the label fetching occur both periodically every week and with the check blue_penguin mentioned since it's inexpensive to do anyways ¯\_(ツ)_/¯
No more opening the popup-manually to fetch the labels now \o/

Hotkey with 0 and display issue on the cheatsheet also fixed.

And a lot of minor code changes thanks to eslint.

v2.1.0 and v2.2.0 diff:
[www.diffchecker.com] https://www.diffchecker.com/lCCRTjIL

This post has been edited by FabulousCupcake: Jan 25 2017, 20:22
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jan 26 2017, 00:37
Post #30
blue penguin



in umbra, igitur, pugnabimus
***********
Group: Gold Star Club
Posts: 10,046
Joined: 24-March 12
Level 500 (Godslayer)


Works like a dream. I really like the const config at the top, will start using something similar in mine.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jan 26 2017, 01:57
Post #31
frankmelody



Θ..Θ
*******
Group: Gold Star Club
Posts: 1,314
Joined: 9-January 11
Level 500 (Godslayer)


exactly what i need. thank you
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post May 17 2017, 15:05
Post #32
trueGAS



Lurker
Group: Recruits
Posts: 5
Joined: 12-January 11
Level 263 (Godslayer)


so i've been using the script for some time and it works great for the most part but when i move the cursor to the stars bar to rate a gallery i seem to always go over "Add to Favorites" and the pop-up gets in the way, which is a pain
is there a way perharps to make pop-up appear with a short delay or disable it altogether (allowing for hotkey control only)?
thanks
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post May 18 2017, 00:25
Post #33
blue penguin



in umbra, igitur, pugnabimus
***********
Group: Gold Star Club
Posts: 10,046
Joined: 24-March 12
Level 500 (Godslayer)


QUOTE(trueGAS @ May 17 2017, 14:05) *
so i've been using the script for some time and it works great for the most part but when i move the cursor to the stars bar to rate a gallery i seem to always go over "Add to Favorites" and the pop-up gets in the way, which is a pain
is there a way perharps to make pop-up appear with a short delay or disable it altogether (allowing for hotkey control only)?
Not a perfect solution but you could comment out bottom: 33px;, i.e. this:
CODE
.qf-top {
    border-bottom: none;
    padding-top: 5px;
    bottom: 33px;
}
into this
CODE
.qf-top {
    border-bottom: none;
    padding-top: 5px;
    //bottom: 33px;
}
Makes the popup open downwards.

The issue is that it looks bad thanks to the borders being crafted for an upward popup. I suck at graphical stuff so I'll leave the appearance fix to someone else.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post May 18 2017, 09:32
Post #34
trueGAS



Lurker
Group: Recruits
Posts: 5
Joined: 12-January 11
Level 263 (Godslayer)


QUOTE(blue penguin @ May 18 2017, 01:25) *
The issue is that it looks bad thanks to the borders being crafted for an upward popup. I suck at graphical stuff so I'll leave the appearance fix to someone else.
works for me
the other thing is i favourite a gallery after i went through its contents (meaning i scrolled down and the UI is not visible) and when i hit the hotkeys there's no "confirmation" (which makes me scroll back up to make sure i did it right)
that's probably just me, but i felt like leaving an input anyway

This post has been edited by trueGAS: May 18 2017, 09:33
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Oct 10 2018, 11:04
Post #35
FabulousCupcake



Casual Poster
****
Group: Gold Star Club
Posts: 492
Joined: 15-April 14
Level 451 (Dovahkiin)


Had to use the script in Firefox today and apparently none of the actions are working.

Turns out that if you send XMLHttpRequest in GM4, it's running in separate environment and you always get a login page instead. Using GM.XMLHttpRequest makes it behave "normally".

Diff: [www.diffchecker.com] https://www.diffchecker.com/ELE9AjQ7
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Oct 10 2018, 23:51
Post #36
blue penguin



in umbra, igitur, pugnabimus
***********
Group: Gold Star Club
Posts: 10,046
Joined: 24-March 12
Level 500 (Godslayer)


GMs quite dead in FF land. People are either using Tamper or Angry Monkey, both of them appear to work with the old script (I use Angry but just installed Tamper to check).

GMs really going bonkers these days.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Oct 11 2018, 10:09
Post #37
FabulousCupcake



Casual Poster
****
Group: Gold Star Club
Posts: 492
Joined: 15-April 14
Level 451 (Dovahkiin)


Ooh, good to know.
I don't like the new GM menu either (everything shoved into the browser action popup), Tampermonkey dashboard is really nice.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Oct 23 2018, 01:51
Post #38
sirlachdanan



Veteran Poster
********
Group: Members
Posts: 4,166
Joined: 20-May 08
Level 500 (Godslayer)


In my settings, i've added the line
CODE
// @homepageURL  https://forums.e-hentai.org/?showtopic=194073

so i can quickly check on this topic for updates. You should add it by default in your next update too, so people can quickly come here to stay up-to-date.

Anyway, wonderful script, a little gem.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Oct 31 2019, 22:48
Post #39
celtsman1989



Regular Poster
******
Group: Gold Star Club
Posts: 948
Joined: 14-December 13
Level 500 (Ponyslayer)


How wonderful this is!!
Thanks very much!
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Feb 14 2020, 20:36
Post #40
carry0987



Newcomer
**
Group: Members
Posts: 70
Joined: 14-May 15
Level 362 (Godslayer)


Great works !!
User is offlineProfile CardPM
Go to the top of the page
+Quote Post


3 Pages V < 1 2 3 >
Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 


Lo-Fi Version Time is now: 1st April 2025 - 16:21