v1.18.x
Julian Lam 7 years ago
parent 25cd21fba8
commit e42ff47e5c

@ -67,9 +67,9 @@
"nodebb-plugin-spam-be-gone": "0.5.1",
"nodebb-rewards-essentials": "0.0.9",
"nodebb-theme-lavender": "4.1.1",
"nodebb-theme-persona": "6.1.6",
"nodebb-theme-persona": "6.1.7",
"nodebb-theme-slick": "1.1.1",
"nodebb-theme-vanilla": "7.1.4",
"nodebb-theme-vanilla": "7.1.5",
"nodebb-widget-essentials": "3.0.7",
"nodemailer": "4.3.0",
"passport": "^0.4.0",

@ -54,7 +54,11 @@
"modal-body": "Please specify your reason for flagging %1 %2 for review. Alternatively, use one of the quick report buttons if applicable.",
"modal-reason-spam": "Spam",
"modal-reason-offensive": "Offensive",
"modal-reason-other": "Other (specify below)",
"modal-reason-custom": "Reason for reporting this content...",
"modal-submit": "Submit Report",
"modal-submit-success": "Content has been flagged for moderation."
"modal-submit-success": "Content has been flagged for moderation.",
"modal-submit-confirm": "Confirm Submission",
"modal-submit-confirm-text": "You have a custom reason specified already. Are you sure you wish to submit via quick-report?",
"modal-submit-confirm-text-help": "Submitting a quick report will overwrite any custom reasons defined."
}

@ -5,6 +5,7 @@ define('flags', ['benchpress'], function (Benchpress) {
var Flag = {};
var flagModal;
var flagCommit;
var flagReason;
Flag.showFlagModal = function (data) {
parseModal(data, function (html) {
@ -15,15 +16,38 @@ define('flags', ['benchpress'], function (Benchpress) {
});
flagCommit = flagModal.find('#flag-post-commit');
flagReason = flagModal.find('#flag-reason-custom');
// Quick-report buttons
flagModal.on('click', '.flag-reason', function () {
createFlag(data.type, data.id, $(this).text());
var reportText = $(this).text();
if (flagReason.length === 0) {
return createFlag(data.type, data.id, reportText);
}
// Custom reason has text, confirm submission
bootbox.confirm({
title: '[[flags:modal-submit-confirm]]',
message: '<p>[[flags:modal-submit-confirm-text]]</p><p class="help-block">[[flags:modal-submit-confirm-text-help]]</p>',
callback: function (result) {
if (result) {
createFlag(data.type, data.id, reportText);
}
},
});
});
// Custom reason report submission
flagCommit.on('click', function () {
createFlag(data.type, data.id, flagModal.find('#flag-reason-custom').val());
});
flagModal.on('click', '.toggle-custom', function () {
flagReason.prop('disabled', false);
flagReason.focus();
});
flagModal.modal('show');
flagModal.find('#flag-reason-custom').on('keyup blur change', checkFlagButtonEnable);

Loading…
Cancel
Save