include includes/pre
<title>New paste</title>
script.
    function submit() {
        q("#submit").disabled = true;
        let content = q("#content").value;
        let token = localStorage.getItem("token") || undefined;
        let progress = q("#progress");
        progress.innerHTML = "Uploading...";
        submitPaste(content, {token}, pasteID => {
            if (pasteID) {
                progress.innerHTML = `Success! <a href="/pastes/${pasteID}">View your new paste</a>`;
                progress.classList.add("successDisplay");
            } else {
                progress.innerHTML = "Failed to submit paste";
                progress.classList.add("errorDisplay");
                q("#submit").disabled = false;
            }
        });
    }
    function bodyLoad() {
        clear();
    }
    getLoginDetails(login => {
        if (login) {
            q("#usernamePostNote").innerText = "Posting as "+login.username+".";
            q("#usernamePostNote").style.display = "block";
        }
    });
include includes/header
<div class="paste-textarea-container">
    <textarea id="content"></textarea>
</div>
<div id="usernamePostNote">You must log in to upload content.</div>
<div>
    <button id="submit" onclick="submit()">Submit</button>
</div>
<div id="progress"></div>
include includes/end
