|
|
|
@ -57,8 +57,12 @@ define('forum/account/header', [
|
|
|
|
|
components.get('account/mute').on('click', function () {
|
|
|
|
|
muteAccount(ajaxify.data.theirid);
|
|
|
|
|
});
|
|
|
|
|
components.get('account/unban').on('click', unbanAccount);
|
|
|
|
|
components.get('account/unmute').on('click', unmuteAccount);
|
|
|
|
|
components.get('account/unban').on('click', function () {
|
|
|
|
|
unbanAccount(ajaxify.data.theirid);
|
|
|
|
|
});
|
|
|
|
|
components.get('account/unmute').on('click', function () {
|
|
|
|
|
unmuteAccount(ajaxify.data.theirid);
|
|
|
|
|
});
|
|
|
|
|
components.get('account/delete-account').on('click', handleDeleteEvent.bind(null, 'account'));
|
|
|
|
|
components.get('account/delete-content').on('click', handleDeleteEvent.bind(null, 'content'));
|
|
|
|
|
components.get('account/delete-all').on('click', handleDeleteEvent.bind(null, 'purge'));
|
|
|
|
@ -73,6 +77,8 @@ define('forum/account/header', [
|
|
|
|
|
// TODO: This exported method is used in forum/flags/detail -- refactor??
|
|
|
|
|
AccountHeader.banAccount = banAccount;
|
|
|
|
|
AccountHeader.muteAccount = muteAccount;
|
|
|
|
|
AccountHeader.unbanAccount = unbanAccount;
|
|
|
|
|
AccountHeader.unmuteAccount = unmuteAccount;
|
|
|
|
|
|
|
|
|
|
function hidePrivateLinks() {
|
|
|
|
|
if (!app.user.uid || app.user.uid !== parseInt(ajaxify.data.theirid, 10)) {
|
|
|
|
@ -176,8 +182,8 @@ define('forum/account/header', [
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function unbanAccount() {
|
|
|
|
|
api.del('/users/' + ajaxify.data.theirid + '/ban').then(() => {
|
|
|
|
|
function unbanAccount(theirid) {
|
|
|
|
|
api.del('/users/' + theirid + '/ban').then(() => {
|
|
|
|
|
ajaxify.refresh();
|
|
|
|
|
}).catch(alerts.error);
|
|
|
|
|
}
|
|
|
|
@ -223,8 +229,8 @@ define('forum/account/header', [
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function unmuteAccount() {
|
|
|
|
|
api.del('/users/' + ajaxify.data.theirid + '/mute').then(() => {
|
|
|
|
|
function unmuteAccount(theirid) {
|
|
|
|
|
api.del('/users/' + theirid + '/mute').then(() => {
|
|
|
|
|
ajaxify.refresh();
|
|
|
|
|
}).catch(alerts.error);
|
|
|
|
|
}
|
|
|
|
|