From a86422266e08bfea731eb0b717ca5eae2e64a57a Mon Sep 17 00:00:00 2001 From: ansuz Date: Thu, 24 Jun 2021 17:56:58 +0530 Subject: [PATCH] good contrast for most of the remote image warning --- customize.dist/src/less2/include/markdown.less | 7 ++++--- www/common/diffMarked.js | 16 ++++++++++------ 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/customize.dist/src/less2/include/markdown.less b/customize.dist/src/less2/include/markdown.less index 11c8a7eb4..3e1837f96 100644 --- a/customize.dist/src/less2/include/markdown.less +++ b/customize.dist/src/less2/include/markdown.less @@ -157,10 +157,11 @@ div.cp-inline-img-warning { display: inline-block; - //border: 1px solid red !important; // @cp_markdown-border !important; padding: 10px; - //color: @cryptpad_color_light_red; // very bad in light mode - //background: @cryptpad_color_red_fader; + + color: @cryptpad_text_col; + background-color: @cryptpad_color_red_fader; + border: 1px solid @cryptpad_color_red; .cp-inline-img { display: flex; diff --git a/www/common/diffMarked.js b/www/common/diffMarked.js index d432b0841..f14b9aab6 100644 --- a/www/common/diffMarked.js +++ b/www/common/diffMarked.js @@ -279,8 +279,12 @@ define([ } }; - renderer.image = function (href, title, text) { // XXX - if (href.slice(0,6) === '/file/') { // XXX this has been deprecated for about 3 years... use the same inline image handler as below? + Messages.resources_imageBlocked = "CryptPad blocked a remote image"; // XXX + Messages.resources_openInNewTab = "Open its source in a new tab"; // XXX + Messages.resources_learnWhy = "Learn why it was blocked"; // XXX + + renderer.image = function (href, title, text) { + if (href.slice(0,6) === '/file/') { // XXX this has been deprecated for about 3 years. Maybe we should display a warning? // DEPRECATED // Mediatag using markdown syntax should not be used anymore so they don't support // password-protected files @@ -301,20 +305,20 @@ define([ h('div.cp-inline-img', [ h('img.cp-inline-img', { src: '/images/broken.png', - title: title || '', + //title: title || '', }), h('p.cp-alt-txt', text), ]), h('span.cp-img-block-notice', { - }, "CryptPad blocked a remote image."), + }, Messages.resources_imageBlocked), h('br'), h('a.cp-remote-img', { href: qualifiedHref(href), - }, "Open its source in a new tab"), + }, Messages.resources_openInNewTab), h('br'), h('a.cp-learn-more', { href: 'https://docs.cryptpad.fr/en/user_guide/index.html?placeholder=remote_images', - }, 'learn why it was blocked'), + }, Messages.resources_learnWhy), ]); return warning.outerHTML;