|
|
|
@ -107,10 +107,15 @@ |
|
|
|
|
|
|
|
function registerUpdateOfNewComment($container) { |
|
|
|
$container.find('.cms-comment-update-form').each(function () { |
|
|
|
let $form = $(this); |
|
|
|
var $form = $(this); |
|
|
|
|
|
|
|
$form.submit(function (e) { |
|
|
|
e.preventDefault(); |
|
|
|
|
|
|
|
abp.ui.setBusy($form.find("button[type='submit']")); |
|
|
|
|
|
|
|
let formAsObject = $form.serializeFormToObject(); |
|
|
|
|
|
|
|
$.ajax({ |
|
|
|
type: 'POST', |
|
|
|
url: '/CmsKitPublicComments/Update/' + formAsObject.id, |
|
|
|
@ -124,9 +129,11 @@ |
|
|
|
}), |
|
|
|
success: function () { |
|
|
|
widgetManager.refresh($widget); |
|
|
|
abp.ui.clearBusy(); |
|
|
|
}, |
|
|
|
error: function (data) { |
|
|
|
abp.message.error(data.responseJSON.error.message); |
|
|
|
abp.ui.clearBusy(); |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
@ -135,10 +142,14 @@ |
|
|
|
|
|
|
|
function registerSubmissionOfNewComment($container) { |
|
|
|
$container.find('.cms-comment-form').each(function () { |
|
|
|
let $form = $(this); |
|
|
|
var $form = $(this); |
|
|
|
|
|
|
|
$form.submit(function (e) { |
|
|
|
e.preventDefault(); |
|
|
|
let formAsObject = $form.serializeFormToObject(); |
|
|
|
|
|
|
|
abp.ui.setBusy("button[type='submit']"); |
|
|
|
|
|
|
|
var formAsObject = $form.serializeFormToObject(); |
|
|
|
|
|
|
|
if (formAsObject.repliedCommentId == '') { |
|
|
|
formAsObject.repliedCommentId = null; |
|
|
|
@ -146,6 +157,7 @@ |
|
|
|
|
|
|
|
if (formAsObject.commentText == '') { |
|
|
|
abp.message.error(l("CommentTextRequired")); |
|
|
|
abp.ui.clearBusy(); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
@ -161,13 +173,16 @@ |
|
|
|
text: formAsObject.commentText, |
|
|
|
url: window.location.href, |
|
|
|
captchaToken: formAsObject.captchaId, |
|
|
|
captchaAnswer: formAsObject.input?.captcha |
|
|
|
captchaAnswer: formAsObject.input?.captcha, |
|
|
|
idempotencyToken: formAsObject.idempotencyToken |
|
|
|
}), |
|
|
|
success: function () { |
|
|
|
widgetManager.refresh($widget); |
|
|
|
abp.ui.clearBusy(); |
|
|
|
}, |
|
|
|
error: function (data) { |
|
|
|
abp.message.error(data.responseJSON.error.message); |
|
|
|
abp.ui.clearBusy(); |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|