diff --git a/app/static/css/editor.css b/app/static/css/editor.css index aa9e410..efb5ab9 100644 --- a/app/static/css/editor.css +++ b/app/static/css/editor.css @@ -51,14 +51,14 @@ position: absolute; left: 0px; width: auto; - min-width: 30vw; + min-width: min-content; text-align: left; right: inherit; background: var(--background-hover); border: var(--border); color: var(--text); padding: .2rem; - top: 3.2rem; + top: 2.3rem; z-index: 100; list-style-position: initial; list-style-type: none; @@ -67,10 +67,16 @@ margin: 0.8rem; margin-top: 0.4rem; margin-bottom: 1rem; + min-width: 30vw; } .editor .modal > div label { margin-top: 0.4rem; } +.editor .modal a.editor-emoji-close-btn { + display: inline-block; + margin: 0.3rem; + margin-top: 0.5rem; +} @media screen and (max-width:849px) { .editor .modal { width: 80vw; diff --git a/app/static/css/global.css b/app/static/css/global.css index a956df7..0a84f86 100644 --- a/app/static/css/global.css +++ b/app/static/css/global.css @@ -78,6 +78,12 @@ section h2 { color: var(--text-light); padding-bottom: 2px; } +section blockquote { + margin: 0 0 10px 0; + border-left: 3px solid var(--border); + background: var(--background); + padding-left: 15px; +} button, .button, input[type="button"], diff --git a/app/static/css/themes/FK_dark_theme.css b/app/static/css/themes/FK_dark_theme.css index acd62c4..bba8d16 100644 --- a/app/static/css/themes/FK_dark_theme.css +++ b/app/static/css/themes/FK_dark_theme.css @@ -130,6 +130,11 @@ table.codehilitetable { --background: #263238; } +blockquote { + --border: rgba(255, 255, 255, .3); + --background: transparent; +} + div.editor-toolbar, div.CodeMirror { --border: #404040; --background-light: #404040; diff --git a/app/static/css/themes/Tituya_v43_theme.css b/app/static/css/themes/Tituya_v43_theme.css index 0d75a56..7dda869 100644 --- a/app/static/css/themes/Tituya_v43_theme.css +++ b/app/static/css/themes/Tituya_v43_theme.css @@ -145,6 +145,11 @@ table.thread.topcomment { border: 1px solid #c0c0c0; } +blockquote { + --border: rgba(236, 36, 36, .7); + --background: transparent; +} + div.editor-toolbar { --border: #aaa2a2; --background-light: #c0c0c0; diff --git a/app/static/css/themes/default_theme.css b/app/static/css/themes/default_theme.css index 0b2d169..d885174 100644 --- a/app/static/css/themes/default_theme.css +++ b/app/static/css/themes/default_theme.css @@ -37,6 +37,11 @@ table th { --border: #ddd; } +blockquote { + --border: rgba(0, 0, 0, .3); + --background: transparent; +} + .form { --background: #fff; --text: #000; diff --git a/app/static/less/editor.less b/app/static/less/editor.less index 46d0a3b..3f3a5c4 100644 --- a/app/static/less/editor.less +++ b/app/static/less/editor.less @@ -63,7 +63,7 @@ position: absolute; left: 0px; width: auto; - min-width: 30vw; + min-width: min-content; text-align: left; right: inherit; @@ -79,7 +79,7 @@ border: var(--border); color: var(--text); padding: .2rem; - top: 3.2rem; + top: 2.3rem; z-index: 100; list-style-position: initial; list-style-type: none; @@ -88,11 +88,18 @@ margin: 0.8rem; margin-top: 0.4rem; margin-bottom: 1rem; + min-width: 30vw; label { margin-top: 0.4rem; } } + + a.editor-emoji-close-btn { + display: inline-block; + margin: 0.3rem; + margin-top: 0.5rem; + } } } diff --git a/app/static/less/global.less b/app/static/less/global.less index 3036468..b175aa0 100644 --- a/app/static/less/global.less +++ b/app/static/less/global.less @@ -77,6 +77,13 @@ section { color: var(--text-light); padding-bottom: 2px; } + + blockquote { + margin: 0 0 10px 0; + border-left: 3px solid var(--border); + background: var(--background); + padding-left: 15px; + } } /* Buttons */ diff --git a/app/static/scripts/editor.js b/app/static/scripts/editor.js index 930b223..5dc3016 100644 --- a/app/static/scripts/editor.js +++ b/app/static/scripts/editor.js @@ -94,7 +94,7 @@ function editor_act_on_lines(event, fn) let lines = ta.value.substring(firstLineIndex, lastLineIndex).split('\n'); for(let i = 0; i < lines.length; i++) - lines[i] = fn(lines[i]); + lines[i] = fn(lines[i], i); let [start, end] = editor_replace_range(ta, firstLineIndex, lastLineIndex, lines.join('\n')); @@ -114,7 +114,7 @@ function editor_clear_modals(event, close = true) document.getElementById('media-alt-input').value = ''; document.getElementById('media-link-input').value = ''; document.getElementById('link-desc-input').value = ''; - document.getElementById('link-desc-input').value = ''; + document.getElementById('link-link-input').value = ''; const media_type = document.getElementsByName("media-type"); for(i = 0; i < media_type.length; i++) { media_type[i].checked = false; @@ -162,7 +162,7 @@ function editor_display_link_modal(event) { event.currentTarget.querySelector("#link-desc-input").value = selection; } - event.currentTarget.children[1].style = {'display': 'block'}; + editor_display_child_modal(event); } function editor_insert_link(event, link_id, text_id, media = false) @@ -202,7 +202,7 @@ function editor_insert_link(event, link_id, text_id, media = false) function editor_title(event, level, diff) { - editor_act_on_lines(event, function(line) { + editor_act_on_lines(event, function(line, _) { /* Strip all the initial # (and count them) */ let count = 0; while(count < line.length && line[count] == '#') count++; @@ -230,7 +230,7 @@ function editor_title(event, level, diff) function editor_quote(event) { - editor_act_on_lines(event, function(line) { + editor_act_on_lines(event, function(line, _) { /* Strip all the initial > (and count them) */ let count = 0; while(count < line.length && line[count] == '>') count++; @@ -246,7 +246,7 @@ function editor_quote(event) function editor_bullet_list(event) { - editor_act_on_lines(event, function(line) { + editor_act_on_lines(event, function(line, _) { let ident_match = line.match(/^[\t]+/m) ?? ['']; let ident = ident_match[0]; let count = ident.length; @@ -260,13 +260,13 @@ function editor_bullet_list(event) function editor_numbered_list(event) { - editor_act_on_lines(event, function(line) { + editor_act_on_lines(event, function(line, number) { let ident_match = line.match(/^[\t]+/m) ?? ['']; let ident = ident_match[0]; let count = ident.length; const contents = line.slice(count); - if ((count < line.length || count == 0) && isNaN(line[count])) return '1. ' + contents; + if ((count < line.length || count == 0) && isNaN(line[count])) return `${number + 1}. ` + contents; return ident + "\t" + contents; }); @@ -284,7 +284,8 @@ function editor_separator(event) { editor_insert_around(event, "", "\n---\n"); } -function editor_display_emoji_modal(event) { +function editor_display_child_modal(event) { + editor_clear_modals(event); event.currentTarget.children[1].style = {'display': 'block'}; } diff --git a/app/templates/index.html b/app/templates/index.html index 62381bb..a80c4ef 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -7,10 +7,6 @@ {% block content %}
-

Site temporaire de Planète Casio

- -

Le site habituel de Planète Casio est indisponible en raison de problèmes techniques avec l'hébergement. Vous êtes sur la prochaine version du site (v5) qui est en développement sur un serveur séparé.

-
-