refactor(admin): consolidate duplicate configuration
Remove duplicate comment, captcha, filing, and website-security configuration paths. Move front submission verification to the captcha scene matrix and retire obsolete admin routes and components.
This commit is contained in:
@@ -210,6 +210,11 @@
|
||||
|
||||
submit: function (btn, action) {
|
||||
var self = this;
|
||||
if (action !== 'posts_draft' && !this.requestCaptcha(function () {
|
||||
self.submit(btn, action);
|
||||
})) {
|
||||
return;
|
||||
}
|
||||
this.isSubmitting = true;
|
||||
var original = btn.innerHTML;
|
||||
btn.disabled = true;
|
||||
@@ -292,6 +297,25 @@
|
||||
});
|
||||
},
|
||||
|
||||
requestCaptcha: function (onVerified) {
|
||||
var verified = this.form.querySelector('input[name="captcha_verified"]');
|
||||
if (verified && verified.value === '1') {
|
||||
return true;
|
||||
}
|
||||
var captcha = window.AKSRTCaptchaState &&
|
||||
window.AKSRTCaptchaState.scenes &&
|
||||
window.AKSRTCaptchaState.scenes.front_submit;
|
||||
if (!captcha || typeof captcha.verify !== 'function') {
|
||||
return true;
|
||||
}
|
||||
captcha.verify(function (passed) {
|
||||
if (passed) {
|
||||
onVerified();
|
||||
}
|
||||
});
|
||||
return false;
|
||||
},
|
||||
|
||||
bindDraftDelete: function () {
|
||||
document.addEventListener('click', function (e) {
|
||||
var btn = e.target.closest('.aksrt-submit-drafts__delete');
|
||||
|
||||
Reference in New Issue
Block a user