/*
Product Name: dhtmlxSuite
Version: 5.2.0
Edition: Professional
License: content of this file is covered by DHTMLX Commercial or Enterprise license. Usage without proper license is prohibited. To obtain it contact sales@dhtmlx.com
Copyright UAB Dinamenta http://www.dhtmlx.com
*/
function dhtmlXEditor(base, skin) {
var that = this;
this.conf = {
// set content after load
content: "", // first if set
contentHTML: "", // second
// resize
resizeTM: null,
resizeTMTime: 100,
// readonly
roMode: false,
// extended toolbar
toolbar: false,
iconsPath: "",
// frame events
evs: ["focus", "blur", "keydown", "keyup", "keypress", "mouseup", "mousedown", "click", "touchend"], // touchend is dev_event for fix on iOS/iPad
// focus fix on iOS/iPad
iOSfix: (navigator.userAgent.match(/Mobile/gi) != null && navigator.userAgent.match(/iPad/gi) != null && navigator.userAgent.match(/AppleWebKit/gi) != null),
// extended font conf
extra_css: "",
font: {family: "Tahoma", size: "12px", color: "black"}
};
this._doOnFocusChanged = null;
this._doOnAccess = null;
if (typeof(base) == "object" && base != null && base.tagName == null) {
skin = base.skin;
if (base.content != null) this.conf.content = base.content;
if (base.contentHTML != null) this.conf.contentHTML = base.contentHTML;
if (base.iconsPath != null) this.conf.iconsPath = base.iconsPath;
if (base.extraCss != null) this.conf.extra_css = base.extraCss;
if (base.toolbar != null) this.conf.toolbar = window.dhx4.s2b(base.toolbar);
if (base.onFocusChanged != null) this._doOnFocusChanged = base.onFocusChanged;
if (base.onAccess != null) this._doOnAccess = base.onAccess;
base = base.parent;
}
// skin config
this.conf.skin = (skin||window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhxeditor")||"material");
// configure base
if (typeof(base) == "string") base = document.getElementById(base);
this.base = base;
this.base.className += " dhxeditor_"+this.conf.skin;
while (this.base.childNodes.length > 0) this.base.removeChild(this.base.childNodes[0]);
// configure base for dhxcont
var pos = (window.dhx4.isIE ? this.base.currentStyle["position"] : (window.getComputedStyle != null? window.getComputedStyle(this.base, null).getPropertyValue("position") : "" ));
if (!(pos == "relative" || pos == "absolute")) this.base.style.position = "relative";
// init dhxcont
this.cell = new dhtmlXEditorCell(window.dhx4.newId(), this);
this.base.appendChild(this.cell.cell);
this.cBlock = document.createElement("DIV");
this.cBlock.className = "dhxcont_content_blocker";
this.cBlock.style.display = "none";
this.base.appendChild(this.cBlock);
// editable area
this.editor = document.createElement("IFRAME");
this.editor.className = "dhxeditor_mainiframe";
this.editor.frameBorder = 0;
if (window.dhx4.isOpera) this.editor.scrolling = "yes";
// adjust self
this.setSizes();
// onAccess event - focus/blue as param
var fr = this.editor;
if (typeof(window.addEventListener) != "undefined") {
fr.onload = function() {
for (var q=0; q"+this.conf.extra_css+
""+
"