making the image button of the editor actually add all the info needed, and made the images clickable for the full size
This commit is contained in:
@@ -245,7 +245,7 @@ func (ch *CaddyHugo) serveMediaPage(w http.ResponseWriter, r *http.Request) (int
|
||||
<head><style>
|
||||
iframe { height: 100%; }
|
||||
.img { display: inline-block; text-align: center; max-width: 19.9vw; min-height: 120px;}
|
||||
.img.selected { background-color: light-blue; }
|
||||
.img.selected { background-color: lightblue; }
|
||||
.copy { cursor: pointer; }
|
||||
@media (max-width: 800px) {
|
||||
.img {
|
||||
@@ -279,7 +279,7 @@ func (ch *CaddyHugo) serveMediaPage(w http.ResponseWriter, r *http.Request) (int
|
||||
fmt.Fprintf(w, `<div class="img">error rendering %q: %v</div>`, m.Name, err)
|
||||
continue
|
||||
}
|
||||
fmt.Fprintf(w, `<div class="img"><img width=%d height=%d src=%q /><br /><input type="text" readonly value=%q /><span class="copy">📋</span></div>`, size.Dx(), size.Dy(), src, src)
|
||||
fmt.Fprintf(w, `<div class="img"><img width=%d height=%d src=%q data-filename=%q /><br /><input type="text" readonly value=%q /><span class="copy">📋</span></div>`, size.Dx(), size.Dy(), src, m.Name, src)
|
||||
}
|
||||
}
|
||||
io.WriteString(w, `<script>
|
||||
@@ -297,6 +297,9 @@ func (ch *CaddyHugo) serveMediaPage(w http.ResponseWriter, r *http.Request) (int
|
||||
current.classList = "img";
|
||||
}
|
||||
evt.target.parentElement.classList = "img selected";
|
||||
if (window.parent) {
|
||||
window.parent.postMessage(evt.target.dataset.filename, location.origin);
|
||||
}
|
||||
}
|
||||
}
|
||||
document.querySelector('body').onmouseup = function (evt) {
|
||||
|
||||
Reference in New Issue
Block a user