Skip to content

Commit 56ec99e

Browse files
committed
Added license and readme content.
1 parent 14a79ed commit 56ec99e

File tree

2 files changed

+107
-0
lines changed

2 files changed

+107
-0
lines changed

LICENSE.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
The CheckTree jQuery plugin is currently available for use in all personal or commercial
2+
projects under _both_ MIT and GPL licenses. This means that _you_ can choose the license
3+
that best suits your project and use it accordingly.
4+
5+
CheckTree version 0.3 Copyright (c) 2012 JJ Geewax
6+
CheckTree later versions Copyright (c) 2013 Richard Fawcett
7+
8+
## The MIT License (MIT)
9+
10+
Permission is hereby granted, free of charge, to any person obtaining a copy
11+
of this software and associated documentation files (the "Software"), to deal
12+
in the Software without restriction, including without limitation the rights
13+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14+
copies of the Software, and to permit persons to whom the Software is
15+
furnished to do so, subject to the following conditions:
16+
17+
The above copyright notice and the permission notice shall be included in
18+
all copies or substantial portions of the Software.
19+
20+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23+
AUTHROS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMANGES OR OTHER
24+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
26+
THE SOFTWARE.
27+
28+
29+
##The GNU General Public License (GPLv3)
30+
31+
This program is free software: you can redistribute it and/or modify
32+
it under the terms of the GNU General Public License as published by
33+
the Free Software Foundation, either version 3 of the License, or
34+
(at your option) any later version.
35+
36+
This program is distributed in the hope that it will be useful,
37+
but WITHOUT ANY WARRANTY; without even the implied warranty of
38+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
39+
GNU General Public License for more details.
40+
41+
You should have received a copy of the GNU General Public License
42+
along with this program. If no, see [http://www.gnu.org/licenses/].

README.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
##Overview
2+
3+
CheckTree is a jQuery plugin, written for jQuery 1.7.0 and later, that allows you to
4+
easily turn a standard ordered list into a hierarchical tree that is both check-able
5+
and collapsable.
6+
7+
It, like jQuery, is licensed under either the GPL or MIT license.
8+
9+
Original project Copyright (C) 2012 JJ Geewax
10+
This fork Copyright (C) 2013 Richard Fawcett
11+
12+
##Getting Started
13+
14+
In your HTML markup, define an unordered list using the following layout:
15+
16+
<ul class="tree">
17+
<li>
18+
<input type="checkbox">
19+
<label>Option 1</label>
20+
<ul>
21+
<li>
22+
<input type="checkbox" name="ourvar" value="1a">
23+
<label>Option 1A</label>
24+
</li>
25+
<li>
26+
<input type="checkbox" name="ourvar" value="1b">
27+
<label>Option 1B</label>
28+
</li>
29+
</ul>
30+
</li>
31+
<li>
32+
<input type="checkbox" name="ourvar" value="2">
33+
<label>Option 2</label>
34+
</li>
35+
</ul>
36+
37+
After ensuring you've included a reference to the jQuery script, add the following script
38+
to your page.
39+
40+
$(function(){
41+
$("ul.tree").checkTree();
42+
});
43+
44+
The script will replace the HTML checkbox controls with a `div` with class `checkbox`. It will
45+
also add the classes `checked` or `half_checked` to this div, depending on whether all children,
46+
or some children, are checked.
47+
48+
A `div` with class `arrow` is prepended to each non-leaf-node checkbox. Such `div` elements are
49+
also adorned with either a `collapsed` or `expanded` class to indicate whether the node is
50+
collapsed or expanded. These can be used to assign different background images in CSS.
51+
52+
##Options
53+
54+
The `checkTree()` function optionally accepts an object variable containing options. The
55+
following keys are supported:
56+
57+
* __onExpand__ - a function which is called when a node in the tree is expanded.
58+
* __onCollapse__ - a function which is called when a node in the tree is collapsed.
59+
* __onCheck__ - a function which is called when a checkbox is ticked.
60+
* __onUnCheck__ - a function which is called when a checkbox is unticked.
61+
* __onHalfCheck__ - a function which is called when a checkbox becomes half-checked.
62+
* __onLabelHoverOver__ - a function which is called when a label is hovered over.
63+
* __onLabelHoverOut__ - a function which is called when a label is no longer being hovered over.
64+
* __labelAction__ - either 'expand' or 'check' - determines what happens when a label is clicked.
65+

0 commit comments

Comments
 (0)