scriptygoddess

10 Jun, 2004

Quick Tags for comments

Posted by: Jennifer In: Script snippet|WordPress

Since Alex released his js quick tags – it seemed like the perfect thing to add to the comments form so that people could put in the html tags more easily. However, while his script is really powerful – just for the comments form, it's more than what's needed. So I stripped it down to the most basic version – using only the most common HTML tags used in comments – italic, bold, and links.

Here are the instructions on how to integrate it into your (wordpress) comments:

First and foremost – if you want to add code, or use the full version – you can download that from Alex's site.

To use the "mini" version I made:

1) Download the js file and upload it to the root of your domain.

2) Open up your wp-comments.php page… Look for the beginning of the comments form – (search for <form in the file) and put this just above it:

<script src="/js_quicktags-mini.js" type="text/javascript"></script>

Look for the text area field for comments which looks like this <textarea name="comment" id="comment" cols="40" rows="6" tabindex="4"></textarea> and add this directly above it:

<script type="text/javascript">edToolbar();</script>

And add this BELOW the textarea field:

<script type="text/javascript">var edCanvas = document.getElementById('comment');</script>

This is the method I'm using on this site – although I added the "h3" tag just for the one I use, since that's what I use to stylize code on this site. You can easily add more… or start from scratch using Alex's.

12 Responses to "Quick Tags for comments"

1 | :: mathibus.com » archives » wordpress: redesigning the comment form

June 21st, 2004 at 9:19 pm

Avatar

[…] efore those rather big changes, he messed around with the comment form. The new things are the mini quicktags, a resi […]

2 | monique

June 10th, 2004 at 8:55 pm

Avatar

these are great! it definitely makes it easier for commenters and i think it looks better than having that list of "tags you can use." it really cleans up the page!

Scripty does it again! =)

3 | Andrew

June 14th, 2004 at 10:08 am

Avatar

Hehe..Customising this script must be the 'flavour of the week' atm. I made this version, which is stripped down to just the dictionary function and a thesaraus function which I added. I've used it already for a personal project and found it indespencable [if you had the dictionary function I would have spelled that correctly :p]

5 | Tek

July 3rd, 2004 at 8:57 pm

Avatar

How come your buttons are nice and rounded? Mine don't look like that at all. *scratches head*

6 | Jennifer

July 3rd, 2004 at 9:03 pm

Avatar

You probably have a style applied to input tags – that will automatically square-off the corners. (I don't have any styling to input tags)

7 | Mama Write

July 7th, 2004 at 8:01 pm

Avatar

Various WordPress Links
Rather than ping ScriptyGoddess multiple times and clog my sideblog with even more WordPress links, I decided to plop 'em all here. I'm going to give WordPress a try again on my course website, since there are various hacks that…

8 | Marius

July 8th, 2004 at 6:54 pm

Avatar

Thank you Jennifer…man…I'm getting a ton of good scripts of here. Tell ya, I'm very greatful.

9 | Monty

July 14th, 2004 at 11:24 pm

Avatar

Another very helpful hack from you.

Thank you!!

10 | Poonam

August 24th, 2004 at 3:14 pm

Avatar

Jennier – I am using this script and its great. But I also want to be able to use the strikethrough in comments. How would I go about adding that to the list? Your help would be very grateful. Thank you. :smile:

11 | Jennifer

August 24th, 2004 at 9:18 pm

Avatar

Poonam – give this a try. In that .js file, you'll see a few other "edButton" definitions. Add this one after the last one (which in my file is the one to make links) :

edButtons[edButtons.length] = new edButton('ed_strike', 'strike', '<strike>', '</strike>');

I haven't tested it, but that should work.

12 | Poonam

August 24th, 2004 at 9:22 pm

Avatar

Thank you so very much Jennifer! You are the best! I tested it and it works fabulously! :) Thank you again!

Featured Sponsors

Genesis Framework for WordPress

Advertise Here


  • Scott: Just moved changed the site URL as WP's installed in a subfolder. Cookie clearance worked for me. Thanks!
  • Stephen Lareau: Hi great blog thanks. Just thought I would add that it helps to put target = like this:1-800-555-1212 and
  • Cord Blomquist: Jennifer, you may want to check out tp2wp.com, a new service my company just launched that converts TypePad and Movable Type export files into WordPre

About


Advertisements