diff --git a/Gruntfile.js b/Gruntfile.js index 8825ac2758..b91a06770f 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -41,7 +41,6 @@ module.exports = function (grunt) { files: { "pixelegg/css/pixelegg.min.css": [ "node_modules/flatpickr/dist/themes/light.css", - "api/js/dhtmlxtree/codebase/dhtmlxtree.css", "api/js/egw_action/test/skins/dhtmlxmenu_egw.css", "vendor/bower-asset/diff2html/dist/diff2html.css", "vendor/bower-asset/cropper/dist/cropper.min.css", @@ -54,7 +53,6 @@ module.exports = function (grunt) { ], "pixelegg/css/mobile.min.css": [ "node_modules/flatpickr/dist/themes/light.css", - "api/js/dhtmlxtree/codebase/dhtmlxtree.css", "api/js/egw_action/test/skins/dhtmlxmenu_egw.css", "vendor/bower-asset/diff2html/dist/diff2html.css", "vendor/bower-asset/cropper/dist/cropper.min.css", @@ -67,7 +65,6 @@ module.exports = function (grunt) { ], "pixelegg/mobile/fw_mobile.min.css": [ "node_modules/flatpickr/dist/themes/light.css", - "api/js/dhtmlxtree/codebase/dhtmlxtree.css", "api/js/egw_action/test/skins/dhtmlxmenu_egw.css", "api/js/etemplate/lib/jsdifflib/diffview.css", "vendor/bower-asset/cropper/dist/cropper.min.css", @@ -80,7 +77,6 @@ module.exports = function (grunt) { ], "pixelegg/css/monochrome.min.css": [ "node_modules/flatpickr/dist/themes/light.css", - "api/js/dhtmlxtree/codebase/dhtmlxtree.css", "api/js/egw_action/test/skins/dhtmlxmenu_egw.css", "vendor/bower-asset/diff2html/dist/diff2html.css", "vendor/bower-asset/cropper/dist/cropper.min.css", @@ -93,7 +89,6 @@ module.exports = function (grunt) { ], "pixelegg/css/modern.min.css": [ "node_modules/flatpickr/dist/themes/light.css", - "api/js/dhtmlxtree/codebase/dhtmlxtree.css", "api/js/egw_action/test/skins/dhtmlxmenu_egw.css", "vendor/bower-asset/diff2html/dist/diff2html.css", "vendor/bower-asset/cropper/dist/cropper.min.css", diff --git a/api/js/dhtmlxtree/License_GPL.html b/api/js/dhtmlxtree/License_GPL.html deleted file mode 100755 index afe2ef33f0..0000000000 --- a/api/js/dhtmlxtree/License_GPL.html +++ /dev/null @@ -1,73 +0,0 @@ -

GNU GENERAL PUBLIC LICENSE

-Version 2, June 1991

-

-

Copyright (C) 1989, 1991 Free Software Foundation, Inc.

-

59 Temple Place - Suite 330, Boston, MA 02111-1307, USA

-

-

Everyone is permitted to copy and distribute verbatim copies

-

of this license document, but changing it is not allowed.

-

-

-

TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

-

0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you".

-

-

Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.

-

-

1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.

-

-

You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.

-

-

2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:

-

-

-

a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.

-

-

b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.

-

-

c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)

-

These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.

-

-

Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.

-

-

In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.

-

-

3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:

-

-

a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,

-

-

b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,

-

-

c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)

-

The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.

-

-

If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.

-

-

4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.

-

-

5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.

-

-

6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.

-

-

7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.

-

-

If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.

-

-

It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.

-

-

This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.

-

-

8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.

-

-

9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.

-

-

Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.

-

-

10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.

-

-

NO WARRANTY

-

-

11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

-

-

12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

-

-

\ No newline at end of file diff --git a/api/js/dhtmlxtree/codebase/dhtmlxcommon.js b/api/js/dhtmlxtree/codebase/dhtmlxcommon.js deleted file mode 100644 index b40d4be75c..0000000000 --- a/api/js/dhtmlxtree/codebase/dhtmlxcommon.js +++ /dev/null @@ -1,54 +0,0 @@ -//v.3.6 build 131023 - -/* -Copyright DHTMLX LTD. http://www.dhtmlx.com -You allowed to use this component or parts of it under GPL terms -To use it on other terms or get Professional edition of the component please contact us at sales@dhtmlx.com -*/ -dhtmlx=function(a){for(var b in a)dhtmlx[b]=a[b];return dhtmlx};dhtmlx.extend_api=function(a,b,c){var d=window[a];if(d)window[a]=function(a){if(a&&typeof a=="object"&&!a.tagName){var c=d.apply(this,b._init?b._init(a):arguments),f;for(f in dhtmlx)if(b[f])this[b[f]](dhtmlx[f]);for(f in a)if(b[f])this[b[f]](a[f]);else f.indexOf("on")==0&&this.attachEvent(f,a[f])}else c=d.apply(this,arguments);b._patch&&b._patch(this);return c||this},window[a].prototype=d.prototype,c&&dhtmlXHeir(window[a].prototype,c)}; -dhtmlxAjax={get:function(a,b){var c=new dtmlXMLLoaderObject(!0);c.async=arguments.length<3;c.waitCall=b;c.loadXML(a);return c},post:function(a,b,c){var d=new dtmlXMLLoaderObject(!0);d.async=arguments.length<4;d.waitCall=c;d.loadXML(a,!0,b);return d},getSync:function(a){return this.get(a,null,!0)},postSync:function(a,b){return this.post(a,b,null,!0)}}; -function dtmlXMLLoaderObject(a,b,c,d){this.xmlDoc="";this.async=typeof c!="undefined"?c:!0;this.onloadAction=a||null;this.mainObject=b||null;this.waitCall=null;this.rSeed=d||!1;return this}dtmlXMLLoaderObject.count=0; -dtmlXMLLoaderObject.prototype.waitLoadFunction=function(a){var b=!0;return this.check=function(){if(a&&a.onloadAction!=null&&(!a.xmlDoc.readyState||a.xmlDoc.readyState==4)&&b){b=!1;dtmlXMLLoaderObject.count++;if(typeof a.onloadAction=="function")a.onloadAction(a.mainObject,null,null,null,a);if(a.waitCall)a.waitCall.call(this,a),a.waitCall=null}}}; -dtmlXMLLoaderObject.prototype.getXMLTopNode=function(a,b){if(this.xmlDoc.responseXML){var c=this.xmlDoc.responseXML.getElementsByTagName(a);c.length==0&&a.indexOf(":")!=-1&&(c=this.xmlDoc.responseXML.getElementsByTagName(a.split(":")[1]));var d=c[0]}else d=this.xmlDoc.documentElement;if(d)return this._retry=!1,d;if(!this._retry&&_isIE)return this._retry=!0,b=this.xmlDoc,this.loadXMLString(this.xmlDoc.responseText.replace(/^[\s]+/,""),!0),this.getXMLTopNode(a,b);dhtmlxError.throwError("LoadXML","Incorrect XML", -[b||this.xmlDoc,this.mainObject]);return document.createElement("DIV")};dtmlXMLLoaderObject.prototype.loadXMLString=function(a,b){if(_isIE)this.xmlDoc=new ActiveXObject("Microsoft.XMLDOM"),this.xmlDoc.async=this.async,this.xmlDoc.onreadystatechange=function(){},this.xmlDoc.loadXML(a);else{var c=new DOMParser;this.xmlDoc=c.parseFromString(a,"text/xml")}if(!b){if(this.onloadAction)this.onloadAction(this.mainObject,null,null,null,this);if(this.waitCall)this.waitCall(),this.waitCall=null}}; -dtmlXMLLoaderObject.prototype.loadXML=function(a,b,c,d){this.rSeed&&(a+=(a.indexOf("?")!=-1?"&":"?")+"a_dhx_rSeed="+(new Date).valueOf());this.filePath=a;this.xmlDoc=!_isIE&&window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");if(this.async)this.xmlDoc.onreadystatechange=new this.waitLoadFunction(this);this.xmlDoc.open(b?"POST":"GET",a,this.async);d?(this.xmlDoc.setRequestHeader("User-Agent","dhtmlxRPC v0.1 ("+navigator.userAgent+")"),this.xmlDoc.setRequestHeader("Content-type", -"text/xml")):b&&this.xmlDoc.setRequestHeader("Content-type",this.contenttype||"application/x-www-form-urlencoded");this.xmlDoc.setRequestHeader("X-Requested-With","XMLHttpRequest");this.xmlDoc.send(c);this.async||(new this.waitLoadFunction(this))()}; -dtmlXMLLoaderObject.prototype.destructor=function(){return this.setXSLParamValue=this.getXMLTopNode=this.xmlNodeToJSON=this.doSerialization=this.loadXMLString=this.loadXML=this.doXSLTransToString=this.doXSLTransToObject=this.doXPathOpera=this.doXPath=this.xmlDoc=this.mainObject=this.onloadAction=this.filePath=this.rSeed=this.async=this._retry=this._getAllNamedChilds=this._filterXPath=null}; -dtmlXMLLoaderObject.prototype.xmlNodeToJSON=function(a){for(var b={},c=0;c-1&&(_isChrome=!0); -if(navigator.userAgent.indexOf("Safari")!=-1||navigator.userAgent.indexOf("Konqueror")!=-1)_KHTMLrv=parseFloat(navigator.userAgent.substr(navigator.userAgent.indexOf("Safari")+7,5)),_KHTMLrv>525?(_isFF=!0,_FFrv=1.9):_isKHTML=!0;else if(navigator.userAgent.indexOf("Opera")!=-1)_isOpera=!0,_OperaRv=parseFloat(navigator.userAgent.substr(navigator.userAgent.indexOf("Opera")+6,3));else if(navigator.appName.indexOf("Microsoft")!=-1){if(_isIE=!0,(navigator.appVersion.indexOf("MSIE 8.0")!=-1||navigator.appVersion.indexOf("MSIE 9.0")!= --1||navigator.appVersion.indexOf("MSIE 10.0")!=-1||document.documentMode>7)&&document.compatMode!="BackCompat")_isIE=8}else navigator.appName=="Netscape"&&navigator.userAgent.indexOf("Trident")!=-1?_isIE=8:(_isFF=!0,_FFrv=parseFloat(navigator.userAgent.split("rv:")[1])); -dtmlXMLLoaderObject.prototype.doXPath=function(a,b,c,d){if(_isKHTML||!_isIE&&!window.XPathResult)return this.doXPathOpera(a,b);if(_isIE)return b||(b=this.xmlDoc.nodeName?this.xmlDoc:this.xmlDoc.responseXML),b||dhtmlxError.throwError("LoadXML","Incorrect XML",[b||this.xmlDoc,this.mainObject]),c!=null&&b.setProperty("SelectionNamespaces","xmlns:xsl='"+c+"'"),d=="single"?b.selectSingleNode(a):b.selectNodes(a)||[];else{var e=b;b||(b=this.xmlDoc.nodeName?this.xmlDoc:this.xmlDoc.responseXML);b||dhtmlxError.throwError("LoadXML", -"Incorrect XML",[b||this.xmlDoc,this.mainObject]);b.nodeName.indexOf("document")!=-1?e=b:(e=b,b=b.ownerDocument);var g=XPathResult.ANY_TYPE;if(d=="single")g=XPathResult.FIRST_ORDERED_NODE_TYPE;var f=[],h=b.evaluate(a,e,function(){return c},g,null);if(g==XPathResult.FIRST_ORDERED_NODE_TYPE)return h.singleNodeValue;for(var i=h.iterateNext();i;)f[f.length]=i,i=h.iterateNext();return f}};function j(){if(!this.catches)this.catches=[];return this}j.prototype.catchError=function(a,b){this.catches[a]=b}; -j.prototype.throwError=function(a,b,c){if(this.catches[a])return this.catches[a](a,b,c);if(this.catches.ALL)return this.catches.ALL(a,b,c);alert("Error type: "+a+"\nDescription: "+b);return null};window.dhtmlxError=new j; -dtmlXMLLoaderObject.prototype.doXPathOpera=function(a,b){var c=a.replace(/[\/]+/gi,"/").split("/"),d=null,e=1;if(!c.length)return[];if(c[0]==".")d=[b];else if(c[0]=="")d=(this.xmlDoc.responseXML||this.xmlDoc).getElementsByTagName(c[e].replace(/\[[^\]]*\]/g,"")),e++;else return[];for(;e body /**/ .dhxtree_dhx_skyblue .selectedTreeRow, html > body /**/ .dhxtree_dhx_skyblue .selectedTreeRow_lor{ - padding:1px 0px 1px 0px; - line-height:normal; - display:inline-block !ie; - height:13px; -} -body:nth-of-type(1) .dhxtree_dhx_skyblue span.selectedTreeRow, body:nth-of-type(1) .dhxtree_dhx_skyblue span.selectedTreeRow_lor{ - padding:1px 0px 1px 0px; - display:inline-block; - padding-top:0px; - height:13px; -} -body:nth-of-type(1) .dhxtree_dhx_skyblue span.standartTreeRow, body:nth-of-type(1) .dhxtree_dhx_skyblue span.standartTreeRow_lor{ - display:inline-block; - height:14px; -} - -.dhxtree_dhx_web .selectedTreeRow_lor, .dhxtree_dhx_web .selectedTreeRow{ - background-color:transparent; - -} -.dhxtree_dhx_web span.selectedTreeRow_lor , .dhxtree_dhx_web span.selectedTreeRow{ - background-color:#ACDAF0; - color:black; -} - -.dhxtree_dhx_web td.standartTreeRow, .dhxtree_dhx_web td.selectedTreeRow{ - padding-left:2px; -} -.dhxtree_dhx_web span.standartTreeRow, .dhxtree_dhx_web span.selectedTreeRow{ - padding-left:3px !important; -} - - - -.dhxtree_dhx_web .standartTreeRow, .dhxtree_dhx_web .standartTreeRow, .dhxtree_dhx_web .selectedTreeRow_lor, .dhxtree_dhx_web .selectedTreeRow{ - font-size:12px; - font-family:Tahoma; - overflow:hidden; -} - - -.dhxtree_dhx_terrace .standartTreeRow, .dhxtree_dhx_terrace .standartTreeRow, .dhxtree_dhx_terrace .selectedTreeRow_lor, .dhxtree_dhx_terrace .selectedTreeRow{ - font-family:Arial; - font-size:13px; - padding:3px 1px 4px 2px; -} - -.dhxtree_dhx_terrace .standartTreeImage{ - padding-left:3px -} -.dhxtree_dhx_terrace .selectedTreeRow_lor, .dhxtree_dhx_terrace .selectedTreeRow{ - background-color:transparent; - -} -.dhxtree_dhx_terrace span.selectedTreeRow_lor , .dhxtree_dhx_terrace span.selectedTreeRow{ - background-color:#fff3a1; - color:black; -} \ No newline at end of file diff --git a/api/js/dhtmlxtree/codebase/dhtmlxtree.js b/api/js/dhtmlxtree/codebase/dhtmlxtree.js deleted file mode 100644 index 73c56bf7ad..0000000000 --- a/api/js/dhtmlxtree/codebase/dhtmlxtree.js +++ /dev/null @@ -1,147 +0,0 @@ -//v.3.6 build 131023 - -/* -Copyright DHTMLX LTD. http://www.dhtmlx.com -You allowed to use this component or parts of it under GPL terms -To use it on other terms or get Professional edition of the component please contact us at sales@dhtmlx.com -*/ -function xmlPointer(a){this.d=a} -xmlPointer.prototype={text:function(){if(!_isFF)return this.d.xml;var a=new XMLSerializer;return a.serializeToString(this.d)},get:function(a){return this.d.getAttribute(a)},exists:function(){return!!this.d},content:function(){return this.d.firstChild?this.d.firstChild.data:""},each:function(a,b,c,d){var e=this.d.childNodes,f=new xmlPointer;if(e.length)for(d=d||0;d -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&& -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=2&&(this._correctPlus(k[a.childsCount-2]), -this._correctLine(k[a.childsCount-2])),a.childsCount!=2&&this._correctPlus(k[0]),this.tscheck&&this._correctCheckStates(a),this._onradh))if(this.xmlstate==1){var t=this.onXLE;this.onXLE=function(a){this._onradh(b);t&&t(a)}}else this._onradh(b);return n};dhtmlXTreeObject.prototype.insertNewItem=function(a,b,c,d,e,f,g,h,j){var i=this._globalIdStorageFind(a);if(!i)return-1;var m=this._attachChildNode(i,b,c,d,e,f,g,h,j);if(!this._idpull[this.rootId].XMLload)this._idpull[this.rootId].XMLload=1;return m}; -dhtmlXTreeObject.prototype.insertNewChild=function(a,b,c,d,e,f,g,h,j){return this.insertNewItem(a,b,c,d,e,f,g,h,j)};dhtmlXTreeObject.prototype._parseXMLTree=function(a,b,c,d,e){var f=new xmlPointer(e.getXMLTopNode("tree"));a._parse(f);a._p=f}; -dhtmlXTreeObject.prototype._parseItem=function(a,b,c,d){var e;if(this._srnd&&(!this._idpull[e=a.get("id")]||!this._idpull[e].span))this._addItemSRND(b.id,e,a);else{var f=a.get_all();if(typeof this.waitUpdateXML=="object"&&!this.waitUpdateXML[f.id])this._parse(a,f.id,1);else{var g=[];f.select&&g.push("SELECT");f.top&&g.push("TOP");if(f.call)this.nodeAskingCall=f.id;f.checked==-1?g.push("HCHECKED"):f.checked&&g.push("CHECKED");f.open&&g.push("OPEN");if(this.waitUpdateXML)if(this._globalIdStorageFind(f.id))var h= -this.updateItem(f.id,f.text,f.im0,f.im1,f.im2,f.checked,f.child);else this.npl==0?g.push("TOP"):c=b.childNodes[this.npl],h=this._attachChildNode(b,f.id,f.text,0,f.im0,f.im1,f.im2,g.join(","),f.child,0,c),f.id=h.id,c=null;else h=this._attachChildNode(b,f.id,f.text,0,f.im0,f.im1,f.im2,g.join(","),f.child,d||0,c);if(f.tooltip)h.span.parentNode.parentNode.title=f.tooltip;f.style&&(h.span.style.cssText?h.span.style.cssText+=";"+f.style:h.span.setAttribute("style",h.span.getAttribute("style")+"; "+f.style)); -if(f.radio)h._r_logic=!0;if(f.nocheckbox){var j=h.span.parentNode.previousSibling.previousSibling;j.style.display="none";h.nocheckbox=!0}f.disabled&&(f.checked!=null&&this._setCheck(h,f.checked),this.disableCheckbox(h,1));h._acc=f.child||0;this.parserExtension&&this.parserExtension._parseExtension.call(this,a,f,b?b.id:0);this.setItemColor(h,f.aCol,f.sCol);f.locked=="1"&&this.lockItem(h.id,!0,!0);(f.imwidth||f.imheight)&&this.setIconSize(f.imwidth,f.imheight,h);(f.closeable=="0"||f.closeable=="1")&& -this.setItemCloseable(h,f.closeable);var i="";f.topoffset&&this.setItemTopOffset(h,f.topoffset);if(!this.slowParse||typeof this.waitUpdateXML=="object")a.sub_exists("item")&&(i=this._parse(a,f.id,1));if(i!="")this.nodeAskingCall=i;a.each("userdata",function(b){this.setUserData(a.get("id"),b.get("name"),b.content())},this)}}}; -dhtmlXTreeObject.prototype._parse=function(a,b,c,d){if(this._srnd&&!this.parentObject.offsetHeight){var e=this;return window.setTimeout(function(){e._parse(a,b,c,d)},100)}if(a.exists()){this.skipLock=!0;if(!b){var b=a.get("id"),f=a.get("dhx_security");if(f)dhtmlx.security_key=f;if(a.get("radio"))this.htmlNode._r_logic=!0;this.parsingOn=b;this.parsedArray=[];this.nodeAskingCall=this.setCheckList=""}var g=this._globalIdStorageFind(b);if(!g)return dhtmlxError.throwError("DataStructure","XML refers to not existing parent"); -this.parsCount=this.parsCount?this.parsCount+1:1;this.XMLloadingWarning=1;var h=g.childsCount&&!d&&!this._edsbps&&!g._has_top?0:0;this.npl=0;a.each("item",function(a){g.XMLload=1;this._parseItem(a,g,0,h);this.npl++},this,d);if(!c){a.each("userdata",function(b){this.setUserData(a.get("id"),b.get("name"),b.content())},this);g.XMLload=1;if(this.waitUpdateXML){this.waitUpdateXML=!1;for(var j=g.childsCount-1;j>=0;j--)g.childNodes[j]._dmark&&this.deleteItem(g.childNodes[j].id)}for(var i=this._globalIdStorageFind(this.parsingOn), -j=0;j1){(c[1].style.display!="none"||b==1)&&b!=2?(this.allTree.childNodes[0].border="1",this.allTree.childNodes[0].border="0",nodestyle="none"):nodestyle="";for(var e=1;e7)k.style.width="999999px";else if(!window._KHTMLrv)k.style.width="100%";b.span.innerHTML=b.label;k.appendChild(b.span);k.parentObject=b;g.parentObject=b;k.onclick= -this.onRowSelect;g.onclick=this.onRowClick;k.ondblclick=this.onRowClick2;if(this.ettip)f.title=b.label;if(this.dragAndDropOff){if(this._aimgs)this.dragger.addDraggableItem(m,this),m.parentObject=b;this.dragger.addDraggableItem(k,this)}b.span.style.paddingLeft="5px";b.span.style.paddingRight="5px";k.style.verticalAlign="";k.style.fontSize="10pt";k.style.cursor=this.style_pointer;f.appendChild(g);f.appendChild(j);f.appendChild(m);f.appendChild(k);e.appendChild(f);d.appendChild(e);if(this.ehlt||this.checkEvent("onMouseIn")|| -this.checkEvent("onMouseOut"))f.onmousemove=this._itemMouseIn,f[_isIE?"onmouseleave":"onmouseout"]=this._itemMouseOut;return d};dhtmlXTreeObject.prototype.setImagePath=function(a){this.iconURL=this.imPath=a};dhtmlXTreeObject.prototype.setIconPath=function(a){this.iconURL=a};dhtmlXTreeObject.prototype.setOnRightClickHandler=function(a){this.attachEvent("onRightClick",a)};dhtmlXTreeObject.prototype.setOnClickHandler=function(a){this.attachEvent("onClick",a)}; -dhtmlXTreeObject.prototype.setOnSelectStateChange=function(a){this.attachEvent("onSelect",a)};dhtmlXTreeObject.prototype.setXMLAutoLoading=function(a){this.XMLsource=a};dhtmlXTreeObject.prototype.setOnCheckHandler=function(a){this.attachEvent("onCheck",a)};dhtmlXTreeObject.prototype.setOnOpenHandler=function(a){this.attachEvent("onOpenStart",a)};dhtmlXTreeObject.prototype.setOnOpenStartHandler=function(a){this.attachEvent("onOpenStart",a)}; -dhtmlXTreeObject.prototype.setOnOpenEndHandler=function(a){this.attachEvent("onOpenEnd",a)};dhtmlXTreeObject.prototype.setOnDblClickHandler=function(a){this.attachEvent("onDblClick",a)};dhtmlXTreeObject.prototype.openAllItems=function(a){var b=this._globalIdStorageFind(a);if(!b)return 0;this._xopenAll(b)};dhtmlXTreeObject.prototype.getOpenState=function(a){var b=this._globalIdStorageFind(a);return!b?"":this._getOpenState(b)}; -dhtmlXTreeObject.prototype.closeAllItems=function(a){if(a===window.undefined)a=this.rootId;var b=this._globalIdStorageFind(a);if(!b)return 0;this._xcloseAll(b);this.allTree.childNodes[0].border="1";this.allTree.childNodes[0].border="0"}; -dhtmlXTreeObject.prototype.setUserData=function(a,b,c){var d=this._globalIdStorageFind(a,0,!0);if(d){if(b=="hint")d.htmlNode.childNodes[0].childNodes[0].title=c;if(typeof d.userData["t_"+b]=="undefined")d._userdatalist?d._userdatalist+=","+b:d._userdatalist=b;d.userData["t_"+b]=c}};dhtmlXTreeObject.prototype.getUserData=function(a,b){var c=this._globalIdStorageFind(a,0,!0);return!c?void 0:c.userData["t_"+b]}; -dhtmlXTreeObject.prototype.getItemColor=function(a){var b=this._globalIdStorageFind(a);if(!b)return 0;var c={};if(b.acolor)c.acolor=b.acolor;if(b.scolor)c.scolor=b.scolor;return c};dhtmlXTreeObject.prototype.setItemColor=function(a,b,c){var d=a&&a.span?a:this._globalIdStorageFind(a);if(d){if(d.i_sel){if(c)d.span.style.color=c}else if(b)d.span.style.color=b;if(c)d.scolor=c;if(b)d.acolor=b}else return 0}; -dhtmlXTreeObject.prototype.getItemText=function(a){var b=this._globalIdStorageFind(a);return!b?0:b.htmlNode.childNodes[0].childNodes[0].childNodes[3].childNodes[0].innerHTML};dhtmlXTreeObject.prototype.getParentId=function(a){var b=this._globalIdStorageFind(a);return!b||!b.parentObject?"":b.parentObject.id};dhtmlXTreeObject.prototype.changeItemId=function(a,b){if(a!=b){var c=this._globalIdStorageFind(a);if(!c)return 0;c.id=b;c.span.contextMenuId=b;this._idpull[b]=this._idpull[a];delete this._idpull[a]}}; -dhtmlXTreeObject.prototype.doCut=function(){this.nodeCut&&this.clearCut();this.nodeCut=[].concat(this._selected);for(var a=0;a=2&&(this._correctPlus(i[b.childsCount-2]),this._correctLine(i[b.childsCount-2]));this._correctPlus(i[b.childsCount-1]);this.tscheck&&this._correctCheckStates(b);e.tscheck&&e._correctCheckStates(g)}f>1&&(e._correctPlus(g.childNodes[f-2]),e._correctLine(g.childNodes[f-2]));e._correctPlus(g);e._correctLine(g);this.callEvent("onDrop",[a.id,b.id,c?c.id:null,e,b.treeNod]);return a.id}; -dhtmlXTreeObject.prototype._clearStyles=function(a){if(a.htmlNode){var b=a.htmlNode.childNodes[0].childNodes[0].childNodes[1],c=b.nextSibling.nextSibling;a.span.innerHTML=a.label;a.i_sel=!1;a._aimgs&&this.dragger.removeDraggableItem(b.nextSibling);this.checkBoxOff?(b.childNodes[0].style.display="",b.childNodes[0].onclick=this.onCheckBoxClick,this._setSrc(b.childNodes[0],this.imPath+this.checkArray[a.checkstate])):b.childNodes[0].style.display="none";b.childNodes[0].treeNod=this;this.dragger.removeDraggableItem(c); -this.dragAndDropOff&&this.dragger.addDraggableItem(c,this);this._aimgs&&this.dragger.addDraggableItem(b.nextSibling,this);c.childNodes[0].className="standartTreeRow";c.onclick=this.onRowSelect;c.ondblclick=this.onRowClick2;b.previousSibling.onclick=this.onRowClick;this._correctLine(a);this._correctPlus(a);for(var d=0;d0){var d=a.childNodes[c].unParsed?this._getAllScraggyItemsXML(a.childNodes[c].unParsed,1):this._getAllScraggyItems(a.childNodes[c]);d&&(b?b+=this.dlmtr+d:b=d)}else b?b+=this.dlmtr+a.childNodes[c].id:b=""+a.childNodes[c].id;return b}; -dhtmlXTreeObject.prototype._getAllFatItems=function(a){for(var b="",c=0;c0){b?b+=this.dlmtr+a.childNodes[c].id:b=""+a.childNodes[c].id;var d=a.childNodes[c].unParsed?this._getAllFatItemsXML(a.childNodes[c].unParsed,1):this._getAllFatItems(a.childNodes[c]);d&&(b+=this.dlmtr+d)}return b}; -dhtmlXTreeObject.prototype._getAllSubItems=function(a,b,c){var d=c?c:this._globalIdStorageFind(a);if(!d)return 0;for(var b="",e=0;e=c.childsCount?null:c.childNodes[b].id};dhtmlXTreeObject.prototype.getChildItemIdByIndex=function(a,b){var c=this._globalIdStorageFind(a);return!c||b>=c.childsCount?null:c.childNodes[b].id};dhtmlXTreeObject.prototype.setDragHandler=function(a){this.attachEvent("onDrag",a)}; -dhtmlXTreeObject.prototype._clearMove=function(){if(this._lastMark)this._lastMark.className=this._lastMark.className.replace(/dragAndDropRow/g,""),this._lastMark=null;this.allTree.className=this.allTree.className.replace(" selectionBox","")}; -dhtmlXTreeObject.prototype.enableDragAndDrop=function(a,b){a=="temporary_disabled"?(this.dADTempOff=!1,a=!0):this.dADTempOff=!0;(this.dragAndDropOff=convertStringToBoolean(a))&&this.dragger.addDragLanding(this.allTree,this);if(arguments.length>1)this._ddronr=!convertStringToBoolean(b)}; -dhtmlXTreeObject.prototype._setMove=function(a){if(a.parentObject.span){var b=getAbsoluteTop(a),c=getAbsoluteTop(this.allTree)-this.allTree.scrollTop;this.dadmodec=this.dadmode;this.dadmodefix=0;var d=a.parentObject.span;d.className+=" dragAndDropRow";this._lastMark=d;this._autoScroll(null,b,c)}}; -dhtmlXTreeObject.prototype._autoScroll=function(a,b,c){if(this.autoScroll){a&&(b=getAbsoluteTop(a),c=getAbsoluteTop(this.allTree)-this.allTree.scrollTop);if(b-c-parseInt(this.allTree.scrollTop)>parseInt(this.allTree.offsetHeight)-50)this.allTree.scrollTop=parseInt(this.allTree.scrollTop)+20;if(b-c"+this._selected[f].span.innerHTML+ -"";else e=this.getSelectedItemText().split(this.dlmtr);d.innerHTML=e.join("");d.style.position="absolute";d.className="dragSpanDiv";this._dragged=[].concat(this._selected);return d};dhtmlXTreeObject.prototype._focusNode=function(a){var b=getAbsoluteTop(a.htmlNode)-getAbsoluteTop(this.allTree);if(b>this.allTree.offsetHeight-30||b<0)this.allTree.scrollTop=b+this.allTree.scrollTop};dhtmlXTreeObject.prototype._preventNsDrag=function(a){a&&a.preventDefault&&a.preventDefault();return!1}; -dhtmlXTreeObject.prototype._drag=function(a,b,c){this._autoOpenTimer&&clearTimeout(this._autoOpenTimer);if(!c.parentObject)c=this.htmlNode.htmlNode.childNodes[0].childNodes[0].childNodes[1].childNodes[0],this.dadmodec=0;this._clearMove();var d=a.parentObject.treeNod;d&&d._clearMove&&d._clearMove("");if(!this.dragMove||this.dragMove())for(var e=!d||!d._clearMove||!d._dragged?Array(a.parentObject):d._dragged,f=c.parentObject,g=0;g2?c.checkstate-3:c.checkstate,this._setCheck(c),c.dscheck<3))c.dscheck=!1}; -dhtmlXTreeObject.prototype.setEscapingMode=function(a){this.utfesc=a};dhtmlXTreeObject.prototype.enableHighlighting=function(a){this.ehlt=!0;this.ehlta=convertStringToBoolean(a)};dhtmlXTreeObject.prototype._itemMouseOut=function(){var a=this.childNodes[3].parentObject,b=a.treeNod;b.callEvent("onMouseOut",[a.id]);if(a.id==b._l_onMSI)b._l_onMSI=null;if(b.ehlta)a.span.className=a.span.className.replace("_lor","")}; -dhtmlXTreeObject.prototype._itemMouseIn=function(){var a=this.childNodes[3].parentObject,b=a.treeNod;b._l_onMSI!=a.id&&b.callEvent("onMouseIn",[a.id]);b._l_onMSI=a.id;if(b.ehlta)a.span.className=a.span.className.replace("_lor",""),a.span.className=a.span.className.replace(/((standart|selected)TreeRow)/,"$1_lor")};dhtmlXTreeObject.prototype.enableActiveImages=function(a){this._aimgs=convertStringToBoolean(a)}; -dhtmlXTreeObject.prototype.focusItem=function(a){var b=this._globalIdStorageFind(a);if(!b)return 0;this._focusNode(b)};dhtmlXTreeObject.prototype.getAllSubItems=function(a){return this._getAllSubItems(a)};dhtmlXTreeObject.prototype.getAllChildless=function(){return this._getAllScraggyItems(this.htmlNode)};dhtmlXTreeObject.prototype.getAllLeafs=dhtmlXTreeObject.prototype.getAllChildless; -dhtmlXTreeObject.prototype._getAllScraggyItems=function(a){for(var b="",c=0;c0){var d=a.childNodes[c].unParsed?this._getAllScraggyItemsXML(a.childNodes[c].unParsed,1):this._getAllScraggyItems(a.childNodes[c]);d&&(b?b+=this.dlmtr+d:b=d)}else b?b+=this.dlmtr+a.childNodes[c].id:b=""+a.childNodes[c].id;return b}; -dhtmlXTreeObject.prototype._getAllFatItems=function(a){for(var b="",c=0;c0){b?b+=this.dlmtr+a.childNodes[c].id:b=""+a.childNodes[c].id;var d=a.childNodes[c].unParsed?this._getAllFatItemsXML(a.childNodes[c].unParsed,1):this._getAllFatItems(a.childNodes[c]);d&&(b+=this.dlmtr+d)}return b};dhtmlXTreeObject.prototype.getAllItemsWithKids=function(){return this._getAllFatItems(this.htmlNode)}; -dhtmlXTreeObject.prototype.getAllFatItems=dhtmlXTreeObject.prototype.getAllItemsWithKids;dhtmlXTreeObject.prototype.getAllChecked=function(){return this._getAllChecked("","",1)};dhtmlXTreeObject.prototype.getAllUnchecked=function(a){a&&(a=this._globalIdStorageFind(a));return this._getAllChecked(a,"",0)};dhtmlXTreeObject.prototype.getAllPartiallyChecked=function(){return this._getAllChecked("","",2)}; -dhtmlXTreeObject.prototype.getAllCheckedBranches=function(){var a=[this._getAllChecked("","",1)],b=this._getAllChecked("","",2);b&&a.push(b);return a.join(this.dlmtr)};dhtmlXTreeObject.prototype._getAllChecked=function(a,b,c){if(!a)a=this.htmlNode;a.checkstate==c&&(a.nocheckbox||(b?b+=this.dlmtr+a.id:b=""+a.id));for(var d=a.childsCount,e=0;e";a.span.style.paddingRight=a.span.style.paddingLeft="0px";a.span.onclick= -a.span.ondblclick=function(a){(a||event).cancelBubble=!0};a.span.childNodes[0].value=b;a.span.childNodes[0].onselectstart=function(a){return(a||event).cancelBubble=!0};a.span.childNodes[0].onmousedown=function(a){return(a||event).cancelBubble=!0};a.span.childNodes[0].focus();a.span.childNodes[0].focus();a.span.onclick=function(a){(a||event).cancelBubble=!0;return!1};a.span.className="";a.span.parentNode.className="";var d=this;a.span.childNodes[0].onkeydown=function(a){if(!a)a=window.event;a.keyCode== -13?(a.cancelBubble=!0,d._stopEdit(window.undefined)):a.keyCode==27&&d._stopEdit(window.undefined,!0);(a||event).cancelBubble=!0};this.callEvent("onEdit",[1,c,this])}}}; - -//v.3.6 build 131023 - -/* -Copyright DHTMLX LTD. http://www.dhtmlx.com -You allowed to use this component or parts of it under GPL terms -To use it on other terms or get Professional edition of the component please contact us at sales@dhtmlx.com -*/ \ No newline at end of file diff --git a/api/js/dhtmlxtree/codebase/ext/dhtmlxtree_er.js b/api/js/dhtmlxtree/codebase/ext/dhtmlxtree_er.js deleted file mode 100644 index d2f18eb877..0000000000 --- a/api/js/dhtmlxtree/codebase/ext/dhtmlxtree_er.js +++ /dev/null @@ -1,21 +0,0 @@ -//v.3.6 build 131023 - -/* -Copyright DHTMLX LTD. http://www.dhtmlx.com -You allowed to use this component or parts of it under GPL terms -To use it on other terms or get Professional edition of the component please contact us at sales@dhtmlx.com -*/ -var g=[];dhtmlXTreeObject.prototype._createSelfA2=dhtmlXTreeObject.prototype._createSelf;dhtmlXTreeObject.prototype._createSelf=function(){g[g.length]=this;return this._createSelfA2()}; -window.onerror=function(e,d,a,c){c=document.createElement("DIV");c.style.cssText="position:absolute; background-color:white; top:10px; left:10px; z-index:20; width:500px; border: 2px silver outset;";var b="

Javascript Error
";b+="
The next error ocured :
"+e+" in "+d+" at line "+a+"
";b+= -"
If you think that error can be caused by dhtmlxtree press the 'Generate report' button and send generated report to support@dhtmlx.com
";b+=""; -b+="
";c.innerHTML=b;document.body.appendChild(c);return!0};function dhtmlxtreeErrorReport(e,d,a){var c=e+" ["+d+"]";e=="LoadXML"&&(c+="
"+a[0].responseText+"
"+a[0].status);window.onerror(c,"none","none")} -function dhtmlxtreeReport(e){var d=e.parentNode;d.lastChild.innerHTML="";for(var a=d.childNodes[1].innerHTML,c=0;c"+e+"");window[l]=c;var n=a.getAttribute("oninit");n&&eval(n);return c} -function dhx_init_trees(){for(var a=document.getElementsByTagName("div"),b=0;b-1) - _isChrome=true; - -if ((navigator.userAgent.indexOf('Safari') != -1)||(navigator.userAgent.indexOf('Konqueror') != -1)){ - _KHTMLrv = parseFloat(navigator.userAgent.substr(navigator.userAgent.indexOf('Safari')+7, 5)); - - if (_KHTMLrv > 525){ //mimic FF behavior for Safari 3.1+ - _isFF=true; - _FFrv = 1.9; - } else - _isKHTML=true; -} else if (navigator.userAgent.indexOf('Opera') != -1){ - _isOpera=true; - _OperaRv=parseFloat(navigator.userAgent.substr(navigator.userAgent.indexOf('Opera')+6, 3)); -} - - -else if (navigator.appName.indexOf("Microsoft") != -1){ - _isIE=true; - if ((navigator.appVersion.indexOf("MSIE 8.0")!= -1 || - navigator.appVersion.indexOf("MSIE 9.0")!= -1 || - navigator.appVersion.indexOf("MSIE 10.0")!= -1 || - document.documentMode > 7) && - document.compatMode != "BackCompat"){ - _isIE=8; - } -} else if (navigator.appName == 'Netscape' && navigator.userAgent.indexOf("Trident") != -1){ - //ie11 - _isIE=8; -} else { - _isFF=true; - _FFrv = parseFloat(navigator.userAgent.split("rv:")[1]) -} - - -//multibrowser Xpath processor -dtmlXMLLoaderObject.prototype.doXPath=function(xpathExp, docObj, namespace, result_type){ - if (_isKHTML || (!_isIE && !window.XPathResult)) - return this.doXPathOpera(xpathExp, docObj); - - if (_isIE){ //IE - if (!docObj) - if (!this.xmlDoc.nodeName) - docObj=this.xmlDoc.responseXML - else - docObj=this.xmlDoc; - - if (!docObj) - dhtmlxError.throwError("LoadXML", "Incorrect XML", [ - (docObj||this.xmlDoc), - this.mainObject - ]); - - if (namespace != null) - docObj.setProperty("SelectionNamespaces", "xmlns:xsl='"+namespace+"'"); // - - if (result_type == 'single'){ - return docObj.selectSingleNode(xpathExp); - } - else { - return docObj.selectNodes(xpathExp)||new Array(0); - } - } else { //Mozilla - var nodeObj = docObj; - - if (!docObj){ - if (!this.xmlDoc.nodeName){ - docObj=this.xmlDoc.responseXML - } - else { - docObj=this.xmlDoc; - } - } - - if (!docObj) - dhtmlxError.throwError("LoadXML", "Incorrect XML", [ - (docObj||this.xmlDoc), - this.mainObject - ]); - - if (docObj.nodeName.indexOf("document") != -1){ - nodeObj=docObj; - } - else { - nodeObj=docObj; - docObj=docObj.ownerDocument; - } - var retType = XPathResult.ANY_TYPE; - - if (result_type == 'single') - retType=XPathResult.FIRST_ORDERED_NODE_TYPE - var rowsCol = new Array(); - var col = docObj.evaluate(xpathExp, nodeObj, function(pref){ - return namespace - }, retType, null); - - if (retType == XPathResult.FIRST_ORDERED_NODE_TYPE){ - return col.singleNodeValue; - } - var thisColMemb = col.iterateNext(); - - while (thisColMemb){ - rowsCol[rowsCol.length]=thisColMemb; - thisColMemb=col.iterateNext(); - } - return rowsCol; - } -} - -function _dhtmlxError(type, name, params){ - if (!this.catches) - this.catches=new Array(); - - return this; -} - -_dhtmlxError.prototype.catchError=function(type, func_name){ - this.catches[type]=func_name; -} -_dhtmlxError.prototype.throwError=function(type, name, params){ - if (this.catches[type]) - return this.catches[type](type, name, params); - - if (this.catches["ALL"]) - return this.catches["ALL"](type, name, params); - - alert("Error type: "+arguments[0]+"\nDescription: "+arguments[1]); - return null; -} - -window.dhtmlxError=new _dhtmlxError(); - - -//opera fake, while 9.0 not released -//multibrowser Xpath processor -dtmlXMLLoaderObject.prototype.doXPathOpera=function(xpathExp, docObj){ - //this is fake for Opera - var z = xpathExp.replace(/[\/]+/gi, "/").split('/'); - var obj = null; - var i = 1; - - if (!z.length) - return []; - - if (z[0] == ".") - obj=[docObj]; else if (z[0] == ""){ - obj=(this.xmlDoc.responseXML||this.xmlDoc).getElementsByTagName(z[i].replace(/\[[^\]]*\]/g, "")); - i++; - } else - return []; - - for (i; i < z.length; i++)obj=this._getAllNamedChilds(obj, z[i]); - - if (z[i-1].indexOf("[") != -1) - obj=this._filterXPath(obj, z[i-1]); - return obj; -} - -dtmlXMLLoaderObject.prototype._filterXPath=function(a, b){ - var c = new Array(); - var b = b.replace(/[^\[]*\[\@/g, "").replace(/[\[\]\@]*/g, ""); - - for (var i = 0; i < a.length; i++) - if (a[i].getAttribute(b)) - c[c.length]=a[i]; - - return c; -} -dtmlXMLLoaderObject.prototype._getAllNamedChilds=function(a, b){ - var c = new Array(); - - if (_isKHTML) - b=b.toUpperCase(); - - for (var i = 0; i < a.length; i++)for (var j = 0; j < a[i].childNodes.length; j++){ - if (_isKHTML){ - if (a[i].childNodes[j].tagName&&a[i].childNodes[j].tagName.toUpperCase() == b) - c[c.length]=a[i].childNodes[j]; - } - - else if (a[i].childNodes[j].tagName == b) - c[c.length]=a[i].childNodes[j]; - } - - return c; -} - -function dhtmlXHeir(a, b){ - for (var c in b) - if (typeof (b[c]) == "function") - a[c]=b[c]; - return a; -} - -function dhtmlxEvent(el, event, handler){ - if (el.addEventListener) - el.addEventListener(event, handler, false); - - else if (el.attachEvent) - el.attachEvent("on"+event, handler); -} - -//============= XSL Extension =================================== - -dtmlXMLLoaderObject.prototype.xslDoc=null; -dtmlXMLLoaderObject.prototype.setXSLParamValue=function(paramName, paramValue, xslDoc){ - if (!xslDoc) - xslDoc=this.xslDoc - - if (xslDoc.responseXML) - xslDoc=xslDoc.responseXML; - var item = - this.doXPath("/xsl:stylesheet/xsl:variable[@name='"+paramName+"']", xslDoc, - "http:/\/www.w3.org/1999/XSL/Transform", "single"); - - if (item != null) - item.firstChild.nodeValue=paramValue -} -dtmlXMLLoaderObject.prototype.doXSLTransToObject=function(xslDoc, xmlDoc){ - if (!xslDoc) - xslDoc=this.xslDoc; - - if (xslDoc.responseXML) - xslDoc=xslDoc.responseXML - - if (!xmlDoc) - xmlDoc=this.xmlDoc; - - if (xmlDoc.responseXML) - xmlDoc=xmlDoc.responseXML - - //MOzilla - if (!_isIE){ - if (!this.XSLProcessor){ - this.XSLProcessor=new XSLTProcessor(); - this.XSLProcessor.importStylesheet(xslDoc); - } - var result = this.XSLProcessor.transformToDocument(xmlDoc); - } else { - var result = new ActiveXObject("Msxml2.DOMDocument.3.0"); - try{ - xmlDoc.transformNodeToObject(xslDoc, result); - }catch(e){ - result = xmlDoc.transformNode(xslDoc); - } - } - return result; -} - -dtmlXMLLoaderObject.prototype.doXSLTransToString=function(xslDoc, xmlDoc){ - var res = this.doXSLTransToObject(xslDoc, xmlDoc); - if(typeof(res)=="string") - return res; - return this.doSerialization(res); -} - -dtmlXMLLoaderObject.prototype.doSerialization=function(xmlDoc){ - if (!xmlDoc) - xmlDoc=this.xmlDoc; - if (xmlDoc.responseXML) - xmlDoc=xmlDoc.responseXML - if (!_isIE){ - var xmlSerializer = new XMLSerializer(); - return xmlSerializer.serializeToString(xmlDoc); - } else - return xmlDoc.xml; -} - -/** -* @desc: -* @type: private -*/ -dhtmlxEventable=function(obj){ - obj.attachEvent=function(name, catcher, callObj){ - name='ev_'+name.toLowerCase(); - if (!this[name]) - this[name]=new this.eventCatcher(callObj||this); - - return(name+':'+this[name].addEvent(catcher)); //return ID (event name & event ID) - } - obj.callEvent=function(name, arg0){ - name='ev_'+name.toLowerCase(); - if (this[name]) - return this[name].apply(this, arg0); - return true; - } - obj.checkEvent=function(name){ - return (!!this['ev_'+name.toLowerCase()]) - } - obj.eventCatcher=function(obj){ - var dhx_catch = []; - var z = function(){ - var res = true; - for (var i = 0; i < dhx_catch.length; i++){ - if (dhx_catch[i] != null){ - var zr = dhx_catch[i].apply(obj, arguments); - res=res&&zr; - } - } - return res; - } - z.addEvent=function(ev){ - if (typeof (ev) != "function") - ev=eval(ev); - if (ev) - return dhx_catch.push(ev)-1; - return false; - } - z.removeEvent=function(id){ - dhx_catch[id]=null; - } - return z; - } - obj.detachEvent=function(id){ - if (id != false){ - var list = id.split(':'); //get EventName and ID - this[list[0]].removeEvent(list[1]); //remove event - } - } - obj.detachAllEvents = function(){ - for (var name in this){ - if (name.indexOf("ev_")==0){ - this.detachEvent(name); - this[name] = null; - } - } - } - obj = null; -}; diff --git a/api/js/dhtmlxtree/sources/dhtmlxtree.js b/api/js/dhtmlxtree/sources/dhtmlxtree.js deleted file mode 100644 index f464a3dbc7..0000000000 --- a/api/js/dhtmlxtree/sources/dhtmlxtree.js +++ /dev/null @@ -1,3878 +0,0 @@ -//v.3.6 build 131023 - -/* -Copyright DHTMLX LTD. http://www.dhtmlx.com -You allowed to use this component or parts of it under GPL terms -To use it on other terms or get Professional edition of the component please contact us at sales@dhtmlx.com -*/ -/*_TOPICS_ -@0:Initialization -@1:Selection control -@2:Add/delete -@3:Private -@4:Node/level control -@5:Checkboxes/user data manipulation -@6:Appearence control -@7: Handlers -*/ - -function xmlPointer(data){ - this.d=data; -} -xmlPointer.prototype={ - text:function(){ if (!_isFF) return this.d.xml; var x = new XMLSerializer(); return x.serializeToString(this.d); }, - get:function(name){return this.d.getAttribute(name); }, - exists:function(){return !!this.d }, - content:function(){return this.d.firstChild?this.d.firstChild.data:""; }, // <4k in FF - each:function(name,f,t,i){ var a=this.d.childNodes; var c=new xmlPointer(); if (a.length) for (i=i||0; i0) { beforeNode=new Object; beforeNode.tr=parentObject.childNodes[0].tr.previousSibling; } - parentObject._has_top=true; - for (ik=Count; ik>0; ik--) - Nodes[ik]=Nodes[ik-1]; - Count=0; - break; - } - }; - }; - - var n; - if (!(n=this._idpull[itemId]) || n.span!=-1){ - n=Nodes[Count]=new dhtmlXTreeItemObject(itemId,itemText,parentObject,this,itemActionHandler,1); - itemId = Nodes[Count].id; - parentObject.childsCount++; - } - - if(!n.htmlNode) { - n.label=itemText; - n.htmlNode=this._createItem((this.checkBoxOff?1:0),n); - n.htmlNode.objBelong=n; - } - - if(image1) n.images[0]=image1; - if(image2) n.images[1]=image2; - if(image3) n.images[2]=image3; - - - var tr=this._drawNewTr(n.htmlNode); - if ((this.XMLloadingWarning)||(this._hAdI)) - n.htmlNode.parentNode.parentNode.style.display="none"; - - - if ((beforeNode)&&beforeNode.tr&&(beforeNode.tr.nextSibling)) - parentObject.htmlNode.childNodes[0].insertBefore(tr,beforeNode.tr.nextSibling); - else - if (this.parsingOn==parentObject.id){ - this.parsedArray[this.parsedArray.length]=tr; - } - else - parentObject.htmlNode.childNodes[0].appendChild(tr); - - - if ((beforeNode)&&(!beforeNode.span)) beforeNode=null; - - if (this.XMLsource) if ((childs)&&(childs!=0)) n.XMLload=0; else n.XMLload=1; - n.tr=tr; - tr.nodem=n; - - if (parentObject.itemId==0) - tr.childNodes[0].className="hiddenRow"; - - if ((parentObject._r_logic)||(this._frbtr)) - this._setSrc(n.htmlNode.childNodes[0].childNodes[0].childNodes[1].childNodes[0],this.imPath+this.radioArray[0]); - - - if (optionStr) { - var tempStr=optionStr.split(","); - - for (var i=0; i=2) - { - this._correctPlus(Nodes[parentObject.childsCount-2]); - this._correctLine(Nodes[parentObject.childsCount-2]); - } - if (parentObject.childsCount!=2) this._correctPlus(Nodes[0]); - - if (this.tscheck) this._correctCheckStates(parentObject); - - if (this._onradh){ - if (this.xmlstate==1){ - var old=this.onXLE; - this.onXLE=function(id){ this._onradh(itemId); if (old) old(id); } - } - else - this._onradh(itemId); - } - - } - return n; -}; - - - - -/** -* @desc: create new node as a child to specified with parentId -* @type: deprecated -* @param: parentId - parent node id -* @param: itemId - new node id -* @param: itemText - new node text -* @param: itemActionHandler - function fired on node select event (optional) -* @param: image1 - image for node without children; (optional) -* @param: image2 - image for closed node; (optional) -* @param: image3 - image for opened node (optional) -* @param: optionStr - options string (optional) -* @param: children - node children flag (for dynamical trees) (optional) -* @topic: 2 -*/ - dhtmlXTreeObject.prototype.insertNewItem=function(parentId,itemId,itemText,itemActionHandler,image1,image2,image3,optionStr,children){ - var parentObject=this._globalIdStorageFind(parentId); - if (!parentObject) return (-1); - var nodez=this._attachChildNode(parentObject,itemId,itemText,itemActionHandler,image1,image2,image3,optionStr,children); - if(!this._idpull[this.rootId].XMLload) - this._idpull[this.rootId].XMLload = 1; - - return nodez; - }; -/** -* @desc: create new node as a child to specified with parentId -* @type: public -* @param: parentId - parent node id -* @param: itemId - new node id -* @param: itemText - new node label -* @param: itemActionHandler - function fired on node select event (optional) -* @param: image1 - image for node without children; (optional) -* @param: image2 - image for closed node; (optional) -* @param: image3 - image for opened node (optional) -* @param: optionStr - options string (optional) -* @param: children - node children flag (for dynamical trees) (optional) -* @topic: 2 -*/ - dhtmlXTreeObject.prototype.insertNewChild=function(parentId,itemId,itemText,itemActionHandler,image1,image2,image3,optionStr,children){ - return this.insertNewItem(parentId,itemId,itemText,itemActionHandler,image1,image2,image3,optionStr,children); - } -/** -* @desc: parse xml -* @type: private -* @param: dhtmlObject - jsTree object -* @param: node - top XML node -* @param: parentId - parent node id -* @param: level - level of tree -* @topic: 2 -*/ - dhtmlXTreeObject.prototype._parseXMLTree=function(a,b,c,d,xml){ - var p=new xmlPointer(xml.getXMLTopNode("tree")); - a._parse(p); - a._p=p; - } - - dhtmlXTreeObject.prototype._parseItem=function(c,temp,preNode,befNode){ - var id; - if (this._srnd && (!this._idpull[id=c.get("id")] || !this._idpull[id].span)) - { - this._addItemSRND(temp.id,id,c); - return; - } - - var a=c.get_all(); - - if ((typeof(this.waitUpdateXML)=="object")&&(!this.waitUpdateXML[a.id])){ - this._parse(c,a.id,1); - return; - } - - - - - - - var zST=[]; - if (a.select) zST.push("SELECT"); - if (a.top) zST.push("TOP"); - if (a.call) this.nodeAskingCall=a.id; - if (a.checked==-1) zST.push("HCHECKED"); - else if (a.checked) zST.push("CHECKED"); - if (a.open) zST.push("OPEN"); - - if (this.waitUpdateXML){ - if (this._globalIdStorageFind(a.id)) - var newNode=this.updateItem(a.id,a.text,a.im0,a.im1,a.im2,a.checked,a.child); - else{ - if (this.npl==0) zST.push("TOP"); - else preNode=temp.childNodes[this.npl]; - - var newNode=this._attachChildNode(temp,a.id,a.text,0,a.im0,a.im1,a.im2,zST.join(","),a.child,0,preNode); - a.id = newNode.id; - preNode=null; - } - } - else - var newNode=this._attachChildNode(temp,a.id,a.text,0,a.im0,a.im1,a.im2,zST.join(","),a.child,(befNode||0),preNode); - if (a.tooltip) - newNode.span.parentNode.parentNode.title=a.tooltip; - - if (a.style) - if (newNode.span.style.cssText) - newNode.span.style.cssText+=(";"+a.style); - else - newNode.span.setAttribute("style",newNode.span.getAttribute("style")+"; "+a.style); - - if (a.radio) newNode._r_logic=true; - - if (a.nocheckbox){ - var check_node=newNode.span.parentNode.previousSibling.previousSibling; - check_node.style.display="none"; - newNode.nocheckbox=true; - } - if (a.disabled){ - if (a.checked!=null) this._setCheck(newNode,a.checked); - this.disableCheckbox(newNode,1); - } - - - newNode._acc=a.child||0; - - if (this.parserExtension) this.parserExtension._parseExtension.call(this,c,a,(temp?temp.id:0)); - - this.setItemColor(newNode,a.aCol,a.sCol); - if (a.locked=="1") this.lockItem(newNode.id,true,true); - - if ((a.imwidth)||(a.imheight)) this.setIconSize(a.imwidth,a.imheight,newNode); - if ((a.closeable=="0")||(a.closeable=="1")) this.setItemCloseable(newNode,a.closeable); - var zcall=""; - if (a.topoffset) this.setItemTopOffset(newNode,a.topoffset); - if ((!this.slowParse)||(typeof(this.waitUpdateXML)=="object")){ - if (c.sub_exists("item")) - zcall=this._parse(c,a.id,1); - } - - if (zcall!="") this.nodeAskingCall=zcall; - - - c.each("userdata",function(u){ - this.setUserData(c.get("id"),u.get("name"),u.content()); - },this) - - - } - dhtmlXTreeObject.prototype._parse=function(p,parentId,level,start){ - if (this._srnd && !this.parentObject.offsetHeight) { - var self=this; - return window.setTimeout(function(){ - self._parse(p,parentId,level,start); - },100); - } - if (!p.exists()) return; - - this.skipLock=true; //disable item locking - //loading flags - - - if (!parentId) { //top level - parentId=p.get("id"); - var skey = p.get("dhx_security"); - if (skey) - dhtmlx.security_key = skey; - - if (p.get("radio")) - this.htmlNode._r_logic=true; - this.parsingOn=parentId; - this.parsedArray=new Array(); - this.setCheckList=""; - this.nodeAskingCall=""; - } - - var temp=this._globalIdStorageFind(parentId); - if (!temp) return dhtmlxError.throwError("DataStructure","XML refers to not existing parent"); - - this.parsCount=this.parsCount?(this.parsCount+1):1; - this.XMLloadingWarning=1; - - if ((temp.childsCount)&&(!start)&&(!this._edsbps)&&(!temp._has_top)) - var preNode=0;//temp.childNodes[temp.childsCount-1]; - else - var preNode=0; - - this.npl=0; - - p.each("item",function(c,i){ - - temp.XMLload=1; - - this._parseItem(c,temp,0,preNode); - - - this.npl++; - - - - },this,start); - - - if (!level) { - p.each("userdata",function(u){ - this.setUserData(p.get("id"),u.get("name"),u.content()); - },this); - - temp.XMLload=1; - if (this.waitUpdateXML){ - this.waitUpdateXML=false; - for (var i=temp.childsCount-1; i>=0; i--) - if (temp.childNodes[i]._dmark) - this.deleteItem(temp.childNodes[i].id); - } - - var parsedNodeTop=this._globalIdStorageFind(this.parsingOn); - - for (var i=0; i1){ - if ( ( (Nodes[1].style.display!="none") || (mode==1) ) && (mode!=2) ) { -//nb:solves standard doctype prb in IE - this.allTree.childNodes[0].border = "1"; - this.allTree.childNodes[0].border = "0"; - nodestyle="none"; - } - else nodestyle=""; - - for (var i=1; i7) td2.style.width="999999px"; - else if (!window._KHTMLrv) td2.style.width="100%"; - -// itemObject.span.appendChild(document.createTextNode(itemObject.label)); - itemObject.span.innerHTML=itemObject.label; - td2.appendChild(itemObject.span); - td2.parentObject=itemObject; td1.parentObject=itemObject; - td2.onclick=this.onRowSelect; td1.onclick=this.onRowClick; td2.ondblclick=this.onRowClick2; - if (this.ettip) - tr.title=itemObject.label; - - if (this.dragAndDropOff) { - if (this._aimgs) { this.dragger.addDraggableItem(td12,this); td12.parentObject=itemObject; } - this.dragger.addDraggableItem(td2,this); - } - - itemObject.span.style.paddingLeft="5px"; itemObject.span.style.paddingRight="5px"; td2.style.verticalAlign=""; - td2.style.fontSize="10pt"; td2.style.cursor=this.style_pointer; - tr.appendChild(td1); tr.appendChild(td11); tr.appendChild(td12); - tr.appendChild(td2); - tbody.appendChild(tr); - table.appendChild(tbody); - - if (this.ehlt || this.checkEvent("onMouseIn") || this.checkEvent("onMouseOut")){//highlighting - tr.onmousemove=this._itemMouseIn; - tr[(_isIE)?"onmouseleave":"onmouseout"]=this._itemMouseOut; - } - return table; - }; - - -/** -* @desc: set path to images directory -* @param: newPath - path to images directory (related to the page with tree or absolute http url) -* @type: public -* @topic: 0 -*/ - dhtmlXTreeObject.prototype.setImagePath=function( newPath ){ this.imPath=newPath; this.iconURL=newPath; }; - /** - * @desc: set path to external images used as tree icons - * @type: public - * @param: path - url (or relative path) of images folder with closing "/" - * @topic: 0,7 - */ - dhtmlXTreeObject.prototype.setIconPath=function(path){ - this.iconURL=path; - } - - - -/** -* @desc: set function called when tree node selected -* @param: (function) func - event handling function -* @type: deprecated -* @topic: 0,7 -* @event: onRightClick -* @depricated: use grid.attachEvent("onRightClick",func); instead -* @eventdesc: Event occurs after right mouse button was clicked. - Assigning this handler can disable default context menu, and incompattible with dhtmlXMenu integration. -* @eventparam: (string) ID of clicked item -* @eventparam: (object) event object -*/ - dhtmlXTreeObject.prototype.setOnRightClickHandler=function(func){ this.attachEvent("onRightClick",func); }; - -/** -* @desc: set function called when tree node clicked, also can be forced to call from API -* @param: func - event handling function -* @type: deprecated -* @topic: 0,7 -* @event: onClick -* @depricated: use grid.attachEvent("onClick",func); instead -* @eventdesc: Event raises immideatly after text part of item in tree was clicked, but after default onClick functionality was processed. - Richt mouse button click can be catched by onRightClick event handler. -* @eventparam: ID of clicked item -* @eventparam: ID of previously selected item -*/ - dhtmlXTreeObject.prototype.setOnClickHandler=function(func){ this.attachEvent("onClick",func); }; - -/** -* @desc: set function called when tree node selected or unselected, include any select change caused by any functionality -* @param: func - event handling function -* @type: deprecated -* @topic: 0,7 -* @event: onSelect -* @depricated: use grid.attachEvent("onSelect",func); instead -* @eventdesc: Event raises immideatly after selection in tree was changed -* @eventparam: selected item ID ( list of IDs in case of multiselection) -*/ - dhtmlXTreeObject.prototype.setOnSelectStateChange=function(func){ this.attachEvent("onSelect",func); }; - - -/** -* @desc: enables dynamic loading from XML -* @type: public -* @param: filePath - name of script returning XML; in case of virtual loading - user defined function -* @topic: 0 -*/ - dhtmlXTreeObject.prototype.setXMLAutoLoading=function(filePath){ this.XMLsource=filePath; }; - - /** -* @desc: set function called before checkbox checked/unchecked -* @param: func - event handling function -* @type: deprecated -* @topic: 0,7 -* @event: onCheck -* @depricated: use tree.attachEvent("onCheck",func); instead -* @eventdesc: Event raises right before item in tree was checked/unchecked. can be canceled (return false from event handler) -* @eventparam: ID of item which will be checked/unchecked -* @eventparam: Current checkbox state. 1 - item checked, 0 - item unchecked. -* @eventreturn: true - confirm changing checked state; false - deny chaning checked state; -*/ - dhtmlXTreeObject.prototype.setOnCheckHandler=function(func){ this.attachEvent("onCheck",func); }; - - -/** -* @desc: set function called before tree node opened/closed -* @param: func - event handling function -* @type: deprecated -* @topic: 0,7 -* @event: onOpen -* @depricated: use grid.attachEvent("onOpenStart",func); instead -* @eventdesc: Event raises immideatly after item in tree got command to open/close , and before item was opened//closed. Event also raised for unclosable nodes and nodes without open/close functionality - in that case result of function will be ignored. - Event does not occur if node was opened by dhtmlXtree API. -* @eventparam: ID of node which will be opened/closed -* @eventparam: Current open state of tree item. 0 - item has not children, -1 - item closed, 1 - item opened. -* @eventreturn: true - confirm opening/closing; false - deny opening/closing; -*/ - dhtmlXTreeObject.prototype.setOnOpenHandler=function(func){ this.attachEvent("onOpenStart",func); }; -/** -* @desc: set function called before tree node opened/closed -* @param: func - event handling function -* @type: deprecated -* @topic: 0,7 -* @event: onOpenStart -* @depricated: use grid.attachEvent("onOpenStart",func); instead -* @eventdesc: Event raises immideatly after item in tree got command to open/close , and before item was opened//closed. Event also raised for unclosable nodes and nodes without open/close functionality - in that case result of function will be ignored. - Event not raised if node opened by dhtmlXtree API. -* @eventparam: ID of node which will be opened/closed -* @eventparam: Current open state of tree item. 0 - item has not children, -1 - item closed, 1 - item opened. -* @eventreturn: true - confirm opening/closing; false - deny opening/closing; -*/ - dhtmlXTreeObject.prototype.setOnOpenStartHandler=function(func){ this.attachEvent("onOpenStart",func); }; - -/** -* @desc: set function called after tree node opened/closed -* @param: func - event handling function -* @type: deprecated -* @topic: 0,7 -* @event: onOpenEnd -* @depricated: use grid.attachEvent("onOpenEnd",func); instead -* @eventdesc: Event raises immideatly after item in tree was opened//closed. Event also raised for unclosable nodes and nodes without open/close functionality - in that case result of function will be ignored. - Event not raised if node opened by dhtmlXtree API. -* @eventparam: ID of node which will be opened/closed -* @eventparam: Current open state of tree item. 0 - item has not children, -1 - item closed, 1 - item opened. -*/ - dhtmlXTreeObject.prototype.setOnOpenEndHandler=function(func){ this.attachEvent("onOpenEnd",func); }; - - /** -* @desc: set function called when tree node double clicked -* @param: func - event handling function -* @type: public -* @topic: 0,7 -* @event: onDblClick -* @depricated: use grid.attachEvent("onDblClick",func); instead -* @eventdesc: Event raised immideatly after item in tree was doubleclicked, before default onDblClick functionality was processed. - Beware using both onClick and onDblClick events, because component can generate onClick event before onDblClick event while doubleclicking item in tree. - ( that behavior depend on used browser ) -* @eventparam: ID of item which was doubleclicked -* @eventreturn: true - confirm opening/closing; false - deny opening/closing; -*/ - dhtmlXTreeObject.prototype.setOnDblClickHandler=function(func){ this.attachEvent("onDblClick",func); }; - - - - - - - - - - /** -* @desc: expand target node and all sub nodes -* @type: public -* @param: itemId - node id -* @topic: 4 -*/ - dhtmlXTreeObject.prototype.openAllItems=function(itemId) - { - var temp=this._globalIdStorageFind(itemId); - if (!temp) return 0; - this._xopenAll(temp); - }; - -/** -* @desc: return open/close state -* @type: public -* @param: itemId - node id -* @return: -1 - close, 1 - opened, 0 - node doesn't have children -* @topic: 4 -*/ - dhtmlXTreeObject.prototype.getOpenState=function(itemId){ - var temp=this._globalIdStorageFind(itemId); - if (!temp) return ""; - return this._getOpenState(temp); - }; - -/** -* @desc: collapse target node and all sub nodes -* @type: public -* @param: itemId - node id -* @topic: 4 -*/ - dhtmlXTreeObject.prototype.closeAllItems=function(itemId) - { - if (itemId===window.undefined) itemId=this.rootId; - - var temp=this._globalIdStorageFind(itemId); - if (!temp) return 0; - this._xcloseAll(temp); - -//nb:solves standard doctype prb in IE - this.allTree.childNodes[0].border = "1"; - this.allTree.childNodes[0].border = "0"; - - }; - - -/** -* @desc: set user data for target node -* @type: public -* @param: itemId - target node id -* @param: name - key for user data -* @param: value - user data value -* @topic: 5 -*/ - dhtmlXTreeObject.prototype.setUserData=function(itemId,name,value){ - var sNode=this._globalIdStorageFind(itemId,0,true); - if (!sNode) return; - if(name=="hint") - sNode.htmlNode.childNodes[0].childNodes[0].title=value; - if (typeof(sNode.userData["t_"+name])=="undefined"){ - if (!sNode._userdatalist) sNode._userdatalist=name; - else sNode._userdatalist+=","+name; - } - sNode.userData["t_"+name]=value; - }; - -/** -* @desc: get user data from target node -* @type: public -* @param: itemId - target node id -* @param: name - key for user data -* @return: value of user data -* @topic: 5 -*/ - dhtmlXTreeObject.prototype.getUserData=function(itemId,name){ - var sNode=this._globalIdStorageFind(itemId,0,true); - if (!sNode) return; - return sNode.userData["t_"+name]; - }; - - - - -/** -* @desc: get node color (text color) -* @param: itemId - id of node -* @type: public -* @return: color of node (empty string for default color); -* @topic: 6 -*/ - dhtmlXTreeObject.prototype.getItemColor=function(itemId) - { - var temp=this._globalIdStorageFind(itemId); - if (!temp) return 0; - - var res= new Object(); - if (temp.acolor) res.acolor=temp.acolor; - if (temp.scolor) res.scolor=temp.scolor; - return res; - }; -/** -* @desc: set node text color -* @param: itemId - id of node -* @param: defaultColor - node color -* @param: selectedColor - selected node color -* @type: public -* @topic: 6 -*/ - dhtmlXTreeObject.prototype.setItemColor=function(itemId,defaultColor,selectedColor) - { - if ((itemId)&&(itemId.span)) - var temp=itemId; - else - var temp=this._globalIdStorageFind(itemId); - if (!temp) return 0; - else { - if (temp.i_sel) - { if (selectedColor) temp.span.style.color=selectedColor; } - else - { if (defaultColor) temp.span.style.color=defaultColor; } - - if (selectedColor) temp.scolor=selectedColor; - if (defaultColor) temp.acolor=defaultColor; - } - }; - -/** -* @desc: return node text -* @param: itemId - id of node -* @type: public -* @return: text of item (with HTML formatting, if any) -* @topic: 6 -*/ - dhtmlXTreeObject.prototype.getItemText=function(itemId) - { - var temp=this._globalIdStorageFind(itemId); - if (!temp) return 0; - return(temp.htmlNode.childNodes[0].childNodes[0].childNodes[3].childNodes[0].innerHTML); - }; -/** -* @desc: return parent item id -* @param: itemId - id of node -* @type: public -* @return: id of parent item -* @topic: 4 -*/ - dhtmlXTreeObject.prototype.getParentId=function(itemId) - { - var temp=this._globalIdStorageFind(itemId); - if ((!temp)||(!temp.parentObject)) return ""; - return temp.parentObject.id; - }; - - - -/** -* @desc: change item id -* @type: public -* @param: itemId - old node id -* @param: newItemId - new node id -* @topic: 4 -*/ - dhtmlXTreeObject.prototype.changeItemId=function(itemId,newItemId) - { - if (itemId==newItemId) return; - var temp=this._globalIdStorageFind(itemId); - if (!temp) return 0; - temp.id=newItemId; - temp.span.contextMenuId=newItemId; - this._idpull[newItemId]=this._idpull[itemId]; - delete this._idpull[itemId]; - }; - - -/** -* @desc: mark selected item as cut -* @type: public -* @topic: 2 -*/ - dhtmlXTreeObject.prototype.doCut=function(){ - if (this.nodeCut) this.clearCut(); - this.nodeCut=(new Array()).concat(this._selected); - for (var i=0; i=2) - { - - this._correctPlus(Nodes[targetObject.childsCount-2]); - this._correctLine(Nodes[targetObject.childsCount-2]); - } - - this._correctPlus(Nodes[targetObject.childsCount-1]); - //this._correctLine(Nodes[targetObject.childsCount-1]); - - - if (this.tscheck) this._correctCheckStates(targetObject); - if (oldTree.tscheck) oldTree._correctCheckStates(z); - - } - - //fix source parent - - if (c>1) { oldTree._correctPlus(z.childNodes[c-2]); - oldTree._correctLine(z.childNodes[c-2]); - } - - -// if (z.childsCount==0) - oldTree._correctPlus(z); - oldTree._correctLine(z); - - - this.callEvent("onDrop",[itemObject.id,targetObject.id,(beforeNode?beforeNode.id:null),oldTree,targetObject.treeNod]); - return itemObject.id; - }; - - - -/** -* @desc: recursive set default styles for node -* @type: private -* @param: itemObject - target node object -* @topic: 6 -*/ - dhtmlXTreeObject.prototype._clearStyles=function(itemObject){ - if (!itemObject.htmlNode) return; //some weird case in SRND mode - var td1=itemObject.htmlNode.childNodes[0].childNodes[0].childNodes[1]; - var td3=td1.nextSibling.nextSibling; - - itemObject.span.innerHTML=itemObject.label; - itemObject.i_sel=false; - - if (itemObject._aimgs) - this.dragger.removeDraggableItem(td1.nextSibling); - - if (this.checkBoxOff) { - td1.childNodes[0].style.display=""; - td1.childNodes[0].onclick=this.onCheckBoxClick; - this._setSrc(td1.childNodes[0],this.imPath+this.checkArray[itemObject.checkstate]); - } - else td1.childNodes[0].style.display="none"; - td1.childNodes[0].treeNod=this; - - this.dragger.removeDraggableItem(td3); - if (this.dragAndDropOff) this.dragger.addDraggableItem(td3,this); - if (this._aimgs) this.dragger.addDraggableItem(td1.nextSibling,this); - - td3.childNodes[0].className="standartTreeRow"; - td3.onclick=this.onRowSelect; td3.ondblclick=this.onRowClick2; - td1.previousSibling.onclick=this.onRowClick; - - this._correctLine(itemObject); - this._correctPlus(itemObject); - for (var i=0; i
"; - dh+="
If you think that error can be caused by dhtmlxtree press the 'Generate report' button and send generated report to support@dhtmlx.com
"; - dh+=""; - dh+="
"; - d.innerHTML=dh; - document.body.appendChild(d); - return true; -}; - -function dhtmlxtreeErrorReport(a,b,c){ - var str=a+" ["+b+"]"; - if (a=='LoadXML') - { - str+="
"+c[0].responseText+"
"+c[0].status; - } - - window.onerror(str, "none", "none"); -} - -function dhtmlxtreeReport(node){ - var that=node.parentNode; - that.lastChild.innerHTML=""; - var rep=that.childNodes[1].innerHTML; - for (var a=0; a<_all_used_trees.length; a++){ - var atree=_all_used_trees[a]; - rep+="\n\n Tree "+a+"\n"; - for (b in atree){ - if (typeof(atree[b])=="function") continue; - rep+=b+"="+atree[b]+"\n"; - } - rep+="---------------------\n"; - if (atree.XMLLoader){ - try{ - var z=atree.XMLLoader.getXMLTopNode("tree") - if (document.all) - rep+=z.xml+"\n"; - else{ - var xmlSerializer = new XMLSerializer(); - rep+=xmlSerializer.serializeToString(z)+"\n"; - } - } - catch(e){ - rep+="XML not recognised\n"; - } - } - - rep+="---------------------\n"; - for (var i in atree._idpull){ - var n=atree._idpull[i]; - if (typeof(n)!='object') continue; - rep+="Node: "+n.id; - rep+=" Childs: "+n.childsCount; - for (var j=0; j"+cont+""); - window[id]=t; - - var oninit = obj.getAttribute("oninit"); - if (oninit) eval(oninit); - return t; -} - -function dhx_init_trees(){ - var z=document.getElementsByTagName("div"); - for (var i=0; i= 0) - { - _text = _text.replace(this._lt_regexp, '<'); - } - return _text; - } - - /** - * html encoding of text of node incl. all children - * - * @param {object} _item with required attributes text, id and optional tooltip and item - * @return {object} encoded node - */ - private _htmlencode_node(_item : {text : string, item : any}) : object - { - _item.text = this._htmlencode(_item.text); - - if (_item.item && jQuery.isArray(_item.item)) - { - for(let i=0; i < _item.item.length; ++i) - { - this._htmlencode_node(_item.item[i]); - } - } - return _item; - } - - set_value(new_value) - { - this.value = this._oldValue = (typeof new_value === 'string' && this.options.multiple ? new_value.split(',') : new_value); - if(this.input == null) return; - - if (this.options.multiple) - { - // Clear all checked - let checked = this.input.getAllChecked().split(this.input.dlmtr); - for(let i = 0; i < checked.length; i++) - { - this.input.setCheck(checked[i], false); - } - - // Check selected - for(let i = 0; i < this.value.length; i++) - { - this.input.setCheck(this.value[i], true); - // autoloading openning needs to be absolutely based on user interaction - // or open flag in folder structure, therefore, We should - // not force it to open the node - if (!this.options.autoloading) this.input.openItem(this.value[i]); - } - } - else - { - this.input.selectItem(this.value, false); // false = do not trigger onSelect - this.input.focusItem(this.value); - this.input.openItem(this.value); - } - } - - /** - * Links actions to tree nodes - * - * @param {object} actions [ {ID: attributes..}+] as for set_actions - */ - _link_actions(actions) - { - // Get the top level element for the tree - // Only look 1 level deep for application object manager - let objectManager = egw_getObjectManager(this.egw().app_name(),true,1); - let treeObj = objectManager.getObjectById(this.id); - if (treeObj == null) { - // Add a new container to the object manager which will hold the tree - // objects - treeObj = objectManager.addObject( - new egwActionObject(this.id, objectManager, null, this._actionManager, EGW_AO_FLAG_IS_CONTAINER), - null, EGW_AO_FLAG_IS_CONTAINER - ); - } - - // Delete all old objects - treeObj.clear(); - - // Go over the tree parts & add links - let action_links = this._get_action_links(actions); - - if (typeof this.options.select_options != 'undefined') - { - - // Iterate over the options (leaves) and add action to each one - let apply_actions = function(treeObj, option) - { - // Add a new action object to the object manager - // @ts-ignore - let obj = treeObj.addObject((typeof option.id == 'number' ? String(option.id) : option.id), new dhtmlxtreeItemAOI(this.input, option.id)); - obj.updateActionLinks(action_links); - - if(option.item && option.item.length > 0) - { - for(let i = 0; i < option.item.length; i++) - { - apply_actions.call(this, treeObj, option.item[i]); - } - } - }; - apply_actions.call(this, treeObj, this.options.select_options); - } - } - - /** - * getValue, retrieves the Id of the selected Item - * @return string or object or null - */ - getValue() - { - if(this.input == null) return null; - if (this.options.multiple) - { - let allChecked = this.input.getAllChecked().split(this.input.dlmtr); - let allUnchecked = this.input.getAllUnchecked().split(this.input.dlmtr); - if (this.options.autoloading) - { - - let res = {}; - for (let i=0;iegw_getAppObjectManager()).getObjectById(this.id); - for(var i=0; i < treeObj.children.length; i++) - { - if(treeObj.children[i].id == _id) - { - treeObj.children[i].id = _newItemId; - if (treeObj.children[i].iface) treeObj.children[i].iface.id = _newItemId; - break; - } - } - - if (typeof _label != 'undefined') this.setLabel(_newItemId, _label); - } - - /** - * deleteItem, deletes an item by id - * @param _id ID of the node - * @param _selectParent select the parent node true/false - * @return void - */ - deleteItem(_id, _selectParent) - { - if(this.input == null) return null; - this.input.deleteItem(_id, _selectParent); - // Update action - // since the action ID has to = this.id, getObjectById() won't work - let treeObj = (egw_getAppObjectManager()).getObjectById(this.id); - for(let i=0; i < treeObj.children.length; i++) - { - if(treeObj.children[i].id == _id) - { - treeObj.children.splice(i,1); - } - } - } - - /** - * Updates a leaf of the tree by requesting new information from the server using the - * autoloading attribute. - * - * @param {string} _id ID of the node - * @param {Object} [data] If provided, the item is refreshed directly with - * the provided data instead of asking the server - * @return void - */ - refreshItem(_id,data) - { - if(this.input == null) return null; - this.input.deleteChildItems(_id); - this.input.setDataMode('JSON'); - - /* Can't use this, it doesn't allow a callback - this.input.refreshItem(_id); - */ - - let self = this; - if(typeof data != 'undefined' && data != null) - { - this.input.loadJSONObject(data, - function() { self._dhtmlxtree_json_callback(data, _id);} - ); - } - else - { - this.input.loadJSON(this.egw().link(this.autoloading_url, {id: _id}), - function(dxmlObject) { - self._dhtmlxtree_json_callback(JSON.parse(dxmlObject.xmlDoc.responseText), _id); - - // refreshing root node causes binding actions fails in dhtmlx tree, we try to refresh the opened node - // in order to rebind the actions again. - if (_id == 0) - { - let openedId = self._oldValue.split("::")[0]; - let interval = setInterval(()=> { - if (self.input.getOpenState(openedId)) - { - clearInterval(interval); - self.refreshItem(openedId); - } - }, 100); - } - } - ); - } - } - - /** - * focus the item, and scrolls it into view - * - * @param _id ID of the node - * @return void - */ - focusItem(_id) - { - if(this.input == null) return null; - this.input.focusItem(_id); - } - - /** - * hasChildren - * - * @param _id ID of the node - * @return the number of childelements - */ - hasChildren(_id) - { - if(this.input == null) return null; - return this.input.hasChildren(_id); - } - - /** - * Callback for after using dhtmlxtree's AJAX loading - * The tree has visually already been updated at this point, we just need - * to update the internal data. - * - * @param {object} new_data Fresh data for the tree - * @param {string} update_option_id optional If provided, only update that node (and children) with the - * provided data instead of the whole thing. Allows for partial updates. - * @return void - */ - private _dhtmlxtree_json_callback(new_data, update_option_id) - { - // not sure if it makes sense to try update_option_id, so far I only seen it to be -1 - let parent_id = typeof update_option_id != 'undefined' && update_option_id != -1 ? update_option_id : new_data.id; - // find root of loaded data to merge it there - let option = this._find_in_item(parent_id, this.options.select_options); - // if we found it, merge it - if (option) - { - jQuery.extend(option,new_data || {}); - } - else // else store it in root - { - this.options.select_options = new_data; - } - // Update actions by just re-setting them - this.set_actions(this.options.actions || {}); - } - - /** - * Recursive search item object for given id - * - * @param {string} _id - * @param {object} _item - * @returns - */ - private _find_in_item(_id, _item) - { - if (_item && _item.id == _id) - { - return _item; - } - if (_item && typeof _item.item != 'undefined') - { - for(let i=0; i < _item.item.length; ++i) - { - let found = this._find_in_item(_id, _item.item[i]); - if (found) return found; - } - } - return null; - } - - /** - * Get node data by id - * - * @param {string} _id id of node - * @return {object} object with attributes id, im0-2, text, tooltip, ... as set via select_options or autoload url - */ - getNode(_id) - { - return this._find_in_item(_id, this.options.select_options); - } - - /** - * Sets label of an item by id - * - * @param _id ID of the node - * @param _label label to set - * @param _tooltip new tooltip, default is previous set tooltip - * @return void - */ - setLabel(_id, _label, _tooltip?) - { - if(this.input == null) return null; - let tooltip = _tooltip || (this.getNode(_id) && this.getNode(_id).tooltip ? - this.getNode(_id).tooltip : ""); - this.input.setItemText(_id, this._htmlencode(_label), tooltip); - } - - /** - * Sets a style for an item by id - * - * @param {string} _id ID of node - * @param {string} _style style to set - * @return void - */ - setStyle(_id, _style) - { - if(this.input == null) return null; - this.input.setItemStyle(_id, _style); - } - - /** - * getLabel, gets the Label of of an item by id - * @param _id ID of the node - * @return _label - */ - getLabel(_id) - { - if(this.input == null) return null; - return this.input.getItemText(_id); - } - - /** - * getSelectedNode, retrieves the full node of the selected Item - * @return string or null - */ - getSelectedNode() - { - if(this.input == null) return null; - // no support for multiple selections - // as there is no get Method to return the full selected node, we use this - return this.options.multiple ? null : this.input._selected[0]; - } - - /** - * getTreeNodeOpenItems - * - * @param {string} _nodeID the nodeID where to start from (initial node) - * @param {string} mode the mode to run in: "forced" fakes the initial node openState to be open - * @return {object} structured array of node ids: array(message-ids) - */ - getTreeNodeOpenItems(_nodeID : string, mode? : string) - { - if(this.input == null) return null; - let z = this.input.getSubItems(_nodeID).split(this.input.dlmtr); - let oS; - let PoS; - let rv; - let returnValue = [_nodeID]; - let modetorun = "none"; - if (mode) { modetorun = mode; } - PoS = this.input.getOpenState(_nodeID); - if (modetorun == "forced") PoS = 1; - if (PoS == 1) { - for(let i=0;iinclude_js_file('/api/js/egw_json.js'); $inc_mgr->include_js_file('/api/js/jsapi/egw.js'); // dhtmlxTree (dhtmlxMenu get loaded via dependency in egw_menu_dhtmlx.js) - $inc_mgr->include_js_file('/api/js/dhtmlxtree/codebase/dhtmlxcommon.js'); - $inc_mgr->include_js_file('/api/js/dhtmlxtree/sources/dhtmlxtree.js'); - $inc_mgr->include_js_file('/api/js/dhtmlxtree/sources/ext/dhtmlxtree_json.js'); + $inc_mgr->include_js_file('/api/js/dhtmlxMenu/codebase/dhtmlxcommon.js'); // actions //TODO there are more and different files that need to be included $inc_mgr->include_js_file('/api/js/egw_action/egw_action_constants');