client/posts: show ! in title for similar posts

This commit is contained in:
rr- 2017-01-08 02:31:07 +01:00
parent cb8bb0f23b
commit cc969a808f
2 changed files with 26 additions and 20 deletions

View File

@ -282,11 +282,15 @@ function showMessage(target, message, className) {
return true; return true;
} }
function showError(target, message) { function appendExclamationMark() {
if (!document.title.startsWith('!')) { if (!document.title.startsWith('!')) {
document.oldTitle = document.title; document.oldTitle = document.title;
document.title = `! ${document.title}`; document.title = `! ${document.title}`;
} }
}
function showError(target, message) {
appendExclamationMark();
return showMessage(target, misc.formatInlineMarkdown(message), 'error'); return showMessage(target, misc.formatInlineMarkdown(message), 'error');
} }
@ -508,6 +512,7 @@ module.exports = {
slideUp: slideUp, slideUp: slideUp,
monitorNodeRemoval: monitorNodeRemoval, monitorNodeRemoval: monitorNodeRemoval,
clearMessages: clearMessages, clearMessages: clearMessages,
appendExclamationMark: appendExclamationMark,
showError: showError, showError: showError,
showSuccess: showSuccess, showSuccess: showSuccess,
showInfo: showInfo, showInfo: showInfo,

View File

@ -197,6 +197,7 @@ class PostUploadView extends events.EventTarget {
showInfo(message, uploadable) { showInfo(message, uploadable) {
this._showMessage(views.showInfo, message, uploadable); this._showMessage(views.showInfo, message, uploadable);
views.appendExclamationMark();
} }
_showMessage(functor, message, uploadable) { _showMessage(functor, message, uploadable) {