Commit a709da7d authored by Fred Chasen's avatar Fred Chasen

Expose Paged from Polyfill

parent e4507c45
Pipeline #62 passed with stage
in 4 minutes and 20 seconds
......@@ -53,7 +53,7 @@ New handlers can be registered from `import { registerHandlers } from 'pagedjs'`
```html
<script src="https://unpkg.com/pagedjs/dist/paged.polyfill.js"></script>
<script>
class myHandler() extends Paged.Handler {
class MyHandler extends Paged.Handler {
constructor(chunker, polisher, caller) {
super(chunker, polisher, caller);
}
......@@ -62,7 +62,7 @@ New handlers can be registered from `import { registerHandlers } from 'pagedjs'`
console.log(pageFragment);
}
}
Paged.registerHandlers(myHandler);
Paged.registerHandlers(MyHandler);
</script>
```
......
{
"name": "pagedjs",
"version": "0.1.12",
"version": "0.1.13",
"description": "Chunks up a document into paged media flows and applies print styles",
"author": "Fred Chasen",
"license": "MIT",
......
import Previewer from './previewer';
import * as Paged from '../index';
let ready = new Promise(function(resolve, reject){
if (document.readyState === "interactive" || document.readyState === "complete") {
......@@ -13,10 +14,11 @@ let ready = new Promise(function(resolve, reject){
}
});
let paged = new Previewer();
let previewer = new Previewer();
window.PagedPolyfill = paged;
window.PagedPolyfill = previewer;
window.Paged = Paged;
ready.then(async function () {
await paged.preview();
await previewer.preview();
});
......@@ -53,6 +53,10 @@ class Previewer {
return handlers;
}
registerHandlers() {
return registerHandlers.apply(registerHandlers, arguments);
}
getParams(name) {
let param;
let url = new URL(window.location);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment