Compare commits

...

5 commits

Author SHA1 Message Date
Christian Hesse
2c5a66c069 contrib/notification: increase font size for heading 2025-11-20 22:39:18 +01:00
Christian Hesse
d8e79b7a24 contrib/notification: disable the border-radius for logo 2025-11-20 22:39:18 +01:00
Christian Hesse
c6e9a81e4c contrib/notification: use rsc.eworm.de for default link 2025-11-20 22:39:18 +01:00
Christian Hesse
f69b86348b contrib/html: add a class for code...
... and make sure the notification generator does not suffer
strange styles.
2025-11-20 22:38:28 +01:00
Christian Hesse
699be25b64 general/clipboard: use textContent...
... and avoid having html entity encoded characters in clipboard.
2025-11-20 20:44:56 +01:00
4 changed files with 9 additions and 6 deletions

View file

@ -14,7 +14,7 @@ markdown -f toc,idanchor "${1}" | sed \
-e 's/href="\([-_\./[:alnum:]]*\)\.md\(#[-[:alnum:]]*\)\?"/href="\1.html\2"/g' \
-e '/<h[1234] /s| id="\(.*\)">| id="\L\1">|' \
-e '/<h[1234] /s|-2[1789cd]-||g' -e '/<h[1234] /s|--26-amp-3b-||g' \
-e '/^<pre>/s|pre|pre onclick="CopyToClipboard(this)"|g' \
-e '/^<pre>/s|pre|pre class="code" onclick="CopyToClipboard(this)"|g' \
-e '/The above link may be broken on code hosting sites/s|blockquote|blockquote style="display: none;"|'
sed \

View file

@ -31,7 +31,7 @@ instead.</p></blockquote>
<div class="content">
<p id="heading" class="heading">[<span id="hostname">MikroTik</span>] <span id="subject"> Subject</span></p>
<pre id="message">Message</pre>
<p id="link" class="hint">🔗 <span id="link-text" class="link">https://eworm.de/</span></p>
<p id="link" class="hint">🔗 <span id="link-text" class="link">https://rsc.eworm.de/</span></p>
<p id="queued" class="hint">⏰ This message was queued since <i><span id="queued-since">2025-10-29 16:06:18</span></i> and may be obsolete.</p>
<p id="cut" class="hint">✂️ The message was too long and has been truncated, cut off <i><span id="cut-percent">13</span>%</i>!</p>
</div>
@ -40,7 +40,7 @@ instead.</p></blockquote>
<p>Hostname: <input type="text" value="MikroTik" onchange="update(this, 'hostname')"></p>
<p>Subject: <input type="text" size=50 value=" Subject" onchange="update(this, 'subject')"></p>
<p>Message: <textarea id="w3review" name="w3review" rows="4" cols="50" onchange="update(this, 'message')">Message</textarea></p>
<p><input type="checkbox" onclick="visible(this, 'link')"> Show link: <input type="text" value="https://eworm.de/" onchange="update(this, 'link-text')"></p>
<p><input type="checkbox" onclick="visible(this, 'link')"> Show link: <input type="text" value="https://rsc.eworm.de/" onchange="update(this, 'link-text')"></p>
<p><input type="checkbox" onclick="visible(this, 'queued')"> Queued since <input type="text" value="2025-10-29 16:06:18" onchange="update(this, 'queued-since')"></p>
<p><input type="checkbox" onclick="visible(this, 'cut')"> Cut-off with <input type="number" min=1 max=99 value=13 onchange="update(this, 'cut-percent')"> percent</p>

View file

@ -1,7 +1,7 @@
/* copy code to clipboard */
function CopyToClipboard(element) {
element.style.filter = 'invert(1)';
navigator.clipboard.writeText(element.firstElementChild.innerHTML);
navigator.clipboard.writeText(element.firstElementChild.textContent);
setTimeout(function() {
element.style.filter = 'invert(0)';
}, 100);

View file

@ -41,13 +41,14 @@ div.content {
}
img.logo {
float: left;
border-radius: 50%;
/* border-radius: 50%; */
}
p.foot {
color: #777;
text-align: center;
}
p.heading {
font-size: 120%;
margin: 0px;
font-weight: bold;
text-decoration: underline;
@ -58,6 +59,8 @@ p.hint {
pre {
font-family: fira-mono, monospace;
white-space: pre-wrap;
}
pre.code {
background-color: #f8f8f8;
border: 1px solid #ccc;
overflow: auto;
@ -69,7 +72,7 @@ pre code {
padding: 0;
border: 0;
}
pre::before {
pre.code::before {
content: "📋 Copy!";
float: right;
border: 1px solid #ccc;