wire/modules/Fieldtype/FieldtypeComments/comments.js
/**
 * Event handler for comment submit button click
 * 
 * Remember values when comment form submitted and save in cookie
 * so that other comment forms can be populated with same info to 
 * save them a step. 
 * 
 */
Event handler for comment submit button click

Remember values when comment form submitted and save in cookie
so that other comment forms can be populated with same info to
save them a step.
Event handler for comment submit button click Remember values when comment form submitted and save in cookie so that other comment forms can be populated with same info to save them a step .
function CommentFormSubmitClick() {
	var $this = jQuery(this);
	var $form = $this.closest('form.CommentForm');
	var $wrapStars = $form.find('.CommentFormStarsRequired');
	if($wrapStars.length) {
		var stars = parseInt($wrapStars.find('input').val());
		if(!stars) {
			alert($wrapStars.attr('data-note'));
			return false;
		}
	}
	var cite = $form.find(".CommentFormCite input").val();
	var email = $form.find(".CommentFormEmail input").val();
	var $website = $form.find(".CommentFormWebsite input");
	var website = $website.length > 0 ? $website.val() : '';
	var $notify = $form.find(".CommentFormNotify :checked");
	var notify = $notify.length > 0 ? $notify.val() : '';
	if(cite.indexOf('|') > -1) cite = '';
	if(email.indexOf('|') > -1) email = '';
	if(website.indexOf('|') > -1) website = '';
	var cookieValue = cite + '|' + email + '|' + website + '|' + notify;
	CommentFormSetCookie('CommentForm', cookieValue, 0);
}
function CommentFormSubmitClick ( ) { var $this = jQuery ( this ) ; var $form = $this . closest ( 'form.CommentForm' ) ; var $wrapStars = $form . find ( '.CommentFormStarsRequired' ) ; if ( $wrapStars . length ) { var stars = parseInt ( $wrapStars . find ( 'input' ) . val ( ) ) ; if ( ! stars ) { alert ( $wrapStars . attr ( 'data-note' ) ) ; return false ; } } var cite = $form . find ( ".CommentFormCite input" ) . val ( ) ; var email = $form . find ( ".CommentFormEmail input" ) . val ( ) ; var $website = $form . find ( ".CommentFormWebsite input" ) ; var website = $website . length > 0 ? $website . val ( ) : '' ; var $notify = $form . find ( ".CommentFormNotify :checked" ) ; var notify = $notify . length > 0 ? $notify . val ( ) : '' ; if ( cite . indexOf ( '|' ) > - 1 ) cite = '' ; if ( email . indexOf ( '|' ) > - 1 ) email = '' ; if ( website . indexOf ( '|' ) > - 1 ) website = '' ; var cookieValue = cite + '|' + email + '|' + website + '|' + notify ; CommentFormSetCookie ( 'CommentForm' , cookieValue , 0 ) ; }
Event handler for comment submit button click
Event handler for comment submit button click