Skip to content

Commit c86a269

Browse files
committed
Add info block.
1 parent aa71d61 commit c86a269

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

cmd/chromad/static/index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@ document.addEventListener("DOMContentLoaded", function () {
1111
var output = document.getElementById("output");
1212
var htmlCheckbox = document.getElementById("html");
1313

14+
(document.querySelectorAll('.notification .delete') || []).forEach(($delete) => {
15+
$notification = $delete.parentNode;
16+
$delete.addEventListener('click', () => {
17+
$notification.parentNode.removeChild($notification);
18+
});
19+
});
20+
1421
function debounce(func, wait, immediate) {
1522
var timeout;
1623
return function () {

cmd/chromad/templates/index.html.tmpl

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
}
1010

1111
#output {
12-
{{.Background}}
13-
12+
{{.Background}};
1413
overflow-x: scroll;
1514
}
1615

@@ -22,10 +21,16 @@
2221
</head>
2322
<body>
2423
<div class="container">
25-
<div class="notification is-hidden"></div>
2624

2725
<h1 class="title">Chroma Playground</h1>
2826

27+
<div class="notification is-info">
28+
<button class="delete"></button>
29+
<a href="https://github.com/alecthomas/chroma">Chroma</a> is a general purpose syntax highlighter in pure Go.
30+
It takes source code and other structured text and converts it into syntax highlighted HTML, ANSI-coloured text,
31+
etc. Chroma is based heavily on Pygments, and includes translators for Pygments lexers and styles.
32+
</div>
33+
2934
<form id="chroma" method="post">
3035
{{ .CSRFField }}
3136
<div class="columns">

0 commit comments

Comments
 (0)