zen 0.2.7 → 0.2.8
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +15 -0
- data/.mailmap +2 -0
- data/.rvmrc +2 -0
- data/.travis.yml +8 -3
- data/AUTHORS +1 -2
- data/CHANGELOG.md +48 -17
- data/README.md +44 -39
- data/Rakefile +4 -0
- data/bin/zen +5 -30
- data/lib/zen.rb +13 -19
- data/lib/zen/asset.rb +99 -64
- data/lib/zen/bin/create.rb +94 -0
- data/lib/zen/bin/runner.rb +118 -0
- data/lib/zen/controller/admin_controller.rb +52 -36
- data/lib/zen/controller/base_controller.rb +5 -5
- data/lib/zen/controller/frontend_controller.rb +7 -7
- data/lib/zen/controller/main_controller.rb +12 -10
- data/lib/zen/controller/preview.rb +15 -11
- data/lib/zen/helper/acl.rb +73 -53
- data/lib/zen/helper/blue_form_vendor.rb +689 -0
- data/lib/zen/helper/breadcrumb.rb +23 -19
- data/lib/zen/helper/message.rb +3 -3
- data/lib/zen/helper/theme.rb +18 -13
- data/lib/zen/language.rb +62 -58
- data/lib/zen/language/en/zen_general.yml +2 -4
- data/lib/zen/language/nl/zen_general.yml +2 -4
- data/lib/zen/layout/admin.xhtml +3 -12
- data/lib/zen/layout/login.xhtml +1 -6
- data/lib/zen/model/methods.rb +6 -6
- data/lib/zen/model/settings.rb +5 -4
- data/lib/zen/package.rb +47 -38
- data/lib/zen/package/all.rb +3 -5
- data/lib/zen/package/base.rb +7 -7
- data/lib/zen/package/categories/lib/categories.rb +8 -3
- data/lib/zen/package/categories/lib/categories/controller/categories.rb +81 -55
- data/lib/zen/package/categories/lib/categories/controller/category_groups.rb +45 -44
- data/lib/zen/package/categories/lib/categories/helper/category.rb +88 -0
- data/lib/zen/package/categories/lib/categories/language/en/categories.yml +5 -4
- data/lib/zen/package/categories/lib/categories/language/en/category_groups.yml +5 -4
- data/lib/zen/package/categories/lib/categories/language/nl/categories.yml +5 -4
- data/lib/zen/package/categories/lib/categories/language/nl/category_groups.yml +5 -4
- data/lib/zen/package/categories/lib/categories/model/category.rb +15 -13
- data/lib/zen/package/categories/lib/categories/model/category_group.rb +3 -3
- data/lib/zen/package/categories/lib/categories/plugin/categories.rb +36 -25
- data/lib/zen/package/categories/lib/categories/view/admin/categories/form.xhtml +49 -56
- data/lib/zen/package/categories/lib/categories/view/admin/categories/index.xhtml +48 -35
- data/lib/zen/package/categories/lib/categories/view/admin/category-groups/form.xhtml +36 -29
- data/lib/zen/package/categories/lib/categories/view/admin/category-groups/index.xhtml +42 -37
- data/lib/zen/package/comments/lib/comments.rb +4 -1
- data/lib/zen/package/comments/lib/comments/controller/comments.rb +39 -32
- data/lib/zen/package/comments/lib/comments/controller/comments_form.rb +45 -26
- data/lib/zen/package/comments/lib/comments/helper/comment.rb +35 -0
- data/lib/zen/package/comments/lib/comments/language/en/comments.yml +9 -7
- data/lib/zen/package/comments/lib/comments/language/nl/comments.yml +10 -8
- data/lib/zen/package/comments/lib/comments/model/comment.rb +31 -17
- data/lib/zen/package/comments/lib/comments/model/comment_status.rb +15 -0
- data/lib/zen/package/comments/lib/comments/plugin/anti_spam.rb +27 -18
- data/lib/zen/package/comments/lib/comments/plugin/comments.rb +25 -20
- data/lib/zen/package/comments/lib/comments/view/admin/comments/form.xhtml +61 -54
- data/lib/zen/package/comments/lib/comments/view/admin/comments/index.xhtml +38 -23
- data/lib/zen/package/comments/migrations/1308774099_comment_status.rb +60 -0
- data/lib/zen/package/custom_fields/lib/custom_fields.rb +33 -7
- data/lib/zen/package/custom_fields/lib/custom_fields/blue_form_parameters.rb +209 -0
- data/lib/zen/package/custom_fields/lib/custom_fields/controller/custom_field_groups.rb +50 -47
- data/lib/zen/package/custom_fields/lib/custom_fields/controller/custom_field_types.rb +215 -0
- data/lib/zen/package/custom_fields/lib/custom_fields/controller/custom_fields.rb +111 -73
- data/lib/zen/package/custom_fields/lib/custom_fields/helper/custom_field.rb +79 -0
- data/lib/zen/package/custom_fields/lib/custom_fields/language/en/custom_field_groups.yml +20 -19
- data/lib/zen/package/custom_fields/lib/custom_fields/language/en/custom_field_types.yml +40 -0
- data/lib/zen/package/custom_fields/lib/custom_fields/language/en/custom_fields.yml +34 -32
- data/lib/zen/package/custom_fields/lib/custom_fields/language/nl/custom_field_groups.yml +5 -4
- data/lib/zen/package/custom_fields/lib/custom_fields/language/nl/custom_field_types.yml +40 -0
- data/lib/zen/package/custom_fields/lib/custom_fields/language/nl/custom_fields.yml +18 -16
- data/lib/zen/package/custom_fields/lib/custom_fields/model/custom_field.rb +31 -11
- data/lib/zen/package/custom_fields/lib/custom_fields/model/custom_field_method.rb +15 -0
- data/lib/zen/package/custom_fields/lib/custom_fields/model/custom_field_type.rb +50 -0
- data/lib/zen/package/custom_fields/lib/custom_fields/model/custom_field_value.rb +28 -7
- data/lib/zen/package/custom_fields/lib/custom_fields/view/admin/custom-field-groups/form.xhtml +33 -28
- data/lib/zen/package/custom_fields/lib/custom_fields/view/admin/custom-field-groups/index.xhtml +48 -46
- data/lib/zen/package/custom_fields/lib/custom_fields/view/admin/custom-field-types/form.xhtml +61 -0
- data/lib/zen/package/custom_fields/lib/custom_fields/view/admin/custom-field-types/index.xhtml +93 -0
- data/lib/zen/package/custom_fields/lib/custom_fields/view/admin/custom-fields/form.xhtml +105 -99
- data/lib/zen/package/custom_fields/lib/custom_fields/view/admin/custom-fields/index.xhtml +43 -39
- data/lib/zen/package/custom_fields/migrations/1295255665_create_schema.rb +47 -16
- data/lib/zen/package/custom_fields/migrations/1310659580_custom_field_types.rb +148 -0
- data/lib/zen/package/custom_fields/migrations/1311694920_rename_css_class.rb +11 -0
- data/lib/zen/package/menus/lib/menus/controller/menu_items.rb +40 -35
- data/lib/zen/package/menus/lib/menus/controller/menus.rb +47 -43
- data/lib/zen/package/menus/lib/menus/helper/{menu_item.rb → menu.rb} +42 -15
- data/lib/zen/package/menus/lib/menus/language/en/menu_items.yml +5 -5
- data/lib/zen/package/menus/lib/menus/language/en/menus.yml +9 -8
- data/lib/zen/package/menus/lib/menus/language/nl/menu_items.yml +8 -8
- data/lib/zen/package/menus/lib/menus/language/nl/menus.yml +11 -10
- data/lib/zen/package/menus/lib/menus/model/menu.rb +5 -5
- data/lib/zen/package/menus/lib/menus/model/menu_item.rb +6 -5
- data/lib/zen/package/menus/lib/menus/plugin/menus.rb +41 -43
- data/lib/zen/package/menus/lib/menus/view/admin/menu-items/form.xhtml +59 -63
- data/lib/zen/package/menus/lib/menus/view/admin/menu-items/index.xhtml +35 -30
- data/lib/zen/package/menus/lib/menus/view/admin/menus/form.xhtml +46 -37
- data/lib/zen/package/menus/lib/menus/view/admin/menus/index.xhtml +37 -37
- data/lib/zen/package/menus/migrations/1297184342_create_schema.rb +5 -5
- data/lib/zen/package/menus/migrations/1308671733_rename_order_column.rb +11 -0
- data/lib/zen/package/menus/migrations/1311695030_rename_css_class.rb +17 -0
- data/lib/zen/package/sections/lib/sections.rb +18 -11
- data/lib/zen/package/sections/lib/sections/controller/section_entries.rb +115 -109
- data/lib/zen/package/sections/lib/sections/controller/sections.rb +72 -50
- data/lib/zen/package/sections/lib/sections/helper/section.rb +53 -0
- data/lib/zen/package/sections/lib/sections/language/en/section_entries.yml +5 -4
- data/lib/zen/package/sections/lib/sections/language/en/sections.yml +5 -4
- data/lib/zen/package/sections/lib/sections/language/nl/section_entries.yml +5 -4
- data/lib/zen/package/sections/lib/sections/language/nl/sections.yml +5 -4
- data/lib/zen/package/sections/lib/sections/model/section.rb +17 -9
- data/lib/zen/package/sections/lib/sections/model/section_entry.rb +192 -13
- data/lib/zen/package/sections/lib/sections/model/section_entry_status.rb +13 -0
- data/lib/zen/package/sections/lib/sections/plugin/section_entries.rb +60 -39
- data/lib/zen/package/sections/lib/sections/plugin/sections.rb +14 -11
- data/lib/zen/package/sections/lib/sections/view/admin/form.xhtml +100 -97
- data/lib/zen/package/sections/lib/sections/view/admin/index.xhtml +41 -39
- data/lib/zen/package/sections/lib/sections/view/admin/section-entries/form.xhtml +95 -215
- data/lib/zen/package/sections/lib/sections/view/admin/section-entries/index.xhtml +48 -40
- data/lib/zen/package/sections/migrations/1308672298_use_id_for_default_section.rb +40 -0
- data/lib/zen/package/sections/migrations/1308813320_section_entry_statuses.rb +58 -0
- data/lib/zen/package/settings/lib/settings/controller/settings.rb +5 -8
- data/lib/zen/package/settings/lib/settings/model/setting.rb +2 -37
- data/lib/zen/package/settings/lib/settings/plugin/setting_base.rb +18 -1
- data/lib/zen/package/settings/lib/settings/plugin/settings.rb +13 -7
- data/lib/zen/package/settings/lib/settings/view/admin/settings/index.xhtml +2 -1
- data/lib/zen/package/users/lib/users.rb +3 -1
- data/lib/zen/package/users/lib/users/controller/access_rules.rb +77 -60
- data/lib/zen/package/users/lib/users/controller/user_groups.rb +41 -36
- data/lib/zen/package/users/lib/users/controller/users.rb +48 -42
- data/lib/zen/package/users/lib/users/helper/users.rb +72 -0
- data/lib/zen/package/users/lib/users/language/en/access_rules.yml +6 -5
- data/lib/zen/package/users/lib/users/language/en/user_groups.yml +5 -4
- data/lib/zen/package/users/lib/users/language/en/users.yml +1 -0
- data/lib/zen/package/users/lib/users/language/nl/access_rules.yml +5 -4
- data/lib/zen/package/users/lib/users/language/nl/user_groups.yml +5 -4
- data/lib/zen/package/users/lib/users/language/nl/users.yml +1 -0
- data/lib/zen/package/users/lib/users/model/access_rule.rb +5 -1
- data/lib/zen/package/users/lib/users/model/user.rb +17 -10
- data/lib/zen/package/users/lib/users/public/admin/js/users/access_rules.js +10 -37
- data/lib/zen/package/users/lib/users/public/admin/js/users/lib/access_rules.js +49 -0
- data/lib/zen/package/users/lib/users/view/admin/access-rules/form.xhtml +105 -96
- data/lib/zen/package/users/lib/users/view/admin/access-rules/index.xhtml +48 -41
- data/lib/zen/package/users/lib/users/view/admin/user-groups/form.xhtml +42 -32
- data/lib/zen/package/users/lib/users/view/admin/user-groups/index.xhtml +43 -38
- data/lib/zen/package/users/lib/users/view/admin/users/form.xhtml +76 -67
- data/lib/zen/package/users/lib/users/view/admin/users/index.xhtml +43 -41
- data/lib/zen/package/users/lib/users/view/admin/users/login.xhtml +12 -9
- data/lib/zen/package/users/migrations/1295281013_create_schema.rb +2 -2
- data/lib/zen/plugin.rb +56 -50
- data/lib/zen/plugin/markup/lib/markup/markup.rb +33 -21
- data/lib/zen/public/admin/css/zen/buttons.css +11 -7
- data/lib/zen/public/admin/css/zen/datepicker.css +6 -6
- data/lib/zen/public/admin/css/zen/forms.css +2 -1
- data/lib/zen/public/admin/css/zen/general.css +15 -10
- data/lib/zen/public/admin/css/zen/layout.css +51 -20
- data/lib/zen/public/admin/css/zen/tables.css +39 -11
- data/lib/zen/public/admin/css/zen/tabs.css +6 -4
- data/lib/zen/public/admin/css/zen/window.css +11 -11
- data/lib/zen/public/{favicon.ico → admin/favicon.ico} +0 -0
- data/lib/zen/public/admin/images/zen/icons/asc.png +0 -0
- data/lib/zen/public/admin/images/zen/icons/desc.png +0 -0
- data/lib/zen/public/admin/js/vendor/datepicker.js +0 -11
- data/lib/zen/public/admin/js/{mootools → vendor/mootools}/core.js +0 -1
- data/lib/zen/public/admin/js/{mootools → vendor/mootools}/more.js +100 -29
- data/lib/zen/public/admin/js/zen/index.js +48 -0
- data/lib/zen/public/admin/js/zen/lib/asset.js +111 -0
- data/lib/zen/public/admin/js/zen/{editor.js → lib/editor.js} +107 -127
- data/lib/zen/public/admin/js/zen/{editor → lib/editor}/markdown.js +7 -9
- data/lib/zen/public/admin/js/zen/{editor → lib/editor}/textile.js +7 -9
- data/lib/zen/public/admin/js/zen/lib/html_table.js +143 -0
- data/lib/zen/public/admin/js/zen/{tabs.js → lib/tabs.js} +40 -37
- data/lib/zen/public/admin/js/zen/{window.js → lib/window.js} +24 -20
- data/lib/zen/spec/bacon/color_output.rb +39 -0
- data/lib/zen/spec/helper.rb +152 -0
- data/lib/zen/spec/simplecov.rb +22 -0
- data/lib/zen/task/build.rake +20 -43
- data/lib/zen/task/clean.rake +2 -6
- data/lib/zen/task/db.rake +8 -12
- data/lib/zen/task/package.rake +4 -10
- data/lib/zen/task/plugin.rake +3 -9
- data/lib/zen/task/proto.rake +0 -62
- data/lib/zen/task/test.rake +6 -3
- data/lib/zen/task/theme.rake +4 -11
- data/lib/zen/theme.rb +22 -24
- data/lib/zen/validation.rb +34 -27
- data/lib/zen/version.rb +2 -8
- data/lib/zen/view/head.xhtml +7 -0
- data/lib/zen/view/main.xhtml +7 -22
- data/{proto/package/migrations → pkg}/.gitkeep +0 -0
- data/proto/app/app.rb +1 -0
- data/proto/app/config/config.rb +5 -4
- data/proto/app/config/database.rb +19 -41
- data/proto/app/config/middlewares.rb +32 -29
- data/proto/{package/lib/package/view/admin/package/index.xhtml → app/log/database/dev/.gitkeep} +0 -0
- data/proto/app/log/database/live/.gitkeep +0 -0
- data/spec/Rakefile +26 -0
- data/spec/fixtures/zen/asset.rb +18 -0
- data/spec/fixtures/zen/helper/acl.rb +39 -0
- data/spec/fixtures/zen/helper/message.rb +19 -0
- data/spec/fixtures/zen/language/en/spec.yml +10 -0
- data/spec/fixtures/zen/language/nl/spec.yml +7 -0
- data/spec/fixtures/zen/package.rb +17 -0
- data/spec/fixtures/zen/package/comments/controller/comments_form.rb +27 -0
- data/spec/fixtures/zen/package/settings/plugin/settings.rb +20 -0
- data/spec/fixtures/zen/plugin.rb +7 -0
- data/spec/fixtures/zen/theme/404.xhtml +1 -0
- data/spec/fixtures/zen/theme/default-section/index.xhtml +1 -0
- data/spec/fixtures/zen/theme/helper/404.xhtml +1 -0
- data/spec/fixtures/zen/theme/helper/partial.xhtml +1 -0
- data/spec/fixtures/zen/theme/helper/wrong_partial.xhtml +1 -0
- data/spec/fixtures/zen/theme/partials/partial.xhtml +1 -0
- data/spec/fixtures/zen/theme/theme.rb +11 -0
- data/spec/fixtures/zen/validation.rb +22 -0
- data/spec/helper.rb +41 -0
- data/spec/zen/all.rb +5 -0
- data/spec/zen/asset.rb +97 -0
- data/spec/zen/bin/create.rb +89 -0
- data/spec/zen/bin/runner.rb +47 -0
- data/spec/zen/controller/admin_controller.rb +26 -0
- data/spec/zen/controller/main_controller.rb +81 -0
- data/spec/zen/controller/preview.rb +33 -0
- data/spec/zen/helper/acl.rb +149 -0
- data/spec/zen/helper/breadcrumb.rb +38 -0
- data/spec/zen/helper/message.rb +31 -0
- data/spec/zen/helper/theme.rb +58 -0
- data/spec/zen/language.rb +55 -0
- data/spec/zen/package.rb +23 -0
- data/spec/zen/package/categories/controller/categories.rb +123 -0
- data/spec/zen/package/categories/controller/category_groups.rb +108 -0
- data/spec/zen/package/categories/helper/category.rb +75 -0
- data/spec/zen/package/categories/plugin/categories.rb +92 -0
- data/spec/zen/package/comments/controller/comments.rb +134 -0
- data/spec/zen/package/comments/controller/comments_form.rb +343 -0
- data/spec/zen/package/comments/helper/comment.rb +47 -0
- data/spec/zen/package/comments/plugin/anti_spam.rb +59 -0
- data/spec/zen/package/comments/plugin/comments.rb +107 -0
- data/spec/zen/package/custom_fields/blue_form_parameters.rb +183 -0
- data/spec/zen/package/custom_fields/controller/custom_field_groups.rb +120 -0
- data/spec/zen/package/custom_fields/controller/custom_field_types.rb +169 -0
- data/spec/zen/package/custom_fields/controller/custom_fields.rb +158 -0
- data/spec/zen/package/custom_fields/helper/custom_field.rb +86 -0
- data/spec/zen/package/menus/controller/menu_items.rb +110 -0
- data/spec/zen/package/menus/controller/menus.rb +110 -0
- data/spec/zen/package/menus/helper/menu.rb +75 -0
- data/spec/zen/package/menus/plugin/menus.rb +120 -0
- data/spec/zen/package/sections/controller/section_entries.rb +201 -0
- data/spec/zen/package/sections/controller/sections.rb +116 -0
- data/spec/zen/package/sections/helper/section.rb +74 -0
- data/spec/zen/package/sections/plugin/section_entries.rb +161 -0
- data/spec/zen/package/sections/plugin/sections.rb +75 -0
- data/spec/zen/package/settings/controller/settings.rb +36 -0
- data/spec/zen/package/settings/plugin/settings.rb +33 -0
- data/spec/zen/package/users/controller/access_rules.rb +90 -0
- data/spec/zen/package/users/controller/user_groups.rb +101 -0
- data/spec/zen/package/users/controller/users.rb +130 -0
- data/spec/zen/package/users/helper/users.rb +97 -0
- data/spec/zen/plugin.rb +64 -0
- data/spec/zen/plugin/helper.rb +11 -0
- data/spec/zen/plugin/markup.rb +44 -0
- data/spec/zen/theme.rb +41 -0
- data/spec/zen/validation.rb +63 -0
- data/zen.gemspec +36 -0
- metadata +159 -113
- data/MANIFEST +0 -266
- data/lib/zen/bin/app.rb +0 -40
- data/lib/zen/ext/string.rb +0 -185
- data/lib/zen/helper/common.rb +0 -106
- data/lib/zen/package/categories/lib/categories/view/admin/categories/edit.xhtml +0 -7
- data/lib/zen/package/categories/lib/categories/view/admin/categories/new.xhtml +0 -7
- data/lib/zen/package/categories/lib/categories/view/admin/category-groups/edit.xhtml +0 -7
- data/lib/zen/package/categories/lib/categories/view/admin/category-groups/new.xhtml +0 -7
- data/lib/zen/package/comments/lib/comments/view/admin/comments/edit.xhtml +0 -7
- data/lib/zen/package/custom_fields/lib/custom_fields/view/admin/custom-field-groups/edit.xhtml +0 -7
- data/lib/zen/package/custom_fields/lib/custom_fields/view/admin/custom-field-groups/new.xhtml +0 -7
- data/lib/zen/package/custom_fields/lib/custom_fields/view/admin/custom-fields/edit.xhtml +0 -7
- data/lib/zen/package/custom_fields/lib/custom_fields/view/admin/custom-fields/new.xhtml +0 -7
- data/lib/zen/package/menus/lib/menus/view/admin/menu-items/edit.xhtml +0 -7
- data/lib/zen/package/menus/lib/menus/view/admin/menu-items/new.xhtml +0 -7
- data/lib/zen/package/menus/lib/menus/view/admin/menus/edit.xhtml +0 -7
- data/lib/zen/package/menus/lib/menus/view/admin/menus/new.xhtml +0 -7
- data/lib/zen/package/sections/lib/sections/view/admin/edit.xhtml +0 -7
- data/lib/zen/package/sections/lib/sections/view/admin/new.xhtml +0 -7
- data/lib/zen/package/sections/lib/sections/view/admin/section-entries/edit.xhtml +0 -7
- data/lib/zen/package/sections/lib/sections/view/admin/section-entries/new.xhtml +0 -7
- data/lib/zen/package/users/lib/users/view/admin/access-rules/edit.xhtml +0 -7
- data/lib/zen/package/users/lib/users/view/admin/access-rules/new.xhtml +0 -7
- data/lib/zen/package/users/lib/users/view/admin/user-groups/edit.xhtml +0 -7
- data/lib/zen/package/users/lib/users/view/admin/user-groups/new.xhtml +0 -7
- data/lib/zen/package/users/lib/users/view/admin/users/edit.xhtml +0 -7
- data/lib/zen/package/users/lib/users/view/admin/users/new.xhtml +0 -7
- data/lib/zen/plugin/controller.rb +0 -59
- data/lib/zen/public/admin/css/zen/notifications.css +0 -84
- data/lib/zen/public/admin/images/zen/icons/large/error.png +0 -0
- data/lib/zen/public/admin/images/zen/icons/large/notice.png +0 -0
- data/lib/zen/public/admin/images/zen/icons/large/success.png +0 -0
- data/lib/zen/public/admin/js/zen/core.js +0 -73
- data/lib/zen/public/admin/js/zen/init.js +0 -80
- data/proto/package/lib/package.rb +0 -21
- data/proto/package/lib/package/controller/controllers.rb +0 -50
- data/proto/package/lib/package/language/en/languages.yml +0 -4
- data/proto/package/lib/package/model/model.rb +0 -12
@@ -1,10 +1,8 @@
|
|
1
1
|
/**
|
2
2
|
* Markdown driver for the text editor that ships with Zen.
|
3
3
|
*
|
4
|
-
* @author
|
5
|
-
* @since
|
6
|
-
* @namespace Zen
|
7
|
-
* @extend Editor
|
4
|
+
* @author Yorick Peterse
|
5
|
+
* @since 0.2.6
|
8
6
|
*/
|
9
7
|
Zen.Editor.Markdown = new Class(
|
10
8
|
{
|
@@ -15,7 +13,7 @@ Zen.Editor.Markdown = new Class(
|
|
15
13
|
*
|
16
14
|
* @author Yorick Peterse
|
17
15
|
* @since 0.2.6
|
18
|
-
* @param
|
16
|
+
* @param {element} editor The textarea to insert the tags into.
|
19
17
|
*/
|
20
18
|
bold: function(editor)
|
21
19
|
{
|
@@ -27,7 +25,7 @@ Zen.Editor.Markdown = new Class(
|
|
27
25
|
*
|
28
26
|
* @author Yorick Peterse
|
29
27
|
* @since 0.2.6
|
30
|
-
* @param
|
28
|
+
* @param {element} editor The textarea to insert the tags into.
|
31
29
|
*/
|
32
30
|
italic: function(editor)
|
33
31
|
{
|
@@ -39,7 +37,7 @@ Zen.Editor.Markdown = new Class(
|
|
39
37
|
*
|
40
38
|
* @author Yorick Peterse
|
41
39
|
* @since 0.2.6
|
42
|
-
* @param
|
40
|
+
* @param {element} editor The textarea to insert the tags into.
|
43
41
|
*/
|
44
42
|
link: function(editor)
|
45
43
|
{
|
@@ -57,7 +55,7 @@ Zen.Editor.Markdown = new Class(
|
|
57
55
|
*
|
58
56
|
* @author Yorick Peterse
|
59
57
|
* @since 0.2.6
|
60
|
-
* @param
|
58
|
+
* @param {element} editor The textarea to insert the tags into.
|
61
59
|
*/
|
62
60
|
ul: function(editor)
|
63
61
|
{
|
@@ -72,7 +70,7 @@ Zen.Editor.Markdown = new Class(
|
|
72
70
|
*
|
73
71
|
* @author Yorick Peterse
|
74
72
|
* @since 0.2.6
|
75
|
-
* @param
|
73
|
+
* @param {element} editor The textarea to insert the tags into.
|
76
74
|
*/
|
77
75
|
ol: function(editor)
|
78
76
|
{
|
@@ -1,10 +1,8 @@
|
|
1
1
|
/**
|
2
2
|
* Textile driver for the text editor that ships with Zen.
|
3
3
|
*
|
4
|
-
* @author
|
5
|
-
* @since
|
6
|
-
* @namespace Zen
|
7
|
-
* @extend Editor
|
4
|
+
* @author Yorick Peterse
|
5
|
+
* @since 0.2.6
|
8
6
|
*/
|
9
7
|
Zen.Editor.Textile = new Class(
|
10
8
|
{
|
@@ -15,7 +13,7 @@ Zen.Editor.Textile = new Class(
|
|
15
13
|
*
|
16
14
|
* @author Yorick Peterse
|
17
15
|
* @since 0.2.6
|
18
|
-
* @param
|
16
|
+
* @param {element} editor The textarea to insert the tags into.
|
19
17
|
*/
|
20
18
|
bold: function(editor)
|
21
19
|
{
|
@@ -27,7 +25,7 @@ Zen.Editor.Textile = new Class(
|
|
27
25
|
*
|
28
26
|
* @author Yorick Peterse
|
29
27
|
* @since 0.2.6
|
30
|
-
* @param
|
28
|
+
* @param {element} editor The textarea to insert the tags into.
|
31
29
|
*/
|
32
30
|
italic: function(editor)
|
33
31
|
{
|
@@ -39,7 +37,7 @@ Zen.Editor.Textile = new Class(
|
|
39
37
|
*
|
40
38
|
* @author Yorick Peterse
|
41
39
|
* @since 0.2.6
|
42
|
-
* @param
|
40
|
+
* @param {element} editor The textarea to insert the tags into.
|
43
41
|
*/
|
44
42
|
link: function(editor)
|
45
43
|
{
|
@@ -57,7 +55,7 @@ Zen.Editor.Textile = new Class(
|
|
57
55
|
*
|
58
56
|
* @author Yorick Peterse
|
59
57
|
* @since 0.2.6
|
60
|
-
* @param
|
58
|
+
* @param {element} editor The textarea to insert the tags into.
|
61
59
|
*/
|
62
60
|
ul: function(editor)
|
63
61
|
{
|
@@ -72,7 +70,7 @@ Zen.Editor.Textile = new Class(
|
|
72
70
|
*
|
73
71
|
* @author Yorick Peterse
|
74
72
|
* @since 0.2.6
|
75
|
-
* @param
|
73
|
+
* @param {element} editor The textarea to insert the tags into.
|
76
74
|
*/
|
77
75
|
ol: function(editor)
|
78
76
|
{
|
@@ -0,0 +1,143 @@
|
|
1
|
+
/**
|
2
|
+
* Zen.HtmlTable is an extension to the HtmlTable class provided by Mootools
|
3
|
+
* More. This extension makes it possible to sort tables, check all checkboxes
|
4
|
+
* in the first column and so on.
|
5
|
+
*
|
6
|
+
* ## Usage
|
7
|
+
*
|
8
|
+
* The markup required by this class is very basic, in fact, by default it
|
9
|
+
* doesn't need any special markup at all. A simple table with a <thead> element
|
10
|
+
* will do just fine:
|
11
|
+
*
|
12
|
+
* <table id="some_table">
|
13
|
+
* <thead>
|
14
|
+
* <tr>
|
15
|
+
* <th>#</th>
|
16
|
+
* <th>Name</th>
|
17
|
+
* </tr>
|
18
|
+
* </thead>
|
19
|
+
* <tbody>
|
20
|
+
* <tr>
|
21
|
+
* <td>10</td>
|
22
|
+
* <td>Yorick</td>
|
23
|
+
* </tr>
|
24
|
+
* </tbody>
|
25
|
+
* </table>
|
26
|
+
*
|
27
|
+
* Creating the Javascript object for this table would work as following:
|
28
|
+
*
|
29
|
+
* var table = new Zen.HtmlTable($('some_table'));
|
30
|
+
*
|
31
|
+
* For more information on the available options (which can be set in the second
|
32
|
+
* parameter just like HtmlTable) see HtmlTable and HtmlTable.Sort.
|
33
|
+
*
|
34
|
+
* @author Yorick Peterse
|
35
|
+
* @since 0.2.8
|
36
|
+
*/
|
37
|
+
Zen.HtmlTable = new Class(
|
38
|
+
{
|
39
|
+
Extends: HtmlTable,
|
40
|
+
|
41
|
+
/**
|
42
|
+
* Creates a new instance of the class and calls the required methods to
|
43
|
+
* allow users to check all checkboxes in a table.
|
44
|
+
*
|
45
|
+
* @author Yorick Peterse
|
46
|
+
* @since 0.2.8
|
47
|
+
* @see HtmlTable.initialize()
|
48
|
+
*/
|
49
|
+
initialize: function(element, options)
|
50
|
+
{
|
51
|
+
options = Object.merge(this.generateOptions(element), options);
|
52
|
+
|
53
|
+
this.parent(element, options);
|
54
|
+
|
55
|
+
this.enableCheck();
|
56
|
+
},
|
57
|
+
|
58
|
+
/**
|
59
|
+
* Given an HTML element this method returns an object containing various
|
60
|
+
* options that can be passed to the HtmlTable class. These options are set
|
61
|
+
* using various HTML attributes.
|
62
|
+
*
|
63
|
+
* The following attributes can be set on the <table> element:
|
64
|
+
*
|
65
|
+
* * data-sort-index: the index of the column to sort the table on by
|
66
|
+
* default, set to 1 by default.
|
67
|
+
*
|
68
|
+
* The following attributes can be set on each <th> elements:
|
69
|
+
*
|
70
|
+
* * data-sort-parser: the name of the parser to use for the column.
|
71
|
+
*
|
72
|
+
* @author Yorick Peterse
|
73
|
+
* @since 0.2.8
|
74
|
+
* @param {element} element An HTML element that represents a single table.
|
75
|
+
* @return {object}
|
76
|
+
*/
|
77
|
+
generateOptions: function(element)
|
78
|
+
{
|
79
|
+
// Set the default options
|
80
|
+
var options = {
|
81
|
+
classSortSpan : 'sort',
|
82
|
+
classSortable : 'sortable',
|
83
|
+
classHeadSort : 'asc',
|
84
|
+
classHeadSortRev: 'desc',
|
85
|
+
classNoSort : 'no_sort',
|
86
|
+
classZebra : 'odd',
|
87
|
+
sortable : true,
|
88
|
+
parsers : []
|
89
|
+
};
|
90
|
+
|
91
|
+
// Determine the column to sort on by default.
|
92
|
+
options.sortIndex = element.get('data-sort-index') || 1;
|
93
|
+
|
94
|
+
if ( typeOf(options.sortIndex) === 'string' )
|
95
|
+
{
|
96
|
+
options.sortIndex = options.sortIndex.toInt();
|
97
|
+
}
|
98
|
+
|
99
|
+
// Add all custom parsers
|
100
|
+
element.getChildren('thead tr th').each(function(th, index)
|
101
|
+
{
|
102
|
+
var parser = th.get('data-sort-parser');
|
103
|
+
|
104
|
+
if ( parser )
|
105
|
+
{
|
106
|
+
options.parsers[index] = parser;
|
107
|
+
}
|
108
|
+
});
|
109
|
+
|
110
|
+
return options;
|
111
|
+
},
|
112
|
+
|
113
|
+
/**
|
114
|
+
* Creates the required events to allow a user to check a single checkbox in
|
115
|
+
* the table heading which in turn checks all the checkboxes for that column
|
116
|
+
* in each table row.
|
117
|
+
*
|
118
|
+
* @author Yorick Peterse
|
119
|
+
* @since 0.2.8
|
120
|
+
*/
|
121
|
+
enableCheck: function()
|
122
|
+
{
|
123
|
+
var element = this.element;
|
124
|
+
var check_all = element.getElement(
|
125
|
+
'thead tr th:first-child input[type="checkbox"]'
|
126
|
+
);
|
127
|
+
|
128
|
+
if ( check_all )
|
129
|
+
{
|
130
|
+
check_all.addEvent('click', function()
|
131
|
+
{
|
132
|
+
var checked = check_all.get('checked');
|
133
|
+
|
134
|
+
element.getElements(
|
135
|
+
'tbody tr td:first-child input[type="checkbox"]'
|
136
|
+
).each(function(checkbox)
|
137
|
+
{
|
138
|
+
checkbox.set('checked', checked);
|
139
|
+
});
|
140
|
+
});
|
141
|
+
}
|
142
|
+
}
|
143
|
+
});
|
@@ -1,12 +1,12 @@
|
|
1
1
|
/**
|
2
2
|
* Widget that allows developers to create a tab based navigation menu.
|
3
|
-
* The Tabs class supports both normal tabs (fields hidden based on their IDs)
|
4
|
-
* as tabs loaded using Ajax.
|
3
|
+
* The Tabs class supports both normal tabs (fields hidden based on their IDs)
|
4
|
+
* as well as tabs loaded using Ajax.
|
5
5
|
*
|
6
|
-
* In order to use the Tab class you only need some very basic markup. You'll
|
7
|
-
* list element (either ordered or unordered) that will contain all links
|
8
|
-
* in case you're using regular tabs that don't load their content
|
9
|
-
* basic example looks like the following:
|
6
|
+
* In order to use the Tab class you only need some very basic markup. You'll
|
7
|
+
* need a list element (either ordered or unordered) that will contain all links
|
8
|
+
* and a few divs in case you're using regular tabs that don't load their content
|
9
|
+
* using Ajax. The most basic example looks like the following:
|
10
10
|
*
|
11
11
|
* <ul class="tabs">
|
12
12
|
* <li>
|
@@ -18,9 +18,10 @@
|
|
18
18
|
* <p>This is the content of tab #1.</p>
|
19
19
|
* </div>
|
20
20
|
*
|
21
|
-
* When using regular tabs it doesn't matter where you put the divs for the
|
22
|
-
* using the Ajax tabs it's important to remember that the
|
23
|
-
* the closing tags of the unordered/ordered
|
21
|
+
* When using regular tabs it doesn't matter where you put the divs for the
|
22
|
+
* tabs. However, when using the Ajax tabs it's important to remember that the
|
23
|
+
* content will be inserted just after the closing tags of the unordered/ordered
|
24
|
+
* list in a div with a class of "tab_content". Example:
|
24
25
|
*
|
25
26
|
* <ul class="tabs">
|
26
27
|
* <li>
|
@@ -34,16 +35,19 @@
|
|
34
35
|
*
|
35
36
|
* ## Creating and Configuration
|
36
37
|
*
|
37
|
-
* Now that we know how the markup works, let's create some tabs. Doing this is
|
38
|
-
* at a basic level only requires the following code:
|
38
|
+
* Now that we know how the markup works, let's create some tabs. Doing this is
|
39
|
+
* fairly easy and at a basic level only requires the following code:
|
39
40
|
*
|
40
41
|
* Zen.Objects.MyTabs = new Zen.Tabs('css_selector_for_element');
|
41
42
|
*
|
42
|
-
* In this case we're creating a new instance of the Tabs class for an element
|
43
|
-
* The first argument is a simple CSS selector
|
44
|
-
*
|
43
|
+
* In this case we're creating a new instance of the Tabs class for an element
|
44
|
+
* named "css_selector_for_element". The first argument is a simple CSS selector
|
45
|
+
* that defines what element to choose. This means that you can either use a
|
46
|
+
* class or ID name but also a more complicated selector like
|
47
|
+
* "div > ul ul:first-child".
|
45
48
|
*
|
46
|
-
* Let's create another Tab instance but use some custom configuration options
|
49
|
+
* Let's create another Tab instance but use some custom configuration options
|
50
|
+
* this time.
|
47
51
|
*
|
48
52
|
* Zen.Objects.MyTabs = new Zen.Tabs('ul.some_class_name',
|
49
53
|
* {
|
@@ -53,18 +57,15 @@
|
|
53
57
|
*
|
54
58
|
* As you can see there are configuration items available.
|
55
59
|
*
|
56
|
-
* * default: The default tab/tab field to show. Again this is just a CSS
|
57
|
-
* can easily customize it.
|
58
|
-
* * ajax: Boolean that indicates that the tabs should be loaded from an
|
59
|
-
* Ajax.
|
60
|
+
* * default: The default tab/tab field to show. Again this is just a CSS
|
61
|
+
* selector so you can easily customize it.
|
62
|
+
* * ajax: Boolean that indicates that the tabs should be loaded from an
|
63
|
+
* external page using Ajax.
|
60
64
|
*
|
61
65
|
* Special thanks to the guys from #mootools for helping me out :)
|
62
66
|
*
|
63
|
-
* @author
|
64
|
-
* @
|
65
|
-
* @link http://zen-cms.com/ Zen Website
|
66
|
-
* @license http://code.yorickpeterse.com/license.txt The MIT license
|
67
|
-
* @since 0.1
|
67
|
+
* @author Yorick Peterse
|
68
|
+
* @since 0.1
|
68
69
|
*/
|
69
70
|
Zen.Tabs = new Class(
|
70
71
|
{
|
@@ -104,7 +105,8 @@ Zen.Tabs = new Class(
|
|
104
105
|
/**
|
105
106
|
* Array that will contain a list of objects for each tab/field for the
|
106
107
|
* current element. This array will be used when binding events to each
|
107
|
-
* tab so that we don't have to search for these tabs/fields over and over
|
108
|
+
* tab so that we don't have to search for these tabs/fields over and over
|
109
|
+
* again.
|
108
110
|
*
|
109
111
|
* @author Yorick Peterse
|
110
112
|
* @since 0.1
|
@@ -120,7 +122,6 @@ Zen.Tabs = new Class(
|
|
120
122
|
* @since 0.1
|
121
123
|
* @param {string} element The element to use for creating the tabs.
|
122
124
|
* @param {object} options Custom options used when creating the tabs
|
123
|
-
* @return {void}
|
124
125
|
*/
|
125
126
|
initialize: function(element, options)
|
126
127
|
{
|
@@ -146,13 +147,13 @@ Zen.Tabs = new Class(
|
|
146
147
|
},
|
147
148
|
|
148
149
|
/**
|
149
|
-
* Generate a set of normal tabs that will load content that's already on the
|
150
|
-
* In order for these tabs to work your URLs will need to point to an
|
151
|
-
* an ID. These elements will be hidden and shown upon clicking
|
150
|
+
* Generate a set of normal tabs that will load content that's already on the
|
151
|
+
* page. In order for these tabs to work your URLs will need to point to an
|
152
|
+
* element with an ID. These elements will be hidden and shown upon clicking
|
153
|
+
* the corresponding tab.
|
152
154
|
*
|
153
155
|
* @author Yorick Peterse
|
154
156
|
* @since 0.1
|
155
|
-
* @return {void}
|
156
157
|
*/
|
157
158
|
generalTabs: function()
|
158
159
|
{
|
@@ -161,7 +162,8 @@ Zen.Tabs = new Class(
|
|
161
162
|
var self = this;
|
162
163
|
|
163
164
|
// Select our default tab element
|
164
|
-
var default_field = this.element.getElement(self.options['default'])
|
165
|
+
var default_field = this.element.getElement(self.options['default']);
|
166
|
+
default_field = default_field.getElement('a');
|
165
167
|
var links = this.element.getElements('li a');
|
166
168
|
|
167
169
|
this.element.getElement(self.options['default']).addClass('active');
|
@@ -192,7 +194,8 @@ Zen.Tabs = new Class(
|
|
192
194
|
// Now we can add the class to the current tab
|
193
195
|
this.getParent('li').addClass('active');
|
194
196
|
|
195
|
-
// Toggle the state of each tab and ignore any non-existing
|
197
|
+
// Toggle the state of each tab and ignore any non-existing
|
198
|
+
// fields.
|
196
199
|
self.fields.each(function(item)
|
197
200
|
{
|
198
201
|
if ( item === null || item.field === null )
|
@@ -215,13 +218,12 @@ Zen.Tabs = new Class(
|
|
215
218
|
|
216
219
|
/**
|
217
220
|
* Generate a set of tabs of which the content for each tab will be loaded
|
218
|
-
* using an Ajax request. By default the content of these tabs will be
|
219
|
-
* after the element that contains the tabs. This content will be
|
220
|
-
* a div of which the class is "tab_content".
|
221
|
+
* using an Ajax request. By default the content of these tabs will be
|
222
|
+
* inserted after the element that contains the tabs. This content will be
|
223
|
+
* inserted into a div of which the class is "tab_content".
|
221
224
|
*
|
222
225
|
* @author Yorick Peterse
|
223
226
|
* @since 0.1
|
224
|
-
* @return {void}
|
225
227
|
*/
|
226
228
|
ajaxTabs: function()
|
227
229
|
{
|
@@ -230,7 +232,8 @@ Zen.Tabs = new Class(
|
|
230
232
|
var self = this;
|
231
233
|
|
232
234
|
// Select our default tab element
|
233
|
-
var default_link = this.element.getElement(self.options['default'])
|
235
|
+
var default_link = this.element.getElement(self.options['default']);
|
236
|
+
default_link = default_link.getElement('a');
|
234
237
|
var links = this.element.getElements('li a');
|
235
238
|
|
236
239
|
// Create the element that will contain our Ajax response data
|
@@ -1,13 +1,14 @@
|
|
1
1
|
/**
|
2
|
-
* The Window class can be used to create basic windows with a title and a set
|
3
|
-
* These windows can be used for a preview of an article, showing an
|
4
|
-
* confirmation.
|
2
|
+
* The Window class can be used to create basic windows with a title and a set
|
3
|
+
* of buttons. These windows can be used for a preview of an article, showing an
|
4
|
+
* image or asking for a confirmation.
|
5
5
|
*
|
6
6
|
* ## Usage
|
7
7
|
*
|
8
|
-
* In order to create a new window you simply need to create a new instance of
|
9
|
-
* The first parameter is the content to display and is required, the
|
10
|
-
* an object containing all custom options to use such as
|
8
|
+
* In order to create a new window you simply need to create a new instance of
|
9
|
+
* the class. The first parameter is the content to display and is required, the
|
10
|
+
* second parameter is an object containing all custom options to use such as
|
11
|
+
* the title.
|
11
12
|
*
|
12
13
|
* var modal = new Zen.Window('Hello, world!');
|
13
14
|
*
|
@@ -19,14 +20,14 @@
|
|
19
20
|
*
|
20
21
|
* ## Buttons
|
21
22
|
*
|
22
|
-
* Buttons can be added by setting the "buttons" key in the options object to an
|
23
|
-
* objects. Each object should have the following three keys:
|
23
|
+
* Buttons can be added by setting the "buttons" key in the options object to an
|
24
|
+
* array of objects. Each object should have the following three keys:
|
24
25
|
*
|
25
26
|
* * name: the name of the button, also used as the class (should be unique).
|
26
27
|
* * label: the text to display in the button.
|
27
|
-
* * onClick: a function that will be called whenever the button is clicked.
|
28
|
-
* takes a single parameter which is set to the instance of the
|
29
|
-
* to.
|
28
|
+
* * onClick: a function that will be called whenever the button is clicked.
|
29
|
+
* This function takes a single parameter which is set to the instance of the
|
30
|
+
* window the button belongs to.
|
30
31
|
*
|
31
32
|
* An example of setting a button can be seen below.
|
32
33
|
*
|
@@ -60,7 +61,8 @@ Zen.Window = new Class(
|
|
60
61
|
},
|
61
62
|
|
62
63
|
/**
|
63
|
-
* Object containing all the custom options as well as the ones specified by
|
64
|
+
* Object containing all the custom options as well as the ones specified by
|
65
|
+
* the user.
|
64
66
|
*
|
65
67
|
* @author Yorick Peterse
|
66
68
|
* @since 0.2.6
|
@@ -91,7 +93,7 @@ Zen.Window = new Class(
|
|
91
93
|
*
|
92
94
|
* @author Yorick Peterse
|
93
95
|
* @since 0.2.6
|
94
|
-
* @var
|
96
|
+
* @var {element}
|
95
97
|
*/
|
96
98
|
element: null,
|
97
99
|
|
@@ -100,9 +102,9 @@ Zen.Window = new Class(
|
|
100
102
|
*
|
101
103
|
* @author Yorick Peterse
|
102
104
|
* @since 0.2.6
|
103
|
-
* @param
|
104
|
-
* @param
|
105
|
-
* window.
|
105
|
+
* @param {string} content The content to display inside the window.
|
106
|
+
* @param {object} options Object containing a collection of custom options
|
107
|
+
* for the window.
|
106
108
|
*/
|
107
109
|
initialize: function(content, options)
|
108
110
|
{
|
@@ -151,11 +153,13 @@ Zen.Window = new Class(
|
|
151
153
|
// Add all the buttons
|
152
154
|
if ( this.options.buttons.length > 0 )
|
153
155
|
{
|
154
|
-
var buttons_container = new Element(
|
156
|
+
var buttons_container = new Element(
|
157
|
+
'div', {'class': 'buttons clearfix'}
|
158
|
+
);
|
155
159
|
|
156
160
|
this.options.buttons.each(function(button)
|
157
161
|
{
|
158
|
-
var div = new Element('div'
|
162
|
+
var div = new Element('div', {'class': 'button ' + button.name});
|
159
163
|
var btn = new Element('button', {text: button.label});
|
160
164
|
|
161
165
|
btn.addEvent('click', function()
|
@@ -183,8 +187,8 @@ Zen.Window = new Class(
|
|
183
187
|
container.makeDraggable();
|
184
188
|
}
|
185
189
|
|
186
|
-
// Set a negative margin so that the window can be aligned when
|
187
|
-
// absolute.
|
190
|
+
// Set a negative margin so that the window can be aligned when
|
191
|
+
// positioning it absolute.
|
188
192
|
var margin = this.options.width - ( this.options.width * 1.5 );
|
189
193
|
container.setStyle('margin-left', margin);
|
190
194
|
|