feat: markdown rendering /m/<id>
This commit is contained in:
22
static/js/markdown.js
Normal file
22
static/js/markdown.js
Normal file
@@ -0,0 +1,22 @@
|
||||
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();
|
||||
}
|
||||
Reference in New Issue
Block a user