Dynamic comment previewing

I've added dynamic comment previewing to the blogs. I'm following the instructions over here, but as you can tell from my discussions with the author, there are bugs. Here are the changes I had to make to get it to work:

1) Change the JavaScript to the following:

// Dynamic Comment Preview - Kudos to Mike Industries for the inspiration!
// D.C.P. - Comment Text
function ReloadTextDiv() {
document.getElementById('TextDisplay').innerHTML = '<p>'+document.getElementById('comment-text').value.replace(/(\r\n|\n)/g,'<br />').replace(/(<br \/>){2,}/gi,'<'+'/p><p>')+'<'+'/p>';
}
// D.C.P. - Comment Author
function ReloadNameDiv() {
document.getElementById('NameDisplay').innerHTML= document.getElementById('comment-author').value;
}
// End Dynamic Comment Preview

You'll notice I changed

document.getElementById('NameDisplay').innerHTML = document.comments_form.comment-author.value;

to

document.getElementById('NameDisplay').innerHTML= document.getElementById('comment-author').value;

2) I added “margin-left: 0px; padding-left: 0px;” to the div containing the POST button.

3) In step 2, I changed

var authname = getCookie(“mtcmtauth”);
document.write(authname);

to

document.write(commenter_name)

4) I also changed

<p class=“comment-footer”>Posted by:
<span class=“author”><a href=“#” id=“NameDisplay”>

to

<p class=“comment-footer” style=“padding-left: 0px; margin-left: 0px”>Posted by:
<span class=“author”><a href=“#” id=“NameDisplay”>

Now it looks right and works properly.

Leave a comment

Recent Entries

  • MT 4.1 now out

    Movable Type 4.1 is now available, I notice. I gave it a try today and while there are obvious improvements everywhere, there are a couple...

  • MT4: Finally made it

    Finally. I've done it. I've made the switch. With the slight exception of MT Blogroll, which I can do without for now (but which...

  • MT4: nearly there

    Tried again with my bi-weekly MT4 upgrade attempt. We're nearly there now, I reckon. Simply Threaded was giving me some problems and not showing...

  • MT-MyBlogLog

    I've been trying to 'Voxify' my media blog of late. That's included comment threading, relative dates, changes to stylesheets, etc. But the biggest change...

  • MT4: not yet

    The observant will have noticed that I've still not migrated my blogs over to MT4. I did have an abortive attempt at it last...

Close