wagn 1.12.10 → 1.12.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/Gemfile +14 -12
- data/VERSION +1 -1
- data/app/assets/javascripts/wagn.js.coffee +25 -22
- data/app/assets/javascripts/wagn_mod.js.coffee +0 -44
- data/app/controllers/card_controller.rb +0 -1
- data/app/controllers/wagn_controller.rb +1 -2
- data/config/routes.rb +0 -1
- data/features/hello_wagn.feature +7 -5
- data/lib/card/exceptions.rb +7 -2
- data/lib/card/format.rb +8 -3
- data/lib/card/query/card_spec.rb +2 -1
- data/lib/card/set.rb +1 -0
- data/lib/wagn/all.rb +4 -4
- data/mods/core/formats/html_format.rb +296 -284
- data/mods/core/formats/text_format.rb +5 -2
- data/mods/core/sets/all/phases.rb +13 -0
- data/mods/standard/formats/css_format.rb +4 -1
- data/mods/standard/formats/csv_format.rb +4 -1
- data/mods/standard/formats/js_format.rb +6 -0
- data/mods/standard/formats/json_format.rb +4 -1
- data/mods/standard/formats/kml_format.rb +4 -1
- data/mods/standard/formats/rss_format.rb +7 -4
- data/mods/standard/formats/xml_format.rb +4 -1
- data/mods/standard/lib/stylesheets/functional.scss +2 -1
- data/mods/standard/sets/all/account.rb +1 -1
- data/mods/standard/sets/all/all_css.rb +5 -1
- data/mods/standard/sets/all/json.rb +17 -21
- data/mods/standard/sets/all/rich_html.rb +4 -3
- data/mods/standard/sets/self/head.rb +6 -0
- data/mods/standard/sets/type/cardtype.rb +1 -1
- data/mods/standard/sets/type/pointer.rb +23 -11
- data/mods/standard/sets/type/scss.rb +1 -0
- data/mods/standard/sets/type/search_type.rb +0 -2
- data/mods/standard/sets/type/user.rb +1 -2
- data/public/assets/application-7cda003cf1291a165b1eac69ea3027aa.js +107 -0
- data/public/assets/application-7cda003cf1291a165b1eac69ea3027aa.js.gz +0 -0
- data/public/assets/application.js +42 -38
- data/public/assets/application.js.gz +0 -0
- data/public/assets/html5shiv-printshiv-ad36fc7219f4aeaa275f9a7fe2383413.js.gz +0 -0
- data/public/assets/html5shiv-printshiv.js.gz +0 -0
- data/public/assets/jquery.min-8b58c0fbf303b938d8e749262f7e50dd.map +1 -0
- data/public/assets/jquery.min.map +1 -0
- data/public/assets/manifest.yml +4 -2
- data/public/assets/tinymce-22b5a139d9ff7df7643afae9ce205508.js.gz +0 -0
- data/public/assets/tinymce.js.gz +0 -0
- data/spec/lib/card/query_spec.rb +3 -2
- data/spec/mods/standard/sets/all/all_css_spec.rb +1 -1
- data/spec/mods/standard/sets/type/pointer_spec.rb +2 -2
- data/wagn.gemspec +5 -4
- metadata +10 -80
- data/public/assets/application-af2bc486eb3db1c02c4dcd0e23ca25fc.js +0 -103
- data/public/assets/application-af2bc486eb3db1c02c4dcd0e23ca25fc.js.gz +0 -0
- data/public/assets2bpacked/jstree/README.txt +0 -10
- data/public/assets2bpacked/jstree/_demo/_dump.sql +0 -20
- data/public/assets2bpacked/jstree/_demo/_inc/__mysql_errors.log +0 -0
- data/public/assets2bpacked/jstree/_demo/_inc/class._database.php +0 -146
- data/public/assets2bpacked/jstree/_demo/_inc/class._database_i.php +0 -152
- data/public/assets2bpacked/jstree/_demo/_inc/class.tree.php +0 -602
- data/public/assets2bpacked/jstree/_demo/_install.txt +0 -6
- data/public/assets2bpacked/jstree/_demo/config.php +0 -14
- data/public/assets2bpacked/jstree/_demo/file.png +0 -0
- data/public/assets2bpacked/jstree/_demo/folder.png +0 -0
- data/public/assets2bpacked/jstree/_demo/index.html +0 -461
- data/public/assets2bpacked/jstree/_demo/root.png +0 -0
- data/public/assets2bpacked/jstree/_demo/server.php +0 -69
- data/public/assets2bpacked/jstree/_docs/!style.css +0 -48
- data/public/assets2bpacked/jstree/_docs/_drive.png +0 -0
- data/public/assets2bpacked/jstree/_docs/_html_data.html +0 -2
- data/public/assets2bpacked/jstree/_docs/_json_data.json +0 -4
- data/public/assets2bpacked/jstree/_docs/_search_data.json +0 -6
- data/public/assets2bpacked/jstree/_docs/_search_result.json +0 -1
- data/public/assets2bpacked/jstree/_docs/_xml_flat.xml +0 -12
- data/public/assets2bpacked/jstree/_docs/_xml_nest.xml +0 -18
- data/public/assets2bpacked/jstree/_docs/checkbox.html +0 -171
- data/public/assets2bpacked/jstree/_docs/contextmenu.html +0 -121
- data/public/assets2bpacked/jstree/_docs/cookies.html +0 -97
- data/public/assets2bpacked/jstree/_docs/core.html +0 -689
- data/public/assets2bpacked/jstree/_docs/crrm.html +0 -316
- data/public/assets2bpacked/jstree/_docs/dnd.html +0 -199
- data/public/assets2bpacked/jstree/_docs/hotkeys.html +0 -82
- data/public/assets2bpacked/jstree/_docs/html_data.html +0 -175
- data/public/assets2bpacked/jstree/_docs/index.html +0 -86
- data/public/assets2bpacked/jstree/_docs/json_data.html +0 -249
- data/public/assets2bpacked/jstree/_docs/languages.html +0 -152
- data/public/assets2bpacked/jstree/_docs/logo.png +0 -0
- data/public/assets2bpacked/jstree/_docs/search.html +0 -153
- data/public/assets2bpacked/jstree/_docs/sort.html +0 -85
- data/public/assets2bpacked/jstree/_docs/syntax/!script.js +0 -2232
- data/public/assets2bpacked/jstree/_docs/syntax/!style.css +0 -511
- data/public/assets2bpacked/jstree/_docs/syntax/clipboard.swf +0 -0
- data/public/assets2bpacked/jstree/_docs/syntax/help.png +0 -0
- data/public/assets2bpacked/jstree/_docs/syntax/magnifier.png +0 -0
- data/public/assets2bpacked/jstree/_docs/syntax/page_white_code.png +0 -0
- data/public/assets2bpacked/jstree/_docs/syntax/page_white_copy.png +0 -0
- data/public/assets2bpacked/jstree/_docs/syntax/printer.png +0 -0
- data/public/assets2bpacked/jstree/_docs/syntax/wrapping.png +0 -0
- data/public/assets2bpacked/jstree/_docs/themeroller.html +0 -107
- data/public/assets2bpacked/jstree/_docs/themes.html +0 -127
- data/public/assets2bpacked/jstree/_docs/types.html +0 -178
- data/public/assets2bpacked/jstree/_docs/ui.html +0 -197
- data/public/assets2bpacked/jstree/_docs/unique.html +0 -85
- data/public/assets2bpacked/jstree/_docs/xml_data.html +0 -218
- data/public/assets2bpacked/jstree/_lib/jquery.cookie.js +0 -96
- data/public/assets2bpacked/jstree/_lib/jquery.hotkeys.js +0 -99
- data/public/assets2bpacked/jstree/_lib/jquery.js +0 -5
- data/public/assets2bpacked/jstree/jquery.jstree.js +0 -4564
- data/public/assets2bpacked/jstree/themes/apple/bg.jpg +0 -0
- data/public/assets2bpacked/jstree/themes/apple/d.png +0 -0
- data/public/assets2bpacked/jstree/themes/apple/dot_for_ie.gif +0 -0
- data/public/assets2bpacked/jstree/themes/apple/style.css +0 -61
- data/public/assets2bpacked/jstree/themes/apple/throbber.gif +0 -0
- data/public/assets2bpacked/jstree/themes/classic/d.gif +0 -0
- data/public/assets2bpacked/jstree/themes/classic/d.png +0 -0
- data/public/assets2bpacked/jstree/themes/classic/dot_for_ie.gif +0 -0
- data/public/assets2bpacked/jstree/themes/classic/style.css +0 -77
- data/public/assets2bpacked/jstree/themes/classic/throbber.gif +0 -0
- data/public/assets2bpacked/jstree/themes/default-rtl/d.gif +0 -0
- data/public/assets2bpacked/jstree/themes/default-rtl/d.png +0 -0
- data/public/assets2bpacked/jstree/themes/default-rtl/dots.gif +0 -0
- data/public/assets2bpacked/jstree/themes/default-rtl/style.css +0 -84
- data/public/assets2bpacked/jstree/themes/default-rtl/throbber.gif +0 -0
- data/public/assets2bpacked/jstree/themes/default/d.gif +0 -0
- data/public/assets2bpacked/jstree/themes/default/d.png +0 -0
- data/public/assets2bpacked/jstree/themes/default/style.css +0 -74
- data/public/assets2bpacked/jstree/themes/default/throbber.gif +0 -0
@@ -1,316 +0,0 @@
|
|
1
|
-
<!DOCTYPE html
|
2
|
-
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
3
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
4
|
-
<html xmlns="http://www.w3.org/1999/xhtml">
|
5
|
-
<head>
|
6
|
-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
7
|
-
<title>jsTree v.1.0 - CRRM documentation</title>
|
8
|
-
<script type="text/javascript" src="../_lib/jquery.js"></script>
|
9
|
-
<script type="text/javascript" src="../_lib/jquery.cookie.js"></script>
|
10
|
-
<script type="text/javascript" src="../_lib/jquery.hotkeys.js"></script>
|
11
|
-
<script type="text/javascript" src="../jquery.jstree.js"></script>
|
12
|
-
|
13
|
-
<link type="text/css" rel="stylesheet" href="syntax/!style.css"/>
|
14
|
-
<link type="text/css" rel="stylesheet" href="!style.css"/>
|
15
|
-
<script type="text/javascript" src="syntax/!script.js"></script>
|
16
|
-
</head>
|
17
|
-
<body>
|
18
|
-
<div id="container">
|
19
|
-
|
20
|
-
<h1 id="dhead">jsTree v.1.0</h1>
|
21
|
-
<h1>crrm plugin</h1>
|
22
|
-
<h2>Description</h2>
|
23
|
-
<div id="description">
|
24
|
-
<p>The <code>CRRM</code> plugin handles creating, renaming, removing and moving nodes by the user.</p>
|
25
|
-
</div>
|
26
|
-
|
27
|
-
<h2 id="configuration">Configuration</h2>
|
28
|
-
<div class="panel configuration">
|
29
|
-
<h3>input_width_limit</h3>
|
30
|
-
<p class="meta">A number. Default is <code>200</code>.</p>
|
31
|
-
<p>When renaming (or creating) nodes the input for the text will autosize - this number sets the maximum size for the input.</p>
|
32
|
-
|
33
|
-
<h3>move</h3>
|
34
|
-
<p class="meta">An object, containing various settings - see below for more.</p>
|
35
|
-
|
36
|
-
<h3>move.always_copy</h3>
|
37
|
-
<p class="meta"><code>true</code>, <code>false</code> or <code>"multitree"</code>. Default is <code>false</code>.</p>
|
38
|
-
<p>Defines how moves are handled - if set to <code>true</code> every move will be forced to a copy (leaving the original node in place). If set to <code>"multitree"</code> only moves between trees will be forced to a copy.</p>
|
39
|
-
|
40
|
-
<h3>move.open_onmove</h3>
|
41
|
-
<p class="meta">A Boolean. Default is <code>true</code>.</p>
|
42
|
-
<p>If set to true, when moving a node to a new, closed parent, the parent node will be opened when the move completes.</p>
|
43
|
-
|
44
|
-
<h3>move.default_position</h3>
|
45
|
-
<p class="meta">A string or a number. Default is <code>"last"</code>.</p>
|
46
|
-
<p>The default position to move to if no position is specified. This can be a zero based index to position the element at a specific point among the new parent's current children. You can also use one of these strings: <code>"before"</code>, <code>"after"</code>, <code>"inside"</code>, <code>"first"</code>, <code>"last"</code>.</p>
|
47
|
-
|
48
|
-
<h3>move.check_move</h3>
|
49
|
-
<p class="meta">A function. Default is <code>function (m) { return true; }</code>.</p>
|
50
|
-
<p>The callback function enabling you to prevent some moves - just return <code>false</code>. The <code>m</code> parameter is the move object generated by jstree. The object follows the structure described in <a href="core.html#_get_move">._get_move</a>.</p>
|
51
|
-
|
52
|
-
</div>
|
53
|
-
|
54
|
-
<h2 id="demos">Demos</h2>
|
55
|
-
<div class="panel">
|
56
|
-
|
57
|
-
<h3>Creating nodes</h3>
|
58
|
-
<input type="button" class="button" value="create_1" id="create_1" style="float:left;" />
|
59
|
-
<input type="button" class="button" value="create_2" id="create_2" style="float:left;" />
|
60
|
-
<input type="button" class="button" value="create_3" id="create_3" style="" />
|
61
|
-
<div id="demo1" class="demo">
|
62
|
-
<ul>
|
63
|
-
<li id="phtml_1">
|
64
|
-
<a href="#">Root node 1</a>
|
65
|
-
<ul>
|
66
|
-
<li id="phtml_2">
|
67
|
-
<a href="#">Child node 1</a>
|
68
|
-
</li>
|
69
|
-
<li id="phtml_3">
|
70
|
-
<a href="#">Child node 2</a>
|
71
|
-
</li>
|
72
|
-
</ul>
|
73
|
-
</li>
|
74
|
-
<li id="phtml_4">
|
75
|
-
<a href="#">Root node 2</a>
|
76
|
-
</li>
|
77
|
-
</ul>
|
78
|
-
</div>
|
79
|
-
<script type="text/javascript" class="source">
|
80
|
-
$(function () {
|
81
|
-
$("#create_1").click(function () {
|
82
|
-
$("#demo1").jstree("create");
|
83
|
-
});
|
84
|
-
$("#create_2").click(function () {
|
85
|
-
$("#demo1").jstree("create","#phtml_1","first","Enter a new name");
|
86
|
-
});
|
87
|
-
$("#create_3").click(function () {
|
88
|
-
$("#demo1").jstree("create",-1,false,"No rename",false,true);
|
89
|
-
});
|
90
|
-
$("#demo1").jstree({
|
91
|
-
"ui" : {
|
92
|
-
"initially_select" : [ "phtml_2" ]
|
93
|
-
},
|
94
|
-
"core" : { "initially_open" : [ "phtml_1" ] },
|
95
|
-
"plugins" : [ "themes", "html_data", "ui", "crrm" ]
|
96
|
-
});
|
97
|
-
});
|
98
|
-
</script>
|
99
|
-
|
100
|
-
<h3>Removing nodes</h3>
|
101
|
-
<input type="button" class="button" value="remove_1" id="remove_1" style="float:left;" />
|
102
|
-
<input type="button" class="button" value="remove_2" id="remove_2" style="" />
|
103
|
-
<div id="demo2" class="demo">
|
104
|
-
<ul>
|
105
|
-
<li id="rhtml_1">
|
106
|
-
<a href="#">Root node 1</a>
|
107
|
-
<ul>
|
108
|
-
<li id="rhtml_2">
|
109
|
-
<a href="#">Child node 1</a>
|
110
|
-
</li>
|
111
|
-
<li id="rhtml_3">
|
112
|
-
<a href="#">Child node 2</a>
|
113
|
-
</li>
|
114
|
-
</ul>
|
115
|
-
</li>
|
116
|
-
<li id="rhtml_4">
|
117
|
-
<a href="#">Root node 2</a>
|
118
|
-
</li>
|
119
|
-
</ul>
|
120
|
-
</div>
|
121
|
-
<script type="text/javascript" class="source">
|
122
|
-
$(function () {
|
123
|
-
$("#remove_1").click(function () {
|
124
|
-
$("#demo2").jstree("remove");
|
125
|
-
});
|
126
|
-
$("#remove_2").click(function () {
|
127
|
-
$("#demo2").jstree("remove","#rhtml_1");
|
128
|
-
});
|
129
|
-
$("#demo2").jstree({
|
130
|
-
"ui" : {
|
131
|
-
"initially_select" : [ "rhtml_2" ]
|
132
|
-
},
|
133
|
-
"core" : { "initially_open" : [ "rhtml_1" ] },
|
134
|
-
"plugins" : [ "themes", "html_data", "ui", "crrm" ]
|
135
|
-
});
|
136
|
-
});
|
137
|
-
</script>
|
138
|
-
|
139
|
-
<h3>Renaming nodes</h3>
|
140
|
-
<input type="button" class="button" value="rename_1" id="rename_1" style="float:left;" />
|
141
|
-
<input type="button" class="button" value="rename_2" id="rename_2" style="" />
|
142
|
-
<div id="demo3" class="demo">
|
143
|
-
<ul>
|
144
|
-
<li id="shtml_1">
|
145
|
-
<a href="#">Root node 1</a>
|
146
|
-
<ul>
|
147
|
-
<li id="shtml_2">
|
148
|
-
<a href="#">Child node 1</a>
|
149
|
-
</li>
|
150
|
-
<li id="shtml_3">
|
151
|
-
<a href="#">Child node 2</a>
|
152
|
-
</li>
|
153
|
-
</ul>
|
154
|
-
</li>
|
155
|
-
<li id="shtml_4">
|
156
|
-
<a href="#">Root node 2</a>
|
157
|
-
</li>
|
158
|
-
</ul>
|
159
|
-
</div>
|
160
|
-
<script type="text/javascript" class="source">
|
161
|
-
$(function () {
|
162
|
-
$("#rename_1").click(function () {
|
163
|
-
$("#demo3").jstree("rename");
|
164
|
-
});
|
165
|
-
$("#rename_2").click(function () {
|
166
|
-
$("#demo3").jstree("rename","#shtml_1");
|
167
|
-
});
|
168
|
-
$("#demo3").jstree({
|
169
|
-
"ui" : {
|
170
|
-
"initially_select" : [ "shtml_2" ]
|
171
|
-
},
|
172
|
-
"core" : { "initially_open" : [ "shtml_1" ] },
|
173
|
-
"plugins" : [ "themes", "html_data", "ui", "crrm" ]
|
174
|
-
});
|
175
|
-
});
|
176
|
-
</script>
|
177
|
-
|
178
|
-
<h3>Moving nodes</h3>
|
179
|
-
<p><strong>move_1</strong> uses the default position - <code>"first"</code></p>
|
180
|
-
<p><strong>move_2</strong> specifies a position - <code>"before"</code> - meaning that the node specified as a first argument will come above the node specified as the second argument</p>
|
181
|
-
<p><strong>move_3</strong> will never work, because of the specified <code>check_move</code> function which prevents the first root node from being moved</p>
|
182
|
-
<input type="button" class="button" value="move_1" id="move_1" style="float:left;" />
|
183
|
-
<input type="button" class="button" value="move_2" id="move_2" style="float:left;" />
|
184
|
-
<input type="button" class="button" value="move_3" id="move_3" style="" />
|
185
|
-
<div id="demo4" class="demo">
|
186
|
-
<ul>
|
187
|
-
<li id="thtml_1">
|
188
|
-
<a href="#">Root node 1</a>
|
189
|
-
<ul>
|
190
|
-
<li id="thtml_2">
|
191
|
-
<a href="#">Child node 1</a>
|
192
|
-
</li>
|
193
|
-
<li id="thtml_3">
|
194
|
-
<a href="#">Child node 2</a>
|
195
|
-
</li>
|
196
|
-
</ul>
|
197
|
-
</li>
|
198
|
-
<li id="thtml_4">
|
199
|
-
<a href="#">Root node 2</a>
|
200
|
-
</li>
|
201
|
-
</ul>
|
202
|
-
</div>
|
203
|
-
<script type="text/javascript" class="source">
|
204
|
-
$(function () {
|
205
|
-
$("#move_1").click(function () {
|
206
|
-
$("#demo4").jstree("move_node","#thtml_4","#thtml_1");
|
207
|
-
});
|
208
|
-
$("#move_2").click(function () {
|
209
|
-
$("#demo4").jstree("move_node","#thtml_4","#thtml_1", "before");
|
210
|
-
});
|
211
|
-
$("#move_3").click(function () {
|
212
|
-
$("#demo4").jstree("move_node","#thtml_1","#thtml_4");
|
213
|
-
});
|
214
|
-
$("#demo4").jstree({
|
215
|
-
"crrm" : {
|
216
|
-
"move" : {
|
217
|
-
"default_position" : "first",
|
218
|
-
"check_move" : function (m) { return (m.o[0].id === "thtml_1") ? false : true; }
|
219
|
-
}
|
220
|
-
},
|
221
|
-
"ui" : {
|
222
|
-
"initially_select" : [ "thtml_2" ]
|
223
|
-
},
|
224
|
-
"core" : { "initially_open" : [ "thtml_1" ] },
|
225
|
-
"plugins" : [ "themes", "html_data", "ui", "crrm" ]
|
226
|
-
});
|
227
|
-
});
|
228
|
-
</script>
|
229
|
-
|
230
|
-
</div>
|
231
|
-
|
232
|
-
<h2 id="api">API</h2>
|
233
|
-
<div class="panel api">
|
234
|
-
|
235
|
-
<h3 id="_show_input">._show_input ( node , callback )</h3>
|
236
|
-
<p>Renders an input field in a node. Used only internally.</p>
|
237
|
-
|
238
|
-
<h3 id="rename">.rename ( node )</h3>
|
239
|
-
<p>Sets a node in rename mode and when the user has entered changes, an event is triggered.</p>
|
240
|
-
<ul class="arguments">
|
241
|
-
<li>
|
242
|
-
<code class="tp">mixed</code> <strong>node</strong>
|
243
|
-
<p>This can be a DOM node, jQuery node or selector pointing to an element within the tree. If you use the UI plugin - pass <code>null</code> to use the currently selected item.</p>
|
244
|
-
</li>
|
245
|
-
</ul>
|
246
|
-
|
247
|
-
<h3 id="create">.create ( node , position , js , callback , skip_rename )</h3>
|
248
|
-
<p>Creates a new node. Triggers an event.</p>
|
249
|
-
<ul class="arguments">
|
250
|
-
<li>
|
251
|
-
<code class="tp">mixed</code> <strong>node</strong>
|
252
|
-
<p>This can be a DOM node, jQuery node or selector pointing to the element you want to create in (or next to). If you use the UI plugin - pass <code>null</code> to use the currently selected item.</p>
|
253
|
-
</li>
|
254
|
-
<li>
|
255
|
-
<code class="tp">mixed</code> <strong>position</strong>
|
256
|
-
<p>The position of the newly created node. This can be a zero based index to position the element at a specific point among the current children. You can also pass in one of those strings: <code>"before"</code>, <code>"after"</code>, <code>"inside"</code>, <code>"first"</code>, <code>"last"</code>.</p>
|
257
|
-
</li>
|
258
|
-
<li>
|
259
|
-
<code class="tp">object</code> <strong>js</strong>
|
260
|
-
<p>The data for the newly created node. Consists of three keys:</p><p style="margin-left:25px;"><code class="tp">attr</code> - an object of attributes (same used for <code>jQuery.attr()</code>. You can omit this key;<br /><code class="tp">state</code> - a string - either <code>"open"</code> or <code>"closed"</code>, for a leaf node - omit this key;<br /><code class="tp">data</code> - a string or an object - if a string is passed it is used for the title of the node, if an object is passed there are two keys you can specify: <code>attr</code> and <code>title</code>;</p>
|
261
|
-
</li>
|
262
|
-
<li>
|
263
|
-
<code class="tp">function</code> <strong>callback</strong>
|
264
|
-
<p>A function to be executed once the node is created. You'd be better off waiting for the event.</p>
|
265
|
-
</li>
|
266
|
-
<li>
|
267
|
-
<code class="tp">bool</code> <strong>skip_rename</strong>
|
268
|
-
<p>Skips the user input step. The node is created with the data you have supplied.</p>
|
269
|
-
</li>
|
270
|
-
</ul>
|
271
|
-
|
272
|
-
<h3 id="remove">.remove ( node )</h3>
|
273
|
-
<p>Removes a node. Triggers an event.</p>
|
274
|
-
<ul class="arguments">
|
275
|
-
<li>
|
276
|
-
<code class="tp">mixed</code> <strong>node</strong>
|
277
|
-
<p>This can be a DOM node, jQuery node or selector pointing to an element within the tree. If you use the UI plugin - pass <code>null</code> to use the currently selected items.</p>
|
278
|
-
</li>
|
279
|
-
</ul>
|
280
|
-
|
281
|
-
<div style="height:1px; visibility:hidden; overflow:hidden;"><span id="check_move"> </span></div>
|
282
|
-
<h3 id="move_node">.check_move ( ), .move_node ( )</h3>
|
283
|
-
<p>Both functions are overwritten from the <a href="core.html#check_move">core</a> in order to implement the new functionality.</p>
|
284
|
-
|
285
|
-
<h3 id="cut">.cut ( node )</h3>
|
286
|
-
<p>Cuts a node (prepares it for pasting).</p>
|
287
|
-
<ul class="arguments">
|
288
|
-
<li>
|
289
|
-
<code class="tp">mixed</code> <strong>node</strong>
|
290
|
-
<p>This can be a DOM node, jQuery node or selector pointing to an element within the tree. If you use the UI plugin - pass <code>null</code> to use the currently selected item.</p>
|
291
|
-
</li>
|
292
|
-
</ul>
|
293
|
-
|
294
|
-
<h3 id="copy">.copy ( node )</h3>
|
295
|
-
<p>Copies a node (prepares it for pasting).</p>
|
296
|
-
<ul class="arguments">
|
297
|
-
<li>
|
298
|
-
<code class="tp">mixed</code> <strong>node</strong>
|
299
|
-
<p>This can be a DOM node, jQuery node or selector pointing to an element within the tree. If you use the UI plugin - pass <code>null</code> to use the currently selected item.</p>
|
300
|
-
</li>
|
301
|
-
</ul>
|
302
|
-
|
303
|
-
<h3 id="paste">.paste ( node )</h3>
|
304
|
-
<p>Pastes copied or cut nodes inside a node.</p>
|
305
|
-
<ul class="arguments">
|
306
|
-
<li>
|
307
|
-
<code class="tp">mixed</code> <strong>node</strong>
|
308
|
-
<p>This can be a DOM node, jQuery node or selector pointing to an element within the tree. If you use the UI plugin - pass <code>null</code> to use the currently selected item.</p>
|
309
|
-
</li>
|
310
|
-
</ul>
|
311
|
-
|
312
|
-
</div>
|
313
|
-
|
314
|
-
</div>
|
315
|
-
</body>
|
316
|
-
</html>
|
@@ -1,199 +0,0 @@
|
|
1
|
-
<!DOCTYPE html
|
2
|
-
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
3
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
4
|
-
<html xmlns="http://www.w3.org/1999/xhtml">
|
5
|
-
<head>
|
6
|
-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
7
|
-
<title>jsTree v.1.0 - dnd documentation</title>
|
8
|
-
<script type="text/javascript" src="../_lib/jquery.js"></script>
|
9
|
-
<script type="text/javascript" src="../_lib/jquery.cookie.js"></script>
|
10
|
-
<script type="text/javascript" src="../_lib/jquery.hotkeys.js"></script>
|
11
|
-
<script type="text/javascript" src="../jquery.jstree.js"></script>
|
12
|
-
|
13
|
-
<link type="text/css" rel="stylesheet" href="syntax/!style.css"/>
|
14
|
-
<link type="text/css" rel="stylesheet" href="!style.css"/>
|
15
|
-
<script type="text/javascript" src="syntax/!script.js"></script>
|
16
|
-
</head>
|
17
|
-
<body>
|
18
|
-
<div id="container">
|
19
|
-
|
20
|
-
<h1 id="dhead">jsTree v.1.0</h1>
|
21
|
-
<h1>dnd plugin</h1>
|
22
|
-
<h2>Description</h2>
|
23
|
-
<div id="description">
|
24
|
-
<p>The <code>dnd</code> plugin enables drag'n'drop support for jstree, also using foreign nodes and drop targets.</p>
|
25
|
-
<p class="note">All foreign node options and callback functions in the config (drop_target, drop_check, drop_finish, drag_target, drag_check, drag_finish) are to be used ONLY when nodes that are not part of any tree are involved.<br />If moving nodes from one tree instance to another - just listen for the "move_node.jstree" event on the receiving tree.<br /><span style="color:red">DO NOT SET drag_target AND drop_target to match tree nodes!</span></p>
|
26
|
-
</div>
|
27
|
-
|
28
|
-
<h2 id="configuration">Configuration</h2>
|
29
|
-
<div class="panel configuration">
|
30
|
-
|
31
|
-
<h3>copy_modifier</h3>
|
32
|
-
<p class="meta">A string. Default is <code>"ctrl"</code>.</p>
|
33
|
-
<p>The special key used to make a drag copy instead of move (<code>"ctrl"</code>, <code>"shift"</code>, <code>"alt"</code>, <code>"meta"</code>).</p>
|
34
|
-
|
35
|
-
<h3>check_timeout</h3>
|
36
|
-
<p class="meta">A number. Default is <code>200</code>.</p>
|
37
|
-
<p>The number of milliseconds to wait before checking if a move is valid upon hovering a node (while dragging). <code>200</code> is a reasonable value - a higher number means better performance but slow feedback to the user, a lower number means lower performance (possibly) but the user will get feedback faster.</p>
|
38
|
-
|
39
|
-
<h3>open_timeout</h3>
|
40
|
-
<p class="meta">A number. Default is <code>500</code>.</p>
|
41
|
-
<p>The number of milliseconds to wait before opening a hovered if it has children (while dragging). This means that the user has to stop over the node for half a second in order to trigger the open operation. Keep in mind that a low value in combination with async data could mean a lot of unneeded traffic, so <code>500</code> is quite reasonable.</p>
|
42
|
-
|
43
|
-
<h3>drop_target</h3>
|
44
|
-
<p class="meta">A string (jQuery selector) (or <code>false</code>). Default is <code>".jstree-drop"</code>.</p>
|
45
|
-
<p>A jquery selector matching all drop targets (you can also use the comma <code>,</code> in the string to specify multiple valid targets). If set to <code>false</code> drop targets are disabled.</p>
|
46
|
-
|
47
|
-
<h3>drop_check</h3>
|
48
|
-
<p class="meta">A function. Default is <code>function (data) { return true; }</code>.</p>
|
49
|
-
<p>Return <code>false</code> to mark the move as invalid, otherwise return <code>true</code>. The <code>data</code> parameter is as follows:</p>
|
50
|
-
<p style="margin-left:2em;"><code>data.o</code> - the object being dragged</p>
|
51
|
-
<p style="margin-left:2em;"><code>data.r</code> - the drop target</p>
|
52
|
-
|
53
|
-
<h3>drop_finish</h3>
|
54
|
-
<p class="meta">A function. Default is <code>$.noop</code>.</p>
|
55
|
-
<p>Gets executed after a valid drop, you get one parameter, which is as follows:</p>
|
56
|
-
<p style="margin-left:2em;"><code>data.o</code> - the object being dragged</p>
|
57
|
-
<p style="margin-left:2em;"><code>data.r</code> - the drop target</p>
|
58
|
-
|
59
|
-
<h3>drag_target</h3>
|
60
|
-
<p class="meta">A string (jQuery selector) (or <code>false</code>). Default is <code>".jstree-draggable"</code>.</p>
|
61
|
-
<p>A jquery selector matching all foreign nodes that can be dropped on the tree (you can also use the comma <code>,</code> in the string to specify multiple valid foreign nodes). If set to <code>false</code> dragging foreign nodes is disabled.</p>
|
62
|
-
|
63
|
-
<h3>drag_check</h3>
|
64
|
-
<p class="meta">A function. Default is <code>function (data) { return { after : false, before : false, inside : true }; }</code>.</p>
|
65
|
-
<p>Return a boolean for each position. The <code>data</code> parameter is as follows:</p>
|
66
|
-
<p style="margin-left:2em;"><code>data.o</code> - the foreign object being dragged</p>
|
67
|
-
<p style="margin-left:2em;"><code>data.r</code> - the hovered node</p>
|
68
|
-
|
69
|
-
<h3>drag_finish</h3>
|
70
|
-
<p class="meta">A function. Default is <code>$.noop</code>.</p>
|
71
|
-
<p>Gets executed after a dropping a foreign element on a tree item, you get one parameter, which is as follows:</p>
|
72
|
-
<p style="margin-left:2em;"><code>data.o</code> - the foreign object being dragged</p>
|
73
|
-
<p style="margin-left:2em;"><code>data.r</code> - the target node</p>
|
74
|
-
|
75
|
-
|
76
|
-
</div>
|
77
|
-
|
78
|
-
<h2 id="demos">Demos</h2>
|
79
|
-
<div class="panel">
|
80
|
-
<h3>Using the dnd plugin</h3>
|
81
|
-
<p>Drag stuff around!</p>
|
82
|
-
<div class="jstree-drop" style="clear:both; border:5px solid green; background:lime; color:green; height:40px; line-height:40px; text-align:center; font-size:20px;">I have the jstree-drop class</div>
|
83
|
-
<div class="jstree-draggable" style="margin:10px 0; clear:both; border:5px solid navy; background:aqua; color:navy; height:40px; line-height:40px; text-align:center; font-size:20px;">I have the jstree-draggable class</div>
|
84
|
-
<div id="demo1" class="demo">
|
85
|
-
<ul>
|
86
|
-
<li id="phtml_1">
|
87
|
-
<a href="#">Root node 1</a>
|
88
|
-
<ul>
|
89
|
-
<li id="phtml_2">
|
90
|
-
<a href="#">Child node 1</a>
|
91
|
-
</li>
|
92
|
-
<li id="phtml_3">
|
93
|
-
<a href="#">Child node 2</a>
|
94
|
-
</li>
|
95
|
-
</ul>
|
96
|
-
</li>
|
97
|
-
<li id="phtml_4">
|
98
|
-
<a href="#">Root node 2</a>
|
99
|
-
</li>
|
100
|
-
</ul>
|
101
|
-
</div>
|
102
|
-
<script type="text/javascript" class="source">
|
103
|
-
$(function () {
|
104
|
-
$("#demo1").jstree({
|
105
|
-
"dnd" : {
|
106
|
-
"drop_finish" : function () {
|
107
|
-
alert("DROP");
|
108
|
-
},
|
109
|
-
"drag_check" : function (data) {
|
110
|
-
if(data.r.attr("id") == "phtml_1") {
|
111
|
-
return false;
|
112
|
-
}
|
113
|
-
return {
|
114
|
-
after : false,
|
115
|
-
before : false,
|
116
|
-
inside : true
|
117
|
-
};
|
118
|
-
},
|
119
|
-
"drag_finish" : function (data) {
|
120
|
-
alert("DRAG OK");
|
121
|
-
}
|
122
|
-
},
|
123
|
-
"plugins" : [ "themes", "html_data", "dnd" ]
|
124
|
-
});
|
125
|
-
});
|
126
|
-
</script>
|
127
|
-
|
128
|
-
<h3>Reorder only demo</h3>
|
129
|
-
<div id="demo2" class="demo">
|
130
|
-
<ul>
|
131
|
-
<li id="rhtml_1">
|
132
|
-
<a href="#">Root node 1</a>
|
133
|
-
<ul>
|
134
|
-
<li id="rhtml_2">
|
135
|
-
<a href="#">Child node 1</a>
|
136
|
-
</li>
|
137
|
-
<li id="rhtml_3">
|
138
|
-
<a href="#">Child node 2</a>
|
139
|
-
</li>
|
140
|
-
<li id="rhtml_4">
|
141
|
-
<a href="#">Child node 3</a>
|
142
|
-
</li>
|
143
|
-
<li id="rhtml_5">
|
144
|
-
<a href="#">Child node 4</a>
|
145
|
-
</li>
|
146
|
-
</ul>
|
147
|
-
</li>
|
148
|
-
<li id="rhtml_6">
|
149
|
-
<a href="#">Root node 2</a>
|
150
|
-
</li>
|
151
|
-
<li id="rhtml_7">
|
152
|
-
<a href="#">Root node 3</a>
|
153
|
-
</li>
|
154
|
-
</ul>
|
155
|
-
</div>
|
156
|
-
<script type="text/javascript" class="source">
|
157
|
-
$(function () {
|
158
|
-
$("#demo2").jstree({
|
159
|
-
"crrm" : {
|
160
|
-
"move" : {
|
161
|
-
"check_move" : function (m) {
|
162
|
-
var p = this._get_parent(m.o);
|
163
|
-
if(!p) return false;
|
164
|
-
p = p == -1 ? this.get_container() : p;
|
165
|
-
if(p === m.np) return true;
|
166
|
-
if(p[0] && m.np[0] && p[0] === m.np[0]) return true;
|
167
|
-
return false;
|
168
|
-
}
|
169
|
-
}
|
170
|
-
},
|
171
|
-
"dnd" : {
|
172
|
-
"drop_target" : false,
|
173
|
-
"drag_target" : false
|
174
|
-
},
|
175
|
-
"plugins" : [ "themes", "html_data", "crrm", "dnd" ]
|
176
|
-
});
|
177
|
-
});
|
178
|
-
</script>
|
179
|
-
|
180
|
-
</div>
|
181
|
-
|
182
|
-
<h2 id="api">API</h2>
|
183
|
-
<div class="panel api">
|
184
|
-
|
185
|
-
<div style="height:1px; visibility:hidden;">
|
186
|
-
<span id="dnd_show"> </span>
|
187
|
-
<span id="dnd_open"> </span>
|
188
|
-
<span id="dnd_finish"> </span>
|
189
|
-
<span id="dnd_enter"> </span>
|
190
|
-
<span id="start_drag"> </span>
|
191
|
-
</div>
|
192
|
-
<h3 id="dnd_prepare">.dnd_prepare ( ), .dnd_show ( ), .dnd_open ( ), .dnd_finish ( ), .dnd_enter ( ), .dnd_leave ( ), .start_drag ( )</h3>
|
193
|
-
<p>All those functions are used internally only. If you want more information - examine the source code.</p>
|
194
|
-
|
195
|
-
</div>
|
196
|
-
|
197
|
-
</div>
|
198
|
-
</body>
|
199
|
-
</html>
|