Clicking either the dark area around the iframe or the x at the top right corner closes the lightbox. The same way it works for default image lightboxes.
Settings
There’s only one setting. You add the domains that you want to have this functionality on there.
Correct, this component will not mess with any whitelisting settings at all.
In order for any iframe to show up in the cooked content of a post - expandable or not - it has to be on the list of allowed_iframes setting like you pointed out.
@Johani is this component still functional? If so, any thoughts on why I am not getting the pop-out diagonal-arrows in the upper-right, but rather a blank/dead box?
Here is what I’ve tried:
Updated themes/components.
Made sure src links were white-listed in the component and the Discourse settings.
Tried a few different links, including Google Maps.
Tried several scenarios with the Media Overlay on/off + Lightbox alone on/off.
thank you very much for conceiving and maintaining this theme component.
After installing it on https://community.hiveeyes.org/ the other day, some users recently started to complain that the overall appearance of the head of the page looked different for them. They finally found out the reason was that they blocked cloudflare altogether, so all requests to https://cdnjs.cloudflare.com/ajax/libs/featherlight/1.7.13/featherlight.min.js would fail.
So, we are humbly asking if there would be a way for you to provide this component in a self-contained variant?
Non c’è bisogno di scusarsi, è bello vedere che sei riuscito a dedicargli un po’ di attenzione, tra tutte le altre cose che succedono. Lo apprezziamo molto.
Non sono a conoscenza di componenti esistenti che facciano ciò, quindi dovresti crearne uno o commissionare questo lavoro nella categoria Marketplace.
Questo componente del tema controlla iFrame in un post e confronta il loro attributo src con un elenco di origini idonee fornito dall’amministratore nelle impostazioni del componente. Se il dominio di origine corrisponde, aggiunge il pulsante lightbox. La visualizzazione della lightbox è gestita da featherlight.js. Featherlight ascolta i clic sugli elementi con l’attributo data-featherlight. Se uno di questi viene cliccato, apre la lightbox con il contenuto di quell’iFrame.
Puoi fare lo stesso con i tag <a> in un componente diverso con un po’ di lavoro. Se l’href del link corrisponde a un dominio elencato nelle impostazioni del componente, visualizzalo in una lightbox in un iframe. Altrimenti, lascialo come un normale link. Non vuoi che tutti i link si aprano in una lightbox iframe.
La maggior parte del lavoro richiesto è già gestito da questo componente, quindi puoi semplicemente fare un hard-fork e iniziare da lì. Non ci sono piani per aggiungere questa funzionalità a questo componente perché è destinato solo a gestire i tag iFrame nei post.
Questo componente funziona ancora? In passato funzionava per me ma per qualche motivo ha smesso di funzionare.
Sembra che l’ultimo aggiornamento sia stato 3 anni fa: hnb-ku/discourse-iframe-lightboxes (github.com) Quindi è ragionevole presumere che qualcosa si sia rotto?
Non riesco a farlo funzionare, ho seguito la guida alla lettera e ho aggiunto il dominio sia al componente del tema che all’impostazione del sito. Ecco cosa ottengo:
nessun errore nella console.
Lo sto usando con le anteprime PDF: Inline PDF Previews - #116 by Alon1
Mi aspetto di ottenere le frecce di espansione sopra il PDF
Entrambi i TC utilizzano la stessa API per decorare un post, quindi l’ordine in cui li installi sarebbe necessario. Inoltre, la sorgente dell’iframe viene impostata dinamicamente una volta scaricato il PDF e potrebbe non essere immediatamente disponibile in questo TC IFrame Lighboxes.
Le modifiche che ho apportato sono fondamentalmente:
Cerca gli elementi iframe nel prossimo ciclo di esecuzione, in modo che l’iframe sia garantito essere disponibile
Attendi che l’iframe venga caricato in modo da poter recuperare l’URL della sorgente