jstree_rails 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (30) hide show
  1. data/CHANGELOG.rdoc +2 -0
  2. data/LICENSE.rdoc +22 -0
  3. data/README.rdoc +0 -0
  4. data/files/public/javascripts/jquery.jstree.js +4544 -0
  5. data/files/public/javascripts/themes/apple/bg.jpg +0 -0
  6. data/files/public/javascripts/themes/apple/d.png +0 -0
  7. data/files/public/javascripts/themes/apple/dot_for_ie.gif +0 -0
  8. data/files/public/javascripts/themes/apple/style.css +61 -0
  9. data/files/public/javascripts/themes/apple/throbber.gif +0 -0
  10. data/files/public/javascripts/themes/classic/d.gif +0 -0
  11. data/files/public/javascripts/themes/classic/d.png +0 -0
  12. data/files/public/javascripts/themes/classic/dot_for_ie.gif +0 -0
  13. data/files/public/javascripts/themes/classic/style.css +77 -0
  14. data/files/public/javascripts/themes/classic/throbber.gif +0 -0
  15. data/files/public/javascripts/themes/default-rtl/d.gif +0 -0
  16. data/files/public/javascripts/themes/default-rtl/d.png +0 -0
  17. data/files/public/javascripts/themes/default-rtl/dots.gif +0 -0
  18. data/files/public/javascripts/themes/default-rtl/style.css +84 -0
  19. data/files/public/javascripts/themes/default-rtl/throbber.gif +0 -0
  20. data/files/public/javascripts/themes/default/d.gif +0 -0
  21. data/files/public/javascripts/themes/default/d.png +0 -0
  22. data/files/public/javascripts/themes/default/style.css +74 -0
  23. data/files/public/javascripts/themes/default/throbber.gif +0 -0
  24. data/lib/jstree_rails.rb +16 -0
  25. data/lib/jstree_rails/generators.rb +16 -0
  26. data/lib/jstree_rails/railtie.rb +7 -0
  27. data/lib/jstree_rails/tasks.rb +21 -0
  28. data/lib/jstree_rails/version.rb +18 -0
  29. data/lib/jstree_rails/viewers.rb +33 -0
  30. metadata +126 -0
@@ -0,0 +1,61 @@
1
+ /*
2
+ * jsTree apple theme 1.0
3
+ * Supported features: dots/no-dots, icons/no-icons, focused, loading
4
+ * Supported plugins: ui (hovered, clicked), checkbox, contextmenu, search
5
+ */
6
+
7
+ .jstree-apple > ul { background:url("bg.jpg") left top repeat; }
8
+ .jstree-apple li,
9
+ .jstree-apple ins { background-image:url("d.png"); background-repeat:no-repeat; background-color:transparent; }
10
+ .jstree-apple li { background-position:-90px 0; background-repeat:repeat-y; }
11
+ .jstree-apple li.jstree-last { background:transparent; }
12
+ .jstree-apple .jstree-open > ins { background-position:-72px 0; }
13
+ .jstree-apple .jstree-closed > ins { background-position:-54px 0; }
14
+ .jstree-apple .jstree-leaf > ins { background-position:-36px 0; }
15
+
16
+ .jstree-apple a { border-radius:4px; -moz-border-radius:4px; -webkit-border-radius:4px; text-shadow:1px 1px 1px white; }
17
+ .jstree-apple .jstree-hovered { background:#e7f4f9; border:1px solid #d8f0fa; padding:0 3px 0 1px; text-shadow:1px 1px 1px silver; }
18
+ .jstree-apple .jstree-clicked { background:#beebff; border:1px solid #99defd; padding:0 3px 0 1px; }
19
+ .jstree-apple a .jstree-icon { background-position:-56px -20px; }
20
+ .jstree-apple a.jstree-loading .jstree-icon { background:url("throbber.gif") center center no-repeat !important; }
21
+
22
+ .jstree-apple.jstree-focused { background:white; }
23
+
24
+ .jstree-apple .jstree-no-dots li,
25
+ .jstree-apple .jstree-no-dots .jstree-leaf > ins { background:transparent; }
26
+ .jstree-apple .jstree-no-dots .jstree-open > ins { background-position:-18px 0; }
27
+ .jstree-apple .jstree-no-dots .jstree-closed > ins { background-position:0 0; }
28
+
29
+ .jstree-apple .jstree-no-icons a .jstree-icon { display:none; }
30
+
31
+ .jstree-apple .jstree-search { font-style:italic; }
32
+
33
+ .jstree-apple .jstree-no-icons .jstree-checkbox { display:inline-block; }
34
+ .jstree-apple .jstree-no-checkboxes .jstree-checkbox { display:none !important; }
35
+ .jstree-apple .jstree-checked > a > .jstree-checkbox { background-position:-38px -19px; }
36
+ .jstree-apple .jstree-unchecked > a > .jstree-checkbox { background-position:-2px -19px; }
37
+ .jstree-apple .jstree-undetermined > a > .jstree-checkbox { background-position:-20px -19px; }
38
+ .jstree-apple .jstree-checked > a > .checkbox:hover { background-position:-38px -37px; }
39
+ .jstree-apple .jstree-unchecked > a > .jstree-checkbox:hover { background-position:-2px -37px; }
40
+ .jstree-apple .jstree-undetermined > a > .jstree-checkbox:hover { background-position:-20px -37px; }
41
+
42
+ #vakata-dragged.jstree-apple ins { background:transparent !important; }
43
+ #vakata-dragged.jstree-apple .jstree-ok { background:url("d.png") -2px -53px no-repeat !important; }
44
+ #vakata-dragged.jstree-apple .jstree-invalid { background:url("d.png") -18px -53px no-repeat !important; }
45
+ #jstree-marker.jstree-apple { background:url("d.png") -41px -57px no-repeat !important; text-indent:-100px; }
46
+
47
+ .jstree-apple a.jstree-search { color:aqua; }
48
+ .jstree-apple .jstree-locked a { color:silver; cursor:default; }
49
+
50
+ #vakata-contextmenu.jstree-apple-context,
51
+ #vakata-contextmenu.jstree-apple-context li ul { background:#f0f0f0; border:1px solid #979797; -moz-box-shadow: 1px 1px 2px #999; -webkit-box-shadow: 1px 1px 2px #999; box-shadow: 1px 1px 2px #999; }
52
+ #vakata-contextmenu.jstree-apple-context li { }
53
+ #vakata-contextmenu.jstree-apple-context a { color:black; }
54
+ #vakata-contextmenu.jstree-apple-context a:hover,
55
+ #vakata-contextmenu.jstree-apple-context .vakata-hover > a { padding:0 5px; background:#e8eff7; border:1px solid #aecff7; color:black; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; }
56
+ #vakata-contextmenu.jstree-apple-context li.jstree-contextmenu-disabled a,
57
+ #vakata-contextmenu.jstree-apple-context li.jstree-contextmenu-disabled a:hover { color:silver; background:transparent; border:0; padding:1px 4px; }
58
+ #vakata-contextmenu.jstree-apple-context li.vakata-separator { background:white; border-top:1px solid #e0e0e0; margin:0; }
59
+ #vakata-contextmenu.jstree-apple-context li ul { margin-left:-4px; }
60
+
61
+ /* TODO: IE6 support - the `>` selectors */
@@ -0,0 +1,77 @@
1
+ /*
2
+ * jsTree classic theme 1.0
3
+ * Supported features: dots/no-dots, icons/no-icons, focused, loading
4
+ * Supported plugins: ui (hovered, clicked), checkbox, contextmenu, search
5
+ */
6
+
7
+ .jstree-classic li,
8
+ .jstree-classic ins { background-image:url("d.png"); background-repeat:no-repeat; background-color:transparent; }
9
+ .jstree-classic li { background-position:-90px 0; background-repeat:repeat-y; }
10
+ .jstree-classic li.jstree-last { background:transparent; }
11
+ .jstree-classic .jstree-open > ins { background-position:-72px 0; }
12
+ .jstree-classic .jstree-closed > ins { background-position:-54px 0; }
13
+ .jstree-classic .jstree-leaf > ins { background-position:-36px 0; }
14
+
15
+ .jstree-classic .jstree-hovered { background:#e7f4f9; border:1px solid #e7f4f9; padding:0 2px 0 1px; }
16
+ .jstree-classic .jstree-clicked { background:navy; border:1px solid navy; padding:0 2px 0 1px; color:white; }
17
+ .jstree-classic a .jstree-icon { background-position:-56px -19px; }
18
+ .jstree-classic .jstree-open > a .jstree-icon { background-position:-56px -36px; }
19
+ .jstree-classic a.jstree-loading .jstree-icon { background:url("throbber.gif") center center no-repeat !important; }
20
+
21
+ .jstree-classic.jstree-focused { background:white; }
22
+
23
+ .jstree-classic .jstree-no-dots li,
24
+ .jstree-classic .jstree-no-dots .jstree-leaf > ins { background:transparent; }
25
+ .jstree-classic .jstree-no-dots .jstree-open > ins { background-position:-18px 0; }
26
+ .jstree-classic .jstree-no-dots .jstree-closed > ins { background-position:0 0; }
27
+
28
+ .jstree-classic .jstree-no-icons a .jstree-icon { display:none; }
29
+
30
+ .jstree-classic .jstree-search { font-style:italic; }
31
+
32
+ .jstree-classic .jstree-no-icons .jstree-checkbox { display:inline-block; }
33
+ .jstree-classic .jstree-no-checkboxes .jstree-checkbox { display:none !important; }
34
+ .jstree-classic .jstree-checked > a > .jstree-checkbox { background-position:-38px -19px; }
35
+ .jstree-classic .jstree-unchecked > a > .jstree-checkbox { background-position:-2px -19px; }
36
+ .jstree-classic .jstree-undetermined > a > .jstree-checkbox { background-position:-20px -19px; }
37
+ .jstree-classic .jstree-checked > a > .jstree-checkbox:hover { background-position:-38px -37px; }
38
+ .jstree-classic .jstree-unchecked > a > .jstree-checkbox:hover { background-position:-2px -37px; }
39
+ .jstree-classic .jstree-undetermined > a > .jstree-checkbox:hover { background-position:-20px -37px; }
40
+
41
+ #vakata-dragged.jstree-classic ins { background:transparent !important; }
42
+ #vakata-dragged.jstree-classic .jstree-ok { background:url("d.png") -2px -53px no-repeat !important; }
43
+ #vakata-dragged.jstree-classic .jstree-invalid { background:url("d.png") -18px -53px no-repeat !important; }
44
+ #jstree-marker.jstree-classic { background:url("d.png") -41px -57px no-repeat !important; text-indent:-100px; }
45
+
46
+ .jstree-classic a.jstree-search { color:aqua; }
47
+ .jstree-classic .jstree-locked a { color:silver; cursor:default; }
48
+
49
+ #vakata-contextmenu.jstree-classic-context,
50
+ #vakata-contextmenu.jstree-classic-context li ul { background:#f0f0f0; border:1px solid #979797; -moz-box-shadow: 1px 1px 2px #999; -webkit-box-shadow: 1px 1px 2px #999; box-shadow: 1px 1px 2px #999; }
51
+ #vakata-contextmenu.jstree-classic-context li { }
52
+ #vakata-contextmenu.jstree-classic-context a { color:black; }
53
+ #vakata-contextmenu.jstree-classic-context a:hover,
54
+ #vakata-contextmenu.jstree-classic-context .vakata-hover > a { padding:0 5px; background:#e8eff7; border:1px solid #aecff7; color:black; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; }
55
+ #vakata-contextmenu.jstree-classic-context li.jstree-contextmenu-disabled a,
56
+ #vakata-contextmenu.jstree-classic-context li.jstree-contextmenu-disabled a:hover { color:silver; background:transparent; border:0; padding:1px 4px; }
57
+ #vakata-contextmenu.jstree-classic-context li.vakata-separator { background:white; border-top:1px solid #e0e0e0; margin:0; }
58
+ #vakata-contextmenu.jstree-classic-context li ul { margin-left:-4px; }
59
+
60
+ /* IE6 BEGIN */
61
+ .jstree-classic li,
62
+ .jstree-classic ins,
63
+ #vakata-dragged.jstree-classic .jstree-invalid,
64
+ #vakata-dragged.jstree-classic .jstree-ok,
65
+ #jstree-marker.jstree-classic { _background-image:url("d.gif"); }
66
+ .jstree-classic .jstree-open ins { _background-position:-72px 0; }
67
+ .jstree-classic .jstree-closed ins { _background-position:-54px 0; }
68
+ .jstree-classic .jstree-leaf ins { _background-position:-36px 0; }
69
+ .jstree-classic .jstree-open a ins.jstree-icon { _background-position:-56px -36px; }
70
+ .jstree-classic .jstree-closed a ins.jstree-icon { _background-position:-56px -19px; }
71
+ .jstree-classic .jstree-leaf a ins.jstree-icon { _background-position:-56px -19px; }
72
+ #vakata-contextmenu.jstree-classic-context ins { _display:none; }
73
+ #vakata-contextmenu.jstree-classic-context li { _zoom:1; }
74
+ .jstree-classic .jstree-undetermined a .jstree-checkbox { _background-position:-20px -19px; }
75
+ .jstree-classic .jstree-checked a .jstree-checkbox { _background-position:-38px -19px; }
76
+ .jstree-classic .jstree-unchecked a .jstree-checkbox { _background-position:-2px -19px; }
77
+ /* IE6 END */
@@ -0,0 +1,84 @@
1
+ /*
2
+ * jsTree default-rtl theme 1.0
3
+ * Supported features: dots/no-dots, icons/no-icons, focused, loading
4
+ * Supported plugins: ui (hovered, clicked), checkbox, contextmenu, search
5
+ */
6
+
7
+ .jstree-default-rtl li,
8
+ .jstree-default-rtl ins { background-image:url("d.png"); background-repeat:no-repeat; background-color:transparent; }
9
+ .jstree-default-rtl li { background-position:-90px 0; background-repeat:repeat-y; }
10
+ .jstree-default-rtl li.jstree-last { background:transparent; }
11
+ .jstree-default-rtl .jstree-open > ins { background-position:-72px 0; }
12
+ .jstree-default-rtl .jstree-closed > ins { background-position:-54px 0; }
13
+ .jstree-default-rtl .jstree-leaf > ins { background-position:-36px 0; }
14
+
15
+ .jstree-default-rtl .jstree-hovered { background:#e7f4f9; border:1px solid #d8f0fa; padding:0 2px 0 1px; }
16
+ .jstree-default-rtl .jstree-clicked { background:#beebff; border:1px solid #99defd; padding:0 2px 0 1px; }
17
+ .jstree-default-rtl a .jstree-icon { background-position:-56px -19px; }
18
+ .jstree-default-rtl a.jstree-loading .jstree-icon { background:url("throbber.gif") center center no-repeat !important; }
19
+
20
+ .jstree-default-rtl.jstree-focused { background:#ffffee; }
21
+
22
+ .jstree-default-rtl .jstree-no-dots li,
23
+ .jstree-default-rtl .jstree-no-dots .jstree-leaf > ins { background:transparent; }
24
+ .jstree-default-rtl .jstree-no-dots .jstree-open > ins { background-position:-18px 0; }
25
+ .jstree-default-rtl .jstree-no-dots .jstree-closed > ins { background-position:0 0; }
26
+
27
+ .jstree-default-rtl .jstree-no-icons a .jstree-icon { display:none; }
28
+
29
+ .jstree-default-rtl .jstree-search { font-style:italic; }
30
+
31
+ .jstree-default-rtl .jstree-no-icons .jstree-checkbox { display:inline-block; }
32
+ .jstree-default-rtl .jstree-no-checkboxes .jstree-checkbox { display:none !important; }
33
+ .jstree-default-rtl .jstree-checked > a > .jstree-checkbox { background-position:-38px -19px; }
34
+ .jstree-default-rtl .jstree-unchecked > a > .jstree-checkbox { background-position:-2px -19px; }
35
+ .jstree-default-rtl .jstree-undetermined > a > .jstree-checkbox { background-position:-20px -19px; }
36
+ .jstree-default-rtl .jstree-checked > a > .jstree-checkbox:hover { background-position:-38px -37px; }
37
+ .jstree-default-rtl .jstree-unchecked > a > .jstree-checkbox:hover { background-position:-2px -37px; }
38
+ .jstree-default-rtl .jstree-undetermined > a > .jstree-checkbox:hover { background-position:-20px -37px; }
39
+
40
+ #vakata-dragged.jstree-default-rtl ins { background:transparent !important; }
41
+ #vakata-dragged.jstree-default-rtl .jstree-ok { background:url("d.png") -2px -53px no-repeat !important; }
42
+ #vakata-dragged.jstree-default-rtl .jstree-invalid { background:url("d.png") -18px -53px no-repeat !important; }
43
+ #jstree-marker.jstree-default-rtl { background:url("d.png") -41px -57px no-repeat !important; text-indent:-100px; }
44
+
45
+ .jstree-default-rtl a.jstree-search { color:aqua; }
46
+ .jstree-default-rtl .jstree-locked a { color:silver; cursor:default; }
47
+
48
+ #vakata-contextmenu.jstree-default-rtl-context,
49
+ #vakata-contextmenu.jstree-default-rtl-context li ul { background:#f0f0f0; border:1px solid #979797; -moz-box-shadow: 1px 1px 2px #999; -webkit-box-shadow: 1px 1px 2px #999; box-shadow: 1px 1px 2px #999; }
50
+ #vakata-contextmenu.jstree-default-rtl-context li { }
51
+ #vakata-contextmenu.jstree-default-rtl-context a { color:black; }
52
+ #vakata-contextmenu.jstree-default-rtl-context a:hover,
53
+ #vakata-contextmenu.jstree-default-rtl-context .vakata-hover > a { padding:0 5px; background:#e8eff7; border:1px solid #aecff7; color:black; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; }
54
+ #vakata-contextmenu.jstree-default-rtl-context li.jstree-contextmenu-disabled a,
55
+ #vakata-contextmenu.jstree-default-rtl-context li.jstree-contextmenu-disabled a:hover { color:silver; background:transparent; border:0; padding:1px 4px; }
56
+ #vakata-contextmenu.jstree-default-rtl-context li.vakata-separator { background:white; border-top:1px solid #e0e0e0; margin:0; }
57
+ #vakata-contextmenu.jstree-default-rtl-context li ul { margin-left:-4px; }
58
+
59
+ /* IE6 BEGIN */
60
+ .jstree-default-rtl li,
61
+ .jstree-default-rtl ins,
62
+ #vakata-dragged.jstree-default-rtl .jstree-invalid,
63
+ #vakata-dragged.jstree-default-rtl .jstree-ok,
64
+ #jstree-marker.jstree-default-rtl { _background-image:url("d.gif"); }
65
+ .jstree-default-rtl .jstree-open ins { _background-position:-72px 0; }
66
+ .jstree-default-rtl .jstree-closed ins { _background-position:-54px 0; }
67
+ .jstree-default-rtl .jstree-leaf ins { _background-position:-36px 0; }
68
+ .jstree-default-rtl a ins.jstree-icon { _background-position:-56px -19px; }
69
+ #vakata-contextmenu.jstree-default-rtl-context ins { _display:none; }
70
+ #vakata-contextmenu.jstree-default-rtl-context li { _zoom:1; }
71
+ .jstree-default-rtl .jstree-undetermined a .jstree-checkbox { _background-position:-18px -19px; }
72
+ .jstree-default-rtl .jstree-checked a .jstree-checkbox { _background-position:-36px -19px; }
73
+ .jstree-default-rtl .jstree-unchecked a .jstree-checkbox { _background-position:0px -19px; }
74
+ /* IE6 END */
75
+
76
+ /* RTL part */
77
+ .jstree-default-rtl .jstree-hovered, .jstree-default-rtl .jstree-clicked { padding:0 1px 0 2px; }
78
+ .jstree-default-rtl li { background-image:url("dots.gif"); background-position: 100% 0px; }
79
+ .jstree-default-rtl .jstree-checked > a > .jstree-checkbox { background-position:-36px -19px; margin-left:2px; }
80
+ .jstree-default-rtl .jstree-unchecked > a > .jstree-checkbox { background-position:0px -19px; margin-left:2px; }
81
+ .jstree-default-rtl .jstree-undetermined > a > .jstree-checkbox { background-position:-18px -19px; margin-left:2px; }
82
+ .jstree-default-rtl .jstree-checked > a > .jstree-checkbox:hover { background-position:-36px -37px; }
83
+ .jstree-default-rtl .jstree-unchecked > a > .jstree-checkbox:hover { background-position:0px -37px; }
84
+ .jstree-default-rtl .jstree-undetermined > a > .jstree-checkbox:hover { background-position:-18px -37px; }
@@ -0,0 +1,74 @@
1
+ /*
2
+ * jsTree default theme 1.0
3
+ * Supported features: dots/no-dots, icons/no-icons, focused, loading
4
+ * Supported plugins: ui (hovered, clicked), checkbox, contextmenu, search
5
+ */
6
+
7
+ .jstree-default li,
8
+ .jstree-default ins { background-image:url("d.png"); background-repeat:no-repeat; background-color:transparent; }
9
+ .jstree-default li { background-position:-90px 0; background-repeat:repeat-y; }
10
+ .jstree-default li.jstree-last { background:transparent; }
11
+ .jstree-default .jstree-open > ins { background-position:-72px 0; }
12
+ .jstree-default .jstree-closed > ins { background-position:-54px 0; }
13
+ .jstree-default .jstree-leaf > ins { background-position:-36px 0; }
14
+
15
+ .jstree-default .jstree-hovered { background:#e7f4f9; border:1px solid #d8f0fa; padding:0 2px 0 1px; }
16
+ .jstree-default .jstree-clicked { background:#beebff; border:1px solid #99defd; padding:0 2px 0 1px; }
17
+ .jstree-default a .jstree-icon { background-position:-56px -19px; }
18
+ .jstree-default a.jstree-loading .jstree-icon { background:url("throbber.gif") center center no-repeat !important; }
19
+
20
+ .jstree-default.jstree-focused { background:#ffffee; }
21
+
22
+ .jstree-default .jstree-no-dots li,
23
+ .jstree-default .jstree-no-dots .jstree-leaf > ins { background:transparent; }
24
+ .jstree-default .jstree-no-dots .jstree-open > ins { background-position:-18px 0; }
25
+ .jstree-default .jstree-no-dots .jstree-closed > ins { background-position:0 0; }
26
+
27
+ .jstree-default .jstree-no-icons a .jstree-icon { display:none; }
28
+
29
+ .jstree-default .jstree-search { font-style:italic; }
30
+
31
+ .jstree-default .jstree-no-icons .jstree-checkbox { display:inline-block; }
32
+ .jstree-default .jstree-no-checkboxes .jstree-checkbox { display:none !important; }
33
+ .jstree-default .jstree-checked > a > .jstree-checkbox { background-position:-38px -19px; }
34
+ .jstree-default .jstree-unchecked > a > .jstree-checkbox { background-position:-2px -19px; }
35
+ .jstree-default .jstree-undetermined > a > .jstree-checkbox { background-position:-20px -19px; }
36
+ .jstree-default .jstree-checked > a > .jstree-checkbox:hover { background-position:-38px -37px; }
37
+ .jstree-default .jstree-unchecked > a > .jstree-checkbox:hover { background-position:-2px -37px; }
38
+ .jstree-default .jstree-undetermined > a > .jstree-checkbox:hover { background-position:-20px -37px; }
39
+
40
+ #vakata-dragged.jstree-default ins { background:transparent !important; }
41
+ #vakata-dragged.jstree-default .jstree-ok { background:url("d.png") -2px -53px no-repeat !important; }
42
+ #vakata-dragged.jstree-default .jstree-invalid { background:url("d.png") -18px -53px no-repeat !important; }
43
+ #jstree-marker.jstree-default { background:url("d.png") -41px -57px no-repeat !important; text-indent:-100px; }
44
+
45
+ .jstree-default a.jstree-search { color:aqua; }
46
+ .jstree-default .jstree-locked a { color:silver; cursor:default; }
47
+
48
+ #vakata-contextmenu.jstree-default-context,
49
+ #vakata-contextmenu.jstree-default-context li ul { background:#f0f0f0; border:1px solid #979797; -moz-box-shadow: 1px 1px 2px #999; -webkit-box-shadow: 1px 1px 2px #999; box-shadow: 1px 1px 2px #999; }
50
+ #vakata-contextmenu.jstree-default-context li { }
51
+ #vakata-contextmenu.jstree-default-context a { color:black; }
52
+ #vakata-contextmenu.jstree-default-context a:hover,
53
+ #vakata-contextmenu.jstree-default-context .vakata-hover > a { padding:0 5px; background:#e8eff7; border:1px solid #aecff7; color:black; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; }
54
+ #vakata-contextmenu.jstree-default-context li.jstree-contextmenu-disabled a,
55
+ #vakata-contextmenu.jstree-default-context li.jstree-contextmenu-disabled a:hover { color:silver; background:transparent; border:0; padding:1px 4px; }
56
+ #vakata-contextmenu.jstree-default-context li.vakata-separator { background:white; border-top:1px solid #e0e0e0; margin:0; }
57
+ #vakata-contextmenu.jstree-default-context li ul { margin-left:-4px; }
58
+
59
+ /* IE6 BEGIN */
60
+ .jstree-default li,
61
+ .jstree-default ins,
62
+ #vakata-dragged.jstree-default .jstree-invalid,
63
+ #vakata-dragged.jstree-default .jstree-ok,
64
+ #jstree-marker.jstree-default { _background-image:url("d.gif"); }
65
+ .jstree-default .jstree-open ins { _background-position:-72px 0; }
66
+ .jstree-default .jstree-closed ins { _background-position:-54px 0; }
67
+ .jstree-default .jstree-leaf ins { _background-position:-36px 0; }
68
+ .jstree-default a ins.jstree-icon { _background-position:-56px -19px; }
69
+ #vakata-contextmenu.jstree-default-context ins { _display:none; }
70
+ #vakata-contextmenu.jstree-default-context li { _zoom:1; }
71
+ .jstree-default .jstree-undetermined a .jstree-checkbox { _background-position:-20px -19px; }
72
+ .jstree-default .jstree-checked a .jstree-checkbox { _background-position:-38px -19px; }
73
+ .jstree-default .jstree-unchecked a .jstree-checkbox { _background-position:-2px -19px; }
74
+ /* IE6 END */
@@ -0,0 +1,16 @@
1
+ require 'jstree_rails/version'
2
+
3
+ if(defined?(Rails))
4
+ require 'jstree_rails/generators'
5
+ require 'jstree_rails/viewers'
6
+ if(defined?(Rails::Railtie))
7
+ require 'jstree_rails/railtie'
8
+ end
9
+
10
+ ActionView::Helpers::AssetTagHelper.register_javascript_expansion(
11
+ :jstree => '/jstree_rails/javascripts/jquery.jstree.js'
12
+ )
13
+ ActionView::Helpers::AssetTagHelper.register_javascript_expansion(
14
+ :plugins => '/jstree_rails/javascripts/jquery.jstree.js'
15
+ )
16
+ end
@@ -0,0 +1,16 @@
1
+ require 'rails_javascript_helpers'
2
+
3
+ module JsTreeRails
4
+ module Generators
5
+ include RailsJavaScriptHelpers
6
+
7
+ def jstree(dom_id, options={})
8
+ "jQuery('#{format_id(dom_id)}').jstree(
9
+ #{format_type_to_js(options)}
10
+ );
11
+ "
12
+ end
13
+ end
14
+ end
15
+
16
+ ActionView::Helpers::PrototypeHelper::JavaScriptGenerator::GeneratorMethods.send :include, JsTreeRails::Generators
@@ -0,0 +1,7 @@
1
+ module JsTreeRails
2
+ class Railtie < Rails::Railtie
3
+ rake_tasks do
4
+ require 'jstree_rails/tasks'
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,21 @@
1
+ namespace :jstree_rails do
2
+
3
+ desc' Install required assets'
4
+ task :install do
5
+ print 'Checking for asset directory... '
6
+ FileUtils.mkdir_p(File.join(Rails.root, 'public', 'jstree_rails'))
7
+ puts 'OK'
8
+ print 'Removing any legacy assets... '
9
+ FileUtils.rm_rf(File.join(Rails.root, 'public', 'jstree_rails', '*'))
10
+ puts 'OK'
11
+ print 'Installing assets... '
12
+ FileUtils.cp_r(File.join(File.dirname(__FILE__), '..', '..', 'files', 'public', '.'), File.join(Rails.root, 'public', 'jstree_rails'))
13
+ puts 'Done'
14
+ end
15
+
16
+ desc 'Upgrade required assets'
17
+ task :upgrade do
18
+ Rake::Task['jstree_rails:install'].invoke
19
+ end
20
+
21
+ end
@@ -0,0 +1,18 @@
1
+ module JsTreeRails
2
+ class Version
3
+ attr_reader :major, :minor, :tiny
4
+
5
+ # version:: Version number
6
+ # Creates a new Version instance
7
+ def initialize(version)
8
+ version = version.split('.')
9
+ @major, @minor, @tiny = [version[0].to_i, version[1].to_i, version[2].to_i]
10
+ end
11
+
12
+ def to_s
13
+ "#{@major}.#{@minor}.#{@tiny}"
14
+ end
15
+ end
16
+
17
+ VERSION = Version.new('0.1.0')
18
+ end
@@ -0,0 +1,33 @@
1
+ require 'rails_javascript_helpers'
2
+ module JsTreeRails
3
+ module Viewers
4
+ include RailsJavaScriptHelpers
5
+
6
+ def jstree(dom_id, options={})
7
+ "<div id=\"#{dom_id.sub(/^#/, '')}\"></div>" +
8
+ javascript_tag{
9
+ "jQuery(function(){
10
+ jQuery('#{format_id(dom_id)}').jstree(
11
+ #{format_type_to_js(options)}
12
+ );
13
+ });
14
+ "
15
+ }.html_safe
16
+ end
17
+
18
+ # Send entire tree structure (-1 forces entire tree. update to make configurable)
19
+ def jstree_send_link(name, dom_id, url_or_path, args={})
20
+ link_to_function(name, args) do |page|
21
+ page << "
22
+ jQuery.ajax(
23
+ #{format_type_to_js(url_or_path)}, {
24
+ type : #{format_type_to_js(args[:method] || 'post')},
25
+ data : {data : jQuery(#{format_type_to_js(format_id(dom_id))}).jstree('get_json', -1)}
26
+ })"
27
+ end
28
+ end
29
+
30
+ end
31
+ end
32
+
33
+ ActionView::Base.send :include, JsTreeRails::Viewers