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,262 @@
|
|
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 - full featured demo</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
|
+
<style type="text/css">
|
14
|
+
html, body { margin:0; padding:0; }
|
15
|
+
body, td, th, pre, code, select, option, input, textarea { font-family:verdana,arial,sans-serif; font-size:10px; }
|
16
|
+
.demo, .demo input, .jstree-dnd-helper, #vakata-contextmenu { font-size:10px; font-family:Verdana; }
|
17
|
+
#container { width:780px; margin:10px auto; overflow:hidden; position:relative; }
|
18
|
+
#demo { width:auto; height:400px; overflow:auto; border:1px solid gray; }
|
19
|
+
|
20
|
+
#text { margin-top:1px; }
|
21
|
+
|
22
|
+
#alog { font-size:9px !important; margin:5px; border:1px solid silver; }
|
23
|
+
</style>
|
24
|
+
</head>
|
25
|
+
<body>
|
26
|
+
<div id="container">
|
27
|
+
|
28
|
+
<div id="mmenu" style="height:30px; overflow:auto;">
|
29
|
+
<input type="button" id="add_folder" value="add folder" style="display:block; float:left;"/>
|
30
|
+
<input type="button" id="add_default" value="add file" style="display:block; float:left;"/>
|
31
|
+
<input type="button" id="rename" value="rename" style="display:block; float:left;"/>
|
32
|
+
<input type="button" id="remove" value="remove" style="display:block; float:left;"/>
|
33
|
+
<input type="button" id="cut" value="cut" style="display:block; float:left;"/>
|
34
|
+
<input type="button" id="copy" value="copy" style="display:block; float:left;"/>
|
35
|
+
<input type="button" id="paste" value="paste" style="display:block; float:left;"/>
|
36
|
+
<input type="button" id="clear_search" value="clear" style="display:block; float:right;"/>
|
37
|
+
<input type="button" id="search" value="search" style="display:block; float:right;"/>
|
38
|
+
<input type="text" id="text" value="" style="display:block; float:right;" />
|
39
|
+
</div>
|
40
|
+
|
41
|
+
<!-- the tree container (notice NOT an UL node) -->
|
42
|
+
<div id="demo" class="demo"></div>
|
43
|
+
<!-- JavaScript neccessary for the tree -->
|
44
|
+
<script type="text/javascript">
|
45
|
+
$(function () {
|
46
|
+
// Settings up the tree - using $(selector).jstree(options);
|
47
|
+
// All those configuration options are documented in the _docs folder
|
48
|
+
$("#demo")
|
49
|
+
.jstree({
|
50
|
+
// the list of plugins to include
|
51
|
+
"plugins" : [ "themes", "json_data", "ui", "crrm", "cookies", "dnd", "search", "types", "hotkeys", "contextmenu" ],
|
52
|
+
// Plugin configuration
|
53
|
+
|
54
|
+
// I usually configure the plugin that handles the data first - in this case JSON as it is most common
|
55
|
+
"json_data" : {
|
56
|
+
// I chose an ajax enabled tree - again - as this is most common, and maybe a bit more complex
|
57
|
+
// All the options are the same as jQuery's except for `data` which CAN (not should) be a function
|
58
|
+
"ajax" : {
|
59
|
+
// the URL to fetch the data
|
60
|
+
"url" : "./server.php",
|
61
|
+
// this function is executed in the instance's scope (this refers to the tree instance)
|
62
|
+
// the parameter is the node being loaded (may be -1, 0, or undefined when loading the root nodes)
|
63
|
+
"data" : function (n) {
|
64
|
+
// the result is fed to the AJAX request `data` option
|
65
|
+
return {
|
66
|
+
"operation" : "get_children",
|
67
|
+
"id" : n.attr ? n.attr("id").replace("node_","") : 1
|
68
|
+
};
|
69
|
+
}
|
70
|
+
}
|
71
|
+
},
|
72
|
+
// Configuring the search plugin
|
73
|
+
"search" : {
|
74
|
+
// As this has been a common question - async search
|
75
|
+
// Same as above - the `ajax` config option is actually jQuery's object (only `data` can be a function)
|
76
|
+
"ajax" : {
|
77
|
+
"url" : "./server.php",
|
78
|
+
// You get the search string as a parameter
|
79
|
+
"data" : function (str) {
|
80
|
+
return {
|
81
|
+
"operation" : "search",
|
82
|
+
"search_str" : str
|
83
|
+
};
|
84
|
+
}
|
85
|
+
}
|
86
|
+
},
|
87
|
+
// Using types - most of the time this is an overkill
|
88
|
+
// Still meny people use them - here is how
|
89
|
+
"types" : {
|
90
|
+
// I set both options to -2, as I do not need depth and children count checking
|
91
|
+
// Those two checks may slow jstree a lot, so use only when needed
|
92
|
+
"max_depth" : -2,
|
93
|
+
"max_children" : -2,
|
94
|
+
// I want only `drive` nodes to be root nodes
|
95
|
+
// This will prevent moving or creating any other type as a root node
|
96
|
+
"valid_children" : [ "drive" ],
|
97
|
+
"types" : {
|
98
|
+
// The default type
|
99
|
+
"default" : {
|
100
|
+
// I want this type to have no children (so only leaf nodes)
|
101
|
+
// In my case - those are files
|
102
|
+
"valid_children" : "none",
|
103
|
+
// If we specify an icon for the default type it WILL OVERRIDE the theme icons
|
104
|
+
"icon" : {
|
105
|
+
"image" : "./file.png"
|
106
|
+
}
|
107
|
+
},
|
108
|
+
// The `folder` type
|
109
|
+
"folder" : {
|
110
|
+
// can have files and other folders inside of it, but NOT `drive` nodes
|
111
|
+
"valid_children" : [ "default", "folder" ],
|
112
|
+
"icon" : {
|
113
|
+
"image" : "./folder.png"
|
114
|
+
}
|
115
|
+
},
|
116
|
+
// The `drive` nodes
|
117
|
+
"drive" : {
|
118
|
+
// can have files and folders inside, but NOT other `drive` nodes
|
119
|
+
"valid_children" : [ "default", "folder" ],
|
120
|
+
"icon" : {
|
121
|
+
"image" : "./root.png"
|
122
|
+
},
|
123
|
+
// those options prevent the functions with the same name to be used on the `drive` type nodes
|
124
|
+
// internally the `before` event is used
|
125
|
+
"start_drag" : false,
|
126
|
+
"move_node" : false,
|
127
|
+
"delete_node" : false,
|
128
|
+
"remove" : false
|
129
|
+
}
|
130
|
+
}
|
131
|
+
},
|
132
|
+
// For UI & core - the nodes to initially select and open will be overwritten by the cookie plugin
|
133
|
+
|
134
|
+
// the UI plugin - it handles selecting/deselecting/hovering nodes
|
135
|
+
"ui" : {
|
136
|
+
// this makes the node with ID node_4 selected onload
|
137
|
+
"initially_select" : [ "node_4" ]
|
138
|
+
},
|
139
|
+
// the core plugin - not many options here
|
140
|
+
"core" : {
|
141
|
+
// just open those two nodes up
|
142
|
+
// as this is an AJAX enabled tree, both will be downloaded from the server
|
143
|
+
"initially_open" : [ "node_2" , "node_3" ]
|
144
|
+
}
|
145
|
+
})
|
146
|
+
.bind("create.jstree", function (e, data) {
|
147
|
+
$.post(
|
148
|
+
"./server.php",
|
149
|
+
{
|
150
|
+
"operation" : "create_node",
|
151
|
+
"id" : data.rslt.parent.attr("id").replace("node_",""),
|
152
|
+
"position" : data.rslt.position,
|
153
|
+
"title" : data.rslt.name,
|
154
|
+
"type" : data.rslt.obj.attr("rel")
|
155
|
+
},
|
156
|
+
function (r) {
|
157
|
+
if(r.status) {
|
158
|
+
$(data.rslt.obj).attr("id", "node_" + r.id);
|
159
|
+
}
|
160
|
+
else {
|
161
|
+
$.jstree.rollback(data.rlbk);
|
162
|
+
}
|
163
|
+
}
|
164
|
+
);
|
165
|
+
})
|
166
|
+
.bind("remove.jstree", function (e, data) {
|
167
|
+
data.rslt.obj.each(function () {
|
168
|
+
$.ajax({
|
169
|
+
async : false,
|
170
|
+
type: 'POST',
|
171
|
+
url: "./server.php",
|
172
|
+
data : {
|
173
|
+
"operation" : "remove_node",
|
174
|
+
"id" : this.id.replace("node_","")
|
175
|
+
},
|
176
|
+
success : function (r) {
|
177
|
+
if(!r.status) {
|
178
|
+
data.inst.refresh();
|
179
|
+
}
|
180
|
+
}
|
181
|
+
});
|
182
|
+
});
|
183
|
+
})
|
184
|
+
.bind("rename.jstree", function (e, data) {
|
185
|
+
$.post(
|
186
|
+
"./server.php",
|
187
|
+
{
|
188
|
+
"operation" : "rename_node",
|
189
|
+
"id" : data.rslt.obj.attr("id").replace("node_",""),
|
190
|
+
"title" : data.rslt.new_name
|
191
|
+
},
|
192
|
+
function (r) {
|
193
|
+
if(!r.status) {
|
194
|
+
$.jstree.rollback(data.rlbk);
|
195
|
+
}
|
196
|
+
}
|
197
|
+
);
|
198
|
+
})
|
199
|
+
.bind("move_node.jstree", function (e, data) {
|
200
|
+
data.rslt.o.each(function (i) {
|
201
|
+
$.ajax({
|
202
|
+
async : false,
|
203
|
+
type: 'POST',
|
204
|
+
url: "./server.php",
|
205
|
+
data : {
|
206
|
+
"operation" : "move_node",
|
207
|
+
"id" : $(this).attr("id").replace("node_",""),
|
208
|
+
"ref" : data.rslt.np.attr("id").replace("node_",""),
|
209
|
+
"position" : data.rslt.cp + i,
|
210
|
+
"title" : data.rslt.name,
|
211
|
+
"copy" : data.rslt.cy ? 1 : 0
|
212
|
+
},
|
213
|
+
success : function (r) {
|
214
|
+
if(!r.status) {
|
215
|
+
$.jstree.rollback(data.rlbk);
|
216
|
+
}
|
217
|
+
else {
|
218
|
+
$(data.rslt.oc).attr("id", "node_" + r.id);
|
219
|
+
if(data.rslt.cy && $(data.rslt.oc).children("UL").length) {
|
220
|
+
data.inst.refresh(data.inst._get_parent(data.rslt.oc));
|
221
|
+
}
|
222
|
+
}
|
223
|
+
$("#analyze").click();
|
224
|
+
}
|
225
|
+
});
|
226
|
+
});
|
227
|
+
});
|
228
|
+
});
|
229
|
+
</script>
|
230
|
+
<script type="text/javascript">
|
231
|
+
$(function () {
|
232
|
+
$("#mmenu input").click(function () {
|
233
|
+
switch(this.id) {
|
234
|
+
case "add_default":
|
235
|
+
case "add_folder":
|
236
|
+
$("#demo").jstree("create", null, "last", { "attr" : { "rel" : this.id.toString().replace("add_", "") } });
|
237
|
+
break;
|
238
|
+
case "search":
|
239
|
+
$("#demo").jstree("search", document.getElementById("text").value);
|
240
|
+
break;
|
241
|
+
case "text": break;
|
242
|
+
default:
|
243
|
+
$("#demo").jstree(this.id);
|
244
|
+
break;
|
245
|
+
}
|
246
|
+
});
|
247
|
+
});
|
248
|
+
</script>
|
249
|
+
|
250
|
+
<div style="position:absolute; right:30px; top:120px; width:220px; border:1px solid silver; min-height:160px;">
|
251
|
+
<input type="button" style='display:block; width:170px; height:24px; margin:5px auto;' value="reconstruct" onclick="$.get('./server.php?reconstruct', function () { $('#demo').jstree('refresh',-1); });" />
|
252
|
+
<input type="button" style='display:block; width:170px; height:24px; margin:5px auto;' id="analyze" value="analyze" onclick="$('#alog').load('./server.php?analyze');" />
|
253
|
+
<input type="button" style='display:block; width:170px; height:24px; margin:5px auto;' value="refresh" onclick="$('#demo').jstree('refresh',-1);" />
|
254
|
+
<div id='alog'></div>
|
255
|
+
</div>
|
256
|
+
|
257
|
+
<p style="margin:1em 2em 3em 2em; text-align:center; ">If you like the project - consider <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=paypal@vakata.com¤cy_code=USD&amount=&return=http://jstree.com/donation&item_name=Buy+me+a+coffee+for+jsTree">supporting jstree</a>.</p>
|
258
|
+
|
259
|
+
</div>
|
260
|
+
|
261
|
+
</body>
|
262
|
+
</html>
|
@@ -0,0 +1,69 @@
|
|
1
|
+
<?php
|
2
|
+
require_once("config.php");
|
3
|
+
$jstree = new json_tree();
|
4
|
+
|
5
|
+
//$jstree->_create_default();
|
6
|
+
//die();
|
7
|
+
|
8
|
+
if(isset($_GET["reconstruct"])) {
|
9
|
+
$jstree->_reconstruct();
|
10
|
+
die();
|
11
|
+
}
|
12
|
+
if(isset($_GET["analyze"])) {
|
13
|
+
echo $jstree->_analyze();
|
14
|
+
die();
|
15
|
+
}
|
16
|
+
|
17
|
+
if($_REQUEST["operation"] && strpos("_", $_REQUEST["operation"]) !== 0 && method_exists($jstree, $_REQUEST["operation"])) {
|
18
|
+
header("HTTP/1.0 200 OK");
|
19
|
+
header('Content-type: text/json; charset=utf-8');
|
20
|
+
header("Cache-Control: no-cache, must-revalidate");
|
21
|
+
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
22
|
+
header("Pragma: no-cache");
|
23
|
+
echo $jstree->{$_REQUEST["operation"]}($_REQUEST);
|
24
|
+
die();
|
25
|
+
}
|
26
|
+
header("HTTP/1.0 404 Not Found");
|
27
|
+
?>
|
28
|
+
|
29
|
+
<?php
|
30
|
+
/*
|
31
|
+
$jstree->_drop();
|
32
|
+
$jstree->create_node(array("id"=>0,"position"=>0));
|
33
|
+
$jstree->create_node(array("id"=>1,"position"=>0));
|
34
|
+
$jstree->create_node(array("id"=>1,"position"=>0));
|
35
|
+
$jstree->create_node(array("id"=>3,"position"=>0,"name"=>"Pesho"));
|
36
|
+
$jstree->move(3,2,0,true);
|
37
|
+
$jstree->_dump(true);
|
38
|
+
$jstree->_reconstruct();
|
39
|
+
echo $jstree->_analyze();
|
40
|
+
die();
|
41
|
+
|
42
|
+
$tree = new _tree_struct;
|
43
|
+
$tree->drop();
|
44
|
+
$tree->create(0, 0);
|
45
|
+
$tree->create(0, 0);
|
46
|
+
$tree->create(1, 0);
|
47
|
+
$tree->create(0, 3);
|
48
|
+
$tree->create(2, 3);
|
49
|
+
$tree->create(2, 0);
|
50
|
+
$tree->dump(true);
|
51
|
+
$tree->move(6,4,0);
|
52
|
+
$tree->move(1,0,0);
|
53
|
+
$tree->move(3,2,99,true);
|
54
|
+
$tree->move(7,1,0,true);
|
55
|
+
$tree->move(1,7,0);
|
56
|
+
$tree->move(1,0,1,true);
|
57
|
+
$tree->move(2, 0, 0, true);
|
58
|
+
$tree->move(13, 12, 2, true);
|
59
|
+
$tree->dump(true);
|
60
|
+
$tree->move(15, 16, 2, true);
|
61
|
+
$tree->dump(true);
|
62
|
+
$tree->move(4, 0, 0);
|
63
|
+
$tree->dump(true);
|
64
|
+
$tree->move(4, 0, 2);
|
65
|
+
$tree->dump(true);
|
66
|
+
echo $tree->analyze();
|
67
|
+
$tree->drop();
|
68
|
+
*/
|
69
|
+
?>
|
@@ -0,0 +1,37 @@
|
|
1
|
+
html, body { margin:0; padding:0; }
|
2
|
+
body, td, th, pre, code, select, option, input, textarea { font-family:"lucida grande",tahoma,verdana,arial,sans-serif; font-size:10pt; }
|
3
|
+
h1 { margin:0; padding:0.2em 0 0.5em 0; font-size:14pt; font-family:Georgia; /*text-shadow:1px 1px 2px gray;*/ border-bottom:2px solid; margin-bottom:0.5em; text-align:center; }
|
4
|
+
h2 { margin:0.5em 0 0.5em 0; padding:0.5em 0 0.5em 20px; font-size:12pt; font-family:Georgia; color:white; background:silver; text-shadow:1px 1px 2px gray; clear:both; -moz-border-radius:5px; }
|
5
|
+
h3 { margin:0; padding:0.5em 0 0.5em 0; font-size:11.5pt; font-family:Georgia; color:gray; clear:both; }
|
6
|
+
p { padding:0em 0 0.5em 0; margin:0; line-height:1.8em; }
|
7
|
+
p.meta { font-size:9pt; color:gray; margin-top:-5px; }
|
8
|
+
.arguments .tp, p code { color:green; padding:0 4px; font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size:13px; }
|
9
|
+
#description, .panel { margin:0 20px; }
|
10
|
+
#container { width:800px; margin:10px auto; overflow:hidden; }
|
11
|
+
.demo { width:255px; float:left; margin:0; border:1px solid gray; background:white; overflow:auto; }
|
12
|
+
.code { width:490px; float:right; margin:0 0 10px 0; border:1px solid gray; font-size:12px; }
|
13
|
+
pre { display:block; }
|
14
|
+
.code_f { border:1px solid gray; margin-bottom:1em; }
|
15
|
+
.syntaxhighlighter { margin:0 0 0 0 !important; padding:0 !important; line-height:18px; }
|
16
|
+
|
17
|
+
.log { padding:4px; border:1px solid gray; margin-bottom:1em; }
|
18
|
+
.button { display:block; margin-bottom:0.5em; }
|
19
|
+
.arguments { margin:0em 1em; padding:0; list-style-type:none; }
|
20
|
+
.arguments .tp { padding:0 0 0 0; float:left; width:70px; }
|
21
|
+
.arguments strong { display:block; }
|
22
|
+
|
23
|
+
.api h3 { margin-left:-10px; color:black; font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; font-weight: normal !important; font-size:14px; margin-top:2em; border-top:1px solid; width:780px; }
|
24
|
+
.api .arguments li strong { color:black; font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; font-weight: normal !important; font-size:13px; }
|
25
|
+
|
26
|
+
.configuration h3 { margin-left:-10px; color:black; font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; font-weight: normal !important; font-size:14px; margin-top:2em; border-top:1px solid; width:780px; }
|
27
|
+
.note { background:#ffffee; padding:10px 20px; border:1px solid #333; -moz-border-radius:5px; border-radius:5px; -webkit-border-radius:5px; margin-bottom:15px; text-align:center; font-weight:bold; }
|
28
|
+
|
29
|
+
ul.columns { list-style-type:none; width:700px; margin:5px auto 15px auto; padding:0; overflow:hidden; }
|
30
|
+
ul.columns li { float:left; margin:0; padding:0 0 0 0px; line-height:18px; width:345px; }
|
31
|
+
ul.plugins li { width:220px; text-align:left; padding:5px 0; }
|
32
|
+
ul.plugins li a { text-decoration:none; color:#3B5998; }
|
33
|
+
ul.plugins li a:hover { text-decoration:underline; }
|
34
|
+
ul.plugins li p { text-align:left; font-size:9px; color:#333; margin:0 5px 0 0; }
|
35
|
+
|
36
|
+
.demo, .demo input, .jstree-dnd-helper, #vakata-contextmenu { font-size:10px; font-family:Verdana; }
|
37
|
+
|
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
[ "#root_node" ]
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<root>
|
3
|
+
<item id="pxml_1">
|
4
|
+
<content><name><![CDATA[Root node 1]]></name></content>
|
5
|
+
<item id="pxml_2">
|
6
|
+
<content><name><![CDATA[Child node 1]]></name></content>
|
7
|
+
</item>
|
8
|
+
<item id="pxml_3">
|
9
|
+
<content><name><![CDATA[Child node 2]]></name></content>
|
10
|
+
</item>
|
11
|
+
<item id="pxml_4">
|
12
|
+
<content><name><![CDATA[Some other child node]]></name></content>
|
13
|
+
</item>
|
14
|
+
</item>
|
15
|
+
<item id="pxml_5">
|
16
|
+
<content><name ><![CDATA[Root node 2]]></name></content>
|
17
|
+
</item>
|
18
|
+
</root>
|
@@ -0,0 +1,148 @@
|
|
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 - checkbox 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 - checkbox plugin</h1>
|
21
|
+
<h2>Description</h2>
|
22
|
+
<div id="description">
|
23
|
+
<p>The <code>checkbox</code> plugin makes multiselection possible using three-state checkboxes.</p>
|
24
|
+
</div>
|
25
|
+
|
26
|
+
<h2 id="configuration">Configuration</h2>
|
27
|
+
<div class="panel configuration">
|
28
|
+
<p>No configuration possible</p>
|
29
|
+
</div>
|
30
|
+
|
31
|
+
<h2 id="demos">Demos</h2>
|
32
|
+
<div class="panel">
|
33
|
+
<h3>Using the checkbox plugin - all you need to do is include it in the list of active plugins.</h3>
|
34
|
+
<div id="demo1" class="demo">
|
35
|
+
<ul>
|
36
|
+
<li id="phtml_1">
|
37
|
+
<a href="#">Root node 1</a>
|
38
|
+
<ul>
|
39
|
+
<li id="phtml_2" class="jstree-checked">
|
40
|
+
<a href="#">Child node 1</a>
|
41
|
+
</li>
|
42
|
+
<li id="phtml_3">
|
43
|
+
<a href="#">Child node 2</a>
|
44
|
+
</li>
|
45
|
+
</ul>
|
46
|
+
</li>
|
47
|
+
<li id="phtml_4">
|
48
|
+
<a href="#">Root node 2</a>
|
49
|
+
</li>
|
50
|
+
</ul>
|
51
|
+
</div>
|
52
|
+
<script type="text/javascript" class="source">
|
53
|
+
$(function () {
|
54
|
+
$("#demo1").jstree({
|
55
|
+
"plugins" : [ "themes", "html_data", "checkbox" ]
|
56
|
+
});
|
57
|
+
});
|
58
|
+
</script>
|
59
|
+
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<h2 id="api">API</h2>
|
63
|
+
<div class="panel api">
|
64
|
+
<p>The checkbox plugin maps UI's <a href="ui.html#get_selected">get_selected function</a> to its own <a href="#get_checked">get_checked function</a> and overwrites the <a href="ui.html#reselect">UI reselect function</a>. It also disables the <code>select_node</code>, <code>deselect_node</code> and <code>deselect_all</code> functions.
|
65
|
+
|
66
|
+
<h3 id="_prepare_checkboxes">._prepare_checkboxes ( node )</h3>
|
67
|
+
<p>Inserts the checkbox icons on the node. Used internally.</p>
|
68
|
+
<ul class="arguments">
|
69
|
+
<li>
|
70
|
+
<code class="tp">mixed</code> <strong>node</strong>
|
71
|
+
<p>This can be a DOM node, jQuery node or selector pointing to an element within the tree.</p>
|
72
|
+
</li>
|
73
|
+
</ul>
|
74
|
+
|
75
|
+
<h3 id="_repair_state">._repair_state ( node )</h3>
|
76
|
+
<p>Repairs the checkbox state inside the node. Used internally.</p>
|
77
|
+
<ul class="arguments">
|
78
|
+
<li>
|
79
|
+
<code class="tp">mixed</code> <strong>node</strong>
|
80
|
+
<p>This can be a DOM node, jQuery node or selector pointing to an element within the tree.</p>
|
81
|
+
</li>
|
82
|
+
</ul>
|
83
|
+
|
84
|
+
<h3 id="change_state">.change_state ( node , uncheck )</h3>
|
85
|
+
<p>Changes the state of a node. Used mostly internally - you'd be better off using the <code>check_node</code> and <code>uncheck_node</code> functions. Triggers an event.</p>
|
86
|
+
<ul class="arguments">
|
87
|
+
<li>
|
88
|
+
<code class="tp">mixed</code> <strong>node</strong>
|
89
|
+
<p>This can be a DOM node, jQuery node or selector pointing to an element within the tree.</p>
|
90
|
+
</li>
|
91
|
+
<li>
|
92
|
+
<code class="tp">boolean</code> <strong>uncheck</strong>
|
93
|
+
<p>If set to <code>true</code> the node is unchecked, if set to <code>false</code> the node is checked, otherwise - the state is toggled.</p>
|
94
|
+
</li>
|
95
|
+
</ul>
|
96
|
+
|
97
|
+
<h3 id="check_node">.check_node ( node )</h3>
|
98
|
+
<p>Checks a node.</p>
|
99
|
+
<ul class="arguments">
|
100
|
+
<li>
|
101
|
+
<code class="tp">mixed</code> <strong>node</strong>
|
102
|
+
<p>This can be a DOM node, jQuery node or selector pointing to an element within the tree.</p>
|
103
|
+
</li>
|
104
|
+
</ul>
|
105
|
+
|
106
|
+
<h3 id="uncheck_node">.uncheck_node ( node )</h3>
|
107
|
+
<p>Unchecks a node.</p>
|
108
|
+
<ul class="arguments">
|
109
|
+
<li>
|
110
|
+
<code class="tp">mixed</code> <strong>node</strong>
|
111
|
+
<p>This can be a DOM node, jQuery node or selector pointing to an element within the tree.</p>
|
112
|
+
</li>
|
113
|
+
</ul>
|
114
|
+
|
115
|
+
<h3 id="check_all">.check_all ( )</h3>
|
116
|
+
<p>Checks all nodes.</p>
|
117
|
+
|
118
|
+
<h3 id="uncheck_all">.uncheck_all ( )</h3>
|
119
|
+
<p>Unchecks all nodes.</p>
|
120
|
+
|
121
|
+
<h3 id="is_checked">.is_checked ( node )</h3>
|
122
|
+
<p>Checks if a node is checked. Returns boolean.</p>
|
123
|
+
<ul class="arguments">
|
124
|
+
<li>
|
125
|
+
<code class="tp">mixed</code> <strong>node</strong>
|
126
|
+
<p>This can be a DOM node, jQuery node or selector pointing to an element within the tree.</p>
|
127
|
+
</li>
|
128
|
+
</ul>
|
129
|
+
|
130
|
+
<div style="height:1px; visibility:hidden; overflow:hidden;"><span id="get_unchecked"> </span></div>
|
131
|
+
<h3 id="get_checked">.get_checked ( context ), .get_unchecked ( context )</h3>
|
132
|
+
<p>Both functions return jQuery collections.</p>
|
133
|
+
<ul class="arguments">
|
134
|
+
<li>
|
135
|
+
<code class="tp">mixed</code> <strong>context</strong>
|
136
|
+
<p>This can be a DOM node, jQuery node or selector pointing to an element within the tree. If specified only nodes inside the specified context are returned, otherwise the whole tree is searched.</p>
|
137
|
+
</li>
|
138
|
+
</ul>
|
139
|
+
|
140
|
+
<div style="height:1px; visibility:hidden; overflow:hidden;"><span id="hide_checkboxes"> </span></div>
|
141
|
+
<h3 id="show_checkboxes">.show_checkboxes ( ), .get_unchecked ( )</h3>
|
142
|
+
<p>Show or hide the checkbox icons.</p>
|
143
|
+
|
144
|
+
</div>
|
145
|
+
|
146
|
+
</div>
|
147
|
+
</body>
|
148
|
+
</html>
|