';
this.touchMode = false;
this.events = ["change"]
},
createInstance: function(k) {
var g = this;
this.textArea = this.host;
var o = this.host.attr("contenteditable");
this.host.addClass(this.toThemeProperty("jqx-widget"));
if (o == true || o == "true") {
this.inline = true;
this.widget = this.host;
this.editorDocument = document;
this.selection = new b(this.editorDocument);
var n = $("
"
}
}
j = j.replace(/</ig, "<");
j = j.replace(/>/ig, ">");
this.host.css("display", "none");
this.host.after(h);
h.find("iframe").after(this.host);
this.container = h.find(".jqx-editor-container");
this.toolbarContainer = h.find(".jqx-editor-toolbar-container");
this.toolbar = h.find(".jqx-editor-toolbar");
this.iframe = h.find("iframe");
this.content = h.find(".jqx-editor-content");
this.editorDocument = this.iframe[0].contentWindow.document;
this.selection = new b(this.editorDocument);
if (!$.jqx.browser.mozilla) {
this.editorDocument.designMode = "On"
}
this.editorDocument.open();
var a = this.rtl ? "direction:rtl;" : "";
var m = $.jqx.browser.msie ? "::selection{color: #fff; background: #328EFD;};::-moz-selection{color: #fff; background: #328eD;};::selection:window-inactive {background: #c7c7c7; color: #000;}::-moz-selection:window-inactive {background: #c7c7c7; color: #000;}html{font-size:13px; height:100%;}body{padding-top:1px;margin-top:-1px; padding-right: 1px; overflow-x: hidden;word-wrap: break-word;-webkit-nbsp-mode: space;-webkit-line-break: after-white-space;" : "";
this.editorDocument.write("" + $.map(this.stylesheets, function(e) {
return ""
}).join("") + "");
this.contentEditableElement = this.editorDocument.body;
if (this.host.is("textarea")) {
this._textArea = this.element;
var f = this.host.data();
f.jqxEditor.host = h;
f.jqxEditor.element = h[0];
this.element = h[0];
h[0].id = this._textArea.id;
this._textArea.id = this._textArea.id + "TextArea";
$(this.element).addClass(this.toThemeProperty("jqx-widget"));
this.host = $(this.element);
this.host.data(f)
}
try {
this.editorDocument.execCommand("useCSS", false, false);
this.editorDocument.execCommand("enableInlineTableEditing", null, false)
} catch (i) {}
try {
this.editorDocument.execCommand("styleWithCSS", 0, true)
} catch (i) {}
this.editorDocument.close();
this.editor = $(this.editorDocument.body);
this.editor.html(j).attr("spellcheck", false).attr("autocorrect", "off");
$.jqx.utilities.resize(h, function() {
g.widget.css("width", g.width);
g.widget.css("height", g.height);
g._arrange()
})
}
},
focus: function() {
if ($.jqx.browser.mozilla) {
if (!this.focused) {
if (this.iframe) {
this.iframe.focus()
}
this.selection.selectNode(this.editor[0].firstChild, true);
this.selection.getRange().collapse(true)
}
}
this.editor.focus();
var a = this.range != null ? this.range : this.getRange();
this.selectRange(a)
},
print: function() {
var a = window.open("", "_blank", "width=450,height=470,left=400,top=100,menubar=yes,toolbar=no,location=no,scrollbars=yes");
a.document.open();
a.document.write('Print' + this.val() + "");
a.document.close()
},
refresh: function(a) {
var m = this;
$.each(this.defaultLocalization, function(i, r) {
if (!m.localization[i]) {
m.localization[i] = r
}
});
this._removeHandlers();
this.toolbar.addClass(this.toThemeProperty("jqx-widget-header"));
if (this.content) {
this.widget.css("width", this.width);
this.widget.css("height", this.height);
this.widget.addClass(this.toThemeProperty("jqx-editor"));
this.widget.addClass(this.toThemeProperty("jqx-widget"));
this.widget.addClass(this.toThemeProperty("jqx-rc-all"));
this.widget.addClass(this.toThemeProperty("jqx-widget-header"));
this.content.addClass(this.toThemeProperty("jqx-widget-content"));
this.container.addClass(this.toThemeProperty("jqx-editor-container"))
} else {
this.toolbarContainer.addClass(this.toThemeProperty("jqx-widget-header"));
this.toolbarContainer.addClass(this.toThemeProperty("jqx-editor-toolbar-inline"));
this.toolbarContainer.addClass(this.toThemeProperty("jqx-widget"));
this.toolbarContainer.addClass(this.toThemeProperty("jqx-rc-all"));
this.toolbarContainer.hide();
this.toolbarContainer.css("position", "absolute");
this.editor.addClass(this.toThemeProperty("jqx-editor-inline"));
this.toolbarContainer.css("width", this.host.outerWidth() + "px")
}
var n = this.toolbarContainer.index();
if (this.toolbarPosition == "top" && n != 0 || this.toolbarPosition == "bottom" && n != 1) {
switch (this.toolbarPosition) {
case "bottom":
this.toolbarContainer.insertAfter(this.content);
break;
case "top":
default:
this.toolbarContainer.insertBefore(this.content);
break
}
}
var h = this.tools;
if (h !== false) {
var l = h.split(" ");
var p = h.split(" | ");
var q = function(i, r) {
$.each(r, function(y, F) {
var u = m.commands[this];
if (!u) {
if (m.createCommand) {
u = m.createCommand(this.toString());
if (!u) {
return true
}
if (!m.commands[this]) {
m.commands[this] = u
}
} else {
return true
}
} else {
if (m.createCommand) {
var x = m.createCommand(this.toString());
u = $.extend(u, x)
}
} if (m.localization[this]) {
u.tooltip = m.localization[this]
}
switch (u.type) {
case "list":
if (u.widget) {
u.widget.jqxDropDownList("destroy")
}
var A = function(R, Q, S) {
if (u.command == "formatblock") {
return "<" + S + ' unselectable="on" style="padding: 0px; margin: 0px;">' + Q + "" + S + ">"
} else {
if (u.command == "fontname") {
return '' + Q + ""
} else {
if (u.command == "fontsize") {
return '' + Q + ""
}
}
}
};
var t = function() {
var Q = m.toThemeProperty("jqx-editor-toolbar-icon") + " " + m.toThemeProperty("jqx-editor-toolbar-icon-" + u.command);
var R = "";
return R
};
var C = u.command == "formatblock" || u.command == "fontname" || u.command == "fontsize";
var z = u.value || [];
var N = new Array();
var J = u.placeHolder || "Please Choose:";
if (u.command == "fontname") {
$.each(z, function() {
var Q = m.localization[this.label];
N.push({
label: Q,
value: this.value
})
})
} else {
if (u.command == "formatblock") {
J = m.localization.format;
$.each(z, function() {
if (this.label.indexOf("Header") >= 0) {
var Q = this.label.replace("Header", m.localization.Header)
} else {
var Q = m.localization[this.label]
}
N.push({
label: Q,
value: this.value
})
})
} else {
N = z
}
}
var P = {
enableBrowserBoundsDetection: true,
touchMode: m.touchMode,
width: u.width || 100,
height: u.height || 25,
dropDownWidth: u.dropDownWidth || "auto",
autoDropDownHeight: (u.value && u.value.length) < 12 ? true : false,
placeHolder: J,
source: N,
theme: m.theme,
keyboardSelection: false,
focusable: false,
disabled: m.disabled,
rtl: m.rtl,
selectionRenderer: u.command == "fontsize" ? t : null,
renderer: C ? A : null
};
var D = "jqx-disableselect " + m.toThemeProperty("jqx-editor-dropdownlist") + " " + m.toThemeProperty("jqx-editor-toolbar-item");
var w = $("");
w.appendTo(i);
w.jqxDropDownList(P);
if (u.init) {
u.init(w)
}
var F = null;
var E = null;
var K = "";
m.addHandler(w, "mousedown", function(R) {
if ($(".jqx-editor-dropdownpicker").length > 0) {
$(".jqx-editor-dropdownpicker").jqxDropDownButton("close")
}
if ($(".jqx-editor-dropdownlist").length > 0) {
var Q = $(".jqx-editor-dropdownlist");
$.each(Q, function(S, T) {
if (T != w[0]) {
$(T).jqxDropDownList("close")
}
})
}
});
m.addHandler(w, "open", function(Q) {
if (!m.focused) {
m.focus()
}
m.updating = true;
m.activeElement = w;
F = w.val();
K = ""
});
m.addHandler(w, "change", function(Q) {
m.updating = false;
m.activeElement = null;
E = w.val();
K = Q.args.type;
if ($.jqx.browser.msie && $.jqx.browser.version < 9) {
m.focus()
}
});
m.addHandler(w, "close", function(Q) {
m.updating = false;
m.activeElement = null;
if (F != E) {
if (K == "mouse" || K == "keyboard") {
m._refreshTools()
}
}
});
m._addCommandHandler(w, "change", u.command, null, u);
break;
case "colorPicker":
if (u.widget) {
$(u.colorPicker).remove();
u.widget.jqxDropDownButton("destroy")
}
var B = $('').attr("id", "picker-" + u.command);
var D = "jqx-disableselect " + m.toThemeProperty("jqx-editor-dropdownpicker") + " " + m.toThemeProperty("jqx-editor-toolbar-item");
var w = $("");
w.appendTo(i);
w.append(B);
w.jqxDropDownButton({
touchMode: m.touchMode,
disabled: m.disabled,
enableBrowserBoundsDetection: true,
width: u.width || 45,
height: u.height || 25,
rtl: m.rtl,
focusable: false,
theme: m.theme
});
var I = $('
');
var s = m.toThemeProperty("jqx-editor-toolbar-icon") + " " + m.toThemeProperty("jqx-editor-toolbar-icon-" + u.command);
var O = $("");
I.append(O);
var L = $('
').attr("id", "bar-" + u.command).css("background-color", u.value);
I.append(L);
w.jqxDropDownButton("setContent", I);
B.append($(m.colorPickerTemplate));
u.colorPicker = B;
if (u.init) {
u.init(w)
}
B.find("tr").attr("role", "row").attr("unselectable", "on");
B.find("td").attr("role", "gridcell").attr("unselectable", "on").css("-webkit-user-select", "none");
B.find("div").attr("unselectable", "on");
m.addHandler(w, "mousedown", function(R) {
if ($(".jqx-editor-dropdownlist").length > 0) {
$(".jqx-editor-dropdownlist").jqxDropDownList("close")
}
if ($(".jqx-editor-dropdownpicker").length > 0) {
var Q = $(".jqx-editor-dropdownpicker");
$.each(Q, function(S, T) {
if (T != w[0]) {
$(T).jqxDropDownButton("close")
}
})
}
});
m.addHandler(w, "open", function() {
if (!m.focused) {
m.focus()
}
m.updating = true;
m.activeElement = B
});
m.addHandler(w, "close", function(Q) {
m.updating = false;
m.activeElement = null;
if (F != E) {
if (K == "mouse" || K == "keyboard") {
m._refreshTools()
}
}
});
m.addHandler(B, "keydown", function(Q) {
var Y = Q.keyCode;
var V = $(B).find(".jqx-editor-color-picker-selected-cell");
var aa = B.find("tr");
var T = aa.length;
var S = V.parent().children().length;
var U = V.index();
var W = -999;
var Z = V.parent();
$.each(aa, function(ab, ac) {
if (this == Z[0]) {
W = ab;
return false
}
});
switch (Y) {
case 27:
w.jqxDropDownButton("close");
break;
case 13:
$(V).trigger("mousedown");
break;
case 38:
W--;
break;
case 40:
W++;
break;
case 39:
U++;
break;
case 37:
U--;
break
}
if (W >= 0 && W <= T) {
if (U >= 0 && U <= S) {
var Z = B.find("tr")[W];
var X = $(Z).children()[U];
var R = $(X).children().css("background-color");
u.val(R)
}
}
});
var M = $(B).find("td");
u.val = function(Q) {
var R = m._rgbToHex(Q);
$.each(M, function() {
var S = $(this).children().css("background-color");
var T = m._rgbToHex(S);
if (T == R) {
M.removeClass("jqx-editor-color-picker-selected-cell");
$(this).addClass("jqx-editor-color-picker-selected-cell");
$("#bar-" + u.command).css("background", S);
return false
}
})
};
u.val(u.value);
m._addCommandHandler(M, "mousedown", u.command, null, u);
break;
case "button":
case "toggleButton":
default:
if (u.widget) {
if (u.type == "button") {
u.widget.jqxButton("destroy")
} else {
u.widget.jqxToggleButton("destroy")
}
}
var v = u.command;
var H = u.action;
var s = m.toThemeProperty("jqx-editor-toolbar-icon") + " " + m.toThemeProperty("jqx-editor-toolbar-icon-" + v);
var O = $("");
var w = $("").addClass("jqx-disableselect").addClass(m.toThemeProperty("jqx-editor-toolbar-button"));
if (!u.init) {
w.append(O)
} else {
if (v) {
w.append(O)
}
}
w.appendTo(i);
if (u.type == "button") {
w.jqxButton({
disabled: m.disabled,
rtl: m.rtl,
theme: m.theme
})
} else {
if (u.type == "toggleButton") {
w.jqxToggleButton({
disabled: m.disabled,
rtl: m.rtl,
uiToggle: false,
theme: m.theme
})
}
} if (u.init) {
u.init(w)
}
u.toggled = false;
u.toggle = function() {
u.toggled = !u.toggled
};
m.addHandler(w, "mousedown", function(Q) {
if (Q.preventDefault) {
Q.preventDefault()
}
if (Q.stopPropagation) {
Q.stopPropagation()
}
return false
});
if (!$.jqx.mobile.isTouchDevice()) {
m._addCommandHandler(w, "click", v, H, u)
} else {
m._addCommandHandler(w, "mousedown", v, H, u)
}
break
}
u.widget = w;
if (w) {
try {
if (u.tooltip != "") {
u.widget.attr("title", u.tooltip);
u.widget.attr("data-tooltip", u.tooltip)
}
if (u.command) {
u.widget.attr("data-command", u.command)
}
u.widget.attr("aria-label", u.tooltip)
} catch (G) {}
if (u.type == "button" || u.type == "toggleButton") {
if (r.length > 2) {
if (y == 0) {
w.css("border-right-radius", "0px");
w.addClass(m.toThemeProperty("jqx-rc-l"))
} else {
if (y == r.length - 1) {
w.css("border-left-radius", "0px");
w.addClass(m.toThemeProperty("jqx-rc-r"))
}
}
w.removeClass(m.toThemeProperty("jqx-rc-all"))
}
if (y != 0 && y != r.length - 1 && r.length > 2) {
w.css("border-left-radius", "0px");
w.css("border-right-radius", "0px");
w.removeClass(m.toThemeProperty("jqx-rc-all"))
} else {
if (r.length == 2) {
if (y == 0) {
w.css("border-right-radius", "0px");
w.addClass(m.toThemeProperty("jqx-rc-l"))
} else {
w.css("border-left-radius", "0px");
w.addClass(m.toThemeProperty("jqx-rc-r"))
}
w.removeClass(m.toThemeProperty("jqx-rc-all"))
} else {
if (r.length == 1) {
w.css("margin-right", "0px")
}
}
}
}
}
})
};
m.toolbar.css("direction", !this.rtl ? "ltr" : "rtl");
if (p.length == 0) {
q(m.toolbar, l)
} else {
for (var j = 0; j < p.length; j++) {
var f = p[j];
var l = f.split(" ");
var o = m.toThemeProperty("jqx-editor-toolbar-group") + " " + m.toThemeProperty("jqx-fill-state-normal");
var k = $("");
k.addClass(m.toThemeProperty("jqx-rc-all"));
m.toolbar.append(k);
q(k, l)
}
var g = m.toolbar.find(".jqx-editor-toolbar-group");
var e = g.length;
for (var j = 0; j < e; j++) {
if ($(g[j]).children().length == 0) {
$(g[j]).remove()
}
}
} if ($.jqx.browser.msie && $.jqx.browser.version < 8) {
$(".jqx-editor-toolbar-group").css("float", "left");
$(".jqx-editor-toolbar-group").children().css("float", "left");
$(".jqx-editor-toolbar-group").css("zoom", "1");
$(".jqx-editor-toolbar-group").children().css("zoom", "1")
}
}
this._arrange();
this._addHandlers()
},
_arrange: function() {
if (this.content) {
if (this.tools == "" || this.tools == false) {
this.content.height(this.container.outerHeight() - parseInt(this.container.css("padding-top")) - parseInt(this.container.css("padding-bottom")) - 6);
this.content.css("margin-top", "4px");
this.toolbar.hide()
} else {
this.toolbar.show();
this.content.css("margin-top", "0px");
this.content.height(this.container.outerHeight() - this.toolbar.outerHeight() - parseInt(this.container.css("padding-top")) - parseInt(this.container.css("padding-bottom")) - 2);
if (this.toolbarPosition != "top") {
this.content.css("margin-top", "4px");
this.content.css("margin-bottom", "0px")
}
} if ($.jqx.browser.msie && $.jqx.browser.version < 8) {
this.content.css("margin-top", "4px");
this.content.height(this.container.height() - this.toolbar.outerHeight() - 2 * parseInt(this.container.css("padding-bottom")) - 10);
this.content.width(this.container.width() - 2 * parseInt(this.container.css("padding-left")) - 2)
}
if (this.editor.height() < this.content.height()) {
this.editor.height(this.content.height())
}
}
},
propertyChangedHandler: function(a, e, g, f) {
if (this.isInitialized == undefined || this.isInitialized == false) {
return
}
if (e == "pasteMode" || e == "lineBreak" || e == "editable") {
return
}
if (e == "disabled") {
a._refreshTools()
}
if (e == "width" || e == "height" || e == "toolbarPosition") {
a._arrange();
return
}
a.refresh()
},
selectRange: function(a) {
if (!a) {
a = this.getRange()
}
this.selection.selectRange(a)
},
getRange: function() {
return this.selection.getRange()
},
getSelectedElement: function() {
var h, f, k, e;
try {
if (this.editorDocument.getSelection) {
var j = this.editorDocument.getSelection();
h = j.getRangeAt(j.rangeCount - 1);
k = h.startContainer;
e = h.endContainer;
f = h.commonAncestorContainer;
if (k.nodeName == "#text") {
f = f.parentNode
}
if (k.nodeName == "#text") {
k = k.parentNode
}
if (k.nodeName.toLowerCase() == "body") {
k = k.firstChild
}
if (e.nodeName == "#text") {
e = e.parentNode
}
if (e.nodeName.toLowerCase() == "body") {
e = e.lastChild
}
if (k == e) {
f = k
}
return e
} else {
if (this.editorDocument.selection) {
h = this.editorDocument.selection.createRange();
if (!h.duplicate) {
return null
}
f = h.parentElement();
var g = h.duplicate();
var a = h.duplicate();
g.collapse(true);
a.moveToElementText(g.parentElement());
a.setEndPoint("EndToStart", g);
k = g.parentElement();
g = h.duplicate();
a = h.duplicate();
a.collapse(false);
g.moveToElementText(a.parentElement());
g.setEndPoint("StartToEnd", a);
e = a.parentElement();
if (k.nodeName.toLowerCase() == "body") {
k = k.firstChild
}
if (e.nodeName.toLowerCase() == "body") {
e = e.lastChild
}
if (k == e) {
f = k
}
return e
}
}
} catch (i) {
return null
}
return null
},
_addHandlers: function() {
var e = this;
this.addHandler(this.toolbar, "mousedown.editor" + this.element.id, function(g) {
if (g.preventDefault) {
g.preventDefault()
}
if (g.stopPropagation) {
g.stopPropagation()
}
return false
});
var f = function() {
if (e.host.is("textarea")) {
e.host.html($(this).html())
}
if (e.changed) {
e._raiseEvent("change");
e.changed = false
}
e.focused = false;
if (e.inline) {
e.host.removeClass(e.toThemeProperty("jqx-fill-state-focus"));
e.host.removeClass(e.toThemeProperty("jqx-editor-inline-focus"));
e.toolbarContainer.fadeOut("fast")
}
};
var a = function() {
e.focused = true;
if (e.inline) {
e.host.addClass(e.toThemeProperty("jqx-fill-state-focus"));
e.host.addClass(e.toThemeProperty("jqx-editor-inline-focus"));
e.host.addClass(e.toThemeProperty("jqx-rc-all"));
e.toolbarContainer.fadeIn("fast");
var g = e.host.coord();
e.toolbarContainer.offset({
left: g.left,
top: g.top - e.toolbarContainer.outerHeight() - 5
})
}
};
if ($.jqx.browser.mozilla) {
this.addHandler($(document), "mousedown.editor" + this.element.id, function(g) {
f()
})
}
this.addHandler(this.editor, "blur.editor" + this.element.id, function(g) {
f()
});
this.addHandler(this.editor, "focus.editor" + this.element.id, function(g) {
a()
});
this.addHandler(this.editor, "beforedeactivate.editor" + this.element.id, function(g) {
e.range = e.getRange()
});
this.addHandler(this.editor, "mousedown.editor" + this.element.id, function(g) {
e.range = e.getRange();
if ($.jqx.browser.mozilla) {
a();
g.stopPropagation()
}
if ($(".jqx-editor-dropdownpicker").length > 0) {
$(".jqx-editor-dropdownpicker").jqxDropDownButton("close")
}
if ($(".jqx-editor-dropdownlist").length > 0) {
$(".jqx-editor-dropdownlist").jqxDropDownList("close")
}
if (e.inline) {
e.editor.focus()
}
});
if ($.jqx.mobile.isTouchDevice()) {
this.addHandler($(this.editorDocument), "selectionchange.editor" + this.element.id, function() {
if (e.editorDocument.activeElement != e.editor[0]) {
window.focus();
e.focus()
}
});
this.addHandler($(this.editorDocument), "keydown.editor" + this.element.id, function() {
if (e.editorDocument.activeElement != e.editor[0]) {
window.focus();
e.focus()
}
})
}
this.addHandler(this.editor, "mouseup.editor" + this.element.id, function(g) {
if (e._documentMode == "source") {
return true
}
e.range = e.getRange();
e._refreshTools(null, true)
});
this.addHandler(this.editor, "keydown.editor" + this.element.id, function(g) {
if (e._documentMode == "source") {
return true
}
if ($.jqx.browser.mozilla) {
if (!e.focused) {
a()
}
}
if (e.disabled) {
if (g.preventDefault) {
g.preventDefault()
}
return false
}
if (e.updating) {
if (e.activeElement) {
var m = jQuery.Event("keydown");
$.extend(m, g);
e.activeElement.trigger(m)
}
if (g.preventDefault) {
g.preventDefault()
}
return false
}
var n = g || window.event;
var q = n.keyCode;
var r = String.fromCharCode(q).toLowerCase();
if (!e.editable) {
var l = [8, 9, 33, 34, 35, 36, 37, 38, 39, 40, 40, 45, 46];
if ($.inArray(n.keyCode, l) == -1 && !(n.ctrlKey && r == "c") && !(n.ctrlKey && r == "a")) {
g.preventDefault()
}
}
if (e.selection.getText().length > 0 || e.linkPopup) {
var l = [8, 9, 13, 33, 34, 35, 36, 37, 38, 39, 40, 40, 45, 46];
if (!$.inArray(n.keyCode, l) != -1 || (n.keyCode == 65 && n.ctrlKey && !n.altKey && !n.shiftKey)) {
if (e._refreshToolsTimer) {
clearTimeout(e._refreshToolsTimer)
}
e._refreshToolsTimer = setTimeout(function() {
e._refreshTools(null, true, n.keyCode)
}, 10)
}
}
if (q == 13 && e.lineBreak != "default") {
var k = e.getSelectedElement();
if (k) {
var o = k.nodeName.toLowerCase();
switch (o) {
case "pre":
case "li":
case "ul":
case "ol":
case "h1":
case "h2":
case "h3":
case "h4":
case "h5":
case "h6":
return true
}
var p = k;
while (p != null) {
if (p.nodeName == "#document") {
p = e.editorDocument.body;
break
}
if (p.parentNode == e.editorDocument.body || p == e.editorDocument.body) {
break
}
p = p.parentNode
}
}
if (p) {
var j = e.getRange();
if (e.editorDocument.body.innerHTML == "" && e.lineBreak != "br") {
e.selection.insertContent("")
}
if (e.lineBreak == "div") {
if (p == e.editorDocument.body) {
$(p).append("
")
} else {
$("
").insertAfter(p)
}
} else {
if (e.lineBreak == "p") {
if (p == e.editorDocument.body) {
$(p).append("
")
} else {
$("
").insertAfter(p)
}
} else {
e.execute("insertHTML", " ")
}
}
e.selectRange(j);
var i = $(e.editorDocument).find("#INSERTION_MARKER");
if (e.lineBreak != "br") {
e.selection.selectNode($(i).prev()[0], true)
} else {
e.selection.selectNode(i[0], true);
if (e.getRange().setStartAfter) {
e.getRange().setStartAfter(i[0])
}
}
i.remove();
e.selection.collapse(false);
if (p && p.nodeName && e.lineBreak == "br") {
if (p.nodeName.toLowerCase() != "#text") {
e.selection.selectNode(p, true);
if (e.getRange().setStartAfter) {
e.getRange().setStartAfter(p)
}
e.selection.collapse(false)
}
}
if (e.lineBreak != "br") {
j = e.getRange();
if (j.select) {
j.select()
}
}
if (g.preventDefault) {
g.preventDefault()
}
return false
}
}
if (n.ctrlKey && (r == "k" || r == "u" || r == "b" || r == "i")) {
if (g.preventDefault) {
g.preventDefault()
}
var h = null;
switch (r) {
case "k":
h = "link";
break;
case "u":
h = "underline";
break;
case "b":
h = "bold";
break;
case "i":
h = "italic";
break
}
if (e.commands[h].widget) {
e.commands[h].widget.trigger("click")
}
return false
}
});
this.addHandler(this.editor, "paste.editor" + this.element.id, function(k) {
if (e._documentMode == "source") {
return true
}
if (e.readOnly) {
return true
}
e.updating = true;
e.readOnly = true;
var l = k;
var j = function(p, o) {
if (o) {
if (!e.paragraphise) {
p = p.replace(/\n/g, " ")
} else {
p = "
" + p + "
";
p = p.replace(/\n/g, "
");
p = p.replace(/
\s<\/p>/gi, "")
}
} else {
p = p.replace(/]*?>(.*)/gim, "$1");
p = p.replace(/<\/html>/gi, "");
p = p.replace(/
]*?>(.*)/gi, "$1");
p = p.replace(/<\/body>/gi, "");
p = p.replace(/