From 7a9e8f8e6f3cff1699a0b6dbde34388a32ba59ca Mon Sep 17 00:00:00 2001 From: Ivan Bozhanov Date: Mon, 9 Apr 2012 15:58:59 +0300 Subject: [PATCH] switched to grunt --- LICENSE-GPL | 278 + LICENSE-MIT | 22 + README.md | 73 + README.txt | 16 - _docs/files/jstree-hotkeys-js.html | 40 - _docs/files/jstree-html-js.html | 40 - _docs/index.html | 1 - _docs/index/Classes.html | 33 - _docs/index/Events.html | 41 - _docs/index/Files.html | 37 - _docs/index/Functions.html | 105 - _docs/index/General.html | 65 - _docs/index/General2.html | 73 - _docs/index/Variables.html | 73 - _docs/search/FilesJ.html | 20 - _docs/search/FunctionsC.html | 20 - _docs/search/FunctionsG.html | 20 - _docs/search/FunctionsI.html | 20 - _docs/search/FunctionsS.html | 20 - _docs/search/FunctionsSymbols.html | 20 - _docs/search/GeneralC.html | 20 - _docs/search/GeneralD.html | 20 - _docs/search/GeneralG.html | 20 - _docs/search/GeneralI.html | 20 - _docs/search/GeneralJ.html | 20 - _docs/search/GeneralR.html | 20 - _docs/search/GeneralS.html | 20 - _docs/search/GeneralSymbols.html | 20 - _docs/search/GeneralU.html | 20 - _docs/search/VariablesD.html | 20 - _lib/jquery.js | 4 - dist/jstree.js | 5543 ++++++++++ dist/jstree.min.js | 4 + {themes => dist/themes}/default-rtl/d.gif | Bin {themes => dist/themes}/default-rtl/d.png | Bin {themes => dist/themes}/default-rtl/dots.gif | Bin {themes => dist/themes}/default-rtl/style.css | 0 .../themes/default-rtl}/throbber.gif | Bin {themes => dist/themes}/default/d.gif | Bin {themes => dist/themes}/default/d.png | Bin {themes => dist/themes}/default/style.css | 0 .../themes/default}/throbber.gif | Bin {_docs => docs}/c.gif | Bin {_docs => docs}/e.gif | Bin {_docs => docs}/files/_lib/jquery-js.html | 0 {_docs => docs}/files/_license-txt.html | 0 {_docs => docs}/files/_usage-txt.html | 0 {_docs => docs}/files/jstree-checkbox-js.html | 4 +- .../files/jstree-contextmenu-js.html | 4 +- {_docs => docs}/files/jstree-core-js.html | 0 {_docs => docs}/files/jstree-dnd-js.html | 4 +- .../files/jstree-hotkeys-js.html | 10 +- .../files/jstree-html-js.html | 10 +- docs/files/jstree-js.html | 309 + {_docs => docs}/files/jstree-json-js.html | 4 +- {_docs => docs}/files/jstree-sort-js.html | 4 +- docs/files/jstree-state-js.html | 40 + {_docs => docs}/files/jstree-themes-js.html | 4 +- docs/files/jstree-ui-js.html | 40 + {_docs => docs}/files/jstree-unique-js.html | 4 +- {_docs => docs}/files/jstree-xml-js.html | 4 +- {_docs => docs}/files/vakata-js.html | 10 +- docs/index.html | 1 + docs/index/Classes.html | 33 + docs/index/Events.html | 41 + docs/index/Files.html | 37 + docs/index/Functions.html | 105 + docs/index/General.html | 65 + docs/index/General2.html | 73 + docs/index/Variables.html | 73 + {_docs => docs}/javascript/main.js | 0 {_docs => docs}/javascript/prettify.js | 0 {_docs => docs}/javascript/searchdata.js | 0 {_docs => docs}/logo.png | Bin {_docs => docs}/m.gif | Bin {_docs => docs}/main.jpg | Bin {_docs => docs}/p.gif | Bin {_docs => docs}/search/ClassesJ.html | 2 +- {_docs => docs}/search/EventsC.html | 0 {_docs => docs}/search/EventsD.html | 0 {_docs => docs}/search/EventsSymbols.html | 2 +- {_docs => docs}/search/FilesH.html | 0 docs/search/FilesJ.html | 20 + {_docs => docs}/search/FunctionsA.html | 0 docs/search/FunctionsC.html | 20 + {_docs => docs}/search/FunctionsD.html | 2 +- {_docs => docs}/search/FunctionsE.html | 0 {_docs => docs}/search/FunctionsF.html | 0 docs/search/FunctionsG.html | 20 + {_docs => docs}/search/FunctionsH.html | 0 docs/search/FunctionsI.html | 20 + {_docs => docs}/search/FunctionsL.html | 2 +- {_docs => docs}/search/FunctionsM.html | 2 +- {_docs => docs}/search/FunctionsO.html | 2 +- {_docs => docs}/search/FunctionsP.html | 2 +- docs/search/FunctionsR.html | 20 + docs/search/FunctionsS.html | 20 + docs/search/FunctionsSymbols.html | 20 + {_docs => docs}/search/FunctionsT.html | 2 +- {_docs => docs}/search/FunctionsU.html | 2 +- docs/search/FunctionsV.html | 20 + {_docs => docs}/search/FunctionsX.html | 0 {_docs => docs}/search/GeneralA.html | 0 docs/search/GeneralC.html | 20 + docs/search/GeneralD.html | 20 + {_docs => docs}/search/GeneralE.html | 0 {_docs => docs}/search/GeneralF.html | 0 docs/search/GeneralG.html | 20 + {_docs => docs}/search/GeneralH.html | 2 +- docs/search/GeneralI.html | 20 + docs/search/GeneralJ.html | 20 + {_docs => docs}/search/GeneralL.html | 2 +- {_docs => docs}/search/GeneralM.html | 2 +- {_docs => docs}/search/GeneralO.html | 2 +- {_docs => docs}/search/GeneralP.html | 2 +- docs/search/GeneralR.html | 20 + docs/search/GeneralS.html | 20 + docs/search/GeneralSymbols.html | 20 + {_docs => docs}/search/GeneralT.html | 2 +- .../search/GeneralU.html | 2 +- {_docs => docs}/search/GeneralV.html | 2 +- {_docs => docs}/search/GeneralX.html | 0 {_docs => docs}/search/NoResults.html | 0 {_docs => docs}/search/VariablesC.html | 0 .../search/VariablesD.html | 2 +- {_docs => docs}/search/VariablesH.html | 0 {_docs => docs}/search/VariablesI.html | 2 +- {_docs => docs}/search/VariablesJ.html | 0 {_docs => docs}/search/VariablesL.html | 0 {_docs => docs}/search/VariablesP.html | 0 {_docs => docs}/search/VariablesS.html | 2 +- {_docs => docs}/search/VariablesT.html | 0 {_docs => docs}/search/VariablesU.html | 0 {_docs => docs}/search/VariablesV.html | 2 +- {_docs => docs}/styles/1.css | 0 {_docs => docs}/styles/2.css | 0 {_docs => docs}/styles/main.css | 0 index.html | 93 +- {_lib => libs}/jquery.cookie.js | 0 {_lib => libs}/jquery.hotkeys.js | 0 libs/jquery.js | 4 + libs/jquery/jquery.js | 9404 +++++++++++++++++ libs/qunit/qunit.css | 232 + libs/qunit/qunit.js | 1659 +++ package.json | 33 + jstree.checkbox.js => src/jstree.checkbox.js | 4 +- .../jstree.contextmenu.js | 0 jstree.dnd.js => src/jstree.dnd.js | 2 +- jstree.hotkeys.js => src/jstree.hotkeys.js | 6 +- jstree.html.js => src/jstree.html.js | 0 jstree.core.js => src/jstree.js | 35 +- jstree.json.js => src/jstree.json.js | 0 jstree.sort.js => src/jstree.sort.js | 2 +- jstree.state.js => src/jstree.state.js | 0 jstree.themes.js => src/jstree.themes.js | 6 +- jstree.ui.js => src/jstree.ui.js | 12 +- jstree.unique.js => src/jstree.unique.js | 0 jstree.xml.js => src/jstree.xml.js | 0 {themes => src/themes}/apple/bg.jpg | Bin {themes => src/themes}/apple/d.png | Bin {themes => src/themes}/apple/dot_for_ie.gif | Bin {themes => src/themes}/apple/style.css | 0 .../themes/apple}/throbber.gif | Bin {themes => src/themes}/classic/d.gif | Bin {themes => src/themes}/classic/d.png | Bin {themes => src/themes}/classic/dot_for_ie.gif | Bin {themes => src/themes}/classic/style.css | 0 .../themes/classic}/throbber.gif | Bin src/themes/default-rtl/d.gif | Bin 0 -> 2872 bytes src/themes/default-rtl/d.png | Bin 0 -> 7459 bytes src/themes/default-rtl/dots.gif | Bin 0 -> 132 bytes src/themes/default-rtl/style.css | 84 + src/themes/default-rtl/throbber.gif | Bin 0 -> 1849 bytes src/themes/default/d.gif | Bin 0 -> 2944 bytes src/themes/default/d.png | Bin 0 -> 7635 bytes src/themes/default/style.css | 79 + src/themes/default/throbber.gif | Bin 0 -> 1849 bytes vakata.js => src/vakata.js | 191 +- test.json | 4 - test/jstree.checkbox.test.js | 0 test/jstree.contextmenu.test.js | 0 test/jstree.dnd.test.js | 0 test/jstree.hotkeys.test.js | 0 test/jstree.html | 42 + test/jstree.html.test.js | 0 test/jstree.json.test.js | 0 test/jstree.sort.test.js | 0 test/jstree.state.test.js | 0 test/jstree.test.js | 58 + test/jstree.themes.test.js | 37 + test/jstree.ui.test.js | 0 test/jstree.unique.test.js | 0 test/jstree.xml.test.js | 0 test/vakata.js | 0 194 files changed, 19037 insertions(+), 959 deletions(-) create mode 100644 LICENSE-GPL create mode 100644 LICENSE-MIT create mode 100644 README.md delete mode 100644 README.txt delete mode 100644 _docs/files/jstree-hotkeys-js.html delete mode 100644 _docs/files/jstree-html-js.html delete mode 100644 _docs/index.html delete mode 100644 _docs/index/Classes.html delete mode 100644 _docs/index/Events.html delete mode 100644 _docs/index/Files.html delete mode 100644 _docs/index/Functions.html delete mode 100644 _docs/index/General.html delete mode 100644 _docs/index/General2.html delete mode 100644 _docs/index/Variables.html delete mode 100644 _docs/search/FilesJ.html delete mode 100644 _docs/search/FunctionsC.html delete mode 100644 _docs/search/FunctionsG.html delete mode 100644 _docs/search/FunctionsI.html delete mode 100644 _docs/search/FunctionsS.html delete mode 100644 _docs/search/FunctionsSymbols.html delete mode 100644 _docs/search/GeneralC.html delete mode 100644 _docs/search/GeneralD.html delete mode 100644 _docs/search/GeneralG.html delete mode 100644 _docs/search/GeneralI.html delete mode 100644 _docs/search/GeneralJ.html delete mode 100644 _docs/search/GeneralR.html delete mode 100644 _docs/search/GeneralS.html delete mode 100644 _docs/search/GeneralSymbols.html delete mode 100644 _docs/search/GeneralU.html delete mode 100644 _docs/search/VariablesD.html delete mode 100644 _lib/jquery.js create mode 100644 dist/jstree.js create mode 100644 dist/jstree.min.js rename {themes => dist/themes}/default-rtl/d.gif (100%) rename {themes => dist/themes}/default-rtl/d.png (100%) rename {themes => dist/themes}/default-rtl/dots.gif (100%) rename {themes => dist/themes}/default-rtl/style.css (100%) rename {themes/apple => dist/themes/default-rtl}/throbber.gif (100%) rename {themes => dist/themes}/default/d.gif (100%) rename {themes => dist/themes}/default/d.png (100%) rename {themes => dist/themes}/default/style.css (100%) rename {themes/classic => dist/themes/default}/throbber.gif (100%) rename {_docs => docs}/c.gif (100%) rename {_docs => docs}/e.gif (100%) rename {_docs => docs}/files/_lib/jquery-js.html (100%) rename {_docs => docs}/files/_license-txt.html (100%) rename {_docs => docs}/files/_usage-txt.html (100%) rename {_docs => docs}/files/jstree-checkbox-js.html (52%) rename {_docs => docs}/files/jstree-contextmenu-js.html (51%) rename {_docs => docs}/files/jstree-core-js.html (100%) rename {_docs => docs}/files/jstree-dnd-js.html (53%) rename _docs/files/jstree-state-js.html => docs/files/jstree-hotkeys-js.html (53%) rename _docs/files/jstree-ui-js.html => docs/files/jstree-html-js.html (59%) create mode 100644 docs/files/jstree-js.html rename {_docs => docs}/files/jstree-json-js.html (53%) rename {_docs => docs}/files/jstree-sort-js.html (53%) create mode 100644 docs/files/jstree-state-js.html rename {_docs => docs}/files/jstree-themes-js.html (81%) create mode 100644 docs/files/jstree-ui-js.html rename {_docs => docs}/files/jstree-unique-js.html (53%) rename {_docs => docs}/files/jstree-xml-js.html (53%) rename {_docs => docs}/files/vakata-js.html (82%) create mode 100644 docs/index.html create mode 100644 docs/index/Classes.html create mode 100644 docs/index/Events.html create mode 100644 docs/index/Files.html create mode 100644 docs/index/Functions.html create mode 100644 docs/index/General.html create mode 100644 docs/index/General2.html create mode 100644 docs/index/Variables.html rename {_docs => docs}/javascript/main.js (100%) rename {_docs => docs}/javascript/prettify.js (100%) rename {_docs => docs}/javascript/searchdata.js (100%) rename {_docs => docs}/logo.png (100%) rename {_docs => docs}/m.gif (100%) rename {_docs => docs}/main.jpg (100%) rename {_docs => docs}/p.gif (100%) rename {_docs => docs}/search/ClassesJ.html (77%) rename {_docs => docs}/search/EventsC.html (100%) rename {_docs => docs}/search/EventsD.html (100%) rename {_docs => docs}/search/EventsSymbols.html (57%) rename {_docs => docs}/search/FilesH.html (100%) create mode 100644 docs/search/FilesJ.html rename {_docs => docs}/search/FunctionsA.html (100%) create mode 100644 docs/search/FunctionsC.html rename {_docs => docs}/search/FunctionsD.html (77%) rename {_docs => docs}/search/FunctionsE.html (100%) rename {_docs => docs}/search/FunctionsF.html (100%) create mode 100644 docs/search/FunctionsG.html rename {_docs => docs}/search/FunctionsH.html (100%) create mode 100644 docs/search/FunctionsI.html rename {_docs => docs}/search/FunctionsL.html (69%) rename {_docs => docs}/search/FunctionsM.html (77%) rename {_docs => docs}/search/FunctionsO.html (68%) rename {_docs => docs}/search/FunctionsP.html (74%) create mode 100644 docs/search/FunctionsR.html create mode 100644 docs/search/FunctionsS.html create mode 100644 docs/search/FunctionsSymbols.html rename {_docs => docs}/search/FunctionsT.html (77%) rename {_docs => docs}/search/FunctionsU.html (78%) create mode 100644 docs/search/FunctionsV.html rename {_docs => docs}/search/FunctionsX.html (100%) rename {_docs => docs}/search/GeneralA.html (100%) create mode 100644 docs/search/GeneralC.html create mode 100644 docs/search/GeneralD.html rename {_docs => docs}/search/GeneralE.html (100%) rename {_docs => docs}/search/GeneralF.html (100%) create mode 100644 docs/search/GeneralG.html rename {_docs => docs}/search/GeneralH.html (87%) create mode 100644 docs/search/GeneralI.html create mode 100644 docs/search/GeneralJ.html rename {_docs => docs}/search/GeneralL.html (61%) rename {_docs => docs}/search/GeneralM.html (81%) rename {_docs => docs}/search/GeneralO.html (68%) rename {_docs => docs}/search/GeneralP.html (62%) create mode 100644 docs/search/GeneralR.html create mode 100644 docs/search/GeneralS.html create mode 100644 docs/search/GeneralSymbols.html rename {_docs => docs}/search/GeneralT.html (88%) rename _docs/search/FunctionsV.html => docs/search/GeneralU.html (67%) rename {_docs => docs}/search/GeneralV.html (51%) rename {_docs => docs}/search/GeneralX.html (100%) rename {_docs => docs}/search/NoResults.html (100%) rename {_docs => docs}/search/VariablesC.html (100%) rename _docs/search/FunctionsR.html => docs/search/VariablesD.html (55%) rename {_docs => docs}/search/VariablesH.html (100%) rename {_docs => docs}/search/VariablesI.html (69%) rename {_docs => docs}/search/VariablesJ.html (100%) rename {_docs => docs}/search/VariablesL.html (100%) rename {_docs => docs}/search/VariablesP.html (100%) rename {_docs => docs}/search/VariablesS.html (53%) rename {_docs => docs}/search/VariablesT.html (100%) rename {_docs => docs}/search/VariablesU.html (100%) rename {_docs => docs}/search/VariablesV.html (82%) rename {_docs => docs}/styles/1.css (100%) rename {_docs => docs}/styles/2.css (100%) rename {_docs => docs}/styles/main.css (100%) rename {_lib => libs}/jquery.cookie.js (100%) rename {_lib => libs}/jquery.hotkeys.js (100%) create mode 100644 libs/jquery.js create mode 100644 libs/jquery/jquery.js create mode 100644 libs/qunit/qunit.css create mode 100644 libs/qunit/qunit.js create mode 100644 package.json rename jstree.checkbox.js => src/jstree.checkbox.js (98%) rename jstree.contextmenu.js => src/jstree.contextmenu.js (100%) rename jstree.dnd.js => src/jstree.dnd.js (99%) rename jstree.hotkeys.js => src/jstree.hotkeys.js (93%) rename jstree.html.js => src/jstree.html.js (100%) rename jstree.core.js => src/jstree.js (98%) rename jstree.json.js => src/jstree.json.js (100%) rename jstree.sort.js => src/jstree.sort.js (92%) rename jstree.state.js => src/jstree.state.js (100%) rename jstree.themes.js => src/jstree.themes.js (97%) rename jstree.ui.js => src/jstree.ui.js (89%) rename jstree.unique.js => src/jstree.unique.js (100%) rename jstree.xml.js => src/jstree.xml.js (100%) rename {themes => src/themes}/apple/bg.jpg (100%) rename {themes => src/themes}/apple/d.png (100%) rename {themes => src/themes}/apple/dot_for_ie.gif (100%) rename {themes => src/themes}/apple/style.css (100%) rename {themes/default-rtl => src/themes/apple}/throbber.gif (100%) rename {themes => src/themes}/classic/d.gif (100%) rename {themes => src/themes}/classic/d.png (100%) rename {themes => src/themes}/classic/dot_for_ie.gif (100%) rename {themes => src/themes}/classic/style.css (100%) rename {themes/default => src/themes/classic}/throbber.gif (100%) create mode 100644 src/themes/default-rtl/d.gif create mode 100644 src/themes/default-rtl/d.png create mode 100644 src/themes/default-rtl/dots.gif create mode 100644 src/themes/default-rtl/style.css create mode 100644 src/themes/default-rtl/throbber.gif create mode 100644 src/themes/default/d.gif create mode 100644 src/themes/default/d.png create mode 100644 src/themes/default/style.css create mode 100644 src/themes/default/throbber.gif rename vakata.js => src/vakata.js (90%) delete mode 100644 test.json create mode 100644 test/jstree.checkbox.test.js create mode 100644 test/jstree.contextmenu.test.js create mode 100644 test/jstree.dnd.test.js create mode 100644 test/jstree.hotkeys.test.js create mode 100644 test/jstree.html create mode 100644 test/jstree.html.test.js create mode 100644 test/jstree.json.test.js create mode 100644 test/jstree.sort.test.js create mode 100644 test/jstree.state.test.js create mode 100644 test/jstree.test.js create mode 100644 test/jstree.themes.test.js create mode 100644 test/jstree.ui.test.js create mode 100644 test/jstree.unique.test.js create mode 100644 test/jstree.xml.test.js create mode 100644 test/vakata.js diff --git a/LICENSE-GPL b/LICENSE-GPL new file mode 100644 index 00000000..11dddd00 --- /dev/null +++ b/LICENSE-GPL @@ -0,0 +1,278 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. diff --git a/LICENSE-MIT b/LICENSE-MIT new file mode 100644 index 00000000..19a998f5 --- /dev/null +++ b/LICENSE-MIT @@ -0,0 +1,22 @@ +Copyright (c) 2012 Ivan Bozhanov + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 00000000..7f54c09a --- /dev/null +++ b/README.md @@ -0,0 +1,73 @@ +# jstree + +Tree view for jQuery. +A list of useful pages: + http://www.jstree.com/ + http://www.jstree.com/demo + http://www.jstree.com/documentation + +## Getting Started +Download the [production version][min] or the [development version][max]. + +[min]: https://raw.github.com/vakata/jstree/master/dist/jstree.min.js +[max]: https://raw.github.com/vakata/jstree/master/dist/jstree.js + +###In your web page: + +``` + + + +``` + +###Interacting with the tree: + +``` +/* METHOD ONE */ +jQuery("some-selector-to-container-node-here") + .jstree("operation_name" [, argument_1, argument_2, ...]); + +/* METHOD TWO */ +jQuery.jstree._reference(needle) + .operation_name([ argument_1, argument_2, ...]); +``` + +###Events +jsTree uses events to notify of any changes. All events fire on the tree container in the _jstree_ namespace and are named after the function that triggered them. + +``` +jQuery("some-container") + .jstree({ /* configuration here */ }) + .bind("__ready.jstree", function (event, data) { + alert("TREE IS LOADED"); + /* note the second parameter, read the docs on each event for its value */ + }) +``` + +###Data: + +TODO: a step by step guide to: HTML (no data plugin), HTML with plugin + AJAX, JSON, JSON + AJAX, XML, XML + AJAX, explain progressive render / unload + +###States: + +TODO: explain about passing states along with the data and the special data-jstree- attributes. + +## Contributing +In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [grunt](https://github.com/cowboy/grunt). + +_Also, please don't edit files in the "dist" subdirectory as they are generated via grunt. You'll find source code in the "src" subdirectory!_ + +## License +Copyright (c) 2012 Ivan Bozhanov (http://vakata.com) +Licensed under the MIT, GPL licenses. + http://www.opensource.org/licenses/mit-license.php + http://www.gnu.org/licenses/gpl.html diff --git a/README.txt b/README.txt deleted file mode 100644 index 5070d25e..00000000 --- a/README.txt +++ /dev/null @@ -1,16 +0,0 @@ -jsTree 1.0 -http://jstree.com/ - -Copyright (c) 2011 Ivan Bozhanov (vakata.com) - -Dual licensed under the MIT and GPL licenses: - http://www.opensource.org/licenses/mit-license.php - http://www.gnu.org/licenses/gpl.html - -A list of useful pages: - http://www.jstree.com/demo - http://www.jstree.com/documentation - https://groups.google.com/forum/#!forum/jstree - -You can support the project on PayPal: - http://bit.ly/jNIuWd \ No newline at end of file diff --git a/_docs/files/jstree-hotkeys-js.html b/_docs/files/jstree-hotkeys-js.html deleted file mode 100644 index 649ded59..00000000 --- a/_docs/files/jstree-hotkeys-js.html +++ /dev/null @@ -1,40 +0,0 @@ - - -jstree.hotkeys.js - jstree - - - - - - - - - -

jstree.hotkeys.js

Enables keyboard shortcuts.  Depends on jQuery.hotkeys (included).

Summary
jstree.hotkeys.jsEnables keyboard shortcuts.
jstree hotkeys plugin
- -

jstree hotkeys plugin

- -
- - - - - - - - - - - - - - - -
Close
- - - \ No newline at end of file diff --git a/_docs/files/jstree-html-js.html b/_docs/files/jstree-html-js.html deleted file mode 100644 index afae67d8..00000000 --- a/_docs/files/jstree-html-js.html +++ /dev/null @@ -1,40 +0,0 @@ - - -jstree.html.js - jstree - - - - - - - - - -

jstree.html.js

This plugin makes it possible for jstree to use HTML data sources (other than the container’s initial HTML).

Summary
jstree.html.jsThis plugin makes it possible for jstree to use HTML data sources (other than the container’s initial HTML).
jstree html plugin
- -

jstree html plugin

- -
- - - - - - - - - - - - - - - -
Close
- - - \ No newline at end of file diff --git a/_docs/index.html b/_docs/index.html deleted file mode 100644 index 7e0f3a21..00000000 --- a/_docs/index.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/_docs/index/Classes.html b/_docs/index/Classes.html deleted file mode 100644 index 265f512d..00000000 --- a/_docs/index/Classes.html +++ /dev/null @@ -1,33 +0,0 @@ - - -Class Index - jstree - - - - - - - - - -
Class Index
$#! · 0-9 · A · B · C · D · E · F · G · H · I · J · K · L · M · N · O · P · Q · R · S · T · U · V · W · X · Y · Z
J
 jstree
- - - -
- - - - - - - - -
Close
- - - \ No newline at end of file diff --git a/_docs/index/Events.html b/_docs/index/Events.html deleted file mode 100644 index 259e9e31..00000000 --- a/_docs/index/Events.html +++ /dev/null @@ -1,41 +0,0 @@ - - -Event Index - jstree - - - - - - - - - -
Event Index
$#! · 0-9 · A · B · C · D · E · F · G · H · I · J · K · L · M · N · O · P · Q · R · S · T · U · V · W · X · Y · Z
$#!
 __after_close, jstree
 __after_open, jstree
 __loaded, jstree
 __ready, jstree
C
 context_hide
 context_parse
 context_show
D
 dnd_move
 dnd_scroll
 dnd_start
 dnd_stop
- -
This event is triggered in the jstree namespace when a node is closed AFTER the animation completes).
This event is triggered in the jstree namespace when a node is successfully opened AFTER the animation completes).
This event is triggered in the jstree namespace when data is first rendered in the tree.
This event is triggered in the jstree namespace when all initial loading is done.
- - - -
Triggered when the context menu is hidden.
Triggered when the context menu is parsed but not yet shown.
Triggered when the context menu is shown.
- - - -
Triggered multiple times while dragging.
Fires when a container is scrolled due to dragging near its edge.
Marks the start of the drag.
Marks the end of the drag.
- -
- - - - - - - - -
Close
- - - \ No newline at end of file diff --git a/_docs/index/Files.html b/_docs/index/Files.html deleted file mode 100644 index 664f1be0..00000000 --- a/_docs/index/Files.html +++ /dev/null @@ -1,37 +0,0 @@ - - -File Index - jstree - - - - - - - - - -
File Index
$#! · 0-9 · A · B · C · D · E · F · G · H · I · J · K · L · M · N · O · P · Q · R · S · T · U · V · W · X · Y · Z
H
 Helper functions
J
 jstree.checkbox.js
 jstree.contextmenu.js
 jstree.core.js
 jstree.dnd.js
 jstree.hotkeys.js
 jstree.html.js
 jstree.json.js
 jstree.sort.js
 jstree.state.js
 jstree.themes.js
 jstree.ui.js
 jstree.unique.js
 jstree.xml.js
- -
This file includes some functions that enable CSS manipulations, contextmenus, XSLT transformations and drag’n’drop.
- - - -
Adds checkboxes to the tree.
Enables a rightclick contextmenu.
The only required part of jstree it consists of a few functions bound to the $.jstree object, the actual plugin function and a few core functions for manipulating a tree.
Enables drag’n’drop.
Enables keyboard shortcuts.
This plugin makes it possible for jstree to use HTML data sources (other than the container’s initial HTML).
This plugin makes it possible for jstree to use JSON data sources.
Sorts items alphabetically (or using any other function)
This plugin enables state saving between reloads.
Controls the looks of jstree, without this plugin you will get a functional tree, but it will look just like an ordinary UL list
This plugin enables selecting, deselecting and hovering tree items.
Does not allow the same name amongst siblings (still a bit experimental).
This plugin makes it possible for jstree to use XML data sources.
- -
- - - - - - - - -
Close
- - - \ No newline at end of file diff --git a/_docs/index/Functions.html b/_docs/index/Functions.html deleted file mode 100644 index fab83260..00000000 --- a/_docs/index/Functions.html +++ /dev/null @@ -1,105 +0,0 @@ - - -Function Index - jstree - - - - - - - - - -
Function Index
$#! · 0-9 · A · B · C · D · E · F · G · H · I · J · K · L · M · N · O · P · Q · R · S · T · U · V · W · X · Y · Z
$#!
 __call, $.jstree
 __construct, $.jstree
 __destruct, $.jstree
 __trigger, jstree
 _clean, $.vakata.dnd
 _execute, $.vakata.context
 _focus, $.jstree
 _focused, $.jstree
 _get, $.vakata.dnd
 _get_string, jstree
 _load_node, jstree
 _parse, $.vakata.context
 _reference, $.jstree
 _scroll, $.vakata.dnd
 _show_submenu, $.vakata.context
 _trigger
A
 add_css, $.vakata.css
 add_sheet, $.vakata.css
 array_remove, $.vakata
 array_unique, $.vakata
 attributes, $.vakata
C
 check, jstree
 clean_node, jstree
 close_all, jstree
 close_node, jstree
 cookie, $.vakata
 copy_node, jstree
 correct_node, jstree
 create_node, jstree
 currentBackend, $.vakata.storage
D
 decode, $.vakata.json
 del, $.vakata.storage
 delete_node, jstree
 drag, $.vakata.dnd
E
 elm_get, $.vakata.selection
 elm_get_caret, $.vakata.selection
 elm_get_caret_position, $.vakata.selection
 elm_replace, $.vakata.selection
 elm_set, $.vakata.selection
 elm_set_caret, $.vakata.selection
 encode, $.vakata.json
F
 flush, $.vakata.storage
G
 get
 get_children, jstree
 get_container, jstree
 get_container_ul, jstree
 get_css, $.vakata.css
 get_index, jstree
 get_json, jstree
 get_next, jstree
 get_node, jstree
 get_parent, jstree
 get_prev, jstree
 get_scrollbar_width, $.vakata
 get_settings, jstree
 get_state, jstree
 get_text, jstree
H
 hide, $.vakata.context
I
 index, $.vakata.storage
 init
 is_closed, jstree
 is_leaf, jstree
 is_loaded, jstree
 is_loading, jstree
 is_locked, jstree
 is_open, jstree
 is_parent, jstree
L
 load_node, jstree
 lock, jstree
M
 move_node, jstree
O
 open_all, jstree
 open_node, jstree
P
 parse, $.vakata.pretty_date
 parse_json, jstree
 plugin, $.jstree
R
 refresh, jstree
 remove_css, $.vakata.css
 rename_node, jstree
S
 scroll_to_node, jstree
 set, $.vakata.storage
 set_state, jstree
 set_text, jstree
 set_theme, jstree
 show, $.vakata.context
 start, $.vakata.dnd
 stop, $.vakata.dnd
 storageAvailable, $.vakata.storage
 storageObj, $.vakata.storage
 storageSize, $.vakata.storage
T
 toggle_node, jstree
U
 unlock, jstree
V
 vakata_pretty_date, $()
 vakata_reverse, $()
X
 xslt, $.vakata
- -
Call a function on the instance and return the result
Creates a new jstree instance, any arguments after the first one are merged and used to configure the tree.
Destroys an instance, and also clears `jstree-` prefixed classes and all events in the `jstree` namespace
Used internally to trigger events on the container node.
Used internally to cleanup after a drop, so that all variables are nulled and ready for the next drag.
Used internally to execute the action (if any) associated with an item.
Make an instance focused (which defocuses the previously focused instance)
Returns the currently focused instance (by default once an instance is created it is focused)
Used internally to get all items for the drag event.
_get_string : function (s)
Used to get the common string in the tree.
_load_node : function (obj,
callback)
Load the children of a node, but as opposed to load_node does not change any visual properties or trigger events.
Used internally to parse a contextmenu description object to an HTML string.
Returns an instance
Used internally to scroll hovered elements.
Used internally to show a submenu
Used internally to trigger all necessary events.
Used internally to trigger all necessary events.
- - - -
Adds a rule.
Adds a whole stylesheet or appends to an existing stylesheet.
Makes it possible to remove an item (or a group of items) form an array.
Returns only the unique items from an array.
Collects all attributes from a DOM node.
- - - -
check : function (chk,
obj,
par,
pos)
This function checks if a structure modification is valid.
clean_node : function (obj)
This function converts inserted nodes to the required by jsTree format.
Close all nodes from a certain node down.
Close a node so that its children are not visible.
$.vakata.cookie = function (key,
value,
options)
A function for getting and setting cookies.
This function copies a node.
This function corrects the open/closed/leaf state as data changes (as the user interacts with the tree).
This function creates a new node.
Get the current backend used.
- - - -
Exists for consistency and is a simple wrapper for jQuery.parseJSON.
Remove a key.
This function deletes a node.
Used internally to process the mousemove event after $.vakata.dnd.start is called.
- - - -
Gets the selection inside an input element or textarea.
Returns the caret position in the element.
Returns the caret position in pixels relative to the element.
Replace the selection inside an input element or textarea.
Sets the selection inside an input element or textarea.
Sets the caret position in the element.
A function for encoding data in a JSON notated string.
- - - -
Empty the storage.
- - - -
Gets the current selection.
Get a value by key.
get_children : function (obj)
Get all the children of a node
Returns the jQuery extended container of the tree (the element you used when constructing the tree).
Returns the jQuery extended first UL node inside the container of the tree.
Retrieves or deletes a specific rule.
Returns an integer, which is the instance’s index.
get_json : function (obj,
is_callback)
This function returns the whole tree (or a single node) in JSON format.
get_next : function (obj,
strict)
Get the next sibling of a node
get_node : function (obj)
Get a hold of the LI node (which represents the jstree node).
get_parent : function (obj)
Get the parent of a node
get_prev : function (obj,
strict)
Get the previous sibling of a node
Gets the width of the scrollbar
Returns the settings for the tree.
get_state : function ()
This function returns the current state of the tree (as collected from all active plugins).
get_text : function (obj,
remove_html)
This function returns the title of the node.
- - - -
Used internally to hide the contextmenu after a click, or on mouseleave, etc.
- - - -
Get an array of all the set keys in the storage.
Parses all time elements in the document and keeps reparsing them every few seconds.
Used internally.
is_closed : function (obj)
Check if a node is currently closed.
is_leaf : function (obj)
Check if a node is a leaf node (has no children).
is_loaded : function (obj)
Check if a node is loaded.
is_loading : function (obj)
Check if a node is currently loading.
is_locked : function ()
Used to get the locked status of the tree.
is_open : function (obj)
Check if a node is currently open.
is_parent : function (obj)
Check if a node is a parent.
- - - -
Load the children of a node.
Used to lock the tree.
- - - -
This function moves a node.
- - - -
Open all nodes from a certain node down.
Open a node so that its children are visible.
- - - -
Parses the difference between to dates to a human readable string.
parse_json : function (node)
This function returns a jQuery node after parsing a JSON object (a LI node for single elements or an UL node for multiple).
Register a plugin
- - - -
This function saves the current state, reloads the complete tree and returns it to the saved state.
Removes a rule, this functions is a shortcut to $.vakata.css.get_css with the delete flag set to true.
This function renames a new node.
- - - -
scroll_to_node : function (obj)
This function scrolls the container to the desired node (if needed).
Set a key to a value
This function returns sets the state of the tree.
This function sets the title of the node.
set_theme : function (theme_name,
theme_url)
Sets the tree theme.
Shows the context menu.
Use this function to start a drag (usually with the mousedown event)
Used internally to process the mouseup event (drop) after $.vakata.dnd.start is called.
See if storage functionality is available.
Get a read only copy of the whole storage.
Get the size of all items in the storage in bytes.
- - - -
toggle_node : function (obj)
- - - -
Used to unlock the tree.
- - - -
$.fn.vakata_pretty_date = function (format,
compare)
Sets the HTML of every element to the parsed difference of its datetime attribute and the compare parameter.
Makes it possible to apply the standard array reverse function to a jQuery collection.
- - - -
$.vakata.xslt = function (xml,
xsl)
This functions transforms a XML string using a XSL string.
- -
- - - - - - - - -
Close
- - - \ No newline at end of file diff --git a/_docs/index/General.html b/_docs/index/General.html deleted file mode 100644 index 858dec14..00000000 --- a/_docs/index/General.html +++ /dev/null @@ -1,65 +0,0 @@ - - -Index - jstree - - - - - - - - - -
Index
$#! · 0-9 · A · B · C · D · E · F · G · H · I · J · K · L · M · N · O · P · Q · R · S · T · U · V · W · X · Y · Z
$#!
 __after_close, jstree
 __after_open, jstree
 __call, $.jstree
 __construct, $.jstree
 __destruct, $.jstree
 __loaded, jstree
 __ready, jstree
 __trigger, jstree
 _clean, $.vakata.dnd
 _execute, $.vakata.context
 _focus, $.jstree
 _focused, $.jstree
 _get, $.vakata.dnd
 _get_string, jstree
 _load_node, jstree
 _parse, $.vakata.context
 _reference, $.jstree
 _scroll, $.vakata.dnd
 _show_submenu, $.vakata.context
 _trigger
A
 add_css, $.vakata.css
 add_sheet, $.vakata.css
 array_remove, $.vakata
 array_unique, $.vakata
 attributes, $.vakata
C
 check, jstree
 CHECKBOX functions
 clean_node, jstree
 close_all, jstree
 close_node, jstree
 context, $.vakata
 Context menu
 context_hide
 context_menu_item
 context_parse
 context_show
 cookie, $.vakata
 Cookie
 copy_node, jstree
 CORE functions, jstree
 CORE options, jstree
 correct_node, jstree
 create_node, jstree
 css, $.vakata
 CSS
 currentBackend, $.vakata.storage
D
 data, jstree
 decode, $.vakata.json
 defaults, $.jstree
 del, $.vakata.storage
 delete_node, jstree
 dnd, $.vakata
 dnd_move
 dnd_scroll
 dnd_start
 dnd_stop
 dots, jstree.config.themes
 drag, $.vakata.dnd
 Drag’n’drop
E
 elm_get, $.vakata.selection
 elm_get_caret, $.vakata.selection
 elm_get_caret_position, $.vakata.selection
 elm_replace, $.vakata.selection
 elm_set, $.vakata.selection
 elm_set_caret, $.vakata.selection
 encode, $.vakata.json
F
 flush, $.vakata.storage
G
 get
 get_children, jstree
 get_container, jstree
 get_container_ul, jstree
 get_css, $.vakata.css
 get_index, jstree
 get_json, jstree
 get_next, jstree
 get_node, jstree
 get_parent, jstree
 get_prev, jstree
 get_scrollbar_width, $.vakata
 get_settings, jstree
 get_state, jstree
 get_text, jstree
H
 Helper functions
 helper_left, $.vakata.dnd.settings
 helper_top, $.vakata.dnd.settings
 hide, $.vakata.context
 hide_onmouseleave, $.vakata.context.settings
I
 icons
 index, $.vakata.storage
 init
 is_closed, jstree
 IS_FF2, $.jstree
 IS_IE6, $.jstree
 IS_IE7, $.jstree
 is_leaf, jstree
 is_loaded, jstree
 is_loading, jstree
 is_locked, jstree
 is_open, jstree
 is_parent, jstree
- -
This event is triggered in the jstree namespace when a node is closed AFTER the animation completes).
This event is triggered in the jstree namespace when a node is successfully opened AFTER the animation completes).
Call a function on the instance and return the result
Creates a new jstree instance, any arguments after the first one are merged and used to configure the tree.
Destroys an instance, and also clears `jstree-` prefixed classes and all events in the `jstree` namespace
This event is triggered in the jstree namespace when data is first rendered in the tree.
This event is triggered in the jstree namespace when all initial loading is done.
Used internally to trigger events on the container node.
Used internally to cleanup after a drop, so that all variables are nulled and ready for the next drag.
Used internally to execute the action (if any) associated with an item.
Make an instance focused (which defocuses the previously focused instance)
Returns the currently focused instance (by default once an instance is created it is focused)
Used internally to get all items for the drag event.
_get_string : function (s)
Used to get the common string in the tree.
_load_node : function (obj,
callback)
Load the children of a node, but as opposed to load_node does not change any visual properties or trigger events.
Used internally to parse a contextmenu description object to an HTML string.
Returns an instance
Used internally to scroll hovered elements.
Used internally to show a submenu
Used internally to trigger all necessary events.
Used internally to trigger all necessary events.
- - - -
Adds a rule.
Adds a whole stylesheet or appends to an existing stylesheet.
Makes it possible to remove an item (or a group of items) form an array.
Returns only the unique items from an array.
Collects all attributes from a DOM node.
- - - -
check : function (chk,
obj,
par,
pos)
This function checks if a structure modification is valid.
clean_node : function (obj)
This function converts inserted nodes to the required by jsTree format.
Close all nodes from a certain node down.
Close a node so that its children are not visible.
$.vakata.context
object holds all context menu related functions and variables.
Functions needed to show a custom context menu.
Triggered when the context menu is hidden.
object Used to construct a context menu entry, this structure will always be a part of an object.
Triggered when the context menu is parsed but not yet shown.
Triggered when the context menu is shown.
$.vakata.cookie = function (key,
value,
options)
A function for getting and setting cookies.
A copy of the jQuery cookie plugin.
This function copies a node.
This function corrects the open/closed/leaf state as data changes (as the user interacts with the tree).
This function creates a new node.
$.vakata.css
object holds all CSS related functions
Functions needed to manipulate stylesheets (add, remove, change)
Get the current backend used.
- - - -
object Provides storage for plugins (aside from private variables).
Exists for consistency and is a simple wrapper for jQuery.parseJSON.
object storing all the default configuration options for every plugin and the core.
Remove a key.
This function deletes a node.
$.vakata.dnd
object holds all DND related functions
Triggered multiple times while dragging.
Fires when a container is scrolled due to dragging near its edge.
Marks the start of the drag.
Marks the end of the drag.
boolean whether to show dots or not.
Used internally to process the mousemove event after $.vakata.dnd.start is called.
Functions needed to drag’n’drop elements
- - - -
Gets the selection inside an input element or textarea.
Returns the caret position in the element.
Returns the caret position in pixels relative to the element.
Replace the selection inside an input element or textarea.
Sets the selection inside an input element or textarea.
Sets the caret position in the element.
A function for encoding data in a JSON notated string.
- - - -
Empty the storage.
- - - -
Gets the current selection.
Get a value by key.
get_children : function (obj)
Get all the children of a node
Returns the jQuery extended container of the tree (the element you used when constructing the tree).
Returns the jQuery extended first UL node inside the container of the tree.
Retrieves or deletes a specific rule.
Returns an integer, which is the instance’s index.
get_json : function (obj,
is_callback)
This function returns the whole tree (or a single node) in JSON format.
get_next : function (obj,
strict)
Get the next sibling of a node
get_node : function (obj)
Get a hold of the LI node (which represents the jstree node).
get_parent : function (obj)
Get the parent of a node
get_prev : function (obj,
strict)
Get the previous sibling of a node
Gets the width of the scrollbar
Returns the settings for the tree.
get_state : function ()
This function returns the current state of the tree (as collected from all active plugins).
get_text : function (obj,
remove_html)
This function returns the title of the node.
- - - -
This file includes some functions that enable CSS manipulations, contextmenus, XSLT transformations and drag’n’drop.
integer number of pixels left of the cursor to move the drag-helper to.
integer number of pixels below the cursor to move the drag-helper to.
Used internally to hide the contextmenu after a click, or on mouseleave, etc.
integer the amount of milliseconds to wait before hiding the menu after mouseleave.
- - - -
boolean whether to show icons or not.
boolean whether to show icons or not.
Get an array of all the set keys in the storage.
Parses all time elements in the document and keeps reparsing them every few seconds.
Used internally.
is_closed : function (obj)
Check if a node is currently closed.
boolean indicating if the client is running Firefox 2
boolean indicating if the client is running Internet Explorer 6
boolean indicating if the client is running Internet Explorer 7
is_leaf : function (obj)
Check if a node is a leaf node (has no children).
is_loaded : function (obj)
Check if a node is loaded.
is_loading : function (obj)
Check if a node is currently loading.
is_locked : function ()
Used to get the locked status of the tree.
is_open : function (obj)
Check if a node is currently open.
is_parent : function (obj)
Check if a node is a parent.
- -
- - - - - - - - -
Close
- - - \ No newline at end of file diff --git a/_docs/index/General2.html b/_docs/index/General2.html deleted file mode 100644 index f4ea116d..00000000 --- a/_docs/index/General2.html +++ /dev/null @@ -1,73 +0,0 @@ - - -Index - jstree - - - - - - - - - -
Index
$#! · 0-9 · A · B · C · D · E · F · G · H · I · J · K · L · M · N · O · P · Q · R · S · T · U · V · W · X · Y · Z
J
 json, $.vakata
 JSON
 jstree
 jstree drag’n’drop plugin
 jstree hotkeys plugin
 jstree html plugin
 jstree json plugin
 jstree sort plugin
 jstree state plugin
 jstree UI plugin
 jstree xml plugin
 jstree.checkbox.js
 jstree.contextmenu.js
 jstree.core.js
 jstree.dnd.js
 jstree.hotkeys.js
 jstree.html.js
 jstree.json.js
 jstree.sort.js
 jstree.state.js
 jstree.themes.js
 jstree.ui.js
 jstree.unique.js
 jstree.xml.js
L
 lang, $.vakata.pretty_date
 License
 load_node, jstree
 LocalStorage
 lock, jstree
M
 Miscellaneous
 move_node, jstree
O
 open_all, jstree
 open_node, jstree
P
 parse, $.vakata.pretty_date
 parse_json, jstree
 plugin, $.jstree
 pretty_date, $.vakata
 PrettyDate
R
 refresh, jstree
 remove_css, $.vakata.css
 rename_node, jstree
S
 scroll_proximity, $.vakata.dnd.settings
 scroll_speed, $.vakata.dnd.settings
 scroll_to_node, jstree
 SCROLLBAR_WIDTH, $.jstree
 selection, $.vakata
 Selection
 set, $.vakata.storage
 set_state, jstree
 set_text, jstree
 set_theme, jstree
 settings
 show, $.vakata.context
 start, $.vakata.dnd
 stop, $.vakata.dnd
 storage, $.vakata
 storageAvailable, $.vakata.storage
 storageObj, $.vakata.storage
 storageSize, $.vakata.storage
 strings, jstree.config.core
T
 theme, jstree.config.themes
 THEMES functions, jstree
 THEMES options, jstree
 THEMES_DIR, $.jstree
 threshold, $.vakata.dnd.settings
 toggle_node, jstree
U
 unlock, jstree
 url, jstree.config.themes
 Usage
V
 vakata, $
 vakata_pretty_date, $()
 vakata_reverse, $()
 version, $.vakata.storage
 VERSION, $.jstree
X
 xslt, $.vakata
 XSLT
- -
$.vakata.json
object holds all JSON related functions.
Functions needed to encode/decode JSON.
Some static functions and variables, unless you know exactly what you are doing do not use these, but $().jstree instead.
The actual plugin wrapper, use this to create instances or execute functions on created instances.
Adds checkboxes to the tree.
Enables a rightclick contextmenu.
The only required part of jstree it consists of a few functions bound to the $.jstree object, the actual plugin function and a few core functions for manipulating a tree.
Enables drag’n’drop.
Enables keyboard shortcuts.
This plugin makes it possible for jstree to use HTML data sources (other than the container’s initial HTML).
This plugin makes it possible for jstree to use JSON data sources.
Sorts items alphabetically (or using any other function)
This plugin enables state saving between reloads.
Controls the looks of jstree, without this plugin you will get a functional tree, but it will look just like an ordinary UL list
This plugin enables selecting, deselecting and hovering tree items.
Does not allow the same name amongst siblings (still a bit experimental).
This plugin makes it possible for jstree to use XML data sources.
- - - -
object the localization to use.
jstree is licensed same as jQuery.
Load the children of a node.
Functions for dealing with localStorage with fallback to userData or cookies.
Used to lock the tree.
- - - -
Various small snippets.
This function moves a node.
- - - -
Open all nodes from a certain node down.
Open a node so that its children are visible.
- - - -
Parses the difference between to dates to a human readable string.
parse_json : function (node)
This function returns a jQuery node after parsing a JSON object (a LI node for single elements or an UL node for multiple).
Register a plugin
$.vakata.pretty_date
object holds all pretty-date related functions and properties.
Modifies time elements to a more human readable value.
- - - -
This function saves the current state, reloads the complete tree and returns it to the saved state.
Removes a rule, this functions is a shortcut to $.vakata.css.get_css with the delete flag set to true.
This function renames a new node.
- - - -
integer number of pixels from the edge of a scrollable parent below which the parent will start scrolling.
integer how fast (pixel count for each step) should a scrollable parent scroll when dragging near the edge.
scroll_to_node : function (obj)
This function scrolls the container to the desired node (if needed).
$.jstree.SCROLLBAR_WIDTH
integer indicating the width of the client scrollbar
$.vakata.selection
object holds all selection related functions and properties.
Selection related functions
Set a key to a value
This function returns sets the state of the tree.
This function sets the title of the node.
set_theme : function (theme_name,
theme_url)
Sets the tree theme.
object holds the global settings object for context menus.
object holds the global settings object for DND.
Shows the context menu.
Use this function to start a drag (usually with the mousedown event)
Used internally to process the mouseup event (drop) after $.vakata.dnd.start is called.
$.vakata.storage
object holds all storage related functions and properties.
See if storage functionality is available.
Get a read only copy of the whole storage.
Get the size of all items in the storage in bytes.
mixed used to store all localization strings.
- - - -
string the name of the theme you want to use.
$.jstree.THEMES_DIR
The location of all themes, this is used when setting a theme without supplying an URL (only by name).
integer amount of pixels required to move before the drag is started.
toggle_node : function (obj)
- - - -
Used to unlock the tree.
mixed the URL of the stylesheet of the theme you want to use.
Introduction
- - - -
(function ($) { $.vakata = {}; })(jQuery)
object Holds all helper objects.
$.fn.vakata_pretty_date = function (format,
compare)
Sets the HTML of every element to the parsed difference of its datetime attribute and the compare parameter.
Makes it possible to apply the standard array reverse function to a jQuery collection.
string the version of jstorage used
string the version of jstree
- - - -
$.vakata.xslt = function (xml,
xsl)
This functions transforms a XML string using a XSL string.
A function used to do XSLT transformations.
- -
- - - - - - - - -
Close
- - - \ No newline at end of file diff --git a/_docs/index/Variables.html b/_docs/index/Variables.html deleted file mode 100644 index 5ac5609b..00000000 --- a/_docs/index/Variables.html +++ /dev/null @@ -1,73 +0,0 @@ - - -Variable Index - jstree - - - - - - - - - -
Variable Index
$#! · 0-9 · A · B · C · D · E · F · G · H · I · J · K · L · M · N · O · P · Q · R · S · T · U · V · W · X · Y · Z
C
 context, $.vakata
 context_menu_item
 css, $.vakata
D
 data, jstree
 defaults, $.jstree
 dnd, $.vakata
 dots, jstree.config.themes
H
 helper_left, $.vakata.dnd.settings
 helper_top, $.vakata.dnd.settings
 hide_onmouseleave, $.vakata.context.settings
I
 icons
 IS_FF2, $.jstree
 IS_IE6, $.jstree
 IS_IE7, $.jstree
J
 json, $.vakata
L
 lang, $.vakata.pretty_date
P
 pretty_date, $.vakata
S
 scroll_proximity, $.vakata.dnd.settings
 scroll_speed, $.vakata.dnd.settings
 SCROLLBAR_WIDTH, $.jstree
 selection, $.vakata
 settings
 storage, $.vakata
 strings, jstree.config.core
T
 theme, jstree.config.themes
 THEMES_DIR, $.jstree
 threshold, $.vakata.dnd.settings
U
 url, jstree.config.themes
V
 vakata, $
 version, $.vakata.storage
 VERSION, $.jstree
- -
$.vakata.context
object holds all context menu related functions and variables.
object Used to construct a context menu entry, this structure will always be a part of an object.
$.vakata.css
object holds all CSS related functions
- - - -
object Provides storage for plugins (aside from private variables).
object storing all the default configuration options for every plugin and the core.
$.vakata.dnd
object holds all DND related functions
boolean whether to show dots or not.
- - - -
integer number of pixels left of the cursor to move the drag-helper to.
integer number of pixels below the cursor to move the drag-helper to.
integer the amount of milliseconds to wait before hiding the menu after mouseleave.
- - - -
boolean whether to show icons or not.
boolean whether to show icons or not.
boolean indicating if the client is running Firefox 2
boolean indicating if the client is running Internet Explorer 6
boolean indicating if the client is running Internet Explorer 7
- - - -
$.vakata.json
object holds all JSON related functions.
- - - -
object the localization to use.
- - - -
$.vakata.pretty_date
object holds all pretty-date related functions and properties.
- - - -
integer number of pixels from the edge of a scrollable parent below which the parent will start scrolling.
integer how fast (pixel count for each step) should a scrollable parent scroll when dragging near the edge.
$.jstree.SCROLLBAR_WIDTH
integer indicating the width of the client scrollbar
$.vakata.selection
object holds all selection related functions and properties.
object holds the global settings object for context menus.
object holds the global settings object for DND.
$.vakata.storage
object holds all storage related functions and properties.
mixed used to store all localization strings.
- - - -
string the name of the theme you want to use.
$.jstree.THEMES_DIR
The location of all themes, this is used when setting a theme without supplying an URL (only by name).
integer amount of pixels required to move before the drag is started.
- - - -
mixed the URL of the stylesheet of the theme you want to use.
- - - -
(function ($) { $.vakata = {}; })(jQuery)
object Holds all helper objects.
string the version of jstorage used
string the version of jstree
- -
- - - - - - - - -
Close
- - - \ No newline at end of file diff --git a/_docs/search/FilesJ.html b/_docs/search/FilesJ.html deleted file mode 100644 index 79d1981a..00000000 --- a/_docs/search/FilesJ.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - -
Loading...
Searching...
No Matches
\ No newline at end of file diff --git a/_docs/search/FunctionsC.html b/_docs/search/FunctionsC.html deleted file mode 100644 index 88fa00ec..00000000 --- a/_docs/search/FunctionsC.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - -
Loading...
check, jstree
clean_node, jstree
close_all, jstree
close_node, jstree
copy_node, jstree
correct_node, jstree
create_node, jstree
currentBackend, $.vakata.storage
Searching...
No Matches
\ No newline at end of file diff --git a/_docs/search/FunctionsG.html b/_docs/search/FunctionsG.html deleted file mode 100644 index 096cb91a..00000000 --- a/_docs/search/FunctionsG.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - -
Loading...
get_children, jstree
get_css, $.vakata.css
get_index, jstree
get_json, jstree
get_next, jstree
get_node, jstree
get_parent, jstree
get_prev, jstree
get_settings, jstree
get_state, jstree
get_text, jstree
Searching...
No Matches
\ No newline at end of file diff --git a/_docs/search/FunctionsI.html b/_docs/search/FunctionsI.html deleted file mode 100644 index 6364de4f..00000000 --- a/_docs/search/FunctionsI.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - -
Loading...
index, $.vakata.storage
is_closed, jstree
is_leaf, jstree
is_loaded, jstree
is_loading, jstree
is_locked, jstree
is_open, jstree
is_parent, jstree
Searching...
No Matches
\ No newline at end of file diff --git a/_docs/search/FunctionsS.html b/_docs/search/FunctionsS.html deleted file mode 100644 index 9565b4ef..00000000 --- a/_docs/search/FunctionsS.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - -
Loading...
set, $.vakata.storage
set_state, jstree
set_text, jstree
set_theme, jstree
show, $.vakata.context
start, $.vakata.dnd
stop, $.vakata.dnd
storageAvailable, $.vakata.storage
storageObj, $.vakata.storage
storageSize, $.vakata.storage
Searching...
No Matches
\ No newline at end of file diff --git a/_docs/search/FunctionsSymbols.html b/_docs/search/FunctionsSymbols.html deleted file mode 100644 index 0bf06c21..00000000 --- a/_docs/search/FunctionsSymbols.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - -
Loading...
__call, $.jstree
__construct, $.jstree
__destruct, $.jstree
__trigger, jstree
_clean, $.vakata.dnd
_execute, $.vakata.context
_focus, $.jstree
_focused, $.jstree
_get, $.vakata.dnd
_get_string, jstree
_load_node, jstree
_parse, $.vakata.context
_reference, $.jstree
_scroll, $.vakata.dnd
_show_submenu, $.vakata.context
Searching...
No Matches
\ No newline at end of file diff --git a/_docs/search/GeneralC.html b/_docs/search/GeneralC.html deleted file mode 100644 index 9803239b..00000000 --- a/_docs/search/GeneralC.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - -
Loading...
check, jstree
clean_node, jstree
close_all, jstree
close_node, jstree
context, $.vakata
copy_node, jstree
CORE options, jstree
correct_node, jstree
create_node, jstree
css, $.vakata
currentBackend, $.vakata.storage
Searching...
No Matches
\ No newline at end of file diff --git a/_docs/search/GeneralD.html b/_docs/search/GeneralD.html deleted file mode 100644 index d79fb1d1..00000000 --- a/_docs/search/GeneralD.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - -
Loading...
data, jstree
decode, $.vakata.json
defaults, $.jstree
del, $.vakata.storage
delete_node, jstree
dnd, $.vakata
dots, jstree.config.themes
drag, $.vakata.dnd
Searching...
No Matches
\ No newline at end of file diff --git a/_docs/search/GeneralG.html b/_docs/search/GeneralG.html deleted file mode 100644 index 096cb91a..00000000 --- a/_docs/search/GeneralG.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - -
Loading...
get_children, jstree
get_css, $.vakata.css
get_index, jstree
get_json, jstree
get_next, jstree
get_node, jstree
get_parent, jstree
get_prev, jstree
get_settings, jstree
get_state, jstree
get_text, jstree
Searching...
No Matches
\ No newline at end of file diff --git a/_docs/search/GeneralI.html b/_docs/search/GeneralI.html deleted file mode 100644 index 0397fc9b..00000000 --- a/_docs/search/GeneralI.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - -
Loading...
index, $.vakata.storage
is_closed, jstree
IS_FF2, $.jstree
IS_IE6, $.jstree
IS_IE7, $.jstree
is_leaf, jstree
is_loaded, jstree
is_loading, jstree
is_locked, jstree
is_open, jstree
is_parent, jstree
Searching...
No Matches
\ No newline at end of file diff --git a/_docs/search/GeneralJ.html b/_docs/search/GeneralJ.html deleted file mode 100644 index bfa67a4b..00000000 --- a/_docs/search/GeneralJ.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - -
Loading...
json, $.vakata
Searching...
No Matches
\ No newline at end of file diff --git a/_docs/search/GeneralR.html b/_docs/search/GeneralR.html deleted file mode 100644 index 762278c1..00000000 --- a/_docs/search/GeneralR.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - -
Loading...
refresh, jstree
remove_css, $.vakata.css
rename_node, jstree
Searching...
No Matches
\ No newline at end of file diff --git a/_docs/search/GeneralS.html b/_docs/search/GeneralS.html deleted file mode 100644 index 6f7f17e0..00000000 --- a/_docs/search/GeneralS.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - -
Loading...
scroll_proximity, $.vakata.dnd.settings
scroll_speed, $.vakata.dnd.settings
SCROLLBAR_WIDTH, $.jstree
selection, $.vakata
set, $.vakata.storage
set_state, jstree
set_text, jstree
set_theme, jstree
show, $.vakata.context
start, $.vakata.dnd
stop, $.vakata.dnd
storage, $.vakata
storageAvailable, $.vakata.storage
storageObj, $.vakata.storage
storageSize, $.vakata.storage
strings, jstree.config.core
Searching...
No Matches
\ No newline at end of file diff --git a/_docs/search/GeneralSymbols.html b/_docs/search/GeneralSymbols.html deleted file mode 100644 index 3ebac063..00000000 --- a/_docs/search/GeneralSymbols.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - -
Loading...
__after_open, jstree
__call, $.jstree
__construct, $.jstree
__destruct, $.jstree
__loaded, jstree
__ready, jstree
__trigger, jstree
_clean, $.vakata.dnd
_execute, $.vakata.context
_focus, $.jstree
_focused, $.jstree
_get, $.vakata.dnd
_get_string, jstree
_load_node, jstree
_parse, $.vakata.context
_reference, $.jstree
_scroll, $.vakata.dnd
_show_submenu, $.vakata.context
Searching...
No Matches
\ No newline at end of file diff --git a/_docs/search/GeneralU.html b/_docs/search/GeneralU.html deleted file mode 100644 index b27820da..00000000 --- a/_docs/search/GeneralU.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - -
Loading...
unlock, jstree
url, jstree.config.themes
Searching...
No Matches
\ No newline at end of file diff --git a/_docs/search/VariablesD.html b/_docs/search/VariablesD.html deleted file mode 100644 index 083fad9a..00000000 --- a/_docs/search/VariablesD.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - -
Loading...
data, jstree
defaults, $.jstree
dnd, $.vakata
dots, jstree.config.themes
Searching...
No Matches
\ No newline at end of file diff --git a/_lib/jquery.js b/_lib/jquery.js deleted file mode 100644 index d2424e65..00000000 --- a/_lib/jquery.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery v1.7 jquery.com | jquery.org/license */ -(function(a,b){function cA(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cx(a){if(!cm[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cn||(cn=c.createElement("iframe"),cn.frameBorder=cn.width=cn.height=0),b.appendChild(cn);if(!co||!cn.createElement)co=(cn.contentWindow||cn.contentDocument).document,co.write((c.compatMode==="CSS1Compat"?"":"")+""),co.close();d=co.createElement(a),co.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cn)}cm[a]=e}return cm[a]}function cw(a,b){var c={};f.each(cs.concat.apply([],cs.slice(0,b)),function(){c[this]=a});return c}function cv(){ct=b}function cu(){setTimeout(cv,0);return ct=f.now()}function cl(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ck(){try{return new a.XMLHttpRequest}catch(b){}}function ce(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){c!=="border"&&f.each(e,function(){c||(d-=parseFloat(f.css(a,"padding"+this))||0),c==="margin"?d+=parseFloat(f.css(a,c+this))||0:d-=parseFloat(f.css(a,"border"+this+"Width"))||0});return d+"px"}d=bB(a,b,b);if(d<0||d==null)d=a.style[b]||0;d=parseFloat(d)||0,c&&f.each(e,function(){d+=parseFloat(f.css(a,"padding"+this))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+this+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+this))||0)});return d+"px"}function br(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bi,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bq(a){var b=(a.nodeName||"").toLowerCase();b==="input"?bp(a):b!=="script"&&typeof a.getElementsByTagName!="undefined"&&f.grep(a.getElementsByTagName("input"),bp)}function bp(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bo(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bn(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}}function bm(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c,d,e,g=f._data(a),h=f._data(b,g),i=g.events;if(i){delete h.handle,h.events={};for(c in i)for(d=0,e=i[c].length;d=0===c})}function V(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function N(){return!0}function M(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/\d/,n=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,o=/^[\],:{}\s]*$/,p=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,q=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,r=/(?:^|:|,)(?:\s*\[)+/g,s=/(webkit)[ \/]([\w.]+)/,t=/(opera)(?:.*version)?[ \/]([\w.]+)/,u=/(msie) ([\w.]+)/,v=/(mozilla)(?:.*? rv:([\w.]+))?/,w=/-([a-z]|[0-9])/ig,x=/^-ms-/,y=function(a,b){return(b+"").toUpperCase()},z=d.userAgent,A,B,C,D=Object.prototype.toString,E=Object.prototype.hasOwnProperty,F=Array.prototype.push,G=Array.prototype.slice,H=String.prototype.trim,I=Array.prototype.indexOf,J={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=n.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7",length:0,size:function(){return this.length},toArray:function(){return G.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?F.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),B.add(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(G.apply(this,arguments),"slice",G.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:F,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;B.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!B){B=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",C,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",C),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&K()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNumeric:function(a){return a!=null&&m.test(a)&&!isNaN(a)},type:function(a){return a==null?String(a):J[D.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!E.call(a,"constructor")&&!E.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||E.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(o.test(b.replace(p,"@").replace(q,"]").replace(r,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(x,"ms-").replace(w,y)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c
a",d=a.getElementsByTagName("*"),e=a.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=a.getElementsByTagName("input")[0],k={leadingWhitespace:a.firstChild.nodeType===3,tbody:!a.getElementsByTagName("tbody").length,htmlSerialize:!!a.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,unknownElems:!!a.getElementsByTagName("nav").length,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:a.className!=="t",enctype:!!c.createElement("form").enctype,submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,k.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,k.optDisabled=!h.disabled;try{delete a.test}catch(v){k.deleteExpando=!1}!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function(){k.noCloneEvent=!1}),a.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),k.radioValue=i.value==="t",i.setAttribute("checked","checked"),a.appendChild(i),l=c.createDocumentFragment(),l.appendChild(a.lastChild),k.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",m=c.getElementsByTagName("body")[0],o=c.createElement(m?"div":"body"),p={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},m&&f.extend(p,{position:"absolute",left:"-999px",top:"-999px"});for(t in p)o.style[t]=p[t];o.appendChild(a),n=m||b,n.insertBefore(o,n.firstChild),k.appendChecked=i.checked,k.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,k.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="
",k.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="
t
",q=a.getElementsByTagName("td"),u=q[0].offsetHeight===0,q[0].style.display="",q[1].style.display="none",k.reliableHiddenOffsets=u&&q[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",a.appendChild(j),k.reliableMarginRight=(parseInt((c.defaultView.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(a.attachEvent)for(t in{submit:1,change:1,focusin:1})s="on"+t,u=s in a,u||(a.setAttribute(s,"return;"),u=typeof a[s]=="function"),k[t+"Bubbles"]=u;f(function(){var a,b,d,e,g,h,i=1,j="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",l="visibility:hidden;border:0;",n="style='"+j+"border:5px solid #000;padding:0;'",p="
"+""+"
";m=c.getElementsByTagName("body")[0];!m||(a=c.createElement("div"),a.style.cssText=l+"width:0;height:0;position:static;top:0;margin-top:"+i+"px",m.insertBefore(a,m.firstChild),o=c.createElement("div"),o.style.cssText=j+l,o.innerHTML=p,a.appendChild(o),b=o.firstChild,d=b.firstChild,g=b.nextSibling.firstChild.firstChild,h={doesNotAddBorder:d.offsetTop!==5,doesAddBorderForTableAndCells:g.offsetTop===5},d.style.position="fixed",d.style.top="20px",h.fixedPosition=d.offsetTop===20||d.offsetTop===15,d.style.position=d.style.top="",b.style.overflow="hidden",b.style.position="relative",h.subtractsBorderForOverflowNotVisible=d.offsetTop===-5,h.doesNotIncludeMarginInBodyOffset=m.offsetTop!==i,m.removeChild(a),o=a=null,f.extend(k,h))}),o.innerHTML="",n.removeChild(o),o=l=g=h=m=j=a=i=null;return k}(),f.boxModel=f.support.boxModel;var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[f.expando]:a[f.expando]&&f.expando,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[f.expando]=n=++f.uuid:n=f.expando),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[f.expando]:f.expando;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)?b=b:b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" "));for(e=0,g=b.length;e-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];if(!arguments.length){if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}return b}e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!a||j===3||j===8||j===2)return b;if(e&&c in f.attrFn)return f(a)[c](d);if(!("getAttribute"in a))return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return b}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g},removeAttr:function(a,b){var c,d,e,g,h=0;if(a.nodeType===1){d=(b||"").split(p),g=d.length;for(;h=0}})});var z=/\.(.*)$/,A=/^(?:textarea|input|select)$/i,B=/\./g,C=/ /g,D=/[^\w\s.|`]/g,E=/^([^\.]*)?(?:\.(.+))?$/,F=/\bhover(\.\S+)?/,G=/^key/,H=/^(?:mouse|contextmenu)|click/,I=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,J=function(a){var b=I.exec(a);b&& -(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},K=function(a,b){return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||a.id===b[2])&&(!b[3]||b[3].test(a.className))},L=function(a){return f.event.special.hover?a:a.replace(F,"mouseenter$1 mouseleave$1")};f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=L(c).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"",(g||!e)&&c.preventDefault();if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,n=null;for(m=e.parentNode;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;l=0:t===b&&(t=o[s]=r.quick?K(m,r.quick):f(m).is(s)),t&&q.push(r);q.length&&j.push({elem:m,matches:q})}d.length>e&&j.push({elem:this,matches:d.slice(e)});for(k=0;k0?this.bind(b,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),G.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),H.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(V(c[0])||V(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c),g=S.call(arguments);O.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!U[a]?f.unique(e):e,(this.length>1||Q.test(d))&&P.test(a)&&(e=e.reverse());return this.pushStack(e,a,g.join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var Y="abbr article aside audio canvas datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",Z=/ jQuery\d+="(?:\d+|null)"/g,$=/^\s+/,_=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,ba=/<([\w:]+)/,bb=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},bk=X(c);bj.optgroup=bj.option,bj.tbody=bj.tfoot=bj.colgroup=bj.caption=bj.thead,bj.th=bj.td,f.support.htmlSerialize||(bj._default=[1,"div
","
"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){f(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after" -,arguments);a.push.apply(a,f(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Z,""):null;if(typeof a=="string"&&!bd.test(a)&&(f.support.leadingWhitespace||!$.test(a))&&!bj[(ba.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(_,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d=a.cloneNode(!0),e,g,h;if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bn(a,d),e=bo(a),g=bo(d);for(h=0;e[h];++h)g[h]&&bn(e[h],g[h])}if(b){bm(a,d);if(c){e=bo(a),g=bo(d);for(h=0;e[h];++h)bm(e[h],g[h])}}e=g=null;return d},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!bc.test(k))k=b.createTextNode(k);else{k=k.replace(_,"<$1>");var l=(ba.exec(k)||["",""])[1].toLowerCase(),m=bj[l]||bj._default,n=m[0],o=b.createElement("div");b===c?bk.appendChild(o):X(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=bb.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&$.test(k)&&o.insertBefore(b.createTextNode($.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bt.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bs,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bs.test(g)?g.replace(bs,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bB(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bC=function(a,c){var d,e,g;c=c.replace(bu,"-$1").toLowerCase();if(!(e=a.ownerDocument.defaultView))return b;if(g=e.getComputedStyle(a,null))d=g.getPropertyValue(c),d===""&&!f.contains(a.ownerDocument.documentElement,a)&&(d=f.style(a,c));return d}),c.documentElement.currentStyle&&(bD=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bv.test(f)&&bw.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bB=bC||bD,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bF=/%20/g,bG=/\[\]$/,bH=/\r?\n/g,bI=/#.*$/,bJ=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bK=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bL=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bM=/^(?:GET|HEAD)$/,bN=/^\/\//,bO=/\?/,bP=/)<[^<]*)*<\/script>/gi,bQ=/^(?:select|textarea)/i,bR=/\s+/,bS=/([?&])_=[^&]*/,bT=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bU=f.fn.load,bV={},bW={},bX,bY,bZ=["*/"]+["*"];try{bX=e.href}catch(b$){bX=c.createElement("a"),bX.href="",bX=bX.href}bY=bT.exec(bX.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bU)return bU.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
").append(c.replace(bP,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bQ.test(this.nodeName)||bK.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bH,"\r\n")}}):{name:b.name,value:c.replace(bH,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.bind(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?cb(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),cb(a,b);return a},ajaxSettings:{url:bX,isLocal:bL.test(bY[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bZ},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:b_(bV),ajaxTransport:b_(bW),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cd(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=ce(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bJ.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bI,"").replace(bN,bY[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bR),d.crossDomain==null&&(r=bT.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bY[1]&&r[2]==bY[2]&&(r[3]||(r[1]==="http:"?80:443))==(bY[3]||(bY[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),ca(bV,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bM.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bO.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bS,"$1_="+x);d.url=y+(y===d.url?(bO.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bZ+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=ca(bW,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){s<2?w(-1,z):f.error(z)}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)cc(g,a[g],c,e);return d.join("&").replace(bF,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cf=f.now(),cg=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cf++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(cg.test(b.url)||e&&cg.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(cg,l),b.url===j&&(e&&(k=k.replace(cg,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var ch=a.ActiveXObject?function(){for(var a in cj)cj[a](0,1)}:!1,ci=0,cj;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ck()||cl()}:ck,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,ch&&delete cj[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++ci,ch&&(cj||(cj={},f(a).unload(ch)),cj[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cm={},cn,co,cp=/^(?:toggle|show|hide)$/,cq=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cr,cs=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],ct;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cw("show",3),a,b,c);for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cz.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cz.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cA(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cA(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f})(window); \ No newline at end of file diff --git a/dist/jstree.js b/dist/jstree.js new file mode 100644 index 00000000..56334c9d --- /dev/null +++ b/dist/jstree.js @@ -0,0 +1,5543 @@ +/*! jstree - v1.0.0 - 2012-04-09 +* http://jstree.com +* Copyright (c) 2012 Ivan Bozhanov; Licensed MIT, GPL */ + +/* +File: Helper functions +This file includes some functions that enable CSS manipulations, contextmenus, XSLT transformations and drag'n'drop. +All of those work independently of jstree. +*/ + +/* +Variable: $.vakata +*object* Holds all helper objects. +*/ +(function ($) { + $.vakata = {}; +})(jQuery); + +/* +Group: Miscellaneous +Various small snippets. +*/ + +/* +Function: $().vakata_reverse +Makes it possible to apply the standard array reverse function to a jQuery collection. + +Input: +>
1
2
3
+> $("div").vakata_reverse().each(function () { document.write(this.innerHTML); }); + +Output: +>321 +*/ +(function ($) { + $.fn.vakata_reverse = [].reverse; +})(jQuery); + +(function ($) { + jQuery.expr[':'].vakata_icontains = function(a,i,m){ + return (a.textContent || a.innerText || "").toLowerCase().indexOf(m[3].toLowerCase())>=0; + }; +})(jQuery); + +/* +Function: $.vakata.array_remove +Makes it possible to remove an item (or a group of items) form an array. +http://ejohn.org/blog/javascript-array-remove/ + +Input: +> $.vakata.array_remove(['a', 'b', 'c'], 1); + +Output: +>['a', 'c'] +*/ +(function ($) { + $.vakata.array_remove = function(array, from, to) { + var rest = array.slice((to || from) + 1 || array.length); + array.length = from < 0 ? array.length + from : from; + array.push.apply(array, rest); + return array; + }; +})(jQuery); + +/* +Function: $.vakata.array_unique +Returns only the unique items from an array. + +Input: +> $.vakata.array_unique(['c','a','a','b','c','b']); + +Output: +>['a', 'b', 'c'] +*/ +(function ($) { + $.vakata.array_unique = function(array) { + var a = [], i, j, l; + for(i = 0, l = array.length; i < l; i++) { + for(j = 0; j <= i; j++) { + if(array[i] === array[j]) { + break; + } + } + if(j === i) { a.push(array[i]); } + } + return a; + }; +})(jQuery); + +/* +Function: $.vakata.attributes +Collects all attributes from a DOM node. +*/ +(function ($) { + $.vakata.attributes = function(node, with_values) { + node = $(node)[0]; + var attr = with_values ? {} : []; + $.each(node.attributes, function (i, v) { + if($.inArray(v.nodeName.toLowerCase(),['style','contenteditable','hasfocus','tabindex']) !== -1) { return; } + if(v.nodeValue !== null && $.trim(v.nodeValue) !== '') { + if(with_values) { attr[v.nodeName] = v.nodeValue; } + else { attr.push(v.nodeName); } + } + }); + return attr; + }; +})(jQuery); + +/* +Function: $.vakata.get_scrollbar_width +Gets the width of the scrollbar +*/ +(function ($) { + var sb; + $.vakata.get_scrollbar_width = function () { + var e1, e2; + if(!sb) { + if(/msie/.test(navigator.userAgent.toLowerCase())) { + e1 = $('').css({ position: 'absolute', top: -1000, left: 0 }).appendTo('body'); + e2 = $('').css({ position: 'absolute', top: -1000, left: 0 }).appendTo('body'); + sb = e1.width() - e2.width(); + e1.add(e2).remove(); + } + else { + e1 = $('
').css({ width: 100, height: 100, overflow: 'auto', position: 'absolute', top: -1000, left: 0 }) + .prependTo('body').append('
').find('div').css({ width: '100%', height: 200 }); + sb = 100 - e1.width(); + e1.parent().remove(); + } + } + return sb; + }; +})(jQuery); + +/* +Group: CSS +Functions needed to manipulate stylesheets (add, remove, change) +*/ +(function ($) { + /* + Variable: $.vakata.css + *object* holds all CSS related functions + */ + $.vakata.css = { + /* + Function: $.vakata.css.get_css + Retrieves or deletes a specific rule. + + Parameters: + rule_name - *string* the rule to search for (any CSS rule) + delete_flag - *boolean* whether you want to delete or simply retrieve a reference to the rule + sheet - the sheet to search in (do not specify this to search in all sheets) + + Returns either: + a reference to the rule - if it was found and the delete flag was not set + true - if the delete flag was set and the rule was successfully removed + false - if the rule could not be found + + See also: + <$.vakata.css.remove_css> + */ + get_css : function(rule_name, delete_flag, sheet) { + rule_name = rule_name.toLowerCase(); + var css_rules = sheet.cssRules || sheet.rules, + j = 0; + do { + if(css_rules.length && j > css_rules.length + 5) { return false; } + if(css_rules[j].selectorText && css_rules[j].selectorText.toLowerCase() === rule_name) { + if(delete_flag === true) { + if(sheet.removeRule) { sheet.removeRule(j); } + if(sheet.deleteRule) { sheet.deleteRule(j); } + return true; + } + else { return css_rules[j]; } + } + } + while (css_rules[++j]); + return false; + }, + /* + Function: $.vakata.css.add_css + Adds a rule. + + Parameters: + rule_name - *string* the rule to add + sheet - a reference to the sheet to add to + + Returns either: + a reference to the rule - if the rule was added + false - if the rule could not be added, or if such a rule already exists + */ + add_css : function(rule_name, sheet) { + if($.jstree.css.get_css(rule_name, false, sheet)) { return false; } + if(sheet.insertRule) { sheet.insertRule(rule_name + ' { }', 0); } else { sheet.addRule(rule_name, null, 0); } + return $.vakata.css.get_css(rule_name); + }, + /* + Function: $.vakata.css.remove_css + Removes a rule, this functions is a shortcut to <$.vakata.css.get_css> with the delete flag set to true. + + Parameters: + rule_name - *string* the rule to remove + sheet - the sheet to remove from (you can omit this and all sheets will be searched) + + Returns either: + true - if rule was removed + false - if the rule could not be removed + + See also: + <$.vakata.css.get_css> + */ + remove_css : function(rule_name, sheet) { + return $.vakata.css.get_css(rule_name, true, sheet); + }, + /* + Function: $.vakata.css.add_sheet + Adds a whole stylesheet or appends to an existing stylesheet. + + Parameters: + options - *object*: + options.url - location of the stylesheet - when this is supplied _options.str_ and _options.title_ should not be set and a new LINK element is always created + options.str - text content of the stylesheet - when this is supplied _options.url_ is not used. A STYLE element is used. + options.title - the ID of the added stylesheet (if you pass `foo` the ID will be `foo-stylesheet`), when the stylesheet exists the content is appended and no new stylesheet is created. + + Returns: + a reference to the stylesheet + */ + add_sheet : function(opts) { + var tmp = false, is_new = true; + if(opts.str) { + if(opts.title) { tmp = $("style[id='" + opts.title + "-stylesheet']")[0]; } + if(tmp) { is_new = false; } + else { + tmp = document.createElement("style"); + tmp.setAttribute('type',"text/css"); + if(opts.title) { tmp.setAttribute("id", opts.title + "-stylesheet"); } + } + if(tmp.styleSheet) { + if(is_new) { + document.getElementsByTagName("head")[0].appendChild(tmp); + tmp.styleSheet.cssText = opts.str; + } + else { + tmp.styleSheet.cssText = tmp.styleSheet.cssText + " " + opts.str; + } + } + else { + tmp.appendChild(document.createTextNode(opts.str)); + document.getElementsByTagName("head")[0].appendChild(tmp); + } + return tmp.sheet || tmp.styleSheet; + } + if(opts.url) { + if(document.createStyleSheet) { + try { tmp = document.createStyleSheet(opts.url); } catch (e) { } + } + else { + tmp = document.createElement('link'); + tmp.rel = 'stylesheet'; + tmp.type = 'text/css'; + tmp.media = "all"; + tmp.href = opts.url; + document.getElementsByTagName("head")[0].appendChild(tmp); + return tmp.styleSheet; + } + } + } + }; +})(jQuery); + +/* +Group: Drag'n'drop +Functions needed to drag'n'drop elements +*/ +(function ($) { + // private variable + var vakata_dnd = { + element : false, + is_down : false, + is_drag : false, + helper : false, + helper_w: 0, + data : false, + init_x : 0, + init_y : 0, + scroll_l: 0, + scroll_t: 0, + scroll_e: false, + scroll_i: false + }; + /* + Variable: $.vakata.dnd + *object* holds all DND related functions + */ + $.vakata.dnd = { + /* + Variable: $.vakata.dnd.settings + *object* holds the global settings object for DND. You can easily modify any of the settings. + >// modification example + >$.vakata.dnd.settings.threshold = 10; + */ + settings : { + /* + Variable: $.vakata.dnd.settings.scroll_speed + *integer* how fast (pixel count for each step) should a scrollable parent scroll when dragging near the edge. Default is _10_. + */ + scroll_speed : 10, + /* + Variable: $.vakata.dnd.settings.scroll_proximity + *integer* number of pixels from the edge of a scrollable parent below which the parent will start scrolling. Default is _20_. + */ + scroll_proximity : 20, + /* + Variable: $.vakata.dnd.settings.helper_left + *integer* number of pixels left of the cursor to move the drag-helper to. Default is _5_; + */ + helper_left : 5, + /* + Variable: $.vakata.dnd.settings.helper_top + *integer* number of pixels below the cursor to move the drag-helper to. Default is _10_. + */ + helper_top : 10, + /* + Variable: $.vakata.dnd.settings.threshold + *integer* amount of pixels required to move before the drag is started. Default is _5_. + */ + threshold : 5 + }, + /* + Function: $.vakata.dnd._trigger + Used internally to trigger all necessary events. + */ + _trigger : function (event_name, e) { + var data = $.vakata.dnd._get(); + data.event = e; + $(document).triggerHandler("dnd_" + event_name + ".vakata", data); + }, + /* + Function: $.vakata.dnd._get + Used internally to get all items for the drag event. Can be used by foreign code too. + */ + _get : function () { + return { + "data" : vakata_dnd.data, + "element" : vakata_dnd.element, + "helper" : vakata_dnd.helper + }; + }, + /* + Function: $.vakata.dnd._clean + Used internally to cleanup after a drop, so that all variables are nulled and ready for the next drag. + */ + _clean : function () { + if(vakata_dnd.helper) { vakata_dnd.helper.remove(); } + if(vakata_dnd.scroll_i) { clearInterval(vakata_dnd.scroll_i); vakata_dnd.scroll_i = false; } + vakata_dnd = { + element : false, + is_down : false, + is_drag : false, + helper : false, + helper_w: 0, + data : false, + init_x : 0, + init_y : 0, + scroll_l: 0, + scroll_t: 0, + scroll_e: false, + scroll_i: false + }; + $(document).unbind("mousemove", $.vakata.dnd.drag); + $(document).unbind("mouseup", $.vakata.dnd.stop); + }, + /* + Function: $.vakata.dnd._scroll + Used internally to scroll hovered elements. + + Triggers: + + + Event: dnd_scroll + Fires when a container is scrolled due to dragging near its edge. Triggered on the document, the event is fired in the *vakata* namespace. + + Parameters: + data.event - the scrolled element + data.data - the data you supplied when calling <$.vakata.dnd.start> + data.element - the origin element + data.helper - the jquery extended drag-helper node (or false if it is not used) + + Example: + >$(document).bind("dnd_start.vakata", function (e, data) { + > // do something + >}); + */ + _scroll : function (init_only) { + if(!vakata_dnd.scroll_e || (!vakata_dnd.scroll_l && !vakata_dnd.scroll_t)) { + if(vakata_dnd.scroll_i) { clearInterval(vakata_dnd.scroll_i); vakata_dnd.scroll_i = false; } + return false; + } + if(!vakata_dnd.scroll_i) { + vakata_dnd.scroll_i = setInterval($.vakata.dnd._scroll, 100); + return false; + } + if(init_only === true) { return false; } + + var i = vakata_dnd.scroll_e.scrollTop(), + j = vakata_dnd.scroll_e.scrollLeft(); + vakata_dnd.scroll_e.scrollTop(i + vakata_dnd.scroll_t * $.vakata.dnd.settings.scroll_speed); + vakata_dnd.scroll_e.scrollLeft(j + vakata_dnd.scroll_l * $.vakata.dnd.settings.scroll_speed); + if(i !== vakata_dnd.scroll_e.scrollTop() || j !== vakata_dnd.scroll_e.scrollLeft()) { + $.vakata.dnd._trigger("scroll", vakata_dnd.scroll_e); + } + }, + /* + Function: $.vakata.dnd.start + Use this function to start a drag (usually with the mousedown event) + + Parameters: + event - *event* the event which started the drag, when used with the mousedown event text selection is prevented + data - *mixed* some custom data you want to bind with that particular drag - you will receive this in all events + html - *mixed* the text for the drag-helper as a *string*, if set to _false_ no helper is shown + + Returns: + false + + Example: + >$("span").bind("mousedown", function (e) { + > return $.vakata.dnd.start(e, {}, "Dragging"); + >}); + */ + start : function (e, data, html) { + if(vakata_dnd.is_drag) { $.vakata.dnd.stop({}); } + try { + e.currentTarget.unselectable = "on"; + e.currentTarget.onselectstart = function() { return false; }; + if(e.currentTarget.style) { e.currentTarget.style.MozUserSelect = "none"; } + } catch(err) { } + vakata_dnd.init_x = e.pageX; + vakata_dnd.init_y = e.pageY; + vakata_dnd.data = data; + vakata_dnd.is_down = true; + vakata_dnd.element = e.currentTarget; + if(html !== false) { + vakata_dnd.helper = $("
").html(html).css({ + "display" : "block", + "margin" : "0", + "padding" : "0", + "position" : "absolute", + "top" : "-2000px", + "lineHeight" : "16px", + "zIndex" : "10000" + }); + } + $(document).bind("mousemove", $.vakata.dnd.drag); + $(document).bind("mouseup", $.vakata.dnd.stop); + return false; + }, + /* + Function: $.vakata.dnd.drag + Used internally to process the mousemove event after <$.vakata.dnd.start> is called. + + Parameters: + event - *event* the mousemove event + + Triggers: + , + */ + drag : function (e) { + if(!vakata_dnd.is_down) { return; } + if(!vakata_dnd.is_drag) { + if( + Math.abs(e.pageX - vakata_dnd.init_x) > $.vakata.dnd.settings.threshold || + Math.abs(e.pageY - vakata_dnd.init_y) > $.vakata.dnd.settings.threshold + ) { + if(vakata_dnd.helper) { + vakata_dnd.helper.appendTo("body"); + vakata_dnd.helper_w = vakata_dnd.helper.outerWidth(); + } + vakata_dnd.is_drag = true; + /* + Event: dnd_start + Marks the start of the drag. Triggered on the document after a drag is initiated using <$.vakata.dnd.start> and the user has moved more than <$.vakata.dnd.settings.threshold> pixels, the event is fired in the *vakata* namespace. + + Parameters: + data.event - the mousemove event + data.data - the data you supplied when calling <$.vakata.dnd.start> + data.element - the origin element + data.helper - the jquery extended drag-helper node (or false if it is not used) + + Example: + >$(document).bind("dnd_start.vakata", function (e, data) { + > // do something + >}); + */ + $.vakata.dnd._trigger("start", e); + } + else { return; } + } + + var d = false, w = false, + dh = false, wh = false, + dw = false, ww = false, + dt = false, dl = false, + ht = false, hl = false; + + vakata_dnd.scroll_t = 0; + vakata_dnd.scroll_l = 0; + vakata_dnd.scroll_e = false; + var p = $(e.target) + .parentsUntil("body").andSelf().vakata_reverse() + .filter(function () { + return (/^auto|scroll$/).test($(this).css("overflow")) && + (this.scrollHeight > this.offsetHeight || this.scrollWidth > this.offsetWidth); + }) + .each(function () { + var t = $(this), o = t.offset(); + if(this.scrollHeight > this.offsetHeight) { + if(o.top + t.height() - e.pageY < $.vakata.dnd.settings.scroll_proximity) { vakata_dnd.scroll_t = 1; } + if(e.pageY - o.top < $.vakata.dnd.settings.scroll_proximity) { vakata_dnd.scroll_t = -1; } + } + if(this.scrollWidth > this.offsetWidth) { + if(o.left + t.width() - e.pageX < $.vakata.dnd.settings.scroll_proximity) { vakata_dnd.scroll_l = 1; } + if(e.pageX - o.left < $.vakata.dnd.settings.scroll_proximity) { vakata_dnd.scroll_l = -1; } + } + if(vakata_dnd.scroll_t || vakata_dnd.scroll_l) { + vakata_dnd.scroll_e = $(this); + return false; + } + }); + + if(!vakata_dnd.scroll_e) { + d = $(document); w = $(window); + dh = d.height(); wh = w.height(); + dw = d.width(); ww = w.width(); + dt = d.scrollTop(); dl = d.scrollLeft(); + if(dh > wh && e.pageY - dt < $.vakata.dnd.settings.scroll_proximity) { vakata_dnd.scroll_t = -1; } + if(dh > wh && wh - (e.pageY - dt) < $.vakata.dnd.settings.scroll_proximity) { vakata_dnd.scroll_t = 1; } + if(dw > ww && e.pageX - dl < $.vakata.dnd.settings.scroll_proximity) { vakata_dnd.scroll_l = -1; } + if(dw > ww && ww - (e.pageX - dl) < $.vakata.dnd.settings.scroll_proximity) { vakata_dnd.scroll_l = 1; } + if(vakata_dnd.scroll_t || vakata_dnd.scroll_l) { + vakata_dnd.scroll_e = d; + } + } + if(vakata_dnd.scroll_e) { $.vakata.dnd._scroll(true); } + + if(vakata_dnd.helper) { + ht = parseInt(e.pageY + $.vakata.dnd.settings.helper_top, 10); + hl = parseInt(e.pageX + $.vakata.dnd.settings.helper_left, 10); + if(dh && ht + 25 > dh) { ht = dh - 50; } + if(dw && hl + vakata_dnd.helper_w > dw) { hl = dw - (vakata_dnd.helper_w + 2); } + vakata_dnd.helper.css({ + left : hl + "px", + top : ht + "px" + }); + } + /* + Event: dnd_move + Triggered multiple times while dragging. This event is triggered on the document after the event when the user moves the mouse, the event is fired in the *vakata* namespace. + + Parameters: + data.event - the mousemove event + data.data - the data you supplied when calling <$.vakata.dnd.start> + data.element - the origin element + data.helper - the jquery extended drag-helper node (or false if it is not used) + + Example: + >$(document).bind("dnd_move.vakata", function (e, data) { + > // do something + >}); + */ + $.vakata.dnd._trigger("move", e); + }, + /* + Function: $.vakata.dnd.stop + Used internally to process the mouseup event (drop) after <$.vakata.dnd.start> is called. + + Parameters: + event - *event* the mouseup event + + Triggers: + + */ + stop : function (e) { + /* + Event: dnd_stop + Marks the end of the drag. This event is triggered on the document after (and possibly ) when a drop (mouseup) occurs or when the drag is programatically terminated, the event is fired in the *vakata* namespace. + + Parameters: + data.event - the mouseup event (or _null_ if stopped programatically using <$.vakata.dnd.stop>()) + data.data - the data you supplied when calling <$.vakata.dnd.start> + data.element - the origin element + data.helper - the jquery extended drag-helper node (or false if it is not used) + + Example: + >$(document).bind("dnd_stop.vakata", function (e, data) { + > // do something + >}); + */ + if(vakata_dnd.is_drag) { + $.vakata.dnd._trigger("stop", e); + } + $.vakata.dnd._clean(); + } + }; +})(jQuery); + +/* +Group: XSLT +A function used to do XSLT transformations. +*/ +(function ($) { + /* + Function: $.vakata.xslt + This functions transforms a XML string using a XSL string. The result is passed to a callback function. + + Parameters: + xml - *string* the source xml string + xsl - *string* the xsl string + + Returns: + the transformed result (or _false_ on failure) + + Example: + >// simple + >$.vakata.xslt("", "", function (res) { $("#some-container").append(res); }); + >// with scope + >$.vakata.xslt("", "", $.proxy(function (res) { + > this.some_process(res); + >}, some_object); + */ + $.vakata.xslt = function (xml, xsl) { + var r = false, p, q, s; + // IE9 + if(r === false && window.ActiveXObject) { + try { + r = new ActiveXObject("Msxml2.XSLTemplate"); + q = new ActiveXObject("Msxml2.DOMDocument"); + q.loadXML(xml); + s = new ActiveXObject("Msxml2.FreeThreadedDOMDocument"); + s.loadXML(xsl); + r.stylesheet = s; + p = r.createProcessor(); + p.input = q; + p.transform(); + r = p.output; + } + catch (e) { } + } + xml = $.parseXML(xml); + xsl = $.parseXML(xsl); + // FF, Chrome + if(r === false && typeof (XSLTProcessor) !== "undefined") { + p = new XSLTProcessor(); + p.importStylesheet(xsl); + r = p.transformToFragment(xml, document); + r = $('
').append(r).html(); + } + // OLD IE + if(r === false && typeof (xml.transformNode) !== "undefined") { + r = xml.transformNode(xsl); + } + return r; + }; +})(jQuery); + +/* +Group: Hotkeys +Copy of the John Resig's fork of http://github.com/tzuryby/hotkeys for consistency +*/ +if(typeof jQuery.hotkeys === "undefined") { + (function ($) { + $.vakata_hotkeys = { + version: "0.8", + + specialKeys: { + 8: "backspace", 9: "tab", 13: "return", 16: "shift", 17: "ctrl", 18: "alt", 19: "pause", + 20: "capslock", 27: "esc", 32: "space", 33: "pageup", 34: "pagedown", 35: "end", 36: "home", + 37: "left", 38: "up", 39: "right", 40: "down", 45: "insert", 46: "del", + 96: "0", 97: "1", 98: "2", 99: "3", 100: "4", 101: "5", 102: "6", 103: "7", + 104: "8", 105: "9", 106: "*", 107: "+", 109: "-", 110: ".", 111 : "/", + 112: "f1", 113: "f2", 114: "f3", 115: "f4", 116: "f5", 117: "f6", 118: "f7", 119: "f8", + 120: "f9", 121: "f10", 122: "f11", 123: "f12", 144: "numlock", 145: "scroll", 191: "/", 224: "meta" + }, + + shiftNums: { + "`": "~", "1": "!", "2": "@", "3": "#", "4": "$", "5": "%", "6": "^", "7": "&", + "8": "*", "9": "(", "0": ")", "-": "_", "=": "+", ";": ": ", "'": "\"", ",": "<", + ".": ">", "/": "?", "\\": "|" + } + }; + + function keyHandler( handleObj ) { + // Only care when a possible input has been specified + if ( typeof handleObj.data !== "string" ) { + return; + } + + var origHandler = handleObj.handler, + keys = handleObj.data.toLowerCase().split(" "); + + handleObj.handler = function( event ) { + // Don't fire in text-accepting inputs that we didn't directly bind to + if ( this !== event.target && (/textarea|select/i.test( event.target.nodeName ) || + event.target.type === "text") ) { + return; + } + + // Keypress represents characters, not special keys + var special = event.type !== "keypress" && jQuery.vakata_hotkeys.specialKeys[ event.which ], + character = String.fromCharCode( event.which ).toLowerCase(), + key, modif = "", possible = {}; + + // check combinations (alt|ctrl|shift+anything) + if ( event.altKey && special !== "alt" ) { + modif += "alt+"; + } + + if ( event.ctrlKey && special !== "ctrl" ) { + modif += "ctrl+"; + } + + // TODO: Need to make sure this works consistently across platforms + if ( event.metaKey && !event.ctrlKey && special !== "meta" ) { + modif += "meta+"; + } + + if ( event.shiftKey && special !== "shift" ) { + modif += "shift+"; + } + + if ( special ) { + possible[ modif + special ] = true; + + } else { + possible[ modif + character ] = true; + possible[ modif + jQuery.vakata_hotkeys.shiftNums[ character ] ] = true; + + // "$" can be triggered as "Shift+4" or "Shift+$" or just "$" + if ( modif === "shift+" ) { + possible[ jQuery.vakata_hotkeys.shiftNums[ character ] ] = true; + } + } + + for ( var i = 0, l = keys.length; i < l; i++ ) { + if ( possible[ keys[i] ] ) { + return origHandler.apply( this, arguments ); + } + } + }; + } + + jQuery.each([ "keydown", "keyup", "keypress" ], function() { + jQuery.event.special[ this ] = { add: keyHandler }; + }); + })(jQuery); +} + +/* +Group: Context menu +Functions needed to show a custom context menu. +*/ +(function ($) { + var right_to_left = false, + vakata_context = { + element : false, + reference : false, + position_x : 0, + position_y : 0, + items : [], + html : "", + is_visible : false + }; + /* + Variable: $.vakata.context + *object* holds all context menu related functions and variables. + */ + $.vakata.context = { + /* + Variable: $.vakata.context.settings + *object* holds the global settings object for context menus. You can easily modify any of the settings. + >// modification example + >$.vakata.context.settings.icons = false; + */ + settings : { + /* + Variable: $.vakata.context.settings.hide_onmouseleave + *integer* the amount of milliseconds to wait before hiding the menu after mouseleave. If set to _0_ the menu won't hide on mouseleave. Default is _0_. + */ + hide_onmouseleave : 0, + /* + Variable: $.vakata.context.settings.icons + *boolean* whether to show icons or not. Default is _true_. + */ + icons : true + }, + /* + Function: $.vakata.context._trigger + Used internally to trigger all necessary events. + */ + _trigger : function (event_name) { + $(document).triggerHandler("context_" + event_name + ".vakata", { + "reference" : vakata_context.reference, + "element" : vakata_context.element, + "position" : { + "x" : vakata_context.position_x, + "y" : vakata_context.position_y + } + }); + }, + /* + Function: $.vakata.context._execute + Used internally to execute the action (if any) associated with an item. + + Parameters: + i - the item's internal index + */ + _execute : function (i) { + i = vakata_context.items[i]; + return i && !i._disabled && i.action ? i.action.call(null, { + "item" : i, + "reference" : vakata_context.reference, + "element" : vakata_context.element, + "position" : { + "x" : vakata_context.position_x, + "y" : vakata_context.position_y + } + }) : false; + }, + /* + Function: $.vakata.context._parse + Used internally to parse a contextmenu description object to an HTML string. + + Parameters: + o - *object* the contextmenu description object + is_callback - *boolean* used internally to indicate a recursive call + + Triggers: + + */ + _parse : function (o, is_callback) { + if(!o) { return false; } + if(!is_callback) { + vakata_context.html = ""; + vakata_context.items = []; + } + var str = "", + sep = false, + tmp; + + if(is_callback) { str += ""; } + /* + Event: context_parse + Triggered when the context menu is parsed but not yet shown. This event is triggered on the document in the *vakata* namespace. + + Parameters: + reference - the DOM node used when <$.vakata.context.show> was called + element - the DOM node of the context menu (not yet populated and shown) + position - an object consisting of _x_ and _y_ keys, represinting the position of the menu (not yet shown) + + Example: + >$(document).bind("context_parse.vakata", function (e, data) { + > // do something + >}); + */ + if(!is_callback) { vakata_context.html = str; $.vakata.context._trigger("parse"); } + return str.length > 10 ? str : false; + }, + /* + Function: $.vakata.context._show_submenu + Used internally to show a submenu + */ + _show_submenu : function (o) { + o = $(o); + if(!o.length || !o.children("ul").length) { return; } + var e = o.children("ul"), + x = o.offset().left + o.outerWidth(), + y = o.offset().top, + w = e.width(), + h = e.height(), + dw = $(document).width(), + dh = $(document).height(); + // може да се спести е една проверка - дали няма някой от класовете вече нагоре + if(right_to_left) { + o[x - (w + 10 + o.outerWidth()) < 0 ? "addClass" : "removeClass"]("vakata-context-left"); + } + else { + o[x + w + 10 > dw ? "addClass" : "removeClass"]("vakata-context-right"); + } + if(y + h + 10 > dh) { + e.css("bottom","-1px"); + } + e.show(); + }, + + /* + Function: $.vakata.context.show + Shows the context menu. Please note that at least one of _reference_ or _position_ should be specified. + + Parameters: + reference - *jquery* associate the menu with a DOM element (optional) + position - *object* should contain _x_ and _y_ properties, those are the coordinates to show the menu at (optional + data - *object* the contextmenu description object. It should consist of keys, each key should be a . If not specified the function will search for $(reference).data('vakata_contextmenu') and use that. + + Triggers: + + + Example: + >$(document).bind("contextmenu", function (e) { + > e.preventDefault(); + > $.vakata.context.show(false, { x: e.pageX, y:e.pageY }, { + > "create" : { + > // only specify what you need + > "separator_after" : true, + > "label" : "Create", + > "action" : function (data) { alert("Create"); } + > }, + > "rename" : { + > "label" : "Rename", + > "icon" : "./some-icon.png", + > "action" : function (data) { alert("Rename on " + data.reference); } + > }, + > "edit" : { + > "label" : "Edit", + > // Clicking this won't hide the menu, the same can be achieved with: + > // "action" : function () { return false; } + > "submenu" : { + > "copy" : { "label" : "Copy", "action" : function () { } }, + > "cut" : { "label" : "Cut", "action" : function () { } }, + > "paste" : { "label" : "Paste", "_disabled" : true, "action" : function () { } } + > } + > }, + > "delete" : { + > "separator_before" : true, + > "label" : "Delete", + > "action" : function (data) { alert("Delete"); } + > } + > }); + >}); + + Variable: context_menu_item + *object* Used to construct a context menu entry, this structure will always be a part of an object. + + separator_before - *boolean* should there be a separator before the item. Default is _false_. + separator_after - *boolean* should there be a separator after the item. Default is _false_. + icon - *string* if supplied this string is used for an icon, if it contains _/_ it is treated as file, otherwise it is applied as a class on an INS object. + label - *string* the text for this item + submenu - *object* if supplied this object is used to build a submenu. It should consist of keys, each of which is a . + _class - *string* if supplied this class is applied to the LI node. + _disabled - *boolean* is this item disabled. + action - *functon* if supplied it will be executed when this item is clicked / activated. If not supplied or the function returns _false_ the contextmenu won't be hidden after execution. To force a context use _$.proxy_. + In the function you will receive a single argument which is an object, consisting of four keys: + _item_ (the object), + _reference_ (the DOM node used when <$.vakata.context.show> was called), + _element_ (the DOM node of the context menu), + _position_ (an object consisting of _x_ and _y_ keys, represinting the current position of the menu) + + See also: + <$.vakata.context.show> + */ + show : function (reference, position, data) { + if(vakata_context.element && vakata_context.element.length) { + vakata_context.element.width(''); + } + switch(!0) { + case (!position && !reference): + return false; + case (!!position && !!reference): + vakata_context.reference = reference; + vakata_context.position_x = position.x; + vakata_context.position_y = position.y; + break; + case (!position && !!reference): + vakata_context.reference = reference; + var o = reference.offset(); + vakata_context.position_x = o.left + reference.outerHeight(); + vakata_context.position_y = o.top; + break; + case (!!position && !reference): + vakata_context.position_x = position.x; + vakata_context.position_y = position.y; + break; + } + if(!!reference && !data && $(reference).data('vakata_contextmenu')) { + data = $(reference).data('vakata_contextmenu'); + } + if($.vakata.context._parse(data)) { + vakata_context.element.html(vakata_context.html); + } + if(vakata_context.items.length) { + var e = vakata_context.element, + x = vakata_context.position_x, + y = vakata_context.position_y, + w = e.width(), + h = e.height(), + dw = $(document).width(), + dh = $(document).height(); + + if(x + w + 20 > dw) { + x = dw - (w + 20); + } + if(y + h + 20 > dh) { + y = dh - (h + 20); + } + + vakata_context.element + .css({ "left" : x, "top" : y }) + .show() + .width(vakata_context.element.outerWidth()); // for ie6 + vakata_context.is_visible = true; + /* + Event: context_show + Triggered when the context menu is shown. This event is triggered on the document in the *vakata* namespace. + + Parameters: + reference - the DOM node used when <$.vakata.context.show> was called + element - the DOM node of the context menu + position - an object consisting of _x_ and _y_ keys, represinting the position of the menu + + Example: + >$(document).bind("context_show.vakata", function (e, data) { + > // do something + >}); + */ + $.vakata.context._trigger("show"); + } + }, + /* + Function: $.vakata.context.hide + Used internally to hide the contextmenu after a click, or on mouseleave, etc. + + Triggers: + + */ + hide : function () { + if(vakata_context.is_visible) { + vakata_context.element.hide().find("ul").hide(); + vakata_context.is_visible = false; + /* + Event: context_hide + Triggered when the context menu is hidden. This event is triggered on the document in the *vakata* namespace. + + Parameters: + reference - the DOM node used when <$.vakata.context.show> was called + element - the DOM node of the context menu + position - an object consisting of _x_ and _y_ keys, represinting the position of the menu + + Example: + >$(document).bind("context_hide.vakata", function (e, data) { + > // do something + >}); + */ + $.vakata.context._trigger("hide"); + } + } + }; + $(function () { + right_to_left = $("body").css("direction") === "rtl"; + var to = false, + css_string = '' + + '.vakata-context { display:none; _width:1px; } ' + + '.vakata-context, ' + + '.vakata-context ul { margin:0; padding:2px; position:absolute; background:#f5f5f5; border:1px solid #979797; ' + + ' -moz-box-shadow:5px 5px 4px -4px #666666; -webkit-box-shadow:2px 2px 2px #999999; box-shadow:2px 2px 2px #999999; }' + + '.vakata-context ul { list-style:none; left:100%; margin-top:-2.7em; margin-left:-4px; } ' + + '.vakata-context li.vakata-context-right ul { left:auto; right:100%; margin-left:auto; margin-right:-4px; } ' + + '.vakata-context li { list-style:none; display:inline; }' + + '.vakata-context li a { display:block; padding:0 2em 0 2em; text-decoration:none; width:auto; color:black; white-space:nowrap; line-height:2.4em; ' + + ' -moz-text-shadow:1px 1px 0px white; -webkit-text-shadow:1px 1px 0px white; text-shadow:1px 1px 0px white; ' + + ' -moz-border-radius:1px; -webkit-border-radius:1px; border-radius:1px; }' + + '.vakata-context li a:hover { position:relative; background-color:#e8eff7; ' + + ' -moz-box-shadow:0px 0px 2px #0a6aa1; -webkit-box-shadow:0px 0px 2px #0a6aa1; box-shadow:0px 0px 2px #0a6aa1; }' + + '.vakata-context li.vakata-context-hover > a { position:relative; background-color:#e8eff7; ' + + ' -moz-box-shadow:0px 0px 2px #0a6aa1; -webkit-box-shadow:0px 0px 2px #0a6aa1; box-shadow:0px 0px 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.vakata-context-separator a, ' + + '.vakata-context li.vakata-context-separator a:hover { background:white; 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; _overflow:hidden; ' + + ' -moz-text-shadow:0 0 0 transparent; -webkit-text-shadow:0 0 0 transparent; text-shadow:0 0 0 transparent; ' + + ' -moz-box-shadow:0 0 0 transparent; -webkit-box-shadow:0 0 0 transparent; box-shadow:0 0 0 transparent; ' + + ' -moz-border-radius:0; -webkit-border-radius:0; border-radius:0; }' + + '.vakata-context li.vakata-contextmenu-disabled a, .vakata-context li.vakata-contextmenu-disabled a:hover { color:silver; background-color:transparent; border:0; box-shadow:0 0 0; }' + + '' + + '.vakata-context li a ins { text-decoration:none; display:inline-block; width:2.4em; height:2.4em; background:transparent; margin:0 0 0 -2em; } ' + + '.vakata-context li a span { display:inline-block; width:1px; height:2.4em; background:white; margin:0 0.5em 0 0; border-left:1px solid #e2e3e3; _overflow:hidden; } ' + + '' + + '.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 li.vakata-context-separator a { margin:0 2.4em 0 0; border-left:0; border-right:1px solid #e2e3e3;} ' + + '.vakata-context-rtl li.vakata-context-left ul { right:auto; left:100%; margin-left:-4px; margin-right:auto; } ' + + '.vakata-context-rtl li a ins { margin:0 -2em 0 0; } ' + + '.vakata-context-rtl li a span { margin:0 0 0 0.5em; border-left-color:white; background:#e2e3e3; } ' + + ''; + $.vakata.css.add_sheet({ str : css_string, title : "vakata-context" }); + + vakata_context.element = $("
    "); + vakata_context.element + .delegate("li", "mouseenter", function (e) { + e.stopImmediatePropagation(); + + if($.contains(this, e.relatedTarget)) { + // премахнато заради delegate mouseleave по-долу + // $(this).find(".vakata-context-hover").removeClass("vakata-context-hover"); + return; + } + + if(to) { clearTimeout(to); } + vakata_context.element.find(".vakata-context-hover").removeClass("vakata-context-hover").end(); + + $(this) + .siblings().find("ul").hide().end().end() + .parentsUntil(".vakata-context", "li").andSelf().addClass("vakata-context-hover"); + $.vakata.context._show_submenu(this); + }) + // тестово - дали не натоварва? + .delegate("li", "mouseleave", function (e) { + if($.contains(this, e.relatedTarget)) { return; } + $(this).find(".vakata-context-hover").andSelf().removeClass("vakata-context-hover"); + }) + .bind("mouseleave", function (e) { + $(this).find(".vakata-context-hover").removeClass("vakata-context-hover"); + if($.vakata.context.settings.hide_onmouseleave) { + to = setTimeout( + (function (t) { + return function () { $.vakata.context.hide(); }; + })(this), $.vakata.context.settings.hide_onmouseleave); + } + }) + .delegate("a", "click", function (e) { + e.preventDefault(); + }) + .delegate("a", "mouseup", function (e) { + if(!$(this).blur().parent().hasClass("vakata-context-disabled") && $.vakata.context._execute($(this).attr("rel")) !== false) { + $.vakata.context.hide(); + } + }) + .appendTo("body"); + + $(document) + .bind("mousedown", function (e) { + if(vakata_context.is_visible && !$.contains(vakata_context.element[0], e.target)) { $.vakata.context.hide(); } + }) + .bind("context_show.vakata", function (e, data) { + vakata_context.element.find("li:has(ul)").children("a").addClass("vakata-context-parent"); + if(right_to_left) { + vakata_context.element.addClass("vakata-context-rtl").css("direction", "rtl"); + } + // also apply a RTL class? + vakata_context.element.find("ul").hide().end(); + }); + + if(typeof $.hotkeys !== "undefined" || typeof $.vakata_hotkeys !== "undefined") { + $(document) + .bind("keydown", "up", function (e) { + if(vakata_context.is_visible) { + var o = vakata_context.element.find("ul:visible").andSelf().last().children(".vakata-context-hover").removeClass("vakata-context-hover").prevAll("li:not(.vakata-context-separator)").first(); + if(!o.length) { o = vakata_context.element.find("ul:visible").andSelf().last().children("li:not(.vakata-context-separator)").last(); } + o.addClass("vakata-context-hover"); + e.stopImmediatePropagation(); + e.preventDefault(); + } + }) + .bind("keydown", "down", function (e) { + if(vakata_context.is_visible) { + var o = vakata_context.element.find("ul:visible").andSelf().last().children(".vakata-context-hover").removeClass("vakata-context-hover").nextAll("li:not(.vakata-context-separator)").first(); + if(!o.length) { o = vakata_context.element.find("ul:visible").andSelf().last().children("li:not(.vakata-context-separator)").first(); } + o.addClass("vakata-context-hover"); + e.stopImmediatePropagation(); + e.preventDefault(); + } + }) + .bind("keydown", "right", function (e) { + if(vakata_context.is_visible) { + vakata_context.element.find(".vakata-context-hover").last().children("ul").show().children("li:not(.vakata-context-separator)").removeClass("vakata-context-hover").first().addClass("vakata-context-hover"); + e.stopImmediatePropagation(); + e.preventDefault(); + } + }) + .bind("keydown", "left", function (e) { + if(vakata_context.is_visible) { + vakata_context.element.find(".vakata-context-hover").last().parents("li:eq(0)").find("ul").hide().find(".vakata-context-hover").removeClass("vakata-context-hover"); + e.stopImmediatePropagation(); + e.preventDefault(); + } + }) + .bind("keydown", "esc", function (e) { + $.vakata.context.hide(); + e.preventDefault(); + }) + .bind("keydown", "space", function (e) { + vakata_context.element.find(".vakata-context-hover").last().children("a").click(); + e.preventDefault(); + }); + } + }); +})(jQuery); + +/* +Group: JSON +Functions needed to encode/decode JSON. Based on the jQuery JSON Plugin. +*/ +(function ($) { + // private function for quoting strings + var _quote = function (str) { + var escapeable = /["\\\x00-\x1f\x7f-\x9f]/g, + meta = { '\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"' :'\\"','\\':'\\\\' }; + if(str.match(escapeable)) { + return '"' + str.replace(escapeable, function (a) { + var c = meta[a]; + if(typeof c === 'string') { return c; } + c = a.charCodeAt(); + return '\\u00' + Math.floor(c / 16).toString(16) + (c % 16).toString(16); + }) + '"'; + } + return '"' + str + '"'; + }; + /* + Variable: $.vakata.json + *object* holds all JSON related functions. + */ + $.vakata.json = { + /* + Function: $.vakata.json.encode + A function for encoding data in a JSON notated string. + + Parameters: + o - *mixed* the data to be encoded + + Returns: + string - the encoded data + */ + encode : function (o) { + if (o === null) { return "null"; } + + var tmp = [], i; + switch(typeof(o)) { + case "undefined": + return undefined; + case "number": + case "boolean": + return o + ""; + case "string": + return _quote(o); + case "object": + if($.isFunction(o.toJSON)) { + return $.vakata.json.encode(o.toJSON()); + } + if(o.constructor === Date) { + return '"' + + o.getUTCFullYear() + '-' + + String("0" + (o.getUTCMonth() + 1)).slice(-2) + '-' + + String("0" + o.getUTCDate()).slice(-2) + 'T' + + String("0" + o.getUTCHours()).slice(-2) + ':' + + String("0" + o.getUTCMinutes()).slice(-2) + ':' + + String("0" + o.getUTCSeconds()).slice(-2) + '.' + + String("00" + o.getUTCMilliseconds()).slice(-3) + 'Z"'; + } + if(o.constructor === Array) { + for(i = 0; i < o.length; i++) { + tmp.push( $.vakata.json.encode(o[i]) || "null" ); + } + return "[" + tmp.join(",") + "]"; + } + + $.each(o, function (i, v) { + if($.isFunction(v)) { return true; } + i = typeof i === "number" ? '"' + i + '"' : _quote(i); + v = $.vakata.json.encode(v); + tmp.push(i + ":" + v); + }); + return "{" + tmp.join(", ") + "}"; + } + }, + /* + Function: $.vakata.json.decode + Exists for consistency and is a simple wrapper for jQuery.parseJSON. + + Parameters: + json - the string to be decoded + + Returns: + Same as jQuery.parseJSON + */ + decode : function (json) { + return $.parseJSON(json); + } + }; +})(jQuery); + +/* +Group: Cookie +A copy of the jQuery cookie plugin. +*/ +(function ($) { + /* + Function: $.vakata.cookie + A function for getting and setting cookies. + + Parameters: + Same as the original plugin + + Returns: + string - the encoded data + */ + $.vakata.cookie = function (key, value, options) { + var days, t, result, decode; + if (arguments.length > 1 && String(value) !== "[object Object]") { + options = $.extend({}, options); + if(value === null || value === undefined) { options.expires = -1; } + if(typeof options.expires === 'number') { days = options.expires; t = options.expires = new Date(); t.setDate(t.getDate() + days); } + value = String(value); + return (document.cookie = [ + encodeURIComponent(key), '=', + options.raw ? value : encodeURIComponent(value), + options.expires ? '; expires=' + options.expires.toUTCString() : '', + options.path ? '; path=' + options.path : '', + options.domain ? '; domain=' + options.domain : '', + options.secure ? '; secure' : '' + ].join('')); + } + options = value || {}; + decode = options.raw ? function (s) { return s; } : decodeURIComponent; + return (result = new RegExp('(?:^|; )' + encodeURIComponent(key) + '=([^;]*)').exec(document.cookie)) ? decode(result[1]) : null; + }; +})(jQuery); + +/* +Group: LocalStorage +Functions for dealing with localStorage with fallback to userData or cookies. A slight modification of jstorage. +*/ + +(function ($) { + var _storage = {}, + _storage_service = {jStorage:"{}"}, + _storage_elm = null, + _storage_size = 0, + json_encode = $.vakata.json.encode, + json_decode = $.vakata.json.decode, + _backend = false, + _ttl_timeout = false; + + function _init() { + var localStorageReallyWorks = false; + if("localStorage" in window){ + try { + window.localStorage.setItem('_tmptest', 'tmpval'); + localStorageReallyWorks = true; + window.localStorage.removeItem('_tmptest'); + } catch(BogusQuotaExceededErrorOnIos5) { + // Thanks be to iOS5 Private Browsing mode which throws + // QUOTA_EXCEEDED_ERRROR DOM Exception 22. + } + } + + if(localStorageReallyWorks){ + try { + if(window.localStorage) { + _storage_service = window.localStorage; + _backend = "localStorage"; + } + } catch(E3) {/* Firefox fails when touching localStorage and cookies are disabled */} + } + else if("globalStorage" in window) { + try { + if(window.globalStorage) { + _storage_service = window.globalStorage[window.location.hostname]; + _backend = "globalStorage"; + } + } catch(E4) {/* Firefox fails when touching localStorage and cookies are disabled */} + } + else { + _storage_elm = document.createElement('link'); + if(_storage_elm.addBehavior) { + _storage_elm.style.behavior = 'url(#default#userData)'; + document.getElementsByTagName('head')[0].appendChild(_storage_elm); + try { + _storage_elm.load("jStorage"); + var data = "{}"; + data = _storage_elm.getAttribute("jStorage"); + _storage_service.jStorage = data; + _backend = "userDataBehavior"; + } catch(E5) {} + } + if( + !_backend && ( + !!$.vakata.cookie('__vjstorage') || + ($.vakata.cookie('__vjstorage', '{}', { 'expires' : 365 }) && $.vakata.cookie('__vjstorage') === '{}') + ) + ) { + _storage_elm = null; + _storage_service.jStorage = $.vakata.cookie('__vjstorage'); + _backend = "cookie"; + } + + if(!_backend) { + _storage_elm = null; + return; + } + } + _load_storage(); + _handleTTL(); + } + + function _load_storage() { + if(_storage_service.jStorage) { + try { + _storage = json_decode(String(_storage_service.jStorage)); + } catch(E6) { _storage_service.jStorage = "{}"; } + } else { + _storage_service.jStorage = "{}"; + } + _storage_size = _storage_service.jStorage ? String(_storage_service.jStorage).length : 0; + } + + function _save() { + try { + _storage_service.jStorage = json_encode(_storage); + if(_backend === 'userDataBehavior') { + _storage_elm.setAttribute("jStorage", _storage_service.jStorage); + _storage_elm.save("jStorage"); + } + if(_backend === 'cookie') { + $.vakata.cookie('__vjstorage', _storage_service.jStorage, { 'expires' : 365 }); + } + _storage_size = _storage_service.jStorage?String(_storage_service.jStorage).length:0; + } catch(E7) { /* probably cache is full, nothing is saved this way*/ } + } + + function _checkKey(key) { + if(!key || (typeof key !== "string" && typeof key !== "number")){ + throw new TypeError('Key name must be string or numeric'); + } + if(key === "__jstorage_meta") { + throw new TypeError('Reserved key name'); + } + return true; + } + + function _handleTTL() { + var curtime = +new Date(), + i, + TTL, + nextExpire = Infinity, + changed = false; + + if(_ttl_timeout !== false) { + clearTimeout(_ttl_timeout); + } + if(!_storage.__jstorage_meta || typeof _storage.__jstorage_meta.TTL !== "object"){ + return; + } + TTL = _storage.__jstorage_meta.TTL; + for(i in TTL) { + if(TTL.hasOwnProperty(i)) { + if(TTL[i] <= curtime) { + delete TTL[i]; + delete _storage[i]; + changed = true; + } + else if(TTL[i] < nextExpire) { + nextExpire = TTL[i]; + } + } + } + + // set next check + if(nextExpire !== Infinity) { + _ttl_timeout = setTimeout(_handleTTL, nextExpire - curtime); + } + // save changes + if(changed) { + _save(); + } + } + + /* + Variable: $.vakata.storage + *object* holds all storage related functions and properties. + */ + $.vakata.storage = { + /* + Variable: $.vakata.storage.version + *string* the version of jstorage used + */ + version: "0.1.6.1", + /* + Function: $.vakata.storage.set + Set a key to a value + + Parameters: + key - the key + value - the value + + Returns: + _value_ + */ + set : function (key, value) { + _checkKey(key); + _storage[key] = value; + _save(); + return value; + }, + /* + Function: $.vakata.storage.get + Get a value by key. + + Parameters: + key - the key + def - the value to return if _key_ is not found + + Returns: + The found value, _def_ if key not found or _null_ if _def_ is not supplied. + */ + get : function (key, def) { + _checkKey(key); + if(key in _storage){ + return _storage[key]; + } + return typeof(def) === 'undefined' ? null : def; + }, + /* + Function: $.vakata.storage.del + Remove a key. + + Parameters: + key - the key + + Returns: + *boolean* + */ + del : function (key) { + _checkKey(key); + if(key in _storage) { + delete _storage[key]; + + if(_storage.__jstorage_meta && typeof _storage.__jstorage_meta.TTL === "object" && key in _storage.__jstorage_meta.TTL) { + delete _storage.__jstorage_meta.TTL[key]; + } + _save(); + return true; + } + return false; + }, + + setTTL: function(key, ttl){ + var curtime = +new Date(); + + _checkKey(key); + ttl = Number(ttl) || 0; + if(key in _storage){ + if(!_storage.__jstorage_meta){ + _storage.__jstorage_meta = {}; + } + if(!_storage.__jstorage_meta.TTL) { + _storage.__jstorage_meta.TTL = {}; + } + if(ttl > 0) { + _storage.__jstorage_meta.TTL[key] = curtime + ttl; + } + else { + delete _storage.__jstorage_meta.TTL[key]; + } + _save(); + _handleTTL(); + return true; + } + return false; + }, + + /* + Function: $.vakata.storage.flush + Empty the storage. + + Returns: + _true_ + */ + flush : function(){ + _storage = {}; + _save(); + // try{ window.localStorage.clear(); } catch(E8) { } + return true; + }, + /* + Function: $.vakata.storage.storageObj + Get a read only copy of the whole storage. + + Returns: + *object* + */ + storageObj : function(){ + function F() {} + F.prototype = _storage; + return new F(); + }, + /* + Function: $.vakata.storage.index + Get an array of all the set keys in the storage. + + Returns: + *array* + */ + index : function(){ + var index = [], i; + $.each(_storage, function (i, v) { if(i !== "__jstorage_meta") { index.push(i); } }); + return index; + }, + /* + Function: $.vakata.storage.storageSize + Get the size of all items in the storage in bytes. + + Returns: + *number* + */ + storageSize : function(){ + return _storage_size; + }, + /* + Function: $.vakata.storage.currentBackend + Get the current backend used. + + Returns: + *string* + */ + currentBackend : function(){ + return _backend; + }, + /* + Function: $.vakata.storage.storageAvailable + See if storage functionality is available. + + Returns: + *boolean* + */ + storageAvailable : function(){ + return !!_backend; + } + }; + _init(); +})(jQuery); + +/* +Group: PrettyDate +Modifies time elements to a more human readable value. Taken from: https://github.com/zachleat/Humane-Dates/blob/master/src/humane.js +*/ +(function ($) { + /* + Variable: $.vakata.pretty_date + *object* holds all pretty-date related functions and properties. + */ + $.vakata.pretty_date = { + /* + Variable: $.vakata.pretty_date.lang + *object* the localization to use. + */ + lang : { + ago: 'Ago', + from: 'From Now', + now: 'Just Now', + minute: 'Minute', + minutes: 'Minutes', + hour: 'Hour', + hours: 'Hours', + day: 'Day', + days: 'Days', + week: 'Week', + weeks: 'Weeks', + month: 'Month', + months: 'Months', + year: 'Year', + years: 'Years' + }, + /* + Function: $.vakata.pretty_date.parse + Parses the difference between to dates to a human readable string. + + Parameters: + date - the date to calculate from (а string in this YYYY-MM-DDTHH:MM:SSZ format - UTC) + comareTo - the date to compare to (as date), if left empty the current date is used + + Returns: + *mixed* - the formatted string on success or _null_ on error + */ + parse : function (date, compareTo) { + // remove the timezone (always use gmdate on server side) + date = new Date(date.replace(/-/g,"/").replace(/[TZ]/g," ").replace(/\+\d\d\:\d\d$/,'')); + compareTo = compareTo || new Date(); + var lang = $.vakata.pretty_date.lang, + formats = [ + [60, lang.now], + [3600, lang.minute, lang.minutes, 60], // 60 minutes, 1 minute + [86400, lang.hour, lang.hours, 3600], // 24 hours, 1 hour + [604800, lang.day, lang.days, 86400], // 7 days, 1 day + [2628000, lang.week, lang.weeks, 604800], // ~1 month, 1 week + [31536000, lang.month, lang.months, 2628000], // 1 year, ~1 month + [Infinity, lang.year, lang.years, 31536000] // Infinity, 1 year + ], + seconds = (compareTo - date + compareTo.getTimezoneOffset() * 60000) / 1000, + normalize = function (val, single) { + var margin = 0.1; + if(val >= single && val <= single * (1+margin)) { + return single; + } + return val; + }, + token; + + if(seconds < 0) { + seconds = Math.abs(seconds); + token = ' ' + lang.from; + } + else { + token = ' ' + lang.ago; + } + + for(var i = 0, format = formats[0]; formats[i]; format = formats[++i]) { + if(seconds < format[0]) { + if(i === 0) { + return format[1]; + } + var val = Math.ceil(normalize(seconds, format[3]) / (format[3])); + return val + + ' ' + + (val !== 1 ? format[2] : format[1]) + + (i > 0 ? token : ''); + } + } + }, + /* + Function: $.vakata.pretty_date.init + Parses all time elements in the document and keeps reparsing them every few seconds. + + Parameters: + i - the interval for reparsing (in milliseconds). Default is 60000. + format - the format to use, example: _Published %{s}._. Default is _%{s}_. + */ + init : function (i, format) { + $("time, [datetime]").vakata_pretty_date(format); + setInterval(function(){ $("time, [datetime]").vakata_pretty_date(format); }, i || 60000); + } + }; + /* + Function: $().vakata_pretty_date + Sets the HTML of every element to the parsed difference of its _datetime_ attribute and the compare parameter. + + Parameters: + format - makes it possible to modify the parsed string, example: _Published %{s}._. Default is _%{s}_. + compare - the date to compare to. Default is the current date. + */ + $.fn.vakata_pretty_date = function (format, compare) { + if(!format) { format = '%{s}'; } + return this.each(function() { + var $t = jQuery(this), + date = $.vakata.pretty_date.parse($t.attr('datetime'), compare); + if(date) { + date = format.replace('%{s}', date); + if($t.html() !== date) { + $t.html(date); + } + } + }); + }; +})(jQuery); + +/* +Group: Selection +Selection related functions +*/ +(function ($) { + /* + Variable: $.vakata.selection + *object* holds all selection related functions and properties. + */ + $.vakata.selection = { + /* + Function: $.vakata.selection.get + Gets the current selection. + + Parameters: + as_text - a boolean - if set to _true_ selection is returned as text, otherwise as HTML + + Returns: + *string* - the current selection + */ + get : function (as_text) { + if(window.getSelection) { + if(as_text) { + return window.getSelection().toString(); + } + var userSelection = window.getSelection(), + range = userSelection.getRangeAt && userSelection.rangeCount ? userSelection.getRangeAt(0) : document.createRange(), + div = document.createElement('div'); + if(!userSelection.getRangeAt) { + range.setStart(userSelection.anchorNode, userSelection.anchorOffset); + range.setEnd(userSelection.focusNode, userSelection.focusOffset); + } + div.appendChild(range.cloneContents()); + return div.innerHTML; + } + if(document.selection) { + return document.selection.createRange()[ as_text ? 'text' : 'htmlText' ]; + } + return ''; + }, + /* + Function: $.vakata.selection.elm_get + Gets the selection inside an input element or textarea. + + Parameters: + e - the actual DOM element or the ID of the element + + Returns: + *object* - the current selection (start, end, length, text) + */ + elm_get : function (e) { + e = typeof e === 'string' ? document.getElementById(e) : e; + if(e.jquery) { e = e.get(0); } + if('selectionStart' in e) { // Mozilla and DOM 3.0 + return { + 'start' : e.selectionStart, + 'end' : e.selectionEnd, + 'length' : (e.selectionEnd - e.selectionStart), + 'text' : e.value.substr(e.selectionStart, (e.selectionEnd - e.selectionStart)) + }; + } + else if(document.selection) { // IE + e.focus(); + var tr0 = document.selection.createRange(), + tr1 = false, + tr2 = false, + len, text_whole, the_start, the_end; + if(tr0 && tr0.parentElement() === e) { + len = e.value.length; + text_whole = e.value.replace(/\r\n/g, "\n"); + + tr1 = e.createTextRange(); + tr1.moveToBookmark(tr0.getBookmark()); + tr2 = e.createTextRange(); + tr2.collapse(false); + + if(tr1.compareEndPoints("StartToEnd", tr2) > -1) { + the_start = the_end = len; + } + else { + the_start = -tr1.moveStart("character", -len); + the_start += text_whole.slice(0, the_start).split("\n").length - 1; + if (tr1.compareEndPoints("EndToEnd", tr2) > -1) { + the_end = len; + } else { + the_end = -tr1.moveEnd("character", -len); + the_end += text_whole.slice(0, the_end).split("\n").length - 1; + } + } + text_whole = e.value.slice(the_start, the_end); + return { + 'start' : the_start, + 'end' : the_end, + 'length' : text_whole.length, + 'text' : text_whole + }; + } + } + else { // not supported + return { + 'start' : e.value.length, + 'end' : e.value.length, + 'length' : 0, + 'text' : '' + }; + } + }, + /* + Function: $.vakata.selection.elm_set + Sets the selection inside an input element or textarea. + + Parameters: + e - the actual DOM element or the ID of the element + beg - the char to start the selection + end - the char to end the selection + + Returns: + *object* - the current selection (start, end, length, text) + */ + elm_set : function (e, beg, end) { + e = typeof e === 'string' ? document.getElementById(e) : e; + if(e.jquery) { e = e.get(0); } + if('selectionStart' in e) { // Mozilla and DOM 3.0 + e.focus(); + e.selectionStart = beg; + e.selectionEnd = end; + } + else if(document.selection) { // IE + e.focus(); + var tr = e.createTextRange(), + tx = e.value.replace(/\r\n/g, "\n"); + + beg -= tx.slice(0, beg).split("\n").length - 1; + end -= tx.slice(0, end).split("\n").length - 1; + + tr.collapse(true); + tr.moveEnd('character', end); + tr.moveStart('character', beg); + tr.select(); + } + return $.vakata.selection.elm_get(e); + }, + /* + Function: $.vakata.selection.elm_replace + Replace the selection inside an input element or textarea. + + Parameters: + e - the actual DOM element or the ID of the element + replace - the string to replace the selection with + + Returns: + *object* - the current selection (start, end, length, text) + */ + elm_replace : function (e, replace) { + e = typeof e === 'string' ? document.getElementById(e) : e; + if(e.jquery) { e = e.get(0); } + var sel = $.vakata.selection.elm_get(e), + beg = sel.start, + end = beg + replace.length; + e.value = e.value.substr(0, beg) + replace + e.value.substr(sel.end, e.value.length); + $.vakata.selection.elm_set(e, beg, end); + return { + 'start' : beg, + 'end' : end, + 'length' : replace.length, + 'text' : replace + }; + }, + /* + Function: $.vakata.selection.elm_get_caret + Returns the caret position in the element. + + Parameters: + e - the actual DOM element or the ID of the element + + Returns: + *number* - the current caret position + */ + elm_get_caret : function (e) { + return $.vakata.selection.elm_get(e).end; + }, + /* + Function: $.vakata.selection.elm_set_caret + Sets the caret position in the element. + + Parameters: + e - the actual DOM element or the ID of the element + pos - the position to move the caret to + + Returns: + *object* - the current selection + */ + elm_set_caret : function (e, pos) { + return $.vakata.selection.elm_set(e, pos, pos); + }, + /* + Function: $.vakata.selection.elm_get_caret_position + Returns the caret position in pixels relative to the element. + + Parameters: + e - the actual DOM element or the ID of the element + + Returns: + *object* - the current position (with _left_ and _top_ values) + */ + elm_get_caret_position : function (e) { + e = typeof e === 'string' ? document.getElementById(e) : e; + if(e.jquery) { e = e.get(0); } + var p = $.vakata.selection.elm_get_caret(e), + s = e.value.substring(0, p).replace(/&/g,'&').replace(//ig,'>').replace(/\r/g, '').replace(/\t/g,' ').replace(/\n/ig, '
    '), + b = $.vakata.get_scrollbar_width(), + w = $(e).width(), + h = $(e).height(); + if(e.scrollHeight > h) { w -= b; } + if(e.scrollWidth > w) { h -= b; } + e = $(e); + e = $('
    ').html(s).css({ + 'background': 'red', + 'width' : w + 'px', + 'height' : 'auto', + 'position' : 'absolute', + 'left' : '0px', + 'top' : '-10000px', + + 'fontSize' : e.css('fontSize'), + 'fontFamily' : e.css('fontFamily'), + 'fontWeight' : e.css('fontWeight'), + 'fontVariant' : e.css('fontVariant'), + 'fontStyle' : e.css('fontStyle'), + 'textTransform' : e.css('textTransform'), + 'lineHeight' : e.css('lineHeight'), + 'whiteSpace' : 'pre-wrap' + }); + e.append(' ').appendTo('body'); + s = e.find('span.caret'); + p = s.offset(); + p.top = p.top + 10000 + s.height(); + e.remove(); + return p; + } + }; +})(jQuery); + + + +(function ($) { + /* + Function: $.vakata_highlight + Hightlight words in the matched elements + + Parameters: + settings - if a string is passed, it is used to search and highlight, if an array of strings is passed, each string is highlighted, you can also pass an object, containing a _words_ string or array, a _color_ string or array, a _css_class_ string. + */ + $.fn.vakata_highlight = function (settings) { + var _return = this; + if(typeof settings === 'string') { + settings = [ settings ]; + } + if($.isArray(settings)) { + settings = { 'words' : settings }; + } + settings = $.extend(true, {}, { 'css_class' : 'vakata-highlight', 'words' : [], 'color' : '#99ccff' }, settings); + if(settings.words.length) { + this.each(function () { + var t = $(this); + $.each(settings.words, function (i,v) { + var color = false; + if(typeof settings.color === 'string') { + color = settings.color; + } + if($.isArray(settings.color) && typeof settings.color[i] === 'string') { + color = settings.color[i]; + } + t + .find(':vakata_icontains("' + v.replace(/\"/ig,'') + '")') + .filter('strong, span, li, p, h1, h2, h3, h4, h5, h6, div, u, em, i, dt, dd') + .contents() + .filter(function() { return this.nodeType === 3; }) + .each(function () { + if(this.nodeValue.toLowerCase().indexOf(v.toLowerCase()) >= 0) { + this.nodeValue = this.nodeValue.replace(new RegExp('(' + v.replace(/([\-.*+?\^${}()|\[\]\/\\])/g,"\\$1") + ')', 'ig'), '|{{{$1}}}|'); + var o = $(this).parent(); + o.html(o.html().replace(/\|\{\{\{/g,'').replace(/\}\}\}\|/g,'')); + } + }); + }); + }); + } + return _return; + }; +})(jQuery); +/* File: jstree.js +The only required part of jstree it consists of a few functions bound to the $.jstree object, the actual plugin function and a few core functions for manipulating a tree. +*/ +(function () { + "use strict"; + if(!jQuery) { throw "jsTree: jQuery not included."; } + if(jQuery.jstree) { return; } // prevent another load? maybe there is a better way? + +/* Group: $.jstree. +Some static functions and variables, unless you know exactly what you are doing do not use these, but <$().jstree> instead. +*/ +(function ($) { + var instances = [], + focused_instance = -1, + plugins = {}, + functions = {}; + /* + Variable: $.jstree + *object* Contains all static functions and variables used by jstree, some plugins also append variables. + */ + $.jstree = { + /* + Variable: $.jstree.VERSION + *string* the version of jstree + */ + VERSION : '1.0.0', + + /* + Variable: $.jstree.IS_IE6 + *boolean* indicating if the client is running Internet Explorer 6 + */ + IS_IE6 : (jQuery.browser.msie && parseInt(jQuery.browser.version,10) === 6), + + /* + Variable: $.jstree.IS_IE7 + *boolean* indicating if the client is running Internet Explorer 7 + */ + IS_IE7 : (jQuery.browser.msie && parseInt(jQuery.browser.version,10) === 6), + + /* + Variable: $.jstree.IS_FF2 + *boolean* indicating if the client is running Firefox 2 + */ + IS_FF2 : (jQuery.browser.mozilla && parseFloat(jQuery.browser.version,10) < 1.9), + + /* + Function: $.jstree.__construct + Creates a new jstree instance, any arguments after the first one are merged and used to configure the tree. + + `.data("jstree")` is also called on the container and is used for configuration (keep in mind you can specify this data using a "data-jstree" attribute) + + Parameters: + container - *mixed* the container of the tree (this should not be the UL node, but a wrapper) - DOM node, jQuery object or selector + */ + __construct : function (container) { + var s = {}, // settings + d = {}, // data + p = [], // plugins + t = [], // plugins temp + i = 0; // index + container = $(container); + if($.jstree._reference(container)) { $.jstree.__destruct(container); } + $.extend.apply(null, [true, s].concat(Array.prototype.slice.call(arguments, 1), (container.data("jstree") || {}) )); + p = $.isArray(s.plugins) ? s.plugins : $.jstree.defaults.plugins.slice(); + p = $.vakata.array_unique(p); + s = $.extend(true, {}, $.jstree.defaults, s); + $.each(plugins, function (i, val) { + if(i !== "core" && $.inArray(i, p) === -1) { s[i] = null; delete s[i]; } + else { t.push(i); d[i] = {}; } + }); + s.plugins = t; + i = parseInt(instances.push({}),10) - 1; + container + .data("jstree_instance_id", i) + .addClass("jstree jstree-" + i); + + this.data = d; + this.get_index = function () { return i; }; + this.get_container = function () { return container; }; + this.get_container_ul = function () { return container.children("ul:eq(0)"); }; + this.get_settings = function (writable) { return writable ? s : $.extend(true, {}, s); }; + this.__trigger = function (ev, data) { + if(!ev) { return; } + if(!data) { data = {}; } + if(typeof ev === "string") { ev = ev.replace(".jstree","") + ".jstree"; } + data.inst = this; + this.get_container().triggerHandler(ev, data); + }; + instances[i] = this; + $.each(t, function (j, val) { if(plugins[val]) { plugins[val].__construct.apply(instances[i]); } }); + this.__trigger("__construct"); + $.jstree._focus(i); + return this; + }, + /* + Group: $.jstree. + + Function: $.jstree.__destruct + Destroys an instance, and also clears `jstree-` prefixed classes and all events in the `jstree` namespace + + Parameters: + instance - *mixed* the instance to destroy (this argument is passed to <$.jstree._reference> to get the instance) + + See also: + <$.jstree._reference> + */ + __destruct : function (instance) { + instance = $.jstree._reference(instance); + if(!instance) { return false; } + var s = instance.get_settings(), + n = instance.get_index(), + i = 0; + if(focused_instance === n) { + for(i in instances) { + if(instances.hasOwnProperty(i) && i !== n) { + $.jstree._focus(i); + break; + } + } + if(focused_instance === n) { $.jstree._focus(false); } + } + $.each(s.plugins, function (i, val) { + try { plugins[val].__destruct.apply(instance); } catch(err) { } + }); + instance.__trigger("__destruct"); + instance.get_container() + .unbind(".jstree") + .undelegate(".jstree") + .removeData("jstree_instance_id") + .find("[class^='jstree']") + .andSelf() + .attr("class", function () { return this.className.replace(/jstree[^ ]*|$/ig,''); }); + $(document) + .unbind(".jstree-" + n) + .undelegate(".jstree-" + n); + delete instances[n]; + return true; + }, + /* + Function: $.jstree.__call + Call a function on the instance and return the result + + Parameters: + instance - *mixed* the instance to destroy (this argument is passed to <$.jstree._reference> to get the instance) + operation - *string* the operation to execute + args - *array* the arguments to pass to the function + + See also: + <$.jstree._reference> + */ + __call : function (instance, operation, args) { + instance = $.jstree._reference(instance); + if(!instance || !$.isFunction(instance[operation])) { return; } + return instance[operation].apply(instance, args); + }, + /* + Function: $.jstree._reference + Returns an instance + + Parameters: + needle - *mixed* - integer, DOM node contained inside a jstree container, ID string, jQuery object, selector + */ + _reference : function (needle) { + if(instances[needle]) { return instances[needle]; } + var o = $(needle); + if(!o.length && typeof needle === "string") { o = $("#" + needle); } + if(!o.length) { return null; } + return instances[o.closest(".jstree").data("jstree_instance_id")] || null; + }, + /* + Function: $.jstree._focused + Returns the currently focused instance (by default once an instance is created it is focused) + */ + _focused : function () { + return instances[focused_instance] || null; + }, + /* + Function: $.jstree._focus + Make an instance focused (which defocuses the previously focused instance) + + Parameters: + instance - *mixed* the instance to focus (this argument is passed to <$.jstree._reference> to get the instance) + + See also: + <$.jstree._reference> + */ + _focus : function (instance) { + if(instance === false) { + instances[focused_instance].get_container().removeClass("jstree-focused"); + instances[focused_instance].__trigger("_defocus"); + focused_instance = -1; + return false; + } + instance = $.jstree._reference(instance); + if(!instance || instance.get_index() === focused_instance) { return false; } + if(focused_instance !== -1) { + instances[focused_instance].get_container().removeClass("jstree-focused"); + instances[focused_instance].__trigger("_defocus"); + } + focused_instance = instance.get_index(); + instance.get_container().addClass("jstree-focused"); + instance.__trigger("_focus"); + return true; + }, + /* + Function: $.jstree.plugin + Register a plugin + + Parameters: + plugin_name - *string* the name of the new plugin (it will be used as a key in an object - make sure it is valid) + plugin_data - *object* consists of 4 keys. Default is: + >{ + > __construct : $.noop, // this function will be executed when a new instance is created + > __destuct : $.noop, // this function will be executed when an instance is destroyed + > _fn : { }, // each key of this object should be a function that will extend the jstree prototype + > defaults : false // the default configuration for the plugin (if any) + >} + */ + plugin : function (plugin_name, plugin_data) { + plugin_data = $.extend({}, { + __construct : $.noop, + __destuct : $.noop, + _fn : { }, + defaults : false + }, plugin_data); + plugins[plugin_name] = plugin_data; + $.jstree.defaults[plugin_name] = plugin_data.defaults; + $.each(plugin_data._fn, function (i, val) { + val.plugin = plugin_name; + val.old = functions[i]; + functions[i] = function () { + var rslt, + func = val, + args = Array.prototype.slice.call(arguments), + evnt = new $.Event("before.jstree"), + plgn = this.get_settings(true).plugins; + + do { + if(func && func.plugin && $.inArray(func.plugin, plgn) !== -1) { break; } + func = func.old; + } while(func); + if(!func) { return; } + + if(i.indexOf("_") === 0) { + rslt = func.apply(this, args); + } + else { + rslt = this.__trigger(evnt, { "func" : i, "args" : args, "plugin" : func.plugin }); + if(rslt === false) { return; } + rslt = func.apply( + $.extend({}, this, { + __callback : function (data) { + this.__trigger( i, { "args" : args, "rslt" : data, "plugin" : func.plugin }); + return data; + }, + __call_old : function (replace_arguments) { + return func.old.apply(this, (replace_arguments ? Array.prototype.slice.call(arguments, 1) : args ) ); + } + }), args); + } + return rslt; + }; + functions[i].old = val.old; + functions[i].plugin = plugin_name; + }); + }, + /* + Variable: $.jstree.defaults + *object* storing all the default configuration options for every plugin and the core. + If this is modified all instances created after the modification, which do not explicitly specify some other value will use the new default. + + Example: + >// this instance will use the _default_ theme + >$("#div0").jstree({ plugins : ["themes"] }); + >$.jstree.defaults.themes.theme = "classic"; + >// this instance will use the _classic_ theme + >$("#div1").jstree({ plugins : ["themes"] }); + >// this instance will use the _apple_ theme + >$("#div2").jstree({ themes : { "theme" : "apple" }, plugins : ["themes"] }); + */ + defaults : { + plugins : [] + } + }; + /* Group: $().jstree() + The actual plugin wrapper, use this to create instances or execute functions on created instances. + + Function: $().jstree + + Creates an instance using the specified objects for containers, or executes a command on an instance, specified by a container. + + Parameters: + settings - *mixed* + + - if you pass an *object* a new instance will be created (using <$.jstree.__construct>) + for each of the objects in the jquery collection, + if an instance already exists on the container it will be destroyed first + + - if you pass a *string* it will be executed using <$.jstree.__call> on each instance + + Examples: + > // this creates an instance + > $("#some-id").jstree({ + > plugins : [ "html_data", "themes", "ui" ] + > }); + > + > // this executes a function on the instance + > $("#some-id").jstree("select_node", "#the-id-to-select"); + + See also: + <$.jstree.__construct>, + <$.jstree.__destruct>, + <$.jstree.__call> + */ + $.fn.jstree = function (settings) { + var _is_method = (typeof settings === 'string'), + _arguments = Array.prototype.slice.call(arguments, 1), + _return = this; + this.each(function () { + if(_is_method) { + var val = $.jstree.__call(this, settings, _arguments); + if(typeof val !== "undefined" && (settings.indexOf("is_" === 0) || (val !== true && val !== false))) { + _return = val; + return false; + } + } + else { + _is_method = new $.jstree.__construct(this, settings); + } + }); + return _return; + }; + functions = $.jstree.__construct.prototype; + + $.expr[':'].jstree = function(a,i,m) { + return typeof ($(a).data("jstree_instance_id")) !== 'undefined'; + }; +})(jQuery); + +(function ($) { + var ccp_node = false, + ccp_mode = false; + + $(function() { $.jstree.SCROLLBAR_WIDTH = $.vakata.get_scrollbar_width(); }); + + $.jstree.plugin("core", { + __construct : function () { + this.data.core.rtl = (this.get_container().css("direction") === "rtl"); + if(this.data.core.rtl) { this.get_container().addClass("jstree-rtl"); } + this.data.core.ready = false; + + this.get_container() + .bind("__construct.jstree", $.proxy(function () { + // defer, so that events bound AFTER creating the instance (like __ready) are still handled + setTimeout($.proxy(function () { if(this) { this.init(); } }, this), 0); + }, this)) + .bind("before.jstree", $.proxy(function (e, data) { + if(!/^is_locked|unlock$/.test(data.func) && this.data.core.locked) { + e.stopImmediatePropagation(); + return false; + } + }, this)) + .bind("create_node.jstree", $.proxy(function (e, data) { + this.clean_node(data.rslt.obj); + }, this)) + .bind("load_node.jstree", $.proxy(function (e, data) { + // data.rslt.status + this.clean_node(data.rslt.obj === -1 ? this.get_container_ul().children('li') : data.rslt.obj.find('> ul > li')); + if(!this.data.core.ready && !this.get_container_ul().find('.jstree-loading:eq(0)').length) { + this.data.core.ready = true; + this.__trigger("__ready"); + } + }, this)) + .bind("__loaded.jstree", $.proxy(function (e, data) { + data.inst.get_container_ul().children('li').each(function () { + data.inst.correct_node(this); + }); + }, this)) + .bind("open_node.jstree", $.proxy(function (e, data) { + data.rslt.obj.find('> ul > li').each(function () { + data.inst.correct_node(this); + }); + }, this)) + .bind("mousedown.jstree", $.proxy(function () { + $.jstree._focus(this.get_index()); + }, this)) + .bind("dblclick.jstree", function () { + if(document.selection && document.selection.empty) { document.selection.empty(); } + else { if(window.getSelection) { var sel = window.getSelection(); try { sel.removeAllRanges(); sel.collapse(); } catch (er) { } } } + }) + .delegate("li > ins", "click.jstree", $.proxy(function (e) { + // var trgt = $(e.target); + // if(trgt.is("ins") && e.pageY - trgt.offset().top < this.data.core.li_height) { this.toggle_node(trgt); } + this.toggle_node(e.target); + }, this)); + }, + __destruct : function () { + + }, + /* Class: jstree */ + /* + Variable: data + *object* Provides storage for plugins (aside from private variables). Every plugin has an key in this object. + > this.data.; + This is useful for detecting if some plugin is included in the instance (plugins also use this for dependencies and enhancements). + + Function: get_index + Returns an *integer*, which is the instance's index. Every instance on the page has an unique index, when destroying an intance the index will not be reused. + + Function: get_container + Returns the jQuery extended container of the tree (the element you used when constructing the tree). + + Function: get_container_ul + Returns the jQuery extended first UL node inside the container of the tree. + + Function: get_settings + Returns the settings for the tree. + + Parameters: + writable - *boolean* whether to return a copy of the settings object or a reference to it. + + Example: + > $("#div1").jstree("get_settings"); // will return a copy + > $.jstree._reference("#div1").get_settings(); // same as above + > $.jstree._focused().get_settings(true); // a reference. BE CAREFUL! + + Function: __trigger + Used internally to trigger events on the container node. + + Parameters: + event_name - the name of the event to trigger (the *jstree* namespace will be appended to it) + data - the additional object to pass along with the event. By default _data.inst_ will be the current instance, so when you bind to the event, you can access the instance easily. + > $("div").bind("some-event.jstree", function (e, data) { data.inst.some_function(); }); + */ + /* + Group: CORE options + + Variable: config.core.strings + *mixed* used to store all localization strings. Default is _false_. + + Example 1: + >$("div").jstree({ + > core : { + > strings : function (s) { + > if(s === "Loading ...") { s = "Please wait ..."; } + > return s; + > } + > } + >}); + + Example 2: + >$("div").jstree({ + > core : { + > strings : { + > "Loading ..." : "Please wait ..." + > } + > } + >}); + + See also: + <_get_string> + */ + defaults : { + strings : false + }, + _fn : { + /* + Group: CORE functions + + Function: _get_string + Used to get the common string in the tree. + + If is set to a function, that function is called with a single parameter (the needed string), the response is returned. + + If is set to an object, the key named as the needed string is returned. + + If is not set, the the needed string is returned. + + Parameters: + needed_string - *string* the needed string + */ + _get_string : function (s) { + var a = this.get_settings(true).core.strings; + if($.isFunction(a)) { return a.call(this, s); } + if(a && a[s]) { return a[s]; } + return s; + }, + /* + Function: init + Used internally. This function is called once the core plugin is constructed. + + Triggers: + <__loaded> + + Event: __loaded + This event is triggered in the *jstree* namespace when data is first rendered in the tree. It won't be triggered after a refresh. Fires only once. + + Parameters: + data.inst - the instance + + Example: + > $("div").bind("__loaded.jstree", function (e, data) { data.inst.do_something(); }); + + Event: __ready + This event is triggered in the *jstree* namespace when all initial loading is done. It won't be triggered after a refresh. Fires only once. + + Parameters: + data.inst - the instance + */ + init : function () { + this.data.core.original_container_html = this.get_container().find(" > ul > li").clone(true); + this.data.core.original_container_html.find("li").andSelf().contents().filter(function() { return this.nodeType === 3 && (!this.nodeValue || /^\s+$/.test(this.nodeValue)); }).remove(); + this.get_container().html(""); + this.clean_node(-1); + this.data.core.li_height = this.get_container_ul().children("li:eq(0)").height() || 18; + this.load_node(-1, function () { + this.__trigger("__loaded"); + }); + }, + /* + Function: lock + Used to lock the tree. When the tree is in a locked state, no functions can be called on the instance (except and ). + Additionally a _jstree-locked_ class is applied on the container. + + Triggers: + + + Event: lock + This event is triggered in the *jstree* namespace when the tree is locked. + + Parameters: + data.inst - the instance + data.args - *array* the arguments passed to the function + data.plugin - *string* the function's plugin (here it will be _"core"_ but if the function is extended it may be something else). + data.rslt - _null_ + + Example: + > $("div").bind("lock.jstree", function (e, data) { data.inst.do_something(); }); + */ + lock : function () { + this.data.core.locked = true; + this.get_container().addClass("jstree-locked"); + this.__callback(); + }, + /* + Function: unlock + Used to unlock the tree. Instance can be used normally again. The _jstree-locked_ class is removed from the container. + + Triggers: + + + Event: unlock + This event is triggered in the *jstree* namespace when the tree is unlocked. + + Parameters: + data.inst - the instance + data.args - *array* the arguments passed to the function + data.plugin - *string* the function's plugin (here it will be _"core"_ but if the function is extended it may be something else). + data.rslt - _null_ + + Example: + > $("div").bind("unlock.jstree", function (e, data) { data.inst.do_something(); }); + */ + unlock : function () { + this.data.core.locked = false; + this.get_container().removeClass("jstree-locked"); + this.__callback(); + }, + /* + Function: is_locked + Used to get the locked status of the tree. + + Returns: + locked - *boolean* _true_ if tree is locked, _false_ otherwise + */ + is_locked : function () { + return this.data.core.locked; + }, + /* + Function: get_node + Get a hold of the LI node (which represents the jstree node). + + Parameters: + obj - *mixed* this is used as a jquery selector - can be jQuery object, DOM node, string, etc. + + Returns: + jquery collection - node was found, the collection contains the LI node + -1 - the tree container was referenced + false - on failure (obj is not part of a tree, or does not exists in the DOM) + */ + get_node : function (obj) { + var $obj = $(obj, this.get_container()); + if($obj.is(".jstree") || obj === -1) { return -1; } + $obj = $obj.closest("li", this.get_container()); + return $obj.length ? $obj : false; + }, + /* + Function: get_next + Get the next sibling of a node + + Parameters: + obj - *mixed* this is used as a jquery selector - can be jQuery object, DOM node, string, etc. + strict - *boolean* if set to _true_ jstree will only return immediate siblings, otherwise, if _obj_ is the last child of its parent, the parent's next sibling is returned. + + Returns: + jquery collection - node was found, the collection contains the LI node + -1 - the tree container was referenced + false - node was not found, or failure (obj is not part of a tree, or does not exists in the DOM) + */ + get_next : function (obj, strict) { + obj = this.get_node(obj); + if(obj === -1) { return this.get_container_ul().children("li:eq(0)"); } + if(!obj || !obj.length) { return false; } + if(strict) { return (obj.nextAll("li").size() > 0) ? obj.nextAll("li:eq(0)") : false; } + if(obj.hasClass("jstree-open")) { return obj.find("li:eq(0)"); } + else if(obj.nextAll("li").size() > 0) { return obj.nextAll("li:eq(0)"); } + else { return obj.parentsUntil(".jstree","li").next("li").eq(0); } + }, + /* + Function: get_prev + Get the previous sibling of a node + + Parameters: + obj - *mixed* this is used as a jquery selector - can be jQuery object, DOM node, string, etc. + strict - *boolean* if set to _true_ jstree will only return immediate siblings, otherwise, if _obj_ is the first child of its parent, the parent's previous sibling is returned. + + Returns: + jquery collection - node was found, the collection contains the LI node + -1 - the tree container was referenced + false - node was not found, or failure (obj is not part of a tree, or does not exists in the DOM) + */ + get_prev : function (obj, strict) { + obj = this.get_node(obj); + if(obj === -1) { return this.get_container().find("> ul > li:last-child"); } + if(!obj || !obj.length) { return false; } + if(strict) { return (obj.prevAll("li").length > 0) ? obj.prevAll("li:eq(0)") : false; } + if(obj.prev("li").length) { + obj = obj.prev("li").eq(0); + while(obj.hasClass("jstree-open")) { obj = obj.children("ul:eq(0)").children("li:last"); } + return obj; + } + else { var o = obj.parentsUntil(".jstree","li:eq(0)"); return o.length ? o : false; } + }, + /* + Function: get_parent + Get the parent of a node + + Parameters: + obj - *mixed* this is used as a jquery selector - can be jQuery object, DOM node, string, etc. + + Returns: + jquery collection - node was found, the collection contains the LI node + -1 - when _obj_ was a root node + false - on failure (obj is not part of a tree, or does not exists in the DOM) + */ + get_parent : function (obj) { + obj = this.get_node(obj); + if(obj === -1 || !obj || !obj.length) { return false; } + var o = obj.parentsUntil(".jstree", "li:eq(0)"); + return o.length ? o : -1; + }, + /* + Function: get_children + Get all the children of a node + + Parameters: + obj - *mixed* this is used as a jquery selector - can be jQuery object, DOM node, string, etc. If _-1_ is used all root nodes are returned. + + Returns: + jquery collection - node was found, the collection contains the LI nodes of all immediate children + false - on failure (obj is not part of a tree, or does not exists in the DOM) + */ + get_children : function (obj) { + obj = this.get_node(obj); + if(obj === -1) { return this.get_container_ul().children("li"); } + if(!obj || !obj.length) { return false; } + return obj.find("> ul > li"); + }, + /* + Function: is_parent + Check if a node is a parent. + + Parameters: + obj - *mixed* this is used as a jquery selector - can be jQuery object, DOM node, string, etc. + + Returns: + true - _obj_ has children or is closed (will be loaded) + false - _obj_ is not a valid node or has no children (leaf node) + */ + is_parent : function (obj) { obj = this.get_node(obj); return obj && obj !== -1 && (obj.find("> ul > li:eq(0)").length || obj.hasClass("jstree-closed")); }, + /* + Function: is_loaded + Check if a node is loaded. + + Parameters: + obj - *mixed* this is used as a jquery selector - can be jQuery object, DOM node, string, etc. + + Returns: + true - _obj_ has children or is leaf + false - _obj_ is currently loading or is not a leaf, but has no children + */ + is_loaded : function (obj) { obj = this.get_node(obj); return obj && ( (obj === -1 && !this.get_container().find("> ul > li.jstree-loading").length) || ( obj !== -1 && !obj.hasClass('jstree-loading') && (obj.find('> ul > li').length || obj.hasClass('jstree-leaf')) ) ); }, + /* + Function: is_loading + Check if a node is currently loading. + + Parameters: + obj - *mixed* this is used as a jquery selector - can be jQuery object, DOM node, string, etc. + + Returns: + true - _obj_ is currently loading + false - _obj_ is not currently loading + */ + is_loading : function (obj) { obj = this.get_node(obj); return obj && ( (obj === -1 && this.get_container().find("> ul > li.jstree-loading").length) || (obj !== -1 && obj.hasClass("jstree-loading")) ); }, + /* + Function: is_open + Check if a node is currently open. + + Parameters: + obj - *mixed* this is used as a jquery selector - can be jQuery object, DOM node, string, etc. + + Returns: + true - _obj_ is currently open + false - _obj_ is not currently open + */ + is_open : function (obj) { obj = this.get_node(obj); return obj && obj !== -1 && obj.hasClass("jstree-open"); }, + /* + Function: is_closed + Check if a node is currently closed. + + Parameters: + obj - *mixed* this is used as a jquery selector - can be jQuery object, DOM node, string, etc. + + Returns: + true - _obj_ is currently closed + false - _obj_ is not currently closed + */ + is_closed : function (obj) { obj = this.get_node(obj); return obj && obj !== -1 && obj.hasClass("jstree-closed"); }, + /* + Function: is_leaf + Check if a node is a leaf node (has no children). + + Parameters: + obj - *mixed* this is used as a jquery selector - can be jQuery object, DOM node, string, etc. + + Returns: + true - _obj_ is a leaf node + false - _obj_ is not a leaf node + */ + is_leaf : function (obj) { obj = this.get_node(obj); return obj && obj !== -1 && obj.hasClass("jstree-leaf"); }, + /* + Function: load_node + Load the children of a node. + + Parameters: + obj - *mixed* this is used as a jquery selector - can be jQuery object, DOM node, string, etc. Use -1 to load the root nodes. + callback - a function to be executed in the tree's scope. Receives two arguments: _obj_ (the same node used to call load_node), _status_ (a boolean indicating if the node was loaded successfully. + + Returns: + true - _obj_ is a valid node and will try loading it + false - _obj_ is not a valid node + + Triggers: + + + See also: + <_load_node> + + Event: load_node + This event is triggered in the *jstree* namespace when a node is loaded (succesfully or not). + + Parameters: + data.inst - the instance + data.args - *array* the arguments passed to the function + data.plugin - *string* the function's plugin (here it will be _"core"_ but if the function is extended it may be something else). + data.rslt - *object* which contains two keys _obj_ (the loaded node) and _status_ - whether the node was loaded successfully. + + Example: + > $("div").bind("load_node.jstree", function (e, data) { if(data.rslt.status) { data.inst.open_node(data.rslt.obj); } }); + */ + load_node : function (obj, callback) { + obj = this.get_node(obj); + if(!obj) { callback.call(this, obj, false); return false; } + // if(this.is_loading(obj)) { return true; } + if(obj !== -1) { obj.addClass("jstree-loading"); } + this._load_node(obj, $.proxy(function (status) { + if(obj !== -1) { obj.removeClass("jstree-loading"); } + this.__callback({ "obj" : obj, "status" : status }); + if(callback) { callback.call(this, obj, status); } + }, this)); + return true; + }, + /* + Function: _load_node + Load the children of a node, but as opposed to does not change any visual properties or trigger events. This function is used in internally. The idea is for data source plugins to overwrite this function. + This implementation (from the *core*) only uses markup found in the tree container, and does not load async. + + Parameters: + obj - *mixed* this is used as a jquery selector - can be jQuery object, DOM node, string, etc. Use -1 to load the root nodes. + callback - a function to be executed in the tree's scope. Receives one argument: _status_ (a boolean indicating if the node was loaded successfully). + */ + _load_node : function (obj, callback) { + // if using async - empty the node first + if(obj === -1) { + this.get_container_ul().empty().append(this.data.core.original_container_html.clone(true)); + } + callback.call(null, true); + }, + /* + Function: open_node + Open a node so that its children are visible. If the node is not loaded try loading it first. + + Parameters: + obj - *mixed* this is used as a jquery selector - can be jQuery object, DOM node, string, etc. + callback - a function to be executed in the tree's scope. Receives two arguments: _obj_ (the node being opened) and _status_ (a boolean indicating if the node was opened successfully). + animation - the duration in miliseconds of the slideDown animation. If not supplied the jQuery default is used. Please note that on IE6 a _0_ is enforced here due to performance issues. + + Triggers: + , <__after_open> + + Event: open_node + This event is triggered in the *jstree* namespace when a node is successfully opened (but if animation is used this event is triggered BEFORE the animation completes). See <__after_open>. + + Parameters: + data.inst - the instance + data.args - *array* the arguments passed to the function + data.plugin - *string* the function's plugin (here it will be _"core"_ but if the function is extended it may be something else). + data.rslt - *object* which contains a single key: _obj_ (the opened node). + + Example: + > $("div").bind("open_node.jstree", function (e, data) { + > data.rslt.obj.find('> ul > .jstree-closed').each(function () { + > data.inst.open_node(this); + > } + > }); + + Event: __after_open + This event is triggered in the *jstree* namespace when a node is successfully opened AFTER the animation completes). See . + + Parameters: + data.inst - the instance + data.rslt - *object* which contains a single key: _obj_ (the opened node). + + Example: + > $("div").bind("__after_open.jstree", function (e, data) { + > data.rslt.obj.find('> ul > .jstree-closed').each(function () { + > data.inst.open_node(this); + > } + > }); + */ + open_node : function (obj, callback, animation) { + obj = this.get_node(obj); + if(obj === -1 || !obj || !obj.length) { return false; } + if(!this.is_closed(obj)) { if(callback) { callback.call(this, obj, false); } return false; } + if(!this.is_loaded(obj)) { // TODO: is_loading? + this.load_node(obj, function (o, ok) { + return ok ? this.open_node(o, callback, animation) : callback ? callback.call(this, o, false) : false; + }); + } + else { + var t = this; + obj + .children("ul").css("display","none").end() + .removeClass("jstree-closed").addClass("jstree-open") + // .children("ins").text("-").end() + .children("ul").stop(true, true).slideDown( ($.jstree.IS_IE6 ? 0 : animation), function () { + this.style.display = ""; + t.__trigger("__after_open", { "rslt" : { "obj" : obj } }); + }); + if(callback) { callback.call(this, obj, true); } + this.__callback({ "obj" : obj }); + } + }, + /* + Function: close_node + Close a node so that its children are not visible. + + Parameters: + obj - *mixed* this is used as a jquery selector - can be jQuery object, DOM node, string, etc. + animation - the duration in miliseconds of the slideDown animation. If not supplied the jQuery default is used. Please note that on IE6 a _0_ is enforced here due to performance issues. + + Triggers: + , <__after_close> + + Event: close_node + This event is triggered in the *jstree* namespace when a node is closed (but if animation is used this event is triggered BEFORE the animation completes). See <__after_close>. + + Parameters: + data.inst - the instance + data.args - *array* the arguments passed to the function + data.plugin - *string* the function's plugin (here it will be _"core"_ but if the function is extended it may be something else). + data.rslt - *object* which contains a single key: _obj_ (the closed node). + + Example: + > $("div").bind("close_node.jstree", function (e, data) { + > data.rslt.obj.children('ul').remove(); + > }); + + Event: __after_close + This event is triggered in the *jstree* namespace when a node is closed AFTER the animation completes). See . + + Parameters: + data.inst - the instance + data.rslt - *object* which contains a single key: _obj_ (the opened node). + + Example: + > $("div").bind("__after_close.jstree", function (e, data) { + > data.rslt.obj.children('ul').remove(); + > }); + */ + close_node : function (obj, animation) { + obj = this.get_node(obj); + if(!obj || !obj.length || !this.is_open(obj)) { return false; } + var t = this; + obj + .children("ul").attr("style","display:block !important").end() + .removeClass("jstree-open").addClass("jstree-closed") + // .children("ins").text("+").end() + .children("ul").stop(true, true).slideUp( ($.jstree.IS_IE6 ? 0 : animation), function () { + this.style.display = ""; + t.__trigger("__after_close", { "rslt" : { "obj" : obj } }); + }); + this.__callback({ "obj" : obj }); + }, + /* + Function: toggle_node + If a node is closed - open it, if it is open - close it. + + Parameters: + obj - *mixed* this is used as a jquery selector - can be jQuery object, DOM node, string, etc. + */ + toggle_node : function (obj) { + if(this.is_closed(obj)) { return this.open_node(obj); } + if(this.is_open(obj)) { return this.close_node(obj); } + }, + /* + Function: open_all + Open all nodes from a certain node down. + + Parameters: + obj - *mixed* this is used as a jquery selector - can be jQuery object, DOM node, string, etc. If _-1_ is used or is omitted all nodes in the tree are opened. + animation - the duration of the slideDown animation when opening the nodes. If not set _0_ is enforced for performance issues. + original_obj - used internally to keep track of the recursion - do not set manually! + + Triggers: + + + Event: open_all + This event is triggered in the *jstree* namespace when an open_all call completes. + + Parameters: + data.inst - the instance + data.args - *array* the arguments passed to the function + data.plugin - *string* the function's plugin (here it will be _"core"_ but if the function is extended it may be something else). + data.rslt - *object* which contains a single key: _obj_ (the node used in the call). + + Example: + > $("div").bind("open_all.jstree", function (e, data) { + > alert('DONE'); + > }); + */ + open_all : function (obj, animation, original_obj) { + obj = obj ? this.get_node(obj) : -1; + obj = !obj || obj === -1 ? this.get_container_ul() : obj; + original_obj = original_obj || obj; + var _this = this; + obj = this.is_closed(obj) ? obj.find('li.jstree-closed').andSelf() : obj.find('li.jstree-closed'); + obj.each(function () { + _this.open_node( + this, + _this.is_loaded(this) ? + false : + function(obj) { this.open_all(obj, animation, original_obj); }, + animation || 0 + ); + }); + if(original_obj.find('li.jstree-closed').length === 0) { this.__callback({ "obj" : original_obj }); } + }, + /* + Function: close_all + Close all nodes from a certain node down. + + Parameters: + obj - *mixed* this is used as a jquery selector - can be jQuery object, DOM node, string, etc. If _-1_ is used or is omitted all nodes in the tree are closed. + animation - the duration of the slideDown animation when closing the nodes. If not set _0_ is enforced for performance issues. + + Triggers: + + + Event: close_all + This event is triggered in the *jstree* namespace when a close_all call completes. + + Parameters: + data.inst - the instance + data.args - *array* the arguments passed to the function + data.plugin - *string* the function's plugin (here it will be _"core"_ but if the function is extended it may be something else). + data.rslt - *object* which contains a single key: _obj_ (the node used in the call). + + Example: + > $("div").bind("close_all.jstree", function (e, data) { + > alert('DONE'); + > }); + */ + close_all : function (obj, animation) { + obj = obj ? this._get_node(obj) : -1; + var $obj = !obj || obj === -1 ? this.get_container_ul() : obj, + _this = this; + $obj = this.is_open($obj) ? $obj.find('li.jstree-open').andSelf() : $obj.find('li.jstree-open'); + $obj.each(function () { _this.close_node(this, animation || 0); }); + this.__callback({ "obj" : obj }); + }, + /* + Function: clean_node + This function converts inserted nodes to the required by jsTree format. It takes care of converting a simple unodreder list to the internally used markup. + The core calls this function automatically when new data arrives (by binding to the event). + Each plugin may override this function to include its own source, but keep in mind to do it like that: + > clean_node : function(obj) { + > obj = this.__call_old(); + > obj.each(function () { + > // do your stuff here + > }); + > } + + Parameters: + obj - *mixed* this is used as a jquery selector - can be jQuery object, DOM node, string, etc. If _-1_ is used or is omitted all nodes in the tree are cleaned. + + Returns: + jQuery collection - the cleaned children of the original node. + */ + clean_node : function (obj) { + // DETACH maybe inside the "load_node" function? But what about animations, etc? + obj = this.get_node(obj); + obj = !obj || obj === -1 ? this.get_container().find("li") : obj.find("li").andSelf(); + var _this = this; + return obj.each(function () { + var t = $(this), + d = t.data("jstree"), + s = (d && d.opened) || t.hasClass("jstree-open") ? "open" : (d && d.closed) || t.children("ul").length ? "closed" : "leaf"; + if(d && d.opened) { delete d.opened; } + if(d && d.closed) { delete d.closed; } + t.removeClass("jstree-open jstree-closed jstree-leaf jstree-last"); + if(!t.children("a").length) { + // allow for text and HTML markup inside the nodes + t.contents().filter(function() { return this.nodeType === 3 || this.tagName !== 'UL'; }).wrapAll(''); + // TODO: make this faster + t.children('a').html(t.children('a').html().replace(/[\s\t\n]+$/,'')); + } + else { + if(!$.trim(t.children('a').attr('href'))) { t.children('a').attr("href","#"); } + } + if(!t.children("ins.jstree-ocl").length) { + t.prepend(" "); + } + if(t.is(":last-child")) { + t.addClass("jstree-last"); + } + switch(s) { + case 'leaf': + t.addClass('jstree-leaf'); + break; + case 'closed': + t.addClass('jstree-open'); + _this.close_node(t, 0); + break; + case 'open': + t.addClass('jstree-closed'); + _this.open_node(t, false, 0); + break; + } + }); + }, + /* + Function: correct_node + This function corrects the open/closed/leaf state as data changes (as the user interacts with the tree). + The core calls this function automatically when a node is opened, deleted or moved. + + Parameters: + obj - *mixed* this is used as a jquery selector - can be jQuery object, DOM node, string, etc. If _-1_ is used or is omitted the root nodes are processed. + + Returns: + jQuery collection - the processed children of the original node. + */ + /* PROCESS SINGLE NODE (OR USE BOOLEAN single PARAM), CALL FROM CLEAN_NODE, LOSE THE EVENTS ABOVE */ + correct_node : function (obj, deep) { + obj = this.get_node(obj); + if(!obj || (obj === -1 && !deep)) { return false; } + if(obj === -1) { obj = this.get_container().find('li'); } + else { obj = deep ? obj.find('li').andSelf() : obj; } + obj.each(function () { + var obj = $(this); + switch(!0) { + case obj.hasClass("jstree-open") && !obj.find("> ul > li").length: + obj.removeClass("jstree-open").addClass("jstree-leaf").children("ul").remove(); // children("ins").html(" ").end() + break; + case obj.hasClass("jstree-leaf") && !!obj.find("> ul > li").length: + obj.removeClass("jstree-leaf").addClass("jstree-closed"); //.children("ins").html("+"); + break; + } + obj[obj.is(":last-child") ? 'addClass' : 'removeClass']("jstree-last"); + }); + return obj; + }, + /* + Function: scroll_to_node + This function scrolls the container to the desired node (if needed). + + Parameters: + obj - *mixed* this is used as a jquery selector - can be jQuery object, DOM node, string, etc. + */ + scroll_to_node : function (obj) { + var c = this.get_container()[0], t; + if(c.scrollHeight > c.offsetHeight) { + obj = this.get_node(obj); + if(!obj || obj === -1 || !obj.length || !obj.is(":visible")) { return; } + t = obj.offset().top - this.get_container().offset().top; + if(t < 0) { + c.scrollTop = c.scrollTop + t - 1; + } + if(t + this.data.core.li_height + (c.scrollWidth > c.offsetWidth ? $.jstree.SCROLLBAR_WIDTH : 0) > c.offsetHeight) { + c.scrollTop = c.scrollTop + (t - c.offsetHeight + this.data.core.li_height + 1 + (c.scrollWidth > c.offsetWidth ? $.jstree.SCROLLBAR_WIDTH : 0)); + } + } + }, + /* + Function: get_state + This function returns the current state of the tree (as collected from all active plugins). + Plugin authors: pay special attention to the way this function is extended for new plugins. In your plugin code write: + > get_state : function () { + > var state = this.__call_old(); + > state.your-plugin-name = ; + > return state; + > } + + Returns: + object - the current state of the instance + */ + get_state : function () { // TODO: scroll position, theme + var state = { 'open' : [], 'scroll' : { 'left' : this.get_container().scrollLeft(), 'top' : this.get_container().scrollTop() } }; + this.get_container_ul().find('.jstree-open').each(function () { if(this.id) { state.open.push(this.id); } }); + return state; + }, + /* + Function: set_state + This function returns sets the state of the tree. + Plugin authors: pay special attention to the way this function is extended for new plugins. In your plugin code write: + > set_state : function (state, callback) { + > if(this.__call_old()) { + > if(state.your-plugin-name) { + > + > // restore using `state.your-plugin-name` + > // if you need some async activity so that you return to this bit of code + > // do not delete state.your-plugin-name and return false (see core's function for example) + > + > delete state.your-plugin-name; + > this.set_state(state, callback); + > return false; + > } + > return true; + > } + > return false; + > } + + Parameters: + state - *object* the state to restore to + callback - *function* this will be executed in the instance's scope once restoring is done + + Returns: + boolean - the return value is used to determine the phase of restoration + + Triggers: + + + Event: set_state + This event is triggered in the *jstree* namespace when a set_state call completes. + + Parameters: + data.inst - the instance + data.args - *array* the arguments passed to the function + data.plugin - *string* the function's plugin (here it will be _"core"_ but if the function is extended it may be something else) + */ + set_state : function (state, callback) { + if(state) { + if($.isArray(state.open)) { + var res = true, + t = this; + this.close_all(); + $.each(state.open.concat([]), function (i, v) { + v = document.getElementById(v); + if(v) { + if(t.is_loaded(v)) { + if(t.is_closed(v)) { + t.open_node(v, false, 0); + } + $.vakata.array_remove(state.open, i); + } + else { + t.open_node(v, $.proxy(function () { this.set_state(state); }, t), 0); + // there will be some async activity - so wait for it + res = false; + } + } + }); + if(res) { + delete state.open; + this.set_state(state, callback); + } + return false; + } + if(state.scroll) { + if(state.scroll && typeof state.scroll.left !== 'undefined') { + this.get_container().scrollLeft(state.scroll.left); + } + if(state.scroll && typeof state.scroll.top !== 'undefined') { + this.get_container().scrollTop(state.scroll.top); + } + delete state.scroll; + delete state.open; + this.set_state(state, callback); + return false; + } + if($.isEmptyObject(state)) { + if(callback) { callback.call(this); } + this.__callback(); + return false; + } + return true; + } + return false; + }, + /* + Function: refresh + This function saves the current state, reloads the complete tree and returns it to the saved state. + + Triggers: + + + Event: refresh + This event is triggered in the *jstree* namespace when a refresh call completes. + + Parameters: + data.inst - the instance + */ + refresh : function () { + this.data.core.state = this.get_state(); + this.load_node(-1, function (o, s) { + if(s) { + this.set_state($.extend(true, {}, this.data.core.state), function () { this.__trigger('refresh'); }); + } + this.data.core.state = null; + }); + }, + /* + Function: get_text + This function returns the title of the node. + + Parameters: + obj - *mixed* this is used as a jquery selector - can be jQuery object, DOM node, string, etc. + remove_html - *boolean* set to _true_ to return plain text instead of HTML + + Returns: + string - the title of the node, specified by _obj_ + */ + get_text : function (obj, remove_html) { + obj = this.get_node(obj); + if(!obj || obj === -1 || !obj.length) { return false; } + obj = obj.children("a:eq(0)").clone(); + obj.children(".jstree-icon").remove(); + return obj[ remove_html ? 'text' : 'html' ](); + }, + /* + Function: set_text + This function sets the title of the node. This is a low-level function, you'd be better off using . + + Parameters: + obj - *mixed* this is used as a jquery selector - can be jQuery object, DOM node, string, etc. + val - *string* the new title of the node (can be HTMl too) + + Returns: + boolean - was the rename successfull + + Triggers: + + + Event: set_text + This event is triggered in the *jstree* namespace when a set_text call completes. + + Parameters: + data.inst - the instance + data.args - *array* the arguments passed to the function + data.plugin - *string* the function's plugin (here it will be _"core"_ but if the function is extended it may be something else) + data.rslt - *object* which contains a two keys: _obj_ (the node) and _val_ (the new title). + + Example: + > $("div").bind("set_text.jstree", function (e, data) { + > alert("Renamed to: " + data.rslt.val); + > }); + */ + set_text : function (obj, val) { + obj = this.get_node(obj); + if(!obj || obj === -1 || !obj.length) { return false; } + obj = obj.children("a:eq(0)"); + var tmp = obj.children("INS").clone(); + obj.html(val).prepend(tmp); + this.__callback({ "obj" : obj, "text" : val }); + return true; + }, + /* + Function: parse_json + This function returns a jQuery node after parsing a JSON object (a LI node for single elements or an UL node for multiple). This function will use the default title from if none is specified. + + Parameters: + node - *mixed* the input to parse + > // can be a string + > "The title of the parsed node" + > // array of strings + > [ "Node 1", "Node 2" ] + > // an object + > { "title" : "The title of the parsed node" } + > // you can manipulate the output + > { "title" : "The title of the parsed node", "li_attr" : { "id" : "id_for_li" }, "a_attr" : { "href" : "http://jstree.com" } } + > // you can supply metadata, which you can later access using $(the_li_node).data() + > { "title" : "The title of the parsed node", "data" : { } } + > // you can supply children (they can be objects too) + > { "title" : "The title of the parsed node", "children" : [ "Node 1", { "title" : "Node 2" } ] } + + Returns: + jQuery - the LI (or UL) node which was produced from the JSON + */ + parse_json : function (node) { + var li, a, ul, t; + if($.isArray(node)) { + ul = $("
    jstree.state.jsThis plugin enables state saving between reloads.
    jstree state plugin
    +

    jstree.hotkeys.js

    Enables keyboard shortcuts.  Depends on jQuery.hotkeys (included in vakata.js).

    Summary
    jstree.hotkeys.jsEnables keyboard shortcuts.
    jstree hotkeys plugin
    -

    jstree state plugin

    +

    jstree hotkeys plugin

    - + - diff --git a/_docs/files/jstree-ui-js.html b/docs/files/jstree-html-js.html similarity index 59% rename from _docs/files/jstree-ui-js.html rename to docs/files/jstree-html-js.html index c8c47c1d..9eb72a21 100644 --- a/_docs/files/jstree-ui-js.html +++ b/docs/files/jstree-html-js.html @@ -1,6 +1,6 @@ -jstree.ui.js - jstree @@ -11,17 +11,17 @@ -

    jstree.ui.js

    This plugin enables selecting, deselecting and hovering tree items.

    Summary
    jstree.ui.jsThis plugin enables selecting, deselecting and hovering tree items.
    jstree UI plugin
    +

    jstree.html.js

    This plugin makes it possible for jstree to use HTML data sources (other than the container’s initial HTML).

    Summary
    jstree.html.jsThis plugin makes it possible for jstree to use HTML data sources (other than the container’s initial HTML).
    jstree html plugin
    -

    jstree UI plugin

    +

    jstree html plugin

    - + - diff --git a/docs/files/jstree-js.html b/docs/files/jstree-js.html new file mode 100644 index 00000000..f3848567 --- /dev/null +++ b/docs/files/jstree-js.html @@ -0,0 +1,309 @@ + + +jstree.js - jstree + + + + + + + + + +

    jstree.js

    The only required part of jstree it consists of a few functions bound to the $.jstree object, the actual plugin function and a few core functions for manipulating a tree.

    Summary
    jstree.jsThe only required part of jstree it consists of a few functions bound to the $.jstree object, the actual plugin function and a few core functions for manipulating a tree.
    $.jstree.Some static functions and variables, unless you know exactly what you are doing do not use these, but $().jstree instead.
    $.jstreeobject Contains all static functions and variables used by jstree, some plugins also append variables.
    $.jstree.VERSIONstring the version of jstree
    $.jstree.IS_IE6boolean indicating if the client is running Internet Explorer 6
    $.jstree.IS_IE7boolean indicating if the client is running Internet Explorer 7
    $.jstree.IS_FF2boolean indicating if the client is running Firefox 2
    $.jstree.__constructCreates a new jstree instance, any arguments after the first one are merged and used to configure the tree.
    $.jstree.
    $.jstree.__destructDestroys an instance, and also clears `jstree-` prefixed classes and all events in the `jstree` namespace
    $.jstree.__callCall a function on the instance and return the result
    $.jstree._referenceReturns an instance
    $.jstree._focusedReturns the currently focused instance (by default once an instance is created it is focused)
    $.jstree._focusMake an instance focused (which defocuses the previously focused instance)
    $.jstree.pluginRegister a plugin
    $.jstree.defaultsobject storing all the default configuration options for every plugin and the core.
    $().jstree()The actual plugin wrapper, use this to create instances or execute functions on created instances.
    $().jstreeCreates an instance using the specified objects for containers, or executes a command on an instance, specified by a container.
    jstree
    dataobject Provides storage for plugins (aside from private variables).
    get_indexReturns an integer, which is the instance’s index.
    get_containerReturns the jQuery extended container of the tree (the element you used when constructing the tree).
    get_container_ulReturns the jQuery extended first UL node inside the container of the tree.
    get_settingsReturns the settings for the tree.
    __triggerUsed internally to trigger events on the container node.
    CORE options
    config.core.stringsmixed used to store all localization strings.
    CORE functions
    _get_stringUsed to get the common string in the tree.
    initUsed internally.
    __loadedThis event is triggered in the jstree namespace when data is first rendered in the tree.
    __readyThis event is triggered in the jstree namespace when all initial loading is done.
    lockUsed to lock the tree.
    lockThis event is triggered in the jstree namespace when the tree is locked.
    unlockUsed to unlock the tree.
    unlockThis event is triggered in the jstree namespace when the tree is unlocked.
    is_lockedUsed to get the locked status of the tree.
    get_nodeGet a hold of the LI node (which represents the jstree node).
    get_nextGet the next sibling of a node
    get_prevGet the previous sibling of a node
    get_parentGet the parent of a node
    get_childrenGet all the children of a node
    is_parentCheck if a node is a parent.
    is_loadedCheck if a node is loaded.
    is_loadingCheck if a node is currently loading.
    is_openCheck if a node is currently open.
    is_closedCheck if a node is currently closed.
    is_leafCheck if a node is a leaf node (has no children).
    load_nodeLoad the children of a node.
    load_nodeThis event is triggered in the jstree namespace when a node is loaded (succesfully or not).
    _load_nodeLoad the children of a node, but as opposed to load_node does not change any visual properties or trigger events.
    open_nodeOpen a node so that its children are visible.
    open_nodeThis event is triggered in the jstree namespace when a node is successfully opened (but if animation is used this event is triggered BEFORE the animation completes).
    __after_openThis event is triggered in the jstree namespace when a node is successfully opened AFTER the animation completes).
    close_nodeClose a node so that its children are not visible.
    close_nodeThis event is triggered in the jstree namespace when a node is closed (but if animation is used this event is triggered BEFORE the animation completes).
    __after_closeThis event is triggered in the jstree namespace when a node is closed AFTER the animation completes).
    toggle_node
    open_allOpen all nodes from a certain node down.
    open_allThis event is triggered in the jstree namespace when an open_all call completes.
    close_allClose all nodes from a certain node down.
    close_allThis event is triggered in the jstree namespace when a close_all call completes.
    clean_nodeThis function converts inserted nodes to the required by jsTree format.
    correct_nodeThis function corrects the open/closed/leaf state as data changes (as the user interacts with the tree).
    scroll_to_nodeThis function scrolls the container to the desired node (if needed).
    get_stateThis function returns the current state of the tree (as collected from all active plugins).
    set_stateThis function returns sets the state of the tree.
    set_stateThis event is triggered in the jstree namespace when a set_state call completes.
    refreshThis function saves the current state, reloads the complete tree and returns it to the saved state.
    refreshThis event is triggered in the jstree namespace when a refresh call completes.
    get_textThis function returns the title of the node.
    set_textThis function sets the title of the node.
    set_textThis event is triggered in the jstree namespace when a set_text call completes.
    parse_jsonThis function returns a jQuery node after parsing a JSON object (a LI node for single elements or an UL node for multiple).
    get_jsonThis function returns the whole tree (or a single node) in JSON format.
    create_nodeThis function creates a new node.
    create_nodeThis event is triggered in the jstree namespace when a new node is created.
    rename_nodeThis function renames a new node.
    rename_nodeThis event is triggered in the jstree namespace when a node is renamed.
    delete_nodeThis function deletes a node.
    delete_nodeThis event is triggered in the jstree namespace when a node is deleted.
    checkThis function checks if a structure modification is valid.
    move_nodeThis function moves a node.
    move_nodeThis event is triggered in the jstree namespace when a node is moved.
    copy_nodeThis function copies a node.
    copy_nodeThis event is triggered in the jstree namespace when a node is copied.
    + +

    $.jstree.

    Some static functions and variables, unless you know exactly what you are doing do not use these, but $().jstree instead.

    + +

    $.jstree

    $.jstree

    object Contains all static functions and variables used by jstree, some plugins also append variables.

    + +

    $.jstree.VERSION

    string the version of jstree

    + +

    $.jstree.IS_IE6

    boolean indicating if the client is running Internet Explorer 6

    + +

    $.jstree.IS_IE7

    boolean indicating if the client is running Internet Explorer 7

    + +

    $.jstree.IS_FF2

    boolean indicating if the client is running Firefox 2

    + +

    $.jstree.__construct

    Creates a new jstree instance, any arguments after the first one are merged and used to configure the tree.

    `.data(“jstree”)` is also called on the container and is used for configuration (keep in mind you can specify this data using a “data-jstree” attribute)

    Parameters

    containermixed the container of the tree (this should not be the UL node, but a wrapper) - DOM node, jQuery object or selector
    + +

    $.jstree.

    + +

    $.jstree.__destruct

    Destroys an instance, and also clears `jstree-` prefixed classes and all events in the `jstree` namespace

    Parameters

    instancemixed the instance to destroy (this argument is passed to $.jstree._reference to get the instance)

    See also

    $.jstree._reference

    + +

    $.jstree.__call

    Call a function on the instance and return the result

    Parameters

    instancemixed the instance to destroy (this argument is passed to $.jstree._reference to get the instance)
    operationstring the operation to execute
    argsarray the arguments to pass to the function

    See also

    $.jstree._reference

    + +

    $.jstree._reference

    Returns an instance

    Parameters

    needlemixed - integer, DOM node contained inside a jstree container, ID string, jQuery object, selector
    + +

    $.jstree._focused

    Returns the currently focused instance (by default once an instance is created it is focused)

    + +

    $.jstree._focus

    Make an instance focused (which defocuses the previously focused instance)

    Parameters

    instancemixed the instance to focus (this argument is passed to $.jstree._reference to get the instance)

    See also

    $.jstree._reference

    + +

    $.jstree.plugin

    Register a plugin

    Parameters

    plugin_namestring the name of the new plugin (it will be used as a key in an object - make sure it is valid)
    plugin_dataobject consists of 4 keys.  Default is:
    {
    +   __construct : $.noop,   // this function will be executed when a new instance is created
    +   __destuct   : $.noop,   // this function will be executed when an instance is destroyed
    +   _fn         : { },      // each key of this object should be a function that will extend the jstree prototype
    +   defaults    : false     // the default configuration for the plugin (if any)
    +}
    + +

    $.jstree.defaults

    object storing all the default configuration options for every plugin and the core.  If this is modified all instances created after the modification, which do not explicitly specify some other value will use the new default.

    Example

    // this instance will use the _default_ theme
    +$("#div0").jstree({ plugins : ["themes"] });
    +$.jstree.defaults.themes.theme = "classic";
    +// this instance will use the _classic_ theme
    +$("#div1").jstree({ plugins : ["themes"] });
    +// this instance will use the _apple_ theme
    +$("#div2").jstree({ themes : { "theme" : "apple" }, plugins : ["themes"] });
    + +

    $().jstree()

    The actual plugin wrapper, use this to create instances or execute functions on created instances.

    + +

    $().jstree

    $.fn.jstree = function (settings)

    Creates an instance using the specified objects for containers, or executes a command on an instance, specified by a container.

    Parameters

    settingsmixed
    • if you pass an object a new instance will be created (using $.jstree.__construct) for each of the objects in the jquery collection, if an instance already exists on the container it will be destroyed first
    • if you pass a string it will be executed using $.jstree.__call on each instance

    Examples

    // this creates an instance
    +$("#some-id").jstree({
    +  plugins : [ "html_data", "themes", "ui" ]
    +});
    +
    +// this executes a function on the instance
    +$("#some-id").jstree("select_node", "#the-id-to-select");

    See also

    $.jstree.__construct, $.jstree.__destruct, $.jstree.__call

    + +

    jstree

    Summary
    dataobject Provides storage for plugins (aside from private variables).
    get_indexReturns an integer, which is the instance’s index.
    get_containerReturns the jQuery extended container of the tree (the element you used when constructing the tree).
    get_container_ulReturns the jQuery extended first UL node inside the container of the tree.
    get_settingsReturns the settings for the tree.
    __triggerUsed internally to trigger events on the container node.
    CORE options
    config.core.stringsmixed used to store all localization strings.
    CORE functions
    _get_stringUsed to get the common string in the tree.
    initUsed internally.
    __loadedThis event is triggered in the jstree namespace when data is first rendered in the tree.
    __readyThis event is triggered in the jstree namespace when all initial loading is done.
    lockUsed to lock the tree.
    lockThis event is triggered in the jstree namespace when the tree is locked.
    unlockUsed to unlock the tree.
    unlockThis event is triggered in the jstree namespace when the tree is unlocked.
    is_lockedUsed to get the locked status of the tree.
    get_nodeGet a hold of the LI node (which represents the jstree node).
    get_nextGet the next sibling of a node
    get_prevGet the previous sibling of a node
    get_parentGet the parent of a node
    get_childrenGet all the children of a node
    is_parentCheck if a node is a parent.
    is_loadedCheck if a node is loaded.
    is_loadingCheck if a node is currently loading.
    is_openCheck if a node is currently open.
    is_closedCheck if a node is currently closed.
    is_leafCheck if a node is a leaf node (has no children).
    load_nodeLoad the children of a node.
    load_nodeThis event is triggered in the jstree namespace when a node is loaded (succesfully or not).
    _load_nodeLoad the children of a node, but as opposed to load_node does not change any visual properties or trigger events.
    open_nodeOpen a node so that its children are visible.
    open_nodeThis event is triggered in the jstree namespace when a node is successfully opened (but if animation is used this event is triggered BEFORE the animation completes).
    __after_openThis event is triggered in the jstree namespace when a node is successfully opened AFTER the animation completes).
    close_nodeClose a node so that its children are not visible.
    close_nodeThis event is triggered in the jstree namespace when a node is closed (but if animation is used this event is triggered BEFORE the animation completes).
    __after_closeThis event is triggered in the jstree namespace when a node is closed AFTER the animation completes).
    toggle_node
    open_allOpen all nodes from a certain node down.
    open_allThis event is triggered in the jstree namespace when an open_all call completes.
    close_allClose all nodes from a certain node down.
    close_allThis event is triggered in the jstree namespace when a close_all call completes.
    clean_nodeThis function converts inserted nodes to the required by jsTree format.
    correct_nodeThis function corrects the open/closed/leaf state as data changes (as the user interacts with the tree).
    scroll_to_nodeThis function scrolls the container to the desired node (if needed).
    get_stateThis function returns the current state of the tree (as collected from all active plugins).
    set_stateThis function returns sets the state of the tree.
    set_stateThis event is triggered in the jstree namespace when a set_state call completes.
    refreshThis function saves the current state, reloads the complete tree and returns it to the saved state.
    refreshThis event is triggered in the jstree namespace when a refresh call completes.
    get_textThis function returns the title of the node.
    set_textThis function sets the title of the node.
    set_textThis event is triggered in the jstree namespace when a set_text call completes.
    parse_jsonThis function returns a jQuery node after parsing a JSON object (a LI node for single elements or an UL node for multiple).
    get_jsonThis function returns the whole tree (or a single node) in JSON format.
    create_nodeThis function creates a new node.
    create_nodeThis event is triggered in the jstree namespace when a new node is created.
    rename_nodeThis function renames a new node.
    rename_nodeThis event is triggered in the jstree namespace when a node is renamed.
    delete_nodeThis function deletes a node.
    delete_nodeThis event is triggered in the jstree namespace when a node is deleted.
    checkThis function checks if a structure modification is valid.
    move_nodeThis function moves a node.
    move_nodeThis event is triggered in the jstree namespace when a node is moved.
    copy_nodeThis function copies a node.
    copy_nodeThis event is triggered in the jstree namespace when a node is copied.
    + +

    data

    object Provides storage for plugins (aside from private variables).  Every plugin has an key in this object.

    this.data.<plugin_name>;

    This is useful for detecting if some plugin is included in the instance (plugins also use this for dependencies and enhancements).

    + +

    get_index

    Returns an integer, which is the instance’s index.  Every instance on the page has an unique index, when destroying an intance the index will not be reused.

    + +

    get_container

    Returns the jQuery extended container of the tree (the element you used when constructing the tree).

    + +

    get_container_ul

    Returns the jQuery extended first UL node inside the container of the tree.

    + +

    get_settings

    Returns the settings for the tree.

    Parameters

    writableboolean whether to return a copy of the settings object or a reference to it.

    Example

    $("#div1").jstree("get_settings"); // will return a copy
    +$.jstree._reference("#div1").get_settings(); // same as above
    +$.jstree._focused().get_settings(true); // a reference. BE CAREFUL!
    + +

    __trigger

    Used internally to trigger events on the container node.

    Parameters

    event_namethe name of the event to trigger (the jstree namespace will be appended to it)
    datathe additional object to pass along with the event.  By default data.inst will be the current instance, so when you bind to the event, you can access the instance easily.
    $("div").bind("some-event.jstree", function (e, data) { data.inst.some_function(); });
    + +

    CORE options

    + +

    config.core.strings

    mixed used to store all localization strings.  Default is false.

    Example 1

    $("div").jstree({
    +   core : {
    +       strings : function (s) {
    +           if(s === "Loading ...") { s = "Please wait ..."; }
    +           return s;
    +       }
    +   }
    +});

    Example 2

    $("div").jstree({
    +   core : {
    +       strings : {
    +           "Loading ..." : "Please wait ..."
    +       }
    +   }
    +});

    See also

    _get_string

    + +

    CORE functions

    + +

    _get_string

    _get_string : function (s)

    Used to get the common string in the tree.

    If config.core.strings is set to a function, that function is called with a single parameter (the needed string), the response is returned.

    If config.core.strings is set to an object, the key named as the needed string is returned.

    If config.core.strings is not set, the the needed string is returned.

    Parameters

    needed_stringstring the needed string
    + +

    init

    Used internally.  This function is called once the core plugin is constructed.

    Triggers

    __loaded

    + +

    __loaded

    This event is triggered in the jstree namespace when data is first rendered in the tree.  It won’t be triggered after a refresh.  Fires only once.

    Parameters

    data.instthe instance

    Example

    $("div").bind("__loaded.jstree", function (e, data) { data.inst.do_something(); });
    + +

    __ready

    This event is triggered in the jstree namespace when all initial loading is done.  It won’t be triggered after a refresh.  Fires only once.

    Parameters

    data.instthe instance
    + +

    lock

    Used to lock the tree.  When the tree is in a locked state, no functions can be called on the instance (except is_locked and unlock).  Additionally a jstree-locked class is applied on the container.

    Triggers

    lock

    + +

    lock

    This event is triggered in the jstree namespace when the tree is locked.

    Parameters

    data.instthe instance
    data.argsarray the arguments passed to the function
    data.pluginstring the function’s plugin (here it will be ”core” but if the function is extended it may be something else).
    data.rsltnull

    Example

    $("div").bind("lock.jstree", function (e, data) { data.inst.do_something(); });
    + +

    unlock

    Used to unlock the tree.  Instance can be used normally again.  The jstree-locked class is removed from the container.

    Triggers

    unlock

    + +

    unlock

    This event is triggered in the jstree namespace when the tree is unlocked.

    Parameters

    data.instthe instance
    data.argsarray the arguments passed to the function
    data.pluginstring the function’s plugin (here it will be ”core” but if the function is extended it may be something else).
    data.rsltnull

    Example

    $("div").bind("unlock.jstree", function (e, data) { data.inst.do_something(); });
    + +

    is_locked

    is_locked : function ()

    Used to get the locked status of the tree.

    Returns

    lockedboolean true if tree is locked, false otherwise
    + +

    get_node

    get_node : function (obj)

    Get a hold of the LI node (which represents the jstree node).

    Parameters

    objmixed this is used as a jquery selector - can be jQuery object, DOM node, string, etc.

    Returns

    jquery collectionnode was found, the collection contains the LI node
    -1the tree container was referenced
    falseon failure (obj is not part of a tree, or does not exists in the DOM)
    + +

    get_next

    get_next : function (obj,
    strict)

    Get the next sibling of a node

    Parameters

    objmixed this is used as a jquery selector - can be jQuery object, DOM node, string, etc.
    strictboolean if set to true jstree will only return immediate siblings, otherwise, if obj is the last child of its parent, the parent’s next sibling is returned.

    Returns

    jquery collectionnode was found, the collection contains the LI node
    -1the tree container was referenced
    falsenode was not found, or failure (obj is not part of a tree, or does not exists in the DOM)
    + +

    get_prev

    get_prev : function (obj,
    strict)

    Get the previous sibling of a node

    Parameters

    objmixed this is used as a jquery selector - can be jQuery object, DOM node, string, etc.
    strictboolean if set to true jstree will only return immediate siblings, otherwise, if obj is the first child of its parent, the parent’s previous sibling is returned.

    Returns

    jquery collectionnode was found, the collection contains the LI node
    -1the tree container was referenced
    falsenode was not found, or failure (obj is not part of a tree, or does not exists in the DOM)
    + +

    get_parent

    get_parent : function (obj)

    Get the parent of a node

    Parameters

    objmixed this is used as a jquery selector - can be jQuery object, DOM node, string, etc.

    Returns

    jquery collectionnode was found, the collection contains the LI node
    -1when obj was a root node
    falseon failure (obj is not part of a tree, or does not exists in the DOM)
    + +

    get_children

    get_children : function (obj)

    Get all the children of a node

    Parameters

    objmixed this is used as a jquery selector - can be jQuery object, DOM node, string, etc.  If -1 is used all root nodes are returned.

    Returns

    jquery collectionnode was found, the collection contains the LI nodes of all immediate children
    falseon failure (obj is not part of a tree, or does not exists in the DOM)
    + +

    is_parent

    is_parent : function (obj)

    Check if a node is a parent.

    Parameters

    objmixed this is used as a jquery selector - can be jQuery object, DOM node, string, etc.

    Returns

    trueobj has children or is closed (will be loaded)
    falseobj is not a valid node or has no children (leaf node)
    + +

    is_loaded

    is_loaded : function (obj)

    Check if a node is loaded.

    Parameters

    objmixed this is used as a jquery selector - can be jQuery object, DOM node, string, etc.

    Returns

    trueobj has children or is leaf
    falseobj is currently loading or is not a leaf, but has no children
    + +

    is_loading

    is_loading : function (obj)

    Check if a node is currently loading.

    Parameters

    objmixed this is used as a jquery selector - can be jQuery object, DOM node, string, etc.

    Returns

    trueobj is currently loading
    falseobj is not currently loading
    + +

    is_open

    is_open : function (obj)

    Check if a node is currently open.

    Parameters

    objmixed this is used as a jquery selector - can be jQuery object, DOM node, string, etc.

    Returns

    trueobj is currently open
    falseobj is not currently open
    + +

    is_closed

    is_closed : function (obj)

    Check if a node is currently closed.

    Parameters

    objmixed this is used as a jquery selector - can be jQuery object, DOM node, string, etc.

    Returns

    trueobj is currently closed
    falseobj is not currently closed
    + +

    is_leaf

    is_leaf : function (obj)

    Check if a node is a leaf node (has no children).

    Parameters

    objmixed this is used as a jquery selector - can be jQuery object, DOM node, string, etc.

    Returns

    trueobj is a leaf node
    falseobj is not a leaf node
    + +

    load_node

    Load the children of a node.

    Parameters

    objmixed this is used as a jquery selector - can be jQuery object, DOM node, string, etc.  Use -1 to load the root nodes.
    callbacka function to be executed in the tree’s scope.  Receives two arguments: obj (the same node used to call load_node), status (a boolean indicating if the node was loaded successfully.

    Returns

    trueobj is a valid node and will try loading it
    falseobj is not a valid node

    Triggers

    load_node

    See also

    _load_node

    + +

    load_node

    This event is triggered in the jstree namespace when a node is loaded (succesfully or not).

    Parameters

    data.instthe instance
    data.argsarray the arguments passed to the function
    data.pluginstring the function’s plugin (here it will be ”core” but if the function is extended it may be something else).
    data.rsltobject which contains two keys obj (the loaded node) and status - whether the node was loaded successfully.

    Example

    $("div").bind("load_node.jstree", function (e, data) { if(data.rslt.status) { data.inst.open_node(data.rslt.obj); } });
    + +

    _load_node

    _load_node : function (obj,
    callback)

    Load the children of a node, but as opposed to load_node does not change any visual properties or trigger events.  This function is used in load_node internally.  The idea is for data source plugins to overwrite this function.  This implementation (from the core) only uses markup found in the tree container, and does not load async.

    Parameters

    objmixed this is used as a jquery selector - can be jQuery object, DOM node, string, etc.  Use -1 to load the root nodes.
    callbacka function to be executed in the tree’s scope.  Receives one argument: status (a boolean indicating if the node was loaded successfully).
    + +

    open_node

    Open a node so that its children are visible.  If the node is not loaded try loading it first.

    Parameters

    objmixed this is used as a jquery selector - can be jQuery object, DOM node, string, etc.
    callbacka function to be executed in the tree’s scope.  Receives two arguments: obj (the node being opened) and status (a boolean indicating if the node was opened successfully).
    animationthe duration in miliseconds of the slideDown animation.  If not supplied the jQuery default is used.  Please note that on IE6 a 0 is enforced here due to performance issues.

    Triggers

    open_node, __after_open

    + +

    open_node

    This event is triggered in the jstree namespace when a node is successfully opened (but if animation is used this event is triggered BEFORE the animation completes).  See __after_open.

    Parameters

    data.instthe instance
    data.argsarray the arguments passed to the function
    data.pluginstring the function’s plugin (here it will be ”core” but if the function is extended it may be something else).
    data.rsltobject which contains a single key: obj (the opened node).

    Example

    $("div").bind("open_node.jstree", function (e, data) {
    +  data.rslt.obj.find('> ul > .jstree-closed').each(function () {
    +    data.inst.open_node(this);
    +  }
    +});
    + +

    __after_open

    This event is triggered in the jstree namespace when a node is successfully opened AFTER the animation completes).  See open_node.

    Parameters

    data.instthe instance
    data.rsltobject which contains a single key: obj (the opened node).

    Example

    $("div").bind("__after_open.jstree", function (e, data) {
    +  data.rslt.obj.find('> ul > .jstree-closed').each(function () {
    +    data.inst.open_node(this);
    +  }
    +});
    + +

    close_node

    Close a node so that its children are not visible.

    Parameters

    objmixed this is used as a jquery selector - can be jQuery object, DOM node, string, etc.
    animationthe duration in miliseconds of the slideDown animation.  If not supplied the jQuery default is used.  Please note that on IE6 a 0 is enforced here due to performance issues.

    Triggers

    close_node, __after_close

    + +

    close_node

    This event is triggered in the jstree namespace when a node is closed (but if animation is used this event is triggered BEFORE the animation completes).  See __after_close.

    Parameters

    data.instthe instance
    data.argsarray the arguments passed to the function
    data.pluginstring the function’s plugin (here it will be ”core” but if the function is extended it may be something else).
    data.rsltobject which contains a single key: obj (the closed node).

    Example

    $("div").bind("close_node.jstree", function (e, data) {
    +  data.rslt.obj.children('ul').remove();
    +});
    + +

    __after_close

    This event is triggered in the jstree namespace when a node is closed AFTER the animation completes).  See close_node.

    Parameters

    data.instthe instance
    data.rsltobject which contains a single key: obj (the opened node).

    Example

    $("div").bind("__after_close.jstree", function (e, data) {
    +  data.rslt.obj.children('ul').remove();
    +});
    + +

    toggle_node

    toggle_node : function (obj)
    If a node is closedopen it, if it is open - close it.

    Parameters

    objmixed this is used as a jquery selector - can be jQuery object, DOM node, string, etc.
    + +

    open_all

    Open all nodes from a certain node down.

    Parameters

    objmixed this is used as a jquery selector - can be jQuery object, DOM node, string, etc.  If -1 is used or is omitted all nodes in the tree are opened.
    animationthe duration of the slideDown animation when opening the nodes.  If not set 0 is enforced for performance issues.
    original_objused internally to keep track of the recursion - do not set manually!

    Triggers

    open_all

    + +

    open_all

    This event is triggered in the jstree namespace when an open_all call completes.

    Parameters

    data.instthe instance
    data.argsarray the arguments passed to the function
    data.pluginstring the function’s plugin (here it will be ”core” but if the function is extended it may be something else).
    data.rsltobject which contains a single key: obj (the node used in the call).

    Example

    $("div").bind("open_all.jstree", function (e, data) {
    +  alert('DONE');
    +});
    + +

    close_all

    Close all nodes from a certain node down.

    Parameters

    objmixed this is used as a jquery selector - can be jQuery object, DOM node, string, etc.  If -1 is used or is omitted all nodes in the tree are closed.
    animationthe duration of the slideDown animation when closing the nodes.  If not set 0 is enforced for performance issues.

    Triggers

    close_all

    + +

    close_all

    This event is triggered in the jstree namespace when a close_all call completes.

    Parameters

    data.instthe instance
    data.argsarray the arguments passed to the function
    data.pluginstring the function’s plugin (here it will be ”core” but if the function is extended it may be something else).
    data.rsltobject which contains a single key: obj (the node used in the call).

    Example

    $("div").bind("close_all.jstree", function (e, data) {
    +  alert('DONE');
    +});
    + +

    clean_node

    clean_node : function (obj)

    This function converts inserted nodes to the required by jsTree format.  It takes care of converting a simple unodreder list to the internally used markup.  The core calls this function automatically when new data arrives (by binding to the load_node event).  Each plugin may override this function to include its own source, but keep in mind to do it like that:

    clean_node : function(obj) {
    + obj = this.__call_old();
    + obj.each(function () {
    +   // do your stuff here
    + });
    +}

    Parameters

    objmixed this is used as a jquery selector - can be jQuery object, DOM node, string, etc.  If -1 is used or is omitted all nodes in the tree are cleaned.

    Returns

    jQuery collectionthe cleaned children of the original node.
    + +

    correct_node

    This function corrects the open/closed/leaf state as data changes (as the user interacts with the tree).  The core calls this function automatically when a node is opened, deleted or moved.

    Parameters

    objmixed this is used as a jquery selector - can be jQuery object, DOM node, string, etc.  If -1 is used or is omitted the root nodes are processed.

    Returns

    jQuery collectionthe processed children of the original node.
    + +

    scroll_to_node

    scroll_to_node : function (obj)

    This function scrolls the container to the desired node (if needed).

    Parameters

    objmixed this is used as a jquery selector - can be jQuery object, DOM node, string, etc.
    + +

    get_state

    get_state : function ()

    This function returns the current state of the tree (as collected from all active plugins).  Plugin authors: pay special attention to the way this function is extended for new plugins.  In your plugin code write:

    get_state : function () {
    +  var state = this.__call_old();
    +  state.your-plugin-name = <some-value-you-collect>;
    +  return state;
    +}

    Returns

    objectthe current state of the instance
    + +

    set_state

    This function returns sets the state of the tree.  Plugin authors: pay special attention to the way this function is extended for new plugins.  In your plugin code write:

    set_state : function (state, callback) {
    +  if(this.__call_old()) {
    +    if(state.your-plugin-name) {
    +
    +      // restore using `state.your-plugin-name`
    +      // if you need some async activity so that you return to this bit of code
    +      // do not delete state.your-plugin-name and return false (see core's function for example)
    +
    +      delete state.your-plugin-name;
    +      this.set_state(state, callback);
    +      return false;
    +    }
    +    return true;
    +  }
    +  return false;
    +}

    Parameters

    stateobject the state to restore to
    callbackfunction this will be executed in the instance’s scope once restoring is done

    Returns

    booleanthe return value is used to determine the phase of restoration

    Triggers

    set_state

    + +

    set_state

    This event is triggered in the jstree namespace when a set_state call completes.

    Parameters

    data.instthe instance
    data.argsarray the arguments passed to the function
    data.pluginstring the function’s plugin (here it will be ”core” but if the function is extended it may be something else)
    + +

    refresh

    This function saves the current state, reloads the complete tree and returns it to the saved state.

    Triggers

    refresh

    + +

    refresh

    This event is triggered in the jstree namespace when a refresh call completes.

    Parameters

    data.instthe instance
    + +

    get_text

    get_text : function (obj,
    remove_html)

    This function returns the title of the node.

    Parameters

    objmixed this is used as a jquery selector - can be jQuery object, DOM node, string, etc.
    remove_htmlboolean set to true to return plain text instead of HTML

    Returns

    stringthe title of the node, specified by obj
    + +

    set_text

    This function sets the title of the node.  This is a low-level function, you’d be better off using <rename>.

    Parameters

    objmixed this is used as a jquery selector - can be jQuery object, DOM node, string, etc.
    valstring the new title of the node (can be HTMl too)

    Returns

    booleanwas the rename successfull

    Triggers

    set_text

    + +

    set_text

    This event is triggered in the jstree namespace when a set_text call completes.

    Parameters

    data.instthe instance
    data.argsarray the arguments passed to the function
    data.pluginstring the function’s plugin (here it will be ”core” but if the function is extended it may be something else)
    data.rsltobject which contains a two keys: obj (the node) and val (the new title).

    Example

    $("div").bind("set_text.jstree", function (e, data) {
    +  alert("Renamed to: " + data.rslt.val);
    +});
    + +

    parse_json

    parse_json : function (node)

    This function returns a jQuery node after parsing a JSON object (a LI node for single elements or an UL node for multiple).  This function will use the default title from jstree.config.core.strings if none is specified.

    Parameters

    nodemixed the input to parse
    // can be a string
    +"The title of the parsed node"
    +// array of strings
    +[ "Node 1", "Node 2" ]
    +// an object
    +{ "title" : "The title of the parsed node" }
    +// you can manipulate the output
    +{ "title" : "The title of the parsed node", "li_attr" : { "id" : "id_for_li" }, "a_attr" : { "href" : "http://jstree.com" } }
    +// you can supply metadata, which you can later access using $(the_li_node).data()
    +{ "title" : "The title of the parsed node", "data" : { <some-values-here> } }
    +// you can supply children (they can be objects too)
    +{ "title" : "The title of the parsed node", "children" : [ "Node 1", { "title" : "Node 2" } ] }

    Returns

    jQuerythe LI (or UL) node which was produced from the JSON
    + +

    get_json

    get_json : function (obj,
    is_callback)

    This function returns the whole tree (or a single node) in JSON format.  Each plugin may override this function to include its own source, but keep in mind to do it like that:

    get_json : function(obj, is_callback) {
    + var r = this.__call_old();
    + if(is_callback) {
    +  if(<some-condition>) { r.data.jstree.<some-key> = <some-value-this-plugin-will-process>; }
    + }
    + return r;
    +}

    Parameters

    objmixed the input to parse
    is_callbackdo not modify this, jstree uses this parameter to keep track of the recursion

    Returns

    Arrayan array consisting of objects (one for each node)
    + +

    create_node

    This function creates a new node.

    Parameters

    parentmixed the parent for the newly created node.  This is used as a jquery selector, can be jQuery object, DOM node, string, etc.  Use -1 to create a new root node.
    nodemixed the input to parse, check parse_json for description
    positionmixed where to create the new node.  Can be one of “before”, “after”, “first”, “last”, “inside” or a numerical index.
    callbackoptional function to be executed once the node is created
    is_loadedused internally when a node needs to be loaded - do not pass this

    Returns

    jQuerythe LI node which was produced from the JSON (may return undefined if the parent node is not yet loaded, but will create the node)

    Triggers

    create_node

    + +

    create_node

    This event is triggered in the jstree namespace when a new node is created.

    Parameters

    data.instthe instance
    data.argsarray the arguments passed to the function
    data.pluginstring the function’s plugin (here it will be ”core” but if the function is extended it may be something else)
    data.rsltobject which contains a three keys: obj (the node), parent (the parent) and position which is the numerical index.

    Example

    $("div").bind("create_node.jstree", function (e, data) {
    +  alert("Created `" + data.inst.get_text(data.rslt.obj) + "` inside `" + (data.rslt.parent === -1 ? 'the main container' : data.inst.get_text(data.rslt.parent)) + "` at index " + data.rslt.position);
    +});
    + +

    rename_node

    This function renames a new node.

    Parameters

    objmixed the node to rename.  This is used as a jquery selector, can be jQuery object, DOM node, string, etc.
    valstring the new title

    Triggers

    rename_node

    + +

    rename_node

    This event is triggered in the jstree namespace when a node is renamed.

    Parameters

    data.instthe instance
    data.argsarray the arguments passed to the function
    data.pluginstring the function’s plugin (here it will be ”core” but if the function is extended it may be something else)
    data.rsltobject which contains a three keys: obj (the node), title (the new title), old (the old title)

    Example

    $("div").bind("rename_node.jstree", function (e, data) {
    +  alert("Node rename from `" + data.rslt.old + "` to `" + data.rslt.title "`");
    +});
    + +

    delete_node

    This function deletes a node.

    Parameters

    objmixed the node to remove.  This is used as a jquery selector, can be jQuery object, DOM node, string, etc.

    Returns

    mixedthe removed node on success, false on failure

    Triggers

    delete_node

    + +

    delete_node

    This event is triggered in the jstree namespace when a node is deleted.

    Parameters

    data.instthe instance
    data.argsarray the arguments passed to the function
    data.pluginstring the function’s plugin (here it will be ”core” but if the function is extended it may be something else)
    data.rsltobject which contains a three keys: obj (the removed node), prev (the previous sibling of the removed node), parent (the parent of the removed node)

    Example

    $("div").bind("delete_node.jstree", function (e, data) {
    +  alert("Node deleted!");
    +});
    + +

    check

    check : function (chk,
    obj,
    par,
    pos)

    This function checks if a structure modification is valid.

    Parameters

    chkstring what are we checking (copy_node, move_node, rename_node, create_node, delete_node)
    objmixed the node.
    parmixed the parent (if dealing with a move or copy - the new parent).
    posmixed the index among the parent’s children (or the new name if dealing with a rename)
    is_copyboolean is this a copy or a move call

    Returns

    booleantrue if the move is valid, false otherwise
    + +

    move_node

    This function moves a node.

    Parameters

    objmixed the node to move.  This is used as a jquery selector, can be jQuery object, DOM node, string, etc.
    parentmixed the new parent.  This is used as a jquery selector, can be jQuery object, DOM node, string, etc.  Use -1 to promote to a root node.
    positionmixed where to create the new node.  Can be one of “before”, “after”, “first”, “last”, “inside” or a numerical index.
    callbackoptional function to be executed once the node is moved
    is_loadedused internally when a node needs to be loaded - do not pass this

    Returns

    booleanindicating if the move was successfull (may return undefined if the parent node is not yet loaded, but will move the node)

    Triggers

    move_node

    + +

    move_node

    This event is triggered in the jstree namespace when a node is moved.

    Parameters

    data.instthe instance
    data.argsarray the arguments passed to the function
    data.pluginstring the function’s plugin (here it will be ”core” but if the function is extended it may be something else)
    data.rsltobject which contains a five keys: obj (the node), parent (the new parent) and position which is the numerical index, old parent (the old parent) and is_multi (a boolean indicating if the node is coming from another tree instance)

    Example

    $("div").bind("move_node.jstree", function (e, data) {
    +  alert("Moved `" + data.inst.get_text(data.rslt.obj) + "` inside `" + (data.rslt.parent === -1 ? 'the main container' : data.inst.get_text(data.rslt.parent)) + "` at index " + data.rslt.position);
    +});
    + +

    copy_node

    This function copies a node.

    Parameters

    objmixed the node to copy.  This is used as a jquery selector, can be jQuery object, DOM node, string, etc.
    parentmixed the new parent.  This is used as a jquery selector, can be jQuery object, DOM node, string, etc.  Use -1 to promote to a root node.
    positionmixed where to create the new node.  Can be one of “before”, “after”, “first”, “last”, “inside” or a numerical index.
    callbackoptional function to be executed once the node is moved
    is_loadedused internally when a node needs to be loaded - do not pass this

    Returns

    booleanindicating if the move was successfull (may return undefined if the parent node is not yet loaded, but will move the node)

    Triggers

    copy_node

    + +

    copy_node

    This event is triggered in the jstree namespace when a node is copied.

    Parameters

    data.instthe instance
    data.argsarray the arguments passed to the function
    data.pluginstring the function’s plugin (here it will be ”core” but if the function is extended it may be something else)
    data.rsltobject which contains a five keys: obj (the node), parent (the new parent) and position which is the numerical index, original (the original object), is_multi (a boolean indicating if the node is coming from another tree instance, old instance (the source instance) and new instance (the receiving instance))

    Example

    $("div").bind("copy_node.jstree", function (e, data) {
    +  alert("Copied `" + data.inst.get_text(data.rslt.original) + "` inside `" + (data.rslt.parent === -1 ? 'the main container' : data.inst.get_text(data.rslt.parent)) + "` at index " + data.rslt.position);
    +});
    + +
    + + + + + + + + + + +
    The actual plugin wrapper, use this to create instances or execute functions on created instances.
    $.jstree
    object Contains all static functions and variables used by jstree, some plugins also append variables.
    _get_string : function (s)
    Used to get the common string in the tree.
    is_locked : function ()
    Used to get the locked status of the tree.
    get_node : function (obj)
    Get a hold of the LI node (which represents the jstree node).
    get_next : function (obj,
    strict)
    Get the next sibling of a node
    get_prev : function (obj,
    strict)
    Get the previous sibling of a node
    get_parent : function (obj)
    Get the parent of a node
    get_children : function (obj)
    Get all the children of a node
    is_parent : function (obj)
    Check if a node is a parent.
    is_loaded : function (obj)
    Check if a node is loaded.
    is_loading : function (obj)
    Check if a node is currently loading.
    is_open : function (obj)
    Check if a node is currently open.
    is_closed : function (obj)
    Check if a node is currently closed.
    is_leaf : function (obj)
    Check if a node is a leaf node (has no children).
    _load_node : function (obj,
    callback)
    Load the children of a node, but as opposed to load_node does not change any visual properties or trigger events.
    Load the children of a node.
    toggle_node : function (obj)
    clean_node : function (obj)
    This function converts inserted nodes to the required by jsTree format.
    scroll_to_node : function (obj)
    This function scrolls the container to the desired node (if needed).
    get_state : function ()
    This function returns the current state of the tree (as collected from all active plugins).
    get_text : function (obj,
    remove_html)
    This function returns the title of the node.
    parse_json : function (node)
    This function returns a jQuery node after parsing a JSON object (a LI node for single elements or an UL node for multiple).
    get_json : function (obj,
    is_callback)
    This function returns the whole tree (or a single node) in JSON format.
    check : function (chk,
    obj,
    par,
    pos)
    This function checks if a structure modification is valid.
    Returns an instance
    Creates a new jstree instance, any arguments after the first one are merged and used to configure the tree.
    Call a function on the instance and return the result
    Destroys an instance, and also clears `jstree-` prefixed classes and all events in the `jstree` namespace
    mixed used to store all localization strings.
    This event is triggered in the jstree namespace when data is first rendered in the tree.
    Used to unlock the tree.
    Used to lock the tree.
    Open a node so that its children are visible.
    This event is triggered in the jstree namespace when a node is successfully opened AFTER the animation completes).
    Close a node so that its children are not visible.
    This event is triggered in the jstree namespace when a node is closed AFTER the animation completes).
    Open all nodes from a certain node down.
    Close all nodes from a certain node down.
    This function returns sets the state of the tree.
    This function saves the current state, reloads the complete tree and returns it to the saved state.
    This function sets the title of the node.
    This function creates a new node.
    This function renames a new node.
    This function deletes a node.
    This function moves a node.
    This function copies a node.
    + + + + + + + + \ No newline at end of file diff --git a/_docs/files/jstree-json-js.html b/docs/files/jstree-json-js.html similarity index 53% rename from _docs/files/jstree-json-js.html rename to docs/files/jstree-json-js.html index 7a87fab0..dc7a2d52 100644 --- a/_docs/files/jstree-json-js.html +++ b/docs/files/jstree-json-js.html @@ -18,10 +18,10 @@
    - + - diff --git a/_docs/files/jstree-sort-js.html b/docs/files/jstree-sort-js.html similarity index 53% rename from _docs/files/jstree-sort-js.html rename to docs/files/jstree-sort-js.html index c2d53cdf..f1ae7377 100644 --- a/_docs/files/jstree-sort-js.html +++ b/docs/files/jstree-sort-js.html @@ -18,10 +18,10 @@ - + - diff --git a/docs/files/jstree-state-js.html b/docs/files/jstree-state-js.html new file mode 100644 index 00000000..bdbf45ae --- /dev/null +++ b/docs/files/jstree-state-js.html @@ -0,0 +1,40 @@ + + +jstree.state.js - jstree + + + + + + + + + +

    jstree.state.js

    This plugin enables state saving between reloads.

    Summary
    jstree.state.jsThis plugin enables state saving between reloads.
    jstree state plugin
    + +

    jstree state plugin

    + +
    + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/_docs/files/jstree-themes-js.html b/docs/files/jstree-themes-js.html similarity index 81% rename from _docs/files/jstree-themes-js.html rename to docs/files/jstree-themes-js.html index a22a9857..8155b5d2 100644 --- a/_docs/files/jstree-themes-js.html +++ b/docs/files/jstree-themes-js.html @@ -40,10 +40,10 @@ - + - diff --git a/docs/files/jstree-ui-js.html b/docs/files/jstree-ui-js.html new file mode 100644 index 00000000..1ef90d72 --- /dev/null +++ b/docs/files/jstree-ui-js.html @@ -0,0 +1,40 @@ + + +jstree.ui.js - jstree + + + + + + + + + +

    jstree.ui.js

    This plugin enables selecting, deselecting and hovering tree items.

    Summary
    jstree.ui.jsThis plugin enables selecting, deselecting and hovering tree items.
    jstree UI plugin
    + +

    jstree UI plugin

    + +
    + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/_docs/files/jstree-unique-js.html b/docs/files/jstree-unique-js.html similarity index 53% rename from _docs/files/jstree-unique-js.html rename to docs/files/jstree-unique-js.html index bbc6e842..179a6bd0 100644 --- a/_docs/files/jstree-unique-js.html +++ b/docs/files/jstree-unique-js.html @@ -18,10 +18,10 @@ - + - diff --git a/_docs/files/jstree-xml-js.html b/docs/files/jstree-xml-js.html similarity index 53% rename from _docs/files/jstree-xml-js.html rename to docs/files/jstree-xml-js.html index 783906d3..e1f7da61 100644 --- a/_docs/files/jstree-xml-js.html +++ b/docs/files/jstree-xml-js.html @@ -18,10 +18,10 @@ - + - diff --git a/_docs/files/vakata-js.html b/docs/files/vakata-js.html similarity index 82% rename from _docs/files/vakata-js.html rename to docs/files/vakata-js.html index ecc359f4..d0da5f89 100644 --- a/_docs/files/vakata-js.html +++ b/docs/files/vakata-js.html @@ -11,7 +11,7 @@ -

    Helper functions

    This file includes some functions that enable CSS manipulations, contextmenus, XSLT transformations and drag’n’drop.  All of those work independently of jstree.

    Summary
    Helper functionsThis file includes some functions that enable CSS manipulations, contextmenus, XSLT transformations and drag’n’drop.
    $.vakataobject Holds all helper objects.
    MiscellaneousVarious small snippets.
    $().vakata_reverseMakes it possible to apply the standard array reverse function to a jQuery collection.
    $.vakata.array_removeMakes it possible to remove an item (or a group of items) form an array.
    $.vakata.array_uniqueReturns only the unique items from an array.
    $.vakata.attributesCollects all attributes from a DOM node.
    $.vakata.get_scrollbar_widthGets the width of the scrollbar
    CSSFunctions needed to manipulate stylesheets (add, remove, change)
    $.vakata.cssobject holds all CSS related functions
    $.vakata.css.get_cssRetrieves or deletes a specific rule.
    $.vakata.css.add_cssAdds a rule.
    $.vakata.css.remove_cssRemoves a rule, this functions is a shortcut to $.vakata.css.get_css with the delete flag set to true.
    $.vakata.css.add_sheetAdds a whole stylesheet or appends to an existing stylesheet.
    Drag’n’dropFunctions needed to drag’n’drop elements
    $.vakata.dndobject holds all DND related functions
    $.vakata.dnd.settingsobject holds the global settings object for DND.
    $.vakata.dnd.settings.scroll_speedinteger how fast (pixel count for each step) should a scrollable parent scroll when dragging near the edge.
    $.vakata.dnd.settings.scroll_proximityinteger number of pixels from the edge of a scrollable parent below which the parent will start scrolling.
    $.vakata.dnd.settings.helper_leftinteger number of pixels left of the cursor to move the drag-helper to.
    $.vakata.dnd.settings.helper_topinteger number of pixels below the cursor to move the drag-helper to.
    $.vakata.dnd.settings.thresholdinteger amount of pixels required to move before the drag is started.
    $.vakata.dnd._triggerUsed internally to trigger all necessary events.
    $.vakata.dnd._getUsed internally to get all items for the drag event.
    $.vakata.dnd._cleanUsed internally to cleanup after a drop, so that all variables are nulled and ready for the next drag.
    $.vakata.dnd._scrollUsed internally to scroll hovered elements.
    dnd_scrollFires when a container is scrolled due to dragging near its edge.
    $.vakata.dnd.startUse this function to start a drag (usually with the mousedown event)
    $.vakata.dnd.dragUsed internally to process the mousemove event after $.vakata.dnd.start is called.
    dnd_startMarks the start of the drag.
    dnd_moveTriggered multiple times while dragging.
    $.vakata.dnd.stopUsed internally to process the mouseup event (drop) after $.vakata.dnd.start is called.
    dnd_stopMarks the end of the drag.
    XSLTA function used to do XSLT transformations.
    $.vakata.xsltThis functions transforms a XML string using a XSL string.
    Context menuFunctions needed to show a custom context menu.
    $.vakata.contextobject holds all context menu related functions and variables.
    $.vakata.context.settingsobject holds the global settings object for context menus.
    $.vakata.context.settings.hide_onmouseleaveinteger the amount of milliseconds to wait before hiding the menu after mouseleave.
    $.vakata.context.settings.iconsboolean whether to show icons or not.
    $.vakata.context._triggerUsed internally to trigger all necessary events.
    $.vakata.context._executeUsed internally to execute the action (if any) associated with an item.
    $.vakata.context._parseUsed internally to parse a contextmenu description object to an HTML string.
    context_parseTriggered when the context menu is parsed but not yet shown.
    $.vakata.context._show_submenuUsed internally to show a submenu
    $.vakata.context.showShows the context menu.
    context_menu_itemobject Used to construct a context menu entry, this structure will always be a part of an object.
    context_showTriggered when the context menu is shown.
    $.vakata.context.hideUsed internally to hide the contextmenu after a click, or on mouseleave, etc.
    context_hideTriggered when the context menu is hidden.
    JSONFunctions needed to encode/decode JSON.
    $.vakata.jsonobject holds all JSON related functions.
    $.vakata.json.encodeA function for encoding data in a JSON notated string.
    $.vakata.json.decodeExists for consistency and is a simple wrapper for jQuery.parseJSON.
    CookieA copy of the jQuery cookie plugin.
    $.vakata.cookieA function for getting and setting cookies.
    LocalStorageFunctions for dealing with localStorage with fallback to userData or cookies.
    $.vakata.storageobject holds all storage related functions and properties.
    $.vakata.storage.versionstring the version of jstorage used
    $.vakata.storage.setSet a key to a value
    $.vakata.storage.getGet a value by key.
    $.vakata.storage.delRemove a key.
    $.vakata.storage.flushEmpty the storage.
    $.vakata.storage.storageObjGet a read only copy of the whole storage.
    $.vakata.storage.indexGet an array of all the set keys in the storage.
    $.vakata.storage.storageSizeGet the size of all items in the storage in bytes.
    $.vakata.storage.currentBackendGet the current backend used.
    $.vakata.storage.storageAvailableSee if storage functionality is available.
    PrettyDateModifies time elements to a more human readable value.
    $.vakata.pretty_dateobject holds all pretty-date related functions and properties.
    $.vakata.pretty_date.langobject the localization to use.
    $.vakata.pretty_date.parseParses the difference between to dates to a human readable string.
    $.vakata.pretty_date.initParses all time elements in the document and keeps reparsing them every few seconds.
    $().vakata_pretty_dateSets the HTML of every element to the parsed difference of its datetime attribute and the compare parameter.
    SelectionSelection related functions
    $.vakata.selectionobject holds all selection related functions and properties.
    $.vakata.selection.getGets the current selection.
    $.vakata.selection.elm_getGets the selection inside an input element or textarea.
    $.vakata.selection.elm_setSets the selection inside an input element or textarea.
    $.vakata.selection.elm_replaceReplace the selection inside an input element or textarea.
    $.vakata.selection.elm_get_caretReturns the caret position in the element.
    $.vakata.selection.elm_set_caretSets the caret position in the element.
    $.vakata.selection.elm_get_caret_positionReturns the caret position in pixels relative to the element.
    +

    Helper functions

    This file includes some functions that enable CSS manipulations, contextmenus, XSLT transformations and drag’n’drop.  All of those work independently of jstree.

    Summary
    Helper functionsThis file includes some functions that enable CSS manipulations, contextmenus, XSLT transformations and drag’n’drop.
    $.vakataobject Holds all helper objects.
    MiscellaneousVarious small snippets.
    $().vakata_reverseMakes it possible to apply the standard array reverse function to a jQuery collection.
    $.vakata.array_removeMakes it possible to remove an item (or a group of items) form an array.
    $.vakata.array_uniqueReturns only the unique items from an array.
    $.vakata.attributesCollects all attributes from a DOM node.
    $.vakata.get_scrollbar_widthGets the width of the scrollbar
    CSSFunctions needed to manipulate stylesheets (add, remove, change)
    $.vakata.cssobject holds all CSS related functions
    $.vakata.css.get_cssRetrieves or deletes a specific rule.
    $.vakata.css.add_cssAdds a rule.
    $.vakata.css.remove_cssRemoves a rule, this functions is a shortcut to $.vakata.css.get_css with the delete flag set to true.
    $.vakata.css.add_sheetAdds a whole stylesheet or appends to an existing stylesheet.
    Drag’n’dropFunctions needed to drag’n’drop elements
    $.vakata.dndobject holds all DND related functions
    $.vakata.dnd.settingsobject holds the global settings object for DND.
    $.vakata.dnd.settings.scroll_speedinteger how fast (pixel count for each step) should a scrollable parent scroll when dragging near the edge.
    $.vakata.dnd.settings.scroll_proximityinteger number of pixels from the edge of a scrollable parent below which the parent will start scrolling.
    $.vakata.dnd.settings.helper_leftinteger number of pixels left of the cursor to move the drag-helper to.
    $.vakata.dnd.settings.helper_topinteger number of pixels below the cursor to move the drag-helper to.
    $.vakata.dnd.settings.thresholdinteger amount of pixels required to move before the drag is started.
    $.vakata.dnd._triggerUsed internally to trigger all necessary events.
    $.vakata.dnd._getUsed internally to get all items for the drag event.
    $.vakata.dnd._cleanUsed internally to cleanup after a drop, so that all variables are nulled and ready for the next drag.
    $.vakata.dnd._scrollUsed internally to scroll hovered elements.
    dnd_scrollFires when a container is scrolled due to dragging near its edge.
    $.vakata.dnd.startUse this function to start a drag (usually with the mousedown event)
    $.vakata.dnd.dragUsed internally to process the mousemove event after $.vakata.dnd.start is called.
    dnd_startMarks the start of the drag.
    dnd_moveTriggered multiple times while dragging.
    $.vakata.dnd.stopUsed internally to process the mouseup event (drop) after $.vakata.dnd.start is called.
    dnd_stopMarks the end of the drag.
    XSLTA function used to do XSLT transformations.
    $.vakata.xsltThis functions transforms a XML string using a XSL string.
    HotkeysCopy of the John Resig’s fork of http://github.com/tzuryby/hotkeys for consistency
    Context menuFunctions needed to show a custom context menu.
    $.vakata.contextobject holds all context menu related functions and variables.
    $.vakata.context.settingsobject holds the global settings object for context menus.
    $.vakata.context.settings.hide_onmouseleaveinteger the amount of milliseconds to wait before hiding the menu after mouseleave.
    $.vakata.context.settings.iconsboolean whether to show icons or not.
    $.vakata.context._triggerUsed internally to trigger all necessary events.
    $.vakata.context._executeUsed internally to execute the action (if any) associated with an item.
    $.vakata.context._parseUsed internally to parse a contextmenu description object to an HTML string.
    context_parseTriggered when the context menu is parsed but not yet shown.
    $.vakata.context._show_submenuUsed internally to show a submenu
    $.vakata.context.showShows the context menu.
    context_menu_itemobject Used to construct a context menu entry, this structure will always be a part of an object.
    context_showTriggered when the context menu is shown.
    $.vakata.context.hideUsed internally to hide the contextmenu after a click, or on mouseleave, etc.
    context_hideTriggered when the context menu is hidden.
    JSONFunctions needed to encode/decode JSON.
    $.vakata.jsonobject holds all JSON related functions.
    $.vakata.json.encodeA function for encoding data in a JSON notated string.
    $.vakata.json.decodeExists for consistency and is a simple wrapper for jQuery.parseJSON.
    CookieA copy of the jQuery cookie plugin.
    $.vakata.cookieA function for getting and setting cookies.
    LocalStorageFunctions for dealing with localStorage with fallback to userData or cookies.
    $.vakata.storageobject holds all storage related functions and properties.
    $.vakata.storage.versionstring the version of jstorage used
    $.vakata.storage.setSet a key to a value
    $.vakata.storage.getGet a value by key.
    $.vakata.storage.delRemove a key.
    $.vakata.storage.flushEmpty the storage.
    $.vakata.storage.storageObjGet a read only copy of the whole storage.
    $.vakata.storage.indexGet an array of all the set keys in the storage.
    $.vakata.storage.storageSizeGet the size of all items in the storage in bytes.
    $.vakata.storage.currentBackendGet the current backend used.
    $.vakata.storage.storageAvailableSee if storage functionality is available.
    PrettyDateModifies time elements to a more human readable value.
    $.vakata.pretty_dateobject holds all pretty-date related functions and properties.
    $.vakata.pretty_date.langobject the localization to use.
    $.vakata.pretty_date.parseParses the difference between to dates to a human readable string.
    $.vakata.pretty_date.initParses all time elements in the document and keeps reparsing them every few seconds.
    $().vakata_pretty_dateSets the HTML of every element to the parsed difference of its datetime attribute and the compare parameter.
    SelectionSelection related functions
    $.vakata.selectionobject holds all selection related functions and properties.
    $.vakata.selection.getGets the current selection.
    $.vakata.selection.elm_getGets the selection inside an input element or textarea.
    $.vakata.selection.elm_setSets the selection inside an input element or textarea.
    $.vakata.selection.elm_replaceReplace the selection inside an input element or textarea.
    $.vakata.selection.elm_get_caretReturns the caret position in the element.
    $.vakata.selection.elm_set_caretSets the caret position in the element.
    $.vakata.selection.elm_get_caret_positionReturns the caret position in pixels relative to the element.
    $.vakata_highlightHightlight words in the matched elements

    $.vakata

    (function ($) { $.vakata = {}; })(jQuery)

    object Holds all helper objects.

    @@ -98,6 +98,8 @@ this.some_process(res); }, some_object);
    +

    Hotkeys

    Copy of the John Resig’s fork of http://github.com/tzuryby/hotkeys for consistency

    +

    Context menu

    Functions needed to show a custom context menu.

    $.vakata.context

    $.vakata.context

    object holds all context menu related functions and variables.

    @@ -231,13 +233,15 @@

    $.vakata.selection.elm_get_caret_position

    Returns the caret position in pixels relative to the element.

    Parameters

    ethe actual DOM element or the ID of the element

    Returns

    *object*the current position (with left and top values)
    +

    $.vakata_highlight

    Hightlight words in the matched elements

    Parameters

    settingsif a string is passed, it is used to search and highlight, if an array of strings is passed, each string is highlighted, you can also pass an object, containing a words string or array, a color string or array, a css class string.
    + - + - diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 00000000..8ab64e74 --- /dev/null +++ b/docs/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/index/Classes.html b/docs/index/Classes.html new file mode 100644 index 00000000..a139cb01 --- /dev/null +++ b/docs/index/Classes.html @@ -0,0 +1,33 @@ + + +Class Index - jstree + + + + + + + + + +
    Class Index
    $#! · 0-9 · A · B · C · D · E · F · G · H · I · J · K · L · M · N · O · P · Q · R · S · T · U · V · W · X · Y · Z
    J
     jstree
    + + + +
    + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/index/Events.html b/docs/index/Events.html new file mode 100644 index 00000000..77bc1e97 --- /dev/null +++ b/docs/index/Events.html @@ -0,0 +1,41 @@ + + +Event Index - jstree + + + + + + + + + +
    Event Index
    $#! · 0-9 · A · B · C · D · E · F · G · H · I · J · K · L · M · N · O · P · Q · R · S · T · U · V · W · X · Y · Z
    $#!
     __after_close, jstree
     __after_open, jstree
     __loaded, jstree
     __ready, jstree
    C
     context_hide
     context_parse
     context_show
    D
     dnd_move
     dnd_scroll
     dnd_start
     dnd_stop
    + +
    This event is triggered in the jstree namespace when a node is closed AFTER the animation completes).
    This event is triggered in the jstree namespace when a node is successfully opened AFTER the animation completes).
    This event is triggered in the jstree namespace when data is first rendered in the tree.
    This event is triggered in the jstree namespace when all initial loading is done.
    + + + +
    Triggered when the context menu is hidden.
    Triggered when the context menu is parsed but not yet shown.
    Triggered when the context menu is shown.
    + + + +
    Triggered multiple times while dragging.
    Fires when a container is scrolled due to dragging near its edge.
    Marks the start of the drag.
    Marks the end of the drag.
    + +
    + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/index/Files.html b/docs/index/Files.html new file mode 100644 index 00000000..bdac5a5c --- /dev/null +++ b/docs/index/Files.html @@ -0,0 +1,37 @@ + + +File Index - jstree + + + + + + + + + +
    File Index
    $#! · 0-9 · A · B · C · D · E · F · G · H · I · J · K · L · M · N · O · P · Q · R · S · T · U · V · W · X · Y · Z
    H
     Helper functions
    J
     jstree.checkbox.js
     jstree.contextmenu.js
     jstree.dnd.js
     jstree.hotkeys.js
     jstree.html.js
     jstree.js
     jstree.json.js
     jstree.sort.js
     jstree.state.js
     jstree.themes.js
     jstree.ui.js
     jstree.unique.js
     jstree.xml.js
    + +
    This file includes some functions that enable CSS manipulations, contextmenus, XSLT transformations and drag’n’drop.
    + + + +
    Adds checkboxes to the tree.
    Enables a rightclick contextmenu.
    Enables drag’n’drop.
    Enables keyboard shortcuts.
    This plugin makes it possible for jstree to use HTML data sources (other than the container’s initial HTML).
    The only required part of jstree it consists of a few functions bound to the $.jstree object, the actual plugin function and a few core functions for manipulating a tree.
    This plugin makes it possible for jstree to use JSON data sources.
    Sorts items alphabetically (or using any other function)
    This plugin enables state saving between reloads.
    Controls the looks of jstree, without this plugin you will get a functional tree, but it will look just like an ordinary UL list
    This plugin enables selecting, deselecting and hovering tree items.
    Does not allow the same name amongst siblings (still a bit experimental).
    This plugin makes it possible for jstree to use XML data sources.
    + +
    + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/index/Functions.html b/docs/index/Functions.html new file mode 100644 index 00000000..57902b29 --- /dev/null +++ b/docs/index/Functions.html @@ -0,0 +1,105 @@ + + +Function Index - jstree + + + + + + + + + +
    Function Index
    $#! · 0-9 · A · B · C · D · E · F · G · H · I · J · K · L · M · N · O · P · Q · R · S · T · U · V · W · X · Y · Z
    $#!
     __call, $.jstree
     __construct, $.jstree
     __destruct, $.jstree
     __trigger, jstree
     _clean, $.vakata.dnd
     _execute, $.vakata.context
     _focus, $.jstree
     _focused, $.jstree
     _get, $.vakata.dnd
     _get_string, jstree
     _load_node, jstree
     _parse, $.vakata.context
     _reference, $.jstree
     _scroll, $.vakata.dnd
     _show_submenu, $.vakata.context
     _trigger
    A
     add_css, $.vakata.css
     add_sheet, $.vakata.css
     array_remove, $.vakata
     array_unique, $.vakata
     attributes, $.vakata
    C
     check, jstree
     clean_node, jstree
     close_all, jstree
     close_node, jstree
     cookie, $.vakata
     copy_node, jstree
     correct_node, jstree
     create_node, jstree
     currentBackend, $.vakata.storage
    D
     decode, $.vakata.json
     del, $.vakata.storage
     delete_node, jstree
     drag, $.vakata.dnd
    E
     elm_get, $.vakata.selection
     elm_get_caret, $.vakata.selection
     elm_get_caret_position, $.vakata.selection
     elm_replace, $.vakata.selection
     elm_set, $.vakata.selection
     elm_set_caret, $.vakata.selection
     encode, $.vakata.json
    F
     flush, $.vakata.storage
    G
     get
     get_children, jstree
     get_container, jstree
     get_container_ul, jstree
     get_css, $.vakata.css
     get_index, jstree
     get_json, jstree
     get_next, jstree
     get_node, jstree
     get_parent, jstree
     get_prev, jstree
     get_scrollbar_width, $.vakata
     get_settings, jstree
     get_state, jstree
     get_text, jstree
    H
     hide, $.vakata.context
    I
     index, $.vakata.storage
     init
     is_closed, jstree
     is_leaf, jstree
     is_loaded, jstree
     is_loading, jstree
     is_locked, jstree
     is_open, jstree
     is_parent, jstree
    L
     load_node, jstree
     lock, jstree
    M
     move_node, jstree
    O
     open_all, jstree
     open_node, jstree
    P
     parse, $.vakata.pretty_date
     parse_json, jstree
     plugin, $.jstree
    R
     refresh, jstree
     remove_css, $.vakata.css
     rename_node, jstree
    S
     scroll_to_node, jstree
     set, $.vakata.storage
     set_state, jstree
     set_text, jstree
     set_theme, jstree
     show, $.vakata.context
     start, $.vakata.dnd
     stop, $.vakata.dnd
     storageAvailable, $.vakata.storage
     storageObj, $.vakata.storage
     storageSize, $.vakata.storage
    T
     toggle_node, jstree
    U
     unlock, jstree
    V
     vakata_highlight, $
     vakata_pretty_date, $()
     vakata_reverse, $()
    X
     xslt, $.vakata
    + +
    Call a function on the instance and return the result
    Creates a new jstree instance, any arguments after the first one are merged and used to configure the tree.
    Destroys an instance, and also clears `jstree-` prefixed classes and all events in the `jstree` namespace
    Used internally to trigger events on the container node.
    Used internally to cleanup after a drop, so that all variables are nulled and ready for the next drag.
    Used internally to execute the action (if any) associated with an item.
    Make an instance focused (which defocuses the previously focused instance)
    Returns the currently focused instance (by default once an instance is created it is focused)
    Used internally to get all items for the drag event.
    _get_string : function (s)
    Used to get the common string in the tree.
    _load_node : function (obj,
    callback)
    Load the children of a node, but as opposed to load_node does not change any visual properties or trigger events.
    Used internally to parse a contextmenu description object to an HTML string.
    Returns an instance
    Used internally to scroll hovered elements.
    Used internally to show a submenu
    Used internally to trigger all necessary events.
    Used internally to trigger all necessary events.
    + + + +
    Adds a rule.
    Adds a whole stylesheet or appends to an existing stylesheet.
    Makes it possible to remove an item (or a group of items) form an array.
    Returns only the unique items from an array.
    Collects all attributes from a DOM node.
    + + + +
    check : function (chk,
    obj,
    par,
    pos)
    This function checks if a structure modification is valid.
    clean_node : function (obj)
    This function converts inserted nodes to the required by jsTree format.
    Close all nodes from a certain node down.
    Close a node so that its children are not visible.
    $.vakata.cookie = function (key,
    value,
    options)
    A function for getting and setting cookies.
    This function copies a node.
    This function corrects the open/closed/leaf state as data changes (as the user interacts with the tree).
    This function creates a new node.
    Get the current backend used.
    + + + +
    Exists for consistency and is a simple wrapper for jQuery.parseJSON.
    Remove a key.
    This function deletes a node.
    Used internally to process the mousemove event after $.vakata.dnd.start is called.
    + + + +
    Gets the selection inside an input element or textarea.
    Returns the caret position in the element.
    Returns the caret position in pixels relative to the element.
    Replace the selection inside an input element or textarea.
    Sets the selection inside an input element or textarea.
    Sets the caret position in the element.
    A function for encoding data in a JSON notated string.
    + + + +
    Empty the storage.
    + + + +
    Gets the current selection.
    Get a value by key.
    get_children : function (obj)
    Get all the children of a node
    Returns the jQuery extended container of the tree (the element you used when constructing the tree).
    Returns the jQuery extended first UL node inside the container of the tree.
    Retrieves or deletes a specific rule.
    Returns an integer, which is the instance’s index.
    get_json : function (obj,
    is_callback)
    This function returns the whole tree (or a single node) in JSON format.
    get_next : function (obj,
    strict)
    Get the next sibling of a node
    get_node : function (obj)
    Get a hold of the LI node (which represents the jstree node).
    get_parent : function (obj)
    Get the parent of a node
    get_prev : function (obj,
    strict)
    Get the previous sibling of a node
    Gets the width of the scrollbar
    Returns the settings for the tree.
    get_state : function ()
    This function returns the current state of the tree (as collected from all active plugins).
    get_text : function (obj,
    remove_html)
    This function returns the title of the node.
    + + + +
    Used internally to hide the contextmenu after a click, or on mouseleave, etc.
    + + + +
    Get an array of all the set keys in the storage.
    Parses all time elements in the document and keeps reparsing them every few seconds.
    Used internally.
    is_closed : function (obj)
    Check if a node is currently closed.
    is_leaf : function (obj)
    Check if a node is a leaf node (has no children).
    is_loaded : function (obj)
    Check if a node is loaded.
    is_loading : function (obj)
    Check if a node is currently loading.
    is_locked : function ()
    Used to get the locked status of the tree.
    is_open : function (obj)
    Check if a node is currently open.
    is_parent : function (obj)
    Check if a node is a parent.
    + + + +
    Load the children of a node.
    Used to lock the tree.
    + + + +
    This function moves a node.
    + + + +
    Open all nodes from a certain node down.
    Open a node so that its children are visible.
    + + + +
    Parses the difference between to dates to a human readable string.
    parse_json : function (node)
    This function returns a jQuery node after parsing a JSON object (a LI node for single elements or an UL node for multiple).
    Register a plugin
    + + + +
    This function saves the current state, reloads the complete tree and returns it to the saved state.
    Removes a rule, this functions is a shortcut to $.vakata.css.get_css with the delete flag set to true.
    This function renames a new node.
    + + + +
    scroll_to_node : function (obj)
    This function scrolls the container to the desired node (if needed).
    Set a key to a value
    This function returns sets the state of the tree.
    This function sets the title of the node.
    set_theme : function (theme_name,
    theme_url)
    Sets the tree theme.
    Shows the context menu.
    Use this function to start a drag (usually with the mousedown event)
    Used internally to process the mouseup event (drop) after $.vakata.dnd.start is called.
    See if storage functionality is available.
    Get a read only copy of the whole storage.
    Get the size of all items in the storage in bytes.
    + + + +
    toggle_node : function (obj)
    + + + +
    Used to unlock the tree.
    + + + +
    Hightlight words in the matched elements
    $.fn.vakata_pretty_date = function (format,
    compare)
    Sets the HTML of every element to the parsed difference of its datetime attribute and the compare parameter.
    Makes it possible to apply the standard array reverse function to a jQuery collection.
    + + + +
    $.vakata.xslt = function (xml,
    xsl)
    This functions transforms a XML string using a XSL string.
    + +
    + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/index/General.html b/docs/index/General.html new file mode 100644 index 00000000..c92b3383 --- /dev/null +++ b/docs/index/General.html @@ -0,0 +1,65 @@ + + +Index - jstree + + + + + + + + + +
    Index
    $#! · 0-9 · A · B · C · D · E · F · G · H · I · J · K · L · M · N · O · P · Q · R · S · T · U · V · W · X · Y · Z
    $#!
     __after_close, jstree
     __after_open, jstree
     __call, $.jstree
     __construct, $.jstree
     __destruct, $.jstree
     __loaded, jstree
     __ready, jstree
     __trigger, jstree
     _clean, $.vakata.dnd
     _execute, $.vakata.context
     _focus, $.jstree
     _focused, $.jstree
     _get, $.vakata.dnd
     _get_string, jstree
     _load_node, jstree
     _parse, $.vakata.context
     _reference, $.jstree
     _scroll, $.vakata.dnd
     _show_submenu, $.vakata.context
     _trigger
    A
     add_css, $.vakata.css
     add_sheet, $.vakata.css
     array_remove, $.vakata
     array_unique, $.vakata
     attributes, $.vakata
    C
     check, jstree
     CHECKBOX functions
     clean_node, jstree
     close_all, jstree
     close_node, jstree
     context, $.vakata
     Context menu
     context_hide
     context_menu_item
     context_parse
     context_show
     cookie, $.vakata
     Cookie
     copy_node, jstree
     CORE functions, jstree
     CORE options, jstree
     correct_node, jstree
     create_node, jstree
     css, $.vakata
     CSS
     currentBackend, $.vakata.storage
    D
     data, jstree
     decode, $.vakata.json
     defaults, $.jstree
     del, $.vakata.storage
     delete_node, jstree
     dnd, $.vakata
     dnd_move
     dnd_scroll
     dnd_start
     dnd_stop
     dots, jstree.config.themes
     drag, $.vakata.dnd
     Drag’n’drop
    E
     elm_get, $.vakata.selection
     elm_get_caret, $.vakata.selection
     elm_get_caret_position, $.vakata.selection
     elm_replace, $.vakata.selection
     elm_set, $.vakata.selection
     elm_set_caret, $.vakata.selection
     encode, $.vakata.json
    F
     flush, $.vakata.storage
    G
     get
     get_children, jstree
     get_container, jstree
     get_container_ul, jstree
     get_css, $.vakata.css
     get_index, jstree
     get_json, jstree
     get_next, jstree
     get_node, jstree
     get_parent, jstree
     get_prev, jstree
     get_scrollbar_width, $.vakata
     get_settings, jstree
     get_state, jstree
     get_text, jstree
    H
     Helper functions
     helper_left, $.vakata.dnd.settings
     helper_top, $.vakata.dnd.settings
     hide, $.vakata.context
     hide_onmouseleave, $.vakata.context.settings
     Hotkeys
    I
     icons
     index, $.vakata.storage
     init
     is_closed, jstree
     IS_FF2, $.jstree
     IS_IE6, $.jstree
     IS_IE7, $.jstree
     is_leaf, jstree
     is_loaded, jstree
     is_loading, jstree
     is_locked, jstree
     is_open, jstree
     is_parent, jstree
    + +
    This event is triggered in the jstree namespace when a node is closed AFTER the animation completes).
    This event is triggered in the jstree namespace when a node is successfully opened AFTER the animation completes).
    Call a function on the instance and return the result
    Creates a new jstree instance, any arguments after the first one are merged and used to configure the tree.
    Destroys an instance, and also clears `jstree-` prefixed classes and all events in the `jstree` namespace
    This event is triggered in the jstree namespace when data is first rendered in the tree.
    This event is triggered in the jstree namespace when all initial loading is done.
    Used internally to trigger events on the container node.
    Used internally to cleanup after a drop, so that all variables are nulled and ready for the next drag.
    Used internally to execute the action (if any) associated with an item.
    Make an instance focused (which defocuses the previously focused instance)
    Returns the currently focused instance (by default once an instance is created it is focused)
    Used internally to get all items for the drag event.
    _get_string : function (s)
    Used to get the common string in the tree.
    _load_node : function (obj,
    callback)
    Load the children of a node, but as opposed to load_node does not change any visual properties or trigger events.
    Used internally to parse a contextmenu description object to an HTML string.
    Returns an instance
    Used internally to scroll hovered elements.
    Used internally to show a submenu
    Used internally to trigger all necessary events.
    Used internally to trigger all necessary events.
    + + + +
    Adds a rule.
    Adds a whole stylesheet or appends to an existing stylesheet.
    Makes it possible to remove an item (or a group of items) form an array.
    Returns only the unique items from an array.
    Collects all attributes from a DOM node.
    + + + +
    check : function (chk,
    obj,
    par,
    pos)
    This function checks if a structure modification is valid.
    clean_node : function (obj)
    This function converts inserted nodes to the required by jsTree format.
    Close all nodes from a certain node down.
    Close a node so that its children are not visible.
    $.vakata.context
    object holds all context menu related functions and variables.
    Functions needed to show a custom context menu.
    Triggered when the context menu is hidden.
    object Used to construct a context menu entry, this structure will always be a part of an object.
    Triggered when the context menu is parsed but not yet shown.
    Triggered when the context menu is shown.
    $.vakata.cookie = function (key,
    value,
    options)
    A function for getting and setting cookies.
    A copy of the jQuery cookie plugin.
    This function copies a node.
    This function corrects the open/closed/leaf state as data changes (as the user interacts with the tree).
    This function creates a new node.
    $.vakata.css
    object holds all CSS related functions
    Functions needed to manipulate stylesheets (add, remove, change)
    Get the current backend used.
    + + + +
    object Provides storage for plugins (aside from private variables).
    Exists for consistency and is a simple wrapper for jQuery.parseJSON.
    object storing all the default configuration options for every plugin and the core.
    Remove a key.
    This function deletes a node.
    $.vakata.dnd
    object holds all DND related functions
    Triggered multiple times while dragging.
    Fires when a container is scrolled due to dragging near its edge.
    Marks the start of the drag.
    Marks the end of the drag.
    boolean whether to show dots or not.
    Used internally to process the mousemove event after $.vakata.dnd.start is called.
    Functions needed to drag’n’drop elements
    + + + +
    Gets the selection inside an input element or textarea.
    Returns the caret position in the element.
    Returns the caret position in pixels relative to the element.
    Replace the selection inside an input element or textarea.
    Sets the selection inside an input element or textarea.
    Sets the caret position in the element.
    A function for encoding data in a JSON notated string.
    + + + +
    Empty the storage.
    + + + +
    Gets the current selection.
    Get a value by key.
    get_children : function (obj)
    Get all the children of a node
    Returns the jQuery extended container of the tree (the element you used when constructing the tree).
    Returns the jQuery extended first UL node inside the container of the tree.
    Retrieves or deletes a specific rule.
    Returns an integer, which is the instance’s index.
    get_json : function (obj,
    is_callback)
    This function returns the whole tree (or a single node) in JSON format.
    get_next : function (obj,
    strict)
    Get the next sibling of a node
    get_node : function (obj)
    Get a hold of the LI node (which represents the jstree node).
    get_parent : function (obj)
    Get the parent of a node
    get_prev : function (obj,
    strict)
    Get the previous sibling of a node
    Gets the width of the scrollbar
    Returns the settings for the tree.
    get_state : function ()
    This function returns the current state of the tree (as collected from all active plugins).
    get_text : function (obj,
    remove_html)
    This function returns the title of the node.
    + + + +
    This file includes some functions that enable CSS manipulations, contextmenus, XSLT transformations and drag’n’drop.
    integer number of pixels left of the cursor to move the drag-helper to.
    integer number of pixels below the cursor to move the drag-helper to.
    Used internally to hide the contextmenu after a click, or on mouseleave, etc.
    integer the amount of milliseconds to wait before hiding the menu after mouseleave.
    Copy of the John Resig’s fork of http://github.com/tzuryby/hotkeys for consistency
    + + + +
    boolean whether to show icons or not.
    boolean whether to show icons or not.
    Get an array of all the set keys in the storage.
    Parses all time elements in the document and keeps reparsing them every few seconds.
    Used internally.
    is_closed : function (obj)
    Check if a node is currently closed.
    boolean indicating if the client is running Firefox 2
    boolean indicating if the client is running Internet Explorer 6
    boolean indicating if the client is running Internet Explorer 7
    is_leaf : function (obj)
    Check if a node is a leaf node (has no children).
    is_loaded : function (obj)
    Check if a node is loaded.
    is_loading : function (obj)
    Check if a node is currently loading.
    is_locked : function ()
    Used to get the locked status of the tree.
    is_open : function (obj)
    Check if a node is currently open.
    is_parent : function (obj)
    Check if a node is a parent.
    + +
    + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/index/General2.html b/docs/index/General2.html new file mode 100644 index 00000000..3fcd73dd --- /dev/null +++ b/docs/index/General2.html @@ -0,0 +1,73 @@ + + +Index - jstree + + + + + + + + + +
    Index
    $#! · 0-9 · A · B · C · D · E · F · G · H · I · J · K · L · M · N · O · P · Q · R · S · T · U · V · W · X · Y · Z
    J
     json, $.vakata
     JSON
     jstree
     jstree drag’n’drop plugin
     jstree hotkeys plugin
     jstree html plugin
     jstree json plugin
     jstree sort plugin
     jstree state plugin
     jstree UI plugin
     jstree xml plugin
     jstree.checkbox.js
     jstree.contextmenu.js
     jstree.dnd.js
     jstree.hotkeys.js
     jstree.html.js
     jstree.js
     jstree.json.js
     jstree.sort.js
     jstree.state.js
     jstree.themes.js
     jstree.ui.js
     jstree.unique.js
     jstree.xml.js
    L
     lang, $.vakata.pretty_date
     load_node, jstree
     LocalStorage
     lock, jstree
    M
     Miscellaneous
     move_node, jstree
    O
     open_all, jstree
     open_node, jstree
    P
     parse, $.vakata.pretty_date
     parse_json, jstree
     plugin, $.jstree
     pretty_date, $.vakata
     PrettyDate
    R
     refresh, jstree
     remove_css, $.vakata.css
     rename_node, jstree
    S
     scroll_proximity, $.vakata.dnd.settings
     scroll_speed, $.vakata.dnd.settings
     scroll_to_node, jstree
     selection, $.vakata
     Selection
     set, $.vakata.storage
     set_state, jstree
     set_text, jstree
     set_theme, jstree
     settings
     show, $.vakata.context
     start, $.vakata.dnd
     stop, $.vakata.dnd
     storage, $.vakata
     storageAvailable, $.vakata.storage
     storageObj, $.vakata.storage
     storageSize, $.vakata.storage
     strings, jstree.config.core
    T
     theme, jstree.config.themes
     THEMES functions, jstree
     THEMES options, jstree
     THEMES_DIR, $.jstree
     threshold, $.vakata.dnd.settings
     toggle_node, jstree
    U
     unlock, jstree
     url, jstree.config.themes
    V
     vakata, $
     vakata_highlight, $
     vakata_pretty_date, $()
     vakata_reverse, $()
     version, $.vakata.storage
     VERSION, $.jstree
    X
     xslt, $.vakata
     XSLT
    + +
    $.vakata.json
    object holds all JSON related functions.
    Functions needed to encode/decode JSON.
    Some static functions and variables, unless you know exactly what you are doing do not use these, but $().jstree instead.
    The actual plugin wrapper, use this to create instances or execute functions on created instances.
    Adds checkboxes to the tree.
    Enables a rightclick contextmenu.
    Enables drag’n’drop.
    Enables keyboard shortcuts.
    This plugin makes it possible for jstree to use HTML data sources (other than the container’s initial HTML).
    The only required part of jstree it consists of a few functions bound to the $.jstree object, the actual plugin function and a few core functions for manipulating a tree.
    This plugin makes it possible for jstree to use JSON data sources.
    Sorts items alphabetically (or using any other function)
    This plugin enables state saving between reloads.
    Controls the looks of jstree, without this plugin you will get a functional tree, but it will look just like an ordinary UL list
    This plugin enables selecting, deselecting and hovering tree items.
    Does not allow the same name amongst siblings (still a bit experimental).
    This plugin makes it possible for jstree to use XML data sources.
    + + + +
    object the localization to use.
    Load the children of a node.
    Functions for dealing with localStorage with fallback to userData or cookies.
    Used to lock the tree.
    + + + +
    Various small snippets.
    This function moves a node.
    + + + +
    Open all nodes from a certain node down.
    Open a node so that its children are visible.
    + + + +
    Parses the difference between to dates to a human readable string.
    parse_json : function (node)
    This function returns a jQuery node after parsing a JSON object (a LI node for single elements or an UL node for multiple).
    Register a plugin
    $.vakata.pretty_date
    object holds all pretty-date related functions and properties.
    Modifies time elements to a more human readable value.
    + + + +
    This function saves the current state, reloads the complete tree and returns it to the saved state.
    Removes a rule, this functions is a shortcut to $.vakata.css.get_css with the delete flag set to true.
    This function renames a new node.
    + + + +
    integer number of pixels from the edge of a scrollable parent below which the parent will start scrolling.
    integer how fast (pixel count for each step) should a scrollable parent scroll when dragging near the edge.
    scroll_to_node : function (obj)
    This function scrolls the container to the desired node (if needed).
    $.vakata.selection
    object holds all selection related functions and properties.
    Selection related functions
    Set a key to a value
    This function returns sets the state of the tree.
    This function sets the title of the node.
    set_theme : function (theme_name,
    theme_url)
    Sets the tree theme.
    object holds the global settings object for context menus.
    object holds the global settings object for DND.
    Shows the context menu.
    Use this function to start a drag (usually with the mousedown event)
    Used internally to process the mouseup event (drop) after $.vakata.dnd.start is called.
    $.vakata.storage
    object holds all storage related functions and properties.
    See if storage functionality is available.
    Get a read only copy of the whole storage.
    Get the size of all items in the storage in bytes.
    mixed used to store all localization strings.
    + + + +
    string the name of the theme you want to use.
    $.jstree.THEMES_DIR
    The location of all themes, this is used when setting a theme without supplying an URL (only by name).
    integer amount of pixels required to move before the drag is started.
    toggle_node : function (obj)
    + + + +
    Used to unlock the tree.
    mixed the URL of the stylesheet of the theme you want to use.
    + + + +
    (function ($) { $.vakata = {}; })(jQuery)
    object Holds all helper objects.
    Hightlight words in the matched elements
    $.fn.vakata_pretty_date = function (format,
    compare)
    Sets the HTML of every element to the parsed difference of its datetime attribute and the compare parameter.
    Makes it possible to apply the standard array reverse function to a jQuery collection.
    string the version of jstorage used
    string the version of jstree
    + + + +
    $.vakata.xslt = function (xml,
    xsl)
    This functions transforms a XML string using a XSL string.
    A function used to do XSLT transformations.
    + +
    + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/index/Variables.html b/docs/index/Variables.html new file mode 100644 index 00000000..fd8eeecf --- /dev/null +++ b/docs/index/Variables.html @@ -0,0 +1,73 @@ + + +Variable Index - jstree + + + + + + + + + +
    Variable Index
    $#! · 0-9 · A · B · C · D · E · F · G · H · I · J · K · L · M · N · O · P · Q · R · S · T · U · V · W · X · Y · Z
    C
     context, $.vakata
     context_menu_item
     css, $.vakata
    D
     data, jstree
     defaults, $.jstree
     dnd, $.vakata
     dots, jstree.config.themes
    H
     helper_left, $.vakata.dnd.settings
     helper_top, $.vakata.dnd.settings
     hide_onmouseleave, $.vakata.context.settings
    I
     icons
     IS_FF2, $.jstree
     IS_IE6, $.jstree
     IS_IE7, $.jstree
    J
     json, $.vakata
    L
     lang, $.vakata.pretty_date
    P
     pretty_date, $.vakata
    S
     scroll_proximity, $.vakata.dnd.settings
     scroll_speed, $.vakata.dnd.settings
     selection, $.vakata
     settings
     storage, $.vakata
     strings, jstree.config.core
    T
     theme, jstree.config.themes
     THEMES_DIR, $.jstree
     threshold, $.vakata.dnd.settings
    U
     url, jstree.config.themes
    V
     vakata, $
     version, $.vakata.storage
     VERSION, $.jstree
    + +
    $.vakata.context
    object holds all context menu related functions and variables.
    object Used to construct a context menu entry, this structure will always be a part of an object.
    $.vakata.css
    object holds all CSS related functions
    + + + +
    object Provides storage for plugins (aside from private variables).
    object storing all the default configuration options for every plugin and the core.
    $.vakata.dnd
    object holds all DND related functions
    boolean whether to show dots or not.
    + + + +
    integer number of pixels left of the cursor to move the drag-helper to.
    integer number of pixels below the cursor to move the drag-helper to.
    integer the amount of milliseconds to wait before hiding the menu after mouseleave.
    + + + +
    boolean whether to show icons or not.
    boolean whether to show icons or not.
    boolean indicating if the client is running Firefox 2
    boolean indicating if the client is running Internet Explorer 6
    boolean indicating if the client is running Internet Explorer 7
    + + + +
    $.vakata.json
    object holds all JSON related functions.
    + + + +
    object the localization to use.
    + + + +
    $.vakata.pretty_date
    object holds all pretty-date related functions and properties.
    + + + +
    integer number of pixels from the edge of a scrollable parent below which the parent will start scrolling.
    integer how fast (pixel count for each step) should a scrollable parent scroll when dragging near the edge.
    $.vakata.selection
    object holds all selection related functions and properties.
    object holds the global settings object for context menus.
    object holds the global settings object for DND.
    $.vakata.storage
    object holds all storage related functions and properties.
    mixed used to store all localization strings.
    + + + +
    string the name of the theme you want to use.
    $.jstree.THEMES_DIR
    The location of all themes, this is used when setting a theme without supplying an URL (only by name).
    integer amount of pixels required to move before the drag is started.
    + + + +
    mixed the URL of the stylesheet of the theme you want to use.
    + + + +
    (function ($) { $.vakata = {}; })(jQuery)
    object Holds all helper objects.
    string the version of jstorage used
    string the version of jstree
    + +
    + + + + + + + + + + + + \ No newline at end of file diff --git a/_docs/javascript/main.js b/docs/javascript/main.js similarity index 100% rename from _docs/javascript/main.js rename to docs/javascript/main.js diff --git a/_docs/javascript/prettify.js b/docs/javascript/prettify.js similarity index 100% rename from _docs/javascript/prettify.js rename to docs/javascript/prettify.js diff --git a/_docs/javascript/searchdata.js b/docs/javascript/searchdata.js similarity index 100% rename from _docs/javascript/searchdata.js rename to docs/javascript/searchdata.js diff --git a/_docs/logo.png b/docs/logo.png similarity index 100% rename from _docs/logo.png rename to docs/logo.png diff --git a/_docs/m.gif b/docs/m.gif similarity index 100% rename from _docs/m.gif rename to docs/m.gif diff --git a/_docs/main.jpg b/docs/main.jpg similarity index 100% rename from _docs/main.jpg rename to docs/main.jpg diff --git a/_docs/p.gif b/docs/p.gif similarity index 100% rename from _docs/p.gif rename to docs/p.gif diff --git a/_docs/search/ClassesJ.html b/docs/search/ClassesJ.html similarity index 77% rename from _docs/search/ClassesJ.html rename to docs/search/ClassesJ.html index 929b3a03..de6f438f 100644 --- a/_docs/search/ClassesJ.html +++ b/docs/search/ClassesJ.html @@ -11,7 +11,7 @@ -
    Loading...
    Searching...
    No Matches
    + + + + + + + + + +
    Loading...
    Searching...
    No Matches
    \ No newline at end of file diff --git a/_docs/search/FunctionsA.html b/docs/search/FunctionsA.html similarity index 100% rename from _docs/search/FunctionsA.html rename to docs/search/FunctionsA.html diff --git a/docs/search/FunctionsC.html b/docs/search/FunctionsC.html new file mode 100644 index 00000000..4f29aeb6 --- /dev/null +++ b/docs/search/FunctionsC.html @@ -0,0 +1,20 @@ + + + + + + + + + + + + +
    Loading...
    check, jstree
    clean_node, jstree
    close_all, jstree
    close_node, jstree
    copy_node, jstree
    correct_node, jstree
    create_node, jstree
    currentBackend, $.vakata.storage
    Searching...
    No Matches
    \ No newline at end of file diff --git a/_docs/search/FunctionsD.html b/docs/search/FunctionsD.html similarity index 77% rename from _docs/search/FunctionsD.html rename to docs/search/FunctionsD.html index 067da55e..4ade64b8 100644 --- a/_docs/search/FunctionsD.html +++ b/docs/search/FunctionsD.html @@ -11,7 +11,7 @@ -
    Loading...
    decode, $.vakata.json
    del, $.vakata.storage
    delete_node, jstree
    drag, $.vakata.dnd
    Searching...
    No Matches
    + + + + + + + + + +
    Loading...
    get_children, jstree
    get_css, $.vakata.css
    get_index, jstree
    get_json, jstree
    get_next, jstree
    get_node, jstree
    get_parent, jstree
    get_prev, jstree
    get_settings, jstree
    get_state, jstree
    get_text, jstree
    Searching...
    No Matches
    \ No newline at end of file diff --git a/_docs/search/FunctionsH.html b/docs/search/FunctionsH.html similarity index 100% rename from _docs/search/FunctionsH.html rename to docs/search/FunctionsH.html diff --git a/docs/search/FunctionsI.html b/docs/search/FunctionsI.html new file mode 100644 index 00000000..971b16b6 --- /dev/null +++ b/docs/search/FunctionsI.html @@ -0,0 +1,20 @@ + + + + + + + + + + + + +
    Loading...
    index, $.vakata.storage
    is_closed, jstree
    is_leaf, jstree
    is_loaded, jstree
    is_loading, jstree
    is_locked, jstree
    is_open, jstree
    is_parent, jstree
    Searching...
    No Matches
    \ No newline at end of file diff --git a/_docs/search/FunctionsL.html b/docs/search/FunctionsL.html similarity index 69% rename from _docs/search/FunctionsL.html rename to docs/search/FunctionsL.html index 9aa5c081..d7d2024d 100644 --- a/_docs/search/FunctionsL.html +++ b/docs/search/FunctionsL.html @@ -11,7 +11,7 @@ -
    Loading...
    load_node, jstree
    lock, jstree
    Searching...
    No Matches
    + + + + + + + + + +
    Loading...
    refresh, jstree
    remove_css, $.vakata.css
    rename_node, jstree
    Searching...
    No Matches
    \ No newline at end of file diff --git a/docs/search/FunctionsS.html b/docs/search/FunctionsS.html new file mode 100644 index 00000000..a095d72f --- /dev/null +++ b/docs/search/FunctionsS.html @@ -0,0 +1,20 @@ + + + + + + + + + + + + +
    Loading...
    set, $.vakata.storage
    set_state, jstree
    set_text, jstree
    set_theme, jstree
    show, $.vakata.context
    start, $.vakata.dnd
    stop, $.vakata.dnd
    storageAvailable, $.vakata.storage
    storageObj, $.vakata.storage
    storageSize, $.vakata.storage
    Searching...
    No Matches
    \ No newline at end of file diff --git a/docs/search/FunctionsSymbols.html b/docs/search/FunctionsSymbols.html new file mode 100644 index 00000000..249ac380 --- /dev/null +++ b/docs/search/FunctionsSymbols.html @@ -0,0 +1,20 @@ + + + + + + + + + + + + +
    Loading...
    __call, $.jstree
    __construct, $.jstree
    __destruct, $.jstree
    __trigger, jstree
    _clean, $.vakata.dnd
    _execute, $.vakata.context
    _focus, $.jstree
    _focused, $.jstree
    _get, $.vakata.dnd
    _get_string, jstree
    _load_node, jstree
    _parse, $.vakata.context
    _reference, $.jstree
    _scroll, $.vakata.dnd
    _show_submenu, $.vakata.context
    Searching...
    No Matches
    \ No newline at end of file diff --git a/_docs/search/FunctionsT.html b/docs/search/FunctionsT.html similarity index 77% rename from _docs/search/FunctionsT.html rename to docs/search/FunctionsT.html index 2f3d9538..f48494b7 100644 --- a/_docs/search/FunctionsT.html +++ b/docs/search/FunctionsT.html @@ -11,7 +11,7 @@ -
    Loading...
    toggle_node, jstree
    Searching...
    No Matches
    + + + + + + + + + +
    Loading...
    Searching...
    No Matches
    \ No newline at end of file diff --git a/_docs/search/FunctionsX.html b/docs/search/FunctionsX.html similarity index 100% rename from _docs/search/FunctionsX.html rename to docs/search/FunctionsX.html diff --git a/_docs/search/GeneralA.html b/docs/search/GeneralA.html similarity index 100% rename from _docs/search/GeneralA.html rename to docs/search/GeneralA.html diff --git a/docs/search/GeneralC.html b/docs/search/GeneralC.html new file mode 100644 index 00000000..f4ac5a6f --- /dev/null +++ b/docs/search/GeneralC.html @@ -0,0 +1,20 @@ + + + + + + + + + + + + +
    Loading...
    check, jstree
    clean_node, jstree
    close_all, jstree
    close_node, jstree
    context, $.vakata
    copy_node, jstree
    CORE options, jstree
    correct_node, jstree
    create_node, jstree
    css, $.vakata
    currentBackend, $.vakata.storage
    Searching...
    No Matches
    \ No newline at end of file diff --git a/docs/search/GeneralD.html b/docs/search/GeneralD.html new file mode 100644 index 00000000..a007e66b --- /dev/null +++ b/docs/search/GeneralD.html @@ -0,0 +1,20 @@ + + + + + + + + + + + + +
    Loading...
    data, jstree
    decode, $.vakata.json
    defaults, $.jstree
    del, $.vakata.storage
    delete_node, jstree
    dnd, $.vakata
    dots, jstree.config.themes
    drag, $.vakata.dnd
    Searching...
    No Matches
    \ No newline at end of file diff --git a/_docs/search/GeneralE.html b/docs/search/GeneralE.html similarity index 100% rename from _docs/search/GeneralE.html rename to docs/search/GeneralE.html diff --git a/_docs/search/GeneralF.html b/docs/search/GeneralF.html similarity index 100% rename from _docs/search/GeneralF.html rename to docs/search/GeneralF.html diff --git a/docs/search/GeneralG.html b/docs/search/GeneralG.html new file mode 100644 index 00000000..0dba537a --- /dev/null +++ b/docs/search/GeneralG.html @@ -0,0 +1,20 @@ + + + + + + + + + + + + +
    Loading...
    get_children, jstree
    get_css, $.vakata.css
    get_index, jstree
    get_json, jstree
    get_next, jstree
    get_node, jstree
    get_parent, jstree
    get_prev, jstree
    get_settings, jstree
    get_state, jstree
    get_text, jstree
    Searching...
    No Matches
    \ No newline at end of file diff --git a/_docs/search/GeneralH.html b/docs/search/GeneralH.html similarity index 87% rename from _docs/search/GeneralH.html rename to docs/search/GeneralH.html index f5971f15..0771894d 100644 --- a/_docs/search/GeneralH.html +++ b/docs/search/GeneralH.html @@ -11,7 +11,7 @@ -
    Loading...
    helper_left, $.vakata.dnd.settings
    helper_top, $.vakata.dnd.settings
    hide, $.vakata.context
    hide_onmouseleave, $.vakata.context.settings
    Searching...
    No Matches
    + + + + + + + + + +
    Loading...
    index, $.vakata.storage
    is_closed, jstree
    IS_FF2, $.jstree
    IS_IE6, $.jstree
    IS_IE7, $.jstree
    is_leaf, jstree
    is_loaded, jstree
    is_loading, jstree
    is_locked, jstree
    is_open, jstree
    is_parent, jstree
    Searching...
    No Matches
    \ No newline at end of file diff --git a/docs/search/GeneralJ.html b/docs/search/GeneralJ.html new file mode 100644 index 00000000..231ab3d2 --- /dev/null +++ b/docs/search/GeneralJ.html @@ -0,0 +1,20 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/_docs/search/GeneralL.html b/docs/search/GeneralL.html similarity index 61% rename from _docs/search/GeneralL.html rename to docs/search/GeneralL.html index 0948fc1f..47e0cdae 100644 --- a/_docs/search/GeneralL.html +++ b/docs/search/GeneralL.html @@ -11,7 +11,7 @@ -
    Loading...
    lang, $.vakata.pretty_date
    load_node, jstree
    lock, jstree
    Searching...
    No Matches
    + + + + + + + + + +
    Loading...
    refresh, jstree
    remove_css, $.vakata.css
    rename_node, jstree
    Searching...
    No Matches
    \ No newline at end of file diff --git a/docs/search/GeneralS.html b/docs/search/GeneralS.html new file mode 100644 index 00000000..464c9503 --- /dev/null +++ b/docs/search/GeneralS.html @@ -0,0 +1,20 @@ + + + + + + + + + + + + +
    Loading...
    scroll_proximity, $.vakata.dnd.settings
    scroll_speed, $.vakata.dnd.settings
    selection, $.vakata
    set, $.vakata.storage
    set_state, jstree
    set_text, jstree
    set_theme, jstree
    show, $.vakata.context
    start, $.vakata.dnd
    stop, $.vakata.dnd
    storage, $.vakata
    storageAvailable, $.vakata.storage
    storageObj, $.vakata.storage
    storageSize, $.vakata.storage
    strings, jstree.config.core
    Searching...
    No Matches
    \ No newline at end of file diff --git a/docs/search/GeneralSymbols.html b/docs/search/GeneralSymbols.html new file mode 100644 index 00000000..c150aab9 --- /dev/null +++ b/docs/search/GeneralSymbols.html @@ -0,0 +1,20 @@ + + + + + + + + + + + + +
    Loading...
    __after_open, jstree
    __call, $.jstree
    __construct, $.jstree
    __destruct, $.jstree
    __loaded, jstree
    __ready, jstree
    __trigger, jstree
    _clean, $.vakata.dnd
    _execute, $.vakata.context
    _focus, $.jstree
    _focused, $.jstree
    _get, $.vakata.dnd
    _get_string, jstree
    _load_node, jstree
    _parse, $.vakata.context
    _reference, $.jstree
    _scroll, $.vakata.dnd
    _show_submenu, $.vakata.context
    Searching...
    No Matches
    \ No newline at end of file diff --git a/_docs/search/GeneralT.html b/docs/search/GeneralT.html similarity index 88% rename from _docs/search/GeneralT.html rename to docs/search/GeneralT.html index 88e32280..e5b09af8 100644 --- a/_docs/search/GeneralT.html +++ b/docs/search/GeneralT.html @@ -11,7 +11,7 @@ -
    Loading...
    theme, jstree.config.themes
    THEMES_DIR, $.jstree
    threshold, $.vakata.dnd.settings
    toggle_node, jstree
    Searching...
    No Matches
    + + + + + + + + + + + + + + + + + + + + + + + +

    jstree Test Suite

    +

    +
    +

    +
      +
      + lame test markup + normal test markup + awesome test markup +
      + + diff --git a/test/jstree.html.test.js b/test/jstree.html.test.js new file mode 100644 index 00000000..e69de29b diff --git a/test/jstree.json.test.js b/test/jstree.json.test.js new file mode 100644 index 00000000..e69de29b diff --git a/test/jstree.sort.test.js b/test/jstree.sort.test.js new file mode 100644 index 00000000..e69de29b diff --git a/test/jstree.state.test.js b/test/jstree.state.test.js new file mode 100644 index 00000000..e69de29b diff --git a/test/jstree.test.js b/test/jstree.test.js new file mode 100644 index 00000000..109b51da --- /dev/null +++ b/test/jstree.test.js @@ -0,0 +1,58 @@ +/*global QUnit:false, module:false, test:false, asyncTest:false, expect:false*/ +/*global start:false, stop:false ok:false, equal:false, notEqual:false, deepEqual:false*/ +/*global notDeepEqual:false, strictEqual:false, notStrictEqual:false, raises:false*/ +(function($) { + + /* + ======== A Handy Little QUnit Reference ======== + http://docs.jquery.com/QUnit + + Test methods: + expect(numAssertions) + stop(increment) + start(decrement) + Test assertions: + ok(value, [message]) + equal(actual, expected, [message]) + notEqual(actual, expected, [message]) + deepEqual(actual, expected, [message]) + notDeepEqual(actual, expected, [message]) + strictEqual(actual, expected, [message]) + notStrictEqual(actual, expected, [message]) + raises(block, [expected], [message]) + */ + + module('jQuery#jstree', { + setup: function() { + this.elems = $('#qunit-fixture').children(); + } + }); + + test('is chainable', 1, function() { + // Not a bad test to run on collection methods. + strictEqual(this.elems.jstree(), this.elems, 'should be chaninable'); + }); + + test('does return all', 1, function() { + strictEqual(this.elems.jstree().text(), 'lame test markupnormal test markupawesome test markup', 'should return all nodes'); + }); + + module('jQuery.jstree'); + + test('is object', 1, function() { + strictEqual(typeof $.jstree.VERSION, 'string', 'should be object'); + }); + + module(':jstree selector', { + setup: function() { + this.elems = $('#qunit-fixture').children(); + this.elems.eq(2).jstree(); + } + }); + + test('is jstree', 1, function() { + // Use deepEqual & .get() when comparing jQuery objects. + deepEqual(this.elems.filter(':jstree').get(), this.elems.eq(2).get(), 'recognizes tree elements'); + }); + +}(jQuery)); diff --git a/test/jstree.themes.test.js b/test/jstree.themes.test.js new file mode 100644 index 00000000..c914cd99 --- /dev/null +++ b/test/jstree.themes.test.js @@ -0,0 +1,37 @@ +/*global QUnit:false, module:false, test:false, asyncTest:false, expect:false*/ +/*global start:false, stop:false ok:false, equal:false, notEqual:false, deepEqual:false*/ +/*global notDeepEqual:false, strictEqual:false, notStrictEqual:false, raises:false*/ +(function($) { + + /* + ======== A Handy Little QUnit Reference ======== + http://docs.jquery.com/QUnit + + Test methods: + expect(numAssertions) + stop(increment) + start(decrement) + Test assertions: + ok(value, [message]) + equal(actual, expected, [message]) + notEqual(actual, expected, [message]) + deepEqual(actual, expected, [message]) + notDeepEqual(actual, expected, [message]) + strictEqual(actual, expected, [message]) + notStrictEqual(actual, expected, [message]) + raises(block, [expected], [message]) + */ + + module('jQuery#jstree.themes', { + setup: function() { + this.elems = $('#qunit-fixture').children(); + } + }); + + test('is chainable', 1, function() { + // Not a bad test to run on collection methods. + strictEqual(this.elems.jstree(), this.elems, 'should be chaninable'); + }); + + +}(jQuery)); diff --git a/test/jstree.ui.test.js b/test/jstree.ui.test.js new file mode 100644 index 00000000..e69de29b diff --git a/test/jstree.unique.test.js b/test/jstree.unique.test.js new file mode 100644 index 00000000..e69de29b diff --git a/test/jstree.xml.test.js b/test/jstree.xml.test.js new file mode 100644 index 00000000..e69de29b diff --git a/test/vakata.js b/test/vakata.js new file mode 100644 index 00000000..e69de29b