mirror of
https://github.com/fastmail/Squire.git
synced 2024-12-22 15:23:29 -05:00
Update to latest squire version.
This commit is contained in:
parent
cc38ca50dc
commit
afb113d5f9
4 changed files with 427 additions and 305 deletions
|
@ -149,19 +149,29 @@ $(document).ready(function() {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
iframe.addEventListener('load', function() {
|
||||||
|
// Make sure we're in standards mode.
|
||||||
|
var doc = iframe.contentDocument;
|
||||||
|
if ( doc.compatMode !== 'CSS1Compat' ) {
|
||||||
|
doc.open();
|
||||||
|
doc.write( '<!DOCTYPE html><title></title>' );
|
||||||
|
doc.close();
|
||||||
|
}
|
||||||
|
// doc.close() can cause a re-entrant load event in some browsers,
|
||||||
|
// such as IE9.
|
||||||
|
if ( iframe.contentWindow.editor ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
iframe.contentWindow.editor = new Squire(iframe.contentWindow.document);
|
||||||
|
iframe.contentWindow.document.head.appendChild(style);
|
||||||
|
});
|
||||||
|
|
||||||
$(container).append(div);
|
$(container).append(div);
|
||||||
$(container).append(iframe);
|
$(container).append(iframe);
|
||||||
|
|
||||||
var style = document.createElement('style');
|
var style = document.createElement('style');
|
||||||
style.innerHTML = 'blockquote { border-left: 3px green solid; padding-left: 5px; }';
|
style.innerHTML = 'blockquote { border-left: 3px green solid; padding-left: 5px; }';
|
||||||
|
|
||||||
|
|
||||||
iframe.contentWindow.editor = new Squire(iframe.contentWindow.document);
|
|
||||||
iframe.addEventListener('load', function() {
|
|
||||||
iframe.contentWindow.editor = new Squire(iframe.contentWindow.document);
|
|
||||||
});
|
|
||||||
|
|
||||||
iframe.contentWindow.document.head.appendChild(style);
|
|
||||||
return iframe.contentWindow.editor;
|
return iframe.contentWindow.editor;
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because one or more lines are too long
|
@ -16,7 +16,7 @@
|
||||||
<script src="build/Squire-UI.js" type="text/javascript"></script>
|
<script src="build/Squire-UI.js" type="text/javascript"></script>
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
UI = new SquireUI({replace: 'textarea#foo', height: 300});
|
new SquireUI({replace: 'textarea#foo', height: 300});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
|
|
Loading…
Reference in a new issue