Code Duplication    Length = 1-12 lines in 2 locations

api/js/dhtmlxtree/sources/dhtmlxtree.js 1 location

@@ 441-452 (lines=12) @@
438
*     @param: afterCall - function which will be called after xml loading
439
*     @topic: 0
440
*/
441
	dhtmlXTreeObject.prototype.loadXML=function(file,afterCall){ 
442
          afterCall = afterCall || this.AJAX_callback;
443
	  if (this._datamode && this._datamode!="xml") return this["load"+this._datamode.toUpperCase()](file,afterCall);
444
        var that=this;
445
      if (!this.parsCount) this.callEvent("onXLS",[that,this._ld_id]);
446
      this._ld_id=null;
447
      this.xmlstate=1;
448
      this.XMLLoader=new dtmlXMLLoaderObject(this._parseXMLTree,this,true,this.no_cashe);
449
450
      if (afterCall) this.XMLLoader.waitCall=afterCall;
451
      this.XMLLoader.loadXML(file);
452
   };
453
/**
454
*     @desc: create new child node
455
*     @type: private

api/js/dhtmlxtree/codebase/dhtmlxtree.js 1 location

@@ 28-28 (lines=1) @@
25
this,f);this.htmlNode.objBelong=this;return this}dhtmlXTreeObject.prototype._globalIdStorageAdd=function(a,b){if(this._globalIdStorageFind(a,1,1))return a=a+"_"+(new Date).valueOf(),this._globalIdStorageAdd(a,b);this._idpull[a]=b;this._pullSize++;return a};dhtmlXTreeObject.prototype._globalIdStorageSub=function(a){this._idpull[a]&&(this._unselectItem(this._idpull[a]),this._idpull[a]=null,this._pullSize--);this._locker&&this._locker[a]&&(this._locker[a]=!1)};
26
dhtmlXTreeObject.prototype._globalIdStorageFind=function(a){var b=this._idpull[a];return b?b:null};dhtmlXTreeObject.prototype._escape=function(a){switch(this.utfesc){case "none":return a;case "utf8":return encodeURIComponent(a);default:return escape(a)}};
27
dhtmlXTreeObject.prototype._drawNewTr=function(a){var b=document.createElement("tr"),c=document.createElement("td"),d=document.createElement("td");c.appendChild(document.createTextNode(" "));d.colSpan=3;d.appendChild(a);b.appendChild(c);b.appendChild(d);return b};dhtmlXTreeObject.prototype.loadXMLString=function(a,b){var c=this;this.parsCount||this.callEvent("onXLS",[c,null]);this.xmlstate=1;if(b)this.XMLLoader.waitCall=b;this.XMLLoader.loadXMLString(a)};
28
dhtmlXTreeObject.prototype.loadXML=function(a,b){if(this._datamode&&this._datamode!="xml")return this["load"+this._datamode.toUpperCase()](a,b);var c=this;this.parsCount||this.callEvent("onXLS",[c,this._ld_id]);this._ld_id=null;this.xmlstate=1;this.XMLLoader=new dtmlXMLLoaderObject(this._parseXMLTree,this,!0,this.no_cashe);if(b)this.XMLLoader.waitCall=b;this.XMLLoader.loadXML(a)};
29
dhtmlXTreeObject.prototype._attachChildNode=function(a,b,c,d,e,f,g,h,j,i,m){if(i&&i.parentObject)a=i.parentObject;if(a.XMLload==0&&this.XMLsource&&!this.XMLloadingWarning)a.XMLload=1,this._loadDynXML(a.id);var l=a.childsCount,k=a.childNodes;if(m&&m.tr.previousSibling)m.tr.previousSibling.previousSibling?i=m.tr.previousSibling.nodem:h=h.replace("TOP","")+",TOP";if(i){var o,r;for(o=0;o<l;o++)if(k[o]==i){for(r=l;r!=o;r--)k[1+r]=k[r];break}o++;l=o}if(h)for(var s=h.split(","),p=0;p<s.length;p++)switch(s[p]){case "TOP":if(a.childsCount>
30
0)i={},i.tr=a.childNodes[0].tr.previousSibling;a._has_top=!0;for(o=l;o>0;o--)k[o]=k[o-1];l=0}var n;if(!(n=this._idpull[b])||n.span!=-1)n=k[l]=new dhtmlXTreeItemObject(b,c,a,this,d,1),b=k[l].id,a.childsCount++;if(!n.htmlNode)n.label=c,n.htmlNode=this._createItem(this.checkBoxOff?1:0,n),n.htmlNode.objBelong=n;e&&(n.images[0]=e);f&&(n.images[1]=f);g&&(n.images[2]=g);var q=this._drawNewTr(n.htmlNode);if(this.XMLloadingWarning||this._hAdI)n.htmlNode.parentNode.parentNode.style.display="none";i&&i.tr&&
31
i.tr.nextSibling?a.htmlNode.childNodes[0].insertBefore(q,i.tr.nextSibling):this.parsingOn==a.id?this.parsedArray[this.parsedArray.length]=q:a.htmlNode.childNodes[0].appendChild(q);i&&!i.span&&(i=null);if(this.XMLsource)n.XMLload=j&&j!=0?0:1;n.tr=q;q.nodem=n;if(a.itemId==0)q.childNodes[0].className="hiddenRow";(a._r_logic||this._frbtr)&&this._setSrc(n.htmlNode.childNodes[0].childNodes[0].childNodes[1].childNodes[0],this.imPath+this.radioArray[0]);if(h){s=h.split(",");for(p=0;p<s.length;p++)switch(s[p]){case "SELECT":this.selectItem(b,