mu.nu - "My Tamagotchi!" she said. "It has to poop."

January 22, 2006

Live Preview Comments

Here's something I ripped off from Ace of Spades HQ... it is the live preview feature for comments.

I recently added this feature to this site, where it is located above the comment box, and to Bad Example, where it is locate under the comment box.

This code works in MT. I don't see any MT specific code in it, so it should work in Word Press or anything else for that matter. If you try it out, please leave a comment to the effect that it works or not. Thanks! First, insert this code into your head section of your Comment Listing Template and/or Individual Entry Archive:

<!-- script type="text/javascript" language="javascript">
<!--
function ReloadTextDiv()

var NewText = document.getElementById("DynamicText").value;
NewText = NewText.replace(/\n/g, '<br />');
var DivElement = document.getElementById("TextDisplay");
DivElement.innerHTML = NewText;

//-->
</script>

Next, insert this code into the body section of that same template where you want the live preview function to appear:

<div class="comments-head">
Live Comment Preview
</div>

<div class="comments-body">
<span id="TextDisplay">
</span>
</div>
<div class="comments-head">Post a comment
</div>

I also commented out the preview comment button in the code:
<!--<input type="submit" name="preview" value=" Preview " /> -->

Posted by: Madfish Willie at 07:38 PM | Comments (28) | Add Comment | Trackbacks (Suck)

1 Added to the sidebar under Useful Thingies.

Posted by: Madfish Willie @ at January 21, 2006 07:48 PM

2 Does anyone want the code the the numbering of the comments... see my blog for a sample or look at the comments here!

Posted by: Madfish Willie @ at January 21, 2006 07:49 PM

3 I think that the live comment preview doesn't strip out markup that MT strips out, for example underline.

Posted by: David Boxenhorn @ at January 22, 2006 10:00 AM

4 Hey! It kept the underline! In my blog it gets stripped out. How did you do that?

Posted by: David Boxenhorn @ at January 22, 2006 10:01 AM

5 It's a setting in your blog configuration file. It will determine which HTML to allow in the comments.

[WEBLOG CONFIG]
Preferences
General Settings
Under 'Sanitize Specs'
Select 'Use My Settings' radiio button
Insert this line:
a href,i,b,u,strike,sup,sub,blockquote,br,p

These codes will enable the following HTML to be used in the comments:
Link, Italics, Bold, Underline, Stike, Sup, Sub, Blockquote,
Line Break,
Paragraph,

Posted by: Madfish Willie @ at January 22, 2006 06:08 PM

6 I guess MuNuviana doesn't allow the blockquote tag in the actual comment. However, it did display correctly in the Live Preview box. I wonder if someone with access can change that for us?

Posted by: Madfish Willie @ at January 22, 2006 06:12 PM

7 What about "overline"---does that work in combination with "underline" too?

Posted by: kyer @ at January 22, 2006 10:56 PM

8 Anything that is valid HTML should work in the comments as long as you put it in the My Settings list as shown above.

Posted by: Madfish Willie @ at January 23, 2006 01:42 AM

9 Okay Willie, I used the javascript above on my blog (http://www.ericsgrumbles.net/) and got .......... nothing. It looks just like the source for MuNuviana. It's a pretty straightforward script, so confusion has set in!

Posted by: Eric @ at February 05, 2006 02:05 AM

10 The only kind of comments I ever get are from people who constantly disagree with me. Generally liberals douchebags who want me to stop bashing on Obama, or Atheists who like to tell me that I'm psychotic for "worshipping magical men in the sky" (yes I got told that once.) So, all I attract are trolls.

Posted by: josephwilliem @ at February 28, 2011 10:47 AM

11 Wall, wood and tile; furthermore discounted wall decals it could be removable and re-usesable.When you use our website, you are responsible for
keeping secrete of wall vinyl decals your account information and password wall stickers kids and restricting the
entry to your computer and you also approve to respond all the activities with
your quotes stickers for the wall account and charms thomas sabo North Carolina let nearly all of a 15-point, second-half lead slip away,
but the Tar Heels recovered and held on for a 86-74 wall decals murals victory From political pundits to college
diaries. Everyone seems to be keeping over
Kentucky cheap tiffany jewelry UK in the second round of the NCAA women's basketball tournament over
Kentucky in the second round outhern wall decals on A blog is basically a journal or diary that is available on the net. Web
blog is the new media of the world. a Blog nowadays.password.The tiffany engagement rings comment is not there. I go ahead and click off on accepting comments and trackbacks on the older ones.

Posted by: Tiffany and Co jewelry @ at March 22, 2011 10:04 AM

12 Napoli, Ian Kinsler Louis Vuitton and Nelson Cruz all Cheap Louis Vuitton homered for Texas, Replica Handbags which played its season Louis Vuitton Wallets opener exactly five months Louis Vuitton Cruise SS 2011 after a Game 5 loss to Louis Vuitton Spring Summer 2011 San Francisco at home ended Louis Vuitton Fall Winter 2010 its first World Series.Darren Oliver,Louis Vuitton Prefall 2010 the third Texas reliever,Louis Vuitton Spring Summer 2010 got the victory even after Louis Vuitton Monogram Empreinte allowing a homer to David Louis Vuitton Antheia Ortiz in the top of the Louis Vuitton New Collection eighth that tied it at Louis Vuitton Monogram Canvas 5.Murphy pinch-hit for No. 9 Louis Vuitton Monogram Idylle batter Julio Borbon, Louis Vuitton Monogram Macassar Canvas the center fielder whose Louis Vuitton Monogram Multicolore two-base error on the first Louis Vuitton Monogram Vernis play of the game led to the Red Louis Vuitton Monogram Miroir Sox scoring a pair of Louis Vuitton Monogram Mini Lin unearned runs. Borbon remained Louis Vuitton Monogram Denim a starter even after five errors Louis VuittonLouis Vuitton Cosmic Blossom in 21 spring training games. from:http://www.go2handbags.com
http://www.go2handbags.com

Posted by: caroline @ at April 02, 2011 08:54 AM

Hide Comments | Add Comment






Processing 0.01, elapsed 0.0169 seconds.
22 queries taking 0.0115 seconds, 34 records returned.
Page size 14 kb.
Powered by Minx 0.8 beta.