Page 1 of 3
Live comment preview
Posted: Tue Jan 03, 2006 9:25 am
by MySchizoBuddy
Re: Live comment preview
Posted: Tue Jan 03, 2006 10:45 am
by garvinhicking
The problem is this: Serendipity has a boast of different markup plugins.
The way the livecomment preview works is by just replacing some escaped HTML code with real code. So no BBCode or even smilies are replaced "live", which kinda sucks.
So we could have a livepreview with nearly a 1:1 copy of their javascript code. But it wouldn't show much of a live preview, as most of the s9y markup cannot be easily replaced with JS calls.
The cooler way would be to just preview the comment with PHP calls. But this can't be done "live", because you would need to fire up a AJAX/PHP call every X seconds or X characters, which would be a HUGE performance impact.
What could be done instead would be to modify the "Preview" button to toggle a no-reload live preview of the comment. What would you think about that?
Regards,
Garvin
Re: Live comment preview
Posted: Tue Jan 03, 2006 10:23 pm
by Guest
garvinhicking wrote:
What could be done instead would be to modify the "Preview" button to toggle a no-reload live preview of the comment. What would you think about that?
that would work too. a no-reload Ajax based preview will be cool.
Re: Live comment preview
Posted: Wed Jan 04, 2006 8:00 pm
by garvinhicking
Guest: But I just explained that a no-reload Ajax based preview would SUCK performance's ass....?!
Regards,
Garvin
Posted: Wed Jan 04, 2006 10:35 pm
by MySchizoBuddy
i meant. change a preview button to make a no-reload preview. like on this site.
http://godbit.com/featured/the-john-carroll-school

Posted: Thu Jan 05, 2006 1:00 pm
by garvinhicking
Okay, I'll have a look at it.
Regards,
Garvin
Posted: Fri Jan 06, 2006 6:30 pm
by garvinhicking
I've just committed a "livecomment" plugin to CVS. You'll require updated comment.tpl and commentform.tpl files, plus some functions of the SVN from now.
Please test!
Bestregards,
Garvin
Re: Live comment preview
Posted: Wed Jun 13, 2007 11:08 am
by Lariel
garvinhicking wrote:The way the livecomment preview works is by just replacing some escaped HTML code with real code. So no BBCode or even smilies are replaced "live", which kinda sucks.
So we could have a livepreview with nearly a 1:1 copy of their javascript code. But it wouldn't show much of a live preview, as most of the s9y markup cannot be easily replaced with JS calls.
I tried the livecomment preview and now I'm here. Because I think it really sucks. Should I change to WP?? :> Not really ... (I'm very satisfied with s9y so far, thanks for your great work garvin + rest!) My problem is: Hitting the "preview" button just like before is not live! I could do that before I used this plugin and I even got more informations, how the complete comment would look with author's name etc. I don't think "no BBCode or even smilies are replaced" sucks, it's just a pre-preview. So if the live preview would be really live and hitting the "preview" button would return the whole thing just like before, that's how it should function, imo.
Didn't want to be offensive. But I really thing it sucks how it works now. It should work more like the livesearch which is great.
Re: Live comment preview
Posted: Wed Jun 13, 2007 11:11 am
by garvinhicking
Hi!
I agree! I would love to see an improved version of the plugin. I am sure someone who has fun with Ajax can now build some improved version of it. Technology has quite improved since the initial commit of this plugin.
However the interest in this plugin was very low, so I can't dedicate time on this plugin on my own. For myself, I also am quite satisfied with the usual preview.
No offense taken, BTW.
Best regards,
Garvin
Posted: Wed Jun 13, 2007 11:14 am
by Lariel
That was a fast reply. Well, I'd do it myself, but my JS and AJAX knowledge really sucks ... Hope, someone gets its hands on it. It's just a shame how it is right now.
Posted: Wed Sep 19, 2007 12:30 pm
by Dawn
Are there any news about this plugin? I've found another plugin @
http://www.softius.net/wp/plugins/comment-live-preview/ (for Wordpress). Wouldn't it help to adapt the source of this plugin? (my skills in Ajax are to less).
Greets and best regards,
Dawn
Posted: Wed Sep 19, 2007 1:42 pm
by garvinhicking
Hi!
That would help, yes. But still the differences are quite large so it would take a skilled Ajaxian still more than one hour to get it transplanted...
Regards,
Garvin
Posted: Wed Sep 19, 2007 1:46 pm
by Dawn
I hope anybody can get it done. This is the only little feature I am a little bit jealous to wordpress users.
Thanks for your feedback garvin.
Greets,
Dawn
Posted: Fri Sep 12, 2008 9:39 am
by onli
Hi
Do you know
this approach using jquery? I adapted it to work with serendipity, you may test it
in my blog and download it
here. Would be glad to here some comments and improvements.
Cause I'm new to this, you may want to check the source before using it...
You will note, it is not yet complete. I don't see a way how to use the installed markup-plugins to format the text - currently this is untouched, therefore producing html-styled text. Further thoughts about this can be found in the blogpost linked above, in german.
Maybe anyone can show me how to get the comments in the right format? I'd complete it if I saw a way - but of course wouldn't mind if someone else complete this.
Greets
Posted: Fri Sep 12, 2008 1:07 pm
by garvinhicking
Hi!
Nice to see that someone is working on this!
Serendipity indeed has a dependency management system, but we currently do not have plugins that just provide libraries. Currently there is no other plugin using jquery, so the overhead of the plugin supplying jquery wouldn't be so bad. If later we see that more plugins use this, a new jquery plugin could be created, though.
The existing serendipity_event_livecomment.php script actually does perform markup transformations, I think. It registers the external_plugin event hook and sends the current input to that script, which then returns the rendered markup. That is some kind of AJAX request, so once you have such a stub, you can use a JS event to perform the AJAX call, and render the HTML with the return code of that call.
The only alternative to such (performance intense!) ajax calls would be to recreate every markup plugin in JAvascript instead of PHP. Quite a huge task, even though at least BBCode or Textile are maybe already existing as JS-transforms...?
In fact, do you maybe want to try to incoroprate your changes into the serendipity_event_livecomment plugin? This would allow us to provide one plugin with the best functionality...
HTH,
Garvin