diff --git a/public/src/admin/manage/digest.js b/public/src/admin/manage/digest.js index 365ac776b6..10af481eab 100644 --- a/public/src/admin/manage/digest.js +++ b/public/src/admin/manage/digest.js @@ -1,35 +1,39 @@ 'use strict'; - define('admin/manage/digest', ['bootbox', 'alerts'], function (bootbox, alerts) { const Digest = {}; + console.log('Mia Li'); + function interval_resend(action) { + const interval = action.slice(7); + bootbox.confirm('[[admin/manage/digest:resend-all-confirm]]', function (ok) { + if (ok) { + Digest.send(action, undefined, function (err) { + if (err) { + return alerts.error(err); + } + alerts.success('[[admin/manage/digest:resent-' + interval + ']]'); + }); + } + }); + } + function single_resend(action, uid) { + Digest.send(action, uid, function (err) { + if (err) { + return alerts.error(err); + } + alerts.success('[[admin/manage/digest:resent-single]]'); + }); + } Digest.init = function () { $('.digest').on('click', '[data-action]', function () { const action = this.getAttribute('data-action'); const uid = this.getAttribute('data-uid'); if (action.startsWith('resend-')) { - const interval = action.slice(7); - bootbox.confirm('[[admin/manage/digest:resend-all-confirm]]', function (ok) { - if (ok) { - Digest.send(action, undefined, function (err) { - if (err) { - return alerts.error(err); - } - - alerts.success('[[admin/manage/digest:resent-' + interval + ']]'); - }); - } - }); + interval_resend(action); } else { - Digest.send(action, uid, function (err) { - if (err) { - return alerts.error(err); - } - - alerts.success('[[admin/manage/digest:resent-single]]'); - }); + single_resend(action, uid); } }); };