Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
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
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
Re: [plugin] [ORPHAN] nhn_livecommentpreview: JavaScript live comment preview
- please turn on debug mode and tell me if you get any notices
- 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
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
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
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
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
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
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
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
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
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
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
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