mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-20 07:20:27 +01:00
fix: #4695, remove new notif alert
This commit is contained in:
@@ -2,6 +2,5 @@
|
|||||||
"notifications": "Notifications",
|
"notifications": "Notifications",
|
||||||
"welcome-notification": "Welcome Notification",
|
"welcome-notification": "Welcome Notification",
|
||||||
"welcome-notification-link": "Welcome Notification Link",
|
"welcome-notification-link": "Welcome Notification Link",
|
||||||
"welcome-notification-uid": "Welcome Notification User (UID)",
|
"welcome-notification-uid": "Welcome Notification User (UID)"
|
||||||
"notification-alert-timeout": "Notification Alert Timeout"
|
|
||||||
}
|
}
|
||||||
@@ -55,32 +55,6 @@ define('notifications', ['sounds', 'translator', 'components', 'navigator', 'ben
|
|||||||
};
|
};
|
||||||
|
|
||||||
Notifications.onNewNotification = function (notifData) {
|
Notifications.onNewNotification = function (notifData) {
|
||||||
// If a path is defined, show notif data, otherwise show generic data
|
|
||||||
var payload = {
|
|
||||||
alert_id: 'new_notif',
|
|
||||||
title: '[[notifications:new_notification]]',
|
|
||||||
timeout: parseInt(config.notificationAlertTimeout, 10) || 5000,
|
|
||||||
};
|
|
||||||
|
|
||||||
if (notifData.path) {
|
|
||||||
payload.message = notifData.bodyShort;
|
|
||||||
payload.type = 'info';
|
|
||||||
payload.clickfn = function () {
|
|
||||||
markNotification(notifData.nid, true);
|
|
||||||
if (notifData.path.startsWith('http') || notifData.path.startsWith('https')) {
|
|
||||||
window.location.href = notifData.path;
|
|
||||||
} else {
|
|
||||||
window.location.href = window.location.protocol + '//' + window.location.host + config.relative_path + notifData.path;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
payload.message = '[[notifications:you_have_unread_notifications]]';
|
|
||||||
payload.type = 'warning';
|
|
||||||
}
|
|
||||||
|
|
||||||
app.alert(payload);
|
|
||||||
app.refreshTitle();
|
|
||||||
|
|
||||||
if (ajaxify.currentPage === 'notifications') {
|
if (ajaxify.currentPage === 'notifications') {
|
||||||
ajaxify.refresh();
|
ajaxify.refresh();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,7 +61,6 @@ apiController.loadConfig = async function (req) {
|
|||||||
searchEnabled: plugins.hasListeners('filter:search.query'),
|
searchEnabled: plugins.hasListeners('filter:search.query'),
|
||||||
bootswatchSkin: meta.config.bootswatchSkin || '',
|
bootswatchSkin: meta.config.bootswatchSkin || '',
|
||||||
enablePostHistory: meta.config.enablePostHistory === 1,
|
enablePostHistory: meta.config.enablePostHistory === 1,
|
||||||
notificationAlertTimeout: meta.config.notificationAlertTimeout || 5000,
|
|
||||||
timeagoCutoff: meta.config.timeagoCutoff !== '' ? Math.max(0, parseInt(meta.config.timeagoCutoff, 10)) : meta.config.timeagoCutoff,
|
timeagoCutoff: meta.config.timeagoCutoff !== '' ? Math.max(0, parseInt(meta.config.timeagoCutoff, 10)) : meta.config.timeagoCutoff,
|
||||||
timeagoCodes: languages.timeagoCodes,
|
timeagoCodes: languages.timeagoCodes,
|
||||||
cookies: {
|
cookies: {
|
||||||
|
|||||||
@@ -7,8 +7,6 @@
|
|||||||
<strong>[[admin/settings/notifications:welcome-notification]]</strong><br /> <textarea class="form-control" data-field="welcomeNotification"></textarea><br />
|
<strong>[[admin/settings/notifications:welcome-notification]]</strong><br /> <textarea class="form-control" data-field="welcomeNotification"></textarea><br />
|
||||||
<strong>[[admin/settings/notifications:welcome-notification-link]]</strong><br /> <input type="text" class="form-control" data-field="welcomeLink"><br />
|
<strong>[[admin/settings/notifications:welcome-notification-link]]</strong><br /> <input type="text" class="form-control" data-field="welcomeLink"><br />
|
||||||
<strong>[[admin/settings/notifications:welcome-notification-uid]]</strong><br /> <input type="text" class="form-control" data-field="welcomeUid"><br />
|
<strong>[[admin/settings/notifications:welcome-notification-uid]]</strong><br /> <input type="text" class="form-control" data-field="welcomeUid"><br />
|
||||||
|
|
||||||
<strong>[[admin/settings/notifications:notification-alert-timeout]]</strong><br /> <input type="text" class="form-control" data-field="notificationAlertTimeout" placeholder="5000"><br />
|
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user