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 522a481dd3 Require <html data-squireinit="true"> to auto-instantiate.
Explicit opt-in to autoinstantiation (included in the default document.html)
means Squire may be loaded in sites that themselves are loaded in iframes,
without unexpected consequences.

Resolves #104.
2015-07-06 12:19:21 +07:00

18 lines
423 B
JavaScript

/*jshint ignore:start */
if ( typeof exports === 'object' ) {
module.exports = Squire;
} else {
win.Squire = Squire;
if ( top !== win &&
doc.documentElement.getAttribute( 'data-squireinit' ) === 'true' ) {
win.editor = new Squire( doc );
if ( win.onEditorLoad ) {
win.onEditorLoad( win.editor );
win.onEditorLoad = null;
}
}
}
}( document ) );