Files
paste/static/js/markdown.js
Aleksander Cynarski c9132e836a
Some checks failed
Build CI / pre-build-checks (push) Failing after 16s
Build CI / build (amd64) (push) Has been skipped
Build CI / build (arm64) (push) Has been skipped
feat: markdown rendering /m/<id>
2026-04-21 16:24:08 +02:00

23 lines
548 B
JavaScript

const homePage = document.location.origin;
function rawClicked() {
window.location = homePage + '/' + PASTE_ID;
}
async function forkClicked() {
const response = await fetch(homePage + '/' + PASTE_ID);
const text = await response.text();
localStorage["forkText"] = text;
window.location = homePage;
}
function newPasteClicked() {
window.location = homePage;
}
function themeChanged(theme) {
const url = new URL(window.location.href);
url.searchParams.set('theme', theme);
window.location = url.toString();
}