documentcloud / documentcloud-pages

Responsively embed DocumentCloud pages.
https://documentcloud.github.io/documentcloud-pages/examples/
MIT License
23 stars 10 forks source link

Ensure `page_embed.*` work sensibly without the enhancer #31

Open reefdog opened 8 years ago

reefdog commented 8 years ago

The enhancer is our personal entry into the embeds, but people should be able to load and use the page embed libraries directly without using the enhancer (or by using their own enhancer). Make sure there are no assumptions within page_embed.* that require the enhancer.

reefdog commented 8 years ago

Our direct-load example on the sample page works:

<div id="foo"></div>
<script src="https://assets.documentcloud.org/embed/page/page_embed.js"></script>
<script>
  DocumentCloud.embed.load("https://www.documentcloud.org/documents/282753-lefler-thesis.html#document/p57", {
    container: '#foo'
  });
</script>

To get styles, you'll also need the CSS: <link rel="stylesheet" href="https://assets.documentcloud.org/embed/page/page_embed.css">

Not marking this as complete because I want to really test the bounds of this ability, but atm it does work if implementors want to play with it.