Added publishing of uploads to built site

This commit is contained in:
Leon Mika 2026-03-03 22:36:24 +11:00
parent 48f39133d7
commit d0cebe6564
13 changed files with 145 additions and 20 deletions

View file

@ -0,0 +1,19 @@
import { Controller } from "@hotwired/stimulus"
import {showToast} from "../services/toast";
export default class ShowUploadController extends Controller {
static values = {
copySnippet: String,
};
async copy(ev) {
ev.preventDefault();
await navigator.clipboard.writeText(this.copySnippetValue);
showToast({
title: "️📋 HTML Snippet",
body: "Copied to clipboard.",
});
}
}

View file

@ -6,6 +6,7 @@ import PosteditController from "./controllers/postedit";
import LogoutController from "./controllers/logout";
import FirstRunController from "./controllers/firstrun";
import UploadController from "./controllers/upload";
import ShowUploadController from "./controllers/show_upload";
window.Stimulus = Application.start()
Stimulus.register("toast", ToastController);
@ -13,4 +14,5 @@ Stimulus.register("postlist", PostlistController);
Stimulus.register("postedit", PosteditController);
Stimulus.register("logout", LogoutController);
Stimulus.register("first-run", FirstRunController);
Stimulus.register("upload", UploadController);
Stimulus.register("upload", UploadController);
Stimulus.register("show-upload", ShowUploadController);