Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+7 votes
5.7k views
in Plugins by
edited by

I see Gideon has this on the list of future enhancements... well, feel free to incorporate this into the core...  It only works with basic formatting editor, don't try it with markdown or wysiwyg unless you like seeing things break.  Even with the basic editor, it may still be buggy.

https://github.com/NoahY/q2a-comment-ajax

This is a fully jQuery+ajax comment form; no more waiting for pages to reload when you make a smarmy comment :)

Update: Here's a demo video showing how it works:

12 Answers

+1 vote
by

i Download the latest version, 5 minutes ago.
enabling
"Enable ajax comment form"
'Add @ username to comment box "

and save changes

the nex error occurs and show this message:

Notice: Undefined variable: qa_state in /home1/samuaz/public_html/qs/qa-include/qa-app-format.php(1264) : eval()'d code on line 126

in admin page and others.

thanks for the plugins and please and @username feature to wysiwyg-editor

by
Thanks, nice catch... fixed now.
0 votes
by
edited by
I'm testing mention-notifier plugin with the latest update on your plugin q2a-comment-ajax and there are compatibility issues, when you give the comment fails to publish Fatal error: Call to a member function get_html () on a non-object in / var / www / qs / qa-include / qa-app-format.php on line 306

without q2a-comment-ajax plugin, mentios work, not problem
any ideas? need to add some event to work with the plugin q2a-comment-ajax? $ posting_events  and process_event?

Please test the two plugins together, would be great to live together

thanks noahy
by
not sure about that... maybe it was because I set the format to "markdown"... can you try the latest code again?
0 votes
by
edited by

Hi, I tried the latest version of the plugin, in all formats, and is not captured or recognized two processes/events that are needed for mentions


Posid and time

before not recognize 7 posid,
question_id, userid etc, and now are only two I think it will be only a small adjustment that you need to give.

note that in version 0.3, there was no such problem, insert @user correct and the mention was also performed without error, the only problem was that the answers/ comments insert HTML tags and sometimes cut the content

thanks regards

by
can you give me the exact error?
by
I may have found the problem... try getting the latest code again?
0 votes
by

I leave  two images, one with Q2A ajax-comment-enabled and other disabled, so you have a clearer idea of the errors.

q2a-comment-ajax enabled (on): http://dl.dropbox.com/u/590349/test-with-q2a-comment-enabled.png html tags bug in answers and mentions show erros and not mentioned
 

q2a-comment-ajax disable (off): http://dl.dropbox.com/u/590349/test-without-q2acomment-DISABLED.png mentios and answers work ok

sorry, had not seen you put a new version, download it now, proves and tell you how it works

0 votes
by

testing the last version

the bug with html tags in wyseditor answers has been fixit,

but the problem persists with the mentions, apparently Q2A-ajax-comment, not sending or obtaining the necessary variables, so qa-mentions-detect do not get any value and fails obtain erros and mention or all mentions is not made

attached image

http://dl.dropbox.com/u/590349/new-commentq2a.png

by
edited by
sorry, its the postID ,
mentions-detect.php :
"postid" => $posid,
"time" => $time));
by
well, there's your problem dude... you haven't defined $posid anywhere in your code.  Probably a typo.
by
Yes, sorry, you're right. Both are mistakes, but as I didn't knew about that bug. The correct stuff is:
qa_report_event("u_mentioned", qa_get_logged_in_userid(), qa_get_logged_in_handle(), qa_cookie_get_create(), array(
                                "userid" => $value,
                                "questionid" => $questionid,
                                "postid" => $postid,
                                "post_type" => strtoupper($type[0]),
                                "time" => time()));

Which means that "postid" is "postid" and $time is time(). Probabily this bug just shows up now because Q2A should have a specific page where it inserts the comments, and then redirects to the question page. Thanks for reporting. :)
by
yea i fix it in mention-detects and now works fine! i reuploanding the plugin with this fix xD
0 votes
by

sorry, its the postID ,
mentions-detect.php :

"userid" => $value,

"questionid" => $questionid,

"postid" => $posid,

"post_type" => strtoupper($type[0]),

"time" => $time));

by
yep, neither $time, nor $posid are defined anywhere.  nothing to do with the comment plugin afaics...
by
hello, yea its a bug of mention-detecti tried fix it mention-detects , posid its fixed change variable to postid, now only $time are no defined i try change it for date or eliminated the time variable
0 votes
by

it was a bug with the mentions plugin in mentios-detect.ph, these two variables are not definided, I fix it, Sorry for inconvenience, now it works fine.

One last suggestion, it would be possible that in the
Q2A-plugin-comment-ajax to give comment, reply etc. The display moves and scroll to the text box/comment box, sometimes gives the top answer in the text box is opened in the last comment and no automatic scroll to the box.

its posibble?

thanx so much noahy

by
sorry NoahY, but the bug with html tags and answers with wyseditor sometimes occurs, sometimes not, I've been trying and sometimes to respond once posted content is displayed inside html tags example: <p> content answer </ p>
only occurs when the responses intruducen spaces or new paragraphs. label <p> content </ p> indicating that space or newline
by
Yeah, I know... I got it working now... it should scroll to the form properly now.
by
I'm sorry I find it easier to decypher Gideon's PHP than your English :P  you'll have to try harder to explain the problem, or I can't help.
by
xD sorry my english its so bad, im from spain xD

the problems its:

1. when you write a response or question with wysiwyg-editor and in writing press "enter" to type in a new paragraph, the publish content appears with these html tags.

2. incorporate a scroll, when clicking in comment or answer the page  scrolling automatically to the text box o comment box

thanks
by
I remember seeing #1 before somewhere, but can't reproduce it now - I don't have the mention plugin installed, though.

#2 should be fixed in the latest git source of the comment plugin.
by
the #1 of the html tags also happens without mention-notifier installed :S, its any problem with q2a-comment-ajax html and wysiwygeditor

#2 thanks so much for the scroll i love it
by
Just to verify, you're not talking about writing comments with wysiwyg?  That is totally broken.  not sure why you're having problems otherwise... no problem here, but I'll look into it.
by
edited by
not clear that I am not writing comments with wysiwyg, I'm writing comments in plain text, but something happens when writing answers not comments, the bug occurs, if you disable the q2a-ajax-comment, the bug does not occur, :S
by
i dowload the last version, and Very nice scroll your great, thanks for it and others plugin
+1 vote
by

Updated now to:

  • include @username references
  • scroll to the comment form automatically
  • close the comment form when pressing Esc key
0 votes
by
edited by

bug with the last version in plain text mode

q2a-comment-ajax enabled in plain text mode+add username

comment in answer and get the next error, and all post its bugged

sorry for my english xD

Fatal error: Call to a member function get_html() on a non-object in /homepages/19/d378890519/htdocs/qs/qa-include/qa-app-format.php on line 306

by
Please try again with the latest code... I made a mistake, I think... hopefully it will work now, it's working here again.
by
the same bug, and now send the comment, but this is not done, does not appear, and sometimes you give comment on the question and the box is opened in response

Fatal error: Call to a member function get_html() on a non-object in /var/www/qs/qa-include/qa-app-format.php on line 306
by
I'm sorry, I don't get this error... I fixed the plain text option to actually show plain text.  Please try the latest code again, but I can't say that it is going to fix your problem... can you try removing all other plugins (the signature plugin was broken, I think I've fixed it now, so you can download the new code if you are using it).
0 votes
by
edited by

hello NoahY,  the

Fatal error: Call to a member function get_html() on a non-object in /homepages/19/d378890519/htdocs/qs/qa-include/qa-app-format.php on line 306

its fix, great!

but there are two problems:

1. If you comment  your own question the dialogue is opened in answer and also the comment is inserted in the first answer  when it should be in your own question.

2. if you comment on other comment of answer in your own question, this is inserted, but not show it the moment,  you need update the page manually, which makes it seem as if the comment is not inserted, but when you refresh the page manually, it appears

thanks NoahY

by
I don't have either of these problems... no matter where I post comments or as whom, the comments show up as expected... strange that we should have different results.
0 votes
by

hello NoahY i upload quick video of my problem for better explanation  http://www.youtube.com/watch?v=8_7bW0yAzgg

thanks

0 votes
by
Just an update that there was a bug in the comment plugin that sometimes stops comments from appearing when submitted.  fixed now, please update.
by
Thanks NoahY i appreciated it
...