Work Editions Grid script for Greasemonkey

ForumTalk about LibraryThing

Melde dich bei LibraryThing an, um Nachrichten zu schreiben.

Work Editions Grid script for Greasemonkey

1brightcopy
Bearbeitet: Okt. 22, 2012, 12:55 pm

I have a fairly major Greasemonkey script that I thought I'd post about here first rather than in the Hacking LibraryThing group. I also wrote up a wiki page for Greasemonkey for anyone wondering what the heck I'm talking about. Okay, on to the show.

I've been working on an off to create a sortable grid for the editions list using Greasemonkey. I put it to the side for months but recently decided I should really finish it. Here's what it looks like once you have it turned on:

Here's the description from http://userscripts.org/scripts/show/100913
-----
Creates a sortable grid for the work editions list. By default, simple sorting is done by simply clicking on a column (again the reverse the sort). In each column, subsequent appearances of the same text are grayed out to help highlight different matches. When comparing variants for graying, it ignores case and spaces, as well as non-alphanumeric characters (e.g. "Apocalipsis (The Stand)" is treated the same as "Apocalipsis / The Stand").



By clicking on the lightning bolt icon, multi-column sorting can be achieved. When in multi-column sort mode, numbers will appear next to the sort showing the sort order. The last column clicked will be added to the end of the sort order.



Title, author and ISBN can be clicked on to open searches for each. This is most useful when clicking to open these searches in a new tab or window.

The last column contains and icon for the separation link. This link is changed so it can be opened in a new tab or window. To improve readability, row colors alternate and a line is drawn every fifth row.

Above the grid there is a link to toggle between the grid and the original editions list. This allows you to see exactly what the original looked like. It also allows you to see other info like the media type designators that are currently not in the grid:



Note: I've had a report that this script works fine with Chrome. So if you're a Chrome user, you might want to give it a shot. I recommend using the TamperMonkey extension in Chrome rather than using the built-in Chrome Greasemonkey support.
-----

If you already have Greasmonkey installed, you can install this script by going here:

http://userscripts.org/scripts/show/100913

and clicking Install. Note that userscripts.org has been having some network problems for a while now, so if it doesn't work at first just keep trying. It might give you 404 errors or gateway errors. Just keep reloading. If it becomes a major problem, I can host the script elsewhere.

If you don't have Greasemonkey installed and want to get on board, see the Greasemonkey wiki link at the top.

2brightcopy
Apr. 10, 2011, 3:30 pm

BTW, this script is not very user configurable. One of the things that held it up was I had ideas to let you configure if you wanted the whole graying out effect, the alternating row effect, etc. But I decided to follow Tim's playbook and decide that configuration wasn't necessary because my design is perfect.

I know, that's not what you say, I just couldn't restrain myself. ;)

Anyway, if there's enough interest, I might be persuaded to put in some configuration. Also, if there are suggestions on things you would really like this to do differently and everyone more or less agrees, I can make those changes. And, of course, please let me know if you run into any bugs.

3aethercowboy
Apr. 10, 2011, 3:32 pm

Nice. I'll give it a shot.

4brightcopy
Apr. 10, 2011, 3:40 pm

Oh, and if you also have my "LibraryThing Sort and Re-link on Combine/Separate Pages" script, you may notice a useless "(sort ascending)" link stuck on the editions page. I plan on doing some improvements to that script in the somewhat near future and will remove the redundant code at that time. Until then, just ignore that link.

5mujahid7ia
Apr. 10, 2011, 4:15 pm

Seems to work well for me in Chrome (10.0.648.204)

6brightcopy
Apr. 10, 2011, 4:16 pm

5> Awesome! I stopped bothering to try to support anything other than FF due to how much all the support sucked in the different browsers. Chrome in particular just decided not to support a bunch of the greasemonkey API. But I suppose I didn't wind up using those so it turned out okay.

7Heather19
Apr. 11, 2011, 2:23 am

I finally gave in and installed Greasemonkey just to use this. So awesome! Wow. Soooo much easier to look at editions this way!

8mujahid7ia
Apr. 11, 2011, 10:53 am

>6 brightcopy: Yeah I was surprised it worked, I usually don't even bother trying the scripts in Chrome but this one seemed very helpful and I'm not a big FF fan (well really not a Chrome fan either, I honestly am not happy with any browser since Opera 6 lol). I'll post here if any problems do crop up on Chrome, just for reference.

9EveleenM
Apr. 11, 2011, 2:00 pm

That's wonderful, brightcopy!

Thank you so much.

10brightcopy
Apr. 11, 2011, 2:12 pm

You're welcome!

According to userscripts, the script has been installed 20 times. Of course, that doesn't guarantee unique people. But I wonder who all those extra folks are. Maybe they're just all Tim. ;)

On another thread, the idea of collapsing "similar" copies has come up. I think I'm going to try putting it in as an optional mode (so you switch between "flat" and "collapsed" modes). Similar thing for collapsing all zero copy editions. No ETA on when I'll have time to work on it.

11DaynaRT
Apr. 11, 2011, 2:17 pm

But I wonder who all those extra folks are.

Me!

12keristars
Apr. 11, 2011, 2:45 pm

10> I looked at a couple different works with it, and collapsing would be more useful for separating when a few things need pulling out, but there's tons of correct entries. Possibly based on whichever sort is used, if a line is completely grey, then it gets collapsed with the line above it.

13brightcopy
Apr. 11, 2011, 2:49 pm

12> Yeah, that's one way to do it that would be useful. The way outlined on the other thread was kind of neat, too. It was more of a fuzzy collapsing and wouldn't matter as much what you're sorting on.

Again, I see these as possibly being other views you could toggle to rather than replacing the existing "flat" mode. I haven't figured out what I would do with the separate link when collapsed yet. I might just hide it, but I might try to do something fancy like let it open up multiple tabs/windows when you click on it.

14jjmcgaffey
Apr. 11, 2011, 6:27 pm

10> Me, for another. I'm not doing a lot of combining right now, but I have been and probably will be. Might as well have it handy...

15jjwilson61
Apr. 11, 2011, 6:43 pm

I'll get it when I have a chance. I have to get GreaseMonkey first.

Why don't you announce it in the Combiners! group.

16brightcopy
Apr. 11, 2011, 6:51 pm

15> Good call! Heading there now...

17Noisy
Apr. 11, 2011, 7:01 pm

>10 brightcopy:

I'm another.

Wonder if it's worth considering the nine common digits in the 13- and 10-digit ISBNs as the same?

18brightcopy
Apr. 11, 2011, 7:12 pm

17> Good point, I'll think on it. Thanks!

19Heather19
Apr. 12, 2011, 12:01 am

I finally realized what's missing, that was getting me confused... Normally, you look at an editions page and next to each edition it has the little "(separate)" link. But with this script on, there is no separate link, so you can't actually separate straight from the editions page with this script.

Unless the link is somewhere and I just don't see it....

20keristars
Apr. 12, 2011, 12:12 am

The separate link is the little icon that looks like two cards from a card catalogue.

21Heather19
Apr. 12, 2011, 12:30 am

...... *headdesks* Thank you.

22brightcopy
Apr. 12, 2011, 12:33 am

Sorry 'bout that. :D

I honestly debated on whether I'd leave it as "(sep)" or put the little fancy icon in. The icon had the advantage of taking up slightly less room.

23bonne1978
Apr. 14, 2011, 12:40 am

I only got "0" (zero) in the number of edition column. Using Chrome

24brightcopy
Bearbeitet: Apr. 14, 2011, 9:29 am

23> For every edition on every work? What version of chrome? What operating system?

25bonne1978
Apr. 15, 2011, 12:30 am

apparently itt's only when I use the swedish version of LT.

compare
http://se.librarything.com/work/5156372/editions
http://www.librarything.com/work/5156372/editions

using windows XP and chrome 11.0.696.44 beta

26brightcopy
Apr. 15, 2011, 12:33 am

Ah, most likely the English "separate" or "copies" in the patterns I use. I'll take a look the next time I'm in the code. Thanks for tracking it down!

27brightcopy
Bearbeitet: Apr. 15, 2011, 11:23 am

bonne1978@25> Okay, I've fixed it and uploaded a new version. Install that one and you should be all set.
ETA: In fact, just about anyone who uses this script and any of the non-www.librarything.com sites should update since it will affect them, too. It's not specific to Chrome, either.

The problem was that on translated pages, there's some extra html <span> tags hidden inside the "(5 current copies separate)" part. This was tripping it up when finding the number.

While I was in there, I fixed some code that had "http://www.librarything.com" hardcoded into the links. Now it should be relative to whatever site you're on (dumb mistake).

I also put all the English text at the top of the .js file, with "translate only this section". If anyone wants it in another language, all they need to do is edit those few strings. If you do this, keep in mind that if you want to put a single quote (') inside the string, put the backslash (\) character in front of it.

Example:
'Now it\'s got a quote'

28bonne1978
Apr. 18, 2011, 7:01 pm

Thanks

29eromsted
Okt. 22, 2012, 11:01 am

Recently, editions are not visible when this script is active. There also seems to be a bug with separating editions on the editions page without this script. These two problems may, or may not be related.

See http://www.librarything.com/topic/143791

30Collectorator
Okt. 22, 2012, 11:03 am

Dieses Mitglied wurde von der Website gesperrt.

31brightcopy
Bearbeitet: Okt. 22, 2012, 11:37 am

I'm not touching the script until Tim finishes fixing the separation problem. Otherwise, I'll have to fix my fix.

32brightcopy
Okt. 22, 2012, 12:56 pm

The script is fixed and I added a new feature. Now theres a "grid | original" link in the header bar above the grid. This allows you to toggle between them.

This will also allow you to toggle to the original editions list in the event of another change that breaks the editions grid.

33eromsted
Okt. 22, 2012, 12:59 pm

Great! Thanks.

34ABVR
Okt. 22, 2012, 11:06 pm

Amazing! Thanks so much!

35henkl
Okt. 23, 2012, 8:28 am

Thanks. I like the new feature.

36brightcopy
Okt. 23, 2012, 10:57 am

Userscripts.org appears to be down right now. If anyone else is needing to download it while it's down, just post here and I'll provide an alternate location.

37kleh
Jan. 27, 5:32 am

The grid seems to have stopped working today.
Has it been broken by some underlying change to the site?
Traumatic, as I've come to depend on the grid when recombining editions.

39kleh
Jan. 27, 6:31 am

I've been using the script with tampermonkey in Opera.
It was working fine until today.
Doesn't seem to be working in firefox either.