0
Fork 0
mirror of https://github.com/fastmail/Squire.git synced 2024-12-22 15:23:29 -05:00
Squire/source/outro.js
Neil Jenkins 6b4dda816e Make into a JS class for multiple instantiation.
* 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.
2013-06-20 23:15:18 +10:00

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 ) );