diff --git a/superx/WEB-INF/lib/superx6.0.jar b/superx/WEB-INF/lib/superx6.0.jar index e6b94c0..0e9ebbf 100644 Binary files a/superx/WEB-INF/lib/superx6.0.jar and b/superx/WEB-INF/lib/superx6.0.jar differ diff --git a/superx/style/superx.css b/superx/style/superx.css index 181b7cf..6efb11b 100644 --- a/superx/style/superx.css +++ b/superx/style/superx.css @@ -617,3 +617,71 @@ thead { top: 68px; } +/* Styles für Javascript Baum, z.B. GANG Studiengang-Menü: */ + + +ul, #treeUL { + list-style-type: none; +} + +#treeUL { + margin-left: 1em; + padding: 0; +} + +ul.treeChildUL +{ + padding-left:0.3em; +} + +.treeCaret { + cursor: pointer; + -webkit-user-select: none; /* Safari 3.1+ */ + -moz-user-select: none; /* Firefox 2+ */ + -ms-user-select: none; /* IE 10+ */ + user-select: none; +} + +.treeCaret::before { + content: "\25B6"; + color: #014A7B; + display: inline-block; + margin-right: 0px; +} + +.treeCaret-down::before { + -ms-transform: rotate(90deg); /* IE 9 */ + -webkit-transform: rotate(90deg); /* Safari */' + transform: rotate(90deg); +} + +.treeNested { + display: none; + margin-right: 0px; + padding-left: 13px; +} + +.treeActive { + display: block; + margin-right: 0px; + padding-left: 13px; + +} +.treeSpacer +{ +padding-left: 10px; +} +.treeLink +{ +text-decoration: none; /* keine Unterstreichung für links */ +list-style-type: none; +} +.treeLinkWithSpace +{ +text-decoration: none; /* keine Unterstreichung für links */ + margin-left:10px; + box-decoration-break: clone; + -webkit-box-decoration-break: clone; + list-style-type: none; +} + diff --git a/superx/xml/dynapi/api/dyndocument.js b/superx/xml/dynapi/api/dyndocument.js deleted file mode 100644 index 79c4bae..0000000 --- a/superx/xml/dynapi/api/dyndocument.js +++ /dev/null @@ -1,276 +0,0 @@ -/* - DynAPI Distribution - DynDocument Class - - The DynAPI Distribution is distributed under the terms of the GNU LGPL license. - - requires: dynapi.api.DynElement -*/ - -function DynDocument(frame) { - this.DynElement = DynElement; - this.DynElement(); - this.frame = frame; - this.doc = this.frame.document; - this._dyndoc = this; - this.x = 0; - this.y = 0; - this.w = 0; - this.h = 0; - this._topZIndex = 10000; - var o = this; - this.frame.onresize = function() {o._handleResize()}; - this.onResizeNS4 = "reload"; // or "redraw" - this._created = false; -}; -var p = dynapi.setPrototype('DynDocument','DynElement'); -p._remove = function() { - this.elm=null; - this.doc=null; - this.frame=null; -}; -p.getBgColor = function() { - return this.bgColor; -}; -p.getX = p.getY = p.getPageX = p.getPageY = dynapi.functions.Zero; -p.getWidth = function() { - if (!this.w) this.findDimensions(); - return this.w; -}; -p.getHeight = function() { - if (!this.h) this.findDimensions(); - return this.h; -}; -p.findDimensions = function() { - this.w=(dynapi.ua.ns||dynapi.ua.opera)? this.frame.innerWidth : this.elm.clientWidth; - this.h=(dynapi.ua.ns||dynapi.ua.opera)? this.frame.innerHeight : this.elm.clientHeight; -}; -p.setBgColor = function(color) { - if (color == null) color=''; - if (dynapi.ua.ns4 && color == '') color = '#ffffff'; - this.bgColor = color; - this.doc.bgColor = color; -}; -p.setFgColor = function(color) { - if (color == null) color=''; - if (dynapi.ua.ns4 && color == '') color='#ffffff'; - this.fgColor = color; - this.doc.fgColor = color; -}; -p.insertChild = function(c,pos,usebp) { // Blueprint Enabled - if (c && !c.isInline && c.parent == this) { - if(pos) c.setPosition(pos); - DynElement._flagPreCreate(c); - if(usebp) c.isInline=c._noInlineValues=true; - else { - this.doc.write(c.getOuterHTML()); - c._inserted = true; - } - } -}; -p.insertAllChildren = function(usebp,bpSrc) { // Blueprint Enabled - var i,c,str =['']; - var ch=this.children; - for(i=0;i<\/script>'); - } - else { - this.doc.write(str.join('\n')); - this.doc.close(); - } -}; - -p._create = function() { - var ua=dynapi.ua; - this._created = true; - if (ua.ns4) { - this.css = this.doc; - this.elm = this.doc; - } - else { - this.elm = this.frame.document.body; - this.css = this.frame.document.body.style; - if (ua.ie) { - this._overflow = this.css.overflow || ''; - } - if (this._cursor) this.css.cursor = this._cursor; - } - this.elm._dynobj = this; - this.doc._dynobj = this; // DynKeyEvent needs this! - this.findDimensions(); - - this.fgColor = this.doc.fgColor||''; - this.bgColor = this.doc.bgColor||''; - - var divs; - // create divs object - speeds up DOM browsers on Win32. Linux & Mac? - if (ua.ie||ua.dom) { - divs={}; - var dv,all=(ua.ie||ua.opera)? document.all.tags('div') : document.getElementsByTagName('div'); - var i=0,l=all.length; // very important! - while (i'; - if(!this._created) hbuf[cnt]=html; - else { - elm=new Layer(0,this.frame); - elm.left=elm.top=0; - var doc=elm.document; - elm.clip.width=dynapi.document.w; - elm.clip.height=dynapi.document.h; - doc.open();doc.write(html);doc.close(); - elm.visibility = 'inherit'; - } - } - else { - var pelm=this.elm; - if(!this._created) hbuf[cnt]=html; - else { - if(ua.ie){ - pelm.insertAdjacentHTML("beforeEnd",html); - elm = pelm.children[pelm.children.length-1]; - } - else{ - var r = pelm.ownerDocument.createRange(); - r.setStartBefore(pelm); - var ptxt = r.createContextualFragment(html); - pelm.appendChild(ptxt); - elm = pelm.lastChild; - } - } - } -}; - -function main() { - if (dynapi.document==null) { - dynapi.document = new DynDocument(dynapi.frame); - if (dynapi.loaded) dynapi.document._create(); - else dynapi.onLoad(function() { - dynapi.document._create(); - }); - } -}; -if (!dynapi.loaded) main(); - diff --git a/superx/xml/dynapi/api/dynlayer_base.js b/superx/xml/dynapi/api/dynlayer_base.js deleted file mode 100644 index 62dc426..0000000 --- a/superx/xml/dynapi/api/dynlayer_base.js +++ /dev/null @@ -1,396 +0,0 @@ -/* - DynAPI Distribution - DynLayer Base/Common Class - - The DynAPI Distribution is distributed under the terms of the GNU LGPL license. - - requires: dynapi.api.DynDocument -*/ - -var DynLayerBase = {}; // used by library -function DynLayer(html,x,y,w,h,color,image) { - this.DynElement = DynElement; - this.DynElement(); - - if (html && typeof(html)=='object'){ // typeof more stable than constructor when creating layers from another frame - var args=html; // dictionary input - html=args.html; - x = args.x; - y = args.y; - w = args.w; - h = args.h; - color = args.color; - image = args.image; - this.z = (args.zIndex||1); - this._saveAnchor = args.anchor; - this.visible = (args.visible==false)? false:true; - this._textSelectable = (args.textSelectable==false)?false:true; - if (args.id) this.setID(args.id,true); - } - else { - this.visible = true; - this.z = 1; - this._saveAnchor = false; - this._textSelectable = true; - } - - this.x = x||0; - this.y = y||0; - this.w = w; - this.h = h; - this.bgColor = color; - this.bgImage = image; - this.html = (html!=null)? html+'':null; // convert html to string - this.elm = null; - this.doc = null; - this.css = null; -}; -var p = dynapi.setPrototype('DynLayer','DynElement'); -p._cssBorder = ''; -p._fixBw = 0; -p._fixBh = 0; -p._adjustSize=function(){ - var aw=this._aSzW; - var ah=this._aSzH; - if(this._created && (aw||ah)) { - var i,c,w=0,h=0; - // get furthest child - for (i=0;i'+this.getInnerHTML()+''; - else { - var s,clip='',bgimage=' background-image:none;'; - if(this.bgImage!=null) bgimage=' background-image:url('+this.bgImage+');'; - if (this.clip) clip=' clip:rect('+this.clip[0]+'px '+this.clip[1]+'px '+this.clip[2]+'px '+this.clip[3]+'px);'; - else if (this.w!=null && this.h!=null) clip=' clip:rect(0px '+(this.w+fixBw)+'px '+(this.h+fixBh)+'px 0px);'; - // modify box fix values - if (!dynapi.ua.ie && !dynapi.ua.opera) fixBw = 0; - if (!dynapi.ua.ie) fixBh = 0; - return [ - '\n
', - this.getInnerHTML(), - '
' - ].join(''); - } -}; -p.getInnerHTML=function() { //! Overwritten by NS4 - var s = ''; - var i,ch=this.children; - if (this.html!=null) s+=this.html; - if (this._blkBoardElm) s=('
'+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.width = this.w||0; - if (ch) this.css.height = this.h||0; - if (cw || ch) { - if(this._needBoxFix) BorderManager.FixBoxModel(this,true); - else this.css.clip = 'rect(0px '+(this.w||0)+'px '+(this.h||0)+'px 0px)'; - // adjust parent size after being sized - if(this.parent._aSz) this.parent._adjustSize(); - } - if (this.updateLayout) this.updateLayout(); // what's this? - } - } - if(this._hasResizeEvents) this.invokeEvent('resize'); - return (cw||ch); -}; -p.setMaximumSize = function(w,h){ - this._maxW=w; this._maxH=h; - this._useMaxSize=(w!=h!=null); - w=(this.w>w)?w:this.w; - h=(this.h>h)? h:this.h; - this.setSize(this.w,this.h); -}; -p.setMinimumSize = function(w,h){ - this._minW=w; this._minH=h; - this._useMinSize=(w!=h!=null); - this.setSize(this.w,this.h); -}; - -p._position = 'absolute'; -p._cssPosition = ' position:absolute'; -p.setPosition = function(p){ - if(p!='relative' && p!='fixed' && p!='absolute') p='absolute'; - this._position=p; - if (this.css) this.css.position=p; - else this._cssPosition = ' position:'+p; -}; - -p._overflow='hidden'; -p._cssOverflow =' overflow:hidden;'; -p.getOverflow = function(){return this._overflow}; -p.setOverflow = function(s){ - if(!s) s='default'; - this._overflow=s; - if(this.css) this.css.overflow=s; - else this._cssOverflow=' overflow:'+s+';'; -}; - -p.getAnchor = function(){ - if(!this.parent) return this._saveAnchors; - else if (this.parent._childAnchors) { - return this.parent._childAnchors[this.id]; - } -}; -p.setAnchor = function(anchor) { - if (anchor == null) { - delete this._saveAnchor; - if (this.parent && this.parent._childAnchors && this.parent._childAnchors[this.id]) delete this.parent._childAnchors[this.id]; - this._hasAnchor = false; - } - else if (this.parent) { - if (!this.parent._childAnchors) this.parent._childAnchors = {}; - var a = this.parent._childAnchors; - a[this.id] = anchor; - this.parent._updateAnchor(this.id); - this._hasAnchor = this.parent._hasChildAnchors = true; - } - else this._saveAnchor = anchor; -}; -p.setX=function(x) {this.setLocation(x,null)}; -p.setY=function(y) {this.setLocation(null,y)}; -p.getX=function() {return this.x||0}; -p.getY=function() {return this.y||0}; -p.setPageX = function(x) {this.setPageLocation(x,null)}; -p.setPageY = function(y) {this.setPageLocation(null,y)}; -p.getVisible=function() {return this.visible}; -p.getZIndex=function() {return this.z}; -p.setZIndex=function(z) { - if (typeof(z)=="object") { - if (z.above) this.z = z.above.z + 1; - else if (z.below) this.z = z.below.z - 1; - else if (z.topmost && !this.parent) this.z = (DynLayer._z)? (DynLayer._z++):(DynLayer._z=1000); - else if (z.topmost) { - var topZ=10000,ch=this.parent.children; - for(var i=0;itopZ) topZ=ch[i].z; - this.parent._topZ = topZ+2; - this.z = this.parent._topZ; - } - } - else this.z = z; - if (this.css) this.css.zIndex = this.z; -}; -p.getHTML = function() {return this.html}; -p.setWidth=function(w) {this.setSize(w,null)}; -p.setHeight=function(h) {this.setSize(null,h)}; -p.getWidth=function() {return this.w||0}; -p.getHeight=function() {return this.h||0}; -p.getBgImage=function() {return this.bgImage}; -p.getBgColor=function() {return this.bgColor}; -p.setBgColor=function(c) { //! Overwritten by NS4 - if (c==null) c = 'transparent'; - this.bgColor = c; - if (this.css) this.css.backgroundColor = c; -}; -p.setBgImage=function(path) { //! Overwritten by NS4 - this.bgImage=path; - if (this.css) this.css.backgroundImage='url('+path+')'; -}; -p.setClip=function(clip) { //! Overwritten by NS4 - var cc=this.getClip(); - for (var i=0;i-1) { - c=c.split("rect(")[1].split(")")[0]; - c=c.replace(/(\D+)/g,',').split(","); - for (var i=0;i'+h+''); - elm.appendChild(ptxt); - this._blkBoardElm = elm.lastChild; - } -}; -p.setLocation=function(x,y) { - var cx = (x!=null && x!=this.x); - var cy = (y!=null && y!=this.y); - if (cx) this.x = x||0; - if (cy) this.y = y||0; - if (this.css!=null) { - if (cx) this.css.left = this.x+"px"; - if (cy) this.css.top = this.y+"px"; - // adjust parent size after being moved - if((cx||cy) && this.parent._aSz) this.parent._adjustSize(); - } - if(this._hasLocationEvents) this.invokeEvent('locationchange'); - return (cx||cy); -}; -p.setPageLocation = function(x,y) { - if (this.isChild) { - if (x!=null) x = x - this.parent.getPageX(); - if (y!=null) y = y - this.parent.getPageY(); - } - return this.setLocation(x,y); -}; -p.setHTML = function(html) { - if (html!=this.html) { - this.html = html; - if (this.css) { - var elm = (this._blkBoardElm)? this._blkBoardElm:this.elm; - elm.innerHTML = html; - var sTmp=(this.w==null)?''+this.html+'':this.html; - while (elm.hasChildNodes()) elm.removeChild(elm.firstChild); - var r=elm.ownerDocument.createRange(); - r.selectNodeContents(elm); - r.collapse(true); - var df=r.createContextualFragment(sTmp); - elm.appendChild(df); - this._adjustSize(); - } - } - if(this._hasContentEvents) this.invokeEvent('contentchange'); -}; -p.setTextSelectable=function(b) { - this._textSelectable = b; - if(!this._hasMouseEvents) this.captureMouseEvents(); - if (!b) this.setCursor('default'); -}; -p.getCursor = function() {return (this._cursor=='pointer')? 'hand':this._cursor}; -p.setCursor = function(c) { - if (!c) c = 'default'; - else c=(c+'').toLowerCase(); - if (c=='hand') c='pointer'; - if (this._cursor!=c) { - this._cursor = c; - if (this.css) this.css.cursor = c; - } -}; -p.getContentWidth=function() { - if (this.elm==null) return 0; - else { - var p = this.parent; - var tw = this.elm.style.width; - this.css.width = "auto"; - var w = this.elm.offsetWidth; - this.css.width = tw; - return w; - }; -}; -p.getContentHeight=function() { - if (this.elm==null) return 0; - else { - var th = this.css.height; - this.elm.style.height = "auto"; - var h = this.elm.offsetHeight; - this.css.height = th; - return h; - } -}; diff --git a/superx/xml/dynapi/api/dynlayer_ie.js b/superx/xml/dynapi/api/dynlayer_ie.js deleted file mode 100644 index b6e2c41..0000000 --- a/superx/xml/dynapi/api/dynlayer_ie.js +++ /dev/null @@ -1,180 +0,0 @@ -/* - DynAPI Distribution - DynLayer IE Specific Functions - - The DynAPI Distribution is distributed under the terms of the GNU LGPL license. - - requires: dynapi.api.DynLayerBase -*/ - -p = DynLayer.prototype; -p._create = function() { - if (this.parent && !this.elm) { - DynElement._flagPreCreate(this); - var elm, parentElement; - parentElement = this.parent.elm; - if(dynapi.ua.v<5){ - parentElement.insertAdjacentHTML("beforeEnd",this.getOuterHTML()); - elm = parentElement.children[parentElement.children.length-1]; - } - else { - // this method is more efficient for ie5+. any comment? - elm=document.createElement('DIV'); - elm.id=this.id; - if(this._className) elm.className=this._className; - if(!this._noStyle) { - var css = elm.style; - css.position=(this._position||'absolute'); - css.pixelLeft=(this.x||0); - css.pixelTop=(this.y||0); - if(this.w!=null) css.width = this.w; - if(this.h!=null) css.height = this.h; - css.backgroundColor=(this.bgColor||'transparent'); - css.zIndex=(this.z||1); - css.cursor=(this._cursor||'auto'); - css.overflow=(this._overflow||''); - if(this.bgImage!=null) css.backgroundImage='url('+this.bgImage+')'; - if (this.bgImage==null && this.html==null) css.backgroundImage='none'; - if (this.clip) css.clip='rect('+this.clip[0]+'px '+this.clip[1]+'px '+this.clip[2]+'px '+this.clip[3]+'px)'; - else if (this.w!=null && this.h!=null) css.clip='rect(0px '+this.w+'px '+this.h+'px 0px)'; - css.visibility=(this.visible==false)? 'hidden':'inherit'; - // border - set by BorderManager - if(this._cssBorTop){ - css.borderTop = this._cssBorTop||''; - css.borderRight = this._cssBorRight||''; - css.borderBottom = this._cssBorBottom||''; - css.borderLeft = this._cssBorLeft||''; - } - } - elm.innerHTML = this.getInnerHTML(); - parentElement.appendChild(elm); - } - DynLayer._assignElement(this,elm); - DynElement._flagCreate(this); - } -}; -DynLayer._assignElement = function(dlyr,elm,divs) { - if (!elm ) { - elm = (divs)? divs[dlyr.id] : dlyr.parent.elm.all[dlyr.id]; - if (!elm){ - if(dlyr.isInline) dlyr._create(); // force create() for missing inline layer - return; - } - } - dlyr.elm = elm; - dlyr.css = elm.style; - dlyr.doc = dlyr.parent.doc; - dlyr.elm._dynobj = dlyr; - dlyr._dyndoc = dlyr.parent._dyndoc; - if(dlyr._blkBoardElm) dlyr._blkBoardElm = (divs)? divs[dlyr.id+'_blkboard'] : dlyr.parent.elm.all[dlyr.id+'_blkboard']; - - 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; - dlyr.setSize(cw,ch); - } - - var i,ch=dlyr.children; - for (i=0;i'+h+''); - this._blkBoardElm = elm.children[elm.children.length-1]; - } -}; -p.setLocation=function(x,y) { - var cx = (x!=null && x!=this.x); - var cy = (y!=null && y!=this.y); - if (cx) this.x = x||0; - if (cy) this.y = y||0; - if (this.css!=null) { - if (cx) this.css.pixelLeft = this.x; - if (cy) this.css.pixelTop = this.y; - // adjust parent size after being moved - if((cx||cy) && this.parent._aSz) this.parent._adjustSize(); - } - if(this._hasLocationEvents) this.invokeEvent('locationchange'); - return (cx||cy); -}; -// this method was breaking in IE saying cx was not defined. -// fixed by davesag 21.jan.2004 -p.setPageLocation = function(x,y) { - var cx = (x!=null && x!=this.x); - var cy = (y!=null && y!=this.y); - if (cx) this.x = x||0; - if (cy) this.y = y||0; - if (this.css!=null) { - if (this.isChild) { - if (dynapi.ua.v>=5) { - if (cx) this.css.pixelLeft = this.x; - if (cy) this.css.pixelTop = this.y; - } - else { - if (cx) this.css.left = this.x+"px"; - if (cy) this.css.top = this.y+"px"; - } - } - } - return this.setLocation(x,y); -}; -p.setHTML = function(html) { - if (html!=this.html) { - this.html = html; - if (this.css) { - var elm = (this._blkBoardElm)? this._blkBoardElm:this.elm; - elm.innerHTML = html; - this._adjustSize(); - } - } - if(this._hasContentEvents) this.invokeEvent('contentchange'); -}; -p.setTextSelectable=function(b) { - this._textSelectable = b; - if (this.elm) this.elm.onselectstart = b? dynapi.functions.Allow : dynapi.functions.Deny; - if (!b) this.setCursor('default'); - // && this.captureMouseEvents && !this._hasMouseEvents) this.captureMouseEvents(); -}; -p.getCursor = function() {return this._cursor}; -p.setCursor = function(c) { - if (!c) c = 'default'; - else c=(c+'').toLowerCase(); - if (this._cursor!=c) { - this._cursor = c; - if (this.css) this.css.cursor = c; - } -}; -p.getContentWidth=function() { - if (this.elm==null) return 0; - else { - var w,tw = this.css.width; - this.css.width='auto'; // force ie to get width - if (dynapi.ua.platform=="mac") w = this.elm.offsetWidth; - else w = parseInt(this.elm.scrollWidth); - this.css.width=tw; - return w; - }; -}; -p.getContentHeight=function() { - if (this.elm==null) return 0; - else { - if (dynapi.ua.platform=="mac") return this.elm.offsetHeight; - return parseInt(this.elm.scrollHeight); - - } -}; diff --git a/superx/xml/dynapi/api/dynlayer_ns4.js b/superx/xml/dynapi/api/dynlayer_ns4.js deleted file mode 100644 index 7fe718f..0000000 --- a/superx/xml/dynapi/api/dynlayer_ns4.js +++ /dev/null @@ -1,308 +0,0 @@ -/* - 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()+''; - 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(),'' - ].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'+h+''); - this._blkBoardElm = elm.children[elm.children.length-1]; - } -}; -p.setLocation=function(x,y) { - var cx = (x!=null && x!=this.x); - var cy = (y!=null && y!=this.y); - if (cx) this.x = x||0; - if (cy) this.y = y||0; - if (this.css!=null) { - if (cx) this.css.pixelLeft = this.x; - if (cy) this.css.pixelTop = this.y; - // adjust parent size after being sized - if((cx||cy) && this.parent._aSz) this.parent._adjustSize(); - } - if(this._hasLocationEvents) this.invokeEvent('locationchange'); - return (cx||cy); -}; -p.setPageLocation = function(x,y) { - if (this.isChild) { - if (dynapi.ua.v>=5) { - if (cx) this.css.pixelLeft = this.x; - if (cy) this.css.pixelTop = this.y; - } - else { - if (cx) this.css.left = this.x+"px"; - if (cy) this.css.top = this.y+"px"; - } - } - return this.setLocation(x,y); -}; -p.setHTML = function(html) { - if (html!=this.html) { - this.html = html; - if (this.css) { - var elm = (this._blkBoardElm)? this._blkBoardElm:this.elm; - elm.innerHTML = html; - this._adjustSize(); - } - } - if(this._hasContentEvents) this.invokeEvent('contentchange'); -}; -p.setTextSelectable=function(b) { - this._textSelectable = b; - if (this.elm) this.elm.onselectstart = b? dynapi.functions.Allow : dynapi.functions.Deny; - if (!b) this.setCursor('default'); - // && this.captureMouseEvents && !this._hasMouseEvents) this.captureMouseEvents(); -}; -p.getCursor = function() {return this._cursor}; -p.setCursor = function(c) { - if (!c) c = 'default'; - else c=(c+'').toLowerCase(); - if (this._cursor!=c) { - this._cursor = c; - if (this.css) this.css.cursor = c; - } -}; -p.getContentWidth=function() { - if (this.elm==null) return 0; - else { - var tw=this.css.width; - var w,to = this.css.overflow; - this.css.width='auto'; - this.css.overflow='auto'; - w = parseInt(this.elm.scrollWidth); - this.css.width=tw; - this.css.overflow=to; - return w; - - }; -}; -p.getContentHeight=function() { - if (this.elm==null) return 0; - else { - if (dynapi.ua.platform=="mac") return this.elm.offsetHeight; - return parseInt(this.elm.scrollHeight); - } -}; diff --git a/superx/xml/dynapi/api/event.js b/superx/xml/dynapi/api/event.js deleted file mode 100644 index 2de9371..0000000 --- a/superx/xml/dynapi/api/event.js +++ /dev/null @@ -1,348 +0,0 @@ -/* - DynAPI Distribution - DynEvent, EventObject, DynElement Classes - - The DynAPI Distribution is distributed under the terms of the GNU LGPL license. -*/ - -function DynEvent(type,src) { - this.type = type; - this.src = src; - this.origin = src; - this.propagate = true; - this.bubble = false; - this.bubbleChild = null; - this.defaultValue = true; -}; -var p = DynEvent.prototype; -p.getType = function() {return this.type}; -p.getSource = function() {return this.src}; -p.getOrigin=function() {return this.origin}; -p.stopPropagation = function() {this.propagate = false}; -p.preventBubble = function() {this.bubble = false}; -p.preventDefault = function() {this.defaultValue = false}; -p.getBubbleChild = function() {return this.bubbleChild}; - -function EventObject() { - this.DynObject = DynObject; - this.DynObject(); - this._listeners = []; -}; -EventObject._SubClass={}; - -p = dynapi.setPrototype('EventObject','DynObject'); -p.addEventListener = function(el) { - if (el) { - for (var i=0;i=ch.length) break; - } - }; - ch.length = 0; - this._aSz = aSz; - if(this._aSz) this._adjustSize(); // adjust size if necessary -}; -p.deleteChild = function(c) { // removes & destroy child - var l = this.children.length; - for (var i=0;i0 && a.left && typeof(a.left)=='string')? tw*(parseInt(a.left)/100):a.left; - var aright=(tw>0 && a.right && typeof(a.right)=='string')? tw*(parseInt(a.right)/100):a.right; - var atop=(th>0 && a.top && typeof(a.top)=='string')? th*(parseInt(a.top)/100):a.top; - var abottom=(th>0 && a.bottom && typeof(a.bottom)=='string')? th*(parseInt(a.bottom)/100):a.bottom; - var x = aleft; - var y = atop; - var w = null; - var h = null; - var dlyrWidth=dlyr.getWidth(); - var dlyrHeight=dlyr.getHeight(); - if (a.stretchH!=null) { - if(typeof(a.stretchH)!='string') w=a.stretchH; - else { - if(a.stretchH=='*') w = tw - ((aleft!=null)? aleft:0); - else w = tw*(parseInt(a.stretchH)/100); - } - dlyrWidth=w; - } - if (a.centerH!=null) { - x = Math.ceil(tw/2 - dlyrWidth/2 + a.centerH); - }else if (aright!=null) { - if (aleft!=null) w = (tw - aright) - aleft; - else x = (tw - dlyrWidth) - aright; - if(tw<=0 && x<0) x=null; // ns4 needs x>=0 - } - if (a.stretchV!=null) { - if(typeof(a.stretchV)!='string') h=a.stretchV; - else { - if(a.stretchV=='*') h = th - ((atop!=null)? atop:0); - else h = th*(parseInt(a.stretchV)/100); - } - dlyrHeight=h; - } - if (a.centerV!=null) { - y = Math.ceil(th/2 - dlyrHeight/2 + a.centerV); - }else if (abottom!=null) { - if (atop!=null) h = (th - abottom) - atop; - else y = (th - dlyrHeight) - abottom; - if(th<=0 && y<0) y=null; // ns4 needs y>=0 - } - if(padX) {x=(x)? x:0;x+=padX} - if(padY) {y=(y)? y:0;y+=padY} - - var tmp=dlyr._hasAnchor; - dlyr._hasAnchor=false; // ignore anchor updates of this layer - if(x!=null||y!=null) dlyr.setLocation(x,y); - if(w!=null||h!=null) dlyr.setSize(w,h); - dlyr._hasAnchor = tmp; // useful for preventing stack overflow -}; -p._updateAnchors = function() { - var tw = this.w; - var th = this.h; - if (tw==null && th==null) return; - for (id in this._childAnchors) this._updateAnchor(id); -}; - - -// Bandwidth timer stop -var ua=dynapi.ua; ua._bwe=new Date; -ua.broadband=((ua._bwe-ua._bws)<=1500)? true:false; diff --git a/superx/xml/dynapi/api/ext/dragevent.js b/superx/xml/dynapi/api/ext/dragevent.js deleted file mode 100644 index 7f3f2cb..0000000 --- a/superx/xml/dynapi/api/ext/dragevent.js +++ /dev/null @@ -1,306 +0,0 @@ -/* - DynAPI Distribution - DragEvent Class - - The DynAPI Distribution is distributed under the terms of the GNU LGPL license. -*/ - -// DragEvent object -function DragEvent(type,src) { - this.MouseEvent = MouseEvent; - this.MouseEvent(); - this.DynEvent(); - this.isDragging = false; -}; -var p = dynapi.setPrototype('DragEvent','MouseEvent'); -p.getX=function() {return this.x}; -p.getY=function() {return this.y}; -p.getPageX=function() {return this.pageX}; -p.getPageY=function() {return this.pageY}; -p.cancelDrag=function() {this.isDragging=false}; - -//DragEvent.dragPlay=0; - -DragEvent.dragevent = new DragEvent(); - -DragEvent.lyrListener = { - onmousedown : function(e) { - var ic,o = e.getSource(); - //setup drag icon - if(o._useDragIcon && o._dragIcon) { - ic=o._dragIcon; - ic._dragOrg = o; - ic.setLocation(o.getPageX(),o.getPageY()); - ic.setSize(o.w,o.h); - // if icon is fixed width then center at pointer - if(ic.w!=o.w||ic.h!=o.h) ic.setLocation(e.getPageX()-(ic.w/2),e.getPageY()-(ic.h/2)); - } - DragEvent.startDrag(e,ic); - //e.preventDefault(); - } -}; - -DragEvent.startDrag = function(e,dlyr) { - var origdlyr = dlyr; - if (!dlyr) dlyr = e.getSource(); - - if (dynapi.ua.dom) { - dlyr.elm.ondragstart = function() { return false; }; - dlyr.elm.onselectstart = function() { return false; }; - } - - // Initialize dragEvent object - var de=DragEvent.dragevent; - //de.bubble = true; - de.src = dlyr; - de.origin = (origdlyr)? e.origin : dlyr; - de.x = e.getPageX()-dlyr.getPageX(); - de.y = e.getPageY()-dlyr.getPageY(); - de.pageX = e.getPageX(); - de.pageY = e.getPageY(); - de.parentPageX = dlyr.parent.getPageX(); - de.parentPageY = dlyr.parent.getPageY(); - de._mouseEvent = e._mouseEvent; - de._browserEvent = e._browserEvent; // ns4 only - - de.isDragging = true; - - e.preventDefault(); - e.preventBubble(); - - //dlyr._dyndoc.addEventListener(DragEvent.docListener); - - dlyr.invokeEvent("dragstart",de); - if(dlyr._dragOrg) { - dlyr.setVisible(true); - dlyr._dragOrg.invokeEvent("dragstart",e); - } -}; - -DragEvent.docListener = { - onmousemove : function(e) { - //var x = e.getPageX(); - //var y = e.getPageY(); - //dynapi.debug.status('drag move '+e.x+' '+e.y); - - var de = DragEvent.dragevent; - if (de && de.isDragging) { - - - var lyr = de.src; - if (!lyr) return; - - // DS: what is this? - // Detect if we should start the drag - /*if(DragEvent.dragPlay==0 || (Math.abs(de.pageX-e.getPageX())-DragEvent.dragPlay>0) || (Math.abs(de.pageY-e.getPageY())-DragEvent.dragPlay>0)) { - de.isDragging=true; - de.src.invokeEvent("dragstart",de); - e.setBubble(de.bubble); - } - */ - /*else if (!de.dragEnabled) { - // This allows 'cancelDrag' method to fire the mouseUp as if had been released by the user - lyr.invokeEvent("mouseup"); - return; - }*/ - - // Properties - de.type="dragmove"; - de.pageX=e.getPageX(); - de.pageY=e.getPageY(); - de._mouseEvent = e._mouseEvent; - de._browserEvent = e._browserEvent; // ns4 only - - /*if (DragEvent.stopAtDocumentEdge) { - if (de.pageX<0) de.pageX = 0; - if (de.pageY<0) de.pageY = 0; - if (de.pageX>DynAPI.document.w) de.pageX = DynAPI.document.w; - if (de.pageY>DynAPI.document.h) de.pageY = DynAPI.document.h; - }*/ - - var x=de.pageX-de.parentPageX-de.x; - var y=de.pageY-de.parentPageY-de.y; - - // Respect boundary, if any - if (lyr._dragBoundary) { - var dB = lyr._dragBoundary; - var t = dB.top; - var r = dB.right; - var b = dB.bottom; - var l = dB.left; - // prevent choppy dragging if child is greater than parent - var pw = (lyr.parent.w>lyr.w)? lyr.parent.w-lyr.w:lyr.x; - var ph = (lyr.parent.h>lyr.h)? lyr.parent.h-lyr.h:lyr.y; - if (xpw-r) x = pw-r; - if (yph-b) y = ph-b; - } - else if (lyr._dragBoundaryA) { - var dB = lyr._dragBoundaryA; - var b=dB[2]; - var r=dB[1]; - var l=dB[3]; - var t=dB[0]; - var w=lyr.w; - var h=lyr.h; - if (xr) x=r-w; - if (yb) y=b-h; - } - // Move dragged layer - lyr.setLocation(x,y); - lyr.invokeEvent("dragmove",de); - // drag icon - if(lyr._dragOrg) { - lyr._dragOrg.invokeEvent("dragmove",e); - } - - - if (lyr._dragStealth==false && lyr.parent.DragOver) { - lyr.parent.DragOver(lyr,e.getPageX(),e.getPageY()); - } - - e.preventDefault(); - e.preventBubble(); - } - }, - onmouseup : function(e) { - // Get, if any, the currently drag in process and the layer. If none, return - var de=DragEvent.dragevent; - //de.bubble = true; - if (!de) return; - var lyr=de.src; - if (!lyr) return; - - if (!de.isDragging) { - de.type="dragend"; - de.src=null; - //e.setBubble(true); - return; - } - if (dynapi.ua.ie) lyr.doc.body.onselectstart = null; - - // Avoid click for the dragged layer ( with MouseEvent addition ) - if (dynapi.ua.def) dynapi.wasDragging=true; - if (lyr.parent.DragDrop) lyr.parent.DragDrop(lyr,e.getPageX(),e.getPageY()); - - // Properties for the event - de.type="dragend"; - de.isDragging=false; - lyr.invokeEvent("dragend",de); - // drag icon - if(lyr._dragOrg) { - lyr.setVisible(false); - lyr._dragOrg.invokeEvent("dragend",de); - } - - - // Clean drag stuff - de.src=null; - //e.preventDefault(); - e.preventBubble(); - - //lyr._dyndoc.removeEventListener(DragEvent.docListener); - } -}; -DragEvent.stopAtDocumentEdge = true; -DragEvent.setDragBoundary=function(lyr,t,r,b,l) { - if (!lyr) {dynapi.debug.print("Error: no object passed to DragEvent.setDragBoundary()"); return;} - var a=arguments; - if (a.length==0) return; - if (a.length==1) { - lyr._dragBoundary = {left:0,right:0,top:0,bottom:0}; - } - if (a.length==2) { - lyr._dragBoundary = arguments[1]; - } - else if (a.length==5) lyr._dragBoundaryA = [t,r,b,l]; -}; -DragEvent.enableDragEvents=function() { - for (var i=0;isX+s.w && chYsY+s.h) { - if ((mX>=chX && mX<=chX+ch.w) && (mY>=chY && mY<=chY+ch.h)) { - if (ch.DragDrop(s,mX,mY)) return true; - ch.invokeEvent("drop",null,s); - return true; - } - } - } - return false; -}; - -// Enable ondragover event -DynElement.prototype.DragOver=function(s,mX,mY){ - if (!this.children.length) return false; - var ch,chX,sX,sY; - for (var i in this.children) { - ch=this.children[i]; - if (!ch._hasDragEvents) ch.DragOver(s,mX,mY); - else { - chX=ch.getPageX(); - chY=ch.getPageY(); - if ((mX>=chX && mX<=chX+ch.w) && (mY>=chY && mY<=chY+ch.h)) { - if (ch.DragOver(s,mX,mY)) return true; - ch._isDragOver=true; - ch.invokeEvent("dragover",null,s); - return true; - }else if (ch._isDragOver) { - ch._isDragOver=false; - ch.invokeEvent("dragout",null,s); - } - } - } - return false; -}; - diff --git a/superx/xml/dynapi/api/ext/dynkeyevent.js b/superx/xml/dynapi/api/ext/dynkeyevent.js deleted file mode 100644 index c482303..0000000 --- a/superx/xml/dynapi/api/ext/dynkeyevent.js +++ /dev/null @@ -1,238 +0,0 @@ -/* - DynAPI Distribution - DynKeyEvent Extensions - - The DynAPI Distribution is distributed under the terms of the GNU LGPL license. - - Requirements: - dynapi.api -*/ -function DynKeyEvent(type,src) { - this.DynEvent = DynEvent; - this.DynEvent(type,src); - this.charKey=null; -}; -var p=dynapi.setPrototype('DynKeyEvent','DynEvent'); -p.getKey=function() { - return this.charKey; -}; -DynKeyEvent._keyEventListener=function(e) { - var dynobj=this._dynobj; - if(!dynobj) return true; - var dyndoc=dynobj.doc._dynobj; - if(!dyndoc) return true; - if(!e) var e=dyndoc.frame.event; - - var evt=new DynKeyEvent(e.type,dynobj); - evt.which=(e.keyCode)?e.keyCode:e.which; - var key=String.fromCharCode(evt.which).toLowerCase(); - if((key>='a'&&key<='z')||(key>='0'&&key<='9')) evt.charKey=key; - evt.spaceKey=(evt.which==32); - evt.enterKey=(evt.which==13); - evt.tabKey=(evt.which==9||evt.which==65289); - evt.leftKey=(evt.which==37||evt.which==52||evt.which==100||evt.which==65460); - evt.rightKey=(evt.which==39||evt.which==54||evt.which==102||evt.which==65462); - evt.upKey=(evt.which==38||evt.which==56||evt.which==104||evt.which==65464); - evt.downKey=(evt.which==40||evt.which==50||evt.which==98||evt.which==65458); - evt.altKey=(e.modifiers)?false:(e.altKey||e.altLeft||evt.which==18||evt.which==57388); - evt.ctrlKey=(e.modifiers)?(e.modifiers&Event.CONTROL_MASK):(e.ctrlKey||e.ctrlLeft||evt.which==17||evt.which==57391); - evt.shiftKey=(e.modifiers)?(e.modifiers&Event.SHIFT_MASK):(e.shiftKey||e.shiftLeft||evt.which==16||evt.which==57390); - - dynobj.invokeEvent(evt.type,evt); - if(evt.defaultValue==false) { - if(e.cancelBubble) e.cancelBubble=true; - if(e.stopPropagation) e.stopPropagation(); - } - return evt.defaultValue; -}; - -TabManager={}; -TabManager._c=0; // Current tab manager index. -TabManager._all=[]; -TabManager._active=false; -TabManager._activeTimeout=function() { // Prevent duplcate keydown events in NS4. - TabManager._active=true; - setTimeout('TabManager._active=false;',25); -}; -TabManager._getForm=null; -TabManager.getForm=function(p) { // Prevent default tab focus in Mozilla. - if(TabManager._getForm) return; - TabManager._getForm=p; - var html='
'; - return p.addChild(new DynLayer(html),'__lyr'); -}; -TabManager._grabFocus=function() { - var form=TabManager._getForm.__lyr; - setTimeout(form+'.doc.forms.__frm.__tab.focus();',0); -}; -TabManager._el={}; -TabManager._el.onkeydown=function(e) { - if(TabManager._getForm) { // User must have inserted TabManager form. - if(TabManager._active) return; - TabManager._activeTimeout(); - } - var i1,o1,l1,i2,o2,l2; - var nextKey=(e.tabKey||e.rightKey); - var prevKey=((e.shiftKey&&e.tabKey)||e.leftKey); - var submitKey=(e.enterKey||e.spaceKey); - i1=TabManager._c; o1=TabManager._all[i1]; l1=TabManager._all.length; - i2=o1._tabGroup._c; o2=o1._tabGroup._all[i2]; l2=o1._tabGroup._all.length; - if(nextKey||prevKey) { // Cycle group. - if(o2._hasFocusEvents) o2.setFocus(false,o2._focusBubble); - else o2.invokeEvent('blur'); - if(prevKey) i2=(i2==0)?l2-1:i2-1; - else i2=(i2==l2-1)?0:i2+1; - o2=o1._tabGroup._all[i2]; o1._tabGroup._c=i2; - if(o2._hasFocusEvents) o2.setFocus(true,o2._focusBubble); - else o2.invokeEvent('focus'); - } - else if(e.upKey||e.downKey) { // Cycle manager. - if(o2._hasFocusEvents) o2.setFocus(false,o2._focusBubble); - else o2.invokeEvent('blur'); - if(e.upKey) i1=(i1==0)?l1-1:i1-1; - else i1=(i1==l1-1)?0:i1+1; - o1=TabManager._all[i1]; TabManager._c=i1; - i2=o1._tabGroup._c; - o2=o1._tabGroup._all[i2]; - if(o2._hasFocusEvents) o2.setFocus(true,o2._focusBubble); - else o2.invokeEvent('focus'); - } else if(submitKey) { - o2.invokeEvent('submit'); - } - e.preventDefault(); - if(TabManager._getForm) TabManager._grabFocus(); -}; -DynElement.prototype.createTabManager=function() { - var p=this, c=p.children; if(!c) return; - var args=(arguments.length)?arguments:c; - var l=args.length, s; if(!l) return; - if(p._tabGroup) delete p._tabGroup; - p._tabGroup={ _c:0, _all:[] }; - for(var i=0;i) to be clicked if ((e.target+'')=='[object Image]') { me.defaultValue = true; } // allow form elements to be selected var t = (e.target.type+'').toLowerCase(); if (t=='button'||t=='checkbox'||t=='radio') { me.defaultValue=true; } } return me.defaultValue; }; DynElement.prototype.disableContextMenu = function(){ this._noContextMenu = true; // can this be done in ns? }; DynElement.prototype.captureMouseEvents = function() { this._hasMouseEvents = true; var elm = this.elm; if (elm) { elm.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP | Event.DBLCLICK); elm.onmousedown = elm.onmouseup = elm.ondblclick = MouseEvent._eventHandler; if (this.getClassName()=='DynDocument') { // move/over/out events are generated from the document this.doc.captureEvents(Event.MOUSEMOVE); elm.onmousemove = MouseEvent._docMoveHandler; } elm._dynobj = this; this.doc._dynobj = this; if(this._blkBoardElm) this.elm.document._dynobj = this; for (var i=0;i-1; // always check for safari & opera - this.opera = ua.indexOf("opera")>-1; // before ns or ie - this.ns = !this.opera && !this.safari && (b=="Netscape"); - this.ie = !this.opera && (b=="Microsoft Internet Explorer"); - this.gecko = ua.indexOf('gecko')>-1; // check for gecko engine - if (this.ns) { - this.ns4 = (this.v==4); - this.ns6 = (this.v>=5); - this.b = "Netscape"; - }else if (this.ie) { - this.ie4 = this.ie5 = this.ie55 = this.ie6 = false; - if (v.indexOf('MSIE 4')>0) {this.ie4 = true; this.v = 4;} - else if (v.indexOf('MSIE 5')>0) {this.ie5 = true; this.v = 5;} - else if (v.indexOf('MSIE 5.5')>0) {this.ie55 = true; this.v = 5.5;} - else if (v.indexOf('MSIE 6')>0) {this.ie6 = true; this.v = 6;} - this.b = "MSIE"; - }else if (this.opera) { - this.v=parseInt(ua.substr(ua.indexOf("opera")+6,1)); // set opera version - this.opera6=(this.v>=6); - this.opera7=(this.v>=7); - this.b = "Opera"; - }else if (this.safari) { - this.ns6 = (this.v>=5); // ns6 compatible correct? - this.b = "Safari"; - } - this.dom = (document.createElement && document.appendChild && document.getElementsByTagName)? true : false; - this.def = (this.ie||this.dom); - this.win32 = ua.indexOf("win")>-1; - this.mac = ua.indexOf("mac")>-1; - this.other = (!this.win32 && !this.mac); - this.supported = (this.def||this.ns4||this.ns6||this.opera)? true:false; - this.broadband=false; - this._bws=new Date; // bandwidth timer start -}; - -function DynAPIObject() { - this.DynObject = DynObject; - this.DynObject(); - - this.version = '3.0.0-beta2'; - this.loaded = false; - - this.ua = new _UserAgent(); - - this._loadfn = []; - this._unloadfn = []; - var f = this.frame = window; - - var url = f.document.location.href; - url = url.substring(0,url.lastIndexOf('/')+1); - this.documentPath = url; - - var o = this; - - this.library = {}; - this.library.setPath = function(p) {o.library.path = p}; - - f.onload = function() { - o.loaded = true; - if (!o.ua.supported) return alert('Unsupported Browser. Exiting.'); - if (o.library._create) o.library._create(); // calls dynapi._onLoad() after loading necessary files - else setTimeout(o+'._onLoad()',1); - }; - f.onunload = function() { - for (var i=0;i'; - return t; -}; - -dynapi.functions = { - removeFromArray : function(array, index, id) { - var which=(typeof(index)=="object")?index:array[index]; - if (id) delete array[which.id]; - else for (var i=0; i<\/script>'; - document.write(s); -}; - -// adds package(s) to the library -p.addPackage = function(pkg, path) { - var ps; - if (pkg.indexOf('.')) ps = pkg.split('.'); - else ps = [pkg]; - - var p = dynapi.frame; - for (var i=0;i tag for the object -p.include = function() { - var a = arguments; - if (a[0]==true) a=a[1]; // arguments used ONLY by packages.js - // buffer includes until packages(.js) are loaded - if (!this._pakLoaded) { - if(!this._buffer) this._buffer=[]; - this._buffer[this._buffer.length]=a; - return; - } - if (dynapi.loaded) this.load(a); - else { - var list = this._queue(a); - var src; - for (var i=0;i<\/script>'); - } - } -}; -p.load = p.reload = p.loadScript = p.reloadScript = function(n) { - dynapi.debug.print('Warning: dynapi.library load extensions not included'); -}; -dynapi.library = new DynAPILibrary(); - -// deprecated -var DynAPI = dynapi; diff --git a/superx/xml/dynapi/ext/blueprint.html b/superx/xml/dynapi/ext/blueprint.html deleted file mode 100644 index 005a416..0000000 --- a/superx/xml/dynapi/ext/blueprint.html +++ /dev/null @@ -1,27 +0,0 @@ - - -Blueprint Output - - - -
-
-
- - - - - - - - - - -
DynAPI - Blueprint
-
-
-
- - - diff --git a/superx/xml/dynapi/ext/debug.html b/superx/xml/dynapi/ext/debug.html deleted file mode 100644 index 6e9d494..0000000 --- a/superx/xml/dynapi/ext/debug.html +++ /dev/null @@ -1 +0,0 @@ - DynAPI Debugger \ No newline at end of file diff --git a/superx/xml/dynapi/ext/debug.js b/superx/xml/dynapi/ext/debug.js deleted file mode 100644 index cbbf294..0000000 --- a/superx/xml/dynapi/ext/debug.js +++ /dev/null @@ -1 +0,0 @@ -/* DynAPI Distribution Debugger The DynAPI Distribution is distributed under the terms of the GNU LGPL license. */ // Note: Debugger does not have to be a DynObject - very important for blueprinted layers function Debugger() { this._mode='normal'; this.win = null; this._watch={}; this._evalBuffer=''; this._buffer = dynapi._debugBuffer; dynapi._debugBuffer = ''; // close the debug window on unload this.closeOnUnLoad = false; dynapi.onUnload(function() { if (dynapi.debug.closeOnUnLoad) dynapi.debug.close(); }); this.open(); } var p = Debugger.prototype; //dynapi.setPrototype('Debugger','DynObject'); p.close = function() { if (this.isLoaded()) { this.win.close(); this.win = null; } }; // error - output a browser generated error to the debug window p.error = function(msg, url, lno) { if (url && url.indexOf(dynapi.documentPath)==0) { url = url.substring(dynapi.documentPath.length); } this.print('Error:'+ (lno? ' Line '+lno : '') +' ['+url+']\n '+msg); }; // evaluates an expression in the scope of the main dynapi window p.evaluate = function(str) { dynapi.frame.eval(str); this.setEvalHistory(str); }; // get evaluation history p.getEvalHistory=function(n){ if(!this.isLoaded()) return; var t,f=this.win.document.debugform; if(n>=1) { var lim=this.win.evalHistory.length-1; this.win.evalIndex++; if (this.win.evalIndex>lim) this.win.evalIndex=(lim<0)?0:lim; t=this.win.evalHistory[this.win.evalIndex]; if(t)f.eval.value=t; }else if(n<=0){ this.win.evalIndex--; if(this.win.evalIndex<0) this.win.evalIndex=0; t=this.win.evalHistory[this.win.evalIndex]; if(t)f.eval.value=t; } }; // lists all known properties of an object p.inspect = function(obj,showFunctions) { this.print('Inspecting:'); var v; if (typeof(obj)=='string') obj=eval(obj); if (typeof(obj)=='object') { for (var i in obj) { if (obj[i]==null) v = 'null' else if (typeof(obj[i])=='undefined') v = 'null'; else if (typeof(obj[i])=='function') { if (showFunctions==false) continue; else v = '[Function]'; } else if (typeof(obj[i])=='object' && typeof(obj[i].length)!='undefined') v = 'Array';// ['+obj[i]+']'; else if (typeof(obj[i])=='object') v = '[Object]'; else v = obj[i]; this.print(' '+i+' = '+v); } } else this.print(' undefined'); }; p.isLoaded = function() { return (this.win!=null && this.win.document && typeof(this.win.document.debugform)=="object"); }; // opens the debugger window p.open = function() { var p = dynapi.library.path; if (!this.isLoaded() && p) { var url = dynapi.documentPath+p+'ext/debug.html#'; var w = (dynapi.ua.def||dynapi.ua.dom)? 350:355 //dynapi.ua.mac? (dynapi.ua.ie?330:300) : 350; var h = (dynapi.ua.def||dynapi.ua.dom)? 432:485 //dynapi.ua.mac? (dynapi.ua.ie?405:365) : (dynapi.ua.def||dynapi.ua.dom)? 420:476; this.win = window.open(url,'debugwin','width='+w+',height='+h+',scrollbars=no,status=no,toolbar=no'); //,resizable=no this.win.opener=window; this.win.evalHistory=[]; this.win.evalIndex=0; this.print(); /* dynapi.frame.onerror = function(msg, url, lno) { dynapi.debug.error(msg, url, lno); }; */ } }; // output text to the debug window p.print = function(s) { if (s==null) s = ''; else s = s + '\n'; if (this.isLoaded()) { this.switchMode('normal'); if (this._buffer != '') { // dump buffer s = this._buffer + s; this._buffer = ''; } this.win.document.debugform.print.value += s; this._normalModeData = this.win.document.debugform.print.value; // Does mozilla has something like this? if (dynapi.ua.ie) { var po = this.win.document.debugform.print; po.scrollTop = po.scrollHeight; var range = po.createTextRange(); range.collapse(false); range.select(); } } else this._buffer += s; }; // reloads selected javascripts, packages or html pages p.reload=function(t){ if (!this.isLoaded) return; t=t+''; if(t.substr(0,3).toLowerCase()=='go:') { t=t.substr(3).replace(/\\/g,'/'); dynapi.frame.location.href=t; return; } var i,f=t.split(';'); for(i=0;i1) this._watch[name]=value; else if(dynapi.frame.eval(name)) this._watch[name]='_watch object_'; else this._watch[name]='_watch object_'; }; p._disableWatch = function(){ this._oldWatchSrc=''; if(this._timerWatch) { window.clearTimeout(this._timerWatch); this._timerWatch=0; } }; p._enableWatch = function(){ if(this._mode!='watch') return; var src,row,v; src='Name\t \t \t Value\n---------------------------------------\n'; for(i in this._watch){ if(this._watch[i]=='_watch object_') v=dynapi.frame.eval(i); else v=this._watch[i]; if(v==null) v='null'; if(typeof(v)=='string') v=v.replace(/\n/g,' '); src+=(i+' ').substr(0,22)+'\t '+v+'\n'; } if(src!=this._oldWatchSrc){ this.win.document.debugform.print.value=this._oldWatchSrc=src; } if(this._timerWatch) window.clearTimeout(this._timerWatch); this._timerWatch=window.setTimeout(this+'._enableWatch()',200); }; dynapi.debug = new Debugger(); var t='------------------------------\n' +'Click "?" for help\n' +'------------------------------\n'; dynapi.debug.print(t); \ No newline at end of file diff --git a/superx/xml/dynapi/ext/functions.color.js b/superx/xml/dynapi/ext/functions.color.js deleted file mode 100644 index 15926d6..0000000 --- a/superx/xml/dynapi/ext/functions.color.js +++ /dev/null @@ -1,94 +0,0 @@ -/* - DynAPI Distribution - dynapi.functions.Color extension -*/ - -var f = dynapi.functions; -f.Color = Color = {}; // used by dynapi.library - -// Color Functions --------------------------- - -f.DecToHex = function(val){ - lo=val%16; - val-=lo; - lo+=48; - if (lo>57) lo+=7; - hi=val/16; - hi+=48; - if (hi>57) hi+=7; - return String.fromCharCode(hi,lo); -}; -f.getColor = function(r,g,b) { - return '#'+dynapi.functions.DecToHex(r)+dynapi.functions.DecToHex(g)+dynapi.functions.DecToHex(b); -}; -f.getRandomColor = function() { - var s = ''; - for (var i=0;i<3;i++) s += dynapi.functions.DecToHex(Math.floor(255*Math.random())); - return s; -}; -f.createRedPal = function(pal) { - var r=g=b=0; - for (var i=0; i<256; i++){ - pal[i]=dynapi.functions.getColor(r,g,b); - r+=8; - if (r>255) { r=255; g+=6; b+=2; } - if (g>255) { g=255; b+=2; } - if (b>255) { b=255; } - } -}; -f.createGrayPal = function(pal) { - var r=0; - for (var i=0; i<256; i++){ - pal[i]=dynapi.functions.getColor(r,r,r); - r+=4; - if (r>255) { r=255; } - } -}; -f.createBluePal = function(pal){ - var r=g=b=0; - for (var i=0; i<256; i++){ - pal[i]=dynapi.functions.getColor(r,g,b); - b+=6; - if (b>255) { b=255; g+=2; } - if (g>255) { g=255; r+=2; } - } -}; -f.createGreenPal = function(pal) { - var r=g=b=0; - for (var i=0; i<256; i++){ - pal[i]=dynapi.functions.getColor(r,g,b); - g+=6; - if (g>255) { g=255; b+=2; } - if (b>255) { b=255; r+=2; } - } -}; -f.fadeColor = function(from, to, percent){ - if(!from || !to) return; - if(percent<0) return from; - else if(percent>100) to; - - if(from.substring(0,1)!='#') from='#'+from; - if(to.substring(0,1)!='#') to='#'+to; - - from = { - red:parseInt(from.substring(1,3),16), - green:parseInt(from.substring(3,5),16), - blue:parseInt(from.substring(5,7),16) - } - - to = { - red:parseInt(to.substring(1,3),16), - green:parseInt(to.substring(3,5),16), - blue:parseInt(to.substring(5,7),16) - } - - var r=from.red+Math.round((percent/100)*(to.red-from.red)); - var g=from.green+Math.round((percent/100)*(to.green-from.green)); - var b=from.blue+Math.round((percent/100)*(to.blue-from.blue)); - - r = (r < 16 ? '0' : '') + r.toString(16); - g = (g < 16 ? '0' : '') + g.toString(16); - b = (b < 16 ? '0' : '') + b.toString(16); - - return '#' + r + g + b; -}; diff --git a/superx/xml/dynapi/ext/functions.date.js b/superx/xml/dynapi/ext/functions.date.js deleted file mode 100644 index 7a25a45..0000000 --- a/superx/xml/dynapi/ext/functions.date.js +++ /dev/null @@ -1,126 +0,0 @@ -/* - DynAPI Distribution - dynapi.functions.Date extension -*/ - -var f = dynapi.functions; -f.Date = {}; // used by dynapi.library - -// Date Functions -------------------------------------- - -f.dateAdd = function(interval,n,dt){ - if(!interval||!n||!dt) return; - var s=1,m=1,h=1,dd=1,i=interval; - if(i=='month'||i=='year'){ - dt=new Date(dt); - if(i=='month') dt.setMonth(dt.getMonth()+n); - if(i=='year') dt.setFullYear(dt.getFullYear()+n); - }else if (i=='second'||i=='minute'||i=='hour'||i=='day'){ - dt=Date.parse(dt); - if(isNaN(dt)) return; - if(i=='second') s=n; - if(i=='minute'){s=60;m=n} - if(i=='hour'){s=60;m=60;h=n}; - if(i=='day'){s=60;m=60;h=24;dd=n}; - dt+=((((1000*s)*m)*h)*dd); - dt=new Date(dt); - } - return dt; -}; -f.dateDiff=function(interval,dt1,dt2){ - if(!interval||!dt1||!dt2) return; - var v,s=1,m=1,h=1,dd=1,i=interval; - if(i=='month'||i=='year'){ - dt1=new Date(dt1); - dt2=new Date(dt2); - years=dt2.getFullYear()-dt1.getFullYear(); - if (i=='year') v=years; - else if(i=='month') { - v=(dt2.getMonth()+1)-(dt1.getMonth()+1); - if(years!=0) v+=(years*12); - } - }else if (i=='second'||i=='minute'||i=='hour'||i=='day'){ - dt1=Date.parse(dt1); - dt2=Date.parse(dt2); - if(isNaN(dt1)||isNaN(dt2)) return; - v=dt2-dt1; - if(i=='second') s=1000; - if(i=='minute') s=60000; - if(i=='hour'){s=60000;m=60}; - if(i=='day'){s=60000;m=60;h=24;}; - v=((((v/s)/m)/h)/dd); - } - return v; -}; -f.formatDate = function(date,format){ - if(!date) return ''; - var dt=new Date(date); - var mm=dt.getMonth(); - var dd=dt.getDate(); - var day=dt.getDay(); - var yyyy=dt.getFullYear(); - var hh=dt.getHours(); - var nn=dt.getMinutes(); - var ss=dt.getSeconds(); - var ampm; - - var days=['Sunday','Monday','Teusday','Wednesday','Thursday','Friday','Saturday']; - var months=['January','February','March','April','May','June','July','August','September','October','November','December']; - - format=(format)? (format+'').toLowerCase():'dddd, mmmm dd, yyyy hh:nn:ss ampm'; - format=format.replace('mmmm',months[mm]); - format=format.replace('mmm',months[mm].substr(0,3)); - format=format.replace('mm',mm+1); - format=format.replace('dddd',days[day]); - format=format.replace('ddd',days[day].substr(0,3)); - format=format.replace('dd',dd); - format=format.replace('yyyy',yyyy); - if(format.indexOf('ampm')>0){ - if(hh>12) hh=hh-12; - if(hh<12) ampm='AM'; - else ampm='PM'; - format=format.replace('ampm',ampm); - } - format=format.replace('hh',hh); - format=format.replace('nn',nn); - format=format.replace('ss',ss); - - return format; -}; -f.getDayOfYear = function(dt){ - dt = new Date(dt); - if(isNaN(dt)) dt = new Date(); - var yr = new Date(dt.getFullYear(),0,1); - yr = yr.getTime() - (yr.getDay()-1)*(24*60*60*1000); - return(Math.ceil((dt.getTime() - yr)/(24*60*60*1000))); -}; -f.isDate = function(dt,format){ - if (!dt) return false; - var dd,mm,yyyy; - var isLeapYear,st=true,delim='/'; - dt+='';format=(format)? format+'':''; - if(dt.indexOf('/')>=0) delim='/'; - else if(dt.indexOf('-')>=0) delim='-'; - else if(dt.indexOf(' ')>=0) delim=' '; - dt=dt.split(delim); - if(format) format=format.replace(/\W/g,'/'); - else { - if (dt[0]>=1000) format='yyyy/mm/dd'; - else if (dt[0]>=12 && dt[1]<=12) format='dd/mm/yyyy'; - else if (dt[0]<=12 && dt[1]>=12) format='mm/dd/yyyy'; - }; - if(format=='yyyy/mm/dd'){yyyy=dt[0];mm=dt[1];dd=dt[2];} - else if(format=='mm/dd/yyyy'){mm=dt[0];dd=dt[1];yyyy=dt[2];} - else if(format=='dd/mm/yyyy'){dd=dt[0];mm=dt[1];yyyy=dt[2];} - if(isNaN(dd)||isNaN(mm)||isNaN(yyyy)) st=false; - else if(dd<1 || dd>31) st=false; - else if(yyyy>9999) st=false; - else if (mm < 1 || mm > 12) st=false; - else if((mm==4 || mm==6 || mm==9 || mm==11) && dd==31) st=false; - else if(mm==2) { // check for leap year and february 29th - isLeapYear = (yyyy % 4 == 0 && (yyyy % 100 != 0 || yyyy % 400 == 0)); - if (dd > 29 || (dd==29 && !isLeapYear)) st=false; - } - return st; -}; - diff --git a/superx/xml/dynapi/ext/functions.image.js b/superx/xml/dynapi/ext/functions.image.js deleted file mode 100644 index 9eece60..0000000 --- a/superx/xml/dynapi/ext/functions.image.js +++ /dev/null @@ -1,124 +0,0 @@ -/* - DynAPI Distribution - dynapi.functions.Image extension -*/ - -var f = dynapi.functions; -f.Image = {}; // used by dynapi.library - -// Image Functions --------------------------- - -f._imgTTL = 30000; // Image Time To Load (ms) -f.getImage = function(src,w,h,params) { - var img,name,p=params; - if(!p) name=src; - else name=(!p.alias)? src:p.alias; - img = dynapi.ximages[name]; - if(!img || (img && img.params!=params)){ // if user enters a new set of params then create a new image object - img=dynapi.ximages[name] = (w!=null&&h!=null)? new Image(w,h) : new Image(); - img.w=w||null; - img.h=h||null; - img.src=src;img.params=p; - img.getHTML=dynapi._imageGetHTML; - img.reload=dynapi._imageReload; - img.dtStart=new Date(); - if(p) { - var f=dynapi.functions; - if(p.oversrc) f.getImage(p.oversrc); - if(p.downsrc) f.getImage(p.downsrc); - } - if(!this._imgTmr && this._imgProgFn) this._imageProgress(); - } - return img; -}; -f.getFailedImages = function(){ - var ar=[]; - for(i in dynapi.ximages){ - img=dynapi.ximages[i]; - if(img && img.failed) ar[ar.length]=img; - } - return ar; -}; -f.captureImageProgress=function(fn){ //fn = fn(completed,failed,total); - this._imgProgFn=fn; - this._imageProgress(); -}; -f._imageProgress = function(){ - var i,c=0,f=0,t=0; - var img,dtEnd = new Date; - var fn=this._imgProgFn; - for(i in dynapi.ximages){ - img=dynapi.ximages[i]; - if(img && img.complete!=null){ - t++; - img.failed=(!img.complete && (dtEnd-img.dtStart)>this._imgTTL)? true:false; - if (img.complete) c++; - else if(img.failed) f++; - } - } - if(fn) fn(c,f,t); - if(c+f'+t; - else if (dir=='S') t=t+'
'+text; - else if (dir=='E') t=t+text; - else if (dir=='W') t=text+t; - } - if(p.link) t=''+t+''; - if(xtags && p.name) dynapi._imageHookArray[p.name]=p; - return t; -}; diff --git a/superx/xml/dynapi/ext/functions.math.js b/superx/xml/dynapi/ext/functions.math.js deleted file mode 100644 index a58cd9f..0000000 --- a/superx/xml/dynapi/ext/functions.math.js +++ /dev/null @@ -1,85 +0,0 @@ -/* - DynAPI Distribution - dynapi.functions.Math extension - - Math and Path functions -*/ - -var f = dynapi.functions; -f.Math = {}; // used by dynapi.library - -// Math Functions -------------------------- - -f.radianToDegree = function(radian) { - return radian*180/Math.PI; -}; -f.degreeToRadian = function(degree) { - return degree*Math.PI/180; -}; -f.sintable = function(lsin) { - for (var i=0; i<361; i+=1) lsin[i]=Math.sin((i/180)*Math.PI); -}; -f.costable = function(lcos) { - for (var i=0; i<361; i+=1) lcos[i]=Math.cos((i/180)*Math.PI); -}; -f.getRandomNumber = function(n) { - var t=new Date(); - n=(n)? n: parseInt(Math.random()*10000); - return Math.round((Math.abs(Math.sin(t.getTime()))*(Math.random()*1000)))%n+1; -}; -f.getGUID = function() { // Globally Unique ID - var n1,n2,n3,n4; - var l,r,m,c=Math.random()+''; - c=c.substr(c.indexOf('.')+1); - m=(c.length-1)/2; - l=c.substr(0,m); r=c.substr(m); - n1=this.getRandomNumber(1000); - n2=this.getRandomNumber(255);n3=this.getRandomNumber(255);n4=this.getRandomNumber(255); - n2 = (n2 < 16 ? '0' : '') + n2.toString(16); - n3 = (n3 < 16 ? '0' : '') + n3.toString(16); - n4 = (n4 < 16 ? '0' : '') + n4.toString(16); - return (n1+n2+'-'+l+'-'+n3+n4+'-'+r).toUpperCase(); -}; - -// Path Functions ------------------------ - -// Combines separate [x1,x2],[y1,y2] arrays into a path array [x1,y1,x2,y2] -f.interlacePaths = function (x,y) { - var l = Math.max(x.length,y.length); - var a = new Array(l*2); - for (var i=0; i=0) comma=','; - if(format.indexOf('$')>=0) symbol='$'; - else if(format.indexOf('%')>=0) symbol='%'; - s=format.split('.'); - fInt=((s[0]==''||s[0]==null||s[0]=='undefinded')? '':s[0]); - fInt=fInt.split('').reverse().join(''); - fDec=(s[1]==''||s[1]==null||s[1]=='undefinded')? '':s[1]; - s=n.split('.'); - nInt=((s[0]==''||s[0]==null||s[0]=='undefinded')? '':s[0]); - nInt=nInt.split('').reverse().join('');; - nDec=(s[1]==''||s[1]==null||s[1]=='undefinded')? '':s[1]; - if (nInt) len=nInt.length; - if (fInt.length>len) len=fInt.length; - for(i=0;i=0) return true; - else return false; -}; -f.isInteger=function(n){ - if(typeof(n)=='number' && (n+'').indexOf('.')<0) return true; - else return false;; -}; -f.toInteger=function(dt){ - var vl; - if(!dt) return 0; - if(isNaN(dt)) vl=parseInt((dt+'').replace(/\,/g,'')); - else vl= parseInt(dt); - if (isNaN(vl)) vl = 0; - return vl; -}; -f.toFloat=function(dt){ - var vl; - if(!dt) return 0; - if(isNaN(dt)) vl=parseFloat((dt+'').replace(/\,/g,'')); - else vl = parseFloat(dt); - if (isNaN(vl)) vl = 0; - return vl; -}; -f.toBoolean = function(dt) { - return (dt=='true'||dt>=1)? true:false; -}; diff --git a/superx/xml/dynapi/ext/functions.string.js b/superx/xml/dynapi/ext/functions.string.js deleted file mode 100644 index 73f5aa5..0000000 --- a/superx/xml/dynapi/ext/functions.string.js +++ /dev/null @@ -1,52 +0,0 @@ -/* - DynAPI Distribution - dynapi.functions.String extension -*/ - -var f = dynapi.functions; -f.String = {}; // used by dynapi.library - - -// String Functions -------------------------------- - -f.sprintf = function(t){ - var ar = arguments; - var i=1,inx = t.indexOf("%s"); - while(inx>=0){ - t = t.substr(0, inx) + ar[i++] + t.substr(inx+2); - inx = t.indexOf("%s"); - } - return t; -}; -f.strRepeat = function(s,n) { - if(!s) return ''; - var i,a=[]; - for(i=1;i<=n;i++){ - a[a.length]=s; - } - return a.join(''); -}; -f.strReverse = function(s) { - if(!s) return ''; - var a=(s+'').split(''); - a.reverse(); - return a.join(''); -}; -f.strStuff = function(s,v,index) { - if(!s) return ''; - if (index==null) s=s+v+''; - else { - var t1=t2=s+''; - s=t1.substr(0,index)+v+t2.substr(index,t2.length-index); - } - return s; -}; -f.trim = function(s,dir){ - if(!s) return; - else s+=''; // make sure s is a string - dir=(dir)? dir:'<>'; - if(dir=='<'||dir=='<>') s=s.replace(/^(\s+)/g,''); - if(dir=='>'||dir=='<>') s=s.replace(/(\s+)$/g,''); - return s; - -}; \ No newline at end of file diff --git a/superx/xml/dynapi/ext/functions.system.js b/superx/xml/dynapi/ext/functions.system.js deleted file mode 100644 index ee39a58..0000000 --- a/superx/xml/dynapi/ext/functions.system.js +++ /dev/null @@ -1,87 +0,0 @@ -/* - DynAPI Distribution - dynapi.functions.System extension -*/ - -var f = dynapi.functions; -f.System = System = {}; // used by dynapi.library - -// System Functions --------------------------------- - -f.coalesce=function(){ - var a,i; - for(i=0;arguments.length;i++){ - a=arguments[i]; - if(a!=null && a!='' && a!=undefined) return a; - } -} -f.choose = function(index){ - if(isNaN(index)) return; - if (arguments.length>index) return arguments[index+1]; -}; -f.cloneObject = function(src) { - if(!src) return; - var i,tar; - if(typeof(src)!='object') return src; - else { - if((src.constructor+'')==(Array+'')) tar=[]; - else if((src.constructor+'')==(Date+'')) return src; - else tar={}; - }; - for(i in src) { - if(typeof(src[i])!='object') tar[i]=src[i]; - else tar[i]=this.cloneObject(src[i]); - } - return tar; -}; -f.copyObject = function(from,to,noclone) { - var i; - if (to && !noclone) to=this.cloneObject(to); - else if(to && noclone) to=to; - else { - if(typeof(from)=='object') { - if((from.constructor+'')==(Array+'')) to=[]; - else if((from.constructor+'')==(Date+'')) return from; - else to={}; - }; - } - for(i in from) { - if(typeof(from[i])!='object') to[i]=from[i]; - else to[i]=this.copyObject(from[i],to[i],true); - } - return to; -}; -f.getElementById = function(id,parentLyr){ - if (document.all) return document.all[id]; - else if(document.getElementById) return document.getElementById(id); - else if(document.layers){ - var i,nLayers,layer; - parentLyr = (parentLyr)? parentLyr:document; - nLayers = parentLyr.layers; - for (i=0;i -dynapi.library._handleLoad(this); - \ No newline at end of file diff --git a/superx/xml/dynapi/ext/library.js b/superx/xml/dynapi/ext/library.js deleted file mode 100644 index 36217d3..0000000 --- a/superx/xml/dynapi/ext/library.js +++ /dev/null @@ -1,232 +0,0 @@ -/* - DynAPI Distribution - Dynamic Loading extension to dynapi.library - - The DynAPI Distribution is distributed under the terms of the GNU LGPL license. -*/ - -// begin loading the object -DynAPILibrary.prototype.load = function(n,fn) { - var list = this._queue(n,null,arguments[2]); - //return dynapi.debug.print('going to load: '+list); - if (list.length) { - var s,src; - for (var i=0;i<\/script>'); - this._export(src); - } - else { - var elm = s.elm = dynapi.frame.document.createElement('script'); - elm.src = rsrc; - elm.type = 'text/javascript'; - elm.defer = true; - if (dynapi.ua.ie) { - elm.C = 0; - var o = this; - elm.onreadystatechange = function() { - elm.C++; - if (elm.C==2 || elm.readyState=="complete") { // use 2nd statechange for onload - o._export(src); - } - } - } - dynapi.frame.document.getElementsByTagName('head')[0].appendChild(elm); - - // I could not find way to know when the script is complete in Moz v0.9.3 - if (dynapi.ua.ns6) setTimeout(this+'._export("'+src+'")',100); - } - } - } -}; - -// executed after a script is finished loading, run main() functions -DynAPILibrary.prototype._export = function(src) { - var src = this.loadList[this.loadIndex]; - var s = this.scripts[src]; - if (s) { - this._register(s); - - // run elm.main)() before global main() - if (dynapi.ua.ns4 && typeof(this.elm.main)=="function") { - this.elm.main(); - this.elm.main = null; - } - - // run global main() if available - if (typeof(main)=="function") { - main(); - main = null; - } - - // clear out all functions in the layer's scope - if (dynapi.ua.ns4) { - for (var i in this.elm) { - if (typeof(this.elm[i])=="function") delete this.elm[i]; - } - } - this.busy = false; - - // load next file - this._load(); - } - //else return alert('Library Error: unknown script '+src); -}; - -// registers the script as loaded, exports the objects -DynAPILibrary.prototype._register = function(s) { - //dynapi.debug.print('loaded "'+s.src+'"'); - s.loaded = true; - s.queued = false; - if (!s.unnamed) { - var n,found; - // loop through each object that the script contains - for (var i=0;i0) { - var ns = n.split('.'), o = dynapi.frame, b = false; - for (var j=0;j, NS4 only -DynAPILibrary.prototype._handleLoad = function(elm) { - var args = dynapi.functions.getURLArguments(elm.src); - var js = args["js"]; - if (js) { - js=js.replace(/\+/g,'/'); // convert + to / - if (js.indexOf('http')!=0) { - var l = dynapi.frame.document.location; - if (js.substr(0,1)=='/') js = l.port+'//'+host+src; - else js = dynapi.documentPath+js; - } - elm.document.write(' -*/ - -function IOElement(hiddenThreads,useXFrames) { - this.DynLayer = DynLayer; - this.DynLayer(); - - this._elmID = this.id+'elm'; - this._requests = {}; // [url,data,fn,method,elmThread,timer,cargo] - this._cargoID=''; - this._requestList = []; - this._requestIndex = -1; - this._retryID=null; - this._transactions = {}; - - this._singleThread=false; - this._elmBusy=[]; - this._elmThread=null; - this._maxThreads=(hiddenThreads>=1 && hiddenThreads<=8)? hiddenThreads : 1; - this._hidden = (hiddenThreads)? true : false; - - this.isSync=false; - this.failTime = 50000; - - // create XFrame window - if(useXFrames && dynapi.ua.ns4) { - this._winXFrames=window.open("about:blank",null,'left=3000,top=3000,width=100,height=100,scrollbars=no,status=no,toolbar=no'); - this._winXFrames.blur(); // hide the new window - var wxf=this._winXFrames; - dynapi.onUnload(function() { // tidy up - if(wxf.open && !wxf.closed) wxf.close(); - }); - } - - if (this._hidden) { - var o = this; - o.setLocation(1,1);// Strange! ns4 requires that the x,y be set in order to load the java applet inside the layer - o.setVisible(false); - dynapi.document.addChild(o); - } - - this.onPreCreate(IOElement.fnPrecreate); - this.onCreate(IOElement.fnCreate); -}; - -IOElement.fnPrecreate = function() { - var t,r=['*'],html=[]; - if (this._hidden) { - if (this._winXFrames) html = ['']; - else if (dynapi.ua.ns4) html = ['']; - else { - // Opera v7.11 requires an IFrame's src to be set before it's accessible - pixel.gif is a 1x1 transparent gif - html = ['']; - } - t=html.join(''); - this._elmThread=this._elmID; - this._elmBusy[this._elmID]=false; - for(var i=1;i'; - else if (dynapi.ua.ns4) t = ''; - else t = ''; - this._elmThread=this._elmID; this._elmBusy[this._elmID]=false; - } - - if (!this._winXFrames) this.html=t; - else{ - var src='DynAPI XFrame\n' - +'\n'+t - +'\n' - this._winXFrames.document.open(); - this._winXFrames.document.write(src); - this._winXFrames.document.close(); - this._winXFrames.top.dynapi=dynapi; - this._winXFrames.top.IOElement=IOElement; - } -}; -IOElement.fnCreate = function() { - if (this._SyncFn) window.setTimeout(this+'._initSync()',100); - if (this.getScope()) { - if (this._requestList.length>0) { - this._setRequestTimeout(100); - } - } -}; - -var p = dynapi.setPrototype('IOElement','DynLayer'); -p.execInParent = function(fn){ // Executes javascript codes within the parent element - if(typeof(fn)=='function') eval('fn='+fn); - else eval('fn=function(){'+fn+'}'); - fn(); -}; -p.getVariable = function(name) { - var v=this.getScope()[name]; - if (IOElement.SODA) v=IOElement.ws_SODA2Var(v); - return v; -}; -p.getScope = function(thread) { - var scope; - if (!thread) thread=this._elmThread; - if (this._winXFrames && this._winXFrames.top) scope = this._winXFrames.top.frames[thread]; - else if (dynapi.ua.ns4) scope = this.doc.layers[thread]; - else scope = window.frames[thread]; - if (!scope) return alert('IOElement Error: no load element'); - else return scope; -}; -p.getCargoID=function(){return this._cargoID} -p.getCargo=function(dontRemove){ - if(!this._cargoID) return null; - var c=this._requests[this._cargoID][6]; - if(!dontRemove) { - // normal cargo are removed from storage - this._requests[this._cargoID][6]=null; - } - return c; -}; -p.isBusy = function(){ - for (var i in this._elmBusy){ - if (this._elmBusy[i]==false) return false; - };return true; -}; -p.cancel= function(id){ - id=(id)? id:this._retryID; - var req=this._requests[id]; - if(req){ - this._elmBusy[req[4]]=false; - delete this._requests[id]; - this._clearScope(); - return true; - } -}; -p.cancelAll=function(){ - this._requests={}; - for (var i in this._elmBusy){ - this.elmThread=i; - this._clearScope(); - } -}; -p.retry=function(id){ - id=this._retryID=((id)? id:this._retryID); - var req=this._requests[id]; - if(req) { - this._setRequestTimeout(50,id); - return true; - } -}; -p.setTimeout = function(ms){ - if(!isNaN(ms))this.failTime=ms; -} -p.useSingleThread = function(b){ - this._singleThread=b; -}; -p.get = function(url,data,fn,cargo) { - if(fn==false && this.isSync) return this._syncRequest(url,data,'get'); - else return this._asyncRequest(url,data,fn,'get',cargo); -}; -p.post = function(url,data,fn,cargo) { - if(fn==false && this.isSync) return this._syncRequest(url,data,'post'); - return this._asyncRequest(url,data,fn,'post',cargo); -}; -p.upload=function(url,form,fn,cargo){ // file upload - return this._asyncRequest(url,form,fn,'upload',cargo); -}; -p._asyncRequest = function(url,data,fn,method,cargo) { - var i,l,src; - var id = this._getRandomID(); // create random load ID to ensure no caching - dynapi.debug.print("IOElement "+method+" request"); - if (typeof(url)=="string") this._requests[id] = [url,data,fn,method,null,null,cargo]; - else if (method=="get") { - for (i=0;i'; - if (data) { - for (i in data) { - if(i) str += ''; - } - } - str += ''; - - elm.document.open(); - elm.document.write(str); - elm.document.close(); - - var f = elm.document.forms['ioDataForm']; - if (!f) return alert("IOElement Error: no form element found"); - if (f && data) { - for (i in data) { - if(i) f[i].value = data[i]; - } - } - f.submit(); - } - - // begin transaction - data sent but awaiting reply - // to-do work on a way to detech if caller is in the same domain as - if(!dynapi.ua.ns4) { - elm.document._tranState="begin"; - this._monitorTransactions(); - } - this.invokeEvent("request"); - } - } -}; -p._clearScope=function(){ - var doc=this.getScope().document; - if(doc){doc.open();doc.write('');doc.close()} -}; -p._getFreeElm= function(){ - for (var i in this._elmBusy){ - if (this._elmBusy[i]==false){ - this._elmThread=i;this._elmBusy[i]=true; - return this.getScope(); - }else if(this._singleThread) break; - } -}; -p._getRandomID = function(){ - var id = Math.random()+''; - return 'io'+id.substring(2); -}; -p._monitorTransactions = function(){ - var c,r,tr,id,elm; - for (id in this._transactions){ - r=this._requests[id]; - tr=this._transactions[id]; - if(r && this._elmBusy[r[4]]) { - elm=this.getScope(r[4]); - if(elm && elm.document && !elm.document._tranState){ - // document completed without proper response from server - tr[0]+=1; // counter. - if(tr[0]>=3){ - //three strikes and you're out! - eval(tr[1]); - } - } - } - } - if(id) window.setTimeout(this+'._monitorTransactions()',1000); -}; -p._notify = function(id, url, success) { - var fn,req=this._requests[id]; if(!req)return; - var s = (success!=null)? success : true; - // delete transaction record - delete this._transactions[id]; - if (!this._elmBusy[req[4]] && success) { - dynapi.debug.print('IOElement Error: '+id+' '+this._elmID+' '+url); - return; - } - clearTimeout(req[5]); - this._elmThread=req[4]; - fn = req[2]; // callback function - if(!s) this._retryID=id; else this._retryID=''; - this._cargoID=id; - if (fn) { - var r,e = new DynEvent("load",this); - if(typeof(fn)=='function') r=fn(e, s); - else r=eval(fn); - // cancels server response and preserve request object - if(r==false) { - s=false; - this._retryID=id; - } - }else{ - this.invokeEvent("response",null,s); - } - this._cargoID=''; - if(s && id!=this._retryID) delete this._requests[id]; - else if(this._hidden) this._clearScope(); - this._elmBusy[req[4]] = false; - // release document - prevent incomplete progressbar in ie - if(dynapi.ua.ie) location.href = "javascript:void (document.close())"; - this._doRequest(); -}; -p._setRequestTimeout=function(interval,id){ - var evl=this+'._doRequest('+((id)? "'"+id+"'":'')+')'; - return window.setTimeout(evl,interval); -}; -// Helper Methods ------------------------- -IOElement.getSharedIO=function(useXFrames){ // Returns a Shared instance of the IOElement object - if(!IOElement.ShareIO) IOElement.ShareIO=new IOElement(1,useXFrames); - return IOElement.ShareIO; -}; -IOElement.notify = function(elm, fn, success) { // ds: added success parameter to nicely relay server generated error messages - if (elm) { - var url, id; - if (dynapi.ua.ns4 && elm.src) url = elm.src; - else if (dynapi.ua.ns4 && elm.location) url = elm.location.href; - else url = elm.document.location.href; - if (url) { - elm.args = dynapi.functions.getURLArguments(url); - var id = elm.args["IORequestID"]; - var obj = DynObject.all[elm.args["IOElementID"]]; - if (obj!=null && id!=null) { - // transaction completed - server has respond sucessfully - elm.document._tranState="complete"; - elm.onload = function() { - if (fn) fn(obj); // send obj fn - rmo - obj._notify(id,url, success); // ds: success - }; - return obj; - } - else { - return false; - } - } - } - return null; -}; -IOElement.URLEncode = function (d){ - d=d.replace(/\s/g,'+').replace(/\%/g,'%25').replace(/\=/g,'%3D'); - d=d.replace(/\&/g,'%26').replace(/\n/g,'%0A').replace(/\r/g,'%0D'); - d=d.replace(/\#/g,'%23').replace(/\\/g,'%5C'); - return d; -}; diff --git a/superx/xml/dynapi/util/ioelement.soda.js b/superx/xml/dynapi/util/ioelement.soda.js deleted file mode 100644 index 376d343..0000000 --- a/superx/xml/dynapi/util/ioelement.soda.js +++ /dev/null @@ -1,332 +0,0 @@ -/* - DynAPI Distribution - IOElement SODA add-on - - The DynAPI Distribution is distributed under the terms of the GNU LGPL license. - - requires: Math, IOElement -*/ - -IOElementSoda={}; // used by dynapi.library -IOElement.SODA=true; - -var p=IOElement.prototype; - -p.createWebService = function(name,url,fn,useSync,uid,pwd,method){ - var o,IOE=IOElement; - if(typeof(fn)!='function') { - alert('Missing or invalid Callback Function'); - return; - } - - useSync=(IOElement.SYNC)? useSync:false; - o=this[name]={}; - method=(method+'').toLowerCase(); - o.sid=dynapi.functions.getGUID(); - o._callback=fn; - o._name=name; - o._useSync=useSync; - o._method=(method=='post'||method=='get')? method:'post'; - o._src=this; o._url=url; o._uid=uid; o._pwd=pwd; - o._iSysCall=IOE.ws_iSysCall; - o._iSysManager=IOE.ws_iSysManager; - o._iSysConnect=IOE.ws_iSysConnect; - - o.isConnected=false; - o.call=IOE.ws_callSrv; - o.getWebName=IOE.ws_getWebName; - o.getWebComment=IOE.ws_getWebComment; - o.importWebMethods=IOE.ws_importWebMethods; - - if(!useSync || (useSync && this.isSync)) o._iSysManager("connect"); - else this.activateSyncMode(this+'.'+name+'._iSysManager("connect")'); -}; -p.disconnectWebService = function(name,fn){ - var o=this[name]; - if(o && o._src==this && o.isConnected==true){ - o._callback=fn; - o._iSysManager("disconnect"); - }; -}; -p.getResponse = function(){ - var cargo=this.getCargo(true); - var retry=(this._retryID==this._cargoID)?true:false; - var response=IOElement.ws_SODAParser(this.getVariable('wsSODAResponse')); - if(retry) response.error={code:0,text:'Request Timeout'}; - if(response.error) this._retryID=this._cargoID; - if(cargo) response.serviceName=cargo.DynAPIWSName; - return response; -}; - -// WS Object Functions -IOElement.wsError='Error occurred while parsing SODA Envelope'; -IOElement.ws_iSysManager = function(sys){ - var s,r; - - this.isSync = (this._useSync && this._src.isSync)? true:false;; - - if(sys=='connect') mn='SYS:WebServiceConnect'; - else if(sys=='disconnect') mn='SYS:WebServiceDisconnect'; - - if(this.isSync) { - // use sync login/logout - r=this._iSysCall(mn); - o=r.value; - if(o && typeof(o)=='object' && o.SYSCall==true) { - o.error=r.error; - r=o;s=true; - }; - this._iSysConnect(r,s); - }else { - // use async login/logout - var cargo={wsObject:this,DynAPIWSName:this._name} - this._iSysCall(mn,null,this._iSysConnect,cargo); - } -}; -IOElement.ws_iSysConnect = function(e,s){ - var o,r,c,ws,et; - - if(!e||(e && e.constructor!=DynEvent)) { - // sync - o=ws=this; - if(!e.error) c=e; - else if(e.error) et= ((e.error.code)? e.error.code+':':'')+e.error.text; - else if(!s) et='Connection Failed'; - }else{ - // async - o=e.getSource(); - r=o.getResponse(); - c=o.getCargo(!s||!r.value); - o=ws=c.wsObject; - c=r.value; - if(r.error) et=r.error.text; - } - o.isConnected=false; - if(!et && c && (c.logout||c.login)=='failed') et='Login failed'; - s=(!et && c && (c.logout||c.login)=='ok')? true:false; // web service must return a login/logout state - if(s && c.logout) { - delete o._src[o._name]; - o.call=dynapi.functions.Null; - }else if(s && c.login){ - o._iWSName = c.name; - o._iWSComment = c.comment; - o._iWSMethodNames = (c.methodNames)? c.methodNames:''; - o.isConnected=s; - } - if (o._callback) o._callback(ws,s,et); -}; - -IOElement.ws_iSysCall=function(name,params,fn,cargo){ // used to make async/sync system call to the service - var r,o,data={}; - if(this.isSync) fn=false; - data.IOResponse=(fn)? 'text/html':'text/xml'; - data.IOEnvelope=IOElement.ws_createSODAEnvelope(name,params,null,null,this.sid,this._uid,this._pwd); - if(this._method=='get') r=this._src.get(this._url,data,fn,cargo); - else r=this._src.post(this._url,data,fn,cargo); - if(this.isSync) { - // convert SODA text returned from get() or post() into response object - if(!r.error) r=IOElement.ws_SODAParser(r.value); - } - return r; -}; - -IOElement.ws_callSrv=function(name,params,fn,cargo){ - var rt,data={IOResponse:'text/html'},cargo=(cargo)? cargo:{}; - var mod=this._method; - var sync=(fn==false && this.isSync); - if(typeof(name)!='string'){ - var i,o=name; - var na=[],pa=[]; - for(i in o){ - na[na.length]=i; - pa[pa.length]=o[i]; - } - name=na.join(','); - params=pa; - } - if(typeof(params)!='object'||params==null) params=[params]; - else if((params.constructor+'')!= (Array+'')) params=[params]; - IOElement.ws_setStringEncFormat('xml'); - cargo.DynAPIWSName=this._name; - data.IOEnvelope=IOElement.ws_createSODAEnvelope(name,params,null,null,this.sid); - if(sync) data.IOResponse = 'text/xml'; // Returned Content Format - if (mod=='get') rt=this._src.get(this._url,data,fn,cargo); - else rt=this._src.post(this._url,data,fn,cargo); - if(sync) { - // convert SODA text returned from get() or post() into response object - if(!rt.error) rt = IOElement.ws_SODAParser(rt.value); - rt.serviceName=this._name; - } - return rt; -}; -IOElement.ws_createSODAEnvelope = function(method,body,ecode,etext,sid,uid,pwd){ - return '' - +((sid)? ''+ sid +'':'') - +((ecode||etext)? ''+ IOElement.ws_SODAStringEncode(ecode+'|'+etext) +'':'') - +((uid)? ''+uid+'':'') - +((pwd)? ''+pwd+'':'') - +''+ IOElement.ws_SODAStringEncode(method) +'' - +''+ IOElement.ws_Var2SODA(body) +'' - +''; -}; -IOElement.ws_getWebName= function(){ - return this._iWSName; -}; -IOElement.ws_getWebComment= function(){ - return this._iWSComment; -}; -IOElement.ws_importWebMethods = function(){ - if(!this.isSync) return false; - var fn,rt=this._iWSMethodNames; - if(rt) { - rt=rt.split(','); - for(var i=0;i=0) lvl++; - else lvl=0; - - if(vtype=="number") { - if((v+'').indexOf('.')>=0) data=''+v+''; - else data=''+v+''; - }else if(vtype=="boolean") { - if(v==true) data='true'; - else data='false'; - }else if(vtype=="string") { - data=''+this.ws_SODAStringEncode(v)+''; - }else if(vtype=="object" && v!=null) { - if((v.constructor+'')==(Array+'')){ - data=''; - for (i=0;i0)? ''+this.ws_Var2SODA(v[i],lvl):this.ws_Var2SODA(v[i],lvl); - } - data+=''; - }else if((v.constructor+'')==(Date+'')){ - //Date format: mm/dd/yyyy hh:nn:ss - v=((v.getMonth()+1)+'/'+v.getDate()+'/'+v.getFullYear()+' '+v.getHours()+':'+v.getMinutes()+':'+v.getSeconds()); - data=''+v+''; - }else { - var keys=[],values=[]; - for(var key in v){ - values[values.length]=v[key]; - if (key.indexOf('|')>=0) key=key.replace(/\|/g,'&s;'); - keys[keys.length]=key; - } - v=[keys.join('|'),values]; - data=''+this.ws_Var2SODA(v,lvl)+''; - }; - }else data='0'; - if (lvl==0) data=''+data+''; - return data; -}; -IOElement.ws_SODA2Var=function(t,lvl){ - var i,tag,data,elms; - var tagType,tagIndex; - - if (lvl>=0)lvl++; - else lvl=0; - - if(lvl==0) { - if((t+'').substr(0,6)!='') return t; - tag=IOElement.ws_getSODATag(t,'soda'); - t=tag.content; - } - - tag=this.ws_getSODATag(t); - tagType=tag.name.substr(0,1); - tagIndex=tag.name.substr(1); - if(tagType=='i') data=parseInt(tag.content); - else if(tagType=='f') data=parseFloat(tag.content); - else if(tagType=='b') data=(tag.content=='true')?true:false; - else if(tagType=='s') data=IOElement.ws_SODAStringDecode(tag.content+''); - else if(tagType=='d') data= new Date(tag.content); - else if(tagType=='a') { - data=[]; - if(tag.content){ - elms=tag.content.split(''); - for (i=0;i=0) key=key.replace(/\&s\;/g,'|'); - data[key]=values[i]; - } - }else if(tagType=='u') data=null; - return data; -}; -IOElement.ws_SODAStringEncode=function (text){ - if (!text) return ''; - // encode string for use with html/javascript - if(this._strEncFormat=='html'){ - text=text.replace(/\\/g,"\\\\"); // \ -> \\ - text=text.replace(/\'/g,"\\'"); // ' -> \' " - text=text.replace(/\n/g,"\\n"); - text=text.replace(/\r/g,"\\r"); - } - // encode string for use with xml/html - text=text.replace(/\&/g,"&"); - text=text.replace(//g,">"); - return text; -}; -IOElement.ws_SODAStringDecode=function (text){ - if (!text) return ''; - text=text.replace(/\&\;/g,"&"); - text=text.replace(/\<\;/g,"<"); - text=text.replace(/\>\;/g,">"); - return text; -}; -IOElement.ws_setStringEncFormat = function(t){ - this._strEncFormat=(t=='xml')? 'xml':'html'; -}; -IOElement.ws_getSODATag=function(t,n){ - var st,et,tag,con; - if(!t) return {}; - n=(n)?n:''; - st=t.indexOf('<'+n); - et=t.indexOf('>',st); - if(st || et) { - tag=t.substr(st+1,(et-1)-st); - st=et+1; - et=t.indexOf(''); - con=t.substr(st,et-st); - - } - return {name:tag,content:con}; -}; -IOElement.ws_SODAParser=function(envelope){ - var r={ - error:IOElement.ws_SODAStringDecode(IOElement.ws_getSODATag(envelope,'err').content), - methodName:IOElement.ws_SODAStringDecode(IOElement.ws_getSODATag(envelope,'method').content), - value:IOElement.ws_SODA2Var(IOElement.ws_getSODATag(envelope,'body').content) - }; - if(r.error) { - var ea=r.error.split('|'); - r.error={code:ea[0],text:ea[1]}; - }else if((envelope+'').indexOf('')!=0){ - r.error={code:'E3',text:IOElement.wsError+':\n\n'+envelope}; - }; - return r; -}; diff --git a/superx/xml/dynapi/util/ioelement.sync.js b/superx/xml/dynapi/util/ioelement.sync.js deleted file mode 100644 index 726b6c1..0000000 --- a/superx/xml/dynapi/util/ioelement.sync.js +++ /dev/null @@ -1,153 +0,0 @@ -/* - DynAPI Distribution - IOElement SYNChronous add-on - - The DynAPI Distribution is distributed under the terms of the GNU LGPL license. - - requires: dynapi.util.IOElement -*/ - -IOElementSync={} -IOElement.SYNC=true; - -var p=IOElement.prototype; - -p.activateSyncMode = function(fn,useJava){ - this._SyncFn=fn; - this._useJava=useJava; - this._hasXMLHttp=(this._hasXMLHttp==null)? IOElement._hasXMLHttp():this._hasXMLHttp; - if (!this.isSync && this._created) { - window.setTimeout(this+'._initSync()',100); - } -}; -p._syncRequest = function(url,data,method){ - var dataBody; - var i,mode,rq,rt={value:''},nv=[]; - var id = this._getRandomID(); // create random load ID to ensure no caching - if(!this.isSync) return; - method=(method+'').toLowerCase(); - mod=(method=='post'||method=='get')? method:'get'; - url=IOElement.getAbsoluteUrl(url); - url += ((url.indexOf('?')==-1)? '?' : '&')+'IORequestID='+id+'&IOMethod='+mod; - for (i in data) { - nv[nv.length]=i+'='+((mod!='get')? data[i]:IOElement.URLEncode(data[i])); - }; - dataBody = nv.join('&'); - if(data && mod=='get') {url+='&'+dataBody;dataBody=null} - // get HTTP Request Object - if(!this._hReq) this._hReq=IOElement._getHttpReq(this._jApplet); - rq=this._hReq; rq.open(mod,url,false); - if (mod=='post') rq.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); - if(dynapi.ua.ns4) { - rq.send(dataBody); rt.value=rq.responseText; - }else { - eval('try {' - +' rq.send(dataBody); rt.value=rq.responseText;' - +'} catch(e) {}'); - } - if(rq.status!=200) rt.error={code:rq.status,text:'Connection Error : '+rq.statusText}; - return rt; -}; -p._initApplet = function(){ - var isJava,doc,scope=this.getScope(this._elmID+'Sync'); - doc=scope.document; - this._jApplet=doc.applets['loadApplet']; - isJava = !(navigator.javaEnabled() && this._jApplet); - if(isJava) alert('IOElement Error: Java Applet not loaded. Java is not enabled on this browser'); - else{ - this.isSync=true; - if (typeof(this._SyncFn)=='function') this._SyncFn(); - else eval(this._SyncFn); - } -}; -p._initSync = function(){ - var evl,ua=dynapi.ua; - if (this._hasXMLHttp && !this._useJava ) { - this.isSync=true; - if (typeof(this._SyncFn)=='function') this._SyncFn(); - else eval(this._SyncFn); - }else { - var t,url,doc; - var scope=this.getScope(this._elmID+'Sync'); - if(!scope) return; - url=dynapi.library.path+'util/'; - t=''; - doc=scope.document; - doc.open();doc.write(t);doc.close(); - window.setTimeout(this+'._initApplet()',1000); // Allow applet to initialize - } -}; -IOElement._getHttpReq = function(jApplet){ - var o,ua=dynapi.ua; - if (jApplet) o = new JavaHttpRequest(jApplet); - else if(IOElement._hasXMLHttp()){ - if (ua.ns) o = new XMLHttpRequest(); - else if (ua.ie) { - var t='try {o = new ActiveXObject("Microsoft.XMLHTTP");}' - +'catch(e){o = new ActiveXObject("MSXML2.XMLHTTP");}' - eval(t); - } - - } - return o; -}; -IOElement._hasXMLHttp = function(){ - var state,ua=dynapi.ua; - // ie for mac,ie4, ns4, ns6.1,x, does not support xmlhttprequest - // while ns 6.2.x (based on gecko 0.9.4) supports xmlhttprequest but - // it does not support sending string via send() - only gecko 0.9.7+ can send string - // netscape 6.x needs the Java-Plugin to support java applets :( - if(ua.ns && navigator.vendor=='Netscape6') state=false; - else if(ua.v>4 && (ua.ns||(ua.ie && ua.win32))) state=true; - return state; -}; - -// GetAbsoluteURL -IOElement.getAbsoluteUrl=function(url, docUrl) { // inspired by afroAPI urlToAbs() - if(url && url.indexOf('://')>0) return url; - docUrl=(docUrl)? docUrl.substring(0,docUrl.lastIndexOf('/')+1):dynapi.documentPath; - url=url.replace(/^(.\/)*/,''); - docUrl=docUrl.replace(/(\?.*)$/,'').replace(/(#.*)*$/,'').replace(/[^\/]*$/,''); - if (url.indexOf('/')==0) return docUrl.substring(0,docUrl.indexOf('/',docUrl.indexOf('//')+2))+url; - else while(url.indexOf('../')==0){ - url=url.replace(/^..\//,''); - docUrl=docUrl.replace(/([^\/]+[\/][^\/]*)$/,''); - }; - return docUrl+url; -}; - -// Java Base HttpRequest -JavaHttpRequest = function(jApplet){ - this.applet=jApplet; - this.url = ""; - this.responseText = ""; - this.status=200;this.statusText=""; -}; -var jhr = JavaHttpRequest.prototype; -jhr.setRequestHeader = function(){}; //dummy -jhr.open = function(method,url){ - this.url = url; - this.method = (method||'get'); -}; -jhr.send = function(data){ - var r,url=this.url; - if (url=="") return false; - - this.responseText = ""; - if (this.applet){ - this.status=200;this.statusText=""; - if(!url.indexOf('file:///') && url.indexOf('file://')) url='file:///'+url.substr(7); - r=this.applet.readURL(url, true, data||"", dynapi.documentPath); - if(r) { - r=new String(r); - r=r.replace(/\n$/,''); - if(r.indexOf('Error: ')==0) { - this.status='403'; - this.statusText=r.substr(7); - } - this.responseText=r; - } - return true; - } -}; - diff --git a/superx/xml/dynapi/util/poolmanager.js b/superx/xml/dynapi/util/poolmanager.js deleted file mode 100644 index c5d64fc..0000000 --- a/superx/xml/dynapi/util/poolmanager.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - DynAPI Distribution - PoolManager Class by Raymond Irving (http://dyntools.shorturl.com) - - The DynAPI Distribution is distributed under the terms of the GNU LGPL license. - - Note: pObj (Parent Object) must implement _CreatePoolObject() and _ResetPoolObject() functions - -*/ - -function PoolManager(pObj){ - this._pool={}; - this._cnt=0; - this._pobj=pObj; -}; -var p = PoolManager.prototype; -p.getObject=function(){ - var o,ob; - // check pool for free object - for(o in this._pool) { - ob=this._pool[o]; - this._pool[o] = null; - delete this._pool[o]; - return ob; - } - // call parent object to create new object - if(this._pobj._CreatePoolObject){ - return this._pobj._CreatePoolObject(); - } -}; -p.storeObject=function(o){ - this._cnt++; - // reset object via _ResetPoolObject - o=this._pobj._ResetPoolObject(o); - this._pool['S'+this._cnt]=o; -}; diff --git a/superx/xml/dynapi/util/stringbuffer.js b/superx/xml/dynapi/util/stringbuffer.js deleted file mode 100644 index 18f41ea..0000000 --- a/superx/xml/dynapi/util/stringbuffer.js +++ /dev/null @@ -1,26 +0,0 @@ -/* - DynAPI Distribution - StringBuffer Class - - The DynAPI Distribution is distributed under the terms of the GNU LGPL license. - -*/ - -function StringBuffer(){ - this.buffer=[]; -}; -var p = StringBuffer.prototype; -p.add=function(src){ - this.buffer[this.buffer.length]=src; -}; -p.flush=function(){ - this.buffer.length=0; -}; -p.getLength=function(){ - return this.buffer.join('').length; -}; -p.toString=function(delim){ - return this.buffer.join(delim||''); -}; - -// More features can be added such as indexOf(), charAt(), etc diff --git a/superx/xml/dynapi/util/url.java b/superx/xml/dynapi/util/url.java deleted file mode 100644 index d86bb19..0000000 --- a/superx/xml/dynapi/util/url.java +++ /dev/null @@ -1,39 +0,0 @@ -import java.applet.Applet; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.InputStreamReader; -import java.io.BufferedReader; -import java.net.URL; -import java.net.URLConnection; - -public class url extends Applet { - private static String auth_cookie = null; - private static StringBuffer c; - public String readURL( String urlStr, boolean cache, String data, String referer) { - c = new StringBuffer(8192); - try { - if ( cache == false ) urlStr.concat((urlStr.indexOf('?')==-1)?"&":"?").concat("stopCache=").concat(Long.toString(System.currentTimeMillis())); - URLConnection uc = new URL( urlStr ).openConnection(); - int len = data.length(); - if (len>0) uc.setDoInput( true ); - uc.setDoOutput( true ); - uc.setRequestProperty( "Referer", referer ); - if ( cache == false ) uc.setUseCaches( false ); - if (len>0) { - byte[] contentBytes = data.getBytes(); - uc.setRequestProperty( "Content-length", Integer.toString( len ) ); - uc.setRequestProperty( "Content-type", "application/x-www-form-urlencoded" ); - OutputStream os = uc.getOutputStream(); - os.write( contentBytes ); - os.flush(); - }; - InputStream is = uc.getInputStream(); - BufferedReader buffer = new BufferedReader(new InputStreamReader(is)); - String line; - while ((line = buffer.readLine())!=null) c.append(line+"\n"); - } catch ( Exception e ) { - c.append("Error: " + e); - }; - return c.toString(); - }; -}; \ No newline at end of file diff --git a/superx/xml/dynapi/version.xml b/superx/xml/dynapi/version.xml deleted file mode 100644 index c1e82e0..0000000 --- a/superx/xml/dynapi/version.xml +++ /dev/null @@ -1,5 +0,0 @@ - - 3 - 0 - 0 - diff --git a/superx/xml/js/memtext/sx_functions.js b/superx/xml/js/memtext/sx_functions.js index 47b1066..75451d7 100644 --- a/superx/xml/js/memtext/sx_functions.js +++ b/superx/xml/js/memtext/sx_functions.js @@ -2118,3 +2118,137 @@ function validiereNeueMaskennr(frm,platform) return true; } } + + +/* Funktionen für Javascript Baum, z.B. GANG Studiengang-Menü: */ +function srcUrl(url,targetElem) + { +this.url=url; +this.targetElem=targetElem; +} + +function treeNode(name,apnr,parent,level,nodeattrib,linkUrl,linkTarget,onClickHandler,isFolder) + { +this.name=name; +this.apnr=apnr; +this.parent=parent; +this.level=level; +this.nodeattrib=nodeattrib; +this.linkUrl=linkUrl; +this.linkTarget=linkTarget; +this.onClickHandler=onClickHandler; +this.isFolder=isFolder; + +} + +function renderTree(treeNodes,targetDiv) +{ +var zs=""; +var zeilenanzahl=treeNodes.length-1; + +//first establish isFolder: +for (var i=0;i <=zeilenanzahl;i++) +{ + if(treeNodeHasChildren(treeNodes,treeNodes[i].apnr)) + treeNodes[i].isFolder=true; +} +zs +="
    "; +for (var i=0;i <=zeilenanzahl;i++) +{ + var myNode=treeNodes[i]; + if(myNode.level==1) //ebene 1 + { + zs+=renderTreeNode(treeNodes,myNode); + } +} +zs+="
"; +document.getElementById(targetDiv).innerHTML=zs; +} +function renderTreeChildNodes(treeNodes,nodeId,spanElem) +{ +var childrenHTML=""; +var childUlId="childOf"+nodeId; +spanElem.classList.toggle("treeCaret-down"); + +if(document.getElementById(childUlId)) +{ + //Kind existiert bereits, wird nur unsichtbar: + document.getElementById(childUlId).classList.toggle("treeNested"); +} +else +{ +//Kind existiert noch nicht: +const childUL=document.createElement("ul"); +childUL.id=childUlId; +childUL.classList.add("treeChildUL"); +spanElem.parentElement.appendChild(childUL); + +var url="";//../../servlet/SuperXmlMaske?tid="+maskentid+"&getJSON_"+fname+"="+nodeId; //xxxxxx-xxxxxx@"; +var suburl=url //+"&"+fname+"="+nodeId; +var ret; + var children=getTreeChildNodes(treeNodes,nodeId); + if(children && children.length >0) + { + for(var j=0;j < children.length;j++) + { + var node=children[j]; + childrenHTML +=renderTreeNode(treeNodes,node); + } + } + childUL.innerHTML=childrenHTML; + + } + + +} + +function getTreeChildNodes(treeNodes,nodeId) +{ + var children=new Array(); + for(i=0;i"; + //hat Element kinder? + if(myNode.isFolder) + { + ret+=" "; + } + if(myNode.onClickHandler !="" && !myNode.isFolder) + { + ret+=""; + + } + else if(myNode.linkUrl!="") + { + ret+=""; + } + ret+= myNode.name; + if(myNode.linkUrl!="") + { + ret+=""; + } + ret+=""; + return ret; +} +function treeNodeHasChildren(treeNodes,nodeId) +{ + var hasChildren=false; + for(i=0;i