The attached add-on files may be out of date. Please visit Devot-ee for the latest versions.
This plugin uses AJAX to submit comments. Supports pagination, scrolling newly submitted
comment into view and triggering search for certain comment through URL.
I. THE TAG exp:ajax_babble:script
This is a *single* tag.
PARAMETERS
1) form_id - required. Allows you to specify CSS id parameter of the form outputted by
exp:comment:form tag. Usually its value will be “comment_form”.
2) entry_id - required. Allows you to specify ID number of the entry being commented on.
3) comments_template_url - required. Allows you to specify URL of the comment template.
You must specify full URL, i.e. starting with “http”. This parameter accepts inside its value
the following ExpressionEngine variables: site_id, site_url, site_index, homepage.
4) comments_container_id - required. Allows you to specify CSS id parameter of the HTML element
inside which AJAX should output comments.
5) submit_button_id - required. Allows you to specify CSS id parameter of the submit button of the
comment form.
6) comments_number_id - optional. Allows you to specify CSS id parameter of the HTML element
inside which number of comments is displayed; this number will be updated when AJAX will submit a new
comment. This parameter supports pipe operator.
7) css_id_to_scroll - optional. Allows you to specify CSS id parameter of the comment which will
be scrolled into view after AJAX will load comments. Into view will be scrolled either
the newly submitted comment or the comment which was found by the search triggered by URL.
8) preview_template_url - optional. Allows you to specify URL of the preview template.
You must specify full URL, i.e. starting with “http”. This parameter accepts inside its value
the following ExpressionEngine variables: site_id, site_url, site_index, homepage.
9) preview_container_id - optional. Allows you to specify CSS id parameter of the HTML element
inside which AJAX should output comment preview.
10) preview_button_id - optional. Allows you to specify CSS id parameter of the preview button of the
comment form.
11) comments_progress_indicator_id - optional. Allows you to specify CSS id parameter of the HTML element
which will act as the indicator of comments being loaded.
12) preview_progress_indicator_id - optional. Allows you to specify CSS id parameter of the HTML element
which will act as the indicator of comment preview being loaded.
13) progress_indicator_class - optional. Allows you to specify CSS class parameter of the HTML element
which will act as the indicator of comments or comment preview being loaded.
14) comments_error_message_id - optional. Allows you to specify CSS id parameter of the HTML element
inside which an error message outputted when AJAX tried to load comments will be displayed.
15) preview_error_message_id - optional. Allows you to specify CSS id parameter of the HTML element
inside which an error message outputted when AJAX tried to load comment preview will be displayed.
16) error_message_class - optional. Allows you to specify CSS class parameter of the HTML element
inside which an error message outputted when AJAX tried to load comments or comment
preview will be displayed.
17) add_callback_submit - optional. Allows you to specify name of javascript function which
will be executed when AJAX response will be outputted into container after submission of the new comment. This parameter supports pipe character, i.e. you can add several callback functions.
18) add_callback_paginate - optional. Allows you to specify name of javascript function which
will be executed when AJAX response will be outputted into container after clicking of some pagination link. This parameter supports pipe character, i.e. you can add several callback functions.
19) any name of javascript function which is used inside the value of “add_callback_submit” parameter or
“add_callback_paginate” parameter can be used as the name of a new parameter. The value of this parameter will
be used as argument of the relevant javascript function. E.g. if you have parameter
add_callback_submit="my_callback"
then you can add parameter
my_callback="5"
the number “5” will be used as the argument for “my_calback” function.
In case you need to call a function with several arguments, use javascript object. E.g. if you have parameter
add_callback_submit="new_callback"
new_callback='{"value1": null,"value2": "some_string"}'
Continued in the next post.
