orestbida / iframemanager

🍪 GDPR friendly iframe manager written in vanilla js
https://orestbida.com/demo-projects/iframemanager/demo1/
MIT License
249 stars 31 forks source link

Support all configurations in the div #1

Open timiwahalahti opened 3 years ago

timiwahalahti commented 3 years ago

Hi! We are using your Cookie Consent javascript plugin (😍) and the IframeManager looks like a very interesting companion for that!

For simplicity of the use, could you consider a possibility of supporting the service configurations fully straight in the div and using the same languages object for all iframes?

That would make using this plugin a much more versatile in situations when the client can update their content through some CMS and add new embeds as they wish. The current way of defining each embed separately on config is hard to achieve, when embeds change dynamically. With the approach of supporting all configs in the div, it would become much more easier just to do some regexp and replace the iframe embed with the div.

orestbida commented 3 years ago

Hi @timiwahalahti,

I totally get your point.

Moving the options into the div isn't an issue, what bugs me is that in the future releases I'm planning on adding support for “custom widgets” (Twitter, Facebook etc.) which (very likely) would require even more options for a correct configuration, and putting everything into the div would make it look quite “overwhelming”, there would be a lot of repeated code.

My proposed solution is to implement something like:

Regarding the languages objects, sure I can add a global languages option!