Merge branch 'dev' of gitea.planet-casio.com:devs/PCv5 into moderation/lockthread

This commit is contained in:
Darks 2023-06-06 21:35:33 +02:00
commit 6817b79680
Signed by: Darks
GPG Key ID: 7515644268BE1433
10 changed files with 58 additions and 19 deletions

View File

@ -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;

View File

@ -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"],

View File

@ -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;

View File

@ -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;

View File

@ -37,6 +37,11 @@ table th {
--border: #ddd;
}
blockquote {
--border: rgba(0, 0, 0, .3);
--background: transparent;
}
.form {
--background: #fff;
--text: #000;

View File

@ -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;
}
}
}

View File

@ -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 */

View File

@ -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'};
}

View File

@ -7,10 +7,6 @@
{% block content %}
<section class="home-pinned-content">
<div>
<p><b>Site temporaire de Planète Casio</b></p>
<p>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é.</p>
<ul>
<li>Inscription : dans le menu "Compte" à gauche (les comptes seront ultimement reconnectés à la version originale du site)</li>
<li>Le forum est fonctionnel, les programmes arrivent sous peu.</li>

View File

@ -92,13 +92,14 @@
</svg>
</button>
<!-- Emojis -->
<button type="button" onclick="editor_display_emoji_modal(event)" title="Emoji">
<button type="button" onclick="editor_display_child_modal(event)" title="Emoji">
<svg viewBox="0 0 24 24">
<path d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm3.5-9c.83 0 1.5-.67 1.5-1.5S16.33 8 15.5 8 14 8.67 14 9.5s.67 1.5 1.5 1.5zm-7 0c.83 0 1.5-.67 1.5-1.5S9.33 8 8.5 8 7 8.67 7 9.5 7.67 11 8.5 11zm3.5 6.5c2.33 0 4.31-1.46 5.11-3.5H6.89c.8 2.04 2.78 3.5 5.11 3.5z"/>
</svg>
<div class="modal" style=display:none>
<emoji-picker data-source={{url_for('static', filename='scripts/emoji-picker-element/data.json')}}></emoji-picker>
<a type="button" class="button bg-error editor-emoji-close-btn" onclick="editor_clear_modals(event)">Annuler</a>
</div>
</button>
<!-- Links -->
@ -120,7 +121,7 @@
</div>
</button>
<!-- Images -->
<button type="button" onclick="event.currentTarget.children[1].style = {'display': 'block'}" title="Image">
<button type="button" onclick="editor_display_child_modal(event)" title="Image">
<svg viewBox="0 0 24 24">
<path d="M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z"/>
</svg>