cambium 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0c3811b2667e138413fb5b2bc60b82416fe1e812
4
- data.tar.gz: ccadfe455992bb9376d2ae8e90428074476209a4
3
+ metadata.gz: 8f60d6aff0476c3c97b3267f814543c225fd7ca9
4
+ data.tar.gz: 18f3fd992da17518053511cf2c5c926a217a3b5a
5
5
  SHA512:
6
- metadata.gz: 5e39c637dd01a8755a0b39d5179f588e81629cb77b2bf3ee1faa874cc583036a742d7bbc5d5560bea43b1862ac831113675455e6a2c7ffee971e3d30b463183e
7
- data.tar.gz: 5543cb93cdf532193421ea437091a0e4e5453073fa1915099624383b2cb89b2accc53ae146266bbf22a19abe52482d11dc1f4345f5ee00a9f2044c329c46bce2
6
+ metadata.gz: 9e4269547de6fc09cf705426b9395c0ef956a8ca224a903a7f1784e5d1b073f9ac4b16fda78a2bbd4fbc0d1886cb026b1e282e05b9c6c8189ee55bd2db3678bf
7
+ data.tar.gz: c659f23c1fc62a72b538c9ec0dc13982f8a53adbb0b551c93ca1a10fd0b12c934b44776d442db839ad7543d9c0ddeef69ecd093b64c8c433d4b80a1d1299a313
@@ -1,3 +1,3 @@
1
1
  module Cambium
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
@@ -4,7 +4,11 @@ class Admin.Routers.Router extends Backbone.Router
4
4
  @autoLoad()
5
5
 
6
6
  autoLoad: =>
7
- new Admin.Views.Wysiwyg if $(".wysihtml5").length > 0
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 "wysihtml5-textarea", #textarea-id
8
- toolbar: "wysihtml5-toolbar" # id of toolbar element
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 => { :f => form, :field => field }
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" } %>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cambium
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean C Davis