cambium 0.3.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.txt +1 -1
- data/README.md +339 -15
- data/{lib/generators/cambium/templates/app/assets/javascripts/admin/admin.js.coffee → app/assets/javascripts/cambium/admin/application.js.coffee} +4 -10
- data/app/assets/javascripts/cambium/admin/routers/router.js.coffee +25 -0
- data/app/assets/javascripts/cambium/admin/users.js +2 -0
- data/app/assets/javascripts/cambium/admin/views/dropdown_menu.js.coffee +24 -0
- data/app/assets/javascripts/cambium/admin/views/pickadate.js.coffee +15 -0
- data/app/assets/stylesheets/cambium/admin/application.scss +27 -0
- data/{lib/generators/cambium/templates/app/assets/stylesheets → app/assets/stylesheets/cambium}/admin/bones/bones-config/_colors.scss +7 -7
- data/{lib/generators/cambium/templates/app/assets/stylesheets → app/assets/stylesheets/cambium}/admin/bones/bones.scss +18 -18
- data/app/assets/stylesheets/cambium/admin/partials/_globals.scss +21 -0
- data/app/assets/stylesheets/cambium/admin/partials/activity.scss +52 -0
- data/app/assets/stylesheets/cambium/admin/partials/components.scss +64 -0
- data/app/assets/stylesheets/cambium/admin/partials/dashboard.scss +48 -0
- data/app/assets/stylesheets/cambium/admin/partials/forms.scss +107 -0
- data/app/assets/stylesheets/cambium/admin/partials/header.scss +113 -0
- data/app/assets/stylesheets/cambium/admin/partials/page_title.scss +42 -0
- data/app/assets/stylesheets/cambium/admin/partials/sidebar.scss +41 -0
- data/app/assets/stylesheets/cambium/admin/partials/tables.scss +80 -0
- data/app/assets/stylesheets/cambium/admin/partials/typography.scss +5 -0
- data/app/assets/stylesheets/cambium/admin/partials/wireframe.scss +52 -0
- data/app/assets/stylesheets/cambium/admin/users.css +4 -0
- data/app/controllers/cambium/admin/dashboard_controller.rb +12 -0
- data/app/controllers/cambium/admin/search_controller.rb +9 -0
- data/app/controllers/cambium/admin/users_controller.rb +30 -0
- data/app/controllers/cambium/admin_controller.rb +90 -0
- data/app/helpers/cambium/cambium_helper.rb +205 -0
- data/app/presenters/cambium/admin_presenter.rb +127 -0
- data/app/views/cambium/admin/_activity.html.erb +6 -0
- data/app/views/cambium/admin/_header.html.erb +41 -0
- data/app/views/cambium/admin/_sidebar.html.erb +19 -0
- data/app/views/cambium/admin/_status.html.erb +5 -0
- data/app/views/cambium/admin/dashboard/show.html.erb +5 -0
- data/app/views/cambium/admin/edit.html.erb +7 -0
- data/app/views/cambium/admin/index.html.erb +7 -0
- data/app/views/cambium/admin/new.html.erb +7 -0
- data/app/views/cambium/admin/paper_trail/versions/_version.html.erb +20 -0
- data/app/views/cambium/admin/search/index.html.erb +38 -0
- data/app/views/layouts/admin.html.erb +25 -0
- data/bin/rails +12 -0
- data/cambium.gemspec +19 -15
- data/config/routes.rb +10 -0
- data/lib/cambium/configuration.rb +28 -0
- data/lib/cambium/engine.rb +2 -1
- data/lib/cambium/version.rb +1 -1
- data/lib/cambium.rb +12 -1
- data/lib/generators/cambium/admin_generator.rb +104 -0
- data/lib/generators/cambium/app_generator.rb +205 -0
- data/lib/generators/cambium/controller_generator.rb +81 -0
- data/lib/generators/cambium/gemfile_generator.rb +36 -0
- data/lib/generators/cambium/install_generator.rb +19 -0
- data/lib/generators/cambium/user_generator.rb +40 -0
- data/lib/generators/{cambium/helpers → helpers}/generators_helper.rb +32 -24
- data/lib/generators/templates/Gemfile.erb +79 -0
- data/lib/generators/{cambium/templates/app/assets/javascripts/backbone/app.js.coffee → templates/app/assets/javascripts/application.js.coffee} +9 -1
- data/lib/generators/templates/app/assets/javascripts/views/default_helpers.js.coffee +16 -0
- data/lib/generators/templates/app/assets/stylesheets/admin/admin.scss +3 -0
- data/lib/generators/templates/app/controllers/admin/controller.rb.erb +2 -0
- data/lib/generators/{cambium/templates → templates}/app/controllers/application_controller.rb +1 -5
- data/lib/generators/{cambium/templates → templates}/app/models/user.rb +4 -4
- data/lib/generators/templates/app/views/application/_status.html.erb +3 -0
- data/lib/generators/{cambium/templates → templates}/app/views/layouts/application.html.erb +1 -1
- data/lib/generators/templates/config/admin/controller.yml.erb +24 -0
- data/lib/generators/templates/config/admin/sidebar.yml +9 -0
- data/lib/generators/templates/config/admin/users.yml +31 -0
- data/lib/generators/{cambium/templates → templates}/config/application.rb +6 -4
- data/lib/generators/templates/config/initializers/_hash.rb +23 -0
- data/lib/generators/templates/config/initializers/_settings.rb +18 -0
- data/lib/generators/templates/config/initializers/assets.rb +1 -0
- data/lib/generators/templates/config/initializers/cambium.rb +16 -0
- data/lib/generators/templates/config/private.yml +16 -0
- data/lib/generators/templates/config/routes.rb +54 -0
- data/lib/generators/templates/config/settings.yml +16 -0
- data/lib/generators/{cambium/templates → templates}/gitignore +1 -1
- data/lib/help/cambium_prereqs.txt +13 -0
- data/lib/help/pg_search_post_install.txt +13 -0
- data/lib/{generators/cambium/templates/lib/tasks → tasks}/db.rake +2 -2
- data/lib/{generators/cambium/templates/lib/tasks → tasks}/rename.rake +1 -1
- data/test/controllers/cambium/admin/dashboard_controller_test.rb +9 -0
- data/test/controllers/cambium/admin/users_controller_test.rb +9 -0
- data/test/controllers/cambium/admin_controller_test.rb +9 -0
- metadata +192 -152
- data/bin/cambium +0 -16
- data/lib/generators/cambium/helpers/dependencies_helper.rb +0 -58
- data/lib/generators/cambium/install/admin_generator.rb +0 -110
- data/lib/generators/cambium/install/app_generator.rb +0 -162
- data/lib/generators/cambium/install/config_generator.rb +0 -182
- data/lib/generators/cambium/install/utilities_generator.rb +0 -57
- data/lib/generators/cambium/model/image_generator.rb +0 -67
- data/lib/generators/cambium/model/page_generator.rb +0 -131
- data/lib/generators/cambium/model/post_generator.rb +0 -71
- data/lib/generators/cambium/model/tag_generator.rb +0 -40
- data/lib/generators/cambium/model/user_generator.rb +0 -78
- data/lib/generators/cambium/templates/Gemfile +0 -43
- data/lib/generators/cambium/templates/Gemfile.erb +0 -40
- data/lib/generators/cambium/templates/_partials/pages/admin_icon.rb +0 -6
- data/lib/generators/cambium/templates/app/assets/javascripts/.DS_Store +0 -0
- data/lib/generators/cambium/templates/app/assets/javascripts/admin/collections/.gitkeep +0 -0
- data/lib/generators/cambium/templates/app/assets/javascripts/admin/models/.gitkeep +0 -0
- data/lib/generators/cambium/templates/app/assets/javascripts/admin/models/image.js.coffee +0 -14
- data/lib/generators/cambium/templates/app/assets/javascripts/admin/models/tag.js.coffee +0 -14
- data/lib/generators/cambium/templates/app/assets/javascripts/admin/parser_rules/custom.js +0 -552
- data/lib/generators/cambium/templates/app/assets/javascripts/admin/routers/router.js.coffee +0 -37
- data/lib/generators/cambium/templates/app/assets/javascripts/admin/tag.jst.ejs +0 -7
- data/lib/generators/cambium/templates/app/assets/javascripts/admin/templates/image.jst.ejs +0 -3
- data/lib/generators/cambium/templates/app/assets/javascripts/admin/templates/paginator_controls.jst.ejs +0 -8
- data/lib/generators/cambium/templates/app/assets/javascripts/admin/templates/paginator_nav.jst.ejs +0 -11
- data/lib/generators/cambium/templates/app/assets/javascripts/admin/templates/post_tag.jst.ejs +0 -1
- data/lib/generators/cambium/templates/app/assets/javascripts/admin/views/accordion.js.coffee +0 -33
- data/lib/generators/cambium/templates/app/assets/javascripts/admin/views/counter.js.coffee +0 -25
- data/lib/generators/cambium/templates/app/assets/javascripts/admin/views/dropdown_toggle.js.coffee +0 -16
- data/lib/generators/cambium/templates/app/assets/javascripts/admin/views/image_upload.js.coffee +0 -28
- data/lib/generators/cambium/templates/app/assets/javascripts/admin/views/init_counter.js.coffee +0 -13
- data/lib/generators/cambium/templates/app/assets/javascripts/admin/views/paginator.js.coffee +0 -86
- data/lib/generators/cambium/templates/app/assets/javascripts/admin/views/publishable.js.coffee +0 -12
- data/lib/generators/cambium/templates/app/assets/javascripts/admin/views/tags.js.coffee +0 -158
- data/lib/generators/cambium/templates/app/assets/javascripts/admin/views/wysiwyg.js.coffee +0 -87
- data/lib/generators/cambium/templates/app/assets/javascripts/admin/wysihtml5.js +0 -9521
- data/lib/generators/cambium/templates/app/assets/javascripts/application.js +0 -10
- data/lib/generators/cambium/templates/app/assets/javascripts/backbone/templates/.keep +0 -0
- data/lib/generators/cambium/templates/app/assets/stylesheets/admin/admin.scss +0 -14
- data/lib/generators/cambium/templates/app/assets/stylesheets/admin/partials/_content.scss +0 -88
- data/lib/generators/cambium/templates/app/assets/stylesheets/admin/partials/_form.scss +0 -470
- data/lib/generators/cambium/templates/app/assets/stylesheets/admin/partials/_globals.scss +0 -39
- data/lib/generators/cambium/templates/app/assets/stylesheets/admin/partials/_header.scss +0 -121
- data/lib/generators/cambium/templates/app/assets/stylesheets/admin/partials/_nav.scss +0 -45
- data/lib/generators/cambium/templates/app/assets/stylesheets/admin/partials/_wireframe.scss +0 -24
- data/lib/generators/cambium/templates/app/assets/stylesheets/admin/wysihtml5.css +0 -7
- data/lib/generators/cambium/templates/app/controllers/admin/images_controller.rb +0 -45
- data/lib/generators/cambium/templates/app/controllers/admin/pages_controller.rb +0 -42
- data/lib/generators/cambium/templates/app/controllers/admin/posts_controller.rb +0 -39
- data/lib/generators/cambium/templates/app/controllers/admin/taggings_controller.rb +0 -69
- data/lib/generators/cambium/templates/app/controllers/admin/tags_controller.rb +0 -11
- data/lib/generators/cambium/templates/app/controllers/admin/users_controller.rb +0 -13
- data/lib/generators/cambium/templates/app/controllers/admin_controller.rb +0 -97
- data/lib/generators/cambium/templates/app/controllers/images_controller.rb +0 -45
- data/lib/generators/cambium/templates/app/controllers/pages_controller.rb +0 -12
- data/lib/generators/cambium/templates/app/controllers/posts_controller.rb +0 -11
- data/lib/generators/cambium/templates/app/helpers/admin/pages_controller.rb +0 -47
- data/lib/generators/cambium/templates/app/helpers/admin_helper.rb +0 -121
- data/lib/generators/cambium/templates/app/models/concerns/name.rb +0 -7
- data/lib/generators/cambium/templates/app/models/concerns/title.rb +0 -7
- data/lib/generators/cambium/templates/app/models/image.rb +0 -43
- data/lib/generators/cambium/templates/app/models/page.rb +0 -81
- data/lib/generators/cambium/templates/app/models/post.rb +0 -45
- data/lib/generators/cambium/templates/app/models/tag.rb +0 -33
- data/lib/generators/cambium/templates/app/models/tagging.rb +0 -20
- data/lib/generators/cambium/templates/app/uploaders/image_uploader.rb +0 -91
- data/lib/generators/cambium/templates/app/views/admin/_buttons.html.erb +0 -5
- data/lib/generators/cambium/templates/app/views/admin/_form.html.erb +0 -11
- data/lib/generators/cambium/templates/app/views/admin/_title.html.erb +0 -1
- data/lib/generators/cambium/templates/app/views/admin/edit.html.erb +0 -2
- data/lib/generators/cambium/templates/app/views/admin/images/_image.html.erb +0 -1
- data/lib/generators/cambium/templates/app/views/admin/images/create.js.erb +0 -7
- data/lib/generators/cambium/templates/app/views/admin/images/index.json.jbuilder +0 -4
- data/lib/generators/cambium/templates/app/views/admin/index.html.erb +0 -50
- data/lib/generators/cambium/templates/app/views/admin/new.html.erb +0 -2
- data/lib/generators/cambium/templates/app/views/admin/pages/_form.html.erb +0 -26
- data/lib/generators/cambium/templates/app/views/admin/posts/_form.html.erb +0 -40
- data/lib/generators/cambium/templates/app/views/admin/shared/_footer.html.erb +0 -2
- data/lib/generators/cambium/templates/app/views/admin/shared/_header.html.erb +0 -2
- data/lib/generators/cambium/templates/app/views/admin/shared/_insert_image.html.erb +0 -12
- data/lib/generators/cambium/templates/app/views/admin/shared/_nav.html.erb +0 -12
- data/lib/generators/cambium/templates/app/views/admin/shared/_status.html.erb +0 -3
- data/lib/generators/cambium/templates/app/views/admin/shared/forms/_editor.html.erb +0 -54
- data/lib/generators/cambium/templates/app/views/admin/shared/forms/_form_column_left.html.erb +0 -9
- data/lib/generators/cambium/templates/app/views/admin/shared/forms/_form_column_right.html.erb +0 -9
- data/lib/generators/cambium/templates/app/views/admin/shared/forms/_form_page.html.erb +0 -22
- data/lib/generators/cambium/templates/app/views/admin/shared/forms/_form_section.html.erb +0 -8
- data/lib/generators/cambium/templates/app/views/admin/shared/forms/_publishable.html.erb +0 -33
- data/lib/generators/cambium/templates/app/views/admin/users/_form.html.erb +0 -11
- data/lib/generators/cambium/templates/app/views/application/_status.html.erb +0 -3
- data/lib/generators/cambium/templates/app/views/layouts/.DS_Store +0 -0
- data/lib/generators/cambium/templates/app/views/layouts/admin.html.erb +0 -44
- data/lib/generators/cambium/templates/app/views/page_templates/default.html.erb +0 -2
- data/lib/generators/cambium/templates/app/views/posts/_post.html.erb +0 -4
- data/lib/generators/cambium/templates/app/views/posts/index.html.erb +0 -1
- data/lib/generators/cambium/templates/app/views/posts/show.html.erb +0 -10
- data/lib/generators/cambium/templates/config/app_routes.rb +0 -77
- data/lib/generators/cambium/templates/config/database.mysql2.yml.erb +0 -15
- data/lib/generators/cambium/templates/config/database.pg.yml.erb +0 -14
- data/lib/generators/cambium/templates/config/database.sqlite3.yml.erb +0 -18
- data/lib/generators/cambium/templates/config/initializers/_settings.rb +0 -11
- data/lib/generators/cambium/templates/config/initializers/assets.rb +0 -1
- data/lib/generators/cambium/templates/config/routes.rb.erb +0 -42
- data/lib/generators/cambium/templates/config/settings.yml +0 -15
- data/lib/generators/cambium/templates/config/settings_private.sample.yml +0 -15
- data/lib/generators/cambium/templates/config/settings_private.yml +0 -13
- data/lib/generators/cambium/templates/db/migrate/create_pages.rb.erb +0 -24
- data/lib/generators/cambium/templates/db/migrate/create_posts.rb +0 -19
- data/lib/generators/cambium/templates/lib/.DS_Store +0 -0
- data/lib/help/cambium +0 -7
- /data/{lib/generators/cambium/templates/app/assets/javascripts/backbone/collections → app/assets/javascripts/cambium/admin/templates}/.keep +0 -0
- /data/{lib/generators/cambium/templates/app/assets/javascripts/backbone → app/assets/javascripts/cambium/admin}/views/default_helpers.js.coffee +0 -0
- /data/{lib/generators/cambium/templates/app/assets/stylesheets → app/assets/stylesheets/cambium}/admin/bones/bones-config/__default.scss +0 -0
- /data/{lib/generators/cambium/templates/app/assets/stylesheets → app/assets/stylesheets/cambium}/admin/bones/bones-config/_buttons.scss +0 -0
- /data/{lib/generators/cambium/templates/app/assets/stylesheets → app/assets/stylesheets/cambium}/admin/bones/bones-config/_components.scss +0 -0
- /data/{lib/generators/cambium/templates/app/assets/stylesheets → app/assets/stylesheets/cambium}/admin/bones/bones-config/_forms.scss +0 -0
- /data/{lib/generators/cambium/templates/app/assets/stylesheets → app/assets/stylesheets/cambium}/admin/bones/bones-config/_helpers.scss +0 -0
- /data/{lib/generators/cambium/templates/app/assets/stylesheets → app/assets/stylesheets/cambium}/admin/bones/bones-config/_images.scss +0 -0
- /data/{lib/generators/cambium/templates/app/assets/stylesheets → app/assets/stylesheets/cambium}/admin/bones/bones-config/_nav.scss +0 -0
- /data/{lib/generators/cambium/templates/app/assets/stylesheets → app/assets/stylesheets/cambium}/admin/bones/bones-config/_tables.scss +0 -0
- /data/{lib/generators/cambium/templates/app/assets/stylesheets → app/assets/stylesheets/cambium}/admin/bones/bones-config/_typography.scss +0 -0
- /data/{lib/generators/cambium/templates/app/assets/stylesheets → app/assets/stylesheets/cambium}/admin/bones/bones-config/_wireframe.scss +0 -0
- /data/{lib/generators/cambium/templates/app → app}/models/concerns/idx.rb +0 -0
- /data/{lib/generators/cambium/templates/app → app}/models/concerns/image_cropper.rb +0 -0
- /data/{lib/generators/cambium/templates/app → app}/models/concerns/publishable.rb +0 -0
- /data/{lib/generators/cambium/templates/app → app}/models/concerns/slug.rb +0 -0
- /data/{lib/generators/cambium/templates/app → app}/models/concerns/tags.rb +0 -0
- /data/lib/generators/{cambium/helpers → helpers}/_autoloader.rb +0 -0
- /data/lib/generators/{cambium/templates/app/assets/javascripts/backbone → templates/app/assets/javascripts}/routers/router.js.coffee +0 -0
- /data/lib/generators/{cambium/templates/app/assets/javascripts/backbone/models → templates/app/assets/javascripts/templates}/.keep +0 -0
- /data/lib/generators/{cambium/templates → templates}/app/assets/stylesheets/application.scss +0 -0
- /data/lib/generators/{cambium/templates → templates}/app/views/home/index.html.erb +0 -0
- /data/lib/generators/{cambium/templates → templates}/db/seeds.rb +0 -0
- /data/{lib/generators/cambium/templates/vendor → vendor}/assets/javascripts/modernizr.js +0 -0
- /data/{lib/generators/cambium/templates/vendor → vendor}/assets/stylesheets/normalize.scss +0 -0
@@ -1,552 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Full HTML5 compatibility rule set
|
3
|
-
* These rules define which tags and CSS classes are supported and which tags should be specially treated.
|
4
|
-
*
|
5
|
-
* Examples based on this rule set:
|
6
|
-
*
|
7
|
-
* <a href="http://foobar.com">foo</a>
|
8
|
-
* ... becomes ...
|
9
|
-
* <a href="http://foobar.com" target="_blank" rel="nofollow">foo</a>
|
10
|
-
*
|
11
|
-
* <img align="left" src="http://foobar.com/image.png">
|
12
|
-
* ... becomes ...
|
13
|
-
* <img class="wysiwyg-float-left" src="http://foobar.com/image.png" alt="">
|
14
|
-
*
|
15
|
-
* <div>foo<script>alert(document.cookie)</script></div>
|
16
|
-
* ... becomes ...
|
17
|
-
* <div>foo</div>
|
18
|
-
*
|
19
|
-
* <marquee>foo</marquee>
|
20
|
-
* ... becomes ...
|
21
|
-
* <span>foo</span>
|
22
|
-
*
|
23
|
-
* foo <br clear="both"> bar
|
24
|
-
* ... becomes ...
|
25
|
-
* foo <br class="wysiwyg-clear-both"> bar
|
26
|
-
*
|
27
|
-
* <div>hello <iframe src="http://google.com"></iframe></div>
|
28
|
-
* ... becomes ...
|
29
|
-
* <div>hello </div>
|
30
|
-
*
|
31
|
-
* <center>hello</center>
|
32
|
-
* ... becomes ...
|
33
|
-
* <div class="wysiwyg-text-align-center">hello</div>
|
34
|
-
*/
|
35
|
-
var wysihtml5ParserRules = {
|
36
|
-
/**
|
37
|
-
* CSS Class white-list
|
38
|
-
* Following CSS classes won't be removed when parsed by the wysihtml5 HTML parser
|
39
|
-
*/
|
40
|
-
"classes": {
|
41
|
-
"wysiwyg-clear-both": 1,
|
42
|
-
"wysiwyg-clear-left": 1,
|
43
|
-
"wysiwyg-clear-right": 1,
|
44
|
-
"wysiwyg-color-aqua": 1,
|
45
|
-
"wysiwyg-color-black": 1,
|
46
|
-
"wysiwyg-color-blue": 1,
|
47
|
-
"wysiwyg-color-fuchsia": 1,
|
48
|
-
"wysiwyg-color-gray": 1,
|
49
|
-
"wysiwyg-color-green": 1,
|
50
|
-
"wysiwyg-color-lime": 1,
|
51
|
-
"wysiwyg-color-maroon": 1,
|
52
|
-
"wysiwyg-color-navy": 1,
|
53
|
-
"wysiwyg-color-olive": 1,
|
54
|
-
"wysiwyg-color-purple": 1,
|
55
|
-
"wysiwyg-color-red": 1,
|
56
|
-
"wysiwyg-color-silver": 1,
|
57
|
-
"wysiwyg-color-teal": 1,
|
58
|
-
"wysiwyg-color-white": 1,
|
59
|
-
"wysiwyg-color-yellow": 1,
|
60
|
-
"wysiwyg-float-left": 1,
|
61
|
-
"wysiwyg-float-right": 1,
|
62
|
-
"wysiwyg-font-size-large": 1,
|
63
|
-
"wysiwyg-font-size-larger": 1,
|
64
|
-
"wysiwyg-font-size-medium": 1,
|
65
|
-
"wysiwyg-font-size-small": 1,
|
66
|
-
"wysiwyg-font-size-smaller": 1,
|
67
|
-
"wysiwyg-font-size-x-large": 1,
|
68
|
-
"wysiwyg-font-size-x-small": 1,
|
69
|
-
"wysiwyg-font-size-xx-large": 1,
|
70
|
-
"wysiwyg-font-size-xx-small": 1,
|
71
|
-
"wysiwyg-text-align-center": 1,
|
72
|
-
"wysiwyg-text-align-justify": 1,
|
73
|
-
"wysiwyg-text-align-left": 1,
|
74
|
-
"wysiwyg-text-align-right": 1
|
75
|
-
},
|
76
|
-
/**
|
77
|
-
* Tag list
|
78
|
-
*
|
79
|
-
* The following options are available:
|
80
|
-
*
|
81
|
-
* - add_class: converts and deletes the given HTML4 attribute (align, clear, ...) via the given method to a css class
|
82
|
-
* The following methods are implemented in wysihtml5.dom.parse:
|
83
|
-
* - align_text: converts align attribute values (right/left/center/justify) to their corresponding css class "wysiwyg-text-align-*")
|
84
|
-
* <p align="center">foo</p> ... becomes ... <p> class="wysiwyg-text-align-center">foo</p>
|
85
|
-
* - clear_br: converts clear attribute values left/right/all/both to their corresponding css class "wysiwyg-clear-*"
|
86
|
-
* <br clear="all"> ... becomes ... <br class="wysiwyg-clear-both">
|
87
|
-
* - align_img: converts align attribute values (right/left) on <img> to their corresponding css class "wysiwyg-float-*"
|
88
|
-
*
|
89
|
-
* - remove: removes the element and its content
|
90
|
-
*
|
91
|
-
* - rename_tag: renames the element to the given tag
|
92
|
-
*
|
93
|
-
* - set_class: adds the given class to the element (note: make sure that the class is in the "classes" white list above)
|
94
|
-
*
|
95
|
-
* - set_attributes: sets/overrides the given attributes
|
96
|
-
*
|
97
|
-
* - check_attributes: checks the given HTML attribute via the given method
|
98
|
-
* - url: allows only valid urls (starting with http:// or https://)
|
99
|
-
* - src: allows something like "/foobar.jpg", "http://google.com", ...
|
100
|
-
* - href: allows something like "mailto:bert@foo.com", "http://google.com", "/foobar.jpg"
|
101
|
-
* - alt: strips unwanted characters. if the attribute is not set, then it gets set (to ensure valid and compatible HTML)
|
102
|
-
* - numbers: ensures that the attribute only contains numeric characters
|
103
|
-
*/
|
104
|
-
"tags": {
|
105
|
-
"tr": {
|
106
|
-
"add_class": {
|
107
|
-
"align": "align_text"
|
108
|
-
}
|
109
|
-
},
|
110
|
-
"strike": {
|
111
|
-
"remove": 1
|
112
|
-
},
|
113
|
-
"form": {
|
114
|
-
"rename_tag": "div"
|
115
|
-
},
|
116
|
-
"rt": {
|
117
|
-
"rename_tag": "span"
|
118
|
-
},
|
119
|
-
"code": {},
|
120
|
-
"acronym": {
|
121
|
-
"rename_tag": "span"
|
122
|
-
},
|
123
|
-
"br": {
|
124
|
-
"add_class": {
|
125
|
-
"clear": "clear_br"
|
126
|
-
}
|
127
|
-
},
|
128
|
-
"details": {
|
129
|
-
"rename_tag": "div"
|
130
|
-
},
|
131
|
-
"h4": {
|
132
|
-
"add_class": {
|
133
|
-
"align": "align_text"
|
134
|
-
}
|
135
|
-
},
|
136
|
-
"em": {},
|
137
|
-
"title": {
|
138
|
-
"remove": 1
|
139
|
-
},
|
140
|
-
"multicol": {
|
141
|
-
"rename_tag": "div"
|
142
|
-
},
|
143
|
-
"figure": {
|
144
|
-
"rename_tag": "div"
|
145
|
-
},
|
146
|
-
"xmp": {
|
147
|
-
"rename_tag": "span"
|
148
|
-
},
|
149
|
-
"small": {
|
150
|
-
"rename_tag": "span",
|
151
|
-
"set_class": "wysiwyg-font-size-smaller"
|
152
|
-
},
|
153
|
-
"area": {
|
154
|
-
"remove": 1
|
155
|
-
},
|
156
|
-
"time": {
|
157
|
-
"rename_tag": "span"
|
158
|
-
},
|
159
|
-
"dir": {
|
160
|
-
"rename_tag": "ul"
|
161
|
-
},
|
162
|
-
"bdi": {
|
163
|
-
"rename_tag": "span"
|
164
|
-
},
|
165
|
-
"command": {
|
166
|
-
"remove": 1
|
167
|
-
},
|
168
|
-
"ul": {},
|
169
|
-
"progress": {
|
170
|
-
"rename_tag": "span"
|
171
|
-
},
|
172
|
-
"dfn": {
|
173
|
-
"rename_tag": "span"
|
174
|
-
},
|
175
|
-
"iframe": {
|
176
|
-
"remove": 1
|
177
|
-
},
|
178
|
-
"figcaption": {
|
179
|
-
"rename_tag": "div"
|
180
|
-
},
|
181
|
-
"a": {
|
182
|
-
"check_attributes": {
|
183
|
-
"href": "url" // if you compiled master manually then change this from 'url' to 'href'
|
184
|
-
},
|
185
|
-
"set_attributes": {
|
186
|
-
"rel": "nofollow"
|
187
|
-
}
|
188
|
-
},
|
189
|
-
"img": {
|
190
|
-
"check_attributes": {
|
191
|
-
"width": "numbers",
|
192
|
-
"alt": "alt",
|
193
|
-
"src": "url", // if you compiled master manually then change this from 'url' to 'src'
|
194
|
-
"height": "numbers"
|
195
|
-
},
|
196
|
-
"add_class": {
|
197
|
-
"align": "align_img"
|
198
|
-
}
|
199
|
-
},
|
200
|
-
"rb": {
|
201
|
-
"rename_tag": "span"
|
202
|
-
},
|
203
|
-
"footer": {
|
204
|
-
"rename_tag": "div"
|
205
|
-
},
|
206
|
-
"noframes": {
|
207
|
-
"remove": 1
|
208
|
-
},
|
209
|
-
"abbr": {
|
210
|
-
"rename_tag": "span"
|
211
|
-
},
|
212
|
-
"u": {},
|
213
|
-
"bgsound": {
|
214
|
-
"remove": 1
|
215
|
-
},
|
216
|
-
"sup": {
|
217
|
-
"rename_tag": "span"
|
218
|
-
},
|
219
|
-
"address": {
|
220
|
-
"rename_tag": "div"
|
221
|
-
},
|
222
|
-
"basefont": {
|
223
|
-
"remove": 1
|
224
|
-
},
|
225
|
-
"nav": {
|
226
|
-
"rename_tag": "div"
|
227
|
-
},
|
228
|
-
"h1": {
|
229
|
-
"add_class": {
|
230
|
-
"align": "align_text"
|
231
|
-
}
|
232
|
-
},
|
233
|
-
"head": {
|
234
|
-
"remove": 1
|
235
|
-
},
|
236
|
-
"tbody": {
|
237
|
-
"add_class": {
|
238
|
-
"align": "align_text"
|
239
|
-
}
|
240
|
-
},
|
241
|
-
"dd": {
|
242
|
-
"rename_tag": "div"
|
243
|
-
},
|
244
|
-
"s": {
|
245
|
-
"rename_tag": "span"
|
246
|
-
},
|
247
|
-
"li": {},
|
248
|
-
"td": {
|
249
|
-
"check_attributes": {
|
250
|
-
"rowspan": "numbers",
|
251
|
-
"colspan": "numbers"
|
252
|
-
},
|
253
|
-
"add_class": {
|
254
|
-
"align": "align_text"
|
255
|
-
}
|
256
|
-
},
|
257
|
-
"object": {
|
258
|
-
"remove": 1
|
259
|
-
},
|
260
|
-
"div": {
|
261
|
-
"add_class": {
|
262
|
-
"align": "align_text"
|
263
|
-
}
|
264
|
-
},
|
265
|
-
"option": {
|
266
|
-
"rename_tag": "span"
|
267
|
-
},
|
268
|
-
"select": {
|
269
|
-
"rename_tag": "span"
|
270
|
-
},
|
271
|
-
"i": {},
|
272
|
-
"track": {
|
273
|
-
"remove": 1
|
274
|
-
},
|
275
|
-
"wbr": {
|
276
|
-
"remove": 1
|
277
|
-
},
|
278
|
-
"fieldset": {
|
279
|
-
"rename_tag": "div"
|
280
|
-
},
|
281
|
-
"big": {
|
282
|
-
"rename_tag": "span",
|
283
|
-
"set_class": "wysiwyg-font-size-larger"
|
284
|
-
},
|
285
|
-
"button": {
|
286
|
-
"rename_tag": "span"
|
287
|
-
},
|
288
|
-
"noscript": {
|
289
|
-
"remove": 1
|
290
|
-
},
|
291
|
-
"svg": {
|
292
|
-
"remove": 1
|
293
|
-
},
|
294
|
-
"input": {
|
295
|
-
"remove": 1
|
296
|
-
},
|
297
|
-
"table": {},
|
298
|
-
"keygen": {
|
299
|
-
"remove": 1
|
300
|
-
},
|
301
|
-
"h5": {
|
302
|
-
"add_class": {
|
303
|
-
"align": "align_text"
|
304
|
-
}
|
305
|
-
},
|
306
|
-
"meta": {
|
307
|
-
"remove": 1
|
308
|
-
},
|
309
|
-
"map": {
|
310
|
-
"rename_tag": "div"
|
311
|
-
},
|
312
|
-
"isindex": {
|
313
|
-
"remove": 1
|
314
|
-
},
|
315
|
-
"mark": {
|
316
|
-
"rename_tag": "span"
|
317
|
-
},
|
318
|
-
"caption": {
|
319
|
-
"add_class": {
|
320
|
-
"align": "align_text"
|
321
|
-
}
|
322
|
-
},
|
323
|
-
"tfoot": {
|
324
|
-
"add_class": {
|
325
|
-
"align": "align_text"
|
326
|
-
}
|
327
|
-
},
|
328
|
-
"base": {
|
329
|
-
"remove": 1
|
330
|
-
},
|
331
|
-
"video": {
|
332
|
-
"remove": 1
|
333
|
-
},
|
334
|
-
"strong": {},
|
335
|
-
"canvas": {
|
336
|
-
"remove": 1
|
337
|
-
},
|
338
|
-
"output": {
|
339
|
-
"rename_tag": "span"
|
340
|
-
},
|
341
|
-
"marquee": {
|
342
|
-
"rename_tag": "span"
|
343
|
-
},
|
344
|
-
"b": {},
|
345
|
-
"q": {
|
346
|
-
"check_attributes": {
|
347
|
-
"cite": "url"
|
348
|
-
}
|
349
|
-
},
|
350
|
-
"applet": {
|
351
|
-
"remove": 1
|
352
|
-
},
|
353
|
-
"span": {},
|
354
|
-
"rp": {
|
355
|
-
"rename_tag": "span"
|
356
|
-
},
|
357
|
-
"spacer": {
|
358
|
-
"remove": 1
|
359
|
-
},
|
360
|
-
"source": {
|
361
|
-
"remove": 1
|
362
|
-
},
|
363
|
-
"aside": {
|
364
|
-
"rename_tag": "div"
|
365
|
-
},
|
366
|
-
"frame": {
|
367
|
-
"remove": 1
|
368
|
-
},
|
369
|
-
"section": {
|
370
|
-
"rename_tag": "div"
|
371
|
-
},
|
372
|
-
"body": {
|
373
|
-
"rename_tag": "div"
|
374
|
-
},
|
375
|
-
"ol": {},
|
376
|
-
"nobr": {
|
377
|
-
"rename_tag": "span"
|
378
|
-
},
|
379
|
-
"html": {
|
380
|
-
"rename_tag": "div"
|
381
|
-
},
|
382
|
-
"summary": {
|
383
|
-
"rename_tag": "span"
|
384
|
-
},
|
385
|
-
"var": {
|
386
|
-
"rename_tag": "span"
|
387
|
-
},
|
388
|
-
"del": {
|
389
|
-
"remove": 1
|
390
|
-
},
|
391
|
-
"blockquote": {
|
392
|
-
"check_attributes": {
|
393
|
-
"cite": "url"
|
394
|
-
}
|
395
|
-
},
|
396
|
-
"style": {
|
397
|
-
"remove": 1
|
398
|
-
},
|
399
|
-
"device": {
|
400
|
-
"remove": 1
|
401
|
-
},
|
402
|
-
"meter": {
|
403
|
-
"rename_tag": "span"
|
404
|
-
},
|
405
|
-
"h3": {
|
406
|
-
"add_class": {
|
407
|
-
"align": "align_text"
|
408
|
-
}
|
409
|
-
},
|
410
|
-
"textarea": {
|
411
|
-
"rename_tag": "span"
|
412
|
-
},
|
413
|
-
"embed": {
|
414
|
-
"remove": 1
|
415
|
-
},
|
416
|
-
"hgroup": {
|
417
|
-
"rename_tag": "div"
|
418
|
-
},
|
419
|
-
"font": {
|
420
|
-
"rename_tag": "span",
|
421
|
-
"add_class": {
|
422
|
-
"size": "size_font"
|
423
|
-
}
|
424
|
-
},
|
425
|
-
"tt": {
|
426
|
-
"rename_tag": "span"
|
427
|
-
},
|
428
|
-
"noembed": {
|
429
|
-
"remove": 1
|
430
|
-
},
|
431
|
-
"thead": {
|
432
|
-
"add_class": {
|
433
|
-
"align": "align_text"
|
434
|
-
}
|
435
|
-
},
|
436
|
-
"blink": {
|
437
|
-
"rename_tag": "span"
|
438
|
-
},
|
439
|
-
"plaintext": {
|
440
|
-
"rename_tag": "span"
|
441
|
-
},
|
442
|
-
"xml": {
|
443
|
-
"remove": 1
|
444
|
-
},
|
445
|
-
"h6": {
|
446
|
-
"add_class": {
|
447
|
-
"align": "align_text"
|
448
|
-
}
|
449
|
-
},
|
450
|
-
"param": {
|
451
|
-
"remove": 1
|
452
|
-
},
|
453
|
-
"th": {
|
454
|
-
"check_attributes": {
|
455
|
-
"rowspan": "numbers",
|
456
|
-
"colspan": "numbers"
|
457
|
-
},
|
458
|
-
"add_class": {
|
459
|
-
"align": "align_text"
|
460
|
-
}
|
461
|
-
},
|
462
|
-
"legend": {
|
463
|
-
"rename_tag": "span"
|
464
|
-
},
|
465
|
-
"hr": {},
|
466
|
-
"label": {
|
467
|
-
"rename_tag": "span"
|
468
|
-
},
|
469
|
-
"dl": {
|
470
|
-
"rename_tag": "div"
|
471
|
-
},
|
472
|
-
"kbd": {
|
473
|
-
"rename_tag": "span"
|
474
|
-
},
|
475
|
-
"listing": {
|
476
|
-
"rename_tag": "div"
|
477
|
-
},
|
478
|
-
"dt": {
|
479
|
-
"rename_tag": "span"
|
480
|
-
},
|
481
|
-
"nextid": {
|
482
|
-
"remove": 1
|
483
|
-
},
|
484
|
-
"pre": {},
|
485
|
-
"center": {
|
486
|
-
"rename_tag": "div",
|
487
|
-
"set_class": "wysiwyg-text-align-center"
|
488
|
-
},
|
489
|
-
"audio": {
|
490
|
-
"remove": 1
|
491
|
-
},
|
492
|
-
"datalist": {
|
493
|
-
"rename_tag": "span"
|
494
|
-
},
|
495
|
-
"samp": {
|
496
|
-
"rename_tag": "span"
|
497
|
-
},
|
498
|
-
"col": {
|
499
|
-
"remove": 1
|
500
|
-
},
|
501
|
-
"article": {
|
502
|
-
"rename_tag": "div"
|
503
|
-
},
|
504
|
-
"cite": {},
|
505
|
-
"link": {
|
506
|
-
"remove": 1
|
507
|
-
},
|
508
|
-
"script": {
|
509
|
-
"remove": 1
|
510
|
-
},
|
511
|
-
"bdo": {
|
512
|
-
"rename_tag": "span"
|
513
|
-
},
|
514
|
-
"menu": {
|
515
|
-
"rename_tag": "ul"
|
516
|
-
},
|
517
|
-
"colgroup": {
|
518
|
-
"remove": 1
|
519
|
-
},
|
520
|
-
"ruby": {
|
521
|
-
"rename_tag": "span"
|
522
|
-
},
|
523
|
-
"h2": {
|
524
|
-
"add_class": {
|
525
|
-
"align": "align_text"
|
526
|
-
}
|
527
|
-
},
|
528
|
-
"ins": {
|
529
|
-
"rename_tag": "span"
|
530
|
-
},
|
531
|
-
"p": {
|
532
|
-
"add_class": {
|
533
|
-
"align": "align_text"
|
534
|
-
}
|
535
|
-
},
|
536
|
-
"sub": {
|
537
|
-
"rename_tag": "span"
|
538
|
-
},
|
539
|
-
"comment": {
|
540
|
-
"remove": 1
|
541
|
-
},
|
542
|
-
"frameset": {
|
543
|
-
"remove": 1
|
544
|
-
},
|
545
|
-
"optgroup": {
|
546
|
-
"rename_tag": "span"
|
547
|
-
},
|
548
|
-
"header": {
|
549
|
-
"rename_tag": "div"
|
550
|
-
}
|
551
|
-
}
|
552
|
-
};
|
@@ -1,37 +0,0 @@
|
|
1
|
-
class Admin.Routers.Router extends Backbone.Router
|
2
|
-
|
3
|
-
initialize: =>
|
4
|
-
@autoLoad()
|
5
|
-
|
6
|
-
autoLoad: =>
|
7
|
-
if $(".wysihtml5").length > 0
|
8
|
-
for wysiwyg in $(".wysihtml5")
|
9
|
-
console.log 'wysihtml5'
|
10
|
-
new Admin.Views.Wysiwyg
|
11
|
-
id: $(wysiwyg).children('textarea').attr('id')
|
12
|
-
toolbarID: $(wysiwyg).siblings('.wysihtml5-toolbar').attr('id')
|
13
|
-
image_upload: true
|
14
|
-
url: "/admin/json/images"
|
15
|
-
new Admin.Views.Publishable if $("[class*=_active_date]").length > 0
|
16
|
-
new Admin.Views.InitCounter if $('input').length > 0
|
17
|
-
new Admin.Views.Paginator if $('table').length > 0
|
18
|
-
new Admin.Views.DropdownToggle if $('.dropdown-toggle').length > 0
|
19
|
-
new Admin.Views.Accordion if $('.accordion').length > 0
|
20
|
-
|
21
|
-
routes:
|
22
|
-
'admin': 'initAdmin'
|
23
|
-
"admin/posts": "initPosts"
|
24
|
-
"admin/posts/new": "initNewPost"
|
25
|
-
"admin/posts/:id/edit": "initEditPost"
|
26
|
-
|
27
|
-
initAdmin: =>
|
28
|
-
console.log "Welcome to your CMS, powered by Ruby on Rails and Cambium!"
|
29
|
-
|
30
|
-
initEditPost: (id) =>
|
31
|
-
new Admin.Views.Tags
|
32
|
-
id: id
|
33
|
-
taggable: "Post"
|
34
|
-
url: "/admin/json/posts/#{id}/taggings"
|
35
|
-
|
36
|
-
initNewPost: =>
|
37
|
-
$('#tag-container').closest('.fields').hide()
|
data/lib/generators/cambium/templates/app/assets/javascripts/admin/templates/paginator_nav.jst.ejs
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
<div class="paginav">
|
2
|
-
<div class="jump-to">
|
3
|
-
<input type="submit" id="jump-to" value="Jump!">
|
4
|
-
<input type="text" placeholder="Jump To..." id="jump-to-val">
|
5
|
-
</div>
|
6
|
-
<div class="location">
|
7
|
-
(Page <span class="current">1</span>
|
8
|
-
of
|
9
|
-
<span class="total">?</span>)
|
10
|
-
</div>
|
11
|
-
</div>
|
data/lib/generators/cambium/templates/app/assets/javascripts/admin/templates/post_tag.jst.ejs
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
<li><%= name %><a href="" data-tag="<%= name %>" class="margin-left-medium">x</a></li>
|
data/lib/generators/cambium/templates/app/assets/javascripts/admin/views/accordion.js.coffee
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
class Admin.Views.Accordion extends Backbone.View
|
2
|
-
|
3
|
-
el: '.accordion'
|
4
|
-
|
5
|
-
events:
|
6
|
-
"click a.arrow": "toggleSlide"
|
7
|
-
|
8
|
-
initialize: =>
|
9
|
-
for el in $('.accordion')
|
10
|
-
$(el).children('header').append """
|
11
|
-
<a class="arrow" href="#">
|
12
|
-
<i class="icon icon-arrow-up"></i>
|
13
|
-
</a>
|
14
|
-
"""
|
15
|
-
if $(el).hasClass('closed')
|
16
|
-
$(el).find('.arrow i').toggleClass "icon-arrow-up"
|
17
|
-
$(el).find('.arrow i').toggleClass "icon-arrow-down"
|
18
|
-
$(el).find('.fields').hide()
|
19
|
-
|
20
|
-
toggleSlide: (e) =>
|
21
|
-
e.preventDefault()
|
22
|
-
acc = $(e.target).parents('.accordion')
|
23
|
-
acc.toggleClass "closed"
|
24
|
-
if acc.hasClass "closed"
|
25
|
-
acc.children('.fields').slideUp()
|
26
|
-
else
|
27
|
-
acc.children('.fields').slideDown()
|
28
|
-
if $(e.target).children('.icon').length == 0
|
29
|
-
$(e.target).toggleClass "icon-arrow-up"
|
30
|
-
$(e.target).toggleClass "icon-arrow-down"
|
31
|
-
else
|
32
|
-
$(e.target).children('.icon').toggleClass "icon-arrow-up"
|
33
|
-
$(e.target).children('.icon').toggleClass "icon-arrow-down"
|
@@ -1,25 +0,0 @@
|
|
1
|
-
class Admin.Views.Counter extends Backbone.View
|
2
|
-
|
3
|
-
el: 'body'
|
4
|
-
|
5
|
-
initialize: (options) =>
|
6
|
-
@max = options.max
|
7
|
-
@target = "##{options.target}"
|
8
|
-
@setupCounter()
|
9
|
-
@updateCounter()
|
10
|
-
$(@target).keyup =>
|
11
|
-
@updateCounter()
|
12
|
-
|
13
|
-
setupCounter: =>
|
14
|
-
$(@target).siblings('label').append """
|
15
|
-
(<span class="maxlength">#{@max}</span>)
|
16
|
-
"""
|
17
|
-
@counter = $(@target).siblings('label').children('.maxlength')
|
18
|
-
|
19
|
-
updateCounter: =>
|
20
|
-
charsRemaining = @max - $(@target).val().length
|
21
|
-
$(@counter).html charsRemaining
|
22
|
-
if charsRemaining > 10
|
23
|
-
$(@counter).removeClass('warning')
|
24
|
-
else
|
25
|
-
$(@counter).addClass('warning')
|