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

Lazy load #9

Open
dbendy opened this issue Jan 24, 2018 · 15 comments
Open

Lazy load #9

dbendy opened this issue Jan 24, 2018 · 15 comments

Comments

@dbendy
Copy link

dbendy commented Jan 24, 2018

Is it possible to use this plugin in order to lazy load pieces of the presentation, only when needed? If not, can you recommend a different plugin for that. Thanks!

@janschoepke
Copy link
Owner

Hi,
This feature has not been implemented yet. I will keep this in mind for later versions. I have no idea about other plugins providing this feature.

Jan

@G1305
Copy link

G1305 commented Feb 17, 2018

I think this is very required feature for everyone ^_^

GOOD LUCK GUYS

@janschoepke
Copy link
Owner

I will have some great news for you in the next days... ;)

@Woidboy
Copy link

Woidboy commented Jun 8, 2018

Is there an update on the lazy loading feature of external HTML files? I'm currently working on a very large slide set (over 300 slides) and it gets so extremly slow and I hope that I can speed up loading by your great feature!

@janschoepke
Copy link
Owner

Hi,
please take a look on the lazy-load branch. I did not find any time to write a documentation for the new behavior and I did not publish this new version to npm or bower. But it should still do a great job.
All you have to do ist to set config.external.lazyLoad to true and set all your data-external- paths absolute instead of relative. Contact me, if you have any issues oder questions!

@janschoepke
Copy link
Owner

In the lazy-load branch you can just try out the updated example which has a working implementation of lazy load in it.

@Woidboy
Copy link

Woidboy commented Jun 8, 2018

Thanks, this works great! My slides are loading so much faster now. However, there are still two issues in my case, the plugin only works with Firefox, not with Chrome. Is this normal? Besides, the presentable plugin can no longer create a table of contents, which makes sense if the slides are loaded lazily, I guess. Unfortunately, the menu plugin is also not working. Do you have any suggestions how to create a table of contents?

@janschoepke
Copy link
Owner

Thanks for your reply! Surely it is not possible to create the "out of the box" TOC for reveal.js due to the full content is not being loaded during initialization process. I will think about that and try to find a solution...
The browser thing is strange. Personally I am using Google Chrome as default browser and the plugin works perfectly fine for me. Do you get any console errors or something? What exactly does not work well?

@Woidboy
Copy link

Woidboy commented Jun 11, 2018

The console tells me:

Failed to load EXTERNAL_FILE Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.

Could it be that it doesn't work because it is stored locally? If this is the case than everything should be fine after uploading to my server. I will try that out.

@janschoepke
Copy link
Owner

Does the error also show up in the example project? Or only in your specific project?

@Woidboy
Copy link

Woidboy commented Jun 12, 2018

It shows up in both projects. And as I conjested, the site is working with Google Chrome if it is accessed to via a server.

@Woidboy
Copy link

Woidboy commented Jun 13, 2018

Others problems with lazy loading:

  • Printing the slides with print-pdf is no longer working.
  • Referencing to a slide which is in a separate html-file can only be accessed if it is preloaded.

Do you know any workaround for these problems?

@Woidboy
Copy link

Woidboy commented Jul 12, 2018

I'm enjoying your plugin for my large set of slides. However, unfortunately, the plugin is not working with the Google Chrome browser when stored locally. This was no problem so far since I've used Firefox for checking local files and Google Chrome when uploaded to the server. Now, I'm currently working on porting my slide set to an Android app. As far as I can see, Androids Webview is based on Chrome and since the files are stored locally in the app (this is actually the feature that I want) the plugin is no longer working. Do you have any suggestions how to run the plugin with Google Chrome on local files?

@janschoepke
Copy link
Owner

Sorry for my late reply. After lots of research I might have an acceptable solution for you. Referencing to this post on stack overflow, unlike to other browsers Google Chrome seems to have some implemented security features, which were disabling AJAX requests via file:// protocol. There does not seem an in-code solution for this problem.

To use reveal_external without a server connection in Google Chrome, this might be a nice browser extension you will like! After installation, you can specify the root folder of your reveal.js presentation, and it will automatically start a web server on your machine. The displayed link will show you the working presentation running on your local machine. I tested this extension in combination with reveal.js and reveal_external successfully.

To get the reveal_external presentation to work in an android app, you might find a solution in this stack overflow post. According to this, you will need to change some settings of the web view you already implemented in your app. I point out that I could not test this scenario due to a lack of equipment.

I hope I could help you so far.

@janschoepke
Copy link
Owner

janschoepke commented Jul 13, 2018

Concerning your post of 13 Jun:

Printing the slides with print-pdf is no longer working.

Sure, that has the same reason as described earlier. But as this feature does not seem to have to work during presentation (usually the slides were printed before or after holding a presentation), you can simply disable the reveal_external plugin for the printing process.

Referencing to a slide which is in a separate html-file can only be accessed if it is preloaded.

This is also true as references in reveal.js are simply said nothing else than HTML links. When the browser cannot find the target referenced in the link tag, nothing will happen at all, because in fact the target is not being loaded at the time the reference link is clicked. The slide, which is specified as asynchronous, does not appear in the DOM at all, so there is no possibility for reveal.js to resolve the correct link target.

I might think about implementing a mechanism handling this reference-error in future.

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

4 participants