copy image markdown from admin area

This commit is contained in:
2023-12-03 11:12:08 +11:00
parent 92c435c1ed
commit 65be48b519
6 changed files with 5531 additions and 26 deletions

View File

@@ -1166,6 +1166,10 @@ video {
margin-top: 1.5rem;
}
.mt-1 {
margin-top: 0.25rem;
}
.block {
display: block;
}
@@ -1377,6 +1381,10 @@ video {
grid-template-columns: repeat(7, minmax(0, 1fr));
}
.grid-cols-1 {
grid-template-columns: repeat(1, minmax(0, 1fr));
}
.grid-rows-1 {
grid-template-rows: repeat(1, minmax(0, 1fr));
}
@@ -1622,6 +1630,11 @@ video {
background-color: rgb(252 231 243 / var(--tw-bg-opacity));
}
.bg-pink-200 {
--tw-bg-opacity: 1;
background-color: rgb(251 207 232 / var(--tw-bg-opacity));
}
.bg-pink-50 {
--tw-bg-opacity: 1;
background-color: rgb(253 242 248 / var(--tw-bg-opacity));
@@ -1637,14 +1650,14 @@ video {
background-color: rgb(255 255 255 / var(--tw-bg-opacity));
}
.bg-pink-400 {
.bg-yellow-50 {
--tw-bg-opacity: 1;
background-color: rgb(244 114 182 / var(--tw-bg-opacity));
background-color: rgb(254 252 232 / var(--tw-bg-opacity));
}
.bg-pink-200 {
.bg-red-50 {
--tw-bg-opacity: 1;
background-color: rgb(251 207 232 / var(--tw-bg-opacity));
background-color: rgb(254 242 242 / var(--tw-bg-opacity));
}
.bg-opacity-75 {
@@ -1909,6 +1922,16 @@ video {
color: rgb(219 39 119 / var(--tw-text-opacity));
}
.text-pink-800 {
--tw-text-opacity: 1;
color: rgb(157 23 77 / var(--tw-text-opacity));
}
.text-pink-900 {
--tw-text-opacity: 1;
color: rgb(131 24 67 / var(--tw-text-opacity));
}
.text-red-200 {
--tw-text-opacity: 1;
color: rgb(254 202 202 / var(--tw-text-opacity));
@@ -1924,14 +1947,9 @@ video {
color: rgb(255 255 255 / var(--tw-text-opacity));
}
.text-pink-900 {
.text-yellow-400 {
--tw-text-opacity: 1;
color: rgb(131 24 67 / var(--tw-text-opacity));
}
.text-pink-800 {
--tw-text-opacity: 1;
color: rgb(157 23 77 / var(--tw-text-opacity));
color: rgb(250 204 21 / var(--tw-text-opacity));
}
.underline {
@@ -2223,6 +2241,11 @@ h1, h2, h3, h4, h5, h6, h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
background-color: rgb(254 226 226 / var(--tw-bg-opacity));
}
.hover\:bg-yellow-100:hover {
--tw-bg-opacity: 1;
background-color: rgb(254 249 195 / var(--tw-bg-opacity));
}
.hover\:fill-blue-400:hover {
fill: #60a5fa;
}
@@ -2290,6 +2313,11 @@ h1, h2, h3, h4, h5, h6, h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
color: rgb(248 113 113 / var(--tw-text-opacity));
}
.hover\:text-yellow-400:hover {
--tw-text-opacity: 1;
color: rgb(250 204 21 / var(--tw-text-opacity));
}
.hover\:underline:hover {
text-decoration-line: underline;
}
@@ -2381,6 +2409,16 @@ h1, h2, h3, h4, h5, h6, h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
color: rgb(219 234 254 / var(--tw-text-opacity));
}
.prose-code\:bg-pink-100 :is(:where(code):not(:where([class~="not-prose"] *))) {
--tw-bg-opacity: 1;
background-color: rgb(252 231 243 / var(--tw-bg-opacity));
}
.prose-code\:text-pink-900 :is(:where(code):not(:where([class~="not-prose"] *))) {
--tw-text-opacity: 1;
color: rgb(131 24 67 / var(--tw-text-opacity));
}
.prose-ul\:mt-0 :is(:where(ul):not(:where([class~="not-prose"] *))) {
margin-top: 0px;
}
@@ -2517,6 +2555,11 @@ h1, h2, h3, h4, h5, h6, h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
background-color: rgb(15 23 42 / var(--tw-bg-opacity));
}
.dark\:bg-yellow-900 {
--tw-bg-opacity: 1;
background-color: rgb(113 63 18 / var(--tw-bg-opacity));
}
.dark\:text-amber-500 {
--tw-text-opacity: 1;
color: rgb(245 158 11 / var(--tw-text-opacity));
@@ -2592,6 +2635,16 @@ h1, h2, h3, h4, h5, h6, h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
color: rgb(49 46 129 / var(--tw-text-opacity));
}
.dark\:text-pink-100 {
--tw-text-opacity: 1;
color: rgb(252 231 243 / var(--tw-text-opacity));
}
.dark\:text-pink-200 {
--tw-text-opacity: 1;
color: rgb(251 207 232 / var(--tw-text-opacity));
}
.dark\:text-pink-400 {
--tw-text-opacity: 1;
color: rgb(244 114 182 / var(--tw-text-opacity));
@@ -2617,14 +2670,9 @@ h1, h2, h3, h4, h5, h6, h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
color: rgb(255 255 255 / var(--tw-text-opacity));
}
.dark\:text-pink-200 {
.dark\:text-yellow-400 {
--tw-text-opacity: 1;
color: rgb(251 207 232 / var(--tw-text-opacity));
}
.dark\:text-pink-100 {
--tw-text-opacity: 1;
color: rgb(252 231 243 / var(--tw-text-opacity));
color: rgb(250 204 21 / var(--tw-text-opacity));
}
.dark\:shadow-pink-200 {
@@ -2747,6 +2795,11 @@ h1, h2, h3, h4, h5, h6, h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
background-color: rgb(2 6 23 / var(--tw-bg-opacity));
}
.dark\:hover\:bg-yellow-800:hover {
--tw-bg-opacity: 1;
background-color: rgb(133 77 14 / var(--tw-bg-opacity));
}
.hover\:dark\:bg-blue-800:hover {
--tw-bg-opacity: 1;
background-color: rgb(30 64 175 / var(--tw-bg-opacity));

View File

@@ -3,11 +3,6 @@ import "../builds/tailwind.css";
import { md_gallery } from "./gallery.js";
(function() {
document.addEventListener('alpine:init', () => {
Alpine.magic('clipboard', () => {
return subject => navigator.clipboard.writeText(subject)
})
})
document.addEventListener("DOMContentLoaded", function () {
if (window.hljs !== undefined) {
window.hljs.highlightAll();

2272
public/assets/admin/app.css Normal file

File diff suppressed because it is too large Load Diff

3176
public/assets/admin/app.js Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -5,6 +5,12 @@ import TinyMDE from "tiny-markdown-editor";
import defo from "@icelab/defo";
(function() {
document.addEventListener('alpine:init', () => {
Alpine.magic('clipboard', () => {
return subject => navigator.clipboard.writeText(subject)
})
})
document.addEventListener("DOMContentLoaded", function () {
const views = {
markdown: (el, attrs) => {

View File

@@ -14,6 +14,9 @@ div class="mb-4 max-w-prose mx-auto prose dark:prose-invert"
- photos.each_with_index do |photo, idx|
- next if photo.match(/small/)
div class="rounded max-w-xs" x-data="" id="photo-#{idx}"
img class="rounded object-cover hover:opacity-80 h-48 w-48" src="/#{photo.gsub("public/", "")}"
button class="hover:text-blue-400 p-2 bg-blue-100 rounded text-blue-600 mr-4 no-underline" @click="$clipboard('#{Hanami.app.settings.micropub_site_url}/#{photo.gsub("public/", "")}')" Copy URL
button class="text-red-600 hover:text-red-400" hx-delete="/admin/media/#{photo}" hx-target="#photo-#{idx}" Delete
img class="rounded object-cover hover:opacity-80 h-48 w-48 mb-2" src="/#{photo.gsub("public/", "")}"
div class="grid grid-cols-2 gap-2"
button class="hover:text-blue-400 p-1 bg-blue-100 rounded text-blue-600 no-underline" @click="$clipboard('#{Hanami.app.settings.micropub_site_url}/#{photo.gsub("public/", "")}')" Copy URL
button class="hover:text-blue-400 p-1 bg-blue-100 rounded text-blue-600 no-underline" @click="$clipboard('![](#{Hanami.app.settings.micropub_site_url}/#{photo.gsub("public/", "")})')" Copy .md
div class="grid grid-cols-1"
button class="text-red-600 p-1 bg-red-50 rounded hover:text-red-400 mt-2" hx-delete="/admin/media/#{photo}" hx-target="#photo-#{idx}" Delete