/**
* @desc: constructor, creates dhtmlxlayout panel
* @pseudonym: td
* @type: public
*/
function dhtmlXLayoutPanel(){
}
/**
* @desc: constructor, creats a new dhtmlXLayout object
* @param: base - object/object id, document.body or dhtmlxWindow - the layout will be attached to it
* @param: view - layout's pattern
* @param: skin - skin
* @type: public
*/
function dhtmlXLayoutObject(base, view, skin) {
if (!dhtmlXContainer) {
alert("dhtmlxcontainer.js is missed on the page");
return;
}
// 1. object/objectId - window without borders
// 2. document.body - fullscreened window
// 3. window object - simple attach
var that = this;
this._autodetectSkin = function() {
var t = document.createElement("DIV");
t.className = "dhxlayout_skin_detect";
if (document.body.childNodes.length > 0) document.body.insertBefore(t, document.body.childNodes[0]); else document.body.appendChild(t);
var w = t.offsetWidth;
document.body.removeChild(t);
t = null;
if (w == 199) return "dhx_skyblue";
if (w == 299) return "dhx_blue";
if (w == 399) return "dhx_black";
return "dhx_skyblue";
}
this.skin = (skin!=null?skin:this._autodetectSkin());
this.setSkin = function(skin) {
if (!this.skinParams[skin]) return;
this.skin = skin;
// params
this._CPanelHeight = this.skinParams[this.skin]["cpanel_height"];
this._collapsedW = this.skinParams[this.skin]["cpanel_collapsed_width"];
this._collapsedH = this.skinParams[this.skin]["cpanel_collapsed_height"];
// classes
this.tpl.className = "dhtmlxLayoutPolyContainer_"+this.skin+(this._r?" dhxlayout_rtl":"");
this.sizer.className = "dhxLayout_Sizer_"+this.skin;
// windows
if (this.dhxWins) this.dhxWins.setSkin(this.skin);
// progress
// container
for (var a in this.polyObj) this.polyObj[a].skin = this.skin;
this.base.skin = this.skin;
// icons
this._fixIcons();
// cells
this.setSizes();
}
this._dblClickTM = 200;
this._mTop = 0;
this._mBottom = 0;
if (typeof(base) == "string") { base = document.getElementById(base); }
// check if window/layout
if ((base._isWindow == true || base._isCell) && !this.base) {
if (base._isCell && base.attachLayout) return base.attachLayout(view, skin);
// window init
if (base.isWindow) return base.attachLayout(view, skin);
// attach to window init
// layout init
this.base = base;
}
// fulscreen init hide scrolls
if (base == document.body && !this.base) {
document.body.style.overflow = "hidden";
}
// object init
if ((typeof(base) == "object" || base == document.body) && !this.base) {
var contObj = document.createElement("DIV");
contObj.className = "dhxcont_global_layout_area";
base.appendChild(contObj);
base._isLayout = true;
this.cont = new dhtmlXContainer(base);
this.cont.setContent(contObj);
if (base == document.body) {
// 2px default margins
if (this.skin == "dhx_skyblue") {
this.cont.obj._offsetTop = 2;
this.cont.obj._offsetLeft = 2;
this.cont.obj._offsetHeight = -4;
this.cont.obj._offsetWidth = -4;
}
document.body.className += " dhxlayout_fullscreened";
}
base.adjustContent(base, this._mTop, null, null, this._mBottom);
// this.base = contObj.childNodes[0];
this.base = document.createElement("DIV");
//this.base.id = "dhxLayoutObj_"+this._genStr(12);
this.base.style.overflow = "hidden";
this.base.style.position = "absolute";
// this._sizerML = 1;
// this._sizerMT = 1;
/*
this.base.style.left = "1px";
this.base.style.top = "1px";
this.base.style.width = parseInt(contObj.childNodes[0].style.width)-2+"px"; //parseInt(this.dhxcont.childNodes[0].style.width)-2+"px";
this.base.style.height = parseInt(contObj.childNodes[0].style.height)-2+"px"; //parseInt(this.dhxcont.childNodes[0].style.height)-2+"px";
this._baseWFix = -2;
this._baseHFix = -2;
*/
this.base.style.left = "0px";
this.base.style.top = "0px";
this.base.style.width = contObj.childNodes[0].style.width;
this.base.style.height = contObj.childNodes[0].style.height;
contObj.childNodes[0].appendChild(this.base);
if (base == document.body) {
// this._sizerML = 0;
// this._sizerMT = 0;
this._tmTime = null;
this._doOnResizeStart = function() {
window.clearTimeout(this._tmTime);
this._tmTime = window.setTimeout(function(){that._doOnResizeEnd();},200);
}
this._doOnResizeEnd = function() {
var dim = this._defineWindowMinDimension(this.base, true);
document.body.setMinContentSize(dim[1], dim[2]);
document.body.adjustContent(document.body, 0);
this.setSizes(false);
}
if (_isIE) {
window.attachEvent("onresize", that._doOnResizeStart);
} else {
window.addEventListener("resize", that._doOnResizeStart, false);
}
// dhtmlxEvent(window, "resize", that._doOnResizeStart);
}
}
this.items = new Array();
/**
* @desc: returns cell's object by cell's id
* @param: id - cell's id
* @type: public
*/
this.cells = function(id) {
if (this.polyObj[id] != null) { return this.polyObj[id]; }
return null;
}
/**
* @desc: returns cell's id by index
* @param: ind - cell's index
* @type: public
*/
this.getIdByIndex = function(ind) {
if (ind < 0) return null;
if (ind >= this.items.length) return null;
// return this.items[ind]._link;
return this.items[ind]._idd;
}
/**
* @desc: returns cell's index by id
* @param: id - cell's id
* @type: public
*/
this.getIndexById = function(id) {
if (this.cells(id) != null) return this.cells(id).getIndex();
return null;
}
// this.base = base; // (typeof(base)=="object"?base:document.getElementById(base));
// needed for windows
this.imagePath = dhtmlx.image_path||"codebase/imgs/";
/**
* @desc: set path to images
* @param: path - path on hard disk
* @type: public
*/
this.setImagePath = function(path) {
this.imagePath = path;
}
// if (parentWindow != null) { this._parentWindow = parentWindow; }
this.polyObj = {};
this.sepHor = new Array();
this.sepVer = new Array();
this._layoutView = (view!=null?String(view).toUpperCase():"3E");
this._minWidth = 40;
this._minHeight = 40;
//
this._CPanelBtnsWidth = 32;
//
// this._collapsedW = 7;//20;
// this._collapsedH = (_isFF?7:8);//(_isFF?20:22);
this.skinParams = { "glassy_blue" : {"hor_sep_height": 4, "ver_sep_width": 4, "cpanel_height": 23, "cpanel_collapsed_width": 7, "cpanel_collapsed_height": (_isFF?7:8)},
"glassy_caramel" : {"hor_sep_height": 4, "ver_sep_width": 4, "cpanel_height": 23, "cpanel_collapsed_width": 7, "cpanel_collapsed_height": (_isFF?7:8)},
"glassy_greenapple" : {"hor_sep_height": 4, "ver_sep_width": 4, "cpanel_height": 23, "cpanel_collapsed_width": 7, "cpanel_collapsed_height": (_isFF?7:8)},
"glassy_rainy" : {"hor_sep_height": 4, "ver_sep_width": 4, "cpanel_height": 23, "cpanel_collapsed_width": 7, "cpanel_collapsed_height": (_isFF?7:8)},
"glassy_raspberries": {"hor_sep_height": 4, "ver_sep_width": 4, "cpanel_height": 23, "cpanel_collapsed_width": 7, "cpanel_collapsed_height": (_isFF?7:8)},
"glassy_yellow" : {"hor_sep_height": 4, "ver_sep_width": 4, "cpanel_height": 23, "cpanel_collapsed_width": 7, "cpanel_collapsed_height": (_isFF?7:8)},
"aqua_dark" : {"hor_sep_height": 5, "ver_sep_width": 5, "cpanel_height": 24, "cpanel_collapsed_width": 18, "cpanel_collapsed_height": 18},
"aqua_orange" : {"hor_sep_height": 5, "ver_sep_width": 5, "cpanel_height": 24, "cpanel_collapsed_width": 18, "cpanel_collapsed_height": 18},
"aqua_sky" : {"hor_sep_height": 5, "ver_sep_width": 5, "cpanel_height": 24, "cpanel_collapsed_width": 18, "cpanel_collapsed_height": 18},
"clear_blue" : {"hor_sep_height": 5, "ver_sep_width": 5, "cpanel_height": 26, "cpanel_collapsed_width": 18, "cpanel_collapsed_height": 18},
"clear_green" : {"hor_sep_height": 5, "ver_sep_width": 5, "cpanel_height": 26, "cpanel_collapsed_width": 18, "cpanel_collapsed_height": 18},
"clear_silver" : {"hor_sep_height": 5, "ver_sep_width": 5, "cpanel_height": 26, "cpanel_collapsed_width": 18, "cpanel_collapsed_height": 18},
"modern_black" : {"hor_sep_height": 5, "ver_sep_width": 5, "cpanel_height": 31, "cpanel_collapsed_width": 18, "cpanel_collapsed_height": 18},
"modern_blue" : {"hor_sep_height": 5, "ver_sep_width": 5, "cpanel_height": 31, "cpanel_collapsed_width": 18, "cpanel_collapsed_height": 18},
"modern_red" : {"hor_sep_height": 5, "ver_sep_width": 5, "cpanel_height": 31, "cpanel_collapsed_width": 18, "cpanel_collapsed_height": 18},
"dhx_black" : {"hor_sep_height": 5, "ver_sep_width": 5, "cpanel_height": 34, "cpanel_collapsed_width": 18, "cpanel_collapsed_height": 18},
"dhx_blue" : {"hor_sep_height": 5, "ver_sep_width": 5, "cpanel_height": 34, "cpanel_collapsed_width": 18, "cpanel_collapsed_height": 18},
"dhx_skyblue" : {"hor_sep_height": 5, "ver_sep_width": 5, "cpanel_height": 26, "cpanel_collapsed_width": 18, "cpanel_collapsed_height": 18},
"standard" : {"hor_sep_height": 5, "ver_sep_width": 5, "cpanel_height": 28, "cpanel_collapsed_width": 20, "cpanel_collapsed_height": (_isFF?20:22)}
};
// ff - 34,18
// ie - 34,18
// safari - 34,18
// opera ?
this._CPanelHeight = this.skinParams[this.skin]["cpanel_height"];
this._collapsedW = this.skinParams[this.skin]["cpanel_collapsed_width"];
this._collapsedH = this.skinParams[this.skin]["cpanel_collapsed_height"];
//
this.tpl = document.createElement("TABLE");
this.tpl.dir = "ltr";
this.tpl.className = "dhtmlxLayoutPolyContainer_"+this.skin;
this.tpl.cellSpacing = 0;
this.tpl.cellPadding = 0;
var bd = document.createElement("TBODY");
this.tpl.appendChild(bd);
this.tpl.border = 0;
//
this.tplSizes = {};
this._effects = { "collapse": false, "resize": false, "highlight": true };
this.sizer = document.createElement("DIV");
this.sizer.className = "dhxLayout_Sizer_"+this.skin;
this.sizer.style.display = "none";
document.body.appendChild(this.sizer);
this._attachSizer = function(obj) {
that.sizer.style.left = getAbsoluteLeft(obj)+"px";
that.sizer.style.top = getAbsoluteTop(obj)+"px";
that.sizer.style.width = obj.offsetWidth+"px";
that.sizer.style.height = obj.offsetHeight+"px";
if (that._sizerML != null) that.sizer.style.marginLeft = that._sizerML+"px";
if (that._sizerMT != null) that.sizer.style.marginTop = that._sizerMT+"px";
that.sizer.style.display = "";
that.sizer.className = "dhxLayout_Sizer_"+that.skin;
if (obj._dir != null) { that.sizer.className += " "+(obj._dir=="hor"?"dhxCursorNResize":"dhxCursorWResize"); }
}
/**
* @desc: returns array with available layout patterns
* @type: public
*/
this.listViews = function() {
var views = new Array();
for (var a in this.tplData) { views[views.length] = a; }
return views;
}
this._init = function() {
this.obj = document.createElement("DIV");
this.obj.className = "dhtmlxLayoutObject";
this.base.appendChild(this.obj);
this.obj.appendChild(this.tpl);
this.w = this.obj.offsetWidth;
this.h = this.obj.offsetHeight;
//
this._xmlLoader.loadXMLString(this.tplData[this._layoutView]!=null?this.tplData[this._layoutView]:this.tplData["3E"]);
this._initWindows();
}
this._autoHor = new Array();
this._autoVer = new Array();
// minimal dimension for parent window
this._dimension = new Array(320, 200);
this._rowsRatio = 100;
this._colsRatio = 100;
//
this._xmlParser = function() {
var tableDataH = new Array();
var tableDataV = new Array();
var tableSeps = {};
//
var root = this.getXMLTopNode("layout");
for (var q=0; q ";
td._minW = (cell.getAttribute("minWidth") != null ? Number(cell.getAttribute("minWidth")):that._minWidth);
td._minH = (cell.getAttribute("minHeight") != null ? Number(cell.getAttribute("minHeight")):that._minHeight);
td._initCPanel = (cell.getAttribute("cpanel") != null ? (cell.getAttribute("cpanel")=="false"?false:true):true);
td._resize = cell.getAttribute("resize");
// init width/height
// if (cell.getAttribute("width") != null) { td.style.width = cell.getAttribute("width"); }
// if (cell.getAttribute("height") != null) { td.style.height = cell.getAttribute("height"); }
// td._initW = (cell.getAttribute("width")!=null?cell.getAttribute("width"):"*");
// td._initH = (cell.getAttribute("height")!=null?cell.getAttribute("height"):"*");
var rd = String(cell.getAttribute("neighbors")).split(";");
for (var e=0; e 1) { rd[e] = p; } }
td._rowData = rd;
that.polyObj[obj] = td;
}
if (cell.getAttribute("sep") != null) {
var sep = cell.getAttribute("sep");
if (sep == "hor") {
td.className = "dhtmlxLayoutPolySplitterHor";
td._dir = "hor";
// top side
var top = cell.getAttribute("top").split(";");
for (var e=0; e 1) { top[e] = p; } }
td._top = top;
// bottom side
var bottom = cell.getAttribute("bottom").split(";");
for (var e=0; e 1) { bottom[e] = p; } }
td._bottom = bottom;
that.sepHor[that.sepHor.length] = td;
} else {
td.className = "dhtmlxLayoutPolySplitterVer";
td._dir = "ver";
// left side
var left = cell.getAttribute("left").split(";");
for (var e=0; e 1) { left[e] = p; } }
td._left = left;
// right side
var right = cell.getAttribute("right").split(";");
for (var e=0; e 1) { right[e] = p; } }
td._right = right;
that.sepVer[that.sepVer.length] = td;
}
td._dblClick = cell.getAttribute("dblclick");
td._isSep = true;
td.innerHTML = " ";
}
if (cell.getAttribute("colspan") != null) { td.colSpan = cell.getAttribute("colspan"); }
if (cell.getAttribute("rowspan") != null) { td.rowSpan = cell.getAttribute("rowspan"); }
tr.appendChild(td);
}
}
}
// autosize data
if (root.childNodes[q].tagName == "autosize") {
that._autoHor = (root.childNodes[q].getAttribute("hor")).split(";");
that._autoVer = (root.childNodes[q].getAttribute("ver")).split(";");
that._totalCols = root.childNodes[q].getAttribute("cols");
that._totalRows = root.childNodes[q].getAttribute("rows");
that._dimension[0] = that._totalCols * that._colsRatio;
that._dimension[1] = that._totalRows * that._rowsRatio;
}
// table layout data (needed for init sizes)
if (root.childNodes[q].tagName == "table") {
var data = root.childNodes[q].getAttribute("data");
var r = String(data).split(";");
for (var q1=0; q1= this._lastClick) {
if (that._doOnDoubleClick(this) === true) return;
}
}
var p = that._findDockCellsVer(this);
that._resAreaData = new Array();
if (p[0] != null && p[1] != null) {
if (String(document.body.className).search("dhxCursorWResize") == -1) { document.body.className += " dhxCursorWResize"; }
that._resObj = this;
that._anyExpL = p[0];
that._anyExpR = p[1];
that._collectResAreaData(p);
that._resX = e.clientX;
// sizmple resize
if (that._effects["resize"] == false) {
that._attachSizer(this);
that.sizer._leftXStart = parseInt(that.sizer.style.left);
// getting neares objects
var objLeft = that.polyObj[that._anyExpL[0]];
that._resXMaxWidthLeft = parseInt(objLeft.style.width)-that._minWidth;
var objRight = that.polyObj[that._anyExpR[0]];
that._resXMaxWidthRight = parseInt(objRight.style.width)-that._minWidth;
// checking alternative min width in attached layout case
if (that._alterSizes.length > 0) {
for (var q=0; q= this._lastClick) {
if (that._doOnDoubleClick(this) === true) return;
}
}
var p = that._findDockCellsHor(this);
that._resAreaData = new Array();
if (p[0] != null && p[1] != null) {
if (String(document.body.className).search("dhxCursorNResize") == -1) { document.body.className += " dhxCursorNResize"; }
that._resObj = this;
that._anyExpT = p[0];
that._anyExpB = p[1];
that._collectResAreaData(p);
that._resY = e.clientY;
// sizmple resize
if (that._effects["resize"] == false) {
that._attachSizer(this);
that.sizer._topYStart = parseInt(that.sizer.style.top);
// getting neares objects
var objTop = that.polyObj[that._anyExpT[0]];
that._resYMaxHeightTop = parseInt(objTop.style.height)-that._minHeight;
var objBottom = that.polyObj[that._anyExpB[0]];
that._resYMaxHeightBottom = parseInt(objBottom.style.height)-that._minHeight;
// checking alternative min height in attached layout case
if (that._alterSizes.length > 0) {
for (var q=0; q"+
""+
""+
""+
""+
""+
"";
if (this.polyObj[a]._initCPanel == true) {
bar._h = this._CPanelHeight;
bar.style.display = "";
} else {
bar._h = 0;
bar.style.display = "none";
}
this.polyObj[a].childNodes[0].appendChild(bar);
//
bar.ondblclick = function() {
that.callEvent("onDblClick", [this._dockCell]);
}
bar.childNodes[4].onclick = function() { // show/hide
var pId = this.parentNode._dockCell;
if (that._isCollapsed(pId)) { that._expand(pId, "hide"); } else { that._collapse(pId, "hide"); }
}
for (var r=0; r=0; q--) {
if (anyExpL == null) {
if (typeof(resObj._left[q]) == "object") {
var isBlocked = false;
for (var w=0; w 0 && this._effects["resize"] == true) {
var objL = new Array();
var objR = new Array();
for (var q=0; q=0; q--) {
if (anyExpT == null) {
if (typeof(resObj._top[q]) == "object") {
var isBlocked = false;
for (var w=0; w 0 && this._effects["resize"] == true) {
var objT = new Array();
var objB = new Array();
for (var q=0; q this._resXMaxWidthLeft && offsetX < 0) { offsetX = -this._resXMaxWidthLeft; this._resX = offsetX+this._resXStart; }
if (offsetX > this._resXMaxWidthRight && offsetX > 0) { offsetX = this._resXMaxWidthRight; this._resX = offsetX+this._resXStart; }
this.sizer.style.left = this.sizer._leftXStart+offsetX+"px";
return;
}
// console.log(this._resObj._leftXStart);
//
var anyExpL = this._anyExpL;
var anyExpR = this._anyExpR;
// resize items
var newX = e.clientX;
var offsetX = e.clientX - that._resX;
//
var objL = new Array();
var objR = new Array();
for (var q=0; q objL[0]._minW && newWL > this._minWLAlter) {
var newWR = wR + wL - newWL;
for (var q=0; q 0) {
var newWR = wR - offsetX;
if (newWR > objR[0]._minW && newWR > this._minWRAlter) {
var newWL = wL + wR - newWR;
for (var q=0; q this._resYMaxHeightTop && offsetY < 0) { offsetY = -this._resYMaxHeightTop; this._resY = offsetY + this._resYStart; }
if (offsetY > this._resYMaxHeightBottom && offsetY > 0) { offsetY = this._resYMaxHeightBottom; this._resY = offsetY + this._resYStart; }
this.sizer.style.top = this.sizer._topYStart+offsetY+"px";
return;
}
//
var anyExpT = this._anyExpT;
var anyExpB = this._anyExpB;
// resize items
var newY = e.clientY;
var offsetY = e.clientY - that._resY;
//
var objT = new Array();
var objB = new Array();
for (var q=0; q objT[0]._minH + this._minHTAlter) {
var newHB = hB + hT - newHT;
for (var q=0; q 0) {
var newHB = hB - offsetY;
if (newHB > objB[0]._minH + this._minHBAlter) {
var newHT = hT + hB - newHB;
for (var q=0; q=0; q--) {
if (anyExp == null) {
if (typeof(rowData[q]) == "string") { if (this.polyObj[rowData[q]]._collapsed == false) { anyExp = rowData[q]; } } else { anyExp = rowData[q]; }
}
}
}
if (anyExp == null) return;
//
if (typeof(anyExp) != "object") { anyExp = new Array(anyExp); }
if (dir == "hor") {
var availSpace = parseInt(this.polyObj[anyExp[0]].style.width) - this._minWidth;
var maxSize = this.polyObj[pId]._savedW;
if (maxSize > availSpace) { maxSize = availSpace; }
if (maxSize < this._minWidth) return;
var step = Math.round(maxSize/3);
// var maxSize = Math.round(parseInt(this.polyObj[anyExp[0]].style.width)/2);
// var step = Math.round(this.polyObj[anyExp[0]].offsetWidth/24);
} else {
var availSpace = parseInt(this.polyObj[anyExp[0]].style.height) - this._minHeight;
var maxSize = this.polyObj[pId]._savedH;
if (maxSize > availSpace) { maxSize = availSpace; }
if (maxSize < this._minHeight) return;
var step = Math.round(maxSize/3);
// var maxSize = Math.round(parseInt(this.polyObj[anyExp[0]].style.height)/2);
// var step = Math.round(this.polyObj[anyExp[0]].offsetHeight/16);
}
// do expanding
this.polyObj[pId].childNodes[0].childNodes[1].style.display = "";
this.polyObj[pId].childNodes[0].childNodes[0].className = "dhtmlxPolyInfoBar";
// icons
this.polyObj[pId].childNodes[0].childNodes[0].childNodes[1].style.display = "";
this.polyObj[pId].childNodes[0].childNodes[0].childNodes[2].style.display = "";
//this.polyObj[pId].childNodes[0].childNodes[3].style.display = "";
this.polyObj[pId].childNodes[0].childNodes[0].childNodes[4].style.display = "";
//
var obj2 = new Array();
for (var q=0; q=0; q--) {
if (anyExp == null) {
if (typeof(rowData[q]) == "string") { if (this.polyObj[rowData[q]]._collapsed == false) { anyExp = rowData[q]; } } else { anyExp = rowData[q]; }
}
}
}
if (anyExp == null) {
if (rowData[ind+1] != null) { anyExp = rowData[ind+1]; }
}
// check first collapsed on the left for expanding
if (anyExp == null) {
if (ind-1 >= 0) {
if (rowData[ind-1] != null) { anyExp = rowData[ind-1]; }
}
}
// do collapsing
if (anyExp != null) {
if (typeof(anyExp) != "object") {
if (this.polyObj[anyExp]._collapsed == true) {
this.polyObj[anyExp].childNodes[0].childNodes[1].style.display = "";
this.polyObj[anyExp]._collapsed = false;
this.polyObj[anyExp].childNodes[0].childNodes[0].className = "dhtmlxPolyInfoBar";
this.polyObj[anyExp].childNodes[0].childNodes[0].childNodes[1].style.display = "";
this.polyObj[anyExp].childNodes[0].childNodes[0].childNodes[4].title = "Collapse";
this.polyObj[anyExp].childNodes[0].childNodes[0].childNodes[2].style.display = "";
this.polyObj[anyExp].childNodes[0].childNodes[0].childNodes[3].style.display = "none";
this.polyObj[anyExp].childNodes[0].childNodes[0].childNodes[4].style.display = "";
//
// undock expanding window
/*
var wId = this.polyObj[anyExp].childNodes[0]._win;
var win = this.dhxWins.window(wId);
if (!win._isDocked) { this.dockWindow(anyExp, wId); }
*/
// dock undocked window
if (this.polyObj[anyExp]._isUnDocked === true) { this.dockWindow(anyExp); }
//
// console.log("need to undock "+this.polyObj[anyExp].childNodes[0]._win)
//
// tabbar special mode
if (this.polyObj[anyExp].className == "dhtmlxLayoutSinglePolyTabbarCollapsed") {
this.polyObj[anyExp].className = "dhtmlxLayoutSinglePolyTabbar";
}
// show/hide splitter images
this._fixSplitters();
// check icons
this._fixIcons();
// event
this.callEvent("onExpand", [anyExp]);
}
anyExp = new Array(anyExp);
}
var obj2 = new Array();
for (var q=0; q maxSize) { newS = maxSize; }
//
if (dir == "hor") {
obj.style.width = newS+"px";
obj.childNodes[0].style.width = obj.style.width;
// obj.childNodes[1].style.width = newS+"px";
} else {
obj.style.height = newS+"px";
obj.childNodes[0].style.height = obj.style.height;
// obj.childNodes[1].style.height = newS-obj.childNodes[0]._h+"px";
}
obj.adjustContent(obj.childNodes[0], (obj._noHeader?0:this.skinParams[this.skin]["cpanel_height"]));
//
for (var q=0; q this._collapsedW && dir == "hor") || (newS > this._collapsedH && dir == "ver")) {
window.setTimeout(function(){that._collapseEffect(obj, obj2, mode, step, dir);}, 4);
} else {
for (var q=0; q sumSize - this._minWidth) { width = sumSize - this._minWidth; }
var width2 = sumSize - width;
//
for (var q=0; q sumSize - this._minHeight) { height = sumSize - this._minHeight; }
var height2 = sumSize - height;
//
for (var q=0; q= 1) {
// to the left
for (var q=idx-1; q>=0; q--) {
if (typeof(data[q]) == "object") {
newIcon = (this.polyObj[a]._resize=="ver"?(cps?"t":"b"):(cps?"l":"r"));
} else if (this.polyObj[data[q]]._collapsed == false) {
newIcon = (this.polyObj[a]._resize=="ver"?(cps?"t":"b"):(cps?"l":"r"));
}
}
}
}
// 3. update icon
if (newIcon != null) {
var dir = this.polyObj[a]._resize;
this.polyObj[a].childNodes[0].childNodes[0].childNodes[4].className = "dhtmlxInfoButtonShowHide_"+dir+" dhxLayoutButton_"+this.skin+"_"+dir+(this.polyObj[a]._collapsed?"2":"1")+newIcon;
}
}
}
/* RESIZE IN WINDOWS */
this._defineWindowMinDimension = function(win, inLayout) {
if (inLayout == true) {
var dim = new Array();
dim[0] = parseInt(win.style.width);
dim[1] = parseInt(win.style.height);
} else {
var dim = win.getDimension();
if (dim[0] == "100%") { dim[0] = win.offsetWidth; }
if (dim[1] == "100%") { dim[1] = win.offsetHeight; }
}
// console.log("dim",dim)
// getting cells which will touched by resize
var hor = that._getNearestParents("hor");
var ver = that._getNearestParents("ver");
// console.log(hor,ver)
//
if (!inLayout) {
// window-based init, checking cells if any layout attached
var resH = new Array();
var resV = new Array();
for (var a in hor) { resH[resH.length] = a; }
for (var a in ver) { resV[resV.length] = a; }
that._checkAlterMinSize(new Array(resH, resV));
// calculating new avail width/height
var hor2 = {};
var ver2 = {};
for (var q=0; q hor2[a]) { hor2[a] = w; } }
if (ver2[a] == null) { ver2[a] = h; } else { if (h > ver2[a]) { ver2[a] = h; } }
}
for (var a in hor) { if (hor2[a] != null) { hor[a] = hor[a]-hor2[a]+that._minWidth; } }
for (var a in ver) { if (ver2[a] != null) { ver[a] = ver[a]-ver2[a]+that._minHeight-(that.polyObj[a].childNodes[0].style.display!="none"?that.skinParams[that.skin]["cpanel_height"]:0); } }
// console.log("1>", resH, hor, hor2)
}
// 1. detect available minimal width
var minWidth = 65536;
for (var a in hor) { if (hor[a] < minWidth) { minWidth = hor[a]; } }
// console.log(minWidth)
minWidth = minWidth - that._minWidth;
minWidth = dim[0] - minWidth;
if (minWidth < that._dimension[0] && !inLayout) { minWidth = that._dimension[0]; }
// 2. detect available minimal height
var minHeight = 65536;
for (var a in ver) { if (ver[a] < minHeight) { minHeight = ver[a]; } }
minHeight = minHeight - that._minHeight;
minHeight = dim[1] - minHeight;
if (minHeight < that._dimension[1] && !inLayout) { minHeight = that._dimension[1]; }
// 3. set min dimension to window
// console.log(minWidth, minHeight)
if (inLayout == true) {
return new Array("", minWidth, minHeight);
} else {
win.setMinDimension(minWidth, minHeight);
}
}
this._getNearestParents = function(resize) {
var data = (resize=="hor"?this._autoHor:this._autoVer);
var pool = {};
for (var q=0; q 0) { for (var w=e-1; w>=0; w--) { if (typeof(rowData[w]) == "object") { id = rowData[w]; } else { if (this.polyObj[rowData[w]]._collapsed == false && id == null) { id = rowData[w]; } } } }
if (id == null) { for (var w=r; w 0) bar.removeChild(bar.childNodes[0]);
bar.parentNode.removeChild(bar);
// cell's content
p._dhxContDestruct();
p._dhxContDestruct = null;
p.childNodes[0].removeChild(p.childNodes[0].childNodes[0]);
p.removeChild(p.childNodes[0]);
p.parentNode.removeChild(p);
p = null;
}
for (var a in this.polyObj) this.polyObj[a] = null;
for (var q=0; q 0) {
while (t.childNodes[0].childNodes.length > 0) {
var r = t.childNodes[0].childNodes[0]; // sep's td
r._top = null;
r._bottom = null;
r._left = null;
r._right = null;
r._dblClick = null;
r._isSep = null;
r._dir = null;
r.ondblclick = null;
r.onmousedown = null;
r.onmouseup = null;
r.onselectstart = null;
while (r.childNodes.length > 0) r.removeChild(r.childNodes[0]);
r.parentNode.removeChild(r);
r = null;
}
t.removeChild(t.childNodes[0]);
}
t.parentNode.removeChild(t);
t = null;
this.tpl.parentNode.removeChild(this.tpl);
this.tpl = null;
for (var a in this.sepHor) this.sepHor[a] = null;
for (var a in this.sepVer) this.sepVer[a] = null;
this.sepHor = null;
this.sepVer = null;
// clear data
this._autoHor = null;
this._autoVer = null;
this._availAutoSize = null;
this._dimension = null;
this._effects = null;
this._layoutView = null;
this._mBottom = null;
this._mTop = null;
this._minWidth = null;
this._minHeight = null;
this._resFunc = null;
this._resObj = null;
this._resX = null;
this._resY = null;
this._rowsRatio = null;
this._totalCols = null;
this._totalRows = null;
this._xmlLoader = null;
this.w = null;
this.h = null;
this.imagePath = null;
this.skin = null;
this.skinParams = null;
this.tplData = null;
this.tplSizes = null;
/*
// will unload with container
if (this.menu) this.menu.unload();
if (this.toolbar) this.toolbar.unload();
if (this.statusbar) this.statusbar.unload();
this.menu = null;
this.toolbar = null;
this.statusbar = null;
*/
if (this.sizer.parentNode) this.sizer.parentNode.removeChild(this.sizer);
this.sizer = null;
this._alterSizes = null;
this._attachSizer = null;
this._buildSurface = null;
this._changeCPanelText = null;
this._checkAlterMinSize = null;
this._collapse = null;
this._collapseEffect = null;
this._collectResAreaData = null;
this._defineWindowMinDimension = null;
this._doCollapse = null;
this._doExpand = null;
this._expand = null;
this._expandEffect = null;
this._findDockCellsHor = null;
this._findDockCellsVer = null;
this._fixIcons = null;
this._fixPositionInWin = null;
this._fixSize = null;
this._fixSplitters = null;
this._getNearestParents = null;
this._hideCovers = null;
this._init = null;
this._initWindows = null;
this._isCollapsed = null;
this._isResizable = null;
this._progressControl = null;
this._progressControlGlobal = null;
this._resizeHor = null;
this._resizeStop = null;
this._resizeVer = null;
this._resAreaData = null;
this._setH = null;
this._setHeight = null;
this._setW = null;
this._setWidth = null;
this._showCovers = null;
this._xmlParser = null;
this.attachEvent = null;
this.attachMenu = null;
this.attachStatusBar = null;
this.attachToolbar = null;
this.callEvent = null;
this.cells = null;
this.checkEvent = null;
this.detachEvent = null;
this.dockWindow = null;
this.eventCatcher = null;
this.forEachItem = null;
this.getEffect = null;
this.getIdByIndex = null;
this.getIndexById = null;
this.getText = null;
this.hidePanel = null;
this.isPanelVisible = null;
this.listAutoSizes = null;
this.listViews = null;
this.progressOff = null;
this.progressOn = null;
this.setAutoSize = null;
this.setEffect = null;
this.setImagePath = null;
this.setSizes = null;
this.setSkin = null;
this.setText = null;
this.showPanel = null;
this.unDockWindow = null;
this.unload = null;
this.updateNestedObjectsArray = null;
if (this.obj) {
this.obj.parentNode.removeChild(this.obj);
this.obj = null;
}
if (this.base) {
if (this.base == document.body) {
} else {
this.base.parentNode.removeChild(this.base);
this.base = null;
}
}
if (this.cont) {
this.cont.obj._dhxContDestruct();
this.cont.obj._dhxContDestruct = null;
if (this.cont.dhxcont.parentNode) this.cont.dhxcont.parentNode.removeChild(this.cont.dhxcont);
this.cont.dhxcont = null;
this.cont.setContent = null;
if (this.cont.obj.parentNode && removeParent === true) this.cont.obj.parentNode.removeChild(this.cont.obj);
this.cont.obj = null;
this.cont = null;
}
// windows if any
if (this.dhxWins) {
this.dhxWins.unload();
this.dhxWins = null;
}
// document.body init, remove events
if (this._doOnResizeStart) {
if (_isIE) { window.detachEvent("onresize", this._doOnResizeStart); } else { window.removeEventListener("resize", this._doOnResizeStart, false); }
this._doOnResizeStart = null;
this._doOnResizeEnd = null;
this._tmTime = null;
}
// remove body events
if (_isIE) {
document.body.detachEvent("onselectstart", this._doOnSelectStart);
document.body.detachEvent("onmousemove", this._doOnMouseMove);
document.body.detachEvent("onmouseup", this._doOnMouseUp);
} else {
document.body.removeEventListener("mousemove", this._doOnMouseMove, false);
document.body.removeEventListener("mouseup", this._doOnMouseUp, false);
}
this._doOnSelectStart = null;
this._doOnMouseMove = null;
this._doOnMouseUp = null;
// main link
that = null;
}
// templates
dhtmlXLayoutObject.prototype.tplData = {
"1C": ' |
',
"2E": ' |
|
|
',
"2U": ' | | |
',
// ---------------------------------------------------------------------------------------------------------------------------------------
"3E": ' |
|
|
|
|
',
"3W": ' | | | | |
',
"3J": ' | | |
|
|
',
"3T": ' |
|
| | |
',
"3L": ' | | |
|
|
',
"3U": ' | | |
|
|
',
// ---------------------------------------------------------------------------------------------------------------------------------------
"4H": ' | | | | |
|
|
',
"4I": ' |
|
| | |
|
|
',
"4T": ' |
|
| | | | |
',
"4U": ' | | | | |
|
|
',
// ---------------------------------------------------------------------------------------------------------------------------------------
"5H": ' | | | | |
|
|
|
|
',
"5I": ' |
|
| | | | |
|
|
',
// ---------------------------------------------------------------------------------------------------------------------------------------
"6I": ' |
|
| | | | | | |
|
|
'
};
// autosize data
dhtmlXLayoutObject.prototype._availAutoSize = {
"1C_hor": new Array("a"),
"1C_ver": new Array("a"),
"2E_hor": new Array("a;b"),
"2E_ver": new Array("a", "b"),
"2U_hor": new Array("a", "b"),
"2U_ver": new Array("a;b"),
"3E_hor": new Array("a;b;c"),
"3E_ver": new Array("a", "b", "c"),
"3W_hor": new Array("a", "b", "c"),
"3W_ver": new Array("a;b;c"),
"3J_hor": new Array("a;c", "b"),
"3J_ver": new Array("a;b", "c;b"),
"3T_hor": new Array("a;b", "a;c"),
"3T_ver": new Array("a", "b;c"),
"3L_hor": new Array("a", "b;c"),
"3L_ver": new Array("a;b", "a;c"),
"3U_hor": new Array("a;c", "b;c"),
"3U_ver": new Array("a;b", "c"),
"4H_hor": new Array("a", "b;c", "d"),
"4H_ver": new Array("a;b;d", "a;c;d"),
"4I_hor": new Array("a;b;d", "a;c;d"),
"4I_ver": new Array("a", "b;c", "d"),
"4T_hor": new Array("a;b", "a;c", "a;d"),
"4T_ver": new Array("a", "b;c;d"),
"4U_hor": new Array("a;d", "b;d", "c;d"),
"4U_ver": new Array("a;b;c", "d"),
"5H_hor": new Array("a", "b;c;d", "e"),
"5H_ver": new Array("a;b;e", "a;c;e", "a;d;e"),
"5I_hor": new Array("a;b;e", "a;c;e", "a;d;e"),
"5I_ver": new Array("a", "b;c;d", "e"),
"6I_hor": new Array("a;b;f", "a;c;f", "a;d;f", "a;e;f"),
"6I_ver": new Array("a", "b;c;d;e", "f")
};
// collapsed text
dhtmlXLayoutObject.prototype.setCollapsedText = function(cell, text) {
if (!this.polyObj[cell]) return;
var p;
var bar = dhxLayout.polyObj[cell].childNodes[0].childNodes[0];
if (bar.childNodes[bar.childNodes.length-1]._ct === true) {
var p = bar.childNodes[bar.childNodes.length-1];
} else {
var p = document.createElement("DIV");
p._ct = true;
p.className = "dhtmlxInfoBarLabel_collapsed_"+this.polyObj[cell]._resize;
bar.appendChild(p);
}
p.innerHTML = text;
bar = null;
};
dhtmlXLayoutObject.prototype._doOnAttachURL = function(id, addIFrameEvents) {
if (!addIFrameEvents) {
// just call onContentLoaded
this.callEvent("onContentLoaded", [id]);
return;
}
// attach events into iframe
var t = this;
var f = this.cells(id)._frame;
if (_isIE) {
f.onreadystatechange = function(a) {
if (f.readyState == "complete") try {t.callEvent("onContentLoaded",[id]);}catch(e){}
}
} else {
f.onload = function() {
t.callEvent("onContentLoaded",[id]);
}
}
};
//layout
(function(){
dhtmlx.extend_api("dhtmlXLayoutObject",{
_init:function(obj){
return [obj.parent, obj.pattern, obj.skin];
},
image_path:"setImagePath",
effect:"_effect",
cells:"_cells",
autosize:"_autosize"
},{
_cells:function(arr){
for (var q=0; q