23 lines
548 B
JavaScript
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();
|
|
}
|