Compare commits

...

6 Commits

13 changed files with 36 additions and 18 deletions

View File

@ -31,3 +31,10 @@ Copyright: Gabriele Malaspina
Designers: Gabriele Malaspina Designers: Gabriele Malaspina
License: CC0 1.0/CC BY 4.0 License: CC0 1.0/CC BY 4.0
CC BY 4.0 compliance: Modified to indicate the URL. Modified size. CC BY 4.0 compliance: Modified to indicate the URL. Modified size.
## Forumoji
Affected files: everything in [`data/static/emoji`](./data/static/emoji) except [`data/static/emoji/scissors.png`](data/static/emoji/scissors.png)
URL: https://gh.vercte.net/forumoji/
License: CC0 1.0
Designers: lolecksdeehaha; Scratch137; 64lu; stickfiregames; mybearworld (the project has many more contributors, but these are the people whose designs were reproduced here)

View File

@ -141,4 +141,11 @@ def create_app():
for id_, text in matches for id_, text in matches
] ]
# this only happens at build time but
# build time is when updates are done anyway
# sooo... /shrug
@app.template_filter('cachebust')
def cachebust(subject):
return f"{subject}?v={str(int(time.time()))}"
return app return app

View File

@ -8,7 +8,7 @@ def tag_code(children, attr):
return f"<code class=\"inline-code\">{children}</code>" return f"<code class=\"inline-code\">{children}</code>"
else: else:
t = children.strip() t = children.strip()
button = f"<button type=button class=\"copy-code\" value={t}>Copy</button>" button = f"<button type=button class=\"copy-code\" value=\"{t}\">Copy</button>"
return f"<pre><span class=\"copy-code-container\">{button}</span><code>{t}</code></pre>" return f"<pre><span class=\"copy-code-container\">{button}</span><code>{t}</code></pre>"
def tag_list(children): def tag_list(children):
@ -49,6 +49,8 @@ EMOJI = {
'pensive': make_emoji('pensive', 'pensive'), 'pensive': make_emoji('pensive', 'pensive'),
'scissors': make_emoji('scissors', 'scissors'),
')': make_emoji('smile', ')'), ')': make_emoji('smile', ')'),
'smiletear': make_emoji('smiletear', 'smiletear'), 'smiletear': make_emoji('smiletear', 'smiletear'),

View File

@ -8,7 +8,7 @@
{% else %} {% else %}
<title>Porom</title> <title>Porom</title>
{% endif %} {% endif %}
<link rel="stylesheet" href="/static/style.css"> <link rel="stylesheet" href="{{ "/static/style.css" | cachebust }}">
<link rel="icon" type="image/png" href="/static/favicon.png"> <link rel="icon" type="image/png" href="/static/favicon.png">
</head> </head>
<body> <body>
@ -24,7 +24,6 @@
<footer class="darkbg"> <footer class="darkbg">
<span>Pyrom commit <a href="{{ "https://git.poto.cafe/yagich/pyrom/commit/" + __commit }}">{{ __commit[:8] }}</a></span> <span>Pyrom commit <a href="{{ "https://git.poto.cafe/yagich/pyrom/commit/" + __commit }}">{{ __commit[:8] }}</a></span>
</footer> </footer>
<script src="/static/js/copy-code.js"></script> <script src="{{ "/static/js/ui.js" | cachebust }}"></script>
<script src="/static/js/ui.js"></script> <script src="{{ "/static/js/date-fmt.js" | cachebust }}"></script>
<script src="/static/js/date-fmt.js"></script>
</body> </body>

View File

@ -67,7 +67,7 @@
<div id="babycode-preview-container"></div> <div id="babycode-preview-container"></div>
</div> </div>
</div> </div>
<script src="/static/js/babycode-editor.js?v=2"></script> <script src="{{ "/static/js/babycode-editor.js" | cachebust }}"></script>
{% endmacro %} {% endmacro %}
{% macro babycode_editor_form(ta_name, prefill = "", cancel_url="", endpoint="") %} {% macro babycode_editor_form(ta_name, prefill = "", cancel_url="", endpoint="") %}

View File

@ -14,5 +14,5 @@
<input type=submit value="Save order"> <input type=submit value="Save order">
</form> </form>
</div> </div>
<script src="/static/js/sort-topics.js"></script> <script src="{{ "/static/js/sort-topics.js" | cachebust }}"></script>
{% endblock %} {% endblock %}

View File

@ -83,5 +83,5 @@
</span> </span>
</div> </div>
</div> </div>
<script src="/static/js/thread.js?v=1"></script> <script src="{{ "/static/js/thread.js" | cachebust }}"></script>
{% endblock %} {% endblock %}

View File

@ -75,5 +75,5 @@
</div> </div>
</dialog> </dialog>
<script src="/static/js/topic.js"></script> <script src="{{ "/static/js/topic.js" | cachebust }}"></script>
{% endblock %} {% endblock %}

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 B

View File

@ -1,7 +0,0 @@
for (let button of document.querySelectorAll(".copy-code")) {
button.addEventListener("click", async () => {
await navigator.clipboard.writeText(button.value)
button.textContent = "Copied!"
setTimeout(() => {button.textContent = "Copy"}, 1000.0)
})
}

View File

@ -144,4 +144,13 @@ document.addEventListener("DOMContentLoaded", () => {
openLightbox(belongingTo, idx); openLightbox(belongingTo, idx);
}); });
}); });
// copy code blocks
for (let button of document.querySelectorAll(".copy-code")) {
button.addEventListener("click", async () => {
await navigator.clipboard.writeText(button.value)
button.textContent = "Copied!"
setTimeout(() => {button.textContent = "Copy"}, 1000.0)
})
};
}); });

View File

@ -240,7 +240,7 @@ blockquote {
margin: 10px; margin: 10px;
border-radius: 4px; border-radius: 4px;
border-left: 10px solid rgb(229.84, 231.92, 227.28); border-left: 10px solid rgb(229.84, 231.92, 227.28);
background-color: rgb(135.1928346457, 145.0974015748, 123.0025984252); background-color: rgba(0, 0, 0, 0.1490196078);
} }
.user-info { .user-info {

View File

@ -291,7 +291,8 @@ blockquote {
margin: 10px; margin: 10px;
border-radius: 4px; border-radius: 4px;
border-left: 10px solid $lighter; border-left: 10px solid $lighter;
background-color: $dark2; // background-color: $dark2;
background-color: #00000026;
} }
.user-info { .user-info {