client/posts: show ! in title for similar posts
This commit is contained in:
parent
cb8bb0f23b
commit
cc969a808f
2 changed files with 26 additions and 20 deletions
|
@ -282,11 +282,15 @@ function showMessage(target, message, className) {
|
|||
return true;
|
||||
}
|
||||
|
||||
function showError(target, message) {
|
||||
function appendExclamationMark() {
|
||||
if (!document.title.startsWith('!')) {
|
||||
document.oldTitle = document.title;
|
||||
document.title = `! ${document.title}`;
|
||||
}
|
||||
}
|
||||
|
||||
function showError(target, message) {
|
||||
appendExclamationMark();
|
||||
return showMessage(target, misc.formatInlineMarkdown(message), 'error');
|
||||
}
|
||||
|
||||
|
@ -492,23 +496,24 @@ document.addEventListener('click', e => {
|
|||
});
|
||||
|
||||
module.exports = {
|
||||
htmlToDom: htmlToDom,
|
||||
getTemplate: getTemplate,
|
||||
emptyContent: emptyContent,
|
||||
replaceContent: replaceContent,
|
||||
enableForm: enableForm,
|
||||
disableForm: disableForm,
|
||||
decorateValidator: decorateValidator,
|
||||
makeTagLink: makeTagLink,
|
||||
makePostLink: makePostLink,
|
||||
makeCheckbox: makeCheckbox,
|
||||
makeRadio: makeRadio,
|
||||
syncScrollPosition: syncScrollPosition,
|
||||
slideDown: slideDown,
|
||||
slideUp: slideUp,
|
||||
monitorNodeRemoval: monitorNodeRemoval,
|
||||
clearMessages: clearMessages,
|
||||
showError: showError,
|
||||
showSuccess: showSuccess,
|
||||
showInfo: showInfo,
|
||||
htmlToDom: htmlToDom,
|
||||
getTemplate: getTemplate,
|
||||
emptyContent: emptyContent,
|
||||
replaceContent: replaceContent,
|
||||
enableForm: enableForm,
|
||||
disableForm: disableForm,
|
||||
decorateValidator: decorateValidator,
|
||||
makeTagLink: makeTagLink,
|
||||
makePostLink: makePostLink,
|
||||
makeCheckbox: makeCheckbox,
|
||||
makeRadio: makeRadio,
|
||||
syncScrollPosition: syncScrollPosition,
|
||||
slideDown: slideDown,
|
||||
slideUp: slideUp,
|
||||
monitorNodeRemoval: monitorNodeRemoval,
|
||||
clearMessages: clearMessages,
|
||||
appendExclamationMark: appendExclamationMark,
|
||||
showError: showError,
|
||||
showSuccess: showSuccess,
|
||||
showInfo: showInfo,
|
||||
};
|
||||
|
|
|
@ -197,6 +197,7 @@ class PostUploadView extends events.EventTarget {
|
|||
|
||||
showInfo(message, uploadable) {
|
||||
this._showMessage(views.showInfo, message, uploadable);
|
||||
views.appendExclamationMark();
|
||||
}
|
||||
|
||||
_showMessage(functor, message, uploadable) {
|
||||
|
|
Loading…
Reference in a new issue