wheels 0.0.48 → 0.0.49
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/app/controllers/access_control_entries_controller.rb +4 -4
- data/app/controllers/external_links_controller.rb +5 -0
- data/app/controllers/feedbacks_controller.rb +10 -0
- data/app/controllers/menus_controller.rb +2 -0
- data/app/controllers/pages_controller.rb +16 -29
- data/app/controllers/sitemaps_controller.rb +135 -0
- data/app/helpers/application_helper.rb +4 -3
- data/app/helpers/external_links_helper.rb +2 -0
- data/app/helpers/feedbacks_helper.rb +2 -0
- data/app/helpers/menus_helper.rb +2 -0
- data/app/helpers/sitemaps_helper.rb +12 -0
- data/app/mailers/feedback_mailer.rb +10 -0
- data/app/models/ability.rb +2 -1
- data/app/models/access_control_entry.rb +17 -15
- data/app/models/external_link.rb +4 -0
- data/app/models/feedback.rb +13 -0
- data/app/models/image.rb +1 -1
- data/app/models/menu.rb +4 -0
- data/app/models/page.rb +2 -5
- data/app/models/sitemap.rb +153 -0
- data/app/models/user.rb +7 -1
- data/app/validators/email_validator.rb +22 -0
- data/app/views/access_control_entries/_form.html.haml +1 -1
- data/app/views/access_control_entries/_index.html.haml +3 -3
- data/app/views/access_control_entries/_show.html.haml +1 -1
- data/app/views/external_links/_fields_for.html.haml +2 -0
- data/app/views/external_links/_form.html.haml +18 -0
- data/app/views/external_links/_show.html.haml +7 -0
- data/app/views/external_links/edit.html.haml +7 -0
- data/app/views/external_links/index.html.haml +23 -0
- data/app/views/external_links/new.html.haml +5 -0
- data/app/views/external_links/show.html.haml +2 -0
- data/app/views/feedback_mailer/submit_feedback.html.haml +22 -0
- data/app/views/feedbacks/_form.html.haml +37 -0
- data/app/views/feedbacks/index.html.haml +27 -0
- data/app/views/feedbacks/new.html.haml +5 -0
- data/app/views/feedbacks/show.html.haml +19 -0
- data/app/views/layouts/application.html.haml +21 -16
- data/app/views/layouts/bare.html.haml +2 -0
- data/app/views/loadbehind/_view.js.haml +1 -2
- data/app/views/menus/_form.html.haml +13 -0
- data/app/views/menus/edit.html.haml +7 -0
- data/app/views/menus/index.html.haml +19 -0
- data/app/views/menus/new.html.haml +5 -0
- data/app/views/menus/show.html.haml +7 -0
- data/app/views/pages/_child_pages_links.html.haml +1 -1
- data/app/views/pages/_control_panel.html.haml +1 -6
- data/app/views/pages/_form.html.haml +2 -2
- data/app/views/pages/_form_fields.html.haml +7 -2
- data/app/views/pages/_show.html.haml +4 -0
- data/app/views/pages/create.js.haml +2 -1
- data/app/views/pages/destroy.js.haml +3 -0
- data/app/views/pages/edit.js.haml +4 -0
- data/app/views/pages/index.html.haml +4 -2
- data/app/views/pages/index.js.haml +3 -0
- data/app/views/pages/new.js.haml +3 -0
- data/app/views/pages/show.html.haml +2 -10
- data/app/views/pages/show.js.haml +3 -0
- data/app/views/pages/update.js.haml +2 -2
- data/app/views/sitemaps/edit.html.haml +12 -0
- data/app/views/sitemaps/edit.js.erb +0 -0
- data/app/views/sitemaps/index.html.haml +93 -0
- data/app/views/sitemaps/index.json.erb +23 -0
- data/app/views/sitemaps/new.html.haml +8 -0
- data/app/views/sitemaps/new.js.erb +0 -0
- data/app/views/users/edit.html.haml +45 -0
- data/db/migrate/{add_fields_to_users.rb → 0010_add_fields_to_users.rb} +0 -0
- data/db/migrate/{create_blogs.rb → 0020_create_blogs.rb} +0 -0
- data/db/migrate/{create_galleries.rb → 0030_create_galleries.rb} +0 -0
- data/db/migrate/{create_images.rb → 0040_create_images.rb} +0 -0
- data/db/migrate/{create_profiles.rb → 0050_create_profiles.rb} +0 -0
- data/db/migrate/{insert_admin_user_and_roles.rb → 0060_insert_admin_user_and_roles.rb} +0 -0
- data/db/migrate/{create_pages.rb → 0070_create_pages.rb} +0 -0
- data/db/migrate/{create_forums.rb → 0080_create_forums.rb} +0 -0
- data/db/migrate/{create_discussions.rb → 0090_create_discussions.rb} +0 -0
- data/db/migrate/{create_forum_messages.rb → 0100_create_forum_messages.rb} +0 -0
- data/db/migrate/{create_access_control_entries.rb → 0110_create_access_control_entries.rb} +3 -3
- data/db/migrate/{create_attachments.rb → 0120_create_attachments.rb} +0 -4
- data/db/migrate/{create_roles.rb → 0130_create_roles.rb} +0 -0
- data/db/migrate/0140_create_feedbacks.rb +20 -0
- data/db/migrate/0150_create_external_links.rb +14 -0
- data/db/migrate/0160_create_sitemaps.rb +17 -0
- data/db/migrate/0170_create_menus.rb +14 -0
- data/lib/development_mail_interceptor.rb +7 -0
- data/lib/generators/wheels/recipes/wheels.rb +18 -12
- data/lib/wheels/base.rb +7 -0
- data/lib/wheels/routes.rb +8 -3
- data/lib/wheels.rb +2 -0
- data/public/javascripts/jquery-validate/additional-methods.js +259 -0
- data/public/javascripts/jquery-validate/changelog.txt +239 -0
- data/public/javascripts/jquery-validate/jquery.validate.js +1146 -0
- data/public/javascripts/jquery-validate/jquery.validate.min.js +16 -0
- data/public/javascripts/jquery-validate/jquery.validate.pack.js +15 -0
- data/public/javascripts/jquery-validate/lib/jquery-1.4.2.js +6240 -0
- data/public/javascripts/jquery-validate/lib/jquery.form.js +660 -0
- data/public/javascripts/jquery-validate/lib/jquery.js +4376 -0
- data/public/javascripts/jquery-validate/lib/jquery.metadata.js +122 -0
- data/public/javascripts/jquery-validate/localization/messages_ar.js +24 -0
- data/public/javascripts/jquery-validate/localization/messages_bg.js +23 -0
- data/public/javascripts/jquery-validate/localization/messages_cn.js +23 -0
- data/public/javascripts/jquery-validate/localization/messages_cs.js +23 -0
- data/public/javascripts/jquery-validate/localization/messages_da.js +20 -0
- data/public/javascripts/jquery-validate/localization/messages_de.js +20 -0
- data/public/javascripts/jquery-validate/localization/messages_el.js +24 -0
- data/public/javascripts/jquery-validate/localization/messages_es.js +23 -0
- data/public/javascripts/jquery-validate/localization/messages_fa.js +23 -0
- data/public/javascripts/jquery-validate/localization/messages_fi.js +21 -0
- data/public/javascripts/jquery-validate/localization/messages_fr.js +23 -0
- data/public/javascripts/jquery-validate/localization/messages_he.js +23 -0
- data/public/javascripts/jquery-validate/localization/messages_hu.js +20 -0
- data/public/javascripts/jquery-validate/localization/messages_it.js +23 -0
- data/public/javascripts/jquery-validate/localization/messages_kk.js +23 -0
- data/public/javascripts/jquery-validate/localization/messages_lt.js +23 -0
- data/public/javascripts/jquery-validate/localization/messages_lv.js +23 -0
- data/public/javascripts/jquery-validate/localization/messages_nl.js +23 -0
- data/public/javascripts/jquery-validate/localization/messages_no.js +23 -0
- data/public/javascripts/jquery-validate/localization/messages_pl.js +23 -0
- data/public/javascripts/jquery-validate/localization/messages_ptbr.js +23 -0
- data/public/javascripts/jquery-validate/localization/messages_ptpt.js +23 -0
- data/public/javascripts/jquery-validate/localization/messages_ro.js +23 -0
- data/public/javascripts/jquery-validate/localization/messages_ru.js +23 -0
- data/public/javascripts/jquery-validate/localization/messages_se.js +21 -0
- data/public/javascripts/jquery-validate/localization/messages_sk.js +20 -0
- data/public/javascripts/jquery-validate/localization/messages_tr.js +23 -0
- data/public/javascripts/jquery-validate/localization/messages_tw.js +23 -0
- data/public/javascripts/jquery-validate/localization/messages_ua.js +23 -0
- data/public/javascripts/jquery-validate/localization/methods_de.js +12 -0
- data/public/javascripts/jquery-validate/localization/methods_nl.js +9 -0
- data/public/javascripts/jquery-validate/localization/methods_pt.js +9 -0
- data/public/javascripts/jquery-validate/todo +172 -0
- data/public/javascripts/jquery.cookie.js +96 -0
- data/public/javascripts/jquery.filedrop.js +253 -0
- data/public/javascripts/jquery.hotkeys.js +99 -0
- data/public/javascripts/jquery.js +6240 -0
- data/public/javascripts/jquery.jstree.js +3510 -0
- data/public/javascripts/jquery.uploadify.js +26 -0
- data/public/javascripts/jquery.validate.js +1147 -0
- data/public/javascripts/sitemap_jstree.js +329 -0
- data/public/javascripts/swfobject.js +4 -0
- data/public/jstree/_demo/_dump.sql +20 -0
- data/public/jstree/_demo/_inc/__mysql_errors.log +0 -0
- data/public/jstree/_demo/_inc/class._database.php +146 -0
- data/public/jstree/_demo/_inc/class._database_i.php +152 -0
- data/public/jstree/_demo/_inc/class.tree.php +602 -0
- data/public/jstree/_demo/_install.txt +6 -0
- data/public/jstree/_demo/config.php +14 -0
- data/public/jstree/_demo/index.html +262 -0
- data/public/jstree/_demo/server.php +69 -0
- data/public/jstree/_docs/!style.css +37 -0
- data/public/jstree/_docs/_drive.png +0 -0
- data/public/jstree/_docs/_html_data.html +2 -0
- data/public/jstree/_docs/_json_data.json +4 -0
- data/public/jstree/_docs/_search_data.json +6 -0
- data/public/jstree/_docs/_search_result.json +1 -0
- data/public/jstree/_docs/_xml_flat.xml +12 -0
- data/public/jstree/_docs/_xml_nest.xml +18 -0
- data/public/jstree/_docs/checkbox.html +148 -0
- data/public/jstree/_docs/contextmenu.html +120 -0
- data/public/jstree/_docs/cookies.html +96 -0
- data/public/jstree/_docs/core.html +622 -0
- data/public/jstree/_docs/crrm.html +315 -0
- data/public/jstree/_docs/dnd.html +197 -0
- data/public/jstree/_docs/hotkeys.html +81 -0
- data/public/jstree/_docs/html_data.html +174 -0
- data/public/jstree/_docs/index.html +75 -0
- data/public/jstree/_docs/json_data.html +240 -0
- data/public/jstree/_docs/languages.html +138 -0
- data/public/jstree/_docs/search.html +114 -0
- data/public/jstree/_docs/sort.html +84 -0
- data/public/jstree/_docs/syntax/!script.js +2232 -0
- data/public/jstree/_docs/syntax/!style.css +511 -0
- data/public/jstree/_docs/syntax/clipboard.swf +0 -0
- data/public/jstree/_docs/syntax/help.png +0 -0
- data/public/jstree/_docs/syntax/magnifier.png +0 -0
- data/public/jstree/_docs/syntax/page_white_code.png +0 -0
- data/public/jstree/_docs/syntax/page_white_copy.png +0 -0
- data/public/jstree/_docs/syntax/printer.png +0 -0
- data/public/jstree/_docs/syntax/wrapping.png +0 -0
- data/public/jstree/_docs/themeroller.html +98 -0
- data/public/jstree/_docs/themes.html +126 -0
- data/public/jstree/_docs/types.html +173 -0
- data/public/jstree/_docs/ui.html +188 -0
- data/public/jstree/_docs/unique.html +70 -0
- data/public/jstree/_docs/xml_data.html +214 -0
- data/public/jstree/_lib/jquery.cookie.js +96 -0
- data/public/jstree/_lib/jquery.hotkeys.js +99 -0
- data/public/jstree/_lib/jquery.js +6240 -0
- data/public/jstree/jquery.jstree.js +3510 -0
- data/public/jstree/jstree.html +237 -0
- data/public/jstree/themes/apple/bg.jpg +0 -0
- data/public/jstree/themes/apple/d.png +0 -0
- data/public/jstree/themes/apple/dot_for_ie.gif +0 -0
- data/public/jstree/themes/apple/style.css +60 -0
- data/public/jstree/themes/apple/throbber.gif +0 -0
- data/public/jstree/themes/classic/d.png +0 -0
- data/public/jstree/themes/classic/dot_for_ie.gif +0 -0
- data/public/jstree/themes/classic/style.css +59 -0
- data/public/jstree/themes/classic/throbber.gif +0 -0
- data/public/jstree/themes/default/d.gif +0 -0
- data/public/jstree/themes/default/d.png +0 -0
- data/public/jstree/themes/default/style.css +73 -0
- data/public/jstree/themes/default/throbber.gif +0 -0
- data/public/jstree/themes/default-rtl/d.gif +0 -0
- data/public/jstree/themes/default-rtl/d.png +0 -0
- data/public/jstree/themes/default-rtl/dots.gif +0 -0
- data/public/jstree/themes/default-rtl/style.css +83 -0
- data/public/jstree/themes/default-rtl/throbber.gif +0 -0
- data/public/stylesheets/sass/dreamy.sass +21 -56
- data/public/stylesheets/sass/menu.sass +43 -9
- data/public/stylesheets/sass/uploadify.sass +52 -0
- data/public/stylesheets/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
- data/public/stylesheets/ui-lightness/jquery-ui-1.8.4.custom.css +549 -0
- data/wheels.gemspec +187 -15
- metadata +188 -16
@@ -0,0 +1,315 @@
|
|
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>jsTree v.1.0 - CRRM plugin</h1>
|
21
|
+
<h2>Description</h2>
|
22
|
+
<div id="description">
|
23
|
+
<p>The <code>CRRM</code> plugin handles creating, renaming, removing and moving nodes by the user.</p>
|
24
|
+
</div>
|
25
|
+
|
26
|
+
<h2 id="configuration">Configuration</h2>
|
27
|
+
<div class="panel configuration">
|
28
|
+
<h3>input_width_limit</h3>
|
29
|
+
<p class="meta">A number. Default is <code>200</code>.</p>
|
30
|
+
<p>When renaming (or creating) nodes the input for the text will autosize - this number sets the maximum size for the input.</p>
|
31
|
+
|
32
|
+
<h3>move</h3>
|
33
|
+
<p class="meta">An object, containing various settings - see below for more.</p>
|
34
|
+
|
35
|
+
<h3>move.always_copy</h3>
|
36
|
+
<p class="meta"><code>true</code>, <code>false</code> or <code>"multitree"</code>. Default is <code>false</code>.</p>
|
37
|
+
<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>
|
38
|
+
|
39
|
+
<h3>move.open_onmove</h3>
|
40
|
+
<p class="meta">A Boolean. Default is <code>true</code>.</p>
|
41
|
+
<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>
|
42
|
+
|
43
|
+
<h3>move.default_position</h3>
|
44
|
+
<p class="meta">A string or a number. Default is <code>"last"</code>.</p>
|
45
|
+
<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>
|
46
|
+
|
47
|
+
<h3>move.check_move</h3>
|
48
|
+
<p class="meta">A function. Default is <code>function (m) { return true; }</code>.</p>
|
49
|
+
<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>
|
50
|
+
|
51
|
+
</div>
|
52
|
+
|
53
|
+
<h2 id="demos">Demos</h2>
|
54
|
+
<div class="panel">
|
55
|
+
|
56
|
+
<h3>Creating nodes</h3>
|
57
|
+
<input type="button" class="button" value="create_1" id="create_1" style="float:left;" />
|
58
|
+
<input type="button" class="button" value="create_2" id="create_2" style="float:left;" />
|
59
|
+
<input type="button" class="button" value="create_3" id="create_3" style="" />
|
60
|
+
<div id="demo1" class="demo">
|
61
|
+
<ul>
|
62
|
+
<li id="phtml_1">
|
63
|
+
<a href="#">Root node 1</a>
|
64
|
+
<ul>
|
65
|
+
<li id="phtml_2">
|
66
|
+
<a href="#">Child node 1</a>
|
67
|
+
</li>
|
68
|
+
<li id="phtml_3">
|
69
|
+
<a href="#">Child node 2</a>
|
70
|
+
</li>
|
71
|
+
</ul>
|
72
|
+
</li>
|
73
|
+
<li id="phtml_4">
|
74
|
+
<a href="#">Root node 2</a>
|
75
|
+
</li>
|
76
|
+
</ul>
|
77
|
+
</div>
|
78
|
+
<script type="text/javascript" class="source">
|
79
|
+
$(function () {
|
80
|
+
$("#create_1").click(function () {
|
81
|
+
$("#demo1").jstree("create");
|
82
|
+
});
|
83
|
+
$("#create_2").click(function () {
|
84
|
+
$("#demo1").jstree("create","#phtml_1","first","Enter a new name");
|
85
|
+
});
|
86
|
+
$("#create_3").click(function () {
|
87
|
+
$("#demo1").jstree("create",-1,false,"No rename",false,true);
|
88
|
+
});
|
89
|
+
$("#demo1").jstree({
|
90
|
+
"ui" : {
|
91
|
+
"initially_select" : [ "phtml_2" ]
|
92
|
+
},
|
93
|
+
"core" : { "initially_open" : [ "phtml_1" ] },
|
94
|
+
"plugins" : [ "themes", "html_data", "ui", "crrm" ]
|
95
|
+
});
|
96
|
+
});
|
97
|
+
</script>
|
98
|
+
|
99
|
+
<h3>Removing nodes</h3>
|
100
|
+
<input type="button" class="button" value="remove_1" id="remove_1" style="float:left;" />
|
101
|
+
<input type="button" class="button" value="remove_2" id="remove_2" style="" />
|
102
|
+
<div id="demo2" class="demo">
|
103
|
+
<ul>
|
104
|
+
<li id="rhtml_1">
|
105
|
+
<a href="#">Root node 1</a>
|
106
|
+
<ul>
|
107
|
+
<li id="rhtml_2">
|
108
|
+
<a href="#">Child node 1</a>
|
109
|
+
</li>
|
110
|
+
<li id="rhtml_3">
|
111
|
+
<a href="#">Child node 2</a>
|
112
|
+
</li>
|
113
|
+
</ul>
|
114
|
+
</li>
|
115
|
+
<li id="rhtml_4">
|
116
|
+
<a href="#">Root node 2</a>
|
117
|
+
</li>
|
118
|
+
</ul>
|
119
|
+
</div>
|
120
|
+
<script type="text/javascript" class="source">
|
121
|
+
$(function () {
|
122
|
+
$("#remove_1").click(function () {
|
123
|
+
$("#demo2").jstree("remove");
|
124
|
+
});
|
125
|
+
$("#remove_2").click(function () {
|
126
|
+
$("#demo2").jstree("remove","#rhtml_1");
|
127
|
+
});
|
128
|
+
$("#demo2").jstree({
|
129
|
+
"ui" : {
|
130
|
+
"initially_select" : [ "rhtml_2" ]
|
131
|
+
},
|
132
|
+
"core" : { "initially_open" : [ "rhtml_1" ] },
|
133
|
+
"plugins" : [ "themes", "html_data", "ui", "crrm" ]
|
134
|
+
});
|
135
|
+
});
|
136
|
+
</script>
|
137
|
+
|
138
|
+
<h3>Renaming nodes</h3>
|
139
|
+
<input type="button" class="button" value="rename_1" id="rename_1" style="float:left;" />
|
140
|
+
<input type="button" class="button" value="rename_2" id="rename_2" style="" />
|
141
|
+
<div id="demo3" class="demo">
|
142
|
+
<ul>
|
143
|
+
<li id="shtml_1">
|
144
|
+
<a href="#">Root node 1</a>
|
145
|
+
<ul>
|
146
|
+
<li id="shtml_2">
|
147
|
+
<a href="#">Child node 1</a>
|
148
|
+
</li>
|
149
|
+
<li id="shtml_3">
|
150
|
+
<a href="#">Child node 2</a>
|
151
|
+
</li>
|
152
|
+
</ul>
|
153
|
+
</li>
|
154
|
+
<li id="shtml_4">
|
155
|
+
<a href="#">Root node 2</a>
|
156
|
+
</li>
|
157
|
+
</ul>
|
158
|
+
</div>
|
159
|
+
<script type="text/javascript" class="source">
|
160
|
+
$(function () {
|
161
|
+
$("#rename_1").click(function () {
|
162
|
+
$("#demo3").jstree("rename");
|
163
|
+
});
|
164
|
+
$("#rename_2").click(function () {
|
165
|
+
$("#demo3").jstree("rename","#shtml_1");
|
166
|
+
});
|
167
|
+
$("#demo3").jstree({
|
168
|
+
"ui" : {
|
169
|
+
"initially_select" : [ "shtml_2" ]
|
170
|
+
},
|
171
|
+
"core" : { "initially_open" : [ "shtml_1" ] },
|
172
|
+
"plugins" : [ "themes", "html_data", "ui", "crrm" ]
|
173
|
+
});
|
174
|
+
});
|
175
|
+
</script>
|
176
|
+
|
177
|
+
<h3>Moving nodes</h3>
|
178
|
+
<p><strong>move_1</strong> uses the default position - <code>"first"</code></p>
|
179
|
+
<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>
|
180
|
+
<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>
|
181
|
+
<input type="button" class="button" value="move_1" id="move_1" style="float:left;" />
|
182
|
+
<input type="button" class="button" value="move_2" id="move_2" style="float:left;" />
|
183
|
+
<input type="button" class="button" value="move_3" id="move_3" style="" />
|
184
|
+
<div id="demo4" class="demo">
|
185
|
+
<ul>
|
186
|
+
<li id="thtml_1">
|
187
|
+
<a href="#">Root node 1</a>
|
188
|
+
<ul>
|
189
|
+
<li id="thtml_2">
|
190
|
+
<a href="#">Child node 1</a>
|
191
|
+
</li>
|
192
|
+
<li id="thtml_3">
|
193
|
+
<a href="#">Child node 2</a>
|
194
|
+
</li>
|
195
|
+
</ul>
|
196
|
+
</li>
|
197
|
+
<li id="thtml_4">
|
198
|
+
<a href="#">Root node 2</a>
|
199
|
+
</li>
|
200
|
+
</ul>
|
201
|
+
</div>
|
202
|
+
<script type="text/javascript" class="source">
|
203
|
+
$(function () {
|
204
|
+
$("#move_1").click(function () {
|
205
|
+
$("#demo4").jstree("move_node","#thtml_4","#thtml_1");
|
206
|
+
});
|
207
|
+
$("#move_2").click(function () {
|
208
|
+
$("#demo4").jstree("move_node","#thtml_4","#thtml_1", "before");
|
209
|
+
});
|
210
|
+
$("#move_3").click(function () {
|
211
|
+
$("#demo4").jstree("move_node","#thtml_1","#thtml_4");
|
212
|
+
});
|
213
|
+
$("#demo4").jstree({
|
214
|
+
"crrm" : {
|
215
|
+
"move" : {
|
216
|
+
"default_position" : "first",
|
217
|
+
"check_move" : function (m) { return (m.o[0].id === "thtml_1") ? false : true; }
|
218
|
+
}
|
219
|
+
},
|
220
|
+
"ui" : {
|
221
|
+
"initially_select" : [ "thtml_2" ]
|
222
|
+
},
|
223
|
+
"core" : { "initially_open" : [ "thtml_1" ] },
|
224
|
+
"plugins" : [ "themes", "html_data", "ui", "crrm" ]
|
225
|
+
});
|
226
|
+
});
|
227
|
+
</script>
|
228
|
+
|
229
|
+
</div>
|
230
|
+
|
231
|
+
<h2 id="api">API</h2>
|
232
|
+
<div class="panel api">
|
233
|
+
|
234
|
+
<h3 id="_show_input">._show_input ( node , callback )</h3>
|
235
|
+
<p>Renders an input field in a node. Used only internally.</p>
|
236
|
+
|
237
|
+
<h3 id="rename">.rename ( node )</h3>
|
238
|
+
<p>Sets a node in rename mode and when the user has entered changes, an event is triggered.</p>
|
239
|
+
<ul class="arguments">
|
240
|
+
<li>
|
241
|
+
<code class="tp">mixed</code> <strong>node</strong>
|
242
|
+
<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>
|
243
|
+
</li>
|
244
|
+
</ul>
|
245
|
+
|
246
|
+
<h3 id="create">.create ( node , position , js , callback , skip_rename )</h3>
|
247
|
+
<p>Creates a new node. Triggers an event.</p>
|
248
|
+
<ul class="arguments">
|
249
|
+
<li>
|
250
|
+
<code class="tp">mixed</code> <strong>node</strong>
|
251
|
+
<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>
|
252
|
+
</li>
|
253
|
+
<li>
|
254
|
+
<code class="tp">mixed</code> <strong>position</strong>
|
255
|
+
<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>
|
256
|
+
</li>
|
257
|
+
<li>
|
258
|
+
<code class="tp">object</code> <strong>js</strong>
|
259
|
+
<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>
|
260
|
+
</li>
|
261
|
+
<li>
|
262
|
+
<code class="tp">function</code> <strong>callback</strong>
|
263
|
+
<p>A function to be executed once the node is created. You'd be better off waiting for the event.</p>
|
264
|
+
</li>
|
265
|
+
<li>
|
266
|
+
<code class="tp">bool</code> <strong>skip_rename</strong>
|
267
|
+
<p>Skips the user input step. The node is created with the data you have supplied.</p>
|
268
|
+
</li>
|
269
|
+
</ul>
|
270
|
+
|
271
|
+
<h3 id="remove">.remove ( node )</h3>
|
272
|
+
<p>Removes a node. Triggers an event.</p>
|
273
|
+
<ul class="arguments">
|
274
|
+
<li>
|
275
|
+
<code class="tp">mixed</code> <strong>node</strong>
|
276
|
+
<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>
|
277
|
+
</li>
|
278
|
+
</ul>
|
279
|
+
|
280
|
+
<div style="height:1px; visibility:hidden; overflow:hidden;"><span id="check_move"> </span></div>
|
281
|
+
<h3 id="move_node">.check_move ( ), .move_node ( )</h3>
|
282
|
+
<p>Both functions are overwritten from the <a href="core.html#check_move">core</a> in order to implement the new functionality.</p>
|
283
|
+
|
284
|
+
<h3 id="cut">.cut ( node )</h3>
|
285
|
+
<p>Cuts a node (prepares it for pasting).</p>
|
286
|
+
<ul class="arguments">
|
287
|
+
<li>
|
288
|
+
<code class="tp">mixed</code> <strong>node</strong>
|
289
|
+
<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>
|
290
|
+
</li>
|
291
|
+
</ul>
|
292
|
+
|
293
|
+
<h3 id="copy">.copy ( node )</h3>
|
294
|
+
<p>Copies a node (prepares it for pasting).</p>
|
295
|
+
<ul class="arguments">
|
296
|
+
<li>
|
297
|
+
<code class="tp">mixed</code> <strong>node</strong>
|
298
|
+
<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>
|
299
|
+
</li>
|
300
|
+
</ul>
|
301
|
+
|
302
|
+
<h3 id="paste">.paste ( node )</h3>
|
303
|
+
<p>Pastes copied or cut nodes inside a node.</p>
|
304
|
+
<ul class="arguments">
|
305
|
+
<li>
|
306
|
+
<code class="tp">mixed</code> <strong>node</strong>
|
307
|
+
<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>
|
308
|
+
</li>
|
309
|
+
</ul>
|
310
|
+
|
311
|
+
</div>
|
312
|
+
|
313
|
+
</div>
|
314
|
+
</body>
|
315
|
+
</html>
|
@@ -0,0 +1,197 @@
|
|
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>jsTree v.1.0 - drag'n'drop plugin</h1>
|
21
|
+
<h2>Description</h2>
|
22
|
+
<div id="description">
|
23
|
+
<p>The <code>dnd</code> plugin enables drag'n'drop support for jstree, also using foreign nodes and drop targets.</p>
|
24
|
+
</div>
|
25
|
+
|
26
|
+
<h2 id="configuration">Configuration</h2>
|
27
|
+
<div class="panel configuration">
|
28
|
+
|
29
|
+
<h3>copy_modifier</h3>
|
30
|
+
<p class="meta">A string. Default is <code>"ctrl"</code>.</p>
|
31
|
+
<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>
|
32
|
+
|
33
|
+
<h3>check_timeout</h3>
|
34
|
+
<p class="meta">A number. Default is <code>200</code>.</p>
|
35
|
+
<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>
|
36
|
+
|
37
|
+
<h3>open_timeout</h3>
|
38
|
+
<p class="meta">A number. Default is <code>500</code>.</p>
|
39
|
+
<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>
|
40
|
+
|
41
|
+
<h3>drop_target</h3>
|
42
|
+
<p class="meta">A string (jQuery selector) (or <code>false</code>). Default is <code>".jstree-drop"</code>.</p>
|
43
|
+
<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>
|
44
|
+
|
45
|
+
<h3>drop_check</h3>
|
46
|
+
<p class="meta">A function. Default is <code>function (data) { return true; }</code>.</p>
|
47
|
+
<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>
|
48
|
+
<p style="margin-left:2em;"><code>data.o</code> - the object being dragged</p>
|
49
|
+
<p style="margin-left:2em;"><code>data.r</code> - the drop target</p>
|
50
|
+
|
51
|
+
<h3>drop_finish</h3>
|
52
|
+
<p class="meta">A function. Default is <code>$.noop</code>.</p>
|
53
|
+
<p>Gets executed after a valid drop, you get one parameter, which is as follows:</p>
|
54
|
+
<p style="margin-left:2em;"><code>data.o</code> - the object being dragged</p>
|
55
|
+
<p style="margin-left:2em;"><code>data.r</code> - the drop target</p>
|
56
|
+
|
57
|
+
<h3>drag_target</h3>
|
58
|
+
<p class="meta">A string (jQuery selector) (or <code>false</code>). Default is <code>".jstree-draggable"</code>.</p>
|
59
|
+
<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>
|
60
|
+
|
61
|
+
<h3>drag_check</h3>
|
62
|
+
<p class="meta">A function. Default is <code>function (data) { return { after : false, before : false, inside : true }; }</code>.</p>
|
63
|
+
<p>Return a boolean for each position. The <code>data</code> parameter is as follows:</p>
|
64
|
+
<p style="margin-left:2em;"><code>data.o</code> - the foreign object being dragged</p>
|
65
|
+
<p style="margin-left:2em;"><code>data.r</code> - the hovered node</p>
|
66
|
+
|
67
|
+
<h3>drag_finish</h3>
|
68
|
+
<p class="meta">A function. Default is <code>$.noop</code>.</p>
|
69
|
+
<p>Gets executed after a dropping a foreign element on a tree item, you get one parameter, which is as follows:</p>
|
70
|
+
<p style="margin-left:2em;"><code>data.o</code> - the foreign object being dragged</p>
|
71
|
+
<p style="margin-left:2em;"><code>data.r</code> - the target node</p>
|
72
|
+
|
73
|
+
|
74
|
+
</div>
|
75
|
+
|
76
|
+
<h2 id="demos">Demos</h2>
|
77
|
+
<div class="panel">
|
78
|
+
<h3>Using the dnd plugin</h3>
|
79
|
+
<p>Drag stuff around!</p>
|
80
|
+
<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>
|
81
|
+
<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>
|
82
|
+
<div id="demo1" class="demo">
|
83
|
+
<ul>
|
84
|
+
<li id="phtml_1">
|
85
|
+
<a href="#">Root node 1</a>
|
86
|
+
<ul>
|
87
|
+
<li id="phtml_2">
|
88
|
+
<a href="#">Child node 1</a>
|
89
|
+
</li>
|
90
|
+
<li id="phtml_3">
|
91
|
+
<a href="#">Child node 2</a>
|
92
|
+
</li>
|
93
|
+
</ul>
|
94
|
+
</li>
|
95
|
+
<li id="phtml_4">
|
96
|
+
<a href="#">Root node 2</a>
|
97
|
+
</li>
|
98
|
+
</ul>
|
99
|
+
</div>
|
100
|
+
<script type="text/javascript" class="source">
|
101
|
+
$(function () {
|
102
|
+
$("#demo1").jstree({
|
103
|
+
"dnd" : {
|
104
|
+
"drop_finish" : function () {
|
105
|
+
alert("DROP");
|
106
|
+
},
|
107
|
+
"drag_check" : function (data) {
|
108
|
+
if(data.r.attr("id") == "phtml_1") {
|
109
|
+
return false;
|
110
|
+
}
|
111
|
+
return {
|
112
|
+
after : false,
|
113
|
+
before : false,
|
114
|
+
inside : true
|
115
|
+
};
|
116
|
+
},
|
117
|
+
"drag_finish" : function () {
|
118
|
+
alert("DRAG OK");
|
119
|
+
}
|
120
|
+
},
|
121
|
+
"plugins" : [ "themes", "html_data", "dnd" ]
|
122
|
+
});
|
123
|
+
});
|
124
|
+
</script>
|
125
|
+
|
126
|
+
<h3>Reorder only demo</h3>
|
127
|
+
<div id="demo2" class="demo">
|
128
|
+
<ul>
|
129
|
+
<li id="rhtml_1">
|
130
|
+
<a href="#">Root node 1</a>
|
131
|
+
<ul>
|
132
|
+
<li id="rhtml_2">
|
133
|
+
<a href="#">Child node 1</a>
|
134
|
+
</li>
|
135
|
+
<li id="rhtml_3">
|
136
|
+
<a href="#">Child node 2</a>
|
137
|
+
</li>
|
138
|
+
<li id="rhtml_4">
|
139
|
+
<a href="#">Child node 3</a>
|
140
|
+
</li>
|
141
|
+
<li id="rhtml_5">
|
142
|
+
<a href="#">Child node 4</a>
|
143
|
+
</li>
|
144
|
+
</ul>
|
145
|
+
</li>
|
146
|
+
<li id="rhtml_6">
|
147
|
+
<a href="#">Root node 2</a>
|
148
|
+
</li>
|
149
|
+
<li id="rhtml_7">
|
150
|
+
<a href="#">Root node 3</a>
|
151
|
+
</li>
|
152
|
+
</ul>
|
153
|
+
</div>
|
154
|
+
<script type="text/javascript" class="source">
|
155
|
+
$(function () {
|
156
|
+
$("#demo2").jstree({
|
157
|
+
"crrm" : {
|
158
|
+
"move" : {
|
159
|
+
"check_move" : function (m) {
|
160
|
+
var p = this._get_parent(m.o);
|
161
|
+
if(!p) return false;
|
162
|
+
p = p == -1 ? this.get_container() : p;
|
163
|
+
if(p === m.np) return true;
|
164
|
+
if(p[0] && m.np[0] && p[0] === m.np[0]) return true;
|
165
|
+
return false;
|
166
|
+
}
|
167
|
+
}
|
168
|
+
},
|
169
|
+
"dnd" : {
|
170
|
+
"drop_target" : false,
|
171
|
+
"drag_target" : false
|
172
|
+
},
|
173
|
+
"plugins" : [ "themes", "html_data", "crrm", "dnd" ]
|
174
|
+
});
|
175
|
+
});
|
176
|
+
</script>
|
177
|
+
|
178
|
+
</div>
|
179
|
+
|
180
|
+
<h2 id="api">API</h2>
|
181
|
+
<div class="panel api">
|
182
|
+
|
183
|
+
<div style="height:1px; visibility:hidden;">
|
184
|
+
<span id="dnd_show"> </span>
|
185
|
+
<span id="dnd_open"> </span>
|
186
|
+
<span id="dnd_finish"> </span>
|
187
|
+
<span id="dnd_enter"> </span>
|
188
|
+
<span id="start_drag"> </span>
|
189
|
+
</div>
|
190
|
+
<h3 id="dnd_prepare">.dnd_prepare ( ), .dnd_show ( ), .dnd_open ( ), .dnd_finish ( ), .dnd_enter ( ), .start_drag ( )</h3>
|
191
|
+
<p>All those functions are used internally only. If you want more information - examine the source code.</p>
|
192
|
+
|
193
|
+
</div>
|
194
|
+
|
195
|
+
</div>
|
196
|
+
</body>
|
197
|
+
</html>
|
@@ -0,0 +1,81 @@
|
|
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 - hotkeys 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>jsTree v.1.0 - hotkeys plugin</h1>
|
21
|
+
<h2>Description</h2>
|
22
|
+
<div id="description">
|
23
|
+
<p>The <code>hotkeys</code> plugin enables keyboard navigation and shortcuts. Depends on the <a href="http://github.com/jeresig/jquery.hotkeys/">jquery.hotkeys plugin</a></p>
|
24
|
+
</div>
|
25
|
+
|
26
|
+
<h2 id="configuration">Configuration</h2>
|
27
|
+
<div class="panel configuration">
|
28
|
+
<p>Expects an object:<br />each key is the keyboard shortcut (for possible values check <a href="http://github.com/jeresig/jquery.hotkeys/">the hotkeys plugin</a>)<br />each values is a function executed in the instance's context, the return value is used as a return value for the event.</p>
|
29
|
+
<p>Simple example:</p>
|
30
|
+
<p><code>"del" : function () { this.remove(); }</code></p>
|
31
|
+
|
32
|
+
</div>
|
33
|
+
|
34
|
+
<h2 id="demos">Demos</h2>
|
35
|
+
<div class="panel">
|
36
|
+
|
37
|
+
<h3>Using the hotkeys plugin</h3>
|
38
|
+
<p>Try pressing <code>up</code>/<code>down</code>/<code>left</code>/<code>right</code>/<code>space</code>/<code>f2</code>/<code>del</code>.</p>
|
39
|
+
<div id="demo1" class="demo">
|
40
|
+
<ul>
|
41
|
+
<li id="phtml_1">
|
42
|
+
<a href="#">Root node 1</a>
|
43
|
+
<ul>
|
44
|
+
<li id="phtml_2">
|
45
|
+
<a href="#">Child node 1</a>
|
46
|
+
</li>
|
47
|
+
<li id="phtml_3">
|
48
|
+
<a href="#">Child node 2</a>
|
49
|
+
</li>
|
50
|
+
</ul>
|
51
|
+
</li>
|
52
|
+
<li id="phtml_4">
|
53
|
+
<a href="#">Root node 2</a>
|
54
|
+
</li>
|
55
|
+
</ul>
|
56
|
+
</div>
|
57
|
+
<script type="text/javascript" class="source">
|
58
|
+
$(function () {
|
59
|
+
$("#demo1").jstree({
|
60
|
+
"core" : { "initially_open" : [ "phtml_1" ] },
|
61
|
+
"plugins" : ["themes","html_data","ui","crrm","hotkeys"]
|
62
|
+
});
|
63
|
+
});
|
64
|
+
</script>
|
65
|
+
|
66
|
+
</div>
|
67
|
+
|
68
|
+
<h2 id="api">API</h2>
|
69
|
+
<div class="panel api">
|
70
|
+
|
71
|
+
<h3 id="enable_hotkeys">.enable_hotkeys ( )</h3>
|
72
|
+
<p>Enable shortcuts on the instance (enabled by default).</p>
|
73
|
+
|
74
|
+
<h3 id="disable_hotkeys">.disable_hotkeys ( )</h3>
|
75
|
+
<p>Disable shortcuts on the instance.</p>
|
76
|
+
|
77
|
+
</div>
|
78
|
+
|
79
|
+
</div>
|
80
|
+
</body>
|
81
|
+
</html>
|