More update.bml stuff
Thursday, December 21st, 2006 01:30 amIn 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:
Random notes:
Changelog:
2007.01.07
---
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
- remembers whether you have the tagslist expanded or not
no subject
Date: 2007-01-19 03:53 pm (UTC)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!
I'll probably put up the new code sometime next week, and definitely crediting you<3 Still need to clean things up, etc.
One thing though, I'd recommend using .textContent and not .innerHTML when fetching the tagname from the server because .innerHTML escapes the & to an &.
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...
no subject
Date: 2007-01-19 04:12 pm (UTC)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.
no subject
Date: 2007-01-21 04:28 pm (UTC)Maybe you could make the textbox serve a dual purpose -
Good idea about the dual purpose, but I wasn't very comfortable with the bold so I tried changing the fontsize to 1.2em instead. It's... I don't know. I'm still not that comfortable with it, but it works sort of. I might change it to bold; want to show it to some people and think about it more.
I'd noticed that you were using innerHTML to get the contents of the tag,
I'm actually relatively new at javascript (I have some relatively older scripts, but my inexperience shows through a lot more in those). Only reason I didn't use textContent before is that I didn't know what the difference between that and innerHTML was. I'm beginning to get an idea now, though I'm probably still missing knowledge *g*.
re: ?format=light
I think I've figured out what I was doing. I checked ?format=light against the recent entries page. When it didn't have any effect, I thought that it wouldn't have any effect on any non-entry pages.
I believe that tag lists are generated...
They are, but the information is available via s2, so you can control how the tags are printed out, which is nice but which makes it hard to get any sort of standardization working *g*. Or so I thought.
BTW, apologies for answering in reverse order - that's the way I like to do things, heh.
No problem at all! Answer any which way you like. I'm enjoying this conversation.
Apologies for the late reply, though. I got caught up in testing the code -- no autocomplete yet, but I added a border around those tags that match. And then for some reason I decided that making a regex would be easier and more flexible than checking the
indexOftagContent ? ", ", since the latter can't handle extra whitespace.I'm not sure it's worth the extra processing though. I wanted to save the
RegExpobject for later use instead of reconstructing it each time I click, but GM is being stubborn. Which is to say, I just don't know how to do it yet, heh.I'll give the link later. I don't want to put it up on us.o yet; want to make sure I haven't accidentally broken anything, since I did change quite a bit. Have no other place I can put up the script though, so I'll have to (re)open an account at ripway. Hm, unless I could email it to you, maybe?
I'm definitely on IM. Mostly I'm available through LJTalk and Gmail chat. I have MSN, AOL and YM accounts as well. Doesn't matter which is added; multi-server chat clients are wonderful things.
no subject
Date: 2007-01-19 04:15 pm (UTC)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