// DOMCORE Package / (c) Archimed'2015 / JSE v0.6.3.1 / Cached for 140.77.250.69 (expires 23/10/2015 09:25:24) // // packages.acknowledge('DOMCORE'); // ---------------------------------------------- // DOMCore - Tools - v1.1.3 - mailto:c.chevalier@archimed.fr - Copyright (c) 2000-2003 Archimed SA // (voir le fichier CHANGELOG pour l'historique) function Implements(a,b) { for(var meth in b.prototype) a.prototype[meth] = b.prototype[meth]; if (a.prototype.Implements==null) a.prototype.Implements=objecttypename(b); else a.prototype.Implements+=','+objecttypename(b); } function Includes(a,b) { var prefix = b.prototype.prefix; for(var meth in b.prototype) { if (typeof(b.prototype[meth])=='function') { a.prototype['ui_'+prefix+'_'+meth]=b.prototype[meth]; } } } function objecttypename(obj) { var t=obj.toString(); return t.substring(t.indexOf(' ')+1,t.indexOf('('));} function objecttype(obj) { if (!obj) return 'null'; if (typeof(obj)=='object') { var t=obj.constructor.toString(); return t.substring(t.indexOf(' ')+1,t.indexOf('('));} else return typeof(obj); } function objectvalue(obj) { if (obj==null) return 'null'; if (typeof(obj)=='function') return '[*]'; if (typeof(obj)=='object') return obj.toString(); if (typeof(obj)=='string') return '"'+obj+'"'; return ''+obj; } function objectprototype(obj) { var s='Object '+objecttypename(obj)+' implements '+obj.prototype.Implements+' {\n'; for(var meth in obj.prototype) { if (typeof(obj.prototype[meth])=='function') s+=' '+meth+'\n'; } return s+'}'; } function dumpObject(obj) { var s=''; for(var prop in obj) { var o = obj[prop]; if (typeof(o)=='number') s+=prop+'('+o+'), '; } return s+'\n}'; } function RuntimeError(objSrc,code,msg,desc,objErr) { alert('Error '+code+': '+msg+'\nDesc: '+desc+'\nObjet Src: '+((objSrc!=null)?objSrc.toString():null)+'\nObjet Err: '+((objErr!=null)?objErr.toString():'null')); } // Hashtable function Hashtable() {} with(Hashtable) { prototype.keys = null; prototype.length=0; // retourne la idxième valeur de la map prototype.item = function(idx) { return this['v_'+this.keys[idx]]; //eval('this.v_'+this.keys[idx]); } // ajoute une paire dans la map prototype.insert = function(id,value) { if (!this.keys) this.keys=new Array(); this.keys[this.keys.length]=id; this.length++; return this['v_'+id]=value; //;eval('this.v_'+id+' = value;'); } // modifie une paire dans la map (deja existante) prototype.put = function(id,value) { return this['v_'+id]=value; //eval('this.v_'+id+' = value;'); } // retourne la valeur d'une paire prototype.get = function(id) { return this['v_'+id]; //eval('this.v_'+id); } // retourne une énumeration des keys de la map prototype._enumKeys = function() { if (!this.keys) return null; return new Enumeration(this.keys); } // indique l'existance d'une clé (-1: none, sinon idx) prototype.exists = function(id) { if (!this.keys) return -1; // y a pas de 'contains' rapide dans les array! :( for(var i=0;i=traceLogSize) { // resize log traceLogSize+=100; traceLog[traceLogSize-1]=null; } traceLogHasChanged=true; getElementById('traceConsole').style.display=''; if (JSisIE) { getElementById('traceConsoleInside').insertAdjacentHTML('beforeend',''+traceLog[traceLogCurrent-1]+'
'); getElementById('scrolleu').scrollIntoView(); } else getElementById('traceConsoleInside').innerHTML+=''+traceLog[traceLogCurrent-1]+'
'; } document.write(''); function TraceStart(obj,meth,zis,args) { traceLogStackDepth++; traceLogStack[traceLogStackDepth]=zis; TraceLog('DEB '+obj+'.'+meth+'('+TraceArgs(args)+') on '+zis.toString(),'blue'); } function TraceStop(obj,meth,zis,ret) { TraceLog('FIN return '+objectvalue(ret)+' ['+objecttype(ret)+']','green'); traceLogStack[traceLogStackDepth]=null; traceLogStackDepth--; } function TraceError(msg) { TraceLog(msg,'red'); } function TraceArgs(args) { if (args.length==0) return ''; var ret=''; for(var i=0;i 2) ? argv[2] : null ; var path = (argc > 3) ? argv[3] : null ; var domain = (argc > 4) ? argv[4] : null ; var secure = (argc > 5) ? argv[5] : false ; document.cookie = name + "=" + escape (value) +((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +((path == null) ? "" : ("; path=" + path)) +((domain == null) ? "" : ("; domain=" + domain)) +((secure == true) ? "; secure" : "") ; } JSCookieManager.prototype.toString = function() { if (!this.items) this.init(); var s=''; for(var i=0;i/ig; var xml_ramp = /\&/ig; // ------------------------------------------------------------------------------------------------------- // | DOMNode | // ----------- function DOMNode() { } with(DOMNode) { prototype.attributes=null; prototype.baseName=''; prototype.childNodes=null; prototype.dataType=''; prototype.firstChild=null; prototype.hasChildren=false; prototype.lastChild=null; prototype.nextSibling=null; prototype.nodeName=''; prototype.nodeType=NODE_ELEMENT; prototype.nodeTypeString='element'; prototype.nodeValue=null; prototype.ownerDocument=null; prototype.parentNode=null; prototype.namespaceURI=''; prototype.prefix=''; prototype.previousSibling=null; prototype.text=''; prototype.level=0; prototype.dirty=true; prototype.appendChild = function(newChild) { //Trace(this,'appendChild '+newChild.nodeType+','+newChild.nodeName,newChild); newChild.parentNode = this; newChild.ownerDocument = this.ownerDocument; newChild.id='ID'+this.ownerDocument._counter++; if (newChild.nodeType==NODE_ATTRIBUTE) { //Trace(this,'ajout d\'un attribut',newChild); if (!this.attributes) this.attributes = new DOMAttributeList(); this.attributes.addNamedItem(newChild); } else { //Trace(this,'ajout d\'un element',newChild); if (!this.hasChildren) { this.childNodes=new Array(); this.hasChildren=true; } newChild.level = this.level+1; newChild.childNumber=this.childNodes.length; this.childNodes[this.childNodes.length]=newChild; } return newChild; } prototype.cloneNode = function(deep) { return null; } prototype.hasChildNodes = function() { return this.hasChildren; } prototype.insertBefore = function(newChild, refChild) { } prototype.removeChild = function(childNode) { if (this.hasChildren) { for(var i=0;i0) { for(var j=0;j'; } else { if (!b) if (this.ownerDocument.ommitEmptyNodes) return ''; ar[i++]='/>'; } if (this.ownerDocument.ommitEmptyNodes) { } return ar.join(''); } prototype.exportData = function() { var attrs=null; var txt=null; var chld=null; if (this.attributes) if (this.attributes.length) { attrs=new Array(this.attributes.length); for(var i=0;i=array.length) { // c'est celui la nodeList.add(this); return true; } var name=array[idx]; var nb=-1; var p=name.indexOf('['); if (p>0) { var q=name.indexOf(']'); nb=parseInt(name.substring(p+1,q)); name=name.substring(0,p); } if (name.charAt(0)=='@') { var attr= this.attributes.get(name.substring(1)); if (attr!=null) nodeList.add(attr); return true; // il ne peut y avoir qu'un attribut avec ce nom, et il n'a pas de fils } // recherche le nbième node name en dessous de moi b=false; if (this.childNodes) for(var i=0;i=this.length-1)?null:this.nodes[++this.cursor]; } prototype.nextNode = function() { return ((i<0)||(i>=this.length))?null:this.nodes[i]; } prototype.reset = function() { this.cursor=-1; } prototype.add = function(item) { this.nodes[this.length++]=item; } prototype.iter = function(fct) { for(var i=0;i deselect if (this.selectionContains(element)) { this.deselect(element); } else { this.selection[this.selection.length]=element; if (bTriggeredByMe) { element.select(); this.fireEvent('onSelectionChange'); } } if (bTriggeredByMe) { this._selectionIsChanging=false; this._selectionTriggerdBy=null; } return; } prototype.selectionContains=function(element) { if (!this.selection) return false; for(var i=0;i'; this.holder.appendChild(ifr); //ifr.src=url; frm.submit(); } else { this.holder.insertAdjacentHTML('beforeEnd','
'); frm = document.forms['frm_req_'+cpt]; frm.DATA.value = data; this.holder.insertAdjacentHTML('beforeEnd',''); var ifr=document.getElementById('ifr_req_'+cpt); frm.submit(); } window.setTimeout('requestBroker.timeOut('+cpt+')',srvTimeout); } prototype.run = function(url,prm,callback,errorHandler,srvTimeout,rqTimeout) { if (!this.ready) this.init(); if (!this.ready) { errorHandler(RB_ERROR_SYSTEMERROR,'RequestBroker unavailable'); return; } var cpt=this.counter++; if (url.indexOf('?')<0) url+='?RID='+cpt; else url+='&RID='+cpt; var t=new Array(7); t[0]=cpt; t[1]=url; t[2]=callback; t[3]=errorHandler; t[4]=false; t[5]=prm; t[6]=rqTimeout; this.list[this.list.length]=t; var ifr; if (JSisMZ) { ifr=document.createElement("iframe"); ifr.id="ifr_req_"+cpt; this.holder.appendChild(ifr); ifr.src=url; } else { this.holder.insertAdjacentHTML('beforeEnd',''); var ifr=document.getElementById('ifr_req_'+cpt); ifr.src=url; } window.setTimeout('requestBroker.timeOut('+cpt+')',srvTimeout); } prototype.find = function(id) { for(var i=0;i