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,214 @@
|
|
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 - xml_data 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 - xml_data plugin</h1>
|
21
|
+
<h2>Description</h2>
|
22
|
+
<div id="description">
|
23
|
+
<p>The <code>xml_data</code> plugin enables jsTree to convert XML objects to interactive trees (using XSL). The data (XML) can be set up in the config (as a string) or retrieved from a server (also ondemand).</p>
|
24
|
+
<p>Two types of XML structures are supported - flat and nested:</p>
|
25
|
+
<div class="code_f">
|
26
|
+
<pre class="brush:xml;">
|
27
|
+
<!-- FLAT -->
|
28
|
+
<root>
|
29
|
+
<item id="root_1" parent_id="0" state="closed">
|
30
|
+
<content>
|
31
|
+
<name><![CDATA[Node 1]]></name>
|
32
|
+
</content>
|
33
|
+
</item>
|
34
|
+
<item id="node_2" parent_id="root_1">
|
35
|
+
<content>
|
36
|
+
<name><![CDATA[Node 2]]></name>
|
37
|
+
</content>
|
38
|
+
</item>
|
39
|
+
</root>
|
40
|
+
|
41
|
+
<!-- NESTED -->
|
42
|
+
<root>
|
43
|
+
<item id="xml_1">
|
44
|
+
<content><name><![CDATA[Root node 1]]></name></content>
|
45
|
+
<item id="xml_2">
|
46
|
+
<content><name><![CDATA[Child node 1]]></name></content>
|
47
|
+
</item>
|
48
|
+
</item>
|
49
|
+
</root>
|
50
|
+
</pre>
|
51
|
+
</div>
|
52
|
+
<p>Aside from nesting the only difference is the <code>parent_id</code> attribute used in <code>xml_flat</code>.</p>
|
53
|
+
<p><code>parent_id</code> defines the parent of the node in XML flat, use <code>0</code> for root nodes. Also when using async - use <code>0</code> for the first level.</p>
|
54
|
+
<p><code>state</code> defines the state of the node (<code>open</code> or <code>closed</code>). You can omit it too - jstree will handle the data automatically - nodes with no children will be leaf nodes, nodes with children will be closed.</p>
|
55
|
+
<p>All attributes you set on the <code>item</code> node will be transfered to the resulting <code>li</code> node. All attributes you set on the <code>name</code> node will be transfered to the resulting <code>a</code> node.</p>
|
56
|
+
<p>If you are using the <a href="languages.html">languages plugin</a> you can have multiple <code>name</code> nodes in a every <code>item</code> node, just set a <code>language</code> attribute on each one (<code><name language="en" ...</code>).</p>
|
57
|
+
<p class="note">Remember to always set the XML header on your XML files.</p>
|
58
|
+
</div>
|
59
|
+
|
60
|
+
<h2 id="configuration">Configuration</h2>
|
61
|
+
<div class="panel configuration">
|
62
|
+
<h3>data</h3>
|
63
|
+
<p class="meta">A XML string (or <code>false</code> if not used). Default is <code>false</code>.</p>
|
64
|
+
<p>Specifies the content to load into the container and convert to a tree.</p>
|
65
|
+
<h3>ajax</h3>
|
66
|
+
<p class="meta">An object (or <code>false</code> if not used). Default is <code>false</code>.</p>
|
67
|
+
<p>The ajax config object is pretty much the same as the <a href="http://api.jquery.com/jQuery.ajax/">jQuery ajax settings object</a>.</p>
|
68
|
+
<p>You can set the <code>data</code> option to a function, that will be executed in the current tree's scope (<code>this</code> will be the tree instance) and gets the node about to be open as a paramater (or <code>-1</code> for initial load). Whatever you return in the function will be sent to the server as data (so for example you can send the node's ID).</p>
|
69
|
+
<p>You can set the <code>url</code> option to a function, that will be executed in the current tree's scope (<code>this</code> will be the tree instance) and gets the node about to be open as a paramater (or <code>-1</code> for initial load). Whatever you return in the <code>url</code> function will be used as the ajax URL (so that you can accomodate pretty paths such as /get_children/node_2).</p>
|
70
|
+
<p>The <code>error</code> and <code>success</code> functions (if present) also fire in the context of the tree, and if you return a value in the <code>success</code> function it will be used to populate the tree - this can be useful if you want to somehow change what the server returned on the client side before it is displayed in the tree.</p>
|
71
|
+
<h3>correct_state</h3>
|
72
|
+
<p class="meta">A Boolean. Default is <code>true</code>.</p>
|
73
|
+
<p>If this option is set to <code>true</code> if an AJAX returns an empty result, the node that was about to be opened will be converted to a leaf node (the open icon will no longer be displayed).</p>
|
74
|
+
<h3>clean_node</h3>
|
75
|
+
<p class="meta">A Boolean. Default is <code>false</code>.</p>
|
76
|
+
<p>Set to true if node needs to be cleaned - usually you should leave this to <code>false</code>.</p>
|
77
|
+
<h3>xsl</h3>
|
78
|
+
<p class="meta">A string. Default is <code>"flat"</code>.</p>
|
79
|
+
<p>The type of structure you wiil be using - set either to <code>"flat"</code> or <code>"nest"</code>.</p>
|
80
|
+
|
81
|
+
<p class="note"><strong>NOTE:</strong><br />If both <code>data</code> and <code>ajax</code> are set the initial tree is rendered from the <code>data</code> string. When opening a closed node (that has no loaded children) an AJAX request is made.</p>
|
82
|
+
</div>
|
83
|
+
|
84
|
+
<h2 id="demos">Demos</h2>
|
85
|
+
<div class="panel">
|
86
|
+
|
87
|
+
<h3>Using the data config option (flat)</h3>
|
88
|
+
<div id="demo1" class="demo"></div>
|
89
|
+
<script type="text/javascript" class="source">
|
90
|
+
$(function () {
|
91
|
+
$("#demo1").jstree({
|
92
|
+
"xml_data" : {
|
93
|
+
"data" : "" +
|
94
|
+
"<root>" +
|
95
|
+
"<item id='node_1'>" +
|
96
|
+
"<content><name>Root node 1</name></content>" +
|
97
|
+
"</item>" +
|
98
|
+
"<item>" +
|
99
|
+
"<content><name>Root node 2</name></content>" +
|
100
|
+
"</item>" +
|
101
|
+
"<item parent_id='node_1'>" +
|
102
|
+
"<content><name>Child node</name></content>" +
|
103
|
+
"</item>" +
|
104
|
+
"</root>"
|
105
|
+
},
|
106
|
+
"plugins" : [ "themes", "xml_data" ]
|
107
|
+
});
|
108
|
+
});
|
109
|
+
</script>
|
110
|
+
|
111
|
+
<h3>Using the ajax config option (nested)</h3>
|
112
|
+
<div id="demo2" class="demo"></div>
|
113
|
+
<script type="text/javascript" class="source">
|
114
|
+
$(function () {
|
115
|
+
$("#demo2").jstree({
|
116
|
+
"xml_data" : {
|
117
|
+
"ajax" : {
|
118
|
+
"url" : "_xml_nest.xml"
|
119
|
+
},
|
120
|
+
"xsl" : "nest"
|
121
|
+
},
|
122
|
+
"plugins" : [ "themes", "xml_data" ]
|
123
|
+
});
|
124
|
+
});
|
125
|
+
</script>
|
126
|
+
|
127
|
+
<h3>Using both the data & ajax config options (flat)</h3>
|
128
|
+
<div id="demo4" class="demo"></div>
|
129
|
+
<script type="text/javascript" class="source">
|
130
|
+
$(function () {
|
131
|
+
$("#demo4").jstree({
|
132
|
+
"xml_data" : {
|
133
|
+
"data" : "" +
|
134
|
+
"<root>" +
|
135
|
+
"<item id='node_1' state='closed'>" +
|
136
|
+
"<content><name>Root node 1</name></content>" +
|
137
|
+
"</item>" +
|
138
|
+
"<item>" +
|
139
|
+
"<content><name>Root node 2</name></content>" +
|
140
|
+
"</item>" +
|
141
|
+
"</root>",
|
142
|
+
"ajax" : {
|
143
|
+
"url" : "_xml_flat.xml",
|
144
|
+
"data" : function (n) {
|
145
|
+
return {
|
146
|
+
id : n.attr ? n.attr("id") : 0,
|
147
|
+
rand : new Date().getTime()
|
148
|
+
};
|
149
|
+
}
|
150
|
+
}
|
151
|
+
},
|
152
|
+
"plugins" : [ "themes", "xml_data" ]
|
153
|
+
});
|
154
|
+
});
|
155
|
+
</script>
|
156
|
+
</div>
|
157
|
+
|
158
|
+
<h2 id="api">API</h2>
|
159
|
+
<div class="panel api">
|
160
|
+
<p>Both dummy functions - <code>_is_loaded</code> and <code>load_node</code> are overwritten.</p>
|
161
|
+
<h3 id="load_node_xml">.load_node_xml ( node , success_callback , error_callback )</h3>
|
162
|
+
<p>This function is called instead of <code>load_node</code>.</p>
|
163
|
+
<ul class="arguments">
|
164
|
+
<li>
|
165
|
+
<code class="tp">mixed</code> <strong>node</strong>
|
166
|
+
<p>This can be a DOM node, jQuery node or selector pointing to an element you want loaded. Use <code>-1</code> for root nodes.</p>
|
167
|
+
</li>
|
168
|
+
<li>
|
169
|
+
<code class="tp">function</code> <strong>success_callback</strong>
|
170
|
+
<p>A function to be executed once the node is loaded successfully - used internally. You should wait for the <code>load_node</code> event.</p>
|
171
|
+
</li>
|
172
|
+
<li>
|
173
|
+
<code class="tp">function</code> <strong>error_callback</strong>
|
174
|
+
<p>A function to be executed if the node is not loaded due to an error - used internally. You should wait for the <code>load_node</code> event.</p>
|
175
|
+
</li>
|
176
|
+
</ul>
|
177
|
+
<h3 id="parse_xml">.parse_xml ( data )</h3>
|
178
|
+
<p>This function converts XML strings or objects to the DOM structure required by jstree. Returns a jQuery object.</p>
|
179
|
+
<ul class="arguments">
|
180
|
+
<li>
|
181
|
+
<code class="tp">mixed</code> <strong>data</strong>
|
182
|
+
<p>The XML string/object.</p>
|
183
|
+
</li>
|
184
|
+
</ul>
|
185
|
+
<h3 id="get_xml">.get_xml ( type , node , li_attr , a_attr , is_callback )</h3>
|
186
|
+
<p>This function returns an array of tree nodes converted back to XML.</p>
|
187
|
+
<ul class="arguments">
|
188
|
+
<li>
|
189
|
+
<code class="tp">string</code> <strong>type</strong>
|
190
|
+
<p>Either <code>"flat"</code> or <code>"nest"</code>. Default is <code>"flat"</code>.</p>
|
191
|
+
</li>
|
192
|
+
<li>
|
193
|
+
<code class="tp">mixed</code> <strong>node</strong>
|
194
|
+
<p>This can be a DOM node, jQuery node or selector pointing to an element you want returned. Use <code>-1</code> or omit to get the whole tree.</p>
|
195
|
+
</li>
|
196
|
+
<li>
|
197
|
+
<code class="tp">array</code> <strong>li_attr</strong>
|
198
|
+
<p>The attributes to collect from the <code>LI</code> node. Defaults to <code>[ "id" , "class" ]</p>
|
199
|
+
</li>
|
200
|
+
<li>
|
201
|
+
<code class="tp">array</code> <strong>a_attr</strong>
|
202
|
+
<p>The attributes to collect from the <code>A</code> node. Defaults to <code>[ ]</p>
|
203
|
+
</li>
|
204
|
+
<li>
|
205
|
+
<code class="tp">string</code> <strong>is_callback</strong>
|
206
|
+
<p>Used internally.</p>
|
207
|
+
</li>
|
208
|
+
</ul>
|
209
|
+
|
210
|
+
</div>
|
211
|
+
|
212
|
+
</div>
|
213
|
+
</body>
|
214
|
+
</html>
|
@@ -0,0 +1,96 @@
|
|
1
|
+
/**
|
2
|
+
* Cookie plugin
|
3
|
+
*
|
4
|
+
* Copyright (c) 2006 Klaus Hartl (stilbuero.de)
|
5
|
+
* Dual licensed under the MIT and GPL licenses:
|
6
|
+
* http://www.opensource.org/licenses/mit-license.php
|
7
|
+
* http://www.gnu.org/licenses/gpl.html
|
8
|
+
*
|
9
|
+
*/
|
10
|
+
|
11
|
+
/**
|
12
|
+
* Create a cookie with the given name and value and other optional parameters.
|
13
|
+
*
|
14
|
+
* @example $.cookie('the_cookie', 'the_value');
|
15
|
+
* @desc Set the value of a cookie.
|
16
|
+
* @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true });
|
17
|
+
* @desc Create a cookie with all available options.
|
18
|
+
* @example $.cookie('the_cookie', 'the_value');
|
19
|
+
* @desc Create a session cookie.
|
20
|
+
* @example $.cookie('the_cookie', null);
|
21
|
+
* @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain
|
22
|
+
* used when the cookie was set.
|
23
|
+
*
|
24
|
+
* @param String name The name of the cookie.
|
25
|
+
* @param String value The value of the cookie.
|
26
|
+
* @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
|
27
|
+
* @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
|
28
|
+
* If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
|
29
|
+
* If set to null or omitted, the cookie will be a session cookie and will not be retained
|
30
|
+
* when the the browser exits.
|
31
|
+
* @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
|
32
|
+
* @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
|
33
|
+
* @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
|
34
|
+
* require a secure protocol (like HTTPS).
|
35
|
+
* @type undefined
|
36
|
+
*
|
37
|
+
* @name $.cookie
|
38
|
+
* @cat Plugins/Cookie
|
39
|
+
* @author Klaus Hartl/klaus.hartl@stilbuero.de
|
40
|
+
*/
|
41
|
+
|
42
|
+
/**
|
43
|
+
* Get the value of a cookie with the given name.
|
44
|
+
*
|
45
|
+
* @example $.cookie('the_cookie');
|
46
|
+
* @desc Get the value of a cookie.
|
47
|
+
*
|
48
|
+
* @param String name The name of the cookie.
|
49
|
+
* @return The value of the cookie.
|
50
|
+
* @type String
|
51
|
+
*
|
52
|
+
* @name $.cookie
|
53
|
+
* @cat Plugins/Cookie
|
54
|
+
* @author Klaus Hartl/klaus.hartl@stilbuero.de
|
55
|
+
*/
|
56
|
+
jQuery.cookie = function(name, value, options) {
|
57
|
+
if (typeof value != 'undefined') { // name and value given, set cookie
|
58
|
+
options = options || {};
|
59
|
+
if (value === null) {
|
60
|
+
value = '';
|
61
|
+
options.expires = -1;
|
62
|
+
}
|
63
|
+
var expires = '';
|
64
|
+
if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
|
65
|
+
var date;
|
66
|
+
if (typeof options.expires == 'number') {
|
67
|
+
date = new Date();
|
68
|
+
date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
|
69
|
+
} else {
|
70
|
+
date = options.expires;
|
71
|
+
}
|
72
|
+
expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
|
73
|
+
}
|
74
|
+
// CAUTION: Needed to parenthesize options.path and options.domain
|
75
|
+
// in the following expressions, otherwise they evaluate to undefined
|
76
|
+
// in the packed version for some reason...
|
77
|
+
var path = options.path ? '; path=' + (options.path) : '';
|
78
|
+
var domain = options.domain ? '; domain=' + (options.domain) : '';
|
79
|
+
var secure = options.secure ? '; secure' : '';
|
80
|
+
document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
|
81
|
+
} else { // only name given, get cookie
|
82
|
+
var cookieValue = null;
|
83
|
+
if (document.cookie && document.cookie != '') {
|
84
|
+
var cookies = document.cookie.split(';');
|
85
|
+
for (var i = 0; i < cookies.length; i++) {
|
86
|
+
var cookie = jQuery.trim(cookies[i]);
|
87
|
+
// Does this cookie string begin with the name we want?
|
88
|
+
if (cookie.substring(0, name.length + 1) == (name + '=')) {
|
89
|
+
cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
|
90
|
+
break;
|
91
|
+
}
|
92
|
+
}
|
93
|
+
}
|
94
|
+
return cookieValue;
|
95
|
+
}
|
96
|
+
};
|
@@ -0,0 +1,99 @@
|
|
1
|
+
/*
|
2
|
+
* jQuery Hotkeys Plugin
|
3
|
+
* Copyright 2010, John Resig
|
4
|
+
* Dual licensed under the MIT or GPL Version 2 licenses.
|
5
|
+
*
|
6
|
+
* Based upon the plugin by Tzury Bar Yochay:
|
7
|
+
* http://github.com/tzuryby/hotkeys
|
8
|
+
*
|
9
|
+
* Original idea by:
|
10
|
+
* Binny V A, http://www.openjs.com/scripts/events/keyboard_shortcuts/
|
11
|
+
*/
|
12
|
+
|
13
|
+
(function(jQuery){
|
14
|
+
|
15
|
+
jQuery.hotkeys = {
|
16
|
+
version: "0.8",
|
17
|
+
|
18
|
+
specialKeys: {
|
19
|
+
8: "backspace", 9: "tab", 13: "return", 16: "shift", 17: "ctrl", 18: "alt", 19: "pause",
|
20
|
+
20: "capslock", 27: "esc", 32: "space", 33: "pageup", 34: "pagedown", 35: "end", 36: "home",
|
21
|
+
37: "left", 38: "up", 39: "right", 40: "down", 45: "insert", 46: "del",
|
22
|
+
96: "0", 97: "1", 98: "2", 99: "3", 100: "4", 101: "5", 102: "6", 103: "7",
|
23
|
+
104: "8", 105: "9", 106: "*", 107: "+", 109: "-", 110: ".", 111 : "/",
|
24
|
+
112: "f1", 113: "f2", 114: "f3", 115: "f4", 116: "f5", 117: "f6", 118: "f7", 119: "f8",
|
25
|
+
120: "f9", 121: "f10", 122: "f11", 123: "f12", 144: "numlock", 145: "scroll", 191: "/", 224: "meta"
|
26
|
+
},
|
27
|
+
|
28
|
+
shiftNums: {
|
29
|
+
"`": "~", "1": "!", "2": "@", "3": "#", "4": "$", "5": "%", "6": "^", "7": "&",
|
30
|
+
"8": "*", "9": "(", "0": ")", "-": "_", "=": "+", ";": ": ", "'": "\"", ",": "<",
|
31
|
+
".": ">", "/": "?", "\\": "|"
|
32
|
+
}
|
33
|
+
};
|
34
|
+
|
35
|
+
function keyHandler( handleObj ) {
|
36
|
+
// Only care when a possible input has been specified
|
37
|
+
if ( typeof handleObj.data !== "string" ) {
|
38
|
+
return;
|
39
|
+
}
|
40
|
+
|
41
|
+
var origHandler = handleObj.handler,
|
42
|
+
keys = handleObj.data.toLowerCase().split(" ");
|
43
|
+
|
44
|
+
handleObj.handler = function( event ) {
|
45
|
+
// Don't fire in text-accepting inputs that we didn't directly bind to
|
46
|
+
if ( this !== event.target && (/textarea|select/i.test( event.target.nodeName ) ||
|
47
|
+
event.target.type === "text") ) {
|
48
|
+
return;
|
49
|
+
}
|
50
|
+
|
51
|
+
// Keypress represents characters, not special keys
|
52
|
+
var special = event.type !== "keypress" && jQuery.hotkeys.specialKeys[ event.which ],
|
53
|
+
character = String.fromCharCode( event.which ).toLowerCase(),
|
54
|
+
key, modif = "", possible = {};
|
55
|
+
|
56
|
+
// check combinations (alt|ctrl|shift+anything)
|
57
|
+
if ( event.altKey && special !== "alt" ) {
|
58
|
+
modif += "alt+";
|
59
|
+
}
|
60
|
+
|
61
|
+
if ( event.ctrlKey && special !== "ctrl" ) {
|
62
|
+
modif += "ctrl+";
|
63
|
+
}
|
64
|
+
|
65
|
+
// TODO: Need to make sure this works consistently across platforms
|
66
|
+
if ( event.metaKey && !event.ctrlKey && special !== "meta" ) {
|
67
|
+
modif += "meta+";
|
68
|
+
}
|
69
|
+
|
70
|
+
if ( event.shiftKey && special !== "shift" ) {
|
71
|
+
modif += "shift+";
|
72
|
+
}
|
73
|
+
|
74
|
+
if ( special ) {
|
75
|
+
possible[ modif + special ] = true;
|
76
|
+
|
77
|
+
} else {
|
78
|
+
possible[ modif + character ] = true;
|
79
|
+
possible[ modif + jQuery.hotkeys.shiftNums[ character ] ] = true;
|
80
|
+
|
81
|
+
// "$" can be triggered as "Shift+4" or "Shift+$" or just "$"
|
82
|
+
if ( modif === "shift+" ) {
|
83
|
+
possible[ jQuery.hotkeys.shiftNums[ character ] ] = true;
|
84
|
+
}
|
85
|
+
}
|
86
|
+
|
87
|
+
for ( var i = 0, l = keys.length; i < l; i++ ) {
|
88
|
+
if ( possible[ keys[i] ] ) {
|
89
|
+
return origHandler.apply( this, arguments );
|
90
|
+
}
|
91
|
+
}
|
92
|
+
};
|
93
|
+
}
|
94
|
+
|
95
|
+
jQuery.each([ "keydown", "keyup", "keypress" ], function() {
|
96
|
+
jQuery.event.special[ this ] = { add: keyHandler };
|
97
|
+
});
|
98
|
+
|
99
|
+
})( jQuery );
|