The code is still in flux, but appears to work.
The way it works was chosen to minimise the changes requred:
- Each entry is wrapped within a new <div>
- The DIV has an ID & a CLASS attribute added.
At load-time the function hideHosts() is called. If a comma-separated cookie called "excludes" is present this is split and iterated over.
For each domain-name in the list the current document is searched for elements having a class prefixed with that hostname - if any match and they have an ID defined (regardless of what that might be) they are hidden.
And thats it.
The changes to the template were minimal; each index entry already has a "link" attribute, so I just had to add this:
<div class="<!-- tmpl_var name='link' escape='html' -->"
id="<!-- tmpl_var name='link' escape='html' -->" >
Because the ID and LINK attributes are URLs there is a little mangling, and inefficiency. But I didn't want to change the core of the PlanetPlanet to define a "hostname" attribute for each feed member...
In an ideal world I'd add "class='feed, $link'" and then iterate over that at load-time to attach handlers, and an ID appropriately. But that is a little scary.. If it works in IE great. I've tested Firefox & Ephinay
ObQuote: Terminator II
Tags: planet-debian, planet-planet