A couple of enhancements

Aloha.

As the de facto webmaster of this site, I keep making minor improvements to this site, mostly at the instance of the pester-power of the markup-challenged owner. :)

All comment boxes on AnarCapLib now have a formatting toolbar that let you write some HTML to format your comments.

Here’s a bonus for you readers: there are still plenty of blogs out there that don’t have a similar feature. I have just the thing for you. If you’re using Internet Explorer, drag this next link to your “links” bar:

href="javascript:(function(){var d=document,i,f,j,t,m,s,u,q;for(i=0;f=d.forms[i];++i)for(j=0;t=f[j];++j)if(t.tagName=="TEXTAREA"&&!t.htmlarea){t.htmlarea=1;t.style.display="none";m=d.createElement("div");m.contentEditable=true;m.innerHTML=t.value;s=m.style;s.overflow="scroll";s.width=500;s.height=250;s.border="2px inset green";t.parentNode.insertBefore(m,t);u=U(m,t);setInterval(u,50);f.attachEvent("onsubmit",u);if(q=f.posttype)q.selectedIndex=1;}function U(m,t){return function(){t.value=m.innerHTML}}})()">HTML-edit

When you go to a blog (or any other site with a comment box), clicking that link will turn the plain ol’ box into an HTML-enriched WYSIWYG editor, where you can press Ctrl-B, Ctrl-I, and Ctrl-K (among other things) to get bold, italics, and hyperlinks respectively. Go on, give it a shot. (And ignore the warning about the link being possibly unsafe blah blah.)

You’re welcome.

Update: Just for Ravages, who asked for a spell-checker, I give you IESpell, a free extension to IE that does exactly that.


9 Responses to “A couple of enhancements”  

  1. 1 anya

    hey this is neat .. the script inserts html tags as i can see :-P .. unfortunately i dont use IE. Does it work for mozilla too? I should if its javascript .. i am too lazy to try it out .. u tell me.

  2. 2 Yazad

    Why just de facto? You’re the de jure webmaster as well :-)

    And yes pester power has it’s uses!

  3. 3 MadMan

    Anya, thanks to a Mozilla bug, it doesn’t work in that browser.

  4. 4 Ashwin

    isn’t it supposed to be the other way round ? because of an IE loophole, you can use it.

  5. 5 MadMan

    Ashwin, that’s not true.

    The document.createRange() implementation is broken in Mozilla. It can’t manipulate text in an input element or textarea element. It is actually part of the W3C DOM specs.
    See:
    http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level-2-Range-Creating

  6. 6 Sathish

    Good Job. :)

  7. 7 Ravages

    You ought to put in a spell checker in this too
    I might have use for it :)

  8. 8 Ravages

    Writing this from Mozilla’s Firefox and the edit bar is visible.

    Am checking the bold function and the italics, but they don’t seem to work though

  9. 9 Nilu

    Hey Yazad,
    Saw how pathetically Rape Sheild laws failed?.

    I think this is the single biggest proof - but for being a libertarian, mankind has little choice ;)

Leave a Reply