Home Blog Tech Stuff Hacking on the identi.ca Badge Script

Hacking on the identi.ca Badge Script

E-mail Print PDF
Article Index
Hacking on the identi.ca Badge Script
Valid XML
Valid XHTML
Stricter XHTML
Making Valid CSS
Fluid Width Modification
All Pages

I made some changes to the identica Badge script the other day. It started out just wanting to make it work in a XHTML DOM, but I ended up hacking it to produce valid XHTML and CSS as well as couple of other small changes. Honestly, I can't think of a good reason that the script needs to pass validation - the changes to ensure it's output is well-formed were necessary, but that's about it. Still, I did it anyway, and then I decided to write an article as a kind of walk-through of the modifications.

Why? No particular reason. Despite appearances perhaps, I'm not just desperate for content here :D In part it's because the web as a reference source currently relies on having mountains of (largely redundant) information to say the same things in different ways given a multitude of individual and specific contexts. And the reason I did this at all is simply that Open Source relies heavily on vested interests; I wanted to make it work on my pages, to make it output valid markup, and I wanted it to be fluid width.

So now I seem to have written a stupidly verbose change log for a largely pointless and unwanted set of changes, but nonetheless I would quite like it if my modified script could be adopted (i.e. hosted and maintained) "officially" as the default, and this seems as good a way as any to explain the things I changed and the reasoning, to plead that case.

The updated script is used here (left) and can be found at this location. I renamed it as identica-badge-xhtml.js to save confusion.



Last Updated on Sunday, 04 October 2009 00:40  

Comments

RE: Hacking on the identi.ca Badge Script - Fluid Width Modification from Sarven Capadisli on Tue. Sep 29, 2009  reply 

Good write up. Nice work! I'll try to give it a go soon and merge it into core. If you are interested or available to make future contributions, please join us http://gitorious.org/statusnet

See http://www.w3.org/TR/html401/struct/text.html#edef-CITE for the cite element. I guess Kent was thinking of http://dev.w3.org/html5/spec/text-level-semantics.html#the-time-element for the date element, but, no biggie. You can practically get away with any new element.

IMO, it is usually easier (for maintenance) and more consistent to reuse existing markup (i.e., what StatusNet uses right now) instead of writing something new. A simplified form of it may be preferable in this case.

I'd suggest using padding-left on the heading for the load indicator and the icon instread of text-indent, because if the username heading is more than a single line, the second line and on will be aligned.