├── test ├── dist │ ├── themes │ │ └── default │ │ │ ├── 32px.png │ │ │ ├── 40px.png │ │ │ ├── throbber.gif │ │ │ ├── style.min.css │ │ │ └── style.css │ └── jstree.min.js └── index.html ├── TraverseAllSystems ├── CmdCreateSharedParameter.cs ├── Options.cs ├── TraverseAllSystems.addin ├── Util.cs ├── TraverseAllSystems.csproj ├── Properties │ └── AssemblyInfo.cs ├── SharedParameterMgr.cs ├── Command.cs └── TraversalTree.cs ├── TraverseAllSystems.sln ├── LICENSE ├── README.md ├── doc └── usc-forge.txt └── .gitignore /test/dist/themes/default/32px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeremytammik/TraverseAllSystems/HEAD/test/dist/themes/default/32px.png -------------------------------------------------------------------------------- /test/dist/themes/default/40px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeremytammik/TraverseAllSystems/HEAD/test/dist/themes/default/40px.png -------------------------------------------------------------------------------- /test/dist/themes/default/throbber.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeremytammik/TraverseAllSystems/HEAD/test/dist/themes/default/throbber.gif -------------------------------------------------------------------------------- /TraverseAllSystems/CmdCreateSharedParameter.cs: -------------------------------------------------------------------------------- 1 | #region Namespaces 2 | using Autodesk.Revit.Attributes; 3 | using Autodesk.Revit.DB; 4 | using Autodesk.Revit.UI; 5 | #endregion // Namespaces 6 | 7 | namespace TraverseAllSystems 8 | { 9 | [Transaction( TransactionMode.Manual )] 10 | public class CmdCreateSharedParameters 11 | : IExternalCommand 12 | { 13 | public Result Execute( 14 | ExternalCommandData commandData, 15 | ref string message, 16 | ElementSet elements ) 17 | { 18 | UIApplication uiapp = commandData.Application; 19 | Document doc = uiapp.ActiveUIDocument.Document; 20 | 21 | SharedParameterMgr.Create( doc ); 22 | 23 | return Result.Succeeded; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /TraverseAllSystems.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25123.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TraverseAllSystems", "TraverseAllSystems\TraverseAllSystems.csproj", "{7BEA4DEA-49A7-48FD-B2F4-9A955EAE48D6}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {7BEA4DEA-49A7-48FD-B2F4-9A955EAE48D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {7BEA4DEA-49A7-48FD-B2F4-9A955EAE48D6}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {7BEA4DEA-49A7-48FD-B2F4-9A955EAE48D6}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {7BEA4DEA-49A7-48FD-B2F4-9A955EAE48D6}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Jeremy Tammik 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /TraverseAllSystems/Options.cs: -------------------------------------------------------------------------------- 1 | namespace TraverseAllSystems 2 | { 3 | class Options 4 | { 5 | /// 6 | /// Store element id or UniqueId in JSON output? 7 | /// 8 | public static bool StoreUniqueId = true; 9 | public static bool StoreElementId = !StoreUniqueId; 10 | 11 | /// 12 | /// Store parent node id in child, or recursive 13 | /// tree of children in parent? 14 | /// 15 | public static bool StoreJsonGraphBottomUp = false; 16 | public static bool StoreJsonGraphTopDown 17 | = !StoreJsonGraphBottomUp; 18 | 19 | /// 20 | /// Store entire JSON graph for all systems on 21 | /// project info element, or individual graph for 22 | /// each system seaparately in MEP system element? 23 | /// 24 | public static bool StoreEntireJsonGraphOnProjectInfo = true; 25 | public static bool StoreSeparateJsonGraphOnEachSystem 26 | = !StoreEntireJsonGraphOnProjectInfo; 27 | 28 | /// 29 | /// The JSON tag specifying the tree node label, 30 | /// normally either 'name' or 'text'. 31 | /// 32 | public static string NodeLabelTag = "text"; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /TraverseAllSystems/TraverseAllSystems.addin: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Traverse MEP Systems 5 | Export graph structure of all MEP systems 6 | TraverseAllSystems.dll 7 | TraverseAllSystems.Command 8 | 8354d365-d2c8-40c1-96cd-531dfdca19b1 9 | com.typepad.thebuildingcoder 10 | The Building Coder, http://thebuildingcoder.typepad.com 11 | 12 | 23 | -------------------------------------------------------------------------------- /TraverseAllSystems/Util.cs: -------------------------------------------------------------------------------- 1 | 2 | using Autodesk.Revit.DB; 3 | 4 | namespace TraverseAllSystems 5 | { 6 | class Util 7 | { 8 | /// 9 | /// Return a string describing the given element: 10 | /// .NET type name, 11 | /// category name, 12 | /// family and symbol name for a family instance, 13 | /// element id and element name. 14 | /// 15 | public static string ElementDescription( 16 | Element e ) 17 | { 18 | if( null == e ) 19 | { 20 | return ""; 21 | } 22 | 23 | // For a wall, the element name equals the 24 | // wall type name, which is equivalent to the 25 | // family name ... 26 | 27 | FamilyInstance fi = e as FamilyInstance; 28 | 29 | string typeName = e.GetType().Name; 30 | 31 | string categoryName = ( null == e.Category ) 32 | ? string.Empty 33 | : e.Category.Name + " "; 34 | 35 | string familyName = ( null == fi ) 36 | ? string.Empty 37 | : fi.Symbol.Family.Name + " "; 38 | 39 | string symbolName = ( null == fi 40 | || e.Name.Equals( fi.Symbol.Name ) ) 41 | ? string.Empty 42 | : fi.Symbol.Name + " "; 43 | 44 | return string.Format( "{0} {1}{2}{3}<{4} {5}>", 45 | typeName, categoryName, familyName, 46 | symbolName, e.Id.IntegerValue, e.Name ); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /test/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | jsTree test 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 26 |
27 | 28 | 31 | 32 | 33 | 34 | 35 | 36 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # TraverseAllSystems 2 | 3 | C# .NET Revit API add-in to extract graph structure of all MEP systems. 4 | 5 | For more information, please refer 6 | to [The Building Coder](http://thebuildingcoder.typepad.com) discussion 7 | on [traversing and exporting all MEP system graphs](http://thebuildingcoder.typepad.com/blog/2016/06/traversing-and-exporting-all-mep-system-graphs.html). 8 | 9 | ## Options 10 | 11 | - Use element id or UniqueId for to identify node 12 | - Store JSON graph bottom-up or top-down 13 | 14 | The two bottom-up and top-down JSON storage structures both comply with 15 | the [jsTree JSON spec](https://www.jstree.com/docs/json). 16 | 17 | ### Bottom-Up JSON Structure 18 | 19 | ``` 20 | [ 21 | { "id" : "ajson1", "parent" : "#", "text" : "Simple root node" }, 22 | { "id" : "ajson2", "parent" : "#", "text" : "Root node 2" }, 23 | { "id" : "ajson3", "parent" : "ajson2", "text" : "Child 1" }, 24 | { "id" : "ajson4", "parent" : "ajson2", "text" : "Child 2" }, 25 | ] 26 | ``` 27 | 28 | ### Top-Down JSON Structure 29 | 30 | ``` 31 | { 32 | id: -1, 33 | name: 'Root', 34 | children: [ 35 | { 36 | id: 0, 37 | name: 'Mechanical System', 38 | children: [ 39 | { 40 | id: 0_1, 41 | name: 'Child 0_1', 42 | type: 'window', 43 | otherField: 'something...', 44 | children: [ 45 | { 46 | id: 0_1_1, 47 | name: 'Grandchild 0_1_1' 48 | }] 49 | }, { 50 | id: 0_2, 51 | name: 'Child 0_2', 52 | children: [ 53 | { 54 | id: 0_2_1, 55 | name: 'Grandchild 0_2_1' 56 | }] 57 | }] 58 | }, { 59 | id: 2, 60 | name: 'Electrical System', 61 | children: [ 62 | { 63 | id: 2_1, 64 | name: 'Child 2_1', 65 | children: [{ 66 | id: 2_1_1, 67 | name: 'Grandchild 2_1_1' 68 | }] 69 | }, 70 | { 71 | id: 2_2, 72 | name: 'Child 2_2', 73 | children: [{ 74 | id: 2_2_1, 75 | name: 'Grandchild 2_2_1' 76 | }] 77 | }] 78 | }, 79 | { 80 | id: 3, 81 | name: 'Piping System', 82 | children: [ 83 | { 84 | id: 3_1, 85 | name: 'Child 3_1', 86 | children: [{ 87 | id: 3_1_1, 88 | name: 'Grandchild 3_1_1' 89 | }] 90 | }, 91 | { 92 | id: 3_2, 93 | name: 'Child 3_2', 94 | children: [{ 95 | id: 3_2_1, 96 | name: 'Grandchild 3_2_1' 97 | }] 98 | }] 99 | }] 100 | } 101 | ``` 102 | 103 | ## Test 104 | 105 | Here is a link to the [test jsTree](https://jeremytammik.github.io/TraverseAllSystems/test) populated from the USC Revit test model. 106 | 107 | 108 | ## Author 109 | 110 | Jeremy Tammik, 111 | [The Building Coder](http://thebuildingcoder.typepad.com) and 112 | [The 3D Web Coder](http://the3dwebcoder.typepad.com), 113 | [Forge](http://forge.autodesk.com) [Platform](https://developer.autodesk.com) Development, 114 | [ADN](http://www.autodesk.com/adn) 115 | [Open](http://www.autodesk.com/adnopen), 116 | [Autodesk Inc.](http://www.autodesk.com) 117 | 118 | 119 | ## License 120 | 121 | This sample is licensed under the terms of the [MIT License](http://opensource.org/licenses/MIT). 122 | Please see the [LICENSE](LICENSE) file for full details. 123 | -------------------------------------------------------------------------------- /TraverseAllSystems/TraverseAllSystems.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | None 7 | 8 | 9 | 10 | 11 | Debug 12 | AnyCPU 13 | {7BEA4DEA-49A7-48FD-B2F4-9A955EAE48D6} 14 | Library 15 | Properties 16 | TraverseAllSystems 17 | TraverseAllSystems 18 | v4.8 19 | 512 20 | 21 | 22 | true 23 | full 24 | false 25 | bin\Debug\ 26 | DEBUG;TRACE 27 | prompt 28 | 4 29 | Program 30 | $(ProgramW6432)\Autodesk\Revit 2017\Revit.exe 31 | Off 32 | 33 | 34 | pdbonly 35 | true 36 | bin\Release\ 37 | TRACE 38 | prompt 39 | 4 40 | Program 41 | $(ProgramW6432)\Autodesk\Revit 2017\Revit.exe 42 | 43 | 44 | 45 | C:\Program Files\Autodesk\Revit 2023\RevitAPI.dll 46 | False 47 | 48 | 49 | C:\Program Files\Autodesk\Revit 2023\RevitAPIUI.dll 50 | False 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | copy "$(ProjectDir)*.addin" "$(AppData)\Autodesk\REVIT\Addins\2017" 70 | copy "$(ProjectDir)bin\debug\*.dll" "$(AppData)\Autodesk\REVIT\Addins\2017" 71 | 72 | 79 | 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /TraverseAllSystems/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle( "TraverseAllSystems" )] 9 | [assembly: AssemblyDescription("Revit add-in for MEP system traversal")] 10 | [assembly: AssemblyConfiguration( "" )] 11 | [assembly: AssemblyCompany( "Autodesk Inc." )] 12 | [assembly: AssemblyProduct( "TraverseAllSystems Revit C# .NET Add-In" )] 13 | [assembly: AssemblyCopyright("Copyright 2016-2022 (C) Jeremy Tammik, Autodesk Inc.")] 14 | [assembly: AssemblyTrademark( "" )] 15 | [assembly: AssemblyCulture( "" )] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible( false )] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid( "321044f7-b0b2-4b1c-af18-e71a19252be0" )] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | // 36 | // History: 37 | // 38 | // 2016-06-21 2017.0.0.0 initial implementation based on TraverseSystem SDK sample 39 | // 2016-06-21 2017.0.0.1 added desired system predicate, first successful test 40 | // 2016-06-22 2017.0.0.2 implemented visited element dictionary to prevent infinite recursion loop 41 | // 2016-06-22 2017.0.0.3 implemented DumpToJson 42 | // 2016-06-22 2017.0.0.4 implemented shared parameter creation 43 | // 2016-06-22 2017.0.0.5 implemented shared parameter value population 44 | // 2016-06-22 2017.0.0.5 tested and verified graph structure json is written out 45 | // 2016-06-22 2017.0.0.6 renamed json text field to name 46 | // 2016-06-23 2017.0.0.7 implemented storage of top-down system graph in json 47 | // 2016-06-23 2017.0.0.8 automatically create shared parameter if needed, eliminated separate command 48 | // 2016-06-23 2017.0.0.8 wrap json strings in double quotes and validated json output 49 | // 2016-06-23 2017.0.0.9 cleaned up for publication 50 | // 2016-06-23 2017.0.0.10 implemented jstree test file and verified proper tree population 51 | // 2016-06-23 2017.0.0.11 implemented test page, gh-pages, test link, separate test treedata.json, master and gh-pages syncing 52 | // 2016-06-24 2017.0.0.12 added json sample data from rme_advanced_sample_model 53 | // 2016-06-24 2017.0.0.13 removed duplicate root id -1 54 | // 2016-06-24 2017.0.0.14 store entire json graph for all systems on project info instead of separate subgraph on each individual system 55 | // 2016-06-24 2017.0.0.15 before pull request #1 by @ChengZY 56 | // 2016-06-24 2017.0.0.16 integrated pull request #1 by @ChengZY 57 | // 2016-06-25 2017.0.0.17 implemented Options.NodeLabelTag to switch more easily between 'text' and 'name' for node label 58 | // 2016-06-26 2017.0.0.17 split graph into three domain-specific subgraphs 59 | // 2016-06-26 2017.0.0.17 sort each domain specific graph and display full element description 60 | // 2016-06-27 2017.0.0.18 use hash code to generate unique jstree ids for top-level project, mechanical, electrical and piping nodes 61 | // 2022-07-22 2017.0.0.19 if `m_system.BaseEquipment` is `null` then iterate over elements to search for equipment 62 | // 2022-09-27 2017.0.0.20 merged issues 3 + 5, PR 4 + 6: check if `sharedParamsFileName` doesn't exist, and include elements with Curve ConnectorType 63 | // 2022-09-27 2023.0.0.0 flat migration to Revit 2023 64 | // 65 | [assembly: AssemblyVersion("2023.0.0.0")] 66 | [assembly: AssemblyFileVersion("2023.0.0.0")] 67 | -------------------------------------------------------------------------------- /doc/usc-forge.txt: -------------------------------------------------------------------------------- 1 | USC_Forge 2 | 3 | 2D/3D Synchronization (markup, save) 4 | create a toolbar button to show/hide 2D section 5 | create new 2D viewer attached below 3D viewer 6 | Main Window 7 | Functional Buttons (show/hide sub-function) 8 | 3.create a toolbar button to show/hide Viewpoints panel 9 | 4.create a toolbar button to show/hide System panel 10 | 11 | Panels (Triggered by Toolbar Button) 12 | 5.create a panel for Viewpoints 13 | 6.create a panel for System 14 | Viewpoints (room, level) 15 | 7. Generate building hierarchy list (level&room) in viewpoints panel 16 | 8. Implement search form in panel for building level/room 17 | 9. Choose exact object (room, level) in viewpoints list 18 | 10.Move camera to viewpoint of selected object(s) 19 | System (colorization) 20 | 11.Generate system hierarchy list in systems panel: http://thebuildingcoder.typepad.com/blog/2013/02/simple-mep-system-traversal.html 21 | 22 | http://thebuildingcoder.typepad.com/blog/2009/06/revit-mep-api.html 23 | 24 | Revit: UniqueId 25 | Forge viewer: dbid, property external id == guid → UniqueId 26 | Getting Started with the Revit API: 27 | http://thebuildingcoder.typepad.com/blog/about-the-author.html#2 28 | 29 | 30 | 12.Highlight selected system by clicking list item 31 | 17.Implement search form in panel for systems 32 | Properties Panel 33 | 13.generate a link to database (open a new tag) 34 | 14.build a new row named “Link to Database” in property panel 35 | Backend (Server Side) 36 | 15.auth token service 37 | 16.file upload (currently A360) 38 | 39 | 40 | 41 | 42 | Links from usc website 43 | Issue report 44 | move element in webviewer 45 | ------------------------------------------------------------------------ 46 | 47 | Revit (.rvt) navisworks(.nwd) 48 | Archi+MEP has room viewpoints (manual add) 49 | section box 50 | 51 | PS: A360 cannot be used as backend 52 | 53 | 54 | Shunni Li: 55 | Created a link property in Properties panel linking to USC equipment database (for both .rvt and .nwd files) 56 | Implemented recuisively collapsing all the items in Systems panel 57 | changed some styles of html 58 | 59 | 60 | 61 | 62 | 63 | Jiayuan Huang: 64 | Implement viewpoints function of the viewer 65 | create toolbar button and panel for viewpoints 66 | collect roomtext data 67 | create custom tree for display data 68 | move camera to fit the view of a room 69 | 70 | 71 | 72 | Zhonghao Wang 73 | back-end: using node js and build on the AWS server 74 | upload the rvt&nwd file to the Autodesk server and translate the file 75 | use the server to get the urn(document Id) & access token 76 | dynamically router the request as a REST server 77 | front-end:js 78 | get the parameter through its own url 79 | ajax call to get data 80 | 81 | 82 | 83 | 84 | Jibin Lyu 85 | Implemented system information showing functionality 86 | Created a toolbar button to show / hide System Information panel 87 | Customized a System panel making use of Property List Panel to show system informaton data 88 | Parsed JSON format system information data to properly fit System panel 89 | Implemented one click function of the element in the panel to highlight corresponding element in the graph 90 | Implemented double click function of the element in the panel to show up its Property panel 91 | Beautified website UI 92 | 93 | 94 | 95 | 96 | 97 | 98 | Ziyu Cheng: 99 | Implemented button to show/hide 2D Map view. 100 | Implemented 2D viewer and 3D viewer synchronization. 101 | Study Revit-api create Revit add-in to generate system hierarchy relation and parse data into tree-structured json file. 102 | 103 | 104 | 105 | http://uscforge-env.us-west-2.elasticbeanstalk.com 106 | 107 | --------------------------------------- 108 | 109 | https://myhub.autodesk360.com/ue29c2737/shares/public/SH7f1edQT22b515c761e848c5b75f889aefd 110 | -------------------------------------------------------------------------------- /TraverseAllSystems/SharedParameterMgr.cs: -------------------------------------------------------------------------------- 1 | #region Namespaces 2 | using System; 3 | using Autodesk.Revit.DB; 4 | using Autodesk.Revit.ApplicationServices; 5 | using System.IO; 6 | using System.Collections.Generic; 7 | using System.Diagnostics; 8 | #endregion // Namespaces 9 | 10 | namespace TraverseAllSystems 11 | { 12 | /// 13 | /// Shared parameters to keep store MEP system 14 | /// graph structure in JSON strings. 15 | /// 16 | class SharedParameterMgr 17 | { 18 | /// 19 | /// Define the user visible shared parameter name. 20 | /// 21 | const string _shared_param_name = "MepSystemGraphJson"; 22 | 23 | /// 24 | /// Return the parameter definition from 25 | /// the given element and parameter name. 26 | /// 27 | public static Definition GetDefinition( Element e ) 28 | { 29 | IList ps = e.GetParameters( 30 | _shared_param_name ); 31 | 32 | int n = ps.Count; 33 | 34 | Debug.Assert( 1 >= n, 35 | "expected maximum one shared parameters " 36 | + "named " + _shared_param_name ); 37 | 38 | Definition d = ( 0 == n ) 39 | ? null 40 | : ps[0].Definition; 41 | 42 | return d; 43 | } 44 | 45 | /// 46 | /// Create a new shared parameter definition 47 | /// in the specified grpup. 48 | /// 49 | static Definition CreateNewDefinition( 50 | DefinitionGroup group, 51 | string parameter_name, 52 | //ParameterType parameter_type 53 | ForgeTypeId forgeTypeId ) 54 | { 55 | return group.Definitions.Create( 56 | new ExternalDefinitionCreationOptions( 57 | parameter_name, forgeTypeId) ); 58 | } 59 | 60 | /// 61 | /// Create the shared parameter. 62 | /// 63 | public static void Create( Document doc ) 64 | { 65 | /// 66 | /// Shared parameters filename; used only in case 67 | /// none is set and we need to create the export 68 | /// history shared parameters. 69 | /// 70 | const string _shared_parameters_filename 71 | = "shared_parameters.txt"; 72 | 73 | const string _definition_group_name 74 | = "TraverseAllSystems"; 75 | 76 | Application app = doc.Application; 77 | 78 | // Retrieve shared parameter file name 79 | 80 | string sharedParamsFileName 81 | = app.SharedParametersFilename; 82 | 83 | if( null == sharedParamsFileName 84 | || 0 == sharedParamsFileName.Length 85 | || !File.Exists(sharedParamsFileName) ) 86 | { 87 | string path = Path.GetTempPath(); 88 | 89 | path = Path.Combine( path, 90 | _shared_parameters_filename ); 91 | 92 | StreamWriter stream; 93 | stream = new StreamWriter( path ); 94 | stream.Close(); 95 | 96 | app.SharedParametersFilename = path; 97 | 98 | sharedParamsFileName 99 | = app.SharedParametersFilename; 100 | } 101 | 102 | // Retrieve shared parameter file object 103 | 104 | DefinitionFile f 105 | = app.OpenSharedParameterFile(); 106 | 107 | using( Transaction t = new Transaction( doc ) ) 108 | { 109 | t.Start( "Create TraverseAllSystems " 110 | + "Shared Parameters" ); 111 | 112 | // Create the category set for binding 113 | 114 | CategorySet catSet = app.Create.NewCategorySet(); 115 | 116 | if( Options.StoreEntireJsonGraphOnProjectInfo ) 117 | { 118 | Category cat = doc.Settings.Categories.get_Item( 119 | BuiltInCategory.OST_ProjectInformation ); 120 | 121 | catSet.Insert( cat ); 122 | } 123 | else 124 | { 125 | Category cat = doc.Settings.Categories.get_Item( 126 | BuiltInCategory.OST_DuctSystem ); 127 | 128 | catSet.Insert( cat ); 129 | 130 | cat = doc.Settings.Categories.get_Item( 131 | BuiltInCategory.OST_PipingSystem ); 132 | 133 | catSet.Insert( cat ); 134 | } 135 | 136 | Binding binding = app.Create.NewInstanceBinding( 137 | catSet ); 138 | 139 | // Retrieve or create shared parameter group 140 | 141 | DefinitionGroup group 142 | = f.Groups.get_Item( _definition_group_name ) 143 | ?? f.Groups.Create( _definition_group_name ); 144 | 145 | // Retrieve or create the three parameters; 146 | // we could check if they are already bound, 147 | // but it looks like Insert will just ignore 148 | // them in that case. 149 | 150 | Definition definition 151 | = group.Definitions.get_Item(_shared_param_name) 152 | ?? CreateNewDefinition(group, 153 | _shared_param_name, SpecTypeId.String.Text); // ParameterType.Text 154 | 155 | doc.ParameterBindings.Insert( definition, binding, 156 | BuiltInParameterGroup.PG_GENERAL ); 157 | 158 | t.Commit(); 159 | } 160 | } 161 | } 162 | } 163 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | bld/ 21 | [Bb]in/ 22 | [Oo]bj/ 23 | [Ll]og/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | # Uncomment if you have tasks that create the project's static files in wwwroot 28 | #wwwroot/ 29 | 30 | # MSTest test Results 31 | [Tt]est[Rr]esult*/ 32 | [Bb]uild[Ll]og.* 33 | 34 | # NUNIT 35 | *.VisualState.xml 36 | TestResult.xml 37 | 38 | # Build Results of an ATL Project 39 | [Dd]ebugPS/ 40 | [Rr]eleasePS/ 41 | dlldata.c 42 | 43 | # DNX 44 | project.lock.json 45 | artifacts/ 46 | 47 | *_i.c 48 | *_p.c 49 | *_i.h 50 | *.ilk 51 | *.meta 52 | *.obj 53 | *.pch 54 | *.pdb 55 | *.pgc 56 | *.pgd 57 | *.rsp 58 | *.sbr 59 | *.tlb 60 | *.tli 61 | *.tlh 62 | *.tmp 63 | *.tmp_proj 64 | *.log 65 | *.vspscc 66 | *.vssscc 67 | .builds 68 | *.pidb 69 | *.svclog 70 | *.scc 71 | 72 | # Chutzpah Test files 73 | _Chutzpah* 74 | 75 | # Visual C++ cache files 76 | ipch/ 77 | *.aps 78 | *.ncb 79 | *.opendb 80 | *.opensdf 81 | *.sdf 82 | *.cachefile 83 | *.VC.db 84 | *.VC.VC.opendb 85 | 86 | # Visual Studio profiler 87 | *.psess 88 | *.vsp 89 | *.vspx 90 | *.sap 91 | 92 | # TFS 2012 Local Workspace 93 | $tf/ 94 | 95 | # Guidance Automation Toolkit 96 | *.gpState 97 | 98 | # ReSharper is a .NET coding add-in 99 | _ReSharper*/ 100 | *.[Rr]e[Ss]harper 101 | *.DotSettings.user 102 | 103 | # JustCode is a .NET coding add-in 104 | .JustCode 105 | 106 | # TeamCity is a build add-in 107 | _TeamCity* 108 | 109 | # DotCover is a Code Coverage Tool 110 | *.dotCover 111 | 112 | # NCrunch 113 | _NCrunch_* 114 | .*crunch*.local.xml 115 | nCrunchTemp_* 116 | 117 | # MightyMoose 118 | *.mm.* 119 | AutoTest.Net/ 120 | 121 | # Web workbench (sass) 122 | .sass-cache/ 123 | 124 | # Installshield output folder 125 | [Ee]xpress/ 126 | 127 | # DocProject is a documentation generator add-in 128 | DocProject/buildhelp/ 129 | DocProject/Help/*.HxT 130 | DocProject/Help/*.HxC 131 | DocProject/Help/*.hhc 132 | DocProject/Help/*.hhk 133 | DocProject/Help/*.hhp 134 | DocProject/Help/Html2 135 | DocProject/Help/html 136 | 137 | # Click-Once directory 138 | publish/ 139 | 140 | # Publish Web Output 141 | *.[Pp]ublish.xml 142 | *.azurePubxml 143 | # TODO: Comment the next line if you want to checkin your web deploy settings 144 | # but database connection strings (with potential passwords) will be unencrypted 145 | *.pubxml 146 | *.publishproj 147 | 148 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 149 | # checkin your Azure Web App publish settings, but sensitive information contained 150 | # in these scripts will be unencrypted 151 | PublishScripts/ 152 | 153 | # NuGet Packages 154 | *.nupkg 155 | # The packages folder can be ignored because of Package Restore 156 | **/packages/* 157 | # except build/, which is used as an MSBuild target. 158 | !**/packages/build/ 159 | # Uncomment if necessary however generally it will be regenerated when needed 160 | #!**/packages/repositories.config 161 | # NuGet v3's project.json files produces more ignoreable files 162 | *.nuget.props 163 | *.nuget.targets 164 | 165 | # Microsoft Azure Build Output 166 | csx/ 167 | *.build.csdef 168 | 169 | # Microsoft Azure Emulator 170 | ecf/ 171 | rcf/ 172 | 173 | # Windows Store app package directories and files 174 | AppPackages/ 175 | BundleArtifacts/ 176 | Package.StoreAssociation.xml 177 | _pkginfo.txt 178 | 179 | # Visual Studio cache files 180 | # files ending in .cache can be ignored 181 | *.[Cc]ache 182 | # but keep track of directories ending in .cache 183 | !*.[Cc]ache/ 184 | 185 | # Others 186 | ClientBin/ 187 | ~$* 188 | *~ 189 | *.dbmdl 190 | *.dbproj.schemaview 191 | *.pfx 192 | *.publishsettings 193 | node_modules/ 194 | orleans.codegen.cs 195 | 196 | # Since there are multiple workflows, uncomment next line to ignore bower_components 197 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 198 | #bower_components/ 199 | 200 | # RIA/Silverlight projects 201 | Generated_Code/ 202 | 203 | # Backup & report files from converting an old project file 204 | # to a newer Visual Studio version. Backup files are not needed, 205 | # because we have git ;-) 206 | _UpgradeReport_Files/ 207 | Backup*/ 208 | UpgradeLog*.XML 209 | UpgradeLog*.htm 210 | 211 | # SQL Server files 212 | *.mdf 213 | *.ldf 214 | 215 | # Business Intelligence projects 216 | *.rdl.data 217 | *.bim.layout 218 | *.bim_*.settings 219 | 220 | # Microsoft Fakes 221 | FakesAssemblies/ 222 | 223 | # GhostDoc plugin setting file 224 | *.GhostDoc.xml 225 | 226 | # Node.js Tools for Visual Studio 227 | .ntvs_analysis.dat 228 | 229 | # Visual Studio 6 build log 230 | *.plg 231 | 232 | # Visual Studio 6 workspace options file 233 | *.opt 234 | 235 | # Visual Studio LightSwitch build output 236 | **/*.HTMLClient/GeneratedArtifacts 237 | **/*.DesktopClient/GeneratedArtifacts 238 | **/*.DesktopClient/ModelManifest.xml 239 | **/*.Server/GeneratedArtifacts 240 | **/*.Server/ModelManifest.xml 241 | _Pvt_Extensions 242 | 243 | # Paket dependency manager 244 | .paket/paket.exe 245 | paket-files/ 246 | 247 | # FAKE - F# Make 248 | .fake/ 249 | 250 | # JetBrains Rider 251 | .idea/ 252 | *.sln.iml 253 | -------------------------------------------------------------------------------- /TraverseAllSystems/Command.cs: -------------------------------------------------------------------------------- 1 | #region Namespaces 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.IO; 5 | using System.Linq; 6 | using System.Text; 7 | using Autodesk.Revit.ApplicationServices; 8 | using Autodesk.Revit.Attributes; 9 | using Autodesk.Revit.DB; 10 | using Autodesk.Revit.DB.Electrical; 11 | using Autodesk.Revit.DB.Mechanical; 12 | using Autodesk.Revit.DB.Plumbing; 13 | using Autodesk.Revit.UI; 14 | #endregion 15 | 16 | namespace TraverseAllSystems 17 | { 18 | [Transaction( TransactionMode.Manual )] 19 | public class Command : IExternalCommand 20 | { 21 | /// 22 | /// Return true to include this system in the 23 | /// exported system graphs. 24 | /// 25 | static bool IsDesirableSystemPredicate( MEPSystem s ) 26 | { 27 | return 1 < s.Elements.Size 28 | && !s.Name.Equals( "unassigned" ) 29 | && ( ( s is MechanicalSystem 30 | && ( (MechanicalSystem) s ).IsWellConnected ) 31 | || ( s is PipingSystem 32 | && ( (PipingSystem) s ).IsWellConnected ) 33 | || ( s is ElectricalSystem 34 | && ( (ElectricalSystem) s ).IsMultipleNetwork ) ); 35 | } 36 | 37 | /// 38 | /// The thee MEP disciplines 39 | /// 40 | public enum MepDomain 41 | { 42 | Invalid = -1, 43 | Mechanical = 0, 44 | Electrical = 1, 45 | Piping = 2, 46 | Count = 3 47 | } 48 | 49 | MepDomain GetMepDomain( MEPSystem s ) 50 | { 51 | return ( s is MechanicalSystem ) ? MepDomain.Mechanical 52 | : (( s is ElectricalSystem ) ? MepDomain.Electrical 53 | : (( s is PipingSystem ) ? MepDomain.Piping 54 | : MepDomain.Invalid)); 55 | } 56 | 57 | /// 58 | /// Create a and return the path of a random temporary directory. 59 | /// 60 | static string GetTemporaryDirectory() 61 | { 62 | string tempDirectory = Path.Combine( 63 | Path.GetTempPath(), Path.GetRandomFileName() ); 64 | 65 | Directory.CreateDirectory( tempDirectory ); 66 | 67 | return tempDirectory; 68 | } 69 | 70 | public Result Execute( 71 | ExternalCommandData commandData, 72 | ref string message, 73 | ElementSet elements ) 74 | { 75 | UIApplication uiapp = commandData.Application; 76 | UIDocument uidoc = uiapp.ActiveUIDocument; 77 | Application app = uiapp.Application; 78 | Document doc = uidoc.Document; 79 | 80 | FilteredElementCollector allSystems 81 | = new FilteredElementCollector( doc ) 82 | .OfClass( typeof( MEPSystem ) ); 83 | 84 | int nAllSystems = allSystems.Count(); 85 | 86 | IEnumerable desirableSystems 87 | = allSystems.Cast().Where( 88 | s => IsDesirableSystemPredicate( s ) ); 89 | 90 | int nDesirableSystems = desirableSystems 91 | .Count(); 92 | 93 | // Check for shared parameter 94 | // to store graph information. 95 | 96 | // Determine element from which to retrieve 97 | // shared parameter definition. 98 | 99 | Element json_storage_element 100 | = Options.StoreSeparateJsonGraphOnEachSystem 101 | ? desirableSystems.First() 102 | : new FilteredElementCollector( doc ) 103 | .OfClass( typeof( ProjectInfo ) ) 104 | .FirstElement(); 105 | 106 | Definition def = SharedParameterMgr.GetDefinition( 107 | json_storage_element ); 108 | 109 | if( null == def ) 110 | { 111 | SharedParameterMgr.Create( doc ); 112 | 113 | def = SharedParameterMgr.GetDefinition( 114 | json_storage_element ); 115 | 116 | if( null == def ) 117 | { 118 | message = "Error creating the " 119 | + "storage shared parameter."; 120 | 121 | return Result.Failed; 122 | } 123 | } 124 | 125 | string outputFolder = GetTemporaryDirectory(); 126 | 127 | int nXmlFiles = 0; 128 | int nJsonGraphs = 0; 129 | int nJsonBytes = 0; 130 | 131 | // Collect one JSON string per system. 132 | 133 | string json; 134 | 135 | // Three separate collections for mechanical, 136 | // electrical and piping systems: 137 | 138 | List[] json_collector 139 | = new List[(int)MepDomain.Count] { 140 | new List(), 141 | new List(), 142 | new List() }; 143 | 144 | using( Transaction t = new Transaction( doc ) ) 145 | { 146 | t.Start( "Determine MEP Graph Structure and Store in JSON Shared Parameter" ); 147 | 148 | StringBuilder[] sbs = new StringBuilder[3]; 149 | 150 | for( int i = 0; i < 3; ++i ) 151 | { 152 | sbs[i] = new StringBuilder(); 153 | sbs[i].Append( "[" ); 154 | } 155 | 156 | foreach( MEPSystem system in desirableSystems ) 157 | { 158 | Debug.Print( system.Name ); 159 | 160 | FamilyInstance root = system.BaseEquipment; 161 | 162 | // Traverse the system and dump the 163 | // traversal graph into an XML file 164 | 165 | TraversalTree tree = new TraversalTree( system ); 166 | 167 | if( tree.Traverse() ) 168 | { 169 | string filename = system.Id.IntegerValue.ToString(); 170 | 171 | filename = Path.ChangeExtension( 172 | Path.Combine( outputFolder, filename ), "xml" ); 173 | 174 | tree.DumpIntoXML( filename ); 175 | 176 | // Uncomment to preview the 177 | // resulting XML structure 178 | 179 | //Process.Start( fileName ); 180 | 181 | json = Options.StoreJsonGraphBottomUp 182 | ? tree.DumpToJsonBottomUp() 183 | : tree.DumpToJsonTopDown(); 184 | 185 | Debug.Assert( 2 < json.Length, 186 | "expected valid non-empty JSON graph data" ); 187 | 188 | Debug.Print( json ); 189 | 190 | // Save this system hierarchy JSON in the 191 | // appropriate domain specific collector. 192 | 193 | json_collector[(int)GetMepDomain(system)].Add( json ); 194 | 195 | if( Options.StoreSeparateJsonGraphOnEachSystem ) 196 | { 197 | Parameter p = system.get_Parameter( def ); 198 | p.Set( json ); 199 | } 200 | 201 | nJsonBytes += json.Length; 202 | ++nJsonGraphs; 203 | ++nXmlFiles; 204 | } 205 | tree.CollectUniqueIds( sbs ); 206 | } 207 | 208 | for( int i = 0; i < 3; ++i ) 209 | { 210 | if( sbs[i][sbs[i].Length - 1] == ',' ) 211 | { 212 | sbs[i].Remove( sbs[i].Length - 1, 1 ); 213 | } 214 | sbs[i].Append( "]" ); 215 | } 216 | 217 | StringBuilder sb = new StringBuilder(); 218 | 219 | sb.Append( "{\"id\": 1 , \"name\" : \"MEP Systems\" , \"children\" : [{\"id\": 2 , \"name\": \"Mechanical System\",\"children\":" ); 220 | sb.Append( sbs[0].ToString() ); 221 | 222 | sb.Append( "},{\"id\":3,\"name\":\"Electrical System\", \"children\":" ); 223 | sb.Append( sbs[1].ToString() ); 224 | 225 | sb.Append( "},{\"id\":4,\"name\":\"Piping System\", \"children\":" ); 226 | sb.Append( sbs[2].ToString() ); 227 | sb.Append( "}]}" ); 228 | 229 | StreamWriter file = new StreamWriter( 230 | Path.ChangeExtension( 231 | Path.Combine( outputFolder, "jsonData" ), 232 | "json" ) ); 233 | 234 | file.WriteLine( sb.ToString() ); 235 | file.Flush(); 236 | file.Close(); 237 | 238 | t.Commit(); 239 | } 240 | 241 | string msg = string.Format( 242 | "{0} XML files and {1} JSON graphs ({2} bytes) " 243 | + "generated in {3} ({4} total systems, {5} desirable):", 244 | nXmlFiles, nJsonGraphs, nJsonBytes, 245 | outputFolder, nAllSystems, nDesirableSystems ); 246 | 247 | List system_list = desirableSystems 248 | .Select( e => 249 | string.Format( "{0}({1})", e.Id, e.Name ) ) 250 | .ToList(); 251 | 252 | system_list.Sort(); 253 | 254 | string detail = string.Join( ", ", 255 | system_list.ToArray() ); 256 | 257 | TaskDialog dlg = new TaskDialog( 258 | nXmlFiles.ToString() + " Systems" ); 259 | 260 | dlg.MainInstruction = msg; 261 | dlg.MainContent = detail; 262 | 263 | dlg.Show(); 264 | 265 | string[] json_systems = new string[3]; 266 | int id = doc.Title.GetHashCode(); 267 | 268 | for( MepDomain d = MepDomain.Mechanical; 269 | d < MepDomain.Count; ++d ) 270 | { 271 | // Compare the systems using the label value, 272 | // which comes after the first comma. 273 | 274 | json_collector[(int) d].Sort( (s,t) 275 | => string.Compare( 276 | s.Substring(s.IndexOf(",")), 277 | t.Substring( t.IndexOf( "," ) ) ) ); 278 | 279 | json_systems[(int)d] 280 | = TreeNode.CreateJsonParentNode( 281 | (++id).ToString(), d.ToString(), 282 | json_collector[(int) d].ToArray() ); 283 | } 284 | 285 | json = TreeNode.CreateJsonParentNode( 286 | doc.Title.GetHashCode().ToString(), 287 | doc.Title, json_systems ); 288 | 289 | Debug.Print( json ); 290 | 291 | if( Options.StoreEntireJsonGraphOnProjectInfo ) 292 | { 293 | using( Transaction t = new Transaction( doc ) ) 294 | { 295 | t.Start( "Store MEP Graph Structure " 296 | + "in JSON Shared Parameter" ); 297 | 298 | Parameter p = json_storage_element 299 | .get_Parameter( def ); 300 | 301 | p.Set( json ); 302 | 303 | t.Commit(); 304 | } 305 | } 306 | 307 | return Result.Succeeded; 308 | } 309 | } 310 | } 311 | -------------------------------------------------------------------------------- /test/dist/themes/default/style.min.css: -------------------------------------------------------------------------------- 1 | .jstree-node,.jstree-children,.jstree-container-ul{display:block;margin:0;padding:0;list-style-type:none;list-style-image:none}.jstree-node{white-space:nowrap}.jstree-anchor{display:inline-block;color:#000;white-space:nowrap;padding:0 4px 0 1px;margin:0;vertical-align:top}.jstree-anchor:focus{outline:0}.jstree-anchor,.jstree-anchor:link,.jstree-anchor:visited,.jstree-anchor:hover,.jstree-anchor:active{text-decoration:none;color:inherit}.jstree-icon{display:inline-block;text-decoration:none;margin:0;padding:0;vertical-align:top;text-align:center}.jstree-icon:empty{display:inline-block;text-decoration:none;margin:0;padding:0;vertical-align:top;text-align:center}.jstree-ocl{cursor:pointer}.jstree-leaf>.jstree-ocl{cursor:default}.jstree .jstree-open>.jstree-children{display:block}.jstree .jstree-closed>.jstree-children,.jstree .jstree-leaf>.jstree-children{display:none}.jstree-anchor>.jstree-themeicon{margin-right:2px}.jstree-no-icons .jstree-themeicon,.jstree-anchor>.jstree-themeicon-hidden{display:none}.jstree-hidden,.jstree-node.jstree-hidden{display:none}.jstree-rtl .jstree-anchor{padding:0 1px 0 4px}.jstree-rtl .jstree-anchor>.jstree-themeicon{margin-left:2px;margin-right:0}.jstree-rtl .jstree-node{margin-left:0}.jstree-rtl .jstree-container-ul>.jstree-node{margin-right:0}.jstree-wholerow-ul{position:relative;display:inline-block;min-width:100%}.jstree-wholerow-ul .jstree-leaf>.jstree-ocl{cursor:pointer}.jstree-wholerow-ul .jstree-anchor,.jstree-wholerow-ul .jstree-icon{position:relative}.jstree-wholerow-ul .jstree-wholerow{width:100%;cursor:pointer;position:absolute;left:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.vakata-context{display:none}.vakata-context,.vakata-context ul{margin:0;padding:2px;position:absolute;background:#f5f5f5;border:1px solid #979797;box-shadow:2px 2px 2px #999}.vakata-context ul{list-style:none;left:100%;margin-top:-2.7em;margin-left:-4px}.vakata-context .vakata-context-right ul{left:auto;right:100%;margin-left:auto;margin-right:-4px}.vakata-context li{list-style:none}.vakata-context li>a{display:block;padding:0 2em;text-decoration:none;width:auto;color:#000;white-space:nowrap;line-height:2.4em;text-shadow:1px 1px 0 #fff;border-radius:1px}.vakata-context li>a:hover{position:relative;background-color:#e8eff7;box-shadow:0 0 2px #0a6aa1}.vakata-context li>a.vakata-context-parent{background-image:url(data:image/gif;base64,R0lGODlhCwAHAIAAACgoKP///yH5BAEAAAEALAAAAAALAAcAAAIORI4JlrqN1oMSnmmZDQUAOw==);background-position:right center;background-repeat:no-repeat}.vakata-context li>a:focus{outline:0}.vakata-context .vakata-context-hover>a{position:relative;background-color:#e8eff7;box-shadow:0 0 2px #0a6aa1}.vakata-context .vakata-context-separator>a,.vakata-context .vakata-context-separator>a:hover{background:#fff;border:0;border-top:1px solid #e2e3e3;height:1px;min-height:1px;max-height:1px;padding:0;margin:0 0 0 2.4em;border-left:1px solid #e0e0e0;text-shadow:0 0 0 transparent;box-shadow:0 0 0 transparent;border-radius:0}.vakata-context .vakata-contextmenu-disabled a,.vakata-context .vakata-contextmenu-disabled a:hover{color:silver;background-color:transparent;border:0;box-shadow:0 0 0}.vakata-context li>a>i{text-decoration:none;display:inline-block;width:2.4em;height:2.4em;background:0 0;margin:0 0 0 -2em;vertical-align:top;text-align:center;line-height:2.4em}.vakata-context li>a>i:empty{width:2.4em;line-height:2.4em}.vakata-context li>a .vakata-contextmenu-sep{display:inline-block;width:1px;height:2.4em;background:#fff;margin:0 .5em 0 0;border-left:1px solid #e2e3e3}.vakata-context .vakata-contextmenu-shortcut{font-size:.8em;color:silver;opacity:.5;display:none}.vakata-context-rtl ul{left:auto;right:100%;margin-left:auto;margin-right:-4px}.vakata-context-rtl li>a.vakata-context-parent{background-image:url(data:image/gif;base64,R0lGODlhCwAHAIAAACgoKP///yH5BAEAAAEALAAAAAALAAcAAAINjI+AC7rWHIsPtmoxLAA7);background-position:left center;background-repeat:no-repeat}.vakata-context-rtl .vakata-context-separator>a{margin:0 2.4em 0 0;border-left:0;border-right:1px solid #e2e3e3}.vakata-context-rtl .vakata-context-left ul{right:auto;left:100%;margin-left:-4px;margin-right:auto}.vakata-context-rtl li>a>i{margin:0 -2em 0 0}.vakata-context-rtl li>a .vakata-contextmenu-sep{margin:0 0 0 .5em;border-left-color:#fff;background:#e2e3e3}#jstree-marker{position:absolute;top:0;left:0;margin:-5px 0 0 0;padding:0;border-right:0;border-top:5px solid transparent;border-bottom:5px solid transparent;border-left:5px solid;width:0;height:0;font-size:0;line-height:0}#jstree-dnd{line-height:16px;margin:0;padding:4px}#jstree-dnd .jstree-icon,#jstree-dnd .jstree-copy{display:inline-block;text-decoration:none;margin:0 2px 0 0;padding:0;width:16px;height:16px}#jstree-dnd .jstree-ok{background:green}#jstree-dnd .jstree-er{background:red}#jstree-dnd .jstree-copy{margin:0 2px}.jstree-default .jstree-node,.jstree-default .jstree-icon{background-repeat:no-repeat;background-color:transparent}.jstree-default .jstree-anchor,.jstree-default .jstree-wholerow{transition:background-color .15s,box-shadow .15s}.jstree-default .jstree-hovered{background:#e7f4f9;border-radius:2px;box-shadow:inset 0 0 1px #ccc}.jstree-default .jstree-context{background:#e7f4f9;border-radius:2px;box-shadow:inset 0 0 1px #ccc}.jstree-default .jstree-clicked{background:#beebff;border-radius:2px;box-shadow:inset 0 0 1px #999}.jstree-default .jstree-no-icons .jstree-anchor>.jstree-themeicon{display:none}.jstree-default .jstree-disabled{background:0 0;color:#666}.jstree-default .jstree-disabled.jstree-hovered{background:0 0;box-shadow:none}.jstree-default .jstree-disabled.jstree-clicked{background:#efefef}.jstree-default .jstree-disabled>.jstree-icon{opacity:.8;filter:url("data:image/svg+xml;utf8,#jstree-grayscale");filter:gray;-webkit-filter:grayscale(100%)}.jstree-default .jstree-search{font-style:italic;color:#8b0000;font-weight:700}.jstree-default .jstree-no-checkboxes .jstree-checkbox{display:none!important}.jstree-default.jstree-checkbox-no-clicked .jstree-clicked{background:0 0;box-shadow:none}.jstree-default.jstree-checkbox-no-clicked .jstree-clicked.jstree-hovered{background:#e7f4f9}.jstree-default.jstree-checkbox-no-clicked>.jstree-wholerow-ul .jstree-wholerow-clicked{background:0 0}.jstree-default.jstree-checkbox-no-clicked>.jstree-wholerow-ul .jstree-wholerow-clicked.jstree-wholerow-hovered{background:#e7f4f9}.jstree-default>.jstree-striped{min-width:100%;display:inline-block;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAkCAMAAAB/qqA+AAAABlBMVEUAAAAAAAClZ7nPAAAAAnRSTlMNAMM9s3UAAAAXSURBVHjajcEBAQAAAIKg/H/aCQZ70AUBjAATb6YPDgAAAABJRU5ErkJggg==) left top repeat}.jstree-default>.jstree-wholerow-ul .jstree-hovered,.jstree-default>.jstree-wholerow-ul .jstree-clicked{background:0 0;box-shadow:none;border-radius:0}.jstree-default .jstree-wholerow{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.jstree-default .jstree-wholerow-hovered{background:#e7f4f9}.jstree-default .jstree-wholerow-clicked{background:#beebff;background:-webkit-linear-gradient(top,#beebff 0,#a8e4ff 100%);background:linear-gradient(to bottom,#beebff 0,#a8e4ff 100%)}.jstree-default .jstree-node{min-height:24px;line-height:24px;margin-left:24px;min-width:24px}.jstree-default .jstree-anchor{line-height:24px;height:24px}.jstree-default .jstree-icon{width:24px;height:24px;line-height:24px}.jstree-default .jstree-icon:empty{width:24px;height:24px;line-height:24px}.jstree-default.jstree-rtl .jstree-node{margin-right:24px}.jstree-default .jstree-wholerow{height:24px}.jstree-default .jstree-node,.jstree-default .jstree-icon{background-image:url(32px.png)}.jstree-default .jstree-node{background-position:-292px -4px;background-repeat:repeat-y}.jstree-default .jstree-last{background:0 0}.jstree-default .jstree-open>.jstree-ocl{background-position:-132px -4px}.jstree-default .jstree-closed>.jstree-ocl{background-position:-100px -4px}.jstree-default .jstree-leaf>.jstree-ocl{background-position:-68px -4px}.jstree-default .jstree-themeicon{background-position:-260px -4px}.jstree-default>.jstree-no-dots .jstree-node,.jstree-default>.jstree-no-dots .jstree-leaf>.jstree-ocl{background:0 0}.jstree-default>.jstree-no-dots .jstree-open>.jstree-ocl{background-position:-36px -4px}.jstree-default>.jstree-no-dots .jstree-closed>.jstree-ocl{background-position:-4px -4px}.jstree-default .jstree-disabled{background:0 0}.jstree-default .jstree-disabled.jstree-hovered{background:0 0}.jstree-default .jstree-disabled.jstree-clicked{background:#efefef}.jstree-default .jstree-checkbox{background-position:-164px -4px}.jstree-default .jstree-checkbox:hover{background-position:-164px -36px}.jstree-default.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox,.jstree-default .jstree-checked>.jstree-checkbox{background-position:-228px -4px}.jstree-default.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox:hover,.jstree-default .jstree-checked>.jstree-checkbox:hover{background-position:-228px -36px}.jstree-default .jstree-anchor>.jstree-undetermined{background-position:-196px -4px}.jstree-default .jstree-anchor>.jstree-undetermined:hover{background-position:-196px -36px}.jstree-default .jstree-checkbox-disabled{opacity:.8;filter:url("data:image/svg+xml;utf8,#jstree-grayscale");filter:gray;-webkit-filter:grayscale(100%)}.jstree-default>.jstree-striped{background-size:auto 48px}.jstree-default.jstree-rtl .jstree-node{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg==);background-position:100% 1px;background-repeat:repeat-y}.jstree-default.jstree-rtl .jstree-last{background:0 0}.jstree-default.jstree-rtl .jstree-open>.jstree-ocl{background-position:-132px -36px}.jstree-default.jstree-rtl .jstree-closed>.jstree-ocl{background-position:-100px -36px}.jstree-default.jstree-rtl .jstree-leaf>.jstree-ocl{background-position:-68px -36px}.jstree-default.jstree-rtl>.jstree-no-dots .jstree-node,.jstree-default.jstree-rtl>.jstree-no-dots .jstree-leaf>.jstree-ocl{background:0 0}.jstree-default.jstree-rtl>.jstree-no-dots .jstree-open>.jstree-ocl{background-position:-36px -36px}.jstree-default.jstree-rtl>.jstree-no-dots .jstree-closed>.jstree-ocl{background-position:-4px -36px}.jstree-default .jstree-themeicon-custom{background-color:transparent;background-image:none;background-position:0 0}.jstree-default>.jstree-container-ul .jstree-loading>.jstree-ocl{background:url(throbber.gif) center center no-repeat}.jstree-default .jstree-file{background:url(32px.png) -100px -68px no-repeat}.jstree-default .jstree-folder{background:url(32px.png) -260px -4px no-repeat}.jstree-default>.jstree-container-ul>.jstree-node{margin-left:0;margin-right:0}#jstree-dnd.jstree-default{line-height:24px;padding:0 4px}#jstree-dnd.jstree-default .jstree-ok,#jstree-dnd.jstree-default .jstree-er{background-image:url(32px.png);background-repeat:no-repeat;background-color:transparent}#jstree-dnd.jstree-default i{background:0 0;width:24px;height:24px;line-height:24px}#jstree-dnd.jstree-default .jstree-ok{background-position:-4px -68px}#jstree-dnd.jstree-default .jstree-er{background-position:-36px -68px}.jstree-default.jstree-rtl .jstree-node{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg==)}.jstree-default.jstree-rtl .jstree-last{background:0 0}.jstree-default-small .jstree-node{min-height:18px;line-height:18px;margin-left:18px;min-width:18px}.jstree-default-small .jstree-anchor{line-height:18px;height:18px}.jstree-default-small .jstree-icon{width:18px;height:18px;line-height:18px}.jstree-default-small .jstree-icon:empty{width:18px;height:18px;line-height:18px}.jstree-default-small.jstree-rtl .jstree-node{margin-right:18px}.jstree-default-small .jstree-wholerow{height:18px}.jstree-default-small .jstree-node,.jstree-default-small .jstree-icon{background-image:url(32px.png)}.jstree-default-small .jstree-node{background-position:-295px -7px;background-repeat:repeat-y}.jstree-default-small .jstree-last{background:0 0}.jstree-default-small .jstree-open>.jstree-ocl{background-position:-135px -7px}.jstree-default-small .jstree-closed>.jstree-ocl{background-position:-103px -7px}.jstree-default-small .jstree-leaf>.jstree-ocl{background-position:-71px -7px}.jstree-default-small .jstree-themeicon{background-position:-263px -7px}.jstree-default-small>.jstree-no-dots .jstree-node,.jstree-default-small>.jstree-no-dots .jstree-leaf>.jstree-ocl{background:0 0}.jstree-default-small>.jstree-no-dots .jstree-open>.jstree-ocl{background-position:-39px -7px}.jstree-default-small>.jstree-no-dots .jstree-closed>.jstree-ocl{background-position:-7px -7px}.jstree-default-small .jstree-disabled{background:0 0}.jstree-default-small .jstree-disabled.jstree-hovered{background:0 0}.jstree-default-small .jstree-disabled.jstree-clicked{background:#efefef}.jstree-default-small .jstree-checkbox{background-position:-167px -7px}.jstree-default-small .jstree-checkbox:hover{background-position:-167px -39px}.jstree-default-small.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox,.jstree-default-small .jstree-checked>.jstree-checkbox{background-position:-231px -7px}.jstree-default-small.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox:hover,.jstree-default-small .jstree-checked>.jstree-checkbox:hover{background-position:-231px -39px}.jstree-default-small .jstree-anchor>.jstree-undetermined{background-position:-199px -7px}.jstree-default-small .jstree-anchor>.jstree-undetermined:hover{background-position:-199px -39px}.jstree-default-small .jstree-checkbox-disabled{opacity:.8;filter:url("data:image/svg+xml;utf8,#jstree-grayscale");filter:gray;-webkit-filter:grayscale(100%)}.jstree-default-small>.jstree-striped{background-size:auto 36px}.jstree-default-small.jstree-rtl .jstree-node{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg==);background-position:100% 1px;background-repeat:repeat-y}.jstree-default-small.jstree-rtl .jstree-last{background:0 0}.jstree-default-small.jstree-rtl .jstree-open>.jstree-ocl{background-position:-135px -39px}.jstree-default-small.jstree-rtl .jstree-closed>.jstree-ocl{background-position:-103px -39px}.jstree-default-small.jstree-rtl .jstree-leaf>.jstree-ocl{background-position:-71px -39px}.jstree-default-small.jstree-rtl>.jstree-no-dots .jstree-node,.jstree-default-small.jstree-rtl>.jstree-no-dots .jstree-leaf>.jstree-ocl{background:0 0}.jstree-default-small.jstree-rtl>.jstree-no-dots .jstree-open>.jstree-ocl{background-position:-39px -39px}.jstree-default-small.jstree-rtl>.jstree-no-dots .jstree-closed>.jstree-ocl{background-position:-7px -39px}.jstree-default-small .jstree-themeicon-custom{background-color:transparent;background-image:none;background-position:0 0}.jstree-default-small>.jstree-container-ul .jstree-loading>.jstree-ocl{background:url(throbber.gif) center center no-repeat}.jstree-default-small .jstree-file{background:url(32px.png) -103px -71px no-repeat}.jstree-default-small .jstree-folder{background:url(32px.png) -263px -7px no-repeat}.jstree-default-small>.jstree-container-ul>.jstree-node{margin-left:0;margin-right:0}#jstree-dnd.jstree-default-small{line-height:18px;padding:0 4px}#jstree-dnd.jstree-default-small .jstree-ok,#jstree-dnd.jstree-default-small .jstree-er{background-image:url(32px.png);background-repeat:no-repeat;background-color:transparent}#jstree-dnd.jstree-default-small i{background:0 0;width:18px;height:18px;line-height:18px}#jstree-dnd.jstree-default-small .jstree-ok{background-position:-7px -71px}#jstree-dnd.jstree-default-small .jstree-er{background-position:-39px -71px}.jstree-default-small.jstree-rtl .jstree-node{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAACAQMAAABv1h6PAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMHBgAAiABBI4gz9AAAAABJRU5ErkJggg==)}.jstree-default-small.jstree-rtl .jstree-last{background:0 0}.jstree-default-large .jstree-node{min-height:32px;line-height:32px;margin-left:32px;min-width:32px}.jstree-default-large .jstree-anchor{line-height:32px;height:32px}.jstree-default-large .jstree-icon{width:32px;height:32px;line-height:32px}.jstree-default-large .jstree-icon:empty{width:32px;height:32px;line-height:32px}.jstree-default-large.jstree-rtl .jstree-node{margin-right:32px}.jstree-default-large .jstree-wholerow{height:32px}.jstree-default-large .jstree-node,.jstree-default-large .jstree-icon{background-image:url(32px.png)}.jstree-default-large .jstree-node{background-position:-288px 0;background-repeat:repeat-y}.jstree-default-large .jstree-last{background:0 0}.jstree-default-large .jstree-open>.jstree-ocl{background-position:-128px 0}.jstree-default-large .jstree-closed>.jstree-ocl{background-position:-96px 0}.jstree-default-large .jstree-leaf>.jstree-ocl{background-position:-64px 0}.jstree-default-large .jstree-themeicon{background-position:-256px 0}.jstree-default-large>.jstree-no-dots .jstree-node,.jstree-default-large>.jstree-no-dots .jstree-leaf>.jstree-ocl{background:0 0}.jstree-default-large>.jstree-no-dots .jstree-open>.jstree-ocl{background-position:-32px 0}.jstree-default-large>.jstree-no-dots .jstree-closed>.jstree-ocl{background-position:0 0}.jstree-default-large .jstree-disabled{background:0 0}.jstree-default-large .jstree-disabled.jstree-hovered{background:0 0}.jstree-default-large .jstree-disabled.jstree-clicked{background:#efefef}.jstree-default-large .jstree-checkbox{background-position:-160px 0}.jstree-default-large .jstree-checkbox:hover{background-position:-160px -32px}.jstree-default-large.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox,.jstree-default-large .jstree-checked>.jstree-checkbox{background-position:-224px 0}.jstree-default-large.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox:hover,.jstree-default-large .jstree-checked>.jstree-checkbox:hover{background-position:-224px -32px}.jstree-default-large .jstree-anchor>.jstree-undetermined{background-position:-192px 0}.jstree-default-large .jstree-anchor>.jstree-undetermined:hover{background-position:-192px -32px}.jstree-default-large .jstree-checkbox-disabled{opacity:.8;filter:url("data:image/svg+xml;utf8,#jstree-grayscale");filter:gray;-webkit-filter:grayscale(100%)}.jstree-default-large>.jstree-striped{background-size:auto 64px}.jstree-default-large.jstree-rtl .jstree-node{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg==);background-position:100% 1px;background-repeat:repeat-y}.jstree-default-large.jstree-rtl .jstree-last{background:0 0}.jstree-default-large.jstree-rtl .jstree-open>.jstree-ocl{background-position:-128px -32px}.jstree-default-large.jstree-rtl .jstree-closed>.jstree-ocl{background-position:-96px -32px}.jstree-default-large.jstree-rtl .jstree-leaf>.jstree-ocl{background-position:-64px -32px}.jstree-default-large.jstree-rtl>.jstree-no-dots .jstree-node,.jstree-default-large.jstree-rtl>.jstree-no-dots .jstree-leaf>.jstree-ocl{background:0 0}.jstree-default-large.jstree-rtl>.jstree-no-dots .jstree-open>.jstree-ocl{background-position:-32px -32px}.jstree-default-large.jstree-rtl>.jstree-no-dots .jstree-closed>.jstree-ocl{background-position:0 -32px}.jstree-default-large .jstree-themeicon-custom{background-color:transparent;background-image:none;background-position:0 0}.jstree-default-large>.jstree-container-ul .jstree-loading>.jstree-ocl{background:url(throbber.gif) center center no-repeat}.jstree-default-large .jstree-file{background:url(32px.png) -96px -64px no-repeat}.jstree-default-large .jstree-folder{background:url(32px.png) -256px 0 no-repeat}.jstree-default-large>.jstree-container-ul>.jstree-node{margin-left:0;margin-right:0}#jstree-dnd.jstree-default-large{line-height:32px;padding:0 4px}#jstree-dnd.jstree-default-large .jstree-ok,#jstree-dnd.jstree-default-large .jstree-er{background-image:url(32px.png);background-repeat:no-repeat;background-color:transparent}#jstree-dnd.jstree-default-large i{background:0 0;width:32px;height:32px;line-height:32px}#jstree-dnd.jstree-default-large .jstree-ok{background-position:0 -64px}#jstree-dnd.jstree-default-large .jstree-er{background-position:-32px -64px}.jstree-default-large.jstree-rtl .jstree-node{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAACAQMAAAAD0EyKAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjgIIGBgABCgCBvVLXcAAAAABJRU5ErkJggg==)}.jstree-default-large.jstree-rtl .jstree-last{background:0 0}@media (max-width:768px){#jstree-dnd.jstree-dnd-responsive{line-height:40px;font-weight:700;font-size:1.1em;text-shadow:1px 1px #fff}#jstree-dnd.jstree-dnd-responsive>i{background:0 0;width:40px;height:40px}#jstree-dnd.jstree-dnd-responsive>.jstree-ok{background-image:url(40px.png);background-position:0 -200px;background-size:120px 240px}#jstree-dnd.jstree-dnd-responsive>.jstree-er{background-image:url(40px.png);background-position:-40px -200px;background-size:120px 240px}#jstree-marker.jstree-dnd-responsive{border-left-width:10px;border-top-width:10px;border-bottom-width:10px;margin-top:-10px}}@media (max-width:768px){.jstree-default-responsive .jstree-icon{background-image:url(40px.png)}.jstree-default-responsive .jstree-node,.jstree-default-responsive .jstree-leaf>.jstree-ocl{background:0 0}.jstree-default-responsive .jstree-node{min-height:40px;line-height:40px;margin-left:40px;min-width:40px;white-space:nowrap}.jstree-default-responsive .jstree-anchor{line-height:40px;height:40px}.jstree-default-responsive .jstree-icon,.jstree-default-responsive .jstree-icon:empty{width:40px;height:40px;line-height:40px}.jstree-default-responsive>.jstree-container-ul>.jstree-node{margin-left:0}.jstree-default-responsive.jstree-rtl .jstree-node{margin-left:0;margin-right:40px;background:0 0}.jstree-default-responsive.jstree-rtl .jstree-container-ul>.jstree-node{margin-right:0}.jstree-default-responsive .jstree-ocl,.jstree-default-responsive .jstree-themeicon,.jstree-default-responsive .jstree-checkbox{background-size:120px 240px}.jstree-default-responsive .jstree-leaf>.jstree-ocl,.jstree-default-responsive.jstree-rtl .jstree-leaf>.jstree-ocl{background:0 0}.jstree-default-responsive .jstree-open>.jstree-ocl{background-position:0 0!important}.jstree-default-responsive .jstree-closed>.jstree-ocl{background-position:0 -40px!important}.jstree-default-responsive.jstree-rtl .jstree-closed>.jstree-ocl{background-position:-40px 0!important}.jstree-default-responsive .jstree-themeicon{background-position:-40px -40px}.jstree-default-responsive .jstree-checkbox,.jstree-default-responsive .jstree-checkbox:hover{background-position:-40px -80px}.jstree-default-responsive.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox,.jstree-default-responsive.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox:hover,.jstree-default-responsive .jstree-checked>.jstree-checkbox,.jstree-default-responsive .jstree-checked>.jstree-checkbox:hover{background-position:0 -80px}.jstree-default-responsive .jstree-anchor>.jstree-undetermined,.jstree-default-responsive .jstree-anchor>.jstree-undetermined:hover{background-position:0 -120px}.jstree-default-responsive .jstree-anchor{font-weight:700;font-size:1.1em;text-shadow:1px 1px #fff}.jstree-default-responsive>.jstree-striped{background:0 0}.jstree-default-responsive .jstree-wholerow{border-top:1px solid rgba(255,255,255,.7);border-bottom:1px solid rgba(64,64,64,.2);background:#ebebeb;height:40px}.jstree-default-responsive .jstree-wholerow-hovered{background:#e7f4f9}.jstree-default-responsive .jstree-wholerow-clicked{background:#beebff}.jstree-default-responsive .jstree-children .jstree-last>.jstree-wholerow{box-shadow:inset 0 -6px 3px -5px #666}.jstree-default-responsive .jstree-children .jstree-open>.jstree-wholerow{box-shadow:inset 0 6px 3px -5px #666;border-top:0}.jstree-default-responsive .jstree-children .jstree-open+.jstree-open{box-shadow:none}.jstree-default-responsive .jstree-node,.jstree-default-responsive .jstree-icon,.jstree-default-responsive .jstree-node>.jstree-ocl,.jstree-default-responsive .jstree-themeicon,.jstree-default-responsive .jstree-checkbox{background-image:url(40px.png);background-size:120px 240px}.jstree-default-responsive .jstree-node{background-position:-80px 0;background-repeat:repeat-y}.jstree-default-responsive .jstree-last{background:0 0}.jstree-default-responsive .jstree-leaf>.jstree-ocl{background-position:-40px -120px}.jstree-default-responsive .jstree-last>.jstree-ocl{background-position:-40px -160px}.jstree-default-responsive .jstree-themeicon-custom{background-color:transparent;background-image:none;background-position:0 0}.jstree-default-responsive .jstree-file{background:url(40px.png) 0 -160px no-repeat;background-size:120px 240px}.jstree-default-responsive .jstree-folder{background:url(40px.png) -40px -40px no-repeat;background-size:120px 240px}.jstree-default-responsive>.jstree-container-ul>.jstree-node{margin-left:0;margin-right:0}} -------------------------------------------------------------------------------- /TraverseAllSystems/TraversalTree.cs: -------------------------------------------------------------------------------- 1 | #region Copyright 2 | // (C) Copyright 2003-2016 by Autodesk, Inc. 3 | // 4 | // Permission to use, copy, modify, and distribute this software in 5 | // object code form for any purpose and without fee is hereby granted, 6 | // provided that the above copyright notice appears in all copies and 7 | // that both that copyright notice and the limited warranty and 8 | // restricted rights notice below appear in all supporting 9 | // documentation. 10 | // 11 | // AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS. 12 | // AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF 13 | // MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC. 14 | // DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE 15 | // UNINTERRUPTED OR ERROR FREE. 16 | // 17 | // Use, duplication, or disclosure by the U.S. Government is subject to 18 | // restrictions set forth in FAR 52.227-19 (Commercial Computer 19 | // Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) 20 | // (Rights in Technical Data and Computer Software), as applicable. 21 | #endregion // Copyright 22 | 23 | #region Namespaces 24 | using System; 25 | using System.Collections.Generic; 26 | using System.Text; 27 | using System.Xml; 28 | using Autodesk.Revit.DB; 29 | using Autodesk.Revit.DB.Electrical; 30 | using Autodesk.Revit.DB.Mechanical; 31 | using Autodesk.Revit.DB.Plumbing; 32 | #endregion // Namespaces 33 | 34 | namespace TraverseAllSystems 35 | { 36 | /// 37 | /// TreeNode object representing a system element 38 | /// 39 | public class TreeNode 40 | { 41 | #region JSON Output Format Strings 42 | /// 43 | /// Format a tree node to JSON storing parent id 44 | /// in child node for bottom-up structure. 45 | /// 46 | const string _json_format_to_store_parent_in_child 47 | = "{{" 48 | + "\"id\" : {0}, " 49 | + "\"{1}\" : \"{2}\", " 50 | + "\"parent\" : {3}}}"; 51 | 52 | /// 53 | /// Format a tree node to JSON storing a 54 | /// hierarchical tree of children ids in parent 55 | /// for top-down structure. 56 | /// 57 | const string _json_format_to_store_children_in_parent 58 | = "{{" 59 | + "\"id\" : \"{0}\", " 60 | + "\"{1}\" : \"{2}\", " 61 | + "\"children\" : [{3}]}}"; 62 | 63 | /// 64 | /// Create a new JSON parent node for the top-down graph. 65 | /// 66 | public static string CreateJsonParentNode( 67 | string id, 68 | string label, 69 | string json_kids ) 70 | { 71 | return string.Format( 72 | _json_format_to_store_children_in_parent, 73 | id, Options.NodeLabelTag, label, json_kids ); 74 | } 75 | 76 | /// 77 | /// Create a new JSON parent node for the top-down graph. 78 | /// 79 | public static string CreateJsonParentNode( 80 | string id, 81 | string label, 82 | string[] json_kids ) 83 | { 84 | return CreateJsonParentNode( id, label, 85 | string.Join( ",", json_kids ) ); 86 | } 87 | #endregion // JSON Output Format Strings 88 | 89 | #region Member variables 90 | /// 91 | /// Id of the element 92 | /// 93 | private Autodesk.Revit.DB.ElementId m_Id; 94 | 95 | /// 96 | /// Flow direction of the node 97 | /// For the starting element of the traversal, the direction will be the same as the connector 98 | /// connected to its following element; Otherwise it will be the direction of the connector connected to 99 | /// its previous element 100 | /// 101 | private FlowDirectionType m_direction; 102 | 103 | /// 104 | /// The parent node of the current node. 105 | /// 106 | private TreeNode m_parent; 107 | 108 | /// 109 | /// The connector of the previous element to which current element is connected 110 | /// 111 | private Connector m_inputConnector; 112 | 113 | /// 114 | /// The first-level child nodes of the current node 115 | /// 116 | private List m_childNodes; 117 | 118 | /// 119 | /// Active document of Revit 120 | /// 121 | private Document m_document; 122 | #endregion 123 | 124 | #region Properties 125 | /// 126 | /// Id of the element 127 | /// 128 | public ElementId Id 129 | { 130 | get 131 | { 132 | return m_Id; 133 | } 134 | } 135 | 136 | /// 137 | /// Flow direction of the node 138 | /// 139 | public FlowDirectionType Direction 140 | { 141 | get 142 | { 143 | return m_direction; 144 | } 145 | set 146 | { 147 | m_direction = value; 148 | } 149 | } 150 | 151 | /// 152 | /// Gets and sets the parent node of the current node. 153 | /// 154 | public TreeNode Parent 155 | { 156 | get 157 | { 158 | return m_parent; 159 | } 160 | set 161 | { 162 | m_parent = value; 163 | } 164 | } 165 | 166 | /// 167 | /// Gets and sets the first-level child nodes of the current node 168 | /// 169 | public List ChildNodes 170 | { 171 | get 172 | { 173 | return m_childNodes; 174 | } 175 | set 176 | { 177 | m_childNodes = value; 178 | } 179 | } 180 | 181 | /// 182 | /// The connector of the previous element to which current element is connected 183 | /// 184 | public Connector InputConnector 185 | { 186 | get 187 | { 188 | return m_inputConnector; 189 | } 190 | set 191 | { 192 | m_inputConnector = value; 193 | } 194 | } 195 | #endregion 196 | 197 | #region Constructor 198 | /// 199 | /// Constructor 200 | /// 201 | /// Revit document 202 | /// Element's Id 203 | public TreeNode( Document doc, ElementId id ) 204 | { 205 | m_document = doc; 206 | m_Id = id; 207 | m_childNodes = new List(); 208 | } 209 | #endregion // Constructor 210 | 211 | #region GetElementById 212 | /// 213 | /// Get Element by its Id 214 | /// 215 | /// Element's Id 216 | /// Element 217 | private Element GetElementById( ElementId eid ) 218 | { 219 | return m_document.GetElement( eid ); 220 | } 221 | #endregion // GetElementById 222 | 223 | #region JSON Output 224 | public static string GetName( Element e ) 225 | { 226 | return Util.ElementDescription( e ) 227 | .Replace( "\"", "\\\"" ); 228 | } 229 | 230 | public static string GetId( Element e ) 231 | { 232 | return Options.StoreUniqueId 233 | ? e.UniqueId 234 | : e.Id.IntegerValue.ToString(); 235 | } 236 | 237 | /// 238 | /// Add JSON strings representing all children 239 | /// of this node to the given collection. 240 | /// 241 | public void DumpToJsonBottomUp( 242 | List json_collector, 243 | string parent_id ) 244 | { 245 | Element e = GetElementById( m_Id ); 246 | string id = GetId( e ); 247 | 248 | string json = string.Format( 249 | _json_format_to_store_parent_in_child, id, 250 | Options.NodeLabelTag, GetName( e ), 251 | parent_id ); 252 | 253 | json_collector.Add( json ); 254 | 255 | foreach( TreeNode node in m_childNodes ) 256 | { 257 | node.DumpToJsonBottomUp( json_collector, id ); 258 | } 259 | } 260 | 261 | /// 262 | /// Return a JSON string representing this node and 263 | /// including the recursive hierarchical graph of 264 | /// all its all children. 265 | /// 266 | public string DumpToJsonTopDown() 267 | { 268 | Element e = GetElementById( m_Id ); 269 | 270 | List json_collector = new List(); 271 | 272 | foreach( TreeNode child in m_childNodes ) 273 | { 274 | json_collector.Add( child.DumpToJsonTopDown() ); 275 | } 276 | 277 | string json = CreateJsonParentNode( GetId( e ), 278 | GetName( e ), json_collector.ToArray() ); 279 | 280 | // Todo: properties print 281 | 282 | return json; 283 | } 284 | #endregion // JSON Output 285 | 286 | #region XML Output 287 | /// 288 | /// Dump the node into XML file. 289 | /// 290 | public void DumpIntoXML( XmlWriter writer ) 291 | { 292 | // Write node information 293 | Element element = GetElementById( m_Id ); 294 | FamilyInstance fi = element as FamilyInstance; 295 | if( fi != null ) 296 | { 297 | MEPModel mepModel = fi.MEPModel; 298 | String type = String.Empty; 299 | if( mepModel is MechanicalEquipment ) 300 | { 301 | type = "MechanicalEquipment"; 302 | writer.WriteStartElement( type ); 303 | } 304 | else if( mepModel is MechanicalFitting ) 305 | { 306 | MechanicalFitting mf = mepModel as MechanicalFitting; 307 | type = "MechanicalFitting"; 308 | writer.WriteStartElement( type ); 309 | writer.WriteAttributeString( "Category", element.Category.Name ); 310 | writer.WriteAttributeString( "PartType", mf.PartType.ToString() ); 311 | } 312 | else 313 | { 314 | type = "FamilyInstance"; 315 | writer.WriteStartElement( type ); 316 | writer.WriteAttributeString( "Category", element.Category.Name ); 317 | } 318 | 319 | writer.WriteAttributeString( "Name", element.Name ); 320 | writer.WriteAttributeString( "Id", element.Id.IntegerValue.ToString() ); 321 | writer.WriteAttributeString( "Direction", m_direction.ToString() ); 322 | writer.WriteEndElement(); 323 | } 324 | else 325 | { 326 | String type = element.GetType().Name; 327 | 328 | writer.WriteStartElement( type ); 329 | writer.WriteAttributeString( "Name", element.Name ); 330 | writer.WriteAttributeString( "Id", element.Id.IntegerValue.ToString() ); 331 | writer.WriteAttributeString( "Direction", m_direction.ToString() ); 332 | writer.WriteEndElement(); 333 | } 334 | 335 | foreach( TreeNode node in m_childNodes ) 336 | { 337 | if( m_childNodes.Count > 1 ) 338 | { 339 | writer.WriteStartElement( "Path" ); 340 | } 341 | 342 | node.DumpIntoXML( writer ); 343 | 344 | if( m_childNodes.Count > 1 ) 345 | { 346 | writer.WriteEndElement(); 347 | } 348 | } 349 | } 350 | #endregion // XML Output 351 | 352 | public void CollectUniqueIds( StringBuilder sb ) 353 | { 354 | Element element = GetElementById( this.m_Id ); 355 | 356 | 357 | sb.Append( "\"" + GetId( element ) + "\"," ); 358 | foreach( TreeNode node in this.m_childNodes ) 359 | { 360 | node.CollectUniqueIds( sb ); 361 | } 362 | } 363 | } 364 | 365 | /// 366 | /// Data structure of the system traversal 367 | /// 368 | public class TraversalTree 369 | { 370 | public static byte MECHANICAL_MASK = 1; 371 | public static byte ELECTRICAL_MASK = 2; 372 | public static byte PIPING_MAKS = 4; 373 | 374 | #region Member variables 375 | /// 376 | /// Active Revit document 377 | /// 378 | private Document m_document; 379 | 380 | /// 381 | /// The MEP system of the traversal 382 | /// 383 | private MEPSystem m_system; 384 | 385 | /// 386 | /// Flag whether the MEP system is mechanical or piping 387 | /// 388 | private Boolean m_isMechanicalSystem; 389 | 390 | /// 391 | /// The starting element node 392 | /// 393 | private TreeNode m_startingElementNode; 394 | 395 | /// 396 | /// Map element id integer to the number 397 | /// of times the element has been visited. 398 | /// 399 | Dictionary _visitedElementCount; 400 | #endregion 401 | 402 | #region Constructor 403 | /// 404 | /// Constructor 405 | /// 406 | /// Revit document 407 | /// The MEP system to traverse 408 | public TraversalTree( MEPSystem system ) 409 | { 410 | m_document = system.Document; 411 | m_system = system; 412 | m_isMechanicalSystem = ( system is MechanicalSystem ); 413 | _visitedElementCount = new Dictionary(); 414 | } 415 | #endregion // Constructor 416 | 417 | #region Tree Construction 418 | /// 419 | /// Traverse the system 420 | /// 421 | public bool Traverse() 422 | { 423 | // Get the starting element node 424 | m_startingElementNode = GetStartingElementNode(); 425 | 426 | if( null != m_startingElementNode ) 427 | { 428 | // Traverse the system recursively 429 | Traverse( m_startingElementNode ); 430 | } 431 | return null != m_startingElementNode; 432 | } 433 | 434 | /// 435 | /// Get the starting element node. 436 | /// If the system has base equipment then get it; 437 | /// Otherwise get the owner of the open connector in the system 438 | /// 439 | /// The starting element node 440 | private TreeNode GetStartingElementNode() 441 | { 442 | TreeNode startingElementNode = null; 443 | 444 | FamilyInstance equipment = m_system.BaseEquipment; 445 | 446 | // If m_system.BaseEquipment returns null, then loop through each element in m_system and get the Mechanical Equipment 447 | if (equipment == null) 448 | { 449 | foreach (FamilyInstance element in m_system.Elements) 450 | { 451 | if (element.MEPModel is MechanicalEquipment) 452 | { 453 | equipment = element; 454 | break; 455 | } 456 | } 457 | } 458 | // 459 | // If the system has base equipment then get it; 460 | // Otherwise get the owner of the open connector in the system 461 | if( equipment != null ) 462 | { 463 | startingElementNode = new TreeNode( m_document, equipment.Id ); 464 | } 465 | else 466 | { 467 | Element root = GetOwnerOfOpenConnector(); 468 | if( null != root ) 469 | { 470 | startingElementNode = new TreeNode( m_document, root.Id ); 471 | } 472 | } 473 | 474 | if( null != startingElementNode ) 475 | { 476 | startingElementNode.Parent = null; 477 | startingElementNode.InputConnector = null; 478 | } 479 | 480 | return startingElementNode; 481 | } 482 | 483 | /// 484 | /// Get the owner of the open connector as the starting element 485 | /// 486 | /// The owner 487 | private Element GetOwnerOfOpenConnector() 488 | { 489 | Element element = null; 490 | 491 | // 492 | // Get an element from the system's terminals 493 | ElementSet elements = m_system.Elements; 494 | foreach( Element ele in elements ) 495 | { 496 | element = ele; 497 | break; 498 | } 499 | 500 | // Get the open connector recursively 501 | Connector openConnector = GetOpenConnector( element, null ); 502 | 503 | return null != openConnector 504 | ? openConnector.Owner 505 | : null; 506 | } 507 | 508 | /// 509 | /// Get the open connector of the system if the system has no base equipment 510 | /// 511 | /// An element in the system 512 | /// The connector of the previous element 513 | /// to which the element is connected 514 | /// The found open connector 515 | private Connector GetOpenConnector( Element element, Connector inputConnector ) 516 | { 517 | Connector openConnector = null; 518 | ConnectorManager cm = null; 519 | // 520 | // Get the connector manager of the element 521 | if( element is FamilyInstance ) 522 | { 523 | FamilyInstance fi = element as FamilyInstance; 524 | cm = fi.MEPModel.ConnectorManager; 525 | } 526 | else 527 | { 528 | MEPCurve mepCurve = element as MEPCurve; 529 | cm = mepCurve.ConnectorManager; 530 | } 531 | 532 | foreach( Connector conn in cm.Connectors ) 533 | { 534 | // Ignore the connector does not belong to any MEP System or belongs to another different MEP system 535 | if( conn.MEPSystem == null || !conn.MEPSystem.Id.IntegerValue.Equals( m_system.Id.IntegerValue ) ) 536 | { 537 | continue; 538 | } 539 | 540 | // If the connector is connected to the input connector, they will have opposite flow directions. 541 | if( inputConnector != null && conn.IsConnectedTo( inputConnector ) ) 542 | { 543 | continue; 544 | } 545 | 546 | // If the connector is not connected, it is the open connector 547 | if( !conn.IsConnected ) 548 | { 549 | openConnector = conn; 550 | break; 551 | } 552 | 553 | // 554 | // If open connector not found, then look for it from elements connected to the element 555 | foreach( Connector refConnector in conn.AllRefs ) 556 | { 557 | // Ignore non-EndConn connectors and connectors of the current element 558 | if( refConnector.ConnectorType != ConnectorType.End || 559 | refConnector.Owner.Id.IntegerValue.Equals( conn.Owner.Id.IntegerValue ) ) 560 | { 561 | continue; 562 | } 563 | 564 | // Ignore connectors of the previous element 565 | if( inputConnector != null && refConnector.Owner.Id.IntegerValue.Equals( inputConnector.Owner.Id.IntegerValue ) ) 566 | { 567 | continue; 568 | } 569 | 570 | openConnector = GetOpenConnector( refConnector.Owner, conn ); 571 | if( openConnector != null ) 572 | { 573 | return openConnector; 574 | } 575 | } 576 | } 577 | 578 | return openConnector; 579 | } 580 | 581 | /// 582 | /// Traverse the system recursively by analyzing each element 583 | /// 584 | /// The element to be analyzed 585 | private void Traverse( TreeNode elementNode ) 586 | { 587 | int id = elementNode.Id.IntegerValue; 588 | 589 | // Terminate if we revisit a node we have already inspected: 590 | 591 | if( _visitedElementCount.ContainsKey( id ) ) 592 | { 593 | return; 594 | } 595 | 596 | // Otherwise, add the new node to the collection of visited elements: 597 | 598 | if( !_visitedElementCount.ContainsKey( id ) ) 599 | { 600 | _visitedElementCount.Add( id, 0 ); 601 | } 602 | ++_visitedElementCount[id]; 603 | 604 | // 605 | // Find all child nodes and analyze them recursively 606 | AppendChildren( elementNode ); 607 | foreach( TreeNode node in elementNode.ChildNodes ) 608 | { 609 | Traverse( node ); 610 | } 611 | } 612 | 613 | /// 614 | /// Find all child nodes of the specified element node 615 | /// 616 | /// The specified element node to be analyzed 617 | private void AppendChildren( TreeNode elementNode ) 618 | { 619 | List nodes = elementNode.ChildNodes; 620 | ConnectorSet connectors; 621 | 622 | // Get connector manager 623 | 624 | Element element = GetElementById( elementNode.Id ); 625 | 626 | //Debug.Print( element.Id.IntegerValue.ToString() ); 627 | 628 | FamilyInstance fi = element as FamilyInstance; 629 | if( fi != null ) 630 | { 631 | connectors = fi.MEPModel.ConnectorManager.Connectors; 632 | } 633 | else 634 | { 635 | MEPCurve mepCurve = element as MEPCurve; 636 | connectors = mepCurve.ConnectorManager.Connectors; 637 | } 638 | 639 | // Find connected connector for each connector 640 | foreach( Connector connector in connectors ) 641 | { 642 | MEPSystem mepSystem = connector.MEPSystem; 643 | // Ignore the connector does not belong to any MEP System or belongs to another different MEP system 644 | if( mepSystem == null || !mepSystem.Id.IntegerValue.Equals( m_system.Id.IntegerValue ) ) 645 | { 646 | continue; 647 | } 648 | 649 | // 650 | // Get the direction of the TreeNode object 651 | if( elementNode.Parent == null ) 652 | { 653 | if( connector.IsConnected ) 654 | { 655 | elementNode.Direction = connector.Direction; 656 | } 657 | } 658 | else 659 | { 660 | // If the connector is connected to the input connector, they will have opposite flow directions. 661 | // Then skip it. 662 | if( connector.IsConnectedTo( elementNode.InputConnector ) ) 663 | { 664 | elementNode.Direction = connector.Direction; 665 | continue; 666 | } 667 | } 668 | 669 | // Get the connector connected to current connector 670 | Connector connectedConnector = GetConnectedConnector( connector ); 671 | if( connectedConnector != null ) 672 | { 673 | TreeNode node = new TreeNode( m_document, connectedConnector.Owner.Id ); 674 | node.InputConnector = connector; 675 | node.Parent = elementNode; 676 | nodes.Add( node ); 677 | } 678 | } 679 | 680 | nodes.Sort( delegate ( TreeNode t1, TreeNode t2 ) 681 | { 682 | return t1.Id.IntegerValue > t2.Id.IntegerValue ? 1 : ( t1.Id.IntegerValue < t2.Id.IntegerValue ? -1 : 0 ); 683 | } 684 | ); 685 | } 686 | 687 | /// 688 | /// Get the connected connector of one connector 689 | /// 690 | /// The connector to be analyzed 691 | /// The connected connector 692 | static private Connector GetConnectedConnector( Connector connector ) 693 | { 694 | Connector connectedConnector = null; 695 | ConnectorSet allRefs = connector.AllRefs; 696 | foreach( Connector conn in allRefs ) 697 | { 698 | // Ignore non-EndConn or Curve connectors and connectors of the current element 699 | // Reason for Curve connectors: https://github.com/jeremytammik/TraverseAllSystems/issues/5 700 | if( (conn.ConnectorType != ConnectorType.End && 701 | conn.ConnectorType != ConnectorType.Curve ) || 702 | conn.Owner.Id.IntegerValue.Equals( connector.Owner.Id.IntegerValue ) ) 703 | { 704 | continue; 705 | } 706 | 707 | connectedConnector = conn; 708 | break; 709 | } 710 | 711 | return connectedConnector; 712 | } 713 | 714 | /// 715 | /// Get element by its id 716 | /// 717 | private Element GetElementById( ElementId eid ) 718 | { 719 | return m_document.GetElement( eid ); 720 | } 721 | #endregion // Tree Construction 722 | 723 | #region JSON Output 724 | /// 725 | /// Dump the top-down traversal graph into JSON. 726 | /// In this case, each parent node is populated 727 | /// with a full hierarchical graph of all its 728 | /// children, cf. https://www.jstree.com/docs/json. 729 | /// 730 | public string DumpToJsonTopDown() 731 | { 732 | return m_startingElementNode 733 | .DumpToJsonTopDown(); 734 | } 735 | 736 | /// 737 | /// Dump the bottom-up traversal graph into JSON. 738 | /// In this case, each child node is equipped with 739 | /// a 'parent' pointer, cf. 740 | /// https://www.jstree.com/docs/json/ 741 | /// 742 | public string DumpToJsonBottomUp() 743 | { 744 | List a = new List(); 745 | m_startingElementNode.DumpToJsonBottomUp( a, "#" ); 746 | return "[" + string.Join( ",", a ) + "]"; 747 | } 748 | #endregion // JSON Output 749 | 750 | #region XML Output 751 | /// 752 | /// Dump the traversal into an XML file 753 | /// 754 | /// Name of the XML file 755 | public void DumpIntoXML( String fileName ) 756 | { 757 | XmlWriterSettings settings = new XmlWriterSettings(); 758 | settings.Indent = true; 759 | settings.IndentChars = " "; 760 | XmlWriter writer = XmlWriter.Create( fileName, settings ); 761 | 762 | // Write the root element 763 | String mepSystemType = String.Empty; 764 | mepSystemType = ( m_system is MechanicalSystem ? "MechanicalSystem" : "PipingSystem" ); 765 | writer.WriteStartElement( mepSystemType ); 766 | 767 | // Write basic information of the MEP system 768 | WriteBasicInfo( writer ); 769 | // Write paths of the traversal 770 | WritePaths( writer ); 771 | 772 | // Close the root element 773 | writer.WriteEndElement(); 774 | 775 | writer.Flush(); 776 | writer.Close(); 777 | } 778 | 779 | /// 780 | /// Write basic information of the MEP system into the XML file 781 | /// 782 | /// XMLWriter object 783 | private void WriteBasicInfo( XmlWriter writer ) 784 | { 785 | MechanicalSystem ms = null; 786 | PipingSystem ps = null; 787 | if( m_isMechanicalSystem ) 788 | { 789 | ms = m_system as MechanicalSystem; 790 | } 791 | else 792 | { 793 | ps = m_system as PipingSystem; 794 | } 795 | 796 | // Write basic information of the system 797 | writer.WriteStartElement( "BasicInformation" ); 798 | 799 | // Write Name property 800 | writer.WriteStartElement( "Name" ); 801 | writer.WriteString( m_system.Name ); 802 | writer.WriteEndElement(); 803 | 804 | // Write Id property 805 | writer.WriteStartElement( "Id" ); 806 | writer.WriteValue( m_system.Id.IntegerValue ); 807 | writer.WriteEndElement(); 808 | 809 | // Write UniqueId property 810 | writer.WriteStartElement( "UniqueId" ); 811 | writer.WriteString( m_system.UniqueId ); 812 | writer.WriteEndElement(); 813 | 814 | // Write SystemType property 815 | writer.WriteStartElement( "SystemType" ); 816 | if( m_isMechanicalSystem ) 817 | { 818 | writer.WriteString( ms.SystemType.ToString() ); 819 | } 820 | else 821 | { 822 | writer.WriteString( ps.SystemType.ToString() ); 823 | } 824 | writer.WriteEndElement(); 825 | 826 | // Write Category property 827 | writer.WriteStartElement( "Category" ); 828 | writer.WriteAttributeString( "Id", m_system.Category.Id.IntegerValue.ToString() ); 829 | writer.WriteAttributeString( "Name", m_system.Category.Name ); 830 | writer.WriteEndElement(); 831 | 832 | // Write IsWellConnected property 833 | writer.WriteStartElement( "IsWellConnected" ); 834 | if( m_isMechanicalSystem ) 835 | { 836 | writer.WriteValue( ms.IsWellConnected ); 837 | } 838 | else 839 | { 840 | writer.WriteValue( ps.IsWellConnected ); 841 | } 842 | writer.WriteEndElement(); 843 | 844 | // Write HasBaseEquipment property 845 | writer.WriteStartElement( "HasBaseEquipment" ); 846 | bool hasBaseEquipment = ( ( m_system.BaseEquipment == null ) ? false : true ); 847 | writer.WriteValue( hasBaseEquipment ); 848 | writer.WriteEndElement(); 849 | 850 | // Write TerminalElementsCount property 851 | writer.WriteStartElement( "TerminalElementsCount" ); 852 | writer.WriteValue( m_system.Elements.Size ); 853 | writer.WriteEndElement(); 854 | 855 | // Write Flow property 856 | //writer.WriteStartElement( "Flow" ); 857 | //if( m_isMechanicalSystem ) 858 | //{ 859 | // writer.WriteValue( ms.GetFlow() ); 860 | //} 861 | //else 862 | //{ 863 | // writer.WriteValue( ps.GetFlow() ); 864 | //} 865 | //writer.WriteEndElement(); 866 | 867 | // Close basic information 868 | writer.WriteEndElement(); 869 | } 870 | 871 | /// 872 | /// Write paths of the traversal into the XML file 873 | /// 874 | /// XMLWriter object 875 | private void WritePaths( XmlWriter writer ) 876 | { 877 | writer.WriteStartElement( "Path" ); 878 | m_startingElementNode.DumpIntoXML( writer ); 879 | writer.WriteEndElement(); 880 | } 881 | 882 | public void CollectUniqueIds( StringBuilder[] sbs ) 883 | { 884 | StringBuilder conn_sb = new StringBuilder(); 885 | 886 | if( this.m_startingElementNode != null ) 887 | { 888 | conn_sb.Append( "{ \"id\":\"" + TreeNode.GetId( m_system ) 889 | + "\",\"name\":\"" + TreeNode.GetName( m_system ) 890 | + "\", \"children\":[], \"udids\":[" ); 891 | 892 | this.m_startingElementNode.CollectUniqueIds( conn_sb ); 893 | 894 | if( conn_sb[conn_sb.Length - 1] == ',' ) 895 | { 896 | conn_sb.Remove( conn_sb.Length - 1, 1 ); 897 | } 898 | conn_sb.Append( "]}," ); 899 | 900 | string str = conn_sb.ToString(); 901 | 902 | if( this.m_system is MechanicalSystem ) 903 | { 904 | sbs[0].Append( str ); 905 | } 906 | if( this.m_system is ElectricalSystem ) 907 | { 908 | 909 | sbs[1].Append( str ); 910 | } 911 | if( this.m_system is PipingSystem ) 912 | { 913 | sbs[2].Append( str ); 914 | } 915 | } 916 | } 917 | #endregion // XML Output 918 | } 919 | } 920 | -------------------------------------------------------------------------------- /test/dist/themes/default/style.css: -------------------------------------------------------------------------------- 1 | /* jsTree default theme */ 2 | .jstree-node, 3 | .jstree-children, 4 | .jstree-container-ul { 5 | display: block; 6 | margin: 0; 7 | padding: 0; 8 | list-style-type: none; 9 | list-style-image: none; 10 | } 11 | .jstree-node { 12 | white-space: nowrap; 13 | } 14 | .jstree-anchor { 15 | display: inline-block; 16 | color: black; 17 | white-space: nowrap; 18 | padding: 0 4px 0 1px; 19 | margin: 0; 20 | vertical-align: top; 21 | } 22 | .jstree-anchor:focus { 23 | outline: 0; 24 | } 25 | .jstree-anchor, 26 | .jstree-anchor:link, 27 | .jstree-anchor:visited, 28 | .jstree-anchor:hover, 29 | .jstree-anchor:active { 30 | text-decoration: none; 31 | color: inherit; 32 | } 33 | .jstree-icon { 34 | display: inline-block; 35 | text-decoration: none; 36 | margin: 0; 37 | padding: 0; 38 | vertical-align: top; 39 | text-align: center; 40 | } 41 | .jstree-icon:empty { 42 | display: inline-block; 43 | text-decoration: none; 44 | margin: 0; 45 | padding: 0; 46 | vertical-align: top; 47 | text-align: center; 48 | } 49 | .jstree-ocl { 50 | cursor: pointer; 51 | } 52 | .jstree-leaf > .jstree-ocl { 53 | cursor: default; 54 | } 55 | .jstree .jstree-open > .jstree-children { 56 | display: block; 57 | } 58 | .jstree .jstree-closed > .jstree-children, 59 | .jstree .jstree-leaf > .jstree-children { 60 | display: none; 61 | } 62 | .jstree-anchor > .jstree-themeicon { 63 | margin-right: 2px; 64 | } 65 | .jstree-no-icons .jstree-themeicon, 66 | .jstree-anchor > .jstree-themeicon-hidden { 67 | display: none; 68 | } 69 | .jstree-hidden, 70 | .jstree-node.jstree-hidden { 71 | display: none; 72 | } 73 | .jstree-rtl .jstree-anchor { 74 | padding: 0 1px 0 4px; 75 | } 76 | .jstree-rtl .jstree-anchor > .jstree-themeicon { 77 | margin-left: 2px; 78 | margin-right: 0; 79 | } 80 | .jstree-rtl .jstree-node { 81 | margin-left: 0; 82 | } 83 | .jstree-rtl .jstree-container-ul > .jstree-node { 84 | margin-right: 0; 85 | } 86 | .jstree-wholerow-ul { 87 | position: relative; 88 | display: inline-block; 89 | min-width: 100%; 90 | } 91 | .jstree-wholerow-ul .jstree-leaf > .jstree-ocl { 92 | cursor: pointer; 93 | } 94 | .jstree-wholerow-ul .jstree-anchor, 95 | .jstree-wholerow-ul .jstree-icon { 96 | position: relative; 97 | } 98 | .jstree-wholerow-ul .jstree-wholerow { 99 | width: 100%; 100 | cursor: pointer; 101 | position: absolute; 102 | left: 0; 103 | -webkit-user-select: none; 104 | -moz-user-select: none; 105 | -ms-user-select: none; 106 | user-select: none; 107 | } 108 | .vakata-context { 109 | display: none; 110 | } 111 | .vakata-context, 112 | .vakata-context ul { 113 | margin: 0; 114 | padding: 2px; 115 | position: absolute; 116 | background: #f5f5f5; 117 | border: 1px solid #979797; 118 | box-shadow: 2px 2px 2px #999999; 119 | } 120 | .vakata-context ul { 121 | list-style: none; 122 | left: 100%; 123 | margin-top: -2.7em; 124 | margin-left: -4px; 125 | } 126 | .vakata-context .vakata-context-right ul { 127 | left: auto; 128 | right: 100%; 129 | margin-left: auto; 130 | margin-right: -4px; 131 | } 132 | .vakata-context li { 133 | list-style: none; 134 | } 135 | .vakata-context li > a { 136 | display: block; 137 | padding: 0 2em 0 2em; 138 | text-decoration: none; 139 | width: auto; 140 | color: black; 141 | white-space: nowrap; 142 | line-height: 2.4em; 143 | text-shadow: 1px 1px 0 white; 144 | border-radius: 1px; 145 | } 146 | .vakata-context li > a:hover { 147 | position: relative; 148 | background-color: #e8eff7; 149 | box-shadow: 0 0 2px #0a6aa1; 150 | } 151 | .vakata-context li > a.vakata-context-parent { 152 | background-image: url("data:image/gif;base64,R0lGODlhCwAHAIAAACgoKP///yH5BAEAAAEALAAAAAALAAcAAAIORI4JlrqN1oMSnmmZDQUAOw=="); 153 | background-position: right center; 154 | background-repeat: no-repeat; 155 | } 156 | .vakata-context li > a:focus { 157 | outline: 0; 158 | } 159 | .vakata-context .vakata-context-hover > a { 160 | position: relative; 161 | background-color: #e8eff7; 162 | box-shadow: 0 0 2px #0a6aa1; 163 | } 164 | .vakata-context .vakata-context-separator > a, 165 | .vakata-context .vakata-context-separator > a:hover { 166 | background: white; 167 | border: 0; 168 | border-top: 1px solid #e2e3e3; 169 | height: 1px; 170 | min-height: 1px; 171 | max-height: 1px; 172 | padding: 0; 173 | margin: 0 0 0 2.4em; 174 | border-left: 1px solid #e0e0e0; 175 | text-shadow: 0 0 0 transparent; 176 | box-shadow: 0 0 0 transparent; 177 | border-radius: 0; 178 | } 179 | .vakata-context .vakata-contextmenu-disabled a, 180 | .vakata-context .vakata-contextmenu-disabled a:hover { 181 | color: silver; 182 | background-color: transparent; 183 | border: 0; 184 | box-shadow: 0 0 0; 185 | } 186 | .vakata-context li > a > i { 187 | text-decoration: none; 188 | display: inline-block; 189 | width: 2.4em; 190 | height: 2.4em; 191 | background: transparent; 192 | margin: 0 0 0 -2em; 193 | vertical-align: top; 194 | text-align: center; 195 | line-height: 2.4em; 196 | } 197 | .vakata-context li > a > i:empty { 198 | width: 2.4em; 199 | line-height: 2.4em; 200 | } 201 | .vakata-context li > a .vakata-contextmenu-sep { 202 | display: inline-block; 203 | width: 1px; 204 | height: 2.4em; 205 | background: white; 206 | margin: 0 0.5em 0 0; 207 | border-left: 1px solid #e2e3e3; 208 | } 209 | .vakata-context .vakata-contextmenu-shortcut { 210 | font-size: 0.8em; 211 | color: silver; 212 | opacity: 0.5; 213 | display: none; 214 | } 215 | .vakata-context-rtl ul { 216 | left: auto; 217 | right: 100%; 218 | margin-left: auto; 219 | margin-right: -4px; 220 | } 221 | .vakata-context-rtl li > a.vakata-context-parent { 222 | background-image: url("data:image/gif;base64,R0lGODlhCwAHAIAAACgoKP///yH5BAEAAAEALAAAAAALAAcAAAINjI+AC7rWHIsPtmoxLAA7"); 223 | background-position: left center; 224 | background-repeat: no-repeat; 225 | } 226 | .vakata-context-rtl .vakata-context-separator > a { 227 | margin: 0 2.4em 0 0; 228 | border-left: 0; 229 | border-right: 1px solid #e2e3e3; 230 | } 231 | .vakata-context-rtl .vakata-context-left ul { 232 | right: auto; 233 | left: 100%; 234 | margin-left: -4px; 235 | margin-right: auto; 236 | } 237 | .vakata-context-rtl li > a > i { 238 | margin: 0 -2em 0 0; 239 | } 240 | .vakata-context-rtl li > a .vakata-contextmenu-sep { 241 | margin: 0 0 0 0.5em; 242 | border-left-color: white; 243 | background: #e2e3e3; 244 | } 245 | #jstree-marker { 246 | position: absolute; 247 | top: 0; 248 | left: 0; 249 | margin: -5px 0 0 0; 250 | padding: 0; 251 | border-right: 0; 252 | border-top: 5px solid transparent; 253 | border-bottom: 5px solid transparent; 254 | border-left: 5px solid; 255 | width: 0; 256 | height: 0; 257 | font-size: 0; 258 | line-height: 0; 259 | } 260 | #jstree-dnd { 261 | line-height: 16px; 262 | margin: 0; 263 | padding: 4px; 264 | } 265 | #jstree-dnd .jstree-icon, 266 | #jstree-dnd .jstree-copy { 267 | display: inline-block; 268 | text-decoration: none; 269 | margin: 0 2px 0 0; 270 | padding: 0; 271 | width: 16px; 272 | height: 16px; 273 | } 274 | #jstree-dnd .jstree-ok { 275 | background: green; 276 | } 277 | #jstree-dnd .jstree-er { 278 | background: red; 279 | } 280 | #jstree-dnd .jstree-copy { 281 | margin: 0 2px 0 2px; 282 | } 283 | .jstree-default .jstree-node, 284 | .jstree-default .jstree-icon { 285 | background-repeat: no-repeat; 286 | background-color: transparent; 287 | } 288 | .jstree-default .jstree-anchor, 289 | .jstree-default .jstree-wholerow { 290 | transition: background-color 0.15s, box-shadow 0.15s; 291 | } 292 | .jstree-default .jstree-hovered { 293 | background: #e7f4f9; 294 | border-radius: 2px; 295 | box-shadow: inset 0 0 1px #cccccc; 296 | } 297 | .jstree-default .jstree-context { 298 | background: #e7f4f9; 299 | border-radius: 2px; 300 | box-shadow: inset 0 0 1px #cccccc; 301 | } 302 | .jstree-default .jstree-clicked { 303 | background: #beebff; 304 | border-radius: 2px; 305 | box-shadow: inset 0 0 1px #999999; 306 | } 307 | .jstree-default .jstree-no-icons .jstree-anchor > .jstree-themeicon { 308 | display: none; 309 | } 310 | .jstree-default .jstree-disabled { 311 | background: transparent; 312 | color: #666666; 313 | } 314 | .jstree-default .jstree-disabled.jstree-hovered { 315 | background: transparent; 316 | box-shadow: none; 317 | } 318 | .jstree-default .jstree-disabled.jstree-clicked { 319 | background: #efefef; 320 | } 321 | .jstree-default .jstree-disabled > .jstree-icon { 322 | opacity: 0.8; 323 | filter: url("data:image/svg+xml;utf8,#jstree-grayscale"); 324 | /* Firefox 10+ */ 325 | filter: gray; 326 | /* IE6-9 */ 327 | -webkit-filter: grayscale(100%); 328 | /* Chrome 19+ & Safari 6+ */ 329 | } 330 | .jstree-default .jstree-search { 331 | font-style: italic; 332 | color: #8b0000; 333 | font-weight: bold; 334 | } 335 | .jstree-default .jstree-no-checkboxes .jstree-checkbox { 336 | display: none !important; 337 | } 338 | .jstree-default.jstree-checkbox-no-clicked .jstree-clicked { 339 | background: transparent; 340 | box-shadow: none; 341 | } 342 | .jstree-default.jstree-checkbox-no-clicked .jstree-clicked.jstree-hovered { 343 | background: #e7f4f9; 344 | } 345 | .jstree-default.jstree-checkbox-no-clicked > .jstree-wholerow-ul .jstree-wholerow-clicked { 346 | background: transparent; 347 | } 348 | .jstree-default.jstree-checkbox-no-clicked > .jstree-wholerow-ul .jstree-wholerow-clicked.jstree-wholerow-hovered { 349 | background: #e7f4f9; 350 | } 351 | .jstree-default > .jstree-striped { 352 | min-width: 100%; 353 | display: inline-block; 354 | background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAkCAMAAAB/qqA+AAAABlBMVEUAAAAAAAClZ7nPAAAAAnRSTlMNAMM9s3UAAAAXSURBVHjajcEBAQAAAIKg/H/aCQZ70AUBjAATb6YPDgAAAABJRU5ErkJggg==") left top repeat; 355 | } 356 | .jstree-default > .jstree-wholerow-ul .jstree-hovered, 357 | .jstree-default > .jstree-wholerow-ul .jstree-clicked { 358 | background: transparent; 359 | box-shadow: none; 360 | border-radius: 0; 361 | } 362 | .jstree-default .jstree-wholerow { 363 | -moz-box-sizing: border-box; 364 | -webkit-box-sizing: border-box; 365 | box-sizing: border-box; 366 | } 367 | .jstree-default .jstree-wholerow-hovered { 368 | background: #e7f4f9; 369 | } 370 | .jstree-default .jstree-wholerow-clicked { 371 | background: #beebff; 372 | background: -webkit-linear-gradient(top, #beebff 0%, #a8e4ff 100%); 373 | background: linear-gradient(to bottom, #beebff 0%, #a8e4ff 100%); 374 | } 375 | .jstree-default .jstree-node { 376 | min-height: 24px; 377 | line-height: 24px; 378 | margin-left: 24px; 379 | min-width: 24px; 380 | } 381 | .jstree-default .jstree-anchor { 382 | line-height: 24px; 383 | height: 24px; 384 | } 385 | .jstree-default .jstree-icon { 386 | width: 24px; 387 | height: 24px; 388 | line-height: 24px; 389 | } 390 | .jstree-default .jstree-icon:empty { 391 | width: 24px; 392 | height: 24px; 393 | line-height: 24px; 394 | } 395 | .jstree-default.jstree-rtl .jstree-node { 396 | margin-right: 24px; 397 | } 398 | .jstree-default .jstree-wholerow { 399 | height: 24px; 400 | } 401 | .jstree-default .jstree-node, 402 | .jstree-default .jstree-icon { 403 | background-image: url("32px.png"); 404 | } 405 | .jstree-default .jstree-node { 406 | background-position: -292px -4px; 407 | background-repeat: repeat-y; 408 | } 409 | .jstree-default .jstree-last { 410 | background: transparent; 411 | } 412 | .jstree-default .jstree-open > .jstree-ocl { 413 | background-position: -132px -4px; 414 | } 415 | .jstree-default .jstree-closed > .jstree-ocl { 416 | background-position: -100px -4px; 417 | } 418 | .jstree-default .jstree-leaf > .jstree-ocl { 419 | background-position: -68px -4px; 420 | } 421 | .jstree-default .jstree-themeicon { 422 | background-position: -260px -4px; 423 | } 424 | .jstree-default > .jstree-no-dots .jstree-node, 425 | .jstree-default > .jstree-no-dots .jstree-leaf > .jstree-ocl { 426 | background: transparent; 427 | } 428 | .jstree-default > .jstree-no-dots .jstree-open > .jstree-ocl { 429 | background-position: -36px -4px; 430 | } 431 | .jstree-default > .jstree-no-dots .jstree-closed > .jstree-ocl { 432 | background-position: -4px -4px; 433 | } 434 | .jstree-default .jstree-disabled { 435 | background: transparent; 436 | } 437 | .jstree-default .jstree-disabled.jstree-hovered { 438 | background: transparent; 439 | } 440 | .jstree-default .jstree-disabled.jstree-clicked { 441 | background: #efefef; 442 | } 443 | .jstree-default .jstree-checkbox { 444 | background-position: -164px -4px; 445 | } 446 | .jstree-default .jstree-checkbox:hover { 447 | background-position: -164px -36px; 448 | } 449 | .jstree-default.jstree-checkbox-selection .jstree-clicked > .jstree-checkbox, 450 | .jstree-default .jstree-checked > .jstree-checkbox { 451 | background-position: -228px -4px; 452 | } 453 | .jstree-default.jstree-checkbox-selection .jstree-clicked > .jstree-checkbox:hover, 454 | .jstree-default .jstree-checked > .jstree-checkbox:hover { 455 | background-position: -228px -36px; 456 | } 457 | .jstree-default .jstree-anchor > .jstree-undetermined { 458 | background-position: -196px -4px; 459 | } 460 | .jstree-default .jstree-anchor > .jstree-undetermined:hover { 461 | background-position: -196px -36px; 462 | } 463 | .jstree-default .jstree-checkbox-disabled { 464 | opacity: 0.8; 465 | filter: url("data:image/svg+xml;utf8,#jstree-grayscale"); 466 | /* Firefox 10+ */ 467 | filter: gray; 468 | /* IE6-9 */ 469 | -webkit-filter: grayscale(100%); 470 | /* Chrome 19+ & Safari 6+ */ 471 | } 472 | .jstree-default > .jstree-striped { 473 | background-size: auto 48px; 474 | } 475 | .jstree-default.jstree-rtl .jstree-node { 476 | background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg=="); 477 | background-position: 100% 1px; 478 | background-repeat: repeat-y; 479 | } 480 | .jstree-default.jstree-rtl .jstree-last { 481 | background: transparent; 482 | } 483 | .jstree-default.jstree-rtl .jstree-open > .jstree-ocl { 484 | background-position: -132px -36px; 485 | } 486 | .jstree-default.jstree-rtl .jstree-closed > .jstree-ocl { 487 | background-position: -100px -36px; 488 | } 489 | .jstree-default.jstree-rtl .jstree-leaf > .jstree-ocl { 490 | background-position: -68px -36px; 491 | } 492 | .jstree-default.jstree-rtl > .jstree-no-dots .jstree-node, 493 | .jstree-default.jstree-rtl > .jstree-no-dots .jstree-leaf > .jstree-ocl { 494 | background: transparent; 495 | } 496 | .jstree-default.jstree-rtl > .jstree-no-dots .jstree-open > .jstree-ocl { 497 | background-position: -36px -36px; 498 | } 499 | .jstree-default.jstree-rtl > .jstree-no-dots .jstree-closed > .jstree-ocl { 500 | background-position: -4px -36px; 501 | } 502 | .jstree-default .jstree-themeicon-custom { 503 | background-color: transparent; 504 | background-image: none; 505 | background-position: 0 0; 506 | } 507 | .jstree-default > .jstree-container-ul .jstree-loading > .jstree-ocl { 508 | background: url("throbber.gif") center center no-repeat; 509 | } 510 | .jstree-default .jstree-file { 511 | background: url("32px.png") -100px -68px no-repeat; 512 | } 513 | .jstree-default .jstree-folder { 514 | background: url("32px.png") -260px -4px no-repeat; 515 | } 516 | .jstree-default > .jstree-container-ul > .jstree-node { 517 | margin-left: 0; 518 | margin-right: 0; 519 | } 520 | #jstree-dnd.jstree-default { 521 | line-height: 24px; 522 | padding: 0 4px; 523 | } 524 | #jstree-dnd.jstree-default .jstree-ok, 525 | #jstree-dnd.jstree-default .jstree-er { 526 | background-image: url("32px.png"); 527 | background-repeat: no-repeat; 528 | background-color: transparent; 529 | } 530 | #jstree-dnd.jstree-default i { 531 | background: transparent; 532 | width: 24px; 533 | height: 24px; 534 | line-height: 24px; 535 | } 536 | #jstree-dnd.jstree-default .jstree-ok { 537 | background-position: -4px -68px; 538 | } 539 | #jstree-dnd.jstree-default .jstree-er { 540 | background-position: -36px -68px; 541 | } 542 | .jstree-default.jstree-rtl .jstree-node { 543 | background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg=="); 544 | } 545 | .jstree-default.jstree-rtl .jstree-last { 546 | background: transparent; 547 | } 548 | .jstree-default-small .jstree-node { 549 | min-height: 18px; 550 | line-height: 18px; 551 | margin-left: 18px; 552 | min-width: 18px; 553 | } 554 | .jstree-default-small .jstree-anchor { 555 | line-height: 18px; 556 | height: 18px; 557 | } 558 | .jstree-default-small .jstree-icon { 559 | width: 18px; 560 | height: 18px; 561 | line-height: 18px; 562 | } 563 | .jstree-default-small .jstree-icon:empty { 564 | width: 18px; 565 | height: 18px; 566 | line-height: 18px; 567 | } 568 | .jstree-default-small.jstree-rtl .jstree-node { 569 | margin-right: 18px; 570 | } 571 | .jstree-default-small .jstree-wholerow { 572 | height: 18px; 573 | } 574 | .jstree-default-small .jstree-node, 575 | .jstree-default-small .jstree-icon { 576 | background-image: url("32px.png"); 577 | } 578 | .jstree-default-small .jstree-node { 579 | background-position: -295px -7px; 580 | background-repeat: repeat-y; 581 | } 582 | .jstree-default-small .jstree-last { 583 | background: transparent; 584 | } 585 | .jstree-default-small .jstree-open > .jstree-ocl { 586 | background-position: -135px -7px; 587 | } 588 | .jstree-default-small .jstree-closed > .jstree-ocl { 589 | background-position: -103px -7px; 590 | } 591 | .jstree-default-small .jstree-leaf > .jstree-ocl { 592 | background-position: -71px -7px; 593 | } 594 | .jstree-default-small .jstree-themeicon { 595 | background-position: -263px -7px; 596 | } 597 | .jstree-default-small > .jstree-no-dots .jstree-node, 598 | .jstree-default-small > .jstree-no-dots .jstree-leaf > .jstree-ocl { 599 | background: transparent; 600 | } 601 | .jstree-default-small > .jstree-no-dots .jstree-open > .jstree-ocl { 602 | background-position: -39px -7px; 603 | } 604 | .jstree-default-small > .jstree-no-dots .jstree-closed > .jstree-ocl { 605 | background-position: -7px -7px; 606 | } 607 | .jstree-default-small .jstree-disabled { 608 | background: transparent; 609 | } 610 | .jstree-default-small .jstree-disabled.jstree-hovered { 611 | background: transparent; 612 | } 613 | .jstree-default-small .jstree-disabled.jstree-clicked { 614 | background: #efefef; 615 | } 616 | .jstree-default-small .jstree-checkbox { 617 | background-position: -167px -7px; 618 | } 619 | .jstree-default-small .jstree-checkbox:hover { 620 | background-position: -167px -39px; 621 | } 622 | .jstree-default-small.jstree-checkbox-selection .jstree-clicked > .jstree-checkbox, 623 | .jstree-default-small .jstree-checked > .jstree-checkbox { 624 | background-position: -231px -7px; 625 | } 626 | .jstree-default-small.jstree-checkbox-selection .jstree-clicked > .jstree-checkbox:hover, 627 | .jstree-default-small .jstree-checked > .jstree-checkbox:hover { 628 | background-position: -231px -39px; 629 | } 630 | .jstree-default-small .jstree-anchor > .jstree-undetermined { 631 | background-position: -199px -7px; 632 | } 633 | .jstree-default-small .jstree-anchor > .jstree-undetermined:hover { 634 | background-position: -199px -39px; 635 | } 636 | .jstree-default-small .jstree-checkbox-disabled { 637 | opacity: 0.8; 638 | filter: url("data:image/svg+xml;utf8,#jstree-grayscale"); 639 | /* Firefox 10+ */ 640 | filter: gray; 641 | /* IE6-9 */ 642 | -webkit-filter: grayscale(100%); 643 | /* Chrome 19+ & Safari 6+ */ 644 | } 645 | .jstree-default-small > .jstree-striped { 646 | background-size: auto 36px; 647 | } 648 | .jstree-default-small.jstree-rtl .jstree-node { 649 | background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg=="); 650 | background-position: 100% 1px; 651 | background-repeat: repeat-y; 652 | } 653 | .jstree-default-small.jstree-rtl .jstree-last { 654 | background: transparent; 655 | } 656 | .jstree-default-small.jstree-rtl .jstree-open > .jstree-ocl { 657 | background-position: -135px -39px; 658 | } 659 | .jstree-default-small.jstree-rtl .jstree-closed > .jstree-ocl { 660 | background-position: -103px -39px; 661 | } 662 | .jstree-default-small.jstree-rtl .jstree-leaf > .jstree-ocl { 663 | background-position: -71px -39px; 664 | } 665 | .jstree-default-small.jstree-rtl > .jstree-no-dots .jstree-node, 666 | .jstree-default-small.jstree-rtl > .jstree-no-dots .jstree-leaf > .jstree-ocl { 667 | background: transparent; 668 | } 669 | .jstree-default-small.jstree-rtl > .jstree-no-dots .jstree-open > .jstree-ocl { 670 | background-position: -39px -39px; 671 | } 672 | .jstree-default-small.jstree-rtl > .jstree-no-dots .jstree-closed > .jstree-ocl { 673 | background-position: -7px -39px; 674 | } 675 | .jstree-default-small .jstree-themeicon-custom { 676 | background-color: transparent; 677 | background-image: none; 678 | background-position: 0 0; 679 | } 680 | .jstree-default-small > .jstree-container-ul .jstree-loading > .jstree-ocl { 681 | background: url("throbber.gif") center center no-repeat; 682 | } 683 | .jstree-default-small .jstree-file { 684 | background: url("32px.png") -103px -71px no-repeat; 685 | } 686 | .jstree-default-small .jstree-folder { 687 | background: url("32px.png") -263px -7px no-repeat; 688 | } 689 | .jstree-default-small > .jstree-container-ul > .jstree-node { 690 | margin-left: 0; 691 | margin-right: 0; 692 | } 693 | #jstree-dnd.jstree-default-small { 694 | line-height: 18px; 695 | padding: 0 4px; 696 | } 697 | #jstree-dnd.jstree-default-small .jstree-ok, 698 | #jstree-dnd.jstree-default-small .jstree-er { 699 | background-image: url("32px.png"); 700 | background-repeat: no-repeat; 701 | background-color: transparent; 702 | } 703 | #jstree-dnd.jstree-default-small i { 704 | background: transparent; 705 | width: 18px; 706 | height: 18px; 707 | line-height: 18px; 708 | } 709 | #jstree-dnd.jstree-default-small .jstree-ok { 710 | background-position: -7px -71px; 711 | } 712 | #jstree-dnd.jstree-default-small .jstree-er { 713 | background-position: -39px -71px; 714 | } 715 | .jstree-default-small.jstree-rtl .jstree-node { 716 | background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAACAQMAAABv1h6PAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMHBgAAiABBI4gz9AAAAABJRU5ErkJggg=="); 717 | } 718 | .jstree-default-small.jstree-rtl .jstree-last { 719 | background: transparent; 720 | } 721 | .jstree-default-large .jstree-node { 722 | min-height: 32px; 723 | line-height: 32px; 724 | margin-left: 32px; 725 | min-width: 32px; 726 | } 727 | .jstree-default-large .jstree-anchor { 728 | line-height: 32px; 729 | height: 32px; 730 | } 731 | .jstree-default-large .jstree-icon { 732 | width: 32px; 733 | height: 32px; 734 | line-height: 32px; 735 | } 736 | .jstree-default-large .jstree-icon:empty { 737 | width: 32px; 738 | height: 32px; 739 | line-height: 32px; 740 | } 741 | .jstree-default-large.jstree-rtl .jstree-node { 742 | margin-right: 32px; 743 | } 744 | .jstree-default-large .jstree-wholerow { 745 | height: 32px; 746 | } 747 | .jstree-default-large .jstree-node, 748 | .jstree-default-large .jstree-icon { 749 | background-image: url("32px.png"); 750 | } 751 | .jstree-default-large .jstree-node { 752 | background-position: -288px 0px; 753 | background-repeat: repeat-y; 754 | } 755 | .jstree-default-large .jstree-last { 756 | background: transparent; 757 | } 758 | .jstree-default-large .jstree-open > .jstree-ocl { 759 | background-position: -128px 0px; 760 | } 761 | .jstree-default-large .jstree-closed > .jstree-ocl { 762 | background-position: -96px 0px; 763 | } 764 | .jstree-default-large .jstree-leaf > .jstree-ocl { 765 | background-position: -64px 0px; 766 | } 767 | .jstree-default-large .jstree-themeicon { 768 | background-position: -256px 0px; 769 | } 770 | .jstree-default-large > .jstree-no-dots .jstree-node, 771 | .jstree-default-large > .jstree-no-dots .jstree-leaf > .jstree-ocl { 772 | background: transparent; 773 | } 774 | .jstree-default-large > .jstree-no-dots .jstree-open > .jstree-ocl { 775 | background-position: -32px 0px; 776 | } 777 | .jstree-default-large > .jstree-no-dots .jstree-closed > .jstree-ocl { 778 | background-position: 0px 0px; 779 | } 780 | .jstree-default-large .jstree-disabled { 781 | background: transparent; 782 | } 783 | .jstree-default-large .jstree-disabled.jstree-hovered { 784 | background: transparent; 785 | } 786 | .jstree-default-large .jstree-disabled.jstree-clicked { 787 | background: #efefef; 788 | } 789 | .jstree-default-large .jstree-checkbox { 790 | background-position: -160px 0px; 791 | } 792 | .jstree-default-large .jstree-checkbox:hover { 793 | background-position: -160px -32px; 794 | } 795 | .jstree-default-large.jstree-checkbox-selection .jstree-clicked > .jstree-checkbox, 796 | .jstree-default-large .jstree-checked > .jstree-checkbox { 797 | background-position: -224px 0px; 798 | } 799 | .jstree-default-large.jstree-checkbox-selection .jstree-clicked > .jstree-checkbox:hover, 800 | .jstree-default-large .jstree-checked > .jstree-checkbox:hover { 801 | background-position: -224px -32px; 802 | } 803 | .jstree-default-large .jstree-anchor > .jstree-undetermined { 804 | background-position: -192px 0px; 805 | } 806 | .jstree-default-large .jstree-anchor > .jstree-undetermined:hover { 807 | background-position: -192px -32px; 808 | } 809 | .jstree-default-large .jstree-checkbox-disabled { 810 | opacity: 0.8; 811 | filter: url("data:image/svg+xml;utf8,#jstree-grayscale"); 812 | /* Firefox 10+ */ 813 | filter: gray; 814 | /* IE6-9 */ 815 | -webkit-filter: grayscale(100%); 816 | /* Chrome 19+ & Safari 6+ */ 817 | } 818 | .jstree-default-large > .jstree-striped { 819 | background-size: auto 64px; 820 | } 821 | .jstree-default-large.jstree-rtl .jstree-node { 822 | background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg=="); 823 | background-position: 100% 1px; 824 | background-repeat: repeat-y; 825 | } 826 | .jstree-default-large.jstree-rtl .jstree-last { 827 | background: transparent; 828 | } 829 | .jstree-default-large.jstree-rtl .jstree-open > .jstree-ocl { 830 | background-position: -128px -32px; 831 | } 832 | .jstree-default-large.jstree-rtl .jstree-closed > .jstree-ocl { 833 | background-position: -96px -32px; 834 | } 835 | .jstree-default-large.jstree-rtl .jstree-leaf > .jstree-ocl { 836 | background-position: -64px -32px; 837 | } 838 | .jstree-default-large.jstree-rtl > .jstree-no-dots .jstree-node, 839 | .jstree-default-large.jstree-rtl > .jstree-no-dots .jstree-leaf > .jstree-ocl { 840 | background: transparent; 841 | } 842 | .jstree-default-large.jstree-rtl > .jstree-no-dots .jstree-open > .jstree-ocl { 843 | background-position: -32px -32px; 844 | } 845 | .jstree-default-large.jstree-rtl > .jstree-no-dots .jstree-closed > .jstree-ocl { 846 | background-position: 0px -32px; 847 | } 848 | .jstree-default-large .jstree-themeicon-custom { 849 | background-color: transparent; 850 | background-image: none; 851 | background-position: 0 0; 852 | } 853 | .jstree-default-large > .jstree-container-ul .jstree-loading > .jstree-ocl { 854 | background: url("throbber.gif") center center no-repeat; 855 | } 856 | .jstree-default-large .jstree-file { 857 | background: url("32px.png") -96px -64px no-repeat; 858 | } 859 | .jstree-default-large .jstree-folder { 860 | background: url("32px.png") -256px 0px no-repeat; 861 | } 862 | .jstree-default-large > .jstree-container-ul > .jstree-node { 863 | margin-left: 0; 864 | margin-right: 0; 865 | } 866 | #jstree-dnd.jstree-default-large { 867 | line-height: 32px; 868 | padding: 0 4px; 869 | } 870 | #jstree-dnd.jstree-default-large .jstree-ok, 871 | #jstree-dnd.jstree-default-large .jstree-er { 872 | background-image: url("32px.png"); 873 | background-repeat: no-repeat; 874 | background-color: transparent; 875 | } 876 | #jstree-dnd.jstree-default-large i { 877 | background: transparent; 878 | width: 32px; 879 | height: 32px; 880 | line-height: 32px; 881 | } 882 | #jstree-dnd.jstree-default-large .jstree-ok { 883 | background-position: 0px -64px; 884 | } 885 | #jstree-dnd.jstree-default-large .jstree-er { 886 | background-position: -32px -64px; 887 | } 888 | .jstree-default-large.jstree-rtl .jstree-node { 889 | background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAACAQMAAAAD0EyKAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjgIIGBgABCgCBvVLXcAAAAABJRU5ErkJggg=="); 890 | } 891 | .jstree-default-large.jstree-rtl .jstree-last { 892 | background: transparent; 893 | } 894 | @media (max-width: 768px) { 895 | #jstree-dnd.jstree-dnd-responsive { 896 | line-height: 40px; 897 | font-weight: bold; 898 | font-size: 1.1em; 899 | text-shadow: 1px 1px white; 900 | } 901 | #jstree-dnd.jstree-dnd-responsive > i { 902 | background: transparent; 903 | width: 40px; 904 | height: 40px; 905 | } 906 | #jstree-dnd.jstree-dnd-responsive > .jstree-ok { 907 | background-image: url("40px.png"); 908 | background-position: 0 -200px; 909 | background-size: 120px 240px; 910 | } 911 | #jstree-dnd.jstree-dnd-responsive > .jstree-er { 912 | background-image: url("40px.png"); 913 | background-position: -40px -200px; 914 | background-size: 120px 240px; 915 | } 916 | #jstree-marker.jstree-dnd-responsive { 917 | border-left-width: 10px; 918 | border-top-width: 10px; 919 | border-bottom-width: 10px; 920 | margin-top: -10px; 921 | } 922 | } 923 | @media (max-width: 768px) { 924 | .jstree-default-responsive { 925 | /* 926 | .jstree-open > .jstree-ocl, 927 | .jstree-closed > .jstree-ocl { border-radius:20px; background-color:white; } 928 | */ 929 | } 930 | .jstree-default-responsive .jstree-icon { 931 | background-image: url("40px.png"); 932 | } 933 | .jstree-default-responsive .jstree-node, 934 | .jstree-default-responsive .jstree-leaf > .jstree-ocl { 935 | background: transparent; 936 | } 937 | .jstree-default-responsive .jstree-node { 938 | min-height: 40px; 939 | line-height: 40px; 940 | margin-left: 40px; 941 | min-width: 40px; 942 | white-space: nowrap; 943 | } 944 | .jstree-default-responsive .jstree-anchor { 945 | line-height: 40px; 946 | height: 40px; 947 | } 948 | .jstree-default-responsive .jstree-icon, 949 | .jstree-default-responsive .jstree-icon:empty { 950 | width: 40px; 951 | height: 40px; 952 | line-height: 40px; 953 | } 954 | .jstree-default-responsive > .jstree-container-ul > .jstree-node { 955 | margin-left: 0; 956 | } 957 | .jstree-default-responsive.jstree-rtl .jstree-node { 958 | margin-left: 0; 959 | margin-right: 40px; 960 | background: transparent; 961 | } 962 | .jstree-default-responsive.jstree-rtl .jstree-container-ul > .jstree-node { 963 | margin-right: 0; 964 | } 965 | .jstree-default-responsive .jstree-ocl, 966 | .jstree-default-responsive .jstree-themeicon, 967 | .jstree-default-responsive .jstree-checkbox { 968 | background-size: 120px 240px; 969 | } 970 | .jstree-default-responsive .jstree-leaf > .jstree-ocl, 971 | .jstree-default-responsive.jstree-rtl .jstree-leaf > .jstree-ocl { 972 | background: transparent; 973 | } 974 | .jstree-default-responsive .jstree-open > .jstree-ocl { 975 | background-position: 0 0px !important; 976 | } 977 | .jstree-default-responsive .jstree-closed > .jstree-ocl { 978 | background-position: 0 -40px !important; 979 | } 980 | .jstree-default-responsive.jstree-rtl .jstree-closed > .jstree-ocl { 981 | background-position: -40px 0px !important; 982 | } 983 | .jstree-default-responsive .jstree-themeicon { 984 | background-position: -40px -40px; 985 | } 986 | .jstree-default-responsive .jstree-checkbox, 987 | .jstree-default-responsive .jstree-checkbox:hover { 988 | background-position: -40px -80px; 989 | } 990 | .jstree-default-responsive.jstree-checkbox-selection .jstree-clicked > .jstree-checkbox, 991 | .jstree-default-responsive.jstree-checkbox-selection .jstree-clicked > .jstree-checkbox:hover, 992 | .jstree-default-responsive .jstree-checked > .jstree-checkbox, 993 | .jstree-default-responsive .jstree-checked > .jstree-checkbox:hover { 994 | background-position: 0 -80px; 995 | } 996 | .jstree-default-responsive .jstree-anchor > .jstree-undetermined, 997 | .jstree-default-responsive .jstree-anchor > .jstree-undetermined:hover { 998 | background-position: 0 -120px; 999 | } 1000 | .jstree-default-responsive .jstree-anchor { 1001 | font-weight: bold; 1002 | font-size: 1.1em; 1003 | text-shadow: 1px 1px white; 1004 | } 1005 | .jstree-default-responsive > .jstree-striped { 1006 | background: transparent; 1007 | } 1008 | .jstree-default-responsive .jstree-wholerow { 1009 | border-top: 1px solid rgba(255, 255, 255, 0.7); 1010 | border-bottom: 1px solid rgba(64, 64, 64, 0.2); 1011 | background: #ebebeb; 1012 | height: 40px; 1013 | } 1014 | .jstree-default-responsive .jstree-wholerow-hovered { 1015 | background: #e7f4f9; 1016 | } 1017 | .jstree-default-responsive .jstree-wholerow-clicked { 1018 | background: #beebff; 1019 | } 1020 | .jstree-default-responsive .jstree-children .jstree-last > .jstree-wholerow { 1021 | box-shadow: inset 0 -6px 3px -5px #666666; 1022 | } 1023 | .jstree-default-responsive .jstree-children .jstree-open > .jstree-wholerow { 1024 | box-shadow: inset 0 6px 3px -5px #666666; 1025 | border-top: 0; 1026 | } 1027 | .jstree-default-responsive .jstree-children .jstree-open + .jstree-open { 1028 | box-shadow: none; 1029 | } 1030 | .jstree-default-responsive .jstree-node, 1031 | .jstree-default-responsive .jstree-icon, 1032 | .jstree-default-responsive .jstree-node > .jstree-ocl, 1033 | .jstree-default-responsive .jstree-themeicon, 1034 | .jstree-default-responsive .jstree-checkbox { 1035 | background-image: url("40px.png"); 1036 | background-size: 120px 240px; 1037 | } 1038 | .jstree-default-responsive .jstree-node { 1039 | background-position: -80px 0; 1040 | background-repeat: repeat-y; 1041 | } 1042 | .jstree-default-responsive .jstree-last { 1043 | background: transparent; 1044 | } 1045 | .jstree-default-responsive .jstree-leaf > .jstree-ocl { 1046 | background-position: -40px -120px; 1047 | } 1048 | .jstree-default-responsive .jstree-last > .jstree-ocl { 1049 | background-position: -40px -160px; 1050 | } 1051 | .jstree-default-responsive .jstree-themeicon-custom { 1052 | background-color: transparent; 1053 | background-image: none; 1054 | background-position: 0 0; 1055 | } 1056 | .jstree-default-responsive .jstree-file { 1057 | background: url("40px.png") 0 -160px no-repeat; 1058 | background-size: 120px 240px; 1059 | } 1060 | .jstree-default-responsive .jstree-folder { 1061 | background: url("40px.png") -40px -40px no-repeat; 1062 | background-size: 120px 240px; 1063 | } 1064 | .jstree-default-responsive > .jstree-container-ul > .jstree-node { 1065 | margin-left: 0; 1066 | margin-right: 0; 1067 | } 1068 | } 1069 | -------------------------------------------------------------------------------- /test/dist/jstree.min.js: -------------------------------------------------------------------------------- 1 | /*! jsTree - v3.0.0-beta10 - 2014-03-30 - (MIT) */ 2 | (function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?e(require("jquery")):e(jQuery)})(function(e,t){"use strict";if(!e.jstree){var r=0,i=!1,n=!1,s=!1,a=[],o=e("script:last").attr("src"),d=document,l=d.createElement("LI"),c,h;l.setAttribute("role","treeitem"),c=d.createElement("I"),c.className="jstree-icon jstree-ocl",l.appendChild(c),c=d.createElement("A"),c.className="jstree-anchor",c.setAttribute("href","#"),h=d.createElement("I"),h.className="jstree-icon jstree-themeicon",c.appendChild(h),l.appendChild(c),c=h=null,e.jstree={version:"3.0.0-beta10",defaults:{plugins:[]},plugins:{},path:o&&-1!==o.indexOf("/")?o.replace(/\/[^\/]+$/,""):"",idregex:/[\\:&'".,=\- \/]/g},e.jstree.create=function(t,i){var n=new e.jstree.core(++r),s=i;return i=e.extend(!0,{},e.jstree.defaults,i),s&&s.plugins&&(i.plugins=s.plugins),e.each(i.plugins,function(e,t){"core"!==e&&(n=n.plugin(t,i[t]))}),n.init(t,i),n},e.jstree.core=function(e){this._id=e,this._cnt=0,this._data={core:{themes:{name:!1,dots:!1,icons:!1},selected:[],last_error:{}}}},e.jstree.reference=function(r){var i=null,n=null;if(r&&r.id&&(r=r.id),!n||!n.length)try{n=e(r)}catch(s){}if(!n||!n.length)try{n=e("#"+r.replace(e.jstree.idregex,"\\$&"))}catch(s){}return n&&n.length&&(n=n.closest(".jstree")).length&&(n=n.data("jstree"))?i=n:e(".jstree").each(function(){var n=e(this).data("jstree");return n&&n._model.data[r]?(i=n,!1):t}),i},e.fn.jstree=function(r){var i="string"==typeof r,n=Array.prototype.slice.call(arguments,1),s=null;return this.each(function(){var a=e.jstree.reference(this),o=i&&a?a[r]:null;return s=i&&o?o.apply(a,n):null,a||i||r!==t&&!e.isPlainObject(r)||e(this).data("jstree",new e.jstree.create(this,r)),(a&&!i||r===!0)&&(s=a||!1),null!==s&&s!==t?!1:t}),null!==s&&s!==t?s:this},e.expr[":"].jstree=e.expr.createPseudo(function(r){return function(r){return e(r).hasClass("jstree")&&e(r).data("jstree")!==t}}),e.jstree.defaults.core={data:!1,strings:!1,check_callback:!1,error:e.noop,animation:200,multiple:!0,themes:{name:!1,url:!1,dir:!1,dots:!0,icons:!0,stripes:!1,variant:!1,responsive:!0},expand_selected_onload:!0},e.jstree.core.prototype={plugin:function(t,r){var i=e.jstree.plugins[t];return i?(this._data[t]={},i.prototype=this,new i(r,this)):this},init:function(t,r){this._model={data:{"#":{id:"#",parent:null,parents:[],children:[],children_d:[],state:{loaded:!1}}},changed:[],force_full_redraw:!1,redraw_timeout:!1,default_state:{loaded:!0,opened:!1,selected:!1,disabled:!1}},this.element=e(t).addClass("jstree jstree-"+this._id),this.settings=r,this.element.bind("destroyed",e.proxy(this.teardown,this)),this._data.core.ready=!1,this._data.core.loaded=!1,this._data.core.rtl="rtl"===this.element.css("direction"),this.element[this._data.core.rtl?"addClass":"removeClass"]("jstree-rtl"),this.element.attr("role","tree"),this.bind(),this.trigger("init"),this._data.core.original_container_html=this.element.find(" > ul > li").clone(!0),this._data.core.original_container_html.find("li").addBack().contents().filter(function(){return 3===this.nodeType&&(!this.nodeValue||/^\s+$/.test(this.nodeValue))}).remove(),this.element.html(""),this._data.core.li_height=this.get_container_ul().children("li:eq(0)").height()||18,this.trigger("loading"),this.load_node("#")},destroy:function(){this.element.unbind("destroyed",this.teardown),this.teardown()},teardown:function(){this.unbind(),this.element.removeClass("jstree").removeData("jstree").find("[class^='jstree']").addBack().attr("class",function(){return this.className.replace(/jstree[^ ]*|$/gi,"")}),this.element=null},bind:function(){this.element.on("dblclick.jstree",function(){if(document.selection&&document.selection.empty)document.selection.empty();else if(window.getSelection){var e=window.getSelection();try{e.removeAllRanges(),e.collapse()}catch(t){}}}).on("click.jstree",".jstree-ocl",e.proxy(function(e){this.toggle_node(e.target)},this)).on("click.jstree",".jstree-anchor",e.proxy(function(t){t.preventDefault(),e(t.currentTarget).focus(),this.activate_node(t.currentTarget,t)},this)).on("keydown.jstree",".jstree-anchor",e.proxy(function(t){if("INPUT"===t.target.tagName)return!0;var r=null;switch(t.which){case 13:case 32:t.type="click",e(t.currentTarget).trigger(t);break;case 37:t.preventDefault(),this.is_open(t.currentTarget)?this.close_node(t.currentTarget):(r=this.get_prev_dom(t.currentTarget),r&&r.length&&r.children(".jstree-anchor").focus());break;case 38:t.preventDefault(),r=this.get_prev_dom(t.currentTarget),r&&r.length&&r.children(".jstree-anchor").focus();break;case 39:t.preventDefault(),this.is_closed(t.currentTarget)?this.open_node(t.currentTarget,function(e){this.get_node(e,!0).children(".jstree-anchor").focus()}):(r=this.get_next_dom(t.currentTarget),r&&r.length&&r.children(".jstree-anchor").focus());break;case 40:t.preventDefault(),r=this.get_next_dom(t.currentTarget),r&&r.length&&r.children(".jstree-anchor").focus();break;case 46:t.preventDefault(),r=this.get_node(t.currentTarget),r&&r.id&&"#"!==r.id&&(r=this.is_selected(r)?this.get_selected():r);break;case 113:t.preventDefault(),r=this.get_node(t.currentTarget);break;default:}},this)).on("load_node.jstree",e.proxy(function(t,r){if(r.status&&("#"!==r.node.id||this._data.core.loaded||(this._data.core.loaded=!0,this.trigger("loaded")),!this._data.core.ready&&!this.get_container_ul().find(".jstree-loading:eq(0)").length)){if(this._data.core.ready=!0,this._data.core.selected.length){if(this.settings.core.expand_selected_onload){var i=[],n,s;for(n=0,s=this._data.core.selected.length;s>n;n++)i=i.concat(this._model.data[this._data.core.selected[n]].parents);for(i=e.vakata.array_unique(i),n=0,s=i.length;s>n;n++)this.open_node(i[n],!1,0)}this.trigger("changed",{action:"ready",selected:this._data.core.selected})}setTimeout(e.proxy(function(){this.trigger("ready")},this),0)}},this)).on("init.jstree",e.proxy(function(){var e=this.settings.core.themes;this._data.core.themes.dots=e.dots,this._data.core.themes.stripes=e.stripes,this._data.core.themes.icons=e.icons,this.set_theme(e.name||"default",e.url),this.set_theme_variant(e.variant)},this)).on("loading.jstree",e.proxy(function(){this[this._data.core.themes.dots?"show_dots":"hide_dots"](),this[this._data.core.themes.icons?"show_icons":"hide_icons"](),this[this._data.core.themes.stripes?"show_stripes":"hide_stripes"]()},this)).on("focus.jstree",".jstree-anchor",e.proxy(function(t){this.element.find(".jstree-hovered").not(t.currentTarget).mouseleave(),e(t.currentTarget).mouseenter()},this)).on("mouseenter.jstree",".jstree-anchor",e.proxy(function(e){this.hover_node(e.currentTarget)},this)).on("mouseleave.jstree",".jstree-anchor",e.proxy(function(e){this.dehover_node(e.currentTarget)},this))},unbind:function(){this.element.off(".jstree"),e(document).off(".jstree-"+this._id)},trigger:function(e,t){t||(t={}),t.instance=this,this.element.triggerHandler(e.replace(".jstree","")+".jstree",t)},get_container:function(){return this.element},get_container_ul:function(){return this.element.children("ul:eq(0)")},get_string:function(t){var r=this.settings.core.strings;return e.isFunction(r)?r.call(this,t):r&&r[t]?r[t]:t},_firstChild:function(e){e=e?e.firstChild:null;while(null!==e&&1!==e.nodeType)e=e.nextSibling;return e},_nextSibling:function(e){e=e?e.nextSibling:null;while(null!==e&&1!==e.nodeType)e=e.nextSibling;return e},_previousSibling:function(e){e=e?e.previousSibling:null;while(null!==e&&1!==e.nodeType)e=e.previousSibling;return e},get_node:function(t,r){t&&t.id&&(t=t.id);var i;try{if(this._model.data[t])t=this._model.data[t];else if(((i=e(t,this.element)).length||(i=e("#"+t.replace(e.jstree.idregex,"\\$&"),this.element)).length)&&this._model.data[i.closest("li").attr("id")])t=this._model.data[i.closest("li").attr("id")];else{if(!(i=e(t,this.element)).length||!i.hasClass("jstree"))return!1;t=this._model.data["#"]}return r&&(t="#"===t.id?this.element:e("#"+t.id.replace(e.jstree.idregex,"\\$&"),this.element)),t}catch(n){return!1}},get_path:function(e,t,r){if(e=e.parents?e:this.get_node(e),!e||"#"===e.id||!e.parents)return!1;var i,n,s=[];for(s.push(r?e.id:e.text),i=0,n=e.parents.length;n>i;i++)s.push(r?e.parents[i]:this.get_text(e.parents[i]));return s=s.reverse().slice(1),t?s.join(t):s},get_next_dom:function(t,r){var i;return t=this.get_node(t,!0),t[0]===this.element[0]?(i=this._firstChild(this.get_container_ul()[0]),i?e(i):!1):t&&t.length?r?(i=this._nextSibling(t[0]),i?e(i):!1):t.hasClass("jstree-open")?(i=this._firstChild(t.children("ul")[0]),i?e(i):!1):null!==(i=this._nextSibling(t[0]))?e(i):t.parentsUntil(".jstree","li").next("li").eq(0):!1},get_prev_dom:function(t,r){var i;if(t=this.get_node(t,!0),t[0]===this.element[0])return i=this.get_container_ul()[0].lastChild,i?e(i):!1;if(!t||!t.length)return!1;if(r)return i=this._previousSibling(t[0]),i?e(i):!1;if(null!==(i=this._previousSibling(t[0]))){t=e(i);while(t.hasClass("jstree-open"))t=t.children("ul:eq(0)").children("li:last");return t}return i=t[0].parentNode.parentNode,i&&"LI"===i.tagName?e(i):!1},get_parent:function(e){return e=this.get_node(e),e&&"#"!==e.id?e.parent:!1},get_children_dom:function(e){return e=this.get_node(e,!0),e[0]===this.element[0]?this.get_container_ul().children("li"):e&&e.length?e.children("ul").children("li"):!1},is_parent:function(e){return e=this.get_node(e),e&&(e.state.loaded===!1||e.children.length>0)},is_loaded:function(e){return e=this.get_node(e),e&&e.state.loaded},is_loading:function(e){return e=this.get_node(e),e&&e.state&&e.state.loading},is_open:function(e){return e=this.get_node(e),e&&e.state.opened},is_closed:function(e){return e=this.get_node(e),e&&this.is_parent(e)&&!e.state.opened},is_leaf:function(e){return!this.is_parent(e)},load_node:function(t,r){var i,n,s,a,o,d,l;if(e.isArray(t)){for(t=t.slice(),i=0,n=t.length;n>i;i++)this.load_node(t[i],r);return!0}if(t=this.get_node(t),!t)return r&&r.call(this,t,!1),!1;if(t.state.loaded){for(t.state.loaded=!1,s=0,a=t.children_d.length;a>s;s++){for(o=0,d=t.parents.length;d>o;o++)this._model.data[t.parents[o]].children_d=e.vakata.array_remove_item(this._model.data[t.parents[o]].children_d,t.children_d[s]);this._model.data[t.children_d[s]].state.selected&&(l=!0,this._data.core.selected=e.vakata.array_remove_item(this._data.core.selected,t.children_d[s])),delete this._model.data[t.children_d[s]]}t.children=[],t.children_d=[],l&&this.trigger("changed",{action:"load_node",node:t,selected:this._data.core.selected})}return t.state.loading=!0,this.get_node(t,!0).addClass("jstree-loading"),this._load_node(t,e.proxy(function(e){t.state.loading=!1,t.state.loaded=e;var i=this.get_node(t,!0);t.state.loaded&&!t.children.length&&i&&i.length&&!i.hasClass("jstree-leaf")&&i.removeClass("jstree-closed jstree-open").addClass("jstree-leaf"),i.removeClass("jstree-loading"),this.trigger("load_node",{node:t,status:e}),r&&r.call(this,t,e)},this)),!0},_load_node:function(t,r){var i=this.settings.core.data,n;return i?e.isFunction(i)?i.call(this,t,e.proxy(function(i){return i===!1?r.call(this,!1):r.call(this,this["string"==typeof i?"_append_html_data":"_append_json_data"](t,"string"==typeof i?e(i):i))},this)):"object"==typeof i?i.url?(i=e.extend(!0,{},i),e.isFunction(i.url)&&(i.url=i.url.call(this,t)),e.isFunction(i.data)&&(i.data=i.data.call(this,t)),e.ajax(i).done(e.proxy(function(i,n,s){var a=s.getResponseHeader("Content-Type");return-1!==a.indexOf("json")||"object"==typeof i?r.call(this,this._append_json_data(t,i)):-1!==a.indexOf("html")||"string"==typeof i?r.call(this,this._append_html_data(t,e(i))):(this._data.core.last_error={error:"ajax",plugin:"core",id:"core_04",reason:"Could not load node",data:JSON.stringify({id:t.id,xhr:s})},r.call(this,!1))},this)).fail(e.proxy(function(e){r.call(this,!1),this._data.core.last_error={error:"ajax",plugin:"core",id:"core_04",reason:"Could not load node",data:JSON.stringify({id:t.id,xhr:e})},this.settings.core.error.call(this,this._data.core.last_error)},this))):(n=e.isArray(i)||e.isPlainObject(i)?JSON.parse(JSON.stringify(i)):i,"#"!==t.id&&(this._data.core.last_error={error:"nodata",plugin:"core",id:"core_05",reason:"Could not load node",data:JSON.stringify({id:t.id})}),r.call(this,"#"===t.id?this._append_json_data(t,n):!1)):"string"==typeof i?("#"!==t.id&&(this._data.core.last_error={error:"nodata",plugin:"core",id:"core_06",reason:"Could not load node",data:JSON.stringify({id:t.id})}),r.call(this,"#"===t.id?this._append_html_data(t,e(i)):!1)):r.call(this,!1):r.call(this,"#"===t.id?this._append_html_data(t,this._data.core.original_container_html.clone(!0)):!1)},_node_changed:function(e){e=this.get_node(e),e&&this._model.changed.push(e.id)},_append_html_data:function(t,r){t=this.get_node(t),t.children=[],t.children_d=[];var i=r.is("ul")?r.children():r,n=t.id,s=[],a=[],o=this._model.data,d=o[n],l=this._data.core.selected.length,c,h,_;for(i.each(e.proxy(function(t,r){c=this._parse_model_from_html(e(r),n,d.parents.concat()),c&&(s.push(c),a.push(c),o[c].children_d.length&&(a=a.concat(o[c].children_d)))},this)),d.children=s,d.children_d=a,h=0,_=d.parents.length;_>h;h++)o[d.parents[h]].children_d=o[d.parents[h]].children_d.concat(a);return this.trigger("model",{nodes:a,parent:n}),"#"!==n?(this._node_changed(n),this.redraw()):(this.get_container_ul().children(".jstree-initial-node").remove(),this.redraw(!0)),this._data.core.selected.length!==l&&this.trigger("changed",{action:"model",selected:this._data.core.selected}),!0},_append_json_data:function(r,i){r=this.get_node(r),r.children=[],r.children_d=[];var n=i,s=r.id,a=[],o=[],d=this._model.data,l=d[s],c=this._data.core.selected.length,h,_,u;if(n.d&&(n=n.d,"string"==typeof n&&(n=JSON.parse(n))),e.isArray(n)||(n=[n]),n.length&&n[0].id!==t&&n[0].parent!==t){for(_=0,u=n.length;u>_;_++)n[_].children||(n[_].children=[]),d[""+n[_].id]=n[_];for(_=0,u=n.length;u>_;_++)d[""+n[_].parent].children.push(""+n[_].id),l.children_d.push(""+n[_].id);for(_=0,u=l.children.length;u>_;_++)h=this._parse_model_from_flat_json(d[l.children[_]],s,l.parents.concat()),o.push(h),d[h].children_d.length&&(o=o.concat(d[h].children_d))}else{for(_=0,u=n.length;u>_;_++)h=this._parse_model_from_json(n[_],s,l.parents.concat()),h&&(a.push(h),o.push(h),d[h].children_d.length&&(o=o.concat(d[h].children_d)));for(l.children=a,l.children_d=o,_=0,u=l.parents.length;u>_;_++)d[l.parents[_]].children_d=d[l.parents[_]].children_d.concat(o)}return this.trigger("model",{nodes:o,parent:s}),"#"!==s?(this._node_changed(s),this.redraw()):this.redraw(!0),this._data.core.selected.length!==c&&this.trigger("changed",{action:"model",selected:this._data.core.selected}),!0},_parse_model_from_html:function(r,i,n){n=n?[].concat(n):[],i&&n.unshift(i);var s,a,o=this._model.data,d={id:!1,text:!1,icon:!0,parent:i,parents:n,children:[],children_d:[],data:null,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1},l,c,h;for(l in this._model.default_state)this._model.default_state.hasOwnProperty(l)&&(d.state[l]=this._model.default_state[l]);if(c=e.vakata.attributes(r,!0),e.each(c,function(r,i){return i=e.trim(i),i.length?(d.li_attr[r]=i,"id"===r&&(d.id=""+i),t):!0}),c=r.children("a").eq(0),c.length&&(c=e.vakata.attributes(c,!0),e.each(c,function(t,r){r=e.trim(r),r.length&&(d.a_attr[t]=r)})),c=r.children("a:eq(0)").length?r.children("a:eq(0)").clone():r.clone(),c.children("ins, i, ul").remove(),c=c.html(),c=e("
").html(c),d.text=c.html(),c=r.data(),d.data=c?e.extend(!0,{},c):null,d.state.opened=r.hasClass("jstree-open"),d.state.selected=r.children("a").hasClass("jstree-clicked"),d.state.disabled=r.children("a").hasClass("jstree-disabled"),d.data&&d.data.jstree)for(l in d.data.jstree)d.data.jstree.hasOwnProperty(l)&&(d.state[l]=d.data.jstree[l]);c=r.children("a").children(".jstree-themeicon"),c.length&&(d.icon=c.hasClass("jstree-themeicon-hidden")?!1:c.attr("rel")),d.state.icon&&(d.icon=d.state.icon),c=r.children("ul").children("li");do h="j"+this._id+"_"+ ++this._cnt;while(o[h]);return d.id=d.li_attr.id?""+d.li_attr.id:h,c.length?(c.each(e.proxy(function(t,r){s=this._parse_model_from_html(e(r),d.id,n),a=this._model.data[s],d.children.push(s),a.children_d.length&&(d.children_d=d.children_d.concat(a.children_d))},this)),d.children_d=d.children_d.concat(d.children)):r.hasClass("jstree-closed")&&(d.state.loaded=!1),d.li_attr["class"]&&(d.li_attr["class"]=d.li_attr["class"].replace("jstree-closed","").replace("jstree-open","")),d.a_attr["class"]&&(d.a_attr["class"]=d.a_attr["class"].replace("jstree-clicked","").replace("jstree-disabled","")),o[d.id]=d,d.state.selected&&this._data.core.selected.push(d.id),d.id},_parse_model_from_flat_json:function(e,r,i){i=i?i.concat():[],r&&i.unshift(r);var n=""+e.id,s=this._model.data,a=this._model.default_state,o,d,l,c,h={id:n,text:e.text||"",icon:e.icon!==t?e.icon:!0,parent:r,parents:i,children:e.children||[],children_d:e.children_d||[],data:e.data,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1};for(o in a)a.hasOwnProperty(o)&&(h.state[o]=a[o]);if(e&&e.data&&e.data.jstree&&e.data.jstree.icon&&(h.icon=e.data.jstree.icon),e&&e.data&&(h.data=e.data,e.data.jstree))for(o in e.data.jstree)e.data.jstree.hasOwnProperty(o)&&(h.state[o]=e.data.jstree[o]);if(e&&"object"==typeof e.state)for(o in e.state)e.state.hasOwnProperty(o)&&(h.state[o]=e.state[o]);if(e&&"object"==typeof e.li_attr)for(o in e.li_attr)e.li_attr.hasOwnProperty(o)&&(h.li_attr[o]=e.li_attr[o]);if(h.li_attr.id||(h.li_attr.id=n),e&&"object"==typeof e.a_attr)for(o in e.a_attr)e.a_attr.hasOwnProperty(o)&&(h.a_attr[o]=e.a_attr[o]);for(e&&e.children&&e.children===!0&&(h.state.loaded=!1,h.children=[],h.children_d=[]),s[h.id]=h,o=0,d=h.children.length;d>o;o++)l=this._parse_model_from_flat_json(s[h.children[o]],h.id,i),c=s[l],h.children_d.push(l),c.children_d.length&&(h.children_d=h.children_d.concat(c.children_d));return delete e.data,delete e.children,s[h.id].original=e,h.state.selected&&this._data.core.selected.push(h.id),h.id},_parse_model_from_json:function(e,r,i){i=i?i.concat():[],r&&i.unshift(r);var n=!1,s,a,o,d,l=this._model.data,c=this._model.default_state,h;do n="j"+this._id+"_"+ ++this._cnt;while(l[n]);h={id:!1,text:"string"==typeof e?e:"",icon:"object"==typeof e&&e.icon!==t?e.icon:!0,parent:r,parents:i,children:[],children_d:[],data:null,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1};for(s in c)c.hasOwnProperty(s)&&(h.state[s]=c[s]);if(e&&e.id&&(h.id=""+e.id),e&&e.text&&(h.text=e.text),e&&e.data&&e.data.jstree&&e.data.jstree.icon&&(h.icon=e.data.jstree.icon),e&&e.data&&(h.data=e.data,e.data.jstree))for(s in e.data.jstree)e.data.jstree.hasOwnProperty(s)&&(h.state[s]=e.data.jstree[s]);if(e&&"object"==typeof e.state)for(s in e.state)e.state.hasOwnProperty(s)&&(h.state[s]=e.state[s]);if(e&&"object"==typeof e.li_attr)for(s in e.li_attr)e.li_attr.hasOwnProperty(s)&&(h.li_attr[s]=e.li_attr[s]);if(h.li_attr.id&&!h.id&&(h.id=""+h.li_attr.id),h.id||(h.id=n),h.li_attr.id||(h.li_attr.id=h.id),e&&"object"==typeof e.a_attr)for(s in e.a_attr)e.a_attr.hasOwnProperty(s)&&(h.a_attr[s]=e.a_attr[s]);if(e&&e.children&&e.children.length){for(s=0,a=e.children.length;a>s;s++)o=this._parse_model_from_json(e.children[s],h.id,i),d=l[o],h.children.push(o),d.children_d.length&&(h.children_d=h.children_d.concat(d.children_d));h.children_d=h.children_d.concat(h.children)}return e&&e.children&&e.children===!0&&(h.state.loaded=!1,h.children=[],h.children_d=[]),delete e.data,delete e.children,h.original=e,l[h.id]=h,h.state.selected&&this._data.core.selected.push(h.id),h.id},_redraw:function(){var e=this._model.force_full_redraw?this._model.data["#"].children.concat([]):this._model.changed.concat([]),t=document.createElement("UL"),r,i,n;for(i=0,n=e.length;n>i;i++)r=this.redraw_node(e[i],!0,this._model.force_full_redraw),r&&this._model.force_full_redraw&&t.appendChild(r);this._model.force_full_redraw&&(t.className=this.get_container_ul()[0].className,this.element.empty().append(t)),this._model.force_full_redraw=!1,this._model.changed=[],this.trigger("redraw",{nodes:e})},redraw:function(e){e&&(this._model.force_full_redraw=!0),this._redraw()},redraw_node:function(t,r,i){var n=this.get_node(t),s=!1,a=!1,o=!1,d=!1,c=!1,h=!1,_="",u=document,g=this._model.data,f=!1,p=!1;if(!n)return!1;if("#"===n.id)return this.redraw(!0);if(r=r||0===n.children.length,t=this.element[0].querySelector("#"+(-1!=="0123456789".indexOf(n.id[0])?"\\3"+n.id[0]+" "+n.id.substr(1).replace(e.jstree.idregex,"\\$&"):n.id.replace(e.jstree.idregex,"\\$&"))))t=e(t),i||(s=t.parent().parent()[0],s===this.element[0]&&(s=null),a=t.index()),r||!n.children.length||t.children("ul").length||(r=!0),r||(o=t.children("UL")[0]),p=t.attr("aria-selected"),f=t.children(".jstree-anchor")[0]===document.activeElement,t.remove();else if(r=!0,!i){if(s="#"!==n.parent?e("#"+n.parent.replace(e.jstree.idregex,"\\$&"),this.element)[0]:null,!(null===s||s&&g[n.parent].state.opened))return!1;a=e.inArray(n.id,null===s?g["#"].children:g[n.parent].children)}t=l.cloneNode(!0),_="jstree-node ";for(d in n.li_attr)if(n.li_attr.hasOwnProperty(d)){if("id"===d)continue;"class"!==d?t.setAttribute(d,n.li_attr[d]):_+=n.li_attr[d]}p&&"false"!==p&&t.setAttribute("aria-selected",!0),n.state.loaded&&!n.children.length?_+=" jstree-leaf":(_+=n.state.opened&&n.state.loaded?" jstree-open":" jstree-closed",t.setAttribute("aria-expanded",n.state.opened&&n.state.loaded)),null!==n.parent&&g[n.parent].children[g[n.parent].children.length-1]===n.id&&(_+=" jstree-last"),t.id=n.id,t.className=_,_=(n.state.selected?" jstree-clicked":"")+(n.state.disabled?" jstree-disabled":"");for(c in n.a_attr)if(n.a_attr.hasOwnProperty(c)){if("href"===c&&"#"===n.a_attr[c])continue;"class"!==c?t.childNodes[1].setAttribute(c,n.a_attr[c]):_+=" "+n.a_attr[c]}if(_.length&&(t.childNodes[1].className="jstree-anchor "+_),(n.icon&&n.icon!==!0||n.icon===!1)&&(n.icon===!1?t.childNodes[1].childNodes[0].className+=" jstree-themeicon-hidden":-1===n.icon.indexOf("/")&&-1===n.icon.indexOf(".")?t.childNodes[1].childNodes[0].className+=" "+n.icon+" jstree-themeicon-custom":(t.childNodes[1].childNodes[0].style.backgroundImage="url("+n.icon+")",t.childNodes[1].childNodes[0].style.backgroundPosition="center center",t.childNodes[1].childNodes[0].style.backgroundSize="auto",t.childNodes[1].childNodes[0].className+=" jstree-themeicon-custom")),t.childNodes[1].innerHTML+=n.text,r&&n.children.length&&n.state.opened&&n.state.loaded){for(h=u.createElement("UL"),h.setAttribute("role","group"),h.className="jstree-children",d=0,c=n.children.length;c>d;d++)h.appendChild(this.redraw_node(n.children[d],r,!0));t.appendChild(h)}return o&&t.appendChild(o),i||(s||(s=this.element[0]),s.getElementsByTagName("UL").length?s=s.getElementsByTagName("UL")[0]:(d=u.createElement("UL"),d.setAttribute("role","group"),d.className="jstree-children",s.appendChild(d),s=d),s.childNodes.length>a?s.insertBefore(t,s.childNodes[a]):s.appendChild(t),f&&t.childNodes[1].focus()),n.state.opened&&!n.state.loaded&&(n.state.opened=!1,setTimeout(e.proxy(function(){this.open_node(n.id,!1,0)},this),0)),t},open_node:function(r,i,n){var s,a,o,d;if(e.isArray(r)){for(r=r.slice(),s=0,a=r.length;a>s;s++)this.open_node(r[s],i,n);return!0}if(r=this.get_node(r),!r||"#"===r.id)return!1;if(n=n===t?this.settings.core.animation:n,!this.is_closed(r))return i&&i.call(this,r,!1),!1;if(this.is_loaded(r))o=this.get_node(r,!0),d=this,o.length&&(r.children.length&&!this._firstChild(o.children("ul")[0])&&(r.state.opened=!0,this.redraw_node(r,!0),o=this.get_node(r,!0)),n?(this.trigger("before_open",{node:r}),o.children("ul").css("display","none").end().removeClass("jstree-closed").addClass("jstree-open").attr("aria-expanded",!0).children("ul").stop(!0,!0).slideDown(n,function(){this.style.display="",d.trigger("after_open",{node:r})})):(this.trigger("before_open",{node:r}),o[0].className=o[0].className.replace("jstree-closed","jstree-open"),o[0].setAttribute("aria-expanded",!0))),r.state.opened=!0,i&&i.call(this,r,!0),o.length||this.trigger("before_open",{node:r}),this.trigger("open_node",{node:r}),n&&o.length||this.trigger("after_open",{node:r});else{if(this.is_loading(r))return setTimeout(e.proxy(function(){this.open_node(r,i,n)},this),500);this.load_node(r,function(e,t){return t?this.open_node(e,i,n):i?i.call(this,e,!1):!1})}},_open_to:function(t){if(t=this.get_node(t),!t||"#"===t.id)return!1;var r,i,n=t.parents;for(r=0,i=n.length;i>r;r+=1)"#"!==r&&this.open_node(n[r],!1,0);return e("#"+t.id.replace(e.jstree.idregex,"\\$&"),this.element)},close_node:function(r,i){var n,s,a,o;if(e.isArray(r)){for(r=r.slice(),n=0,s=r.length;s>n;n++)this.close_node(r[n],i);return!0}return r=this.get_node(r),r&&"#"!==r.id?this.is_closed(r)?!1:(i=i===t?this.settings.core.animation:i,a=this,o=this.get_node(r,!0),o.length&&(i?o.children("ul").attr("style","display:block !important").end().removeClass("jstree-open").addClass("jstree-closed").attr("aria-expanded",!1).children("ul").stop(!0,!0).slideUp(i,function(){this.style.display="",o.children("ul").remove(),a.trigger("after_close",{node:r})}):(o[0].className=o[0].className.replace("jstree-open","jstree-closed"),o.attr("aria-expanded",!1).children("ul").remove())),r.state.opened=!1,this.trigger("close_node",{node:r}),i&&o.length||this.trigger("after_close",{node:r}),t):!1},toggle_node:function(r){var i,n;if(e.isArray(r)){for(r=r.slice(),i=0,n=r.length;n>i;i++)this.toggle_node(r[i]);return!0}return this.is_closed(r)?this.open_node(r):this.is_open(r)?this.close_node(r):t},open_all:function(e,t,r){if(e||(e="#"),e=this.get_node(e),!e)return!1;var i="#"===e.id?this.get_container_ul():this.get_node(e,!0),n,s,a;if(!i.length){for(n=0,s=e.children_d.length;s>n;n++)this.is_closed(this._model.data[e.children_d[n]])&&(this._model.data[e.children_d[n]].state.opened=!0);return this.trigger("open_all",{node:e})}r=r||i,a=this,i=this.is_closed(e)?i.find("li.jstree-closed").addBack():i.find("li.jstree-closed"),i.each(function(){a.open_node(this,function(e,i){i&&this.is_parent(e)&&this.open_all(e,t,r)},t||0)}),0===r.find("li.jstree-closed").length&&this.trigger("open_all",{node:this.get_node(r)})},close_all:function(e,t){if(e||(e="#"),e=this.get_node(e),!e)return!1;var r="#"===e.id?this.get_container_ul():this.get_node(e,!0),i=this,n,s;if(!r.length){for(n=0,s=e.children_d.length;s>n;n++)this._model.data[e.children_d[n]].state.opened=!1;return this.trigger("close_all",{node:e})}r=this.is_open(e)?r.find("li.jstree-open").addBack():r.find("li.jstree-open"),r.vakata_reverse().each(function(){i.close_node(this,t||0)}),this.trigger("close_all",{node:e})},is_disabled:function(e){return e=this.get_node(e),e&&e.state&&e.state.disabled},enable_node:function(r){var i,n;if(e.isArray(r)){for(r=r.slice(),i=0,n=r.length;n>i;i++)this.enable_node(r[i]);return!0}return r=this.get_node(r),r&&"#"!==r.id?(r.state.disabled=!1,this.get_node(r,!0).children(".jstree-anchor").removeClass("jstree-disabled"),this.trigger("enable_node",{node:r}),t):!1},disable_node:function(r){var i,n;if(e.isArray(r)){for(r=r.slice(),i=0,n=r.length;n>i;i++)this.disable_node(r[i]);return!0}return r=this.get_node(r),r&&"#"!==r.id?(r.state.disabled=!0,this.get_node(r,!0).children(".jstree-anchor").addClass("jstree-disabled"),this.trigger("disable_node",{node:r}),t):!1},activate_node:function(e,r){if(this.is_disabled(e))return!1;if(this._data.core.last_clicked=this._data.core.last_clicked&&this._data.core.last_clicked.id!==t?this.get_node(this._data.core.last_clicked.id):null,this._data.core.last_clicked&&!this._data.core.last_clicked.state.selected&&(this._data.core.last_clicked=null),!this._data.core.last_clicked&&this._data.core.selected.length&&(this._data.core.last_clicked=this.get_node(this._data.core.selected[this._data.core.selected.length-1])),this.settings.core.multiple&&(r.metaKey||r.ctrlKey||r.shiftKey)&&(!r.shiftKey||this._data.core.last_clicked&&this.get_parent(e)&&this.get_parent(e)===this._data.core.last_clicked.parent))if(r.shiftKey){var i=this.get_node(e).id,n=this._data.core.last_clicked.id,s=this.get_node(this._data.core.last_clicked.parent).children,a=!1,o,d;for(o=0,d=s.length;d>o;o+=1)s[o]===i&&(a=!a),s[o]===n&&(a=!a),a||s[o]===i||s[o]===n?this.select_node(s[o],!1,!1,r):this.deselect_node(s[o],!1,!1,r)}else this.is_selected(e)?this.deselect_node(e,!1,!1,r):this.select_node(e,!1,!1,r);else!this.settings.core.multiple&&(r.metaKey||r.ctrlKey||r.shiftKey)&&this.is_selected(e)?this.deselect_node(e,!1,!1,r):(this.deselect_all(!0),this.select_node(e,!1,!1,r),this._data.core.last_clicked=this.get_node(e));this.trigger("activate_node",{node:this.get_node(e)})},hover_node:function(e){if(e=this.get_node(e,!0),!e||!e.length||e.children(".jstree-hovered").length)return!1;var t=this.element.find(".jstree-hovered"),r=this.element;t&&t.length&&this.dehover_node(t),e.children(".jstree-anchor").addClass("jstree-hovered"),this.trigger("hover_node",{node:this.get_node(e)}),setTimeout(function(){r.attr("aria-activedescendant",e[0].id),e.attr("aria-selected",!0)},0)},dehover_node:function(e){return e=this.get_node(e,!0),e&&e.length&&e.children(".jstree-hovered").length?(e.attr("aria-selected",!1).children(".jstree-anchor").removeClass("jstree-hovered"),this.trigger("dehover_node",{node:this.get_node(e)}),t):!1},select_node:function(r,i,n,s){var a,o,d,l;if(e.isArray(r)){for(r=r.slice(),o=0,d=r.length;d>o;o++)this.select_node(r[o],i,n,s);return!0}return r=this.get_node(r),r&&"#"!==r.id?(a=this.get_node(r,!0),r.state.selected||(r.state.selected=!0,this._data.core.selected.push(r.id),n||(a=this._open_to(r)),a&&a.length&&a.children(".jstree-anchor").addClass("jstree-clicked"),this.trigger("select_node",{node:r,selected:this._data.core.selected,event:s}),i||this.trigger("changed",{action:"select_node",node:r,selected:this._data.core.selected,event:s})),t):!1},deselect_node:function(r,i,n){var s,a,o;if(e.isArray(r)){for(r=r.slice(),s=0,a=r.length;a>s;s++)this.deselect_node(r[s],i,n);return!0}return r=this.get_node(r),r&&"#"!==r.id?(o=this.get_node(r,!0),r.state.selected&&(r.state.selected=!1,this._data.core.selected=e.vakata.array_remove_item(this._data.core.selected,r.id),o.length&&o.children(".jstree-anchor").removeClass("jstree-clicked"),this.trigger("deselect_node",{node:r,selected:this._data.core.selected,event:n}),i||this.trigger("changed",{action:"deselect_node",node:r,selected:this._data.core.selected,event:n})),t):!1},select_all:function(e){var t=this._data.core.selected.concat([]),r,i;for(this._data.core.selected=this._model.data["#"].children_d.concat(),r=0,i=this._data.core.selected.length;i>r;r++)this._model.data[this._data.core.selected[r]]&&(this._model.data[this._data.core.selected[r]].state.selected=!0);this.redraw(!0),this.trigger("select_all",{selected:this._data.core.selected}),e||this.trigger("changed",{action:"select_all",selected:this._data.core.selected,old_selection:t})},deselect_all:function(e){var t=this._data.core.selected.concat([]),r,i;for(r=0,i=this._data.core.selected.length;i>r;r++)this._model.data[this._data.core.selected[r]]&&(this._model.data[this._data.core.selected[r]].state.selected=!1);this._data.core.selected=[],this.element.find(".jstree-clicked").removeClass("jstree-clicked"),this.trigger("deselect_all",{selected:this._data.core.selected,node:t}),e||this.trigger("changed",{action:"deselect_all",selected:this._data.core.selected,old_selection:t})},is_selected:function(e){return e=this.get_node(e),e&&"#"!==e.id?e.state.selected:!1},get_selected:function(t){return t?e.map(this._data.core.selected,e.proxy(function(e){return this.get_node(e)},this)):this._data.core.selected},get_top_selected:function(t){var r=this.get_selected(!0),i={},n,s,a,o;for(n=0,s=r.length;s>n;n++)i[r[n].id]=r[n];for(n=0,s=r.length;s>n;n++)for(a=0,o=r[n].children_d.length;o>a;a++)i[r[n].children_d[a]]&&delete i[r[n].children_d[a]]; 3 | r=[];for(n in i)i.hasOwnProperty(n)&&r.push(n);return t?e.map(r,e.proxy(function(e){return this.get_node(e)},this)):r},get_bottom_selected:function(t){var r=this.get_selected(!0),i=[],n,s;for(n=0,s=r.length;s>n;n++)r[n].children.length||i.push(r[n].id);return t?e.map(i,e.proxy(function(e){return this.get_node(e)},this)):i},get_state:function(){var e={core:{open:[],scroll:{left:this.element.scrollLeft(),top:this.element.scrollTop()},selected:[]}},t;for(t in this._model.data)this._model.data.hasOwnProperty(t)&&"#"!==t&&(this._model.data[t].state.opened&&e.core.open.push(t),this._model.data[t].state.selected&&e.core.selected.push(t));return e},set_state:function(r,i){if(r){if(r.core){var n,s,a,o;if(r.core.open)return e.isArray(r.core.open)?(n=!0,s=!1,a=this,e.each(r.core.open.concat([]),function(t,o){s=a.get_node(o),s&&(a.is_loaded(o)?(a.is_closed(o)&&a.open_node(o,!1,0),r&&r.core&&r.core.open&&e.vakata.array_remove_item(r.core.open,o)):(a.is_loading(o)||a.open_node(o,e.proxy(function(t,n){!n&&r&&r.core&&r.core.open&&e.vakata.array_remove_item(r.core.open,t.id),this.set_state(r,i)},a),0),n=!1))}),n&&(delete r.core.open,this.set_state(r,i)),!1):(delete r.core.open,this.set_state(r,i),!1);if(r.core.scroll)return r.core.scroll&&r.core.scroll.left!==t&&this.element.scrollLeft(r.core.scroll.left),r.core.scroll&&r.core.scroll.top!==t&&this.element.scrollTop(r.core.scroll.top),delete r.core.scroll,this.set_state(r,i),!1;if(r.core.selected)return o=this,this.deselect_all(),e.each(r.core.selected,function(e,t){o.select_node(t)}),delete r.core.selected,this.set_state(r,i),!1;if(e.isEmptyObject(r.core))return delete r.core,this.set_state(r,i),!1}return e.isEmptyObject(r)?(r=null,i&&i.call(this),this.trigger("set_state"),!1):!0}return!1},refresh:function(t){this._data.core.state=this.get_state(),this._cnt=0,this._model.data={"#":{id:"#",parent:null,parents:[],children:[],children_d:[],state:{loaded:!1}}};var r=this.get_container_ul()[0].className;t||this.element.html(""),this.load_node("#",function(t,i){i&&(this.get_container_ul()[0].className=r,this.set_state(e.extend(!0,{},this._data.core.state),function(){this.trigger("refresh")})),this._data.core.state=null})},set_id:function(t,r){if(t=this.get_node(t),!t||"#"===t.id)return!1;var i,n,s=this._model.data;for(r=""+r,s[t.parent].children[e.inArray(t.id,s[t.parent].children)]=r,i=0,n=t.parents.length;n>i;i++)s[t.parents[i]].children_d[e.inArray(t.id,s[t.parents[i]].children_d)]=r;for(i=0,n=t.children.length;n>i;i++)s[t.children[i]].parent=r;for(i=0,n=t.children_d.length;n>i;i++)s[t.children_d[i]].parents[e.inArray(t.id,s[t.children_d[i]].parents)]=r;return i=e.inArray(t.id,this._data.core.selected),-1!==i&&(this._data.core.selected[i]=r),i=this.get_node(t.id,!0),i&&i.attr("id",r),delete s[t.id],t.id=r,s[r]=t,!0},get_text:function(e){return e=this.get_node(e),e&&"#"!==e.id?e.text:!1},set_text:function(t,r){var i,n,s,a;if(e.isArray(t)){for(t=t.slice(),i=0,n=t.length;n>i;i++)this.set_text(t[i],r);return!0}return t=this.get_node(t),t&&"#"!==t.id?(t.text=r,s=this.get_node(t,!0),s.length&&(s=s.children(".jstree-anchor:eq(0)"),a=s.children("I").clone(),s.html(r).prepend(a),this.trigger("set_text",{obj:t,text:r})),!0):!1},get_json:function(e,t,r){if(e=this.get_node(e||"#"),!e)return!1;t&&t.flat&&!r&&(r=[]);var i={id:e.id,text:e.text,icon:this.get_icon(e),li_attr:e.li_attr,a_attr:e.a_attr,state:{},data:t&&t.no_data?!1:e.data},n,s;if(t&&t.flat?i.parent=e.parent:i.children=[],!t||!t.no_state)for(n in e.state)e.state.hasOwnProperty(n)&&(i.state[n]=e.state[n]);if(t&&t.no_id&&(delete i.id,i.li_attr&&i.li_attr.id&&delete i.li_attr.id),t&&t.flat&&"#"!==e.id&&r.push(i),!t||!t.no_children)for(n=0,s=e.children.length;s>n;n++)t&&t.flat?this.get_json(e.children[n],t,r):i.children.push(this.get_json(e.children[n],t));return t&&t.flat?r:"#"===e.id?i.children:i},create_node:function(r,i,n,s,a){if(null===r&&(r="#"),r=this.get_node(r),!r)return!1;if(n=n===t?"last":n,!(""+n).match(/^(before|after)$/)&&!a&&!this.is_loaded(r))return this.load_node(r,function(){this.create_node(r,i,n,s,!0)});i||(i={text:this.get_string("New node")}),i.text===t&&(i.text=this.get_string("New node"));var o,d,l,c;switch("#"===r.id&&("before"===n&&(n="first"),"after"===n&&(n="last")),n){case"before":o=this.get_node(r.parent),n=e.inArray(r.id,o.children),r=o;break;case"after":o=this.get_node(r.parent),n=e.inArray(r.id,o.children)+1,r=o;break;case"inside":case"first":n=0;break;case"last":n=r.children.length;break;default:n||(n=0)}if(n>r.children.length&&(n=r.children.length),i.id||(i.id=!0),!this.check("create_node",i,r,n))return this.settings.core.error.call(this,this._data.core.last_error),!1;if(i.id===!0&&delete i.id,i=this._parse_model_from_json(i,r.id,r.parents.concat()),!i)return!1;for(o=this.get_node(i),d=[],d.push(i),d=d.concat(o.children_d),this.trigger("model",{nodes:d,parent:r.id}),r.children_d=r.children_d.concat(d),l=0,c=r.parents.length;c>l;l++)this._model.data[r.parents[l]].children_d=this._model.data[r.parents[l]].children_d.concat(d);for(i=o,o=[],l=0,c=r.children.length;c>l;l++)o[l>=n?l+1:l]=r.children[l];return o[n]=i.id,r.children=o,this.redraw_node(r,!0),s&&s.call(this,this.get_node(i)),this.trigger("create_node",{node:this.get_node(i),parent:r.id,position:n}),i.id},rename_node:function(t,r){var i,n,s;if(e.isArray(t)){for(t=t.slice(),i=0,n=t.length;n>i;i++)this.rename_node(t[i],r);return!0}return t=this.get_node(t),t&&"#"!==t.id?(s=t.text,this.check("rename_node",t,this.get_parent(t),r)?(this.set_text(t,r),this.trigger("rename_node",{node:t,text:r,old:s}),!0):(this.settings.core.error.call(this,this._data.core.last_error),!1)):!1},delete_node:function(t){var r,i,n,s,a,o,d,l,c,h;if(e.isArray(t)){for(t=t.slice(),r=0,i=t.length;i>r;r++)this.delete_node(t[r]);return!0}if(t=this.get_node(t),!t||"#"===t.id)return!1;if(n=this.get_node(t.parent),s=e.inArray(t.id,n.children),h=!1,!this.check("delete_node",t,n,s))return this.settings.core.error.call(this,this._data.core.last_error),!1;for(-1!==s&&(n.children=e.vakata.array_remove(n.children,s)),a=t.children_d.concat([]),a.push(t.id),l=0,c=a.length;c>l;l++){for(o=0,d=t.parents.length;d>o;o++)s=e.inArray(a[l],this._model.data[t.parents[o]].children_d),-1!==s&&(this._model.data[t.parents[o]].children_d=e.vakata.array_remove(this._model.data[t.parents[o]].children_d,s));this._model.data[a[l]].state.selected&&(h=!0,s=e.inArray(a[l],this._data.core.selected),-1!==s&&(this._data.core.selected=e.vakata.array_remove(this._data.core.selected,s)))}for(this.trigger("delete_node",{node:t,parent:n.id}),h&&this.trigger("changed",{action:"delete_node",node:t,selected:this._data.core.selected,parent:n.id}),l=0,c=a.length;c>l;l++)delete this._model.data[a[l]];return this.redraw_node(n,!0),!0},check:function(t,r,i,n,s){r=r&&r.id?r:this.get_node(r),i=i&&i.id?i:this.get_node(i);var a=t.match(/^move_node|copy_node|create_node$/i)?i:r,o=this.settings.core.check_callback;return"move_node"!==t||r.id!==i.id&&e.inArray(r.id,i.children)!==n&&-1===e.inArray(i.id,r.children_d)?(a=this.get_node(a,!0),a.length&&(a=a.data("jstree")),a&&a.functions&&(a.functions[t]===!1||a.functions[t]===!0)?(a.functions[t]===!1&&(this._data.core.last_error={error:"check",plugin:"core",id:"core_02",reason:"Node data prevents function: "+t,data:JSON.stringify({chk:t,pos:n,obj:r&&r.id?r.id:!1,par:i&&i.id?i.id:!1})}),a.functions[t]):o===!1||e.isFunction(o)&&o.call(this,t,r,i,n,s)===!1||o&&o[t]===!1?(this._data.core.last_error={error:"check",plugin:"core",id:"core_03",reason:"User config for core.check_callback prevents function: "+t,data:JSON.stringify({chk:t,pos:n,obj:r&&r.id?r.id:!1,par:i&&i.id?i.id:!1})},!1):!0):(this._data.core.last_error={error:"check",plugin:"core",id:"core_01",reason:"Moving parent inside child",data:JSON.stringify({chk:t,pos:n,obj:r&&r.id?r.id:!1,par:i&&i.id?i.id:!1})},!1)},last_error:function(){return this._data.core.last_error},move_node:function(r,i,n,s,a){var o,d,l,c,h,_,u,g,f,p,m,v,y;if(e.isArray(r)){for(r=r.reverse().slice(),o=0,d=r.length;d>o;o++)this.move_node(r[o],i,n,s,a);return!0}if(r=r&&r.id?r:this.get_node(r),i=this.get_node(i),n=n===t?0:n,!i||!r||"#"===r.id)return!1;if(!(""+n).match(/^(before|after)$/)&&!a&&!this.is_loaded(i))return this.load_node(i,function(){this.move_node(r,i,n,s,!0)});if(l=""+(r.parent||"#"),c=(""+n).match(/^(before|after)$/)&&"#"!==i.id?this.get_node(i.parent):i,h=this._model.data[r.id]?this:e.jstree.reference(r.id),_=!h||!h._id||this._id!==h._id)return this.copy_node(r,i,n,s,a)?(h&&h.delete_node(r),!0):!1;switch("#"===c.id&&("before"===n&&(n="first"),"after"===n&&(n="last")),n){case"before":n=e.inArray(i.id,c.children);break;case"after":n=e.inArray(i.id,c.children)+1;break;case"inside":case"first":n=0;break;case"last":n=c.children.length;break;default:n||(n=0)}if(n>c.children.length&&(n=c.children.length),!this.check("move_node",r,c,n))return this.settings.core.error.call(this,this._data.core.last_error),!1;if(r.parent===c.id){for(u=c.children.concat(),g=e.inArray(r.id,u),-1!==g&&(u=e.vakata.array_remove(u,g),n>g&&n--),g=[],f=0,p=u.length;p>f;f++)g[f>=n?f+1:f]=u[f];g[n]=r.id,c.children=g,this._node_changed(c.id),this.redraw("#"===c.id)}else{for(g=r.children_d.concat(),g.push(r.id),f=0,p=r.parents.length;p>f;f++){for(u=[],y=h._model.data[r.parents[f]].children_d,m=0,v=y.length;v>m;m++)-1===e.inArray(y[m],g)&&u.push(y[m]);h._model.data[r.parents[f]].children_d=u}for(h._model.data[l].children=e.vakata.array_remove_item(h._model.data[l].children,r.id),f=0,p=c.parents.length;p>f;f++)this._model.data[c.parents[f]].children_d=this._model.data[c.parents[f]].children_d.concat(g);for(u=[],f=0,p=c.children.length;p>f;f++)u[f>=n?f+1:f]=c.children[f];for(u[n]=r.id,c.children=u,c.children_d.push(r.id),c.children_d=c.children_d.concat(r.children_d),r.parent=c.id,g=c.parents.concat(),g.unshift(c.id),y=r.parents.length,r.parents=g,g=g.concat(),f=0,p=r.children_d.length;p>f;f++)this._model.data[r.children_d[f]].parents=this._model.data[r.children_d[f]].parents.slice(0,-1*y),Array.prototype.push.apply(this._model.data[r.children_d[f]].parents,g);this._node_changed(l),this._node_changed(c.id),this.redraw("#"===l||"#"===c.id)}return s&&s.call(this,r,c,n),this.trigger("move_node",{node:r,parent:c.id,position:n,old_parent:l,is_multi:_,old_instance:h,new_instance:this}),!0},copy_node:function(r,i,n,s,a){var o,d,l,c,h,_,u,g,f,p,m;if(e.isArray(r)){for(r=r.reverse().slice(),o=0,d=r.length;d>o;o++)this.copy_node(r[o],i,n,s,a);return!0}if(r=r&&r.id?r:this.get_node(r),i=this.get_node(i),n=n===t?0:n,!i||!r||"#"===r.id)return!1;if(!(""+n).match(/^(before|after)$/)&&!a&&!this.is_loaded(i))return this.load_node(i,function(){this.copy_node(r,i,n,s,!0)});switch(g=""+(r.parent||"#"),f=(""+n).match(/^(before|after)$/)&&"#"!==i.id?this.get_node(i.parent):i,p=this._model.data[r.id]?this:e.jstree.reference(r.id),m=!p||!p._id||this._id!==p._id,"#"===f.id&&("before"===n&&(n="first"),"after"===n&&(n="last")),n){case"before":n=e.inArray(i.id,f.children);break;case"after":n=e.inArray(i.id,f.children)+1;break;case"inside":case"first":n=0;break;case"last":n=f.children.length;break;default:n||(n=0)}if(n>f.children.length&&(n=f.children.length),!this.check("copy_node",r,f,n))return this.settings.core.error.call(this,this._data.core.last_error),!1;if(u=p?p.get_json(r,{no_id:!0,no_data:!0,no_state:!0}):r,!u)return!1;if(u.id===!0&&delete u.id,u=this._parse_model_from_json(u,f.id,f.parents.concat()),!u)return!1;for(c=this.get_node(u),r&&r.state&&r.state.loaded===!1&&(c.state.loaded=!1),l=[],l.push(u),l=l.concat(c.children_d),this.trigger("model",{nodes:l,parent:f.id}),h=0,_=f.parents.length;_>h;h++)this._model.data[f.parents[h]].children_d=this._model.data[f.parents[h]].children_d.concat(l);for(l=[],h=0,_=f.children.length;_>h;h++)l[h>=n?h+1:h]=f.children[h];return l[n]=c.id,f.children=l,f.children_d.push(c.id),f.children_d=f.children_d.concat(c.children_d),this._node_changed(f.id),this.redraw("#"===f.id),s&&s.call(this,c,f,n),this.trigger("copy_node",{node:c,original:r,parent:f.id,position:n,old_parent:g,is_multi:m,old_instance:p,new_instance:this}),c.id},cut:function(r){if(r||(r=this._data.core.selected.concat()),e.isArray(r)||(r=[r]),!r.length)return!1;var a=[],o,d,l;for(d=0,l=r.length;l>d;d++)o=this.get_node(r[d]),o&&o.id&&"#"!==o.id&&a.push(o);return a.length?(i=a,s=this,n="move_node",this.trigger("cut",{node:r}),t):!1},copy:function(r){if(r||(r=this._data.core.selected.concat()),e.isArray(r)||(r=[r]),!r.length)return!1;var a=[],o,d,l;for(d=0,l=r.length;l>d;d++)o=this.get_node(r[d]),o&&o.id&&"#"!==o.id&&a.push(o);return a.length?(i=a,s=this,n="copy_node",this.trigger("copy",{node:r}),t):!1},get_buffer:function(){return{mode:n,node:i,inst:s}},can_paste:function(){return n!==!1&&i!==!1},paste:function(e,r){return e=this.get_node(e),e&&n&&n.match(/^(copy_node|move_node)$/)&&i?(this[n](i,e,r)&&this.trigger("paste",{parent:e.id,node:i,mode:n}),i=!1,n=!1,s=!1,t):!1},edit:function(r,i){if(r=this._open_to(r),!r||!r.length)return!1;var n=this._data.core.rtl,s=this.element.width(),a=r.children(".jstree-anchor"),o=e(""),d="string"==typeof i?i:this.get_text(r),l=e("
",{css:{position:"absolute",top:"-200px",left:n?"0px":"-1000px",visibility:"hidden"}}).appendTo("body"),c=e("",{value:d,"class":"jstree-rename-input",css:{padding:"0",border:"1px solid silver","box-sizing":"border-box",display:"inline-block",height:this._data.core.li_height+"px",lineHeight:this._data.core.li_height+"px",width:"150px"},blur:e.proxy(function(){var e=o.children(".jstree-rename-input"),t=e.val();""===t&&(t=d),l.remove(),o.replaceWith(a),o.remove(),this.set_text(r,d),this.rename_node(r,t)===!1&&this.set_text(r,d)},this),keydown:function(e){var t=e.which;27===t&&(this.value=d),(27===t||13===t||37===t||38===t||39===t||40===t||32===t)&&e.stopImmediatePropagation(),(27===t||13===t)&&(e.preventDefault(),this.blur())},click:function(e){e.stopImmediatePropagation()},mousedown:function(e){e.stopImmediatePropagation()},keyup:function(e){c.width(Math.min(l.text("pW"+this.value).width(),s))},keypress:function(e){return 13===e.which?!1:t}}),h={fontFamily:a.css("fontFamily")||"",fontSize:a.css("fontSize")||"",fontWeight:a.css("fontWeight")||"",fontStyle:a.css("fontStyle")||"",fontStretch:a.css("fontStretch")||"",fontVariant:a.css("fontVariant")||"",letterSpacing:a.css("letterSpacing")||"",wordSpacing:a.css("wordSpacing")||""};this.set_text(r,""),o.attr("class",a.attr("class")).append(a.contents().clone()).append(c),a.replaceWith(o),l.css(h),c.css(h).width(Math.min(l.text("pW"+c[0].value).width(),s))[0].select()},set_theme:function(t,r){if(!t)return!1;if(r===!0){var i=this.settings.core.themes.dir;i||(i=e.jstree.path+"/themes"),r=i+"/"+t+"/style.css"}r&&-1===e.inArray(r,a)&&(e("head").append(''),a.push(r)),this._data.core.themes.name&&this.element.removeClass("jstree-"+this._data.core.themes.name),this._data.core.themes.name=t,this.element.addClass("jstree-"+t),this.element[this.settings.core.themes.responsive?"addClass":"removeClass"]("jstree-"+t+"-responsive"),this.trigger("set_theme",{theme:t})},get_theme:function(){return this._data.core.themes.name},set_theme_variant:function(e){this._data.core.themes.variant&&this.element.removeClass("jstree-"+this._data.core.themes.name+"-"+this._data.core.themes.variant),this._data.core.themes.variant=e,e&&this.element.addClass("jstree-"+this._data.core.themes.name+"-"+this._data.core.themes.variant)},get_theme_variant:function(){return this._data.core.themes.variant},show_stripes:function(){this._data.core.themes.stripes=!0,this.get_container_ul().addClass("jstree-striped")},hide_stripes:function(){this._data.core.themes.stripes=!1,this.get_container_ul().removeClass("jstree-striped")},toggle_stripes:function(){this._data.core.themes.stripes?this.hide_stripes():this.show_stripes()},show_dots:function(){this._data.core.themes.dots=!0,this.get_container_ul().removeClass("jstree-no-dots")},hide_dots:function(){this._data.core.themes.dots=!1,this.get_container_ul().addClass("jstree-no-dots")},toggle_dots:function(){this._data.core.themes.dots?this.hide_dots():this.show_dots()},show_icons:function(){this._data.core.themes.icons=!0,this.get_container_ul().removeClass("jstree-no-icons")},hide_icons:function(){this._data.core.themes.icons=!1,this.get_container_ul().addClass("jstree-no-icons")},toggle_icons:function(){this._data.core.themes.icons?this.hide_icons():this.show_icons()},set_icon:function(t,r){var i,n,s,a;if(e.isArray(t)){for(t=t.slice(),i=0,n=t.length;n>i;i++)this.set_icon(t[i],r);return!0}return t=this.get_node(t),t&&"#"!==t.id?(a=t.icon,t.icon=r,s=this.get_node(t,!0).children(".jstree-anchor").children(".jstree-themeicon"),r===!1?this.hide_icon(t):r===!0?s.removeClass("jstree-themeicon-custom "+a).css("background","").removeAttr("rel"):-1===r.indexOf("/")&&-1===r.indexOf(".")?(s.removeClass(a).css("background",""),s.addClass(r+" jstree-themeicon-custom").attr("rel",r)):(s.removeClass(a).css("background",""),s.addClass("jstree-themeicon-custom").css("background","url('"+r+"') center center no-repeat").attr("rel",r)),!0):!1},get_icon:function(e){return e=this.get_node(e),e&&"#"!==e.id?e.icon:!1},hide_icon:function(t){var r,i;if(e.isArray(t)){for(t=t.slice(),r=0,i=t.length;i>r;r++)this.hide_icon(t[r]);return!0}return t=this.get_node(t),t&&"#"!==t?(t.icon=!1,this.get_node(t,!0).children("a").children(".jstree-themeicon").addClass("jstree-themeicon-hidden"),!0):!1},show_icon:function(t){var r,i,n;if(e.isArray(t)){for(t=t.slice(),r=0,i=t.length;i>r;r++)this.show_icon(t[r]);return!0}return t=this.get_node(t),t&&"#"!==t?(n=this.get_node(t,!0),t.icon=n.length?n.children("a").children(".jstree-themeicon").attr("rel"):!0,t.icon||(t.icon=!0),n.children("a").children(".jstree-themeicon").removeClass("jstree-themeicon-hidden"),!0):!1}},e.vakata={},e.fn.vakata_reverse=[].reverse,e.vakata.attributes=function(t,r){t=e(t)[0];var i=r?{}:[];return t&&t.attributes&&e.each(t.attributes,function(t,n){-1===e.inArray(n.nodeName.toLowerCase(),["style","contenteditable","hasfocus","tabindex"])&&null!==n.nodeValue&&""!==e.trim(n.nodeValue)&&(r?i[n.nodeName]=n.nodeValue:i.push(n.nodeName))}),i},e.vakata.array_unique=function(e){var t=[],r,i,n;for(r=0,n=e.length;n>r;r++){for(i=0;r>=i;i++)if(e[r]===e[i])break;i===r&&t.push(e[r])}return t},e.vakata.array_remove=function(e,t,r){var i=e.slice((r||t)+1||e.length);return e.length=0>t?e.length+t:t,e.push.apply(e,i),e},e.vakata.array_remove_item=function(t,r){var i=e.inArray(r,t);return-1!==i?e.vakata.array_remove(t,i):t},function(){var t={},r=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||0>e.indexOf("compatible")&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},i=r(window.navigator.userAgent);i.browser&&(t[i.browser]=!0,t.version=i.version),t.chrome?t.webkit=!0:t.webkit&&(t.safari=!0),e.vakata.browser=t}(),e.vakata.browser.msie&&8>e.vakata.browser.version&&(e.jstree.defaults.core.animation=0);var _=document.createElement("I");_.className="jstree-icon jstree-checkbox",e.jstree.defaults.checkbox={visible:!0,three_state:!0,whole_node:!0,keep_selected_style:!0},e.jstree.plugins.checkbox=function(t,r){this.bind=function(){r.bind.call(this),this._data.checkbox.uto=!1,this.element.on("init.jstree",e.proxy(function(){this._data.checkbox.visible=this.settings.checkbox.visible,this.settings.checkbox.keep_selected_style||this.element.addClass("jstree-checkbox-no-clicked")},this)).on("loading.jstree",e.proxy(function(){this[this._data.checkbox.visible?"show_checkboxes":"hide_checkboxes"]()},this)),this.settings.checkbox.three_state&&this.element.on("changed.jstree move_node.jstree copy_node.jstree redraw.jstree open_node.jstree",e.proxy(function(){this._data.checkbox.uto&&clearTimeout(this._data.checkbox.uto),this._data.checkbox.uto=setTimeout(e.proxy(this._undetermined,this),50)},this)).on("model.jstree",e.proxy(function(t,r){var i=this._model.data,n=i[r.parent],s=r.nodes,a=[],o,d,l,c,h,_;if(n.state.selected){for(d=0,l=s.length;l>d;d++)i[s[d]].state.selected=!0;this._data.core.selected=this._data.core.selected.concat(s)}else for(d=0,l=s.length;l>d;d++)if(i[s[d]].state.selected){for(c=0,h=i[s[d]].children_d.length;h>c;c++)i[i[s[d]].children_d[c]].state.selected=!0;this._data.core.selected=this._data.core.selected.concat(i[s[d]].children_d)}for(d=0,l=n.children_d.length;l>d;d++)i[n.children_d[d]].children.length||a.push(i[n.children_d[d]].parent);for(a=e.vakata.array_unique(a),c=0,h=a.length;h>c;c++){n=i[a[c]];while(n&&"#"!==n.id){for(o=0,d=0,l=n.children.length;l>d;d++)o+=i[n.children[d]].state.selected;if(o!==l)break;n.state.selected=!0,this._data.core.selected.push(n.id),_=this.get_node(n,!0),_&&_.length&&_.children(".jstree-anchor").addClass("jstree-clicked"),n=this.get_node(n.parent)}}this._data.core.selected=e.vakata.array_unique(this._data.core.selected)},this)).on("select_node.jstree",e.proxy(function(t,r){var i=r.node,n=this._model.data,s=this.get_node(i.parent),a=this.get_node(i,!0),o,d,l,c;for(this._data.core.selected=e.vakata.array_unique(this._data.core.selected.concat(i.children_d)),o=0,d=i.children_d.length;d>o;o++)n[i.children_d[o]].state.selected=!0;while(s&&"#"!==s.id){for(l=0,o=0,d=s.children.length;d>o;o++)l+=n[s.children[o]].state.selected;if(l!==d)break;s.state.selected=!0,this._data.core.selected.push(s.id),c=this.get_node(s,!0),c&&c.length&&c.children(".jstree-anchor").addClass("jstree-clicked"),s=this.get_node(s.parent)}a.length&&a.find(".jstree-anchor").addClass("jstree-clicked")},this)).on("deselect_node.jstree",e.proxy(function(t,r){var i=r.node,n=this.get_node(i,!0),s,a,o;for(s=0,a=i.children_d.length;a>s;s++)this._model.data[i.children_d[s]].state.selected=!1;for(s=0,a=i.parents.length;a>s;s++)this._model.data[i.parents[s]].state.selected=!1,o=this.get_node(i.parents[s],!0),o&&o.length&&o.children(".jstree-anchor").removeClass("jstree-clicked");for(o=[],s=0,a=this._data.core.selected.length;a>s;s++)-1===e.inArray(this._data.core.selected[s],i.children_d)&&-1===e.inArray(this._data.core.selected[s],i.parents)&&o.push(this._data.core.selected[s]);this._data.core.selected=e.vakata.array_unique(o),n.length&&n.find(".jstree-anchor").removeClass("jstree-clicked")},this)).on("delete_node.jstree",e.proxy(function(e,t){var r=this.get_node(t.parent),i=this._model.data,n,s,a,o;while(r&&"#"!==r.id){for(a=0,n=0,s=r.children.length;s>n;n++)a+=i[r.children[n]].state.selected;if(a!==s)break;r.state.selected=!0,this._data.core.selected.push(r.id),o=this.get_node(r,!0),o&&o.length&&o.children(".jstree-anchor").addClass("jstree-clicked"),r=this.get_node(r.parent)}},this)).on("move_node.jstree",e.proxy(function(t,r){var i=r.is_multi,n=r.old_parent,s=this.get_node(r.parent),a=this._model.data,o,d,l,c,h;if(!i){o=this.get_node(n);while(o&&"#"!==o.id){for(d=0,l=0,c=o.children.length;c>l;l++)d+=a[o.children[l]].state.selected;if(d!==c)break;o.state.selected=!0,this._data.core.selected.push(o.id),h=this.get_node(o,!0),h&&h.length&&h.children(".jstree-anchor").addClass("jstree-clicked"),o=this.get_node(o.parent)}}o=s;while(o&&"#"!==o.id){for(d=0,l=0,c=o.children.length;c>l;l++)d+=a[o.children[l]].state.selected;if(d===c)o.state.selected||(o.state.selected=!0,this._data.core.selected.push(o.id),h=this.get_node(o,!0),h&&h.length&&h.children(".jstree-anchor").addClass("jstree-clicked"));else{if(!o.state.selected)break;o.state.selected=!1,this._data.core.selected=e.vakata.array_remove_item(this._data.core.selected,o.id),h=this.get_node(o,!0),h&&h.length&&h.children(".jstree-anchor").removeClass("jstree-clicked")}o=this.get_node(o.parent)}},this))},this._undetermined=function(){var t,r,i=this._model.data,n=this._data.core.selected,s=[],a=this;for(t=0,r=n.length;r>t;t++)i[n[t]]&&i[n[t]].parents&&(s=s.concat(i[n[t]].parents));for(this.element.find(".jstree-closed").not(":has(ul)").each(function(){var e=a.get_node(this);!e.state.loaded&&e.original&&e.original.state&&e.original.state.undetermined&&e.original.state.undetermined===!0&&(s.push(e.id),s=s.concat(e.parents))}),s=e.vakata.array_unique(s),t=e.inArray("#",s),-1!==t&&(s=e.vakata.array_remove(s,t)),this.element.find(".jstree-undetermined").removeClass("jstree-undetermined"),t=0,r=s.length;r>t;t++)i[s[t]].state.selected||(n=this.get_node(s[t],!0),n&&n.length&&n.children("a").children(".jstree-checkbox").addClass("jstree-undetermined"))},this.redraw_node=function(t,i,n){if(t=r.redraw_node.call(this,t,i,n)){var s=t.getElementsByTagName("A")[0];s.insertBefore(_.cloneNode(!1),s.childNodes[0])}return!n&&this.settings.checkbox.three_state&&(this._data.checkbox.uto&&clearTimeout(this._data.checkbox.uto),this._data.checkbox.uto=setTimeout(e.proxy(this._undetermined,this),50)),t},this.activate_node=function(t,i){return(this.settings.checkbox.whole_node||e(i.target).hasClass("jstree-checkbox"))&&(i.ctrlKey=!0),r.activate_node.call(this,t,i)},this.show_checkboxes=function(){this._data.core.themes.checkboxes=!0,this.element.children("ul").removeClass("jstree-no-checkboxes")},this.hide_checkboxes=function(){this._data.core.themes.checkboxes=!1,this.element.children("ul").addClass("jstree-no-checkboxes")},this.toggle_checkboxes=function(){this._data.core.themes.checkboxes?this.hide_checkboxes():this.show_checkboxes()}},e.jstree.defaults.contextmenu={select_node:!0,show_at_node:!0,items:function(t,r){return{create:{separator_before:!1,separator_after:!0,_disabled:!1,label:"Create",action:function(t){var r=e.jstree.reference(t.reference),i=r.get_node(t.reference);r.create_node(i,{},"last",function(e){setTimeout(function(){r.edit(e)},0)})}},rename:{separator_before:!1,separator_after:!1,_disabled:!1,label:"Rename",action:function(t){var r=e.jstree.reference(t.reference),i=r.get_node(t.reference);r.edit(i)}},remove:{separator_before:!1,icon:!1,separator_after:!1,_disabled:!1,label:"Delete",action:function(t){var r=e.jstree.reference(t.reference),i=r.get_node(t.reference);r.is_selected(i)?r.delete_node(r.get_selected()):r.delete_node(i)}},ccp:{separator_before:!0,icon:!1,separator_after:!1,label:"Edit",action:!1,submenu:{cut:{separator_before:!1,separator_after:!1,label:"Cut",action:function(t){var r=e.jstree.reference(t.reference),i=r.get_node(t.reference);r.is_selected(i)?r.cut(r.get_selected()):r.cut(i)}},copy:{separator_before:!1,icon:!1,separator_after:!1,label:"Copy",action:function(t){var r=e.jstree.reference(t.reference),i=r.get_node(t.reference);r.is_selected(i)?r.copy(r.get_selected()):r.copy(i)}},paste:{separator_before:!1,icon:!1,_disabled:function(t){return!e.jstree.reference(t.reference).can_paste()},separator_after:!1,label:"Paste",action:function(t){var r=e.jstree.reference(t.reference),i=r.get_node(t.reference);r.paste(i)}}}}}}},e.jstree.plugins.contextmenu=function(r,i){this.bind=function(){i.bind.call(this);var t=0;this.element.on("contextmenu.jstree",".jstree-anchor",e.proxy(function(e){e.preventDefault(),t=e.ctrlKey?e.timeStamp:0,this.is_loading(e.currentTarget)||this.show_contextmenu(e.currentTarget,e.pageX,e.pageY,e)},this)).on("click.jstree",".jstree-anchor",e.proxy(function(r){this._data.contextmenu.visible&&(!t||r.timeStamp-t>250)&&e.vakata.context.hide()},this)),e(document).on("context_hide.vakata",e.proxy(function(){this._data.contextmenu.visible=!1},this))},this.teardown=function(){this._data.contextmenu.visible&&e.vakata.context.hide(),i.teardown.call(this)},this.show_contextmenu=function(r,i,n,s){if(r=this.get_node(r),!r||"#"===r.id)return!1;var a=this.settings.contextmenu,o=this.get_node(r,!0),d=o.children(".jstree-anchor"),l=!1,c=!1;(a.show_at_node||i===t||n===t)&&(l=d.offset(),i=l.left,n=l.top+this._data.core.li_height),this.settings.contextmenu.select_node&&!this.is_selected(r)&&(this.deselect_all(),this.select_node(r,!1,!1,s)),c=a.items,e.isFunction(c)&&(c=c.call(this,r,e.proxy(function(e){this._show_contextmenu(r,i,n,e)},this))),e.isPlainObject(c)&&this._show_contextmenu(r,i,n,c)},this._show_contextmenu=function(t,r,i,n){var s=this.get_node(t,!0),a=s.children(".jstree-anchor");e(document).one("context_show.vakata",e.proxy(function(t,r){var i="jstree-contextmenu jstree-"+this.get_theme()+"-contextmenu";e(r.element).addClass(i)},this)),this._data.contextmenu.visible=!0,e.vakata.context.show(a,{x:r,y:i},n),this.trigger("show_contextmenu",{node:t,x:r,y:i})}},function(e){var r=!1,i={element:!1,reference:!1,position_x:0,position_y:0,items:[],html:"",is_visible:!1};e.vakata.context={settings:{hide_onmouseleave:0,icons:!0},_trigger:function(t){e(document).triggerHandler("context_"+t+".vakata",{reference:i.reference,element:i.element,position:{x:i.position_x,y:i.position_y}})},_execute:function(t){return t=i.items[t],t&&(!t._disabled||e.isFunction(t._disabled)&&!t._disabled({item:t,reference:i.reference,element:i.element}))&&t.action?t.action.call(null,{item:t,reference:i.reference,element:i.element,position:{x:i.position_x,y:i.position_y}}):!1},_parse:function(r,n){if(!r)return!1;n||(i.html="",i.items=[]);var s="",a=!1,o;return n&&(s+=""),n||(i.html=s,e.vakata.context._trigger("parse")),s.length>10?s:!1},_show_submenu:function(t){if(t=e(t),t.length&&t.children("ul").length){var i=t.children("ul"),n=t.offset().left+t.outerWidth(),s=t.offset().top,a=i.width(),o=i.height(),d=e(window).width()+e(window).scrollLeft(),l=e(window).height()+e(window).scrollTop();r?t[0>n-(a+10+t.outerWidth())?"addClass":"removeClass"]("vakata-context-left"):t[n+a+10>d?"addClass":"removeClass"]("vakata-context-right"),s+o+10>l&&i.css("bottom","-1px"),i.show()}},show:function(t,n,s){var a,o,d,l,c,h,_,u,g=!0;switch(i.element&&i.element.length&&i.element.width(""),g){case!n&&!t:return!1;case!!n&&!!t:i.reference=t,i.position_x=n.x,i.position_y=n.y;break;case!n&&!!t:i.reference=t,a=t.offset(),i.position_x=a.left+t.outerHeight(),i.position_y=a.top;break;case!!n&&!t:i.position_x=n.x,i.position_y=n.y}t&&!s&&e(t).data("vakata_contextmenu")&&(s=e(t).data("vakata_contextmenu")),e.vakata.context._parse(s)&&i.element.html(i.html),i.items.length&&(o=i.element,d=i.position_x,l=i.position_y,c=o.width(),h=o.height(),_=e(window).width()+e(window).scrollLeft(),u=e(window).height()+e(window).scrollTop(),r&&(d-=o.outerWidth(),e(window).scrollLeft()+20>d&&(d=e(window).scrollLeft()+20)),d+c+20>_&&(d=_-(c+20)),l+h+20>u&&(l=u-(h+20)),i.element.css({left:d,top:l}).show().find("a:eq(0)").focus().parent().addClass("vakata-context-hover"),i.is_visible=!0,e.vakata.context._trigger("show")) 4 | },hide:function(){i.is_visible&&(i.element.hide().find("ul").hide().end().find(":focus").blur(),i.is_visible=!1,e.vakata.context._trigger("hide"))}},e(function(){r="rtl"===e("body").css("direction");var t=!1;i.element=e("
    "),i.element.on("mouseenter","li",function(r){r.stopImmediatePropagation(),e.contains(this,r.relatedTarget)||(t&&clearTimeout(t),i.element.find(".vakata-context-hover").removeClass("vakata-context-hover").end(),e(this).siblings().find("ul").hide().end().end().parentsUntil(".vakata-context","li").addBack().addClass("vakata-context-hover"),e.vakata.context._show_submenu(this))}).on("mouseleave","li",function(t){e.contains(this,t.relatedTarget)||e(this).find(".vakata-context-hover").addBack().removeClass("vakata-context-hover")}).on("mouseleave",function(r){e(this).find(".vakata-context-hover").removeClass("vakata-context-hover"),e.vakata.context.settings.hide_onmouseleave&&(t=setTimeout(function(t){return function(){e.vakata.context.hide()}}(this),e.vakata.context.settings.hide_onmouseleave))}).on("click","a",function(e){e.preventDefault()}).on("mouseup","a",function(t){e(this).blur().parent().hasClass("vakata-context-disabled")||e.vakata.context._execute(e(this).attr("rel"))===!1||e.vakata.context.hide()}).on("keydown","a",function(t){var r=null;switch(t.which){case 13:case 32:t.type="mouseup",t.preventDefault(),e(t.currentTarget).trigger(t);break;case 37:i.is_visible&&(i.element.find(".vakata-context-hover").last().parents("li:eq(0)").find("ul").hide().find(".vakata-context-hover").removeClass("vakata-context-hover").end().end().children("a").focus(),t.stopImmediatePropagation(),t.preventDefault());break;case 38:i.is_visible&&(r=i.element.find("ul:visible").addBack().last().children(".vakata-context-hover").removeClass("vakata-context-hover").prevAll("li:not(.vakata-context-separator)").first(),r.length||(r=i.element.find("ul:visible").addBack().last().children("li:not(.vakata-context-separator)").last()),r.addClass("vakata-context-hover").children("a").focus(),t.stopImmediatePropagation(),t.preventDefault());break;case 39:i.is_visible&&(i.element.find(".vakata-context-hover").last().children("ul").show().children("li:not(.vakata-context-separator)").removeClass("vakata-context-hover").first().addClass("vakata-context-hover").children("a").focus(),t.stopImmediatePropagation(),t.preventDefault());break;case 40:i.is_visible&&(r=i.element.find("ul:visible").addBack().last().children(".vakata-context-hover").removeClass("vakata-context-hover").nextAll("li:not(.vakata-context-separator)").first(),r.length||(r=i.element.find("ul:visible").addBack().last().children("li:not(.vakata-context-separator)").first()),r.addClass("vakata-context-hover").children("a").focus(),t.stopImmediatePropagation(),t.preventDefault());break;case 27:e.vakata.context.hide(),t.preventDefault();break;default:}}).on("keydown",function(e){e.preventDefault();var t=i.element.find(".vakata-contextmenu-shortcut-"+e.which).parent();t.parent().not(".vakata-context-disabled")&&t.mouseup()}).appendTo("body"),e(document).on("mousedown",function(t){i.is_visible&&!e.contains(i.element[0],t.target)&&e.vakata.context.hide()}).on("context_show.vakata",function(e,t){i.element.find("li:has(ul)").children("a").addClass("vakata-context-parent"),r&&i.element.addClass("vakata-context-rtl").css("direction","rtl"),i.element.find("ul").hide().end()})})}(e),e.jstree.defaults.dnd={copy:!0,open_timeout:500,is_draggable:!0,check_while_dragging:!0},e.jstree.plugins.dnd=function(r,i){this.bind=function(){i.bind.call(this),this.element.on("mousedown.jstree touchstart.jstree",".jstree-anchor",e.proxy(function(r){var i=this.get_node(r.target),n=this.is_selected(i)?this.get_selected().length:1;return i&&i.id&&"#"!==i.id&&(1===r.which||"touchstart"===r.type)&&(this.settings.dnd.is_draggable===!0||e.isFunction(this.settings.dnd.is_draggable)&&this.settings.dnd.is_draggable.call(this,n>1?this.get_selected(!0):[i]))?(this.element.trigger("mousedown.jstree"),e.vakata.dnd.start(r,{jstree:!0,origin:this,obj:this.get_node(i,!0),nodes:n>1?this.get_selected():[i.id]},'
    '+(n>1?n+" "+this.get_string("nodes"):this.get_text(r.currentTarget,!0))+'
    ')):t},this))}},e(function(){var r=!1,i=!1,n=!1,s=e('
     
    ').hide().appendTo("body");e(document).bind("dnd_start.vakata",function(e,t){r=!1}).bind("dnd_move.vakata",function(a,o){if(n&&clearTimeout(n),o.data.jstree&&(!o.event.target.id||"jstree-marker"!==o.event.target.id)){var d=e.jstree.reference(o.event.target),l=!1,c=!1,h=!1,_,u,g,f,p,m,v,y,j,x,k,b;if(d&&d._data&&d._data.dnd)if(s.attr("class","jstree-"+d.get_theme()),o.helper.children().attr("class","jstree-"+d.get_theme()).find(".jstree-copy:eq(0)")[o.data.origin&&o.data.origin.settings.dnd.copy&&(o.event.metaKey||o.event.ctrlKey)?"show":"hide"](),o.event.target!==d.element[0]&&o.event.target!==d.get_container_ul()[0]||0!==d.get_container_ul().children().length){if(l=e(o.event.target).closest("a"),l&&l.length&&l.parent().is(".jstree-closed, .jstree-open, .jstree-leaf")&&(c=l.offset(),h=o.event.pageY-c.top,g=l.height(),m=g/3>h?["b","i","a"]:h>g-g/3?["a","i","b"]:h>g/2?["i","a","b"]:["i","b","a"],e.each(m,function(a,h){switch(h){case"b":_=c.left-6,u=c.top-5,f=d.get_parent(l),p=l.parent().index();break;case"i":_=c.left-2,u=c.top-5+g/2+1,f=d.get_node(l.parent()).id,p=0;break;case"a":_=c.left-6,u=c.top-5+g,f=d.get_parent(l),p=l.parent().index()+1}for(v=!0,y=0,j=o.data.nodes.length;j>y;y++)if(x=o.data.origin&&o.data.origin.settings.dnd.copy&&(o.event.metaKey||o.event.ctrlKey)?"copy_node":"move_node",k=p,"move_node"===x&&"a"===h&&o.data.origin&&o.data.origin===d&&f===d.get_parent(o.data.nodes[y])&&(b=d.get_node(f),k>e.inArray(o.data.nodes[y],b.children)&&(k-=1)),v=v&&(d&&d.settings&&d.settings.dnd&&d.settings.dnd.check_while_dragging===!1||d.check(x,o.data.origin&&o.data.origin!==d?o.data.origin.get_node(o.data.nodes[y]):o.data.nodes[y],f,k,{dnd:!0,ref:d.get_node(l.parent()),pos:h})),!v){d&&d.last_error&&(i=d.last_error());break}return v?("i"===h&&l.parent().is(".jstree-closed")&&d.settings.dnd.open_timeout&&(n=setTimeout(function(e,t){return function(){e.open_node(t)}}(d,l),d.settings.dnd.open_timeout)),r={ins:d,par:f,pos:p},s.css({left:_+"px",top:u+"px"}).show(),o.helper.find(".jstree-icon:eq(0)").removeClass("jstree-er").addClass("jstree-ok"),i={},m=!0,!1):t}),m===!0))return}else{for(v=!0,y=0,j=o.data.nodes.length;j>y;y++)if(v=v&&d.check(o.data.origin&&o.data.origin.settings.dnd.copy&&(o.event.metaKey||o.event.ctrlKey)?"copy_node":"move_node",o.data.origin&&o.data.origin!==d?o.data.origin.get_node(o.data.nodes[y]):o.data.nodes[y],"#","last"),!v)break;if(v)return r={ins:d,par:"#",pos:"last"},s.hide(),o.helper.find(".jstree-icon:eq(0)").removeClass("jstree-er").addClass("jstree-ok"),t}r=!1,o.helper.find(".jstree-icon").removeClass("jstree-ok").addClass("jstree-er"),s.hide()}}).bind("dnd_scroll.vakata",function(e,t){t.data.jstree&&(s.hide(),r=!1,t.helper.find(".jstree-icon:eq(0)").removeClass("jstree-ok").addClass("jstree-er"))}).bind("dnd_stop.vakata",function(t,a){if(n&&clearTimeout(n),a.data.jstree){s.hide();var o,d,l=[];if(r){for(o=0,d=a.data.nodes.length;d>o;o++)l[o]=a.data.origin?a.data.origin.get_node(a.data.nodes[o]):a.data.nodes[o];r.ins[a.data.origin&&a.data.origin.settings.dnd.copy&&(a.event.metaKey||a.event.ctrlKey)?"copy_node":"move_node"](l,r.par,r.pos)}else o=e(a.event.target).closest(".jstree"),o.length&&i&&i.error&&"check"===i.error&&(o=o.jstree(!0),o&&o.settings.core.error.call(this,i))}}).bind("keyup keydown",function(t,r){r=e.vakata.dnd._get(),r.data&&r.data.jstree&&r.helper.find(".jstree-copy:eq(0)")[r.data.origin&&r.data.origin.settings.dnd.copy&&(t.metaKey||t.ctrlKey)?"show":"hide"]()})}),function(e){var r={element:!1,is_down:!1,is_drag:!1,helper:!1,helper_w:0,data:!1,init_x:0,init_y:0,scroll_l:0,scroll_t:0,scroll_e:!1,scroll_i:!1};e.vakata.dnd={settings:{scroll_speed:10,scroll_proximity:20,helper_left:5,helper_top:10,threshold:5},_trigger:function(t,r){var i=e.vakata.dnd._get();i.event=r,e(document).triggerHandler("dnd_"+t+".vakata",i)},_get:function(){return{data:r.data,element:r.element,helper:r.helper}},_clean:function(){r.helper&&r.helper.remove(),r.scroll_i&&(clearInterval(r.scroll_i),r.scroll_i=!1),r={element:!1,is_down:!1,is_drag:!1,helper:!1,helper_w:0,data:!1,init_x:0,init_y:0,scroll_l:0,scroll_t:0,scroll_e:!1,scroll_i:!1},e(document).off("mousemove touchmove",e.vakata.dnd.drag),e(document).off("mouseup touchend",e.vakata.dnd.stop)},_scroll:function(t){if(!r.scroll_e||!r.scroll_l&&!r.scroll_t)return r.scroll_i&&(clearInterval(r.scroll_i),r.scroll_i=!1),!1;if(!r.scroll_i)return r.scroll_i=setInterval(e.vakata.dnd._scroll,100),!1;if(t===!0)return!1;var i=r.scroll_e.scrollTop(),n=r.scroll_e.scrollLeft();r.scroll_e.scrollTop(i+r.scroll_t*e.vakata.dnd.settings.scroll_speed),r.scroll_e.scrollLeft(n+r.scroll_l*e.vakata.dnd.settings.scroll_speed),(i!==r.scroll_e.scrollTop()||n!==r.scroll_e.scrollLeft())&&e.vakata.dnd._trigger("scroll",r.scroll_e)},start:function(t,i,n){"touchstart"===t.type&&t.originalEvent&&t.originalEvent.changedTouches&&t.originalEvent.changedTouches[0]&&(t.pageX=t.originalEvent.changedTouches[0].pageX,t.pageY=t.originalEvent.changedTouches[0].pageY,t.target=document.elementFromPoint(t.originalEvent.changedTouches[0].pageX-window.pageXOffset,t.originalEvent.changedTouches[0].pageY-window.pageYOffset)),r.is_drag&&e.vakata.dnd.stop({});try{t.currentTarget.unselectable="on",t.currentTarget.onselectstart=function(){return!1},t.currentTarget.style&&(t.currentTarget.style.MozUserSelect="none")}catch(s){}return r.init_x=t.pageX,r.init_y=t.pageY,r.data=i,r.is_down=!0,r.element=t.currentTarget,n!==!1&&(r.helper=e("
    ").html(n).css({display:"block",margin:"0",padding:"0",position:"absolute",top:"-2000px",lineHeight:"16px",zIndex:"10000"})),e(document).bind("mousemove touchmove",e.vakata.dnd.drag),e(document).bind("mouseup touchend",e.vakata.dnd.stop),!1},drag:function(i){if("touchmove"===i.type&&i.originalEvent&&i.originalEvent.changedTouches&&i.originalEvent.changedTouches[0]&&(i.pageX=i.originalEvent.changedTouches[0].pageX,i.pageY=i.originalEvent.changedTouches[0].pageY,i.target=document.elementFromPoint(i.originalEvent.changedTouches[0].pageX-window.pageXOffset,i.originalEvent.changedTouches[0].pageY-window.pageYOffset)),r.is_down){if(!r.is_drag){if(!(Math.abs(i.pageX-r.init_x)>e.vakata.dnd.settings.threshold||Math.abs(i.pageY-r.init_y)>e.vakata.dnd.settings.threshold))return;r.helper&&(r.helper.appendTo("body"),r.helper_w=r.helper.outerWidth()),r.is_drag=!0,e.vakata.dnd._trigger("start",i)}var n=!1,s=!1,a=!1,o=!1,d=!1,l=!1,c=!1,h=!1,_=!1,u=!1;r.scroll_t=0,r.scroll_l=0,r.scroll_e=!1,e(e(i.target).parentsUntil("body").addBack().get().reverse()).filter(function(){return/^auto|scroll$/.test(e(this).css("overflow"))&&(this.scrollHeight>this.offsetHeight||this.scrollWidth>this.offsetWidth)}).each(function(){var n=e(this),s=n.offset();return this.scrollHeight>this.offsetHeight&&(s.top+n.height()-i.pageYthis.offsetWidth&&(s.left+n.width()-i.pageXo&&i.pageY-co&&o-(i.pageY-c)l&&i.pageX-hl&&l-(i.pageX-h)a&&(_=a-50),d&&u+r.helper_w>d&&(u=d-(r.helper_w+2)),r.helper.css({left:u+"px",top:_+"px"})),e.vakata.dnd._trigger("move",i)}},stop:function(t){"touchend"===t.type&&t.originalEvent&&t.originalEvent.changedTouches&&t.originalEvent.changedTouches[0]&&(t.pageX=t.originalEvent.changedTouches[0].pageX,t.pageY=t.originalEvent.changedTouches[0].pageY,t.target=document.elementFromPoint(t.originalEvent.changedTouches[0].pageX-window.pageXOffset,t.originalEvent.changedTouches[0].pageY-window.pageYOffset)),r.is_drag&&e.vakata.dnd._trigger("stop",t),e.vakata.dnd._clean()}}}(jQuery),e.jstree.defaults.search={ajax:!1,fuzzy:!0,case_sensitive:!1,show_only_matches:!1,close_opened_onclear:!0},e.jstree.plugins.search=function(t,r){this.bind=function(){r.bind.call(this),this._data.search.str="",this._data.search.dom=e(),this._data.search.res=[],this._data.search.opn=[],this._data.search.sln=null,this.element.on("before_open.jstree",e.proxy(function(t,r){var i,n,s,a=this._data.search.res,o=[],d=e();if(a&&a.length){for(this._data.search.dom=e(),i=0,n=a.length;n>i;i++)o=o.concat(this.get_node(a[i]).parents),s=this.get_node(a[i],!0),s&&(this._data.search.dom=this._data.search.dom.add(s));for(o=e.vakata.array_unique(o),i=0,n=o.length;n>i;i++)"#"!==o[i]&&(s=this.get_node(o[i],!0),s&&(d=d.add(s)));this._data.search.dom.children(".jstree-anchor").addClass("jstree-search"),this.settings.search.show_only_matches&&this._data.search.res.length&&(this.element.find("li").hide().filter(".jstree-last").filter(function(){return this.nextSibling}).removeClass("jstree-last"),d=d.add(this._data.search.dom),d.parentsUntil(".jstree").addBack().show().filter("ul").each(function(){e(this).children("li:visible").eq(-1).addClass("jstree-last")}))}},this)),this.settings.search.show_only_matches&&this.element.on("search.jstree",function(t,r){r.nodes.length&&(e(this).find("li").hide().filter(".jstree-last").filter(function(){return this.nextSibling}).removeClass("jstree-last"),r.nodes.parentsUntil(".jstree").addBack().show().filter("ul").each(function(){e(this).children("li:visible").eq(-1).addClass("jstree-last")}))}).on("clear_search.jstree",function(t,r){r.nodes.length&&e(this).find("li").css("display","").filter(".jstree-last").filter(function(){return this.nextSibling}).removeClass("jstree-last")})},this.search=function(t,r){if(t===!1||""===e.trim(t))return this.clear_search();var i=this.settings.search,n=i.ajax?e.extend({},i.ajax):!1,s=null,a=[],o=[],d,l;if(this._data.search.res.length&&this.clear_search(),!r&&n!==!1)return n.data||(n.data={}),n.data.str=t,e.ajax(n).fail(e.proxy(function(){this._data.core.last_error={error:"ajax",plugin:"search",id:"search_01",reason:"Could not load search parents",data:JSON.stringify(n)},this.settings.core.error.call(this,this._data.core.last_error)},this)).done(e.proxy(function(r){r&&r.d&&(r=r.d),this._data.search.sln=e.isArray(r)?r:[],this._search_load(t)},this));if(this._data.search.str=t,this._data.search.dom=e(),this._data.search.res=[],this._data.search.opn=[],s=new e.vakata.search(t,!0,{caseSensitive:i.case_sensitive,fuzzy:i.fuzzy}),e.each(this._model.data,function(e,t){t.text&&s.search(t.text).isMatch&&(a.push(e),o=o.concat(t.parents))}),a.length){for(o=e.vakata.array_unique(o),this._search_open(o),d=0,l=a.length;l>d;d++)s=this.get_node(a[d],!0),s&&(this._data.search.dom=this._data.search.dom.add(s));this._data.search.res=a,this._data.search.dom.children(".jstree-anchor").addClass("jstree-search")}this.trigger("search",{nodes:this._data.search.dom,str:t,res:this._data.search.res})},this.clear_search=function(){this._data.search.dom.children(".jstree-anchor").removeClass("jstree-search"),this.settings.search.close_opened_onclear&&this.close_node(this._data.search.opn,0),this.trigger("clear_search",{nodes:this._data.search.dom,str:this._data.search.str,res:this._data.search.res}),this._data.search.str="",this._data.search.res=[],this._data.search.opn=[],this._data.search.dom=e()},this._search_open=function(t){var r=this;e.each(t.concat([]),function(i,n){if("#"===n)return!0;try{n=e("#"+n.replace(e.jstree.idregex,"\\$&"),r.element)}catch(s){}n&&n.length&&r.is_closed(n)&&(r._data.search.opn.push(n[0].id),r.open_node(n,function(){r._search_open(t)},0))})},this._search_load=function(t){var r=!0,i=this,n=i._model.data;e.isArray(this._data.search.sln)&&(this._data.search.sln.length?(e.each(this._data.search.sln,function(s,a){n[a]&&(n[a].state.loaded||(i.is_loading(a)||i.load_node(a,function(r,n){e.vakata.array_remove_item(i._data.search.sln,a),i._search_load(t)}),r=!1))}),r&&(this._data.search.sln=[],this._search_load(t))):(this._data.search.sln=null,this.search(t,!0)))}},function(e){e.vakata.search=function(e,t,r){r=r||{},r.fuzzy!==!1&&(r.fuzzy=!0),e=r.caseSensitive?e:e.toLowerCase();var i=r.location||0,n=r.distance||100,s=r.threshold||.6,a=e.length,o,d,l,c;return a>32&&(r.fuzzy=!1),r.fuzzy&&(o=1<r;r++)t[e.charAt(r)]=0;for(r=0;a>r;r++)t[e.charAt(r)]|=1<n;n++){g=0,f=p;while(f>g)_>=l(n,i+f)?g=f:p=f,f=Math.floor((p-g)/2+g);for(p=f,v=Math.max(1,i-f+1),y=Math.min(i+f,h)+a,j=Array(y+2),j[y+1]=(1<=v;c--)if(x=d[t.charAt(c-1)],j[c]=0===n?(1|j[c+1]<<1)&x:(1|j[c+1]<<1)&x|(1|(m[c+1]|m[c])<<1)|m[c+1],j[c]&o&&(k=l(n,c-1),_>=k)){if(_=k,u=c-1,b.push(u),!(u>i))break;v=Math.max(1,2*i-u)}if(l(n+1,i)>_)break;m=j}return{isMatch:u>=0,score:k}},t===!0?{search:c}:c(t)}}(jQuery),e.jstree.defaults.sort=function(e,t){return this.get_text(e)>this.get_text(t)?1:-1},e.jstree.plugins.sort=function(t,r){this.bind=function(){r.bind.call(this),this.element.on("model.jstree",e.proxy(function(e,t){this.sort(t.parent,!0)},this)).on("rename_node.jstree create_node.jstree",e.proxy(function(e,t){this.sort(t.parent||t.node.parent,!1),this.redraw_node(t.parent||t.node.parent,!0)},this)).on("move_node.jstree copy_node.jstree",e.proxy(function(e,t){this.sort(t.parent,!1),this.redraw_node(t.parent,!0)},this))},this.sort=function(t,r){var i,n;if(t=this.get_node(t),t&&t.children&&t.children.length&&(t.children.sort(e.proxy(this.settings.sort,this)),r))for(i=0,n=t.children_d.length;n>i;i++)this.sort(t.children_d[i],!1)}};var u=!1;e.jstree.defaults.state={key:"jstree",events:"changed.jstree open_node.jstree close_node.jstree",ttl:!1,filter:!1},e.jstree.plugins.state=function(t,r){this.bind=function(){r.bind.call(this);var t=e.proxy(function(){this.element.on(this.settings.state.events,e.proxy(function(){u&&clearTimeout(u),u=setTimeout(e.proxy(function(){this.save_state()},this),100)},this))},this);this.element.on("ready.jstree",e.proxy(function(e,r){this.element.one("restore_state.jstree",t),this.restore_state()||t()},this))},this.save_state=function(){var t={state:this.get_state(),ttl:this.settings.state.ttl,sec:+new Date};e.vakata.storage.set(this.settings.state.key,JSON.stringify(t))},this.restore_state=function(){var t=e.vakata.storage.get(this.settings.state.key);if(t)try{t=JSON.parse(t)}catch(r){return!1}return t&&t.ttl&&t.sec&&+new Date-t.sec>t.ttl?!1:(t&&t.state&&(t=t.state),t&&e.isFunction(this.settings.state.filter)&&(t=this.settings.state.filter.call(this,t)),t?(this.element.one("set_state.jstree",function(r,i){i.instance.trigger("restore_state",{state:e.extend(!0,{},t)})}),this.set_state(t),!0):!1)},this.clear_state=function(){return e.vakata.storage.del(this.settings.state.key)}},function(e,t){e.vakata.storage={set:function(e,t){return window.localStorage.setItem(e,t)},get:function(e){return window.localStorage.getItem(e)},del:function(e){return window.localStorage.removeItem(e)}}}(jQuery),e.jstree.defaults.types={"#":{},"default":{}},e.jstree.plugins.types=function(r,i){this.init=function(e,r){var n,s;if(r&&r.types&&r.types["default"])for(n in r.types)if("default"!==n&&"#"!==n&&r.types.hasOwnProperty(n))for(s in r.types["default"])r.types["default"].hasOwnProperty(s)&&r.types[n][s]===t&&(r.types[n][s]=r.types["default"][s]);i.init.call(this,e,r),this._model.data["#"].type="#"},this.refresh=function(e){i.refresh.call(this,e),this._model.data["#"].type="#"},this.bind=function(){this.element.on("model.jstree",e.proxy(function(e,r){var i=this._model.data,n=r.nodes,s=this.settings.types,a,o,d="default";for(a=0,o=n.length;o>a;a++)d="default",i[n[a]].original&&i[n[a]].original.type&&s[i[n[a]].original.type]&&(d=i[n[a]].original.type),i[n[a]].data&&i[n[a]].data.jstree&&i[n[a]].data.jstree.type&&s[i[n[a]].data.jstree.type]&&(d=i[n[a]].data.jstree.type),i[n[a]].type=d,i[n[a]].icon===!0&&s[d].icon!==t&&(i[n[a]].icon=s[d].icon)},this)),i.bind.call(this)},this.get_json=function(t,r,n){var s,a,o=this._model.data,d=r?e.extend(!0,{},r,{no_id:!1}):{},l=i.get_json.call(this,t,d,n);if(l===!1)return!1;if(e.isArray(l))for(s=0,a=l.length;a>s;s++)l[s].type=l[s].id&&o[l[s].id]&&o[l[s].id].type?o[l[s].id].type:"default",r&&r.no_id&&(delete l[s].id,l[s].li_attr&&l[s].li_attr.id&&delete l[s].li_attr.id);else l.type=l.id&&o[l.id]&&o[l.id].type?o[l.id].type:"default",r&&r.no_id&&(l=this._delete_ids(l));return l},this._delete_ids=function(t){if(e.isArray(t)){for(var r=0,i=t.length;i>r;r++)t[r]=this._delete_ids(t[r]);return t}return delete t.id,t.li_attr&&t.li_attr.id&&delete t.li_attr.id,t.children&&e.isArray(t.children)&&(t.children=this._delete_ids(t.children)),t},this.check=function(r,n,s,a,o){if(i.check.call(this,r,n,s,a,o)===!1)return!1;n=n&&n.id?n:this.get_node(n),s=s&&s.id?s:this.get_node(s);var d=n&&n.id?e.jstree.reference(n.id):null,l,c,h,_;switch(d=d&&d._model&&d._model.data?d._model.data:null,r){case"create_node":case"move_node":case"copy_node":if("move_node"!==r||-1===e.inArray(n.id,s.children)){if(l=this.get_rules(s),l.max_children!==t&&-1!==l.max_children&&l.max_children===s.children.length)return this._data.core.last_error={error:"check",plugin:"types",id:"types_01",reason:"max_children prevents function: "+r,data:JSON.stringify({chk:r,pos:a,obj:n&&n.id?n.id:!1,par:s&&s.id?s.id:!1})},!1;if(l.valid_children!==t&&-1!==l.valid_children&&-1===e.inArray(n.type,l.valid_children))return this._data.core.last_error={error:"check",plugin:"types",id:"types_02",reason:"valid_children prevents function: "+r,data:JSON.stringify({chk:r,pos:a,obj:n&&n.id?n.id:!1,par:s&&s.id?s.id:!1})},!1;if(d&&n.children_d&&n.parents){for(c=0,h=0,_=n.children_d.length;_>h;h++)c=Math.max(c,d[n.children_d[h]].parents.length);c=c-n.parents.length+1}(0>=c||c===t)&&(c=1);do{if(l.max_depth!==t&&-1!==l.max_depth&&c>l.max_depth)return this._data.core.last_error={error:"check",plugin:"types",id:"types_03",reason:"max_depth prevents function: "+r,data:JSON.stringify({chk:r,pos:a,obj:n&&n.id?n.id:!1,par:s&&s.id?s.id:!1})},!1;s=this.get_node(s.parent),l=this.get_rules(s),c++}while(s)}}return!0},this.get_rules=function(e){if(e=this.get_node(e),!e)return!1;var r=this.get_type(e,!0);return r.max_depth===t&&(r.max_depth=-1),r.max_children===t&&(r.max_children=-1),r.valid_children===t&&(r.valid_children=-1),r},this.get_type=function(t,r){return t=this.get_node(t),t?r?e.extend({type:t.type},this.settings.types[t.type]):t.type:!1},this.set_type=function(r,i){var n,s,a,o,d;if(e.isArray(r)){for(r=r.slice(),s=0,a=r.length;a>s;s++)this.set_type(r[s],i);return!0}return n=this.settings.types,r=this.get_node(r),n[i]&&r?(o=r.type,d=this.get_icon(r),r.type=i,(d===!0||n[o]&&n[o].icon&&d===n[o].icon)&&this.set_icon(r,n[i].icon!==t?n[i].icon:!0),!0):!1}},e.jstree.plugins.unique=function(t,r){this.check=function(t,i,n,s,a){if(r.check.call(this,t,i,n,s,a)===!1)return!1;if(i=i&&i.id?i:this.get_node(i),n=n&&n.id?n:this.get_node(n),!n||!n.children)return!0;var o="rename_node"===t?s:i.text,d=[],l=this._model.data,c,h;for(c=0,h=n.children.length;h>c;c++)d.push(l[n.children[c]].text);switch(t){case"delete_node":return!0;case"rename_node":case"copy_node":return c=-1===e.inArray(o,d),c||(this._data.core.last_error={error:"check",plugin:"unique",id:"unique_01",reason:"Child with name "+o+" already exists. Preventing: "+t,data:JSON.stringify({chk:t,pos:s,obj:i&&i.id?i.id:!1,par:n&&n.id?n.id:!1})}),c;case"move_node":return c=i.parent===n.id||-1===e.inArray(o,d),c||(this._data.core.last_error={error:"check",plugin:"unique",id:"unique_01",reason:"Child with name "+o+" already exists. Preventing: "+t,data:JSON.stringify({chk:t,pos:s,obj:i&&i.id?i.id:!1,par:n&&n.id?n.id:!1})}),c}return!0}};var g=document.createElement("DIV");g.setAttribute("unselectable","on"),g.className="jstree-wholerow",g.innerHTML=" ",e.jstree.plugins.wholerow=function(t,r){this.bind=function(){r.bind.call(this),this.element.on("loading",e.proxy(function(){g.style.height=this._data.core.li_height+"px"},this)).on("ready.jstree set_state.jstree",e.proxy(function(){this.hide_dots()},this)).on("ready.jstree",e.proxy(function(){this.get_container_ul().addClass("jstree-wholerow-ul")},this)).on("deselect_all.jstree",e.proxy(function(e,t){this.element.find(".jstree-wholerow-clicked").removeClass("jstree-wholerow-clicked")},this)).on("changed.jstree",e.proxy(function(e,t){this.element.find(".jstree-wholerow-clicked").removeClass("jstree-wholerow-clicked");var r=!1,i,n;for(i=0,n=t.selected.length;n>i;i++)r=this.get_node(t.selected[i],!0),r&&r.length&&r.children(".jstree-wholerow").addClass("jstree-wholerow-clicked")},this)).on("open_node.jstree",e.proxy(function(e,t){this.get_node(t.node,!0).find(".jstree-clicked").parent().children(".jstree-wholerow").addClass("jstree-wholerow-clicked")},this)).on("hover_node.jstree dehover_node.jstree",e.proxy(function(e,t){this.get_node(t.node,!0).children(".jstree-wholerow")["hover_node"===e.type?"addClass":"removeClass"]("jstree-wholerow-hovered")},this)).on("contextmenu.jstree",".jstree-wholerow",e.proxy(function(t){t.preventDefault();var r=e.Event("contextmenu",{metaKey:t.metaKey,ctrlKey:t.ctrlKey,altKey:t.altKey,shiftKey:t.shiftKey,pageX:t.pageX,pageY:t.pageY});e(t.currentTarget).closest("li").children("a:eq(0)").trigger(r)},this)).on("click.jstree",".jstree-wholerow",function(t){t.stopImmediatePropagation();var r=e.Event("click",{metaKey:t.metaKey,ctrlKey:t.ctrlKey,altKey:t.altKey,shiftKey:t.shiftKey});e(t.currentTarget).closest("li").children("a:eq(0)").trigger(r).focus()}).on("click.jstree",".jstree-leaf > .jstree-ocl",e.proxy(function(t){t.stopImmediatePropagation();var r=e.Event("click",{metaKey:t.metaKey,ctrlKey:t.ctrlKey,altKey:t.altKey,shiftKey:t.shiftKey});e(t.currentTarget).closest("li").children("a:eq(0)").trigger(r).focus()},this)).on("mouseover.jstree",".jstree-wholerow, .jstree-icon",e.proxy(function(e){return e.stopImmediatePropagation(),this.hover_node(e.currentTarget),!1},this)).on("mouseleave.jstree",".jstree-node",e.proxy(function(e){this.dehover_node(e.currentTarget)},this))},this.teardown=function(){this.settings.wholerow&&this.element.find(".jstree-wholerow").remove(),r.teardown.call(this)},this.redraw_node=function(t,i,n){if(t=r.redraw_node.call(this,t,i,n)){var s=g.cloneNode(!0);-1!==e.inArray(t.id,this._data.core.selected)&&(s.className+=" jstree-wholerow-clicked"),t.insertBefore(s,t.childNodes[0])}return t}}}}); --------------------------------------------------------------------------------