Este tópico está presentemente marcado como "adormecido"—a última mensagem tem mais de 90 dias. Pode acordar o tópico publicando uma resposta.
Adds "sort by copies" and "sort by title" links to the works headers on author pages. These let you resort the works on the fly.
Note that if you're on an author page where some works are hidden behind a "show all" link, it will only sort the visible works. Click on the "show all" link and then sort.
What are the steps?
I clicked the install button, but it just showed me your script...
Let me know if it still leaves some questions unanswered.
Nope, that didn't do it.
and tell me if it works on one, both or neither.
I can find other examples of working and not working if that would be useful.
Other pages I tried it on and saw it didn't work:
Pages I tried where it does work:
Edit: Something I noticed...all the author pages work fine if I go to them from my library (I look in my library and select their name from there). They do NOT work if I do a "search site" of the author's name and look at it from there.
Update your script and test it out and let me know how it goes. For those new to the whole thing, you can just go to the script page at the very top and click the green Install button.
(But not the stupid green "Download" button.)
One oddity is that it'll promote weird "No title" works to the top. Like this one (please don't "fix" it, though - I'm going to file a bug report):
Sort by title and the first one is "No title". This is a side effect of the title being blank even though the link text is "No title". I sort by the link's title.
The odd part is that it should have a title. That book is this one:
Weird, huh? Like I said, time for a bug report. I posted about a similar one when fixing an entry like this on Stephen King (see the All Hail King Stephen thread in Talk About LibraryThing).
(also I have no idea what's up with that title. I tried looking for others that have only copies of the work title in Greek text, but they seem to be fine, so I'm out of ideas lol)
However, I would request some tweaking to the alphabetization rules that the script encompasses. It doesn't alphabetize like the rest of LT does; for instance titles that begin with "A ....." or "The ....." are lumped together. It also separates capitalized titles from non-capitalized titles, which is kind of helpful in a way, but probably not optimal. (how it even does that is far, far beyond me)
My example today is http://www.librarything.com/author/digestreaders&all=1
So, many thanks once again, brightcopy.
Don't know if it would be possible to do an LT-style sort - there's a lot of code in there for ignoring A and The and the like.
Well, adding the -i flag or using tolower() isn't exactly hard. But yeah, it's not as though omitting it is at all mystifying.
Just excluding leading "The, A, An" would be easy enough to do - that's a one-line regexp. LT's proper sorting is harder.
I thought about doing some more fancy, and yeah the A/An/The would be low-hanging fruit. I also found that there's a locale-sensitive lowercase that might be nice for people using other languages. But of course it won't do any good if you have some books from several languages.
Sort by title will use a locale-sensitive sort (meaning it takes the language of your computer into account - though not necessarily the language of the individual books).
Sorting will also attempt to intelligently sort numbers so "Abc 99 Def" comes before "Abc 1000 Def".
By default, the sort will ignore the first word if it is "a", "an" or "the". You can edit this list of words by choosing "Leading title words to ignore" from the script menu.
Just use your browser's built in updating if it has it (in google there is a "check for userscript updates" option, in Firefox you have to find the script under Tools->Addons->User scripts, right-click on it and choose "Find updates"). If it doesn't or that doesn't work, just go to the script page at the top of message #1 and click the green Install button at the top right of the page (beware of advertisements that have "download" or "install" buttons that aren't at the top right).
This will cause A is for Alibi to sort to the wrong location and there may be some mixed language libraries for which this won't work well. But you probably knew that already.