aboutsummaryrefslogtreecommitdiff
path: root/src/static
diff options
context:
space:
mode:
Diffstat (limited to 'src/static')
-rw-r--r--src/static/edit_script.js15
-rw-r--r--src/static/edit_script.js.sha2561
-rw-r--r--src/static/style.css83
-rw-r--r--src/static/style.css.sha2561
-rwxr-xr-xsrc/static/update_hashes.sh5
5 files changed, 105 insertions, 0 deletions
diff --git a/src/static/edit_script.js b/src/static/edit_script.js
new file mode 100644
index 0000000..a73898f
--- /dev/null
+++ b/src/static/edit_script.js
@@ -0,0 +1,15 @@
+const textarea = document.forms[0].text;
+textarea.addEventListener('keydown', (e) => {
+ if (e.key == 'Escape') {
+ e.preventDefault();
+ location.search = '';
+ }
+});
+if (location.hash) {
+ let match = location.hash.match(/L([0-9]+)-L([0-9]+)/);
+ if (match) {
+ textarea.setSelectionRange(match[1], match[2]);
+ }
+ // workaround for Chromium bug (https://crbug.com/1046357)
+ textarea.focus();
+} \ No newline at end of file
diff --git a/src/static/edit_script.js.sha256 b/src/static/edit_script.js.sha256
new file mode 100644
index 0000000..c03887e
--- /dev/null
+++ b/src/static/edit_script.js.sha256
@@ -0,0 +1 @@
+O/Q67ZO/c2t0OEnZQIJtx/2VGvvdDEBTB8ol44aaUIo= \ No newline at end of file
diff --git a/src/static/style.css b/src/static/style.css
new file mode 100644
index 0000000..15821e8
--- /dev/null
+++ b/src/static/style.css
@@ -0,0 +1,83 @@
+html, body {
+ height: 100%;
+ margin: 0;
+}
+
+body {
+ display: flex;
+ flex-direction: column;
+ box-sizing: border-box;
+ padding: 1em;
+ max-width: 800px;
+ margin: 0 auto;
+}
+
+.edit-form {
+ display: flex;
+ flex-direction: column;
+ flex-grow: 1;
+}
+
+textarea {
+ flex-grow: 1;
+}
+
+.active {
+ font-weight: bold;
+}
+
+.actions {
+ margin-bottom: 0.2em;
+}
+
+.buttons {
+ margin-top: 0.2em;
+ display: flex;
+}
+
+.buttons button {
+ margin-right: 0.4em;
+}
+
+.buttons input {
+ flex-grow: 1;
+}
+
+.error {
+ padding: 0.2em;
+ margin: 0.5em 0;
+ background-color: #f8d7da;
+ border: 1px solid #f5c2c7;
+}
+
+.note {
+ padding: 0.2em;
+ margin: 0.5em 0;
+ background-color: #fff3cd;
+ border: 1px solid #ffecb5;
+}
+
+.edit-hint {
+ margin: 0.5em 0;
+}
+
+#header {
+ display: flex;
+}
+
+.user-info {
+ margin-left: auto;
+}
+
+label {
+ display: block;
+}
+
+.img-container img {
+ max-width: 100%;
+}
+
+.addition { background: #e6ffed; }
+.deletion { background: #ffeef0; }
+.addition ins {background: #acf2bd; text-decoration: none; }
+.deletion del {background: #fdb8c0; text-decoration: none; } \ No newline at end of file
diff --git a/src/static/style.css.sha256 b/src/static/style.css.sha256
new file mode 100644
index 0000000..878c14a
--- /dev/null
+++ b/src/static/style.css.sha256
@@ -0,0 +1 @@
+wQBINLe+9xuEst1p9wa95+08ECz1vGzc6bV960VQHDQ= \ No newline at end of file
diff --git a/src/static/update_hashes.sh b/src/static/update_hashes.sh
new file mode 100755
index 0000000..31f63bd
--- /dev/null
+++ b/src/static/update_hashes.sh
@@ -0,0 +1,5 @@
+#/bin/sh
+cd "$(dirname "$0")"
+for script in *.css *.js; do
+ shasum -a 256 < $script | cut -d' ' -f1 | xxd -r -p | base64 -w 0 > $script.sha256
+done