Compare commits
2 Commits
33559463fb
...
b8070e48d7
Author | SHA1 | Date | |
---|---|---|---|
b8070e48d7 | |||
8689d14fc1 |
@ -8,11 +8,11 @@
|
|||||||
<div id="preview">
|
<div id="preview">
|
||||||
<!-- wp:image {"align":"center","id":2319} -->
|
<!-- wp:image {"align":"center","id":2319} -->
|
||||||
<figure class="wp-block-image aligncenter">
|
<figure class="wp-block-image aligncenter">
|
||||||
|
{# djlint:off H006 #}
|
||||||
<img src="https://claremontmakerspace.org/wp-content/uploads/2019/03/CMS-Logo-b-y-g-300x168.png"
|
<img src="https://claremontmakerspace.org/wp-content/uploads/2019/03/CMS-Logo-b-y-g-300x168.png"
|
||||||
width="300"
|
|
||||||
height="168"
|
|
||||||
alt="CMS Logo"
|
alt="CMS Logo"
|
||||||
class="wp-image-2319" />
|
class="wp-image-2319" />
|
||||||
|
{# djlint:on #}
|
||||||
</figure>
|
</figure>
|
||||||
<!-- /wp:image -->
|
<!-- /wp:image -->
|
||||||
|
|
||||||
@ -65,21 +65,28 @@
|
|||||||
{% with url="https://claremontmakerspace.org/events/#!event/register/"|add:event.url %}
|
{% with url="https://claremontmakerspace.org/events/#!event/register/"|add:event.url %}
|
||||||
<!-- wp:group {"tagName":"section","layout":{"type":"constrained"}} -->
|
<!-- wp:group {"tagName":"section","layout":{"type":"constrained"}} -->
|
||||||
<section class="wp-block-group">
|
<section class="wp-block-group">
|
||||||
|
|
||||||
|
{% if "lgo" in event %}
|
||||||
|
<!-- wp:image {"width":"400px","height":"auto","sizeSlug":"large","linkDestination":"media","align":"{% cycle 'left' 'right' %}"} -->
|
||||||
|
<figure class="wp-block-image {% cycle 'alignleft' 'alignright' %} size-large is-resized">
|
||||||
|
<a href="{{ url }}">
|
||||||
|
{# djlint:off H006 #}
|
||||||
|
<img src="{{ event.lgo.l }}"
|
||||||
|
alt="Image for {{ event.ttl|nh3:"" }}"
|
||||||
|
style="width:400px;
|
||||||
|
height:auto" />
|
||||||
|
{# djlint:on #}
|
||||||
|
</a>
|
||||||
|
</figure>
|
||||||
|
<!-- /wp:image -->
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<!-- wp:heading {"align":"center"} -->
|
<!-- wp:heading {"align":"center"} -->
|
||||||
<h2 class="wp-block-heading">
|
<h2 class="wp-block-heading">
|
||||||
<a href="{{ url }}">
|
<a href="{{ url }}">{{ event.ttl|nh3 }}</a>
|
||||||
{% if "lgo" in event %}
|
|
||||||
{# djlint:off H006 #}
|
|
||||||
<img class="{% cycle 'alignleft' 'alignright' %}"
|
|
||||||
width="400"
|
|
||||||
alt="Image for {{ event.ttl|nh3:"" }}"
|
|
||||||
src="{{ event.lgo.l }}">
|
|
||||||
{# djlint:on #}
|
|
||||||
{% endif %}
|
|
||||||
<span>{{ event.ttl|nh3 }}</span>
|
|
||||||
</a>
|
|
||||||
</h2>
|
</h2>
|
||||||
<!-- /wp:heading -->
|
<!-- /wp:heading -->
|
||||||
|
|
||||||
<!-- wp:paragraph -->
|
<!-- wp:paragraph -->
|
||||||
<p>
|
<p>
|
||||||
{# wordpress is very annoying with spacing here #}
|
{# wordpress is very annoying with spacing here #}
|
||||||
@ -110,7 +117,7 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
<!-- wp:paragraph -->
|
<!-- wp:paragraph -->
|
||||||
<p style="clear: both;">Happy Makin’!</p>
|
<p>Happy Makin’!</p>
|
||||||
<!-- /wp:paragraph -->
|
<!-- /wp:paragraph -->
|
||||||
<!-- wp:paragraph -->
|
<!-- wp:paragraph -->
|
||||||
<p>
|
<p>
|
||||||
@ -132,34 +139,14 @@
|
|||||||
{% block script %}
|
{% block script %}
|
||||||
<script>
|
<script>
|
||||||
async function copyToClipboard(event) {
|
async function copyToClipboard(event) {
|
||||||
const rich = document.getElementById("preview").innerHTML;
|
// https://developer.mozilla.org/en-US/docs/Web/API/Clipboard_API
|
||||||
const plain = document.getElementById("preview").innerHTML;
|
|
||||||
|
|
||||||
// from https://stackoverflow.com/a/77305170
|
|
||||||
if (typeof ClipboardItem !== "undefined") {
|
|
||||||
// Shiny new Clipboard API, not fully supported in Firefox.
|
|
||||||
// https://developer.mozilla.org/en-US/docs/Web/API/Clipboard_API#browser_compatibility
|
|
||||||
const html = new Blob([rich], {
|
|
||||||
type: "text/html"
|
|
||||||
});
|
|
||||||
const text = new Blob([plain], {
|
|
||||||
type: "text/plain"
|
|
||||||
});
|
|
||||||
const data = new ClipboardItem({
|
const data = new ClipboardItem({
|
||||||
"text/html": html,
|
"text/plain": new Blob(
|
||||||
"text/plain": text
|
[document.getElementById("preview").innerHTML], {
|
||||||
|
type: "text/plain"
|
||||||
|
})
|
||||||
});
|
});
|
||||||
await navigator.clipboard.write([data]);
|
await navigator.clipboard.write([data]);
|
||||||
} else {
|
|
||||||
const cb = e => {
|
|
||||||
e.clipboardData.setData("text/html", rich);
|
|
||||||
e.clipboardData.setData("text/plain", plain);
|
|
||||||
e.preventDefault();
|
|
||||||
};
|
|
||||||
document.addEventListener("copy", cb);
|
|
||||||
document.execCommand("copy");
|
|
||||||
document.removeEventListener("copy", cb);
|
|
||||||
}
|
|
||||||
|
|
||||||
bootstrap.Popover.getInstance(event.target).show();
|
bootstrap.Popover.getInstance(event.target).show();
|
||||||
setTimeout(() => bootstrap.Popover.getInstance(event.target).hide(), 1000);
|
setTimeout(() => bootstrap.Popover.getInstance(event.target).hide(), 1000);
|
||||||
|
Loading…
Reference in New Issue
Block a user