/*
DynAPI Distribution
DynLayer NS4 Specific Functions
The DynAPI Distribution is distributed under the terms of the GNU LGPL license.
requires: dynapi.api.DynLayerBase
*/
p = DynLayer.prototype;
p._ns4IPad = ''; // used with blackboard
p._remove = function() {
if (this.elm) {
var p = this.parent;
if (p && this._alias) p[this._alias]=null;
if (!p.doc.recycled) p.doc.recycled=[];
p.doc.recycled[p.doc.recycled.length]=this.elm;
this.elm.visibility="hide";
this.elm = null;
if (this.releaseMouseEvents) this.releaseMouseEvents();
if (this.releaseKeyEvents) this.releaseKeyEvents();
}
/*this.frame = null;
this.bgImage = null;
this.bgColor = null;
this.html = null;
this.z = null;
this.w = null;
this.h = null;
this.elm = null;
this.doc = null;
this.css = null;*/
};
p._create = function() {
if (this.parent && !this.elm) {
DynElement._flagPreCreate(this);
var parentElement = this.parent.isClass('DynLayer')? this.parent.elm : this.parent.frame;
var elm = new Layer(this.w||0, parentElement);
if(this._className) elm.className=this._className; // does this work in ns4?
if(!this._noStyle) {
if (this.w) elm.clip.width = this.w+this._fixBw;
if (this.h) elm.clip.height = this.h+this._fixBh;
if (this.x && this.y) elm.moveTo(this.x,this.y);
else if (this.x) elm.left = this.x;
else if (this.y) elm.top = this.y;
if (this.bgColor!=null) elm.document.bgColor = this.bgColor;
if (this.clip) {
var c = elm.clip, cl = this.clip;
c.top=cl[0], c.right=cl[1], c.bottom=cl[2], c.left=cl[3];
}
if (this.z) elm.zIndex = this.z;
if (this.visible) elm.visibility = 'inherit';
}
if (this.children.length || (this.html!=null && this.html!='')) {
elm.document.write(this.getInnerHTML());
elm.document.close();
}
DynLayer._assignElement(this,elm);
DynElement._flagCreate(this);
}
};
DynLayer._getLayerById = function(id,pElm){
var i,lyrs,elm;
pElm = (pElm)? pElm:document;
lyrs = pElm.layers;
for (i=0;i, images, links, etc
}
dlyr.elm._dynobj = dlyr.doc._dynobj = dlyr;
dlyr._dyndoc = dlyr.parent._dyndoc;
if (dlyr.html!=null && dlyr.html!='' && (dlyr.w==null || dlyr.h==null)) {
var cw = (dlyr.w==null)? dlyr.getContentWidth() : null;
var ch = (dlyr.h==null)? dlyr.getContentHeight() : null;
//var cw = (dlyr.w==null)? dlyr.getElmWidth() : null;
//var ch = (dlyr.h==null)? dlyr.getElmHeight() : null;
dlyr.setSize(cw,ch);
}
if (dlyr.bgImage!=null) dlyr.setBgImage(dlyr.bgImage);
var i,ch=dlyr.children;
for (i=0;i'+this.getInnerHTML()+''+tag+'>';
else {
if (this.clip) clip=' clip="'+this.clip[3]+','+this.clip[0]+','+this.clip[1]+','+this.clip[2]+'"';
else clip=' clip="0,0,'+((this.w>=0)? this.w+fixBw:0)+','+((this.h>=0)? this.h+fixBh:0)+'"';
return [
'\n<'+tag+' ',this._cssClass,' id="'+this.id+'"',
' left=',(this.x!=null? this.x : 0),
' top=',(this.y!=null? this.y : 0),
((this.visible)? ' visibility="inherit"':' visibility="hide"'),
((this.w!=null)? ' width='+(this.w+fixBw):''),
((this.h!=null)? ' height='+(this.h+fixBw):''),
((this.z)? ' zindex='+this.z:''),
((this.bgColor!=null)? ' bgcolor="'+this.bgColor+'"':''),
((this.bgImage!=null)? ' background="'+this.bgImage+'"':''),
clip,'>',this.getInnerHTML(),''+tag+'>'
].join('');
}
};
p.getInnerHTML = function() {
var i,s = '',ch=this.children;
if (this.html!=null) {
if (this.w==null) s += ''+this.html+'';
else s+=this.html;
}
if (this._blkBoardElm) s=''+this._ns4IPad+s+'';
if(ch.length<50) for (i=0;ithis._maxW) w=this._maxW;
if (this._maxH && h>this._maxH) h=this._maxH;
}
var cw = (w!=null && w!=this.w);
var ch = (h!=null && h!=this.h);
if (cw) this.w = w<0? 0 : w;
if (ch) this.h = h<0? 0 : h;
if (cw||ch) {
if (this._hasAnchor) this.updateAnchor(); // update this anchor
if (this._hasChildAnchors) this._updateAnchors(); // update child anchors
if (this.css) {
if (cw) this.css.clip.width = (this.w || 0)+this._fixBw;
if (ch) this.css.clip.height = (this.h || 0)+this._fixBh;
// adjust parent size after being sized
if((cw||ch) && this.parent._aSz) this.parent._adjustSize();
if (this.updateLayout) this.updateLayout();
}
}
if(this._hasResizeEvents) this.invokeEvent('resize');
return (cw||ch);
};
p.setHTML=function(html) {
var ch = (html!=null && html!=this.html);
if (ch) {
this.html = html;
if (this.css) {
var i, doc = this.doc;
var html=(!this._blkBoardElm)? this.html:this._ns4IPad+this.html; // don't ask why! See HTMLContainer
doc.open(); doc.write(html); doc.close();
for (i=0;i