cambium 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/cambium/version.rb +1 -1
- data/lib/generators/cambium/templates/app/assets/javascripts/admin/routers/router.js.coffee +5 -1
- data/lib/generators/cambium/templates/app/assets/javascripts/admin/views/wysiwyg.js.coffee +2 -2
- data/lib/generators/cambium/templates/app/helpers/admin_helper.rb +3 -2
- data/lib/generators/cambium/templates/app/views/admin/shared/forms/_editor.html.erb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8f60d6aff0476c3c97b3267f814543c225fd7ca9
|
4
|
+
data.tar.gz: 18f3fd992da17518053511cf2c5c926a217a3b5a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e4269547de6fc09cf705426b9395c0ef956a8ca224a903a7f1784e5d1b073f9ac4b16fda78a2bbd4fbc0d1886cb026b1e282e05b9c6c8189ee55bd2db3678bf
|
7
|
+
data.tar.gz: c659f23c1fc62a72b538c9ec0dc13982f8a53adbb0b551c93ca1a10fd0b12c934b44776d442db839ad7543d9c0ddeef69ecd093b64c8c433d4b80a1d1299a313
|
data/lib/cambium/version.rb
CHANGED
@@ -4,7 +4,11 @@ class Admin.Routers.Router extends Backbone.Router
|
|
4
4
|
@autoLoad()
|
5
5
|
|
6
6
|
autoLoad: =>
|
7
|
-
|
7
|
+
if $(".wysihtml5").length > 0
|
8
|
+
for wysiwyg in $(".wysihtml5")
|
9
|
+
new Admin.Views.Wysiwyg
|
10
|
+
id: $(wysiwyg).children('textarea').attr('id')
|
11
|
+
toolbarID: $(wysiwyg).siblings('.wysihtml5-toolbar').attr('id')
|
8
12
|
new Admin.Views.Publishable if $("[class*=_active_date]").length > 0
|
9
13
|
new Admin.Views.InitCounter if $('input').length > 0
|
10
14
|
new Admin.Views.Paginator if $('table').length > 0
|
@@ -4,7 +4,7 @@ class Admin.Views.Wysiwyg extends Backbone.View
|
|
4
4
|
textarea: '.wysiwyg'
|
5
5
|
|
6
6
|
initialize: (options) =>
|
7
|
-
editor = new wysihtml5.Editor
|
8
|
-
toolbar:
|
7
|
+
editor = new wysihtml5.Editor options.id, #textarea-id
|
8
|
+
toolbar: options.toolbarID # id of toolbar element
|
9
9
|
parserRules: wysihtml5ParserRules # defined in parser rules set
|
10
10
|
stylesheets: [ WYSIWYG_BASE_STYLES, WYSIWYG_CUSTOM_STYLES ] # defined in admin.html.erb
|
@@ -53,8 +53,9 @@ module AdminHelper
|
|
53
53
|
:title => title, :content => capture(&block) }
|
54
54
|
end
|
55
55
|
|
56
|
-
def wysiwyg(form, field = :body)
|
57
|
-
render :partial => 'admin/shared/forms/editor', :locals => {
|
56
|
+
def wysiwyg(form, field = :body, idx = 1)
|
57
|
+
render :partial => 'admin/shared/forms/editor', :locals => {
|
58
|
+
:f => form, :field => field, :idx => idx }
|
58
59
|
end
|
59
60
|
|
60
61
|
def publishable_fields(form)
|
@@ -49,6 +49,6 @@
|
|
49
49
|
|
50
50
|
</div>
|
51
51
|
|
52
|
-
<%= f.input field, :label => false, :input_html => {
|
52
|
+
<%= f.input field, :as => :text, :label => false, :input_html => {
|
53
53
|
:id => "wysihtml5-textarea-#{idx}", :class => 'wysihtml5-textarea' },
|
54
54
|
:wrapper_html => { :class => "wysihtml5" } %>
|