Added publishing of uploads to built site
This commit is contained in:
parent
48f39133d7
commit
d0cebe6564
13 changed files with 145 additions and 20 deletions
19
assets/js/controllers/show_upload.js
Normal file
19
assets/js/controllers/show_upload.js
Normal 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.",
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
Loading…
Add table
Add a link
Reference in a new issue