}
// contents are not html encoded
-plaintext_elements = {
+var plaintext_elements = {
style: 1,
script: 1,
xmp: 1,
}
// parser deletes a starting newline inside:
-newline_eating_elements = {
+var newline_eating_elements = {
pre: 1,
textarea: 1,
listing: 1
if (this.options.editor_id != null) {
this.outer_iframe.setAttribute('id', this.options.editor_id)
}
- this.outer_iframe.onload = (function(_this) {
- return function() {
- var icss
- _this.outer_idoc = _this.outer_iframe.contentDocument
- icss = domify(_this.outer_idoc, { style: { children: [
- domify(_this.outer_idoc, {text: css})
- ]}})
- _this.outer_idoc.head.appendChild(icss)
- _this.iframe = domify(_this.outer_idoc, {iframe: {sandbox: 'allow-same-origin allow-scripts'}})
- _this.iframe.onload = function() {
+ this.outer_iframe.onload = (function(_this) { return function() {
+ var icss
+ _this.outer_idoc = _this.outer_iframe.contentDocument
+ icss = domify(_this.outer_idoc, { style: { children: [
+ domify(_this.outer_idoc, {text: css})
+ ]}})
+ _this.outer_idoc.head.appendChild(icss)
+ _this.iframe = domify(_this.outer_idoc, {iframe: {sandbox: 'allow-same-origin allow-scripts'}})
+ _this.iframe.onload = function() {
+ return _this.init_1()
+ }
+ timeout(200, function() { // firefox never fires this onload
+ if (!_this.init_1_called) {
return _this.init_1()
}
- timeout(200, function() { // firefox never fires this onload
- if (!_this.init_1_called) {
- return _this.init_1()
- }
- })
- _this.outer_idoc.body.appendChild(
- domify(_this.outer_idoc, {div: {id: 'wrap1', children: [
- domify(_this.outer_idoc, {div: {
- style: "position: absolute; top: 0; left: 1px; font-size: 10px",
- children: [domify(_this.outer_idoc, {text: "Peach HTML5 Editor"})]
- }}),
- _this.wrap2 = domify(_this.outer_idoc, {div: {id: 'wrap2', children: [
- domify(_this.outer_idoc, {div: {id: 'wrap3', children: [
- _this.iframe,
- _this.overlay = domify(_this.outer_idoc, { div: { id: 'overlay' }})
- ]}})
+ })
+ _this.outer_idoc.body.appendChild(
+ domify(_this.outer_idoc, {div: {id: 'wrap1', children: [
+ domify(_this.outer_idoc, {div: {
+ style: "position: absolute; top: 0; left: 1px; font-size: 10px",
+ children: [domify(_this.outer_idoc, {text: "Peach HTML5 Editor"})]
+ }}),
+ _this.wrap2 = domify(_this.outer_idoc, {div: {id: 'wrap2', children: [
+ domify(_this.outer_idoc, {div: {id: 'wrap3', children: [
+ _this.iframe,
+ _this.overlay = domify(_this.outer_idoc, { div: { id: 'overlay' }})
]}})
]}})
- )
- }
- })(this)
+ ]}})
+ )
+ }})(this)
outer_wrap = domify(document, {div: {"class": 'peach_html5_editor' }})
this.in_el.parentNode.appendChild(outer_wrap)
outer_bounds = get_el_bounds(outer_wrap)
ret += 'padding: 0;'
ret += 'color: black;'
ret += 'background: white;'
+ ret += 'font-family: sans;'
ret += '}'
ret += '#wrap1 {'
ret += "border: " + (occupy(1)) + "px solid black;"
PeachHTML5Editor.prototype.update_style_from_el = function(n) {
var style
style = n.el.getAttribute('style')
- if (style != null) {
+ if (style != null && style != '') {
return n.attrs.style = style
} else {
if (n.attrs.style != null) {
}
if (need_preserve) {
// do we have it already?
- ws = this.computed_style(n, 'white-space') // FIXME implement this
+ ws = this.computed_style(n, 'white-space')
if (ws_props[ws] != null ? !ws_props[ws].space : true) {
// 2nd arg is ideal target for css rule
ws = this.preserve_space(n, block)
eats_start_sp = false
} else {
if (is_space_code(n.text.charCodeAt(n.text.length - 1))) {
- ws = this.computed_style(n, 'white-space') // FIXME implement this
+ ws = this.computed_style(n, 'white-space')
if ((ref1 = ws_props[ws]) != null ? ref1.space : void 0) {
eats_start_sp = false
} else {