Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#76 2005-11-09 00:28:50

ashground
Member
From: Vancouver, Canada
Registered: 2005-01-07
Posts: 63
Website

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

Thanks. I’ll update it asap.

Fantastic work on the plugin, BTW.

Offline

#77 2005-11-09 00:35:26

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

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

> Skubidu wrote:

> Infi: I’ve got one idea: Have you really changed <txp:comments_form /> in the form “comments_display” to <txp:nhn_comments_form />?

I have. If I’m the only one experiencing it, must be in my setup. Sent the goods to you.

Offline

#78 2005-11-09 03:24:59

ashground
Member
From: Vancouver, Canada
Registered: 2005-01-07
Posts: 63
Website

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

So, I updated to the beta you pointed me to, aaaand… the comments won’t submit.

I’ve rolled back to the version I was using until the problem is resolved. Anything I can do to help?

Offline

#79 2005-11-09 08:29:41

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

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

Please try these two things:
  1. please turn on debug mode and tell me if you get any notices
  2. please do not insert the javascript tag <txp:nhn_livecommentpreview_js /> and tell me if this changes anything concerning the submit problem.

Are you using the standard preview/submit system or are you using <txp:nhn_comment_submit />? I can’t reproduce your problem – that’s my problem :(

Offline

#80 2005-11-09 08:32:42

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

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

By the way: Is there anybody using the version 0.4 beta without problems as I do?

Offline

#81 2005-11-09 14:51:25

ashground
Member
From: Vancouver, Canada
Registered: 2005-01-07
Posts: 63
Website

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

Here’s how things are set up…

This is my comment form (with most of the layout stuff stripped out):

<div class="small">Name</div>
<txp:comment_name_input />
<div class="small"><txp:comment_remember /></div>
<div class="small"><txp:text item="email" /></div>
<txp:comment_email_input />
<div class="small">http://</div>
<txp:comment_web_input />
<div class="small">
<txp:text item="message" /><br/>
<txp:comments_help />
</div>
<txp:comment_message_input />
<div class="small">
<txp:nhn_comment_spamsave /><br/>
<txp:nhn_comment_submit />
</div>
<div class="small">
<strong>Live preview</strong>
</div>
<txp:nhn_livecommentpreview />

This code works fine with 0.3.1.

I’ve tested the new version again and when I submit a post, it brings me back to the same page with the same form (with the form content retained). There’s no debug strangeness. The state of the spam checkbox doesn’t change anything.

Enabling / disabling the JS code still doesn’t have an effect on posting.

Last edited by ashground (2005-11-09 16:56:08)

Offline

#82 2005-11-09 23:13:35

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

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

Hi
I can’t get the live comment to work on this page:
http://www.pieman.net/clients/beatbreakaz/audio/electro-magnetic

comments_display
<code><txp:if_comments>
<h3>Comments</h3>
<txp:comments />
<txp:else />
<p>No Current Comments</p>
</txp:if_comments>

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

comment_form
<code><div id=“commentform”> <h3>Add Your Comment</h3> <p>You may use <a target=”_blank” href=“http://www.textpattern.com/help/?item=textile_comments” onclick=“window.open(this.href, ‘popupwindow’, ‘width=300,height=400,scrollbars,resizable’); return false;”>textile</a> in your comment. <a class=“external” href=“http://gravatar.com”>Gravatars</a> are enabled. Your email will not be displayed and will remain private. Open and honest communication is encouraged, but I reserve the right to edit or delete comments.</p>

<label for=“name”>Your Name:</label>
<input type=“text” id=“name” name=“name” value=”<?php echo pcs(‘name’); ?>” size=“25” tabindex=“1” /><br />
<label for=“email”>Your Email: (will be hidden)</label>
<input type=“text” id=“email” name=“email” value=”<?php echo pcs(‘email’); ?>” size=“25” tabindex=“2” /><br />
<label for=“web”>Your Website: (optional) http://</label>
<input type=“text” id=“web” name=“web” value=”<?php echo pcs(‘web’); ?>” size=“25” tabindex=“3” /><br />
<label for=“message”>Your Comment:</label>
<textarea id=“message” name=“message” cols=“30” rows=“12” tabindex=“4”><?php echo pcs(‘message’); ?></textarea><br />
<txp:nhn_livecommentpreview />
<txp:comment_preview />
<txp:comment_submit />
</div></code>

the nhn_livecommentpreview reads <code><h3>preview</h3> <txp:nhn_lcp_preview /></code>

And <code><txp:nhn_livecommentpreview_js /></code> is in the head

The <code><div id=“TextDisplay”></div></code> div is being written below the form as expected but when i type into the field the preview doesn’t show.

Perhaps there is something wrong with the JavaScript? I am pretty clueless about JS ;) but i checked it in the FF dev toolbar JavaScript Console and it’s giving a lot of errors.

Any advice appreciated.

Offline

#83 2005-11-09 23:26:26

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

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

Hey pieman!
Your problem is a javascript problem: You have inserted the javascript twice:

  • <script src="http://www.pieman.net/clients/beatbreakaz/inc/js/livePreview.js" type="text/javascript"></script> – if you attach the javascript like that, you have to delete the <script>-tag in the external file.
  • The other one is inserted directly.

By the way: You’re using the version 0.3.1 and not the new 0.4 beta I mentioned above.
Please clean up your javascript and tell me if it works.

Nils

Last edited by Skubidu (2005-11-09 23:26:40)

Offline

#84 2005-11-10 09:29:00

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

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

Thanks Skubidu

Well spotted! I removed the old <code><script></code> tag, leaving the <code><txp:nhn_livecommentpreview_js /></code> in the head, and I upgraded the plugin to 0.4 beta. But still no preview appears :(

I thought it may be a browser issue but it works ok on other sites.

by the way… I’d prefer to keep the javascript out of the markup. Is there a way in Txp to do this?

thanks again
Stu

Offline

#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

Board footer

Powered by FluxBB