Friday, November 30th, 2007

afuna: Cat under a blanket. Text: "Cats are just little people with Fur and Fangs" (Default)
Back in January, I realized that you could probably figure out which individual tags filter you were viewing by using the (newly-added) parameter to each Userlite data_link:

3:09 AM me: hm
3:10 AM me: ma thinking of s2 at the moment
does this entry : http://community.livejournal.com/changelog/4356263.html mean that we can determine what tagspage we're on by checking the data link?
3:13 AM murklins: Looks like, but how do you check the data link?
3:14 AM me: Page has a hash of data links


I meant to play around with it, so I posted about it to remind myself, and then promptly forgot.


Then in May, [livejournal.com profile] murklins(<3) needed to customize certain tags views, and reminded me about my idea:
12:51 AM murklins: Hey, this is how we find out if we're on a tags subset of the recent entries page right?
if ((size $this.data_links_order) > 0) {
  if ($this.data_link{"rss"}) {
    var Link dlink = $this.data_link{"rss"};
    if ($dlink.url->contains("?tag=")) {
      print "A Tags Page";
    }
  }
}

12:55 AM me: hee
I don't know :)
I don't tihnk I've ever seen that before
though the concept seems familiar, but my mind might be playing tricks on me
12:56 AM murklins: Oh, it was your idea! :)


And I remembered that I'd had that idea before, and decided to do something with it some day. (And then promptly forgot about it again.)

Then someone made an entry in [livejournal.com profile] s2flexisquares asking whether it was possible to hide a sticky post when filtered by tags. And I was happy that I'd finally have a chance to play with the idea (almost a year after I first thought of it), so I wrote code and replied with it. Then she asked me whether it would be possible to make it so that you could show the sticky post only for certain tags, and after shaking off some rust I came up with this code.

It could be more flexible -- right now it won't work if you filter by multiple tags, but it's good enough, and I'm not crazy enough to try implementing a join/split function in S2.

(What if I made the tags an array instead of a hash? That would make it easier to input tag names -- ["tag1", "tag2"] instead of {"tag1"=>true, "tag2"=>true}, and it's unlikely that the list of tags this is used on would be long enough to affect performance either way.)

Other possibilities are to change colors or images depending on the tag that you're filtering by, or to change the behavior of entries with certain tags (for example, only show summaries for fic-related tags). And others! If you were motivated enough, you could make subtle changes to your layout for each tag you have. I'm not that motivated. :-)
afuna: Cat under a blanket. Text: "Cats are just little people with Fur and Fangs" (Default)
There was a coup attempt earlier today, led by a Senator who was already in prison for his involvement in an earlier coup attempt (the Oakwood Mutiny).

At the time of the Oakwood Mutiny, Trillanes was a lieutenant of the Philippine Navy. During the latest Senatorial elections, he won a seat in the Senate, probably because of his involvement in said mutiny, but was not allowed to take part because he was in prison. So Senator Trillanes was at a court hearing earlier today and just walked out. He headed to the Manila Peninsula, joined by some other civilians, and started calling for Pres. Gloria to step down.

The whole thing began before noon, and ended by 4:30PM. The first I heard of it was around 2PM, when someone mentioned that they'd blocked off Ayala and were sending in four gigantic tanks. (I was safe in Ortigas, by the way, very far from the center of action.)

I've heard that the soldiers crashed through the Peninsula's front doors, and I have the impression that they used the tank to do so, but I'm not sure whether I have the facts right. As far as I know, no one was seriously injured, though shots were fired.

After Trillanes surrendered, the police started arresting all the journalists who were in the hotel because they hadn't come out when told to do so. They'll probably be all right and hopefully will be released tomorrow morning after being processed. Apparently, the government wants to make sure that they were sent by their respective stations and didn't just go there of their own volition -- that is, to lend assistance to Trillanes (or at least that's how I'm reading tone of the radio interview that I heard on the way home).

There's also a curfew for tonight (maybe also tomorrow night) from midnight to 5AM. It's not Martial Law, but this plus the arrest of the journalists plus the sadly incompetent way the Trillanes walkout was handled will keep the media busy for the next few days.

Will find out how these events have affected the markets on Monday. The long weekend is a blessing; it will give matters time to settle down, and hopefully we won't be hit as we would have been if the markets were open on Friday.

Three typhoons, two earthquakes, and now an attempted coup. It's been a rough week for my country.

ETA:
Wiki entry: Manila Peninsula Mutiny