afuna: Cat under a blanket. Text: "Cats are just little people with Fur and Fangs" (Default)
[personal profile] afuna
In case anyone wants to comment on the script but doesn't feel comfortable doing so on us.o, here is a good place. I'm assuming that anyone who wants to use that script has an LJ account, since the script itself is made to work with LJ!

---

Because it seems fitting, here's a script (not written by me!) which restores the appearance and formatting of the old update.bml page.

Also, I've finally posted the script to add a tagslist to update.bml. There's an easter egg in there of a sorts -- didn't bother to remove my uglification code, but it can't be activated unless you know the exact steps.

Ah, the stupid thing is that my script is not compatible with the first one, so unless someone (else) is willing to figure out how to fix that, you'll have to choose one or the other.

The information below is outdated; most updated info is in the script itself and probably also in the extended description over at us.o.

The script will probably contain the most updated form of this, but here goes:

Usage notes:

  • will only work with journals you can edit via the Tags Management page, sorry! That means your own personal journal and any communities you manage. Trying to do it any other way would require parsing the tags page of the journal, which I'm not quite up to

  • cmd-clicking /ctrl-clicking on the tags will open the tagspage in a new tab

  • when expanded, the list shows all tabs. When collapsed, it shows the top $n tags based on usage frequency, where $n is a number you define. If there are many tags tied for $nth place, it shows all of them

  • there is no auto-complete, and it will not synchronize the textbox and the list when input is typed. However, it should always synchronize on click

  • the tags list will show up in both when you update and edit. It will also automatically detect the journal you're posting to


Random notes:

  • If you're wondering where I grab the tags info, I get it from the tags management page which has an array of tags and tags data

  • was thinking of caching the tags, but then I remembered that GM has a problem with UTF-8 encoding, and I think that certain languages require UTF-8. Would rather not risk it

  • does not work with the script that restores the old update.bml appearance. Both of us move things around using javascript, so, um, yeah. Might be possible to integrate the two though

  • There is a hidden uglification setting built in which moves the icon to the bottom and removes music/location textfields. I've deliberately hidden it because I plan to use it, but I don't think anyone else would appreciate it

  • if anyone should want to grab any part of this and use it for any reason, say to merge with another script, then go ahead (do I even have to say that? *g*). However, if you discover any bugs when you take the code, please email me at my livejournal.com email

  • I need to clean up my code


Changelog:
2007.01.07
  • fixed bug where "&" were showing as "&" (thanks to turloughishere for pointing it out)
  • changed whitespace in the tag url to a '+', in keeping with the tag url conventions on LJ
  • there is no journal dropdown when you're logged out, so check whether it exists or not
2007.01.16
  • remembers whether you have the tagslist expanded or not

Date: 2007-01-19 04:12 pm (UTC)
From: [identity profile] soph.livejournal.com
I noticed that you ordered the tags by their usage frequency -- do you think it's likely that most others want it the same way? Right now I'm doing it alphabetically so that it's easy to find a tag in the list of tags if you don't know the usage patterns of the community, but that means that the frequently used tags are hidden among all the other tags. Granted, you can pull up the top $n or so tags, but...

That was most likely a mistake on my part. I was trying to emulate the way you did it, which I figured was by the frequency. I agree it'd be easier alphabetically, yes.

Here's a suggestion, though, that might help with the most common tags being hidden. Maybe you could make the textbox serve a dual purpose - as well as changing the number of items shown when the list is collapsed, make it so that when the list is expanded, those same tags are instead put in bold. It's probably easier to do the necessary bolding on load and on a change of the textbox, which means that a collapsed list would have all its tags in bold. But to be honest, I'd be fine with that; it reinforces the idea of what the bold tags actually represent.

One thing though, I'd recommend using .textContent and not .innerHTML when fetching the tagname from the server because .innerHTML escapes the & to an &.

Actually that's what I'd normally have done but when I edit other people's code I try to stick to what they're doing themselves. (Actually, normally I tend to refer to things directly rather than using .innerHTML or .textContent, but, heh.) I'd noticed that you were using innerHTML to get the contents of the <script> tag, so to make things easier I adopted that throughout. (Besides, as I said before, it was a quick hack. ;p) Had I looked in the other functions I'd have seen that you used .textContent, but I had no need to.

I could have sworn that I tried ?format=light before, and that it didn't work, but I might have misremembered. Or something might have changed. Either way, I'm not complaining!

Actually, I think either something changed or we're both misremembering things - I thought I'd tried it before too. But I may just have tried it on my journal, which, by virtue of its being S1, is already in the requisite format.

Or we might have both been trying ?usescheme=global or something similar, which doesn't work.

Date: 2007-01-19 04:15 pm (UTC)
From: [identity profile] soph.livejournal.com
Oops, didn't get to finish my comment...

That was what was stopping me before: the variety of styles. Your first comment on the subject made me think of pulling up any link that was in the proper format, instead of looking up specific divs/uls since those vary by styles, but with tagslists in the sidebar, there would be twice as much processing.

My view of it is that I believe the tag lists are generated. Or believed, anyway; I'm not so sure now. I figured that all tag lists would have the "ljtaglist" class, and nothing else would; obviously this turned out to be wrong with "tagstable" and tag lists in the sidebar. But yeah, using ?format=light is definitely much better.

BTW, apologies for answering in reverse order - that's the way I like to do things, heh.

Are you on IM at all? You sound like the sort of person I'd like to geek out with. ;p