On Sat, 2008-12-06 at 08:14 -0500, Evan Prodromou wrote:
> I'd need to see a better use case than, say, hashtags-without-hashes
> to go for a full templating engine.

I agree, I just know that the discussion had been brought up before, but
couldn't remember if any good enough reason had been raised.

Randulo, since laconica uses jQuery, the following JavaScript code
should do exactly what you want:

/**
 * Removes # symbol from hashlinks in laconica.
 *
 * Copyright 2008 Jeff 'foxxtrot' Craig
 * Licensed under the GNU Affero Public License
 **/
$(function() { 
        $(".notice_single .content").each(function () {
            var content = this.innerHTML;
            var h = /#<a href="http:\/\/identi.ca\/tag\/\w+" rel="tag"
class="hashlink">(\w+)<\/a>/g;
            var r = content.match(h), s, i;
            if (r === null) return;     

            for (i = 0 ; i < r.length ; i += 1) {
                s = r[i].substr(1);
                content = content.replace(r[i],s);
            }

            this.innerHTML = content;
        })
);

It will run when the DOM is ready, and remove all the '#' from hashtag
links. You can then style a.hashlink however you want. You should be
able to put it in the util.js file in your laconica instance.

Jeff 'foxxtrot' Craig

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
Laconica-dev mailing list
[email protected]
http://mail.laconi.ca/mailman/listinfo/laconica-dev

Reply via email to