Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic user content / shortcodes will only work for first 5 minutes #29

Open
mennolui opened this issue Oct 11, 2018 · 2 comments
Open

Comments

@mennolui
Copy link
Owner

mennolui commented Oct 11, 2018

Javascripts that are initialized at page load will work inside their slide at first, but will no longer work after 5 minutes.

Every 5 minutes new HTML is loaded. Because $(document).ready() is only invoked once, at page load of the display, some Javascripts for newly loaded HTML will not start. Especially Javascripts unknown to Foyer, used by user content such as shortcodes.

Also, any inline Javascript that is output by shortcodes is stripped while loading new HTML (using jQuery). And even if it would not be stripped while loading it would not be run.

Possible solutions:

  • Hack jQuery to allow re-invoking $(document).ready(): http://jsfiddle.net/5dRxh/ plus make sure inline Javascript output by shortcodes is loaded and run while loading new HTML (how?).
  • Only add new HTML when something changed. Does not solve the problem, makes it less frequent.
  • Load each slide inside an iframe so each slide has their own document, also when loading new content.
@WatskeBart
Copy link

Where do I need to implement the jQuery hack to test if it works?

Is it also possible to turn off the 5 minute refresh completely?

@WatskeBart
Copy link

My workaround can be found a the foyer support forum:
https://wordpress.org/support/topic/disable-5-minute-refresh/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants