mirror of
https://github.com/fastmail/Squire.git
synced 2024-12-22 15:23:29 -05:00
6b4dda816e
* If you load the squire.js script into a top-level page rather than an iframe, it will add a Squire constructor to the global scope. * The Squire constructor can be used to instantiate multiple instances on the same page without having to load/parse/execute the full code every time. * For each instance, create a new iframe, then call `new Squire( document )`, with the document node for each iframe.
13 lines
255 B
JavaScript
13 lines
255 B
JavaScript
/*global top, win, doc, Squire */
|
|
|
|
if ( top !== win ) {
|
|
win.editor = new Squire( doc );
|
|
if ( win.onEditorLoad ) {
|
|
win.onEditorLoad( win.editor );
|
|
win.onEditorLoad = null;
|
|
}
|
|
} else {
|
|
win.Squire = Squire;
|
|
}
|
|
|
|
}( document ) );
|