client/posts: show ! in title for similar posts
This commit is contained in:
parent
cb8bb0f23b
commit
cc969a808f
|
@ -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');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -492,23 +496,24 @@ document.addEventListener('click', e => {
|
||||||
});
|
});
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
htmlToDom: htmlToDom,
|
htmlToDom: htmlToDom,
|
||||||
getTemplate: getTemplate,
|
getTemplate: getTemplate,
|
||||||
emptyContent: emptyContent,
|
emptyContent: emptyContent,
|
||||||
replaceContent: replaceContent,
|
replaceContent: replaceContent,
|
||||||
enableForm: enableForm,
|
enableForm: enableForm,
|
||||||
disableForm: disableForm,
|
disableForm: disableForm,
|
||||||
decorateValidator: decorateValidator,
|
decorateValidator: decorateValidator,
|
||||||
makeTagLink: makeTagLink,
|
makeTagLink: makeTagLink,
|
||||||
makePostLink: makePostLink,
|
makePostLink: makePostLink,
|
||||||
makeCheckbox: makeCheckbox,
|
makeCheckbox: makeCheckbox,
|
||||||
makeRadio: makeRadio,
|
makeRadio: makeRadio,
|
||||||
syncScrollPosition: syncScrollPosition,
|
syncScrollPosition: syncScrollPosition,
|
||||||
slideDown: slideDown,
|
slideDown: slideDown,
|
||||||
slideUp: slideUp,
|
slideUp: slideUp,
|
||||||
monitorNodeRemoval: monitorNodeRemoval,
|
monitorNodeRemoval: monitorNodeRemoval,
|
||||||
clearMessages: clearMessages,
|
clearMessages: clearMessages,
|
||||||
showError: showError,
|
appendExclamationMark: appendExclamationMark,
|
||||||
showSuccess: showSuccess,
|
showError: showError,
|
||||||
showInfo: showInfo,
|
showSuccess: showSuccess,
|
||||||
|
showInfo: showInfo,
|
||||||
};
|
};
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
Loading…
Reference in New Issue