Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#85 2005-11-10 09:46:32

pieman
Member
From: Bristol, UK
Registered: 2005-09-22
Posts: 491
Website

Re: [plugin] [ORPHAN] nhn_livecommentpreview: JavaScript live comment preview

I also tried (but failed) to introduce the <code><txp:nhn_comment_submit /></code> and <code>< txp:nhn_comment_spamsave /></code> fetaures.

Maybe this complicates my livepreview problem, but I equally thought it may shed some more light on it…

Firstly, no error messge was displayed if you didn’t check the spam box first. Secondly, the comment never gets saved – the default comment preview is over-ridden but clicking ‘submit’ just reloads the page with the comment still in the form and not on the page.

I have removed these 2 optional features for now…

Offline

#86 2005-11-10 14:03:34

davidwang
Member
From: Malaysia
Registered: 2005-01-25
Posts: 38
Website

Re: [plugin] [ORPHAN] nhn_livecommentpreview: JavaScript live comment preview

pieman, you can keep the javascript out of the markup but you have to do it manually. View source and copy the code that the <txp:nhn_livecommentpreview_js /> produces. Paste it into an external file and name it scripts.js or something. Link to the file from your page in the <head>. Don’t forget to delete the <txp:nhn_livecommentpreview_js /> tag.

Offline

#87 2005-11-10 14:54:34

Skubidu
Archived Plugin Author
Registered: 2004-10-23
Posts: 611
Website

Re: [plugin] [ORPHAN] nhn_livecommentpreview: JavaScript live comment preview

Version 0.4 beta attaches the javascript in an external file.
If we get this version to work, you won’t see the javascript in your markup. I’ve not yet found the problem of the beta… still searching…

Offline

#88 2005-11-10 15:02:13

Skubidu
Archived Plugin Author
Registered: 2004-10-23
Posts: 611
Website

Re: [plugin] [ORPHAN] nhn_livecommentpreview: JavaScript live comment preview

Pieman: Please change <txp:comments_form /> to <txp:nhn_comments_form /> and please use the build-in textpattern tags to generate the input boxes for the comment form. Otherwise the plugin can’t work.

Last edited by Skubidu (2005-11-10 15:02:32)

Offline

#89 2005-11-10 22:45:46

pieman
Member
From: Bristol, UK
Registered: 2005-09-22
Posts: 491
Website

Re: [plugin] [ORPHAN] nhn_livecommentpreview: JavaScript live comment preview

Thanks for your help
I’m a little confused…

I changed change <code><txp:comments_form /></code> to <code><txp:nhn_comments_form /></code> in the ‘comments display’ form… so it now reads
<code><txp:if_comments>
<h3>Comments</h3>
<txp:comments />
<txp:else />
<p>No Current Comments</p>
</txp:if_comments>

<txp:if_comments_allowed>
<txp:nhn_comments_form />
<txp:else />
<p><txp:text item=“comments_closed” /></p>
</txp:if_comments_allowed></code>

Then I made a new comment form, called “nhn_comments_form”, but I’m not sure exactly what I should put in it… If i use the same form elements as the default comment form then I don’t see the point of making a new one. Can you tell me what I need to include to make it work?

Offline

#90 2005-11-11 07:06:21

tkn
Member
From: New York
Registered: 2004-06-29
Posts: 39
Website

Re: [plugin] [ORPHAN] nhn_livecommentpreview: JavaScript live comment preview

Yeah, I am also having problems getting the live previewing to work. I have basically stock comment forms at this point and the script does not seem to be working to put the preview text in the bottom.

Offline

#91 2005-11-11 07:32:05

Skubidu
Archived Plugin Author
Registered: 2004-10-23
Posts: 611
Website

Re: [plugin] [ORPHAN] nhn_livecommentpreview: JavaScript live comment preview

Pieman: You don’t have to create a new form called “nhn_comment_form”! The plugin uses the standard form “comment_form”, it just handels it differently and inserts some JavaScript calls. For that reasons you have to use <txp:comment_message /> in that form for example – otherwise there will be no live preview because there is no JavaScript call to start it.

For example:

  1. Your comment form has the following output for the comment message: <textarea id="message" name="message" cols="30" rows="12" tabindex="4"></textarea>
  2. If it’s handled by the plugin it would be: <textarea name="message" cols="25" rows="5" class="txpCommentInputMessage" id="nhn_message" onkeyup="ReloadTextDiv();"></textarea>

The minimum you have to do to get it work is to add the id and the onkeyup event.

Please read the plugin help again – that might help.

Nils

Last edited by Skubidu (2005-11-11 08:11:00)

Offline

#92 2005-11-11 08:16:41

Skubidu
Archived Plugin Author
Registered: 2004-10-23
Posts: 611
Website

Re: [plugin] [ORPHAN] nhn_livecommentpreview: JavaScript live comment preview

tkn: You don’t have inserted the javascript anywhere in your page. Please place <txp:nhn_livecommentpreview_js /> in the head of your page.

Back to topic: the beta release. Anybody using it without having problems. The discussed problems (beside the submit/spamsave problems) don’t seem to have anything to do with that release.

Last edited by Skubidu (2005-11-11 09:21:50)

Offline

#93 2005-11-11 08:51:45

pieman
Member
From: Bristol, UK
Registered: 2005-09-22
Posts: 491
Website

Re: [plugin] [ORPHAN] nhn_livecommentpreview: JavaScript live comment preview

Thanks for your help Skubidu… its much appreciated.

Offline

#94 2005-11-11 19:04:14

Skubidu
Archived Plugin Author
Registered: 2004-10-23
Posts: 611
Website

Re: [plugin] [ORPHAN] nhn_livecommentpreview: JavaScript live comment preview

Okay… I found a bug… Shame on me for that one:
Try 0.4 beta 2, please.

Offline

#95 2005-11-13 17:28:37

Infi
Member
Registered: 2005-05-28
Posts: 75

Re: [plugin] [ORPHAN] nhn_livecommentpreview: JavaScript live comment preview

Yay! It works. Thanks so much. Only thing remaining (as far as I can see) is validation, remembrance and display.

A few of the the tags aren’t properly closed in the script. I’d fixed that and thought to send you a copy before you changed it again, but you were too fast for me. :)

1. Where returned, the input fields and check boxes need to be closed with “ />”

2. language=“javascript” in the script tag can go. (It’s not necessary and doesn’t validate.)

3. Unchecking remember doesn’t seem to prevent being remembered, but the forget box works just great.

<strike>4. nhn_comments_form doesn’t display the comments approved. (Neither does the txp version, so it may be unrelated. Checking.)</strike>

All other issues appear to be fixed. Comment is submitted, checks done and errors appear inline. (Found number 4. Strike that one.)

Really fantastic job. One for the books. :)

Last edited by Infi (2005-11-13 20:45:39)

Offline

#96 2005-11-13 21:32:23

Skubidu
Archived Plugin Author
Registered: 2004-10-23
Posts: 611
Website

Re: [plugin] [ORPHAN] nhn_livecommentpreview: JavaScript live comment preview

Hi Infi!

1. and 2. are easy to fix.
Concerning No. 3: Does this happen only if you use the plugin? I can’t remember having changed anything in this part of the script…

By the way: Thanks for testing :)

Nils

Offline

Board footer

Powered by FluxBB