bootsy 1.1.0 → 1.2.0

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: d39459ba06843f6310669394df4e9e02390e83a3
4
- data.tar.gz: 7a3bf0f12f9d4c8b14a4ccc6c5cb035d51d309ff
3
+ metadata.gz: 06d4f6c3c4baaff130fb3321a969e1090706013e
4
+ data.tar.gz: 75b66ce2924940d0d4b56a236adfac9de8651c0e
5
5
  SHA512:
6
- metadata.gz: 2ad8bb69fa7cdb0c75624e220ee4b64ae4b343e6601f8bc290a3518e39f8d08cedddaaae3812559bfce82486cef7d2daf4717be64cbc5c7a3938bd265a5aad38
7
- data.tar.gz: 7624652a602ce80baf4a2b2d724c6fe54960d072386bcc7ff8ab3b97accdaecc8f0a9e7cf3e091925a495dd65f89c076ac5de99dba44a978c402299ec7ed6b96
6
+ metadata.gz: e50200981071659ce01e15a40ab22f19b98c0910ec187ffb07cc41830b25f997071afacf374bfbc6532455d10af75a8b9ec3582b2729f5bb3ba87deba6ff1ac4
7
+ data.tar.gz: 8e1dd14d053308773af5ca8db3cb7debe28ebf2619d8e7ac3f8f47063881cdcba67d79b5f8fab327246ac95f63871cb234f798c397694e122ff9044b4c2d2b80
data/README.md CHANGED
@@ -46,10 +46,10 @@ rake db:migrate
46
46
  Just call the brand new method `bootsy_area` in your `FormBuilder` instances, the same way you'd call the basic `textarea` method. Example:
47
47
  ```erb
48
48
  <%= form_for(@post) do |f| %>
49
- <%= f.label :title %><br />
49
+ <%= f.label :title %>
50
50
  <%= f.text_field :title %>
51
51
 
52
- <%= f.label :content %><br />
52
+ <%= f.label :content %>
53
53
  <%= f.bootsy_area :content %>
54
54
 
55
55
  <%= f.submit %>
@@ -74,6 +74,21 @@ def post_params
74
74
  end
75
75
  ```
76
76
 
77
+
78
+ ## Bootsy with SimpleForm builders
79
+
80
+ Just use the brand new input type `bootsy` in your `SimpleForm::FormBuilder` instances, in the same way you would use the basic `text` input. Example:
81
+ ```erb
82
+ <%= simple_form_for @post do |f| %>
83
+ <%= f.input :title %>
84
+
85
+ <%= f.input :content, as: :bootsy %>
86
+
87
+ <%= f.button :submit %>
88
+ <% end %>
89
+ ```
90
+
91
+
77
92
  ## Editor options
78
93
 
79
94
  It is possible to customize how the editor is displayed and its behavior by passing a hash `editor_options` to your `bootsy_area`.
@@ -110,16 +125,6 @@ You can set the default editor options, image sizes available (small, medium, la
110
125
  Bootsy defines some i18n keys. The english translation is automatically added to your `config/locales` directory as `bootsy.en.yml`. You can follow that template in order to translate Bootsy to your language. You can find some examples [here](https://github.com/volmer/bootsy/tree/master/config/locales). It is also necessary to add a translation for Bootstrap-wysihtml5, the javascript editor, in your assets pipeline. Instructions [here](https://github.com/jhollingworth/bootstrap-wysihtml5#i18n). If you are using the alert for unsaved changes, you have to define a translation for it as well. Just follow [this example](https://github.com/volmer/bootsy/tree/master/app/assets/bootsy/locales/bootsy.pt-BR.js).
111
126
 
112
127
 
113
- ## Mongoid support
114
-
115
- By default, Bootsy only supports ActiveRecord. In order to use Bootsy with Mongoid, please use [Bootsy-Mongoid](https://github.com/volmer/bootsy-mongoid) instead.
116
-
117
-
118
- ## Bootsy with SimpleForm
119
-
120
- Do you want to use Bootsy alongside with [SimpleForm](https://github.com/plataformatec/simple_form)? Take a look at [Bootsy-SimpleForm](https://github.com/volmer/bootsy-simple_form).
121
-
122
-
123
128
  ## License
124
129
 
125
130
  MIT License. Copyright 2013 Volmer Soares
@@ -1,8 +1,11 @@
1
1
  window.Bootsy = window.Bootsy || {};
2
2
 
3
- $(function(){
3
+ Bootsy.init = function() {
4
4
  Bootsy.areas = [];
5
+
5
6
  $('textarea.bootsy_text_area').each(function() {
6
7
  Bootsy.areas.push(new Bootsy.Area($(this)));
7
8
  });
8
- });
9
+ };
10
+
11
+ $(Bootsy.init);
data/lib/bootsy.rb CHANGED
@@ -6,6 +6,8 @@ require 'bootsy/form_helper'
6
6
  require 'bootsy/form_builder'
7
7
  require 'bootsy/core_ext'
8
8
 
9
+ autoload :BootsyInput, 'bootsy/simple_form/bootsy_input'
10
+
9
11
  module Bootsy
10
12
  ## CONFIGURATION OPTIONS
11
13
 
@@ -0,0 +1,11 @@
1
+ require 'simple_form'
2
+
3
+ class BootsyInput < SimpleForm::Inputs::Base
4
+ enable :placeholder, :maxlength, :container, :editor_options, :uploader
5
+
6
+ def input
7
+ bootsy_params = [:editor_options, :container, :uploader]
8
+ input_html_options.merge! input_options.select {|k,v| bootsy_params.include? k }
9
+ @builder.bootsy_area attribute_name, input_html_options
10
+ end
11
+ end
@@ -1,3 +1,3 @@
1
1
  module Bootsy
2
- VERSION = '1.1.0'
2
+ VERSION = '1.2.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bootsy
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Volmer Soares
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-14 00:00:00.000000000 Z
11
+ date: 2013-09-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mini_magick
@@ -100,28 +100,28 @@ dependencies:
100
100
  requirements:
101
101
  - - ~>
102
102
  - !ruby/object:Gem::Version
103
- version: '1.3'
103
+ version: '1.4'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - ~>
109
109
  - !ruby/object:Gem::Version
110
- version: '1.3'
110
+ version: '1.4'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: shoulda-matchers
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - ~>
116
116
  - !ruby/object:Gem::Version
117
- version: '2.2'
117
+ version: '2.3'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - ~>
123
123
  - !ruby/object:Gem::Version
124
- version: '2.2'
124
+ version: '2.3'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: selenium-webdriver
127
127
  requirement: !ruby/object:Gem::Requirement
@@ -180,6 +180,7 @@ files:
180
180
  - lib/bootsy/engine.rb
181
181
  - lib/bootsy/form_builder.rb
182
182
  - lib/bootsy/form_helper.rb
183
+ - lib/bootsy/simple_form/bootsy_input.rb
183
184
  - lib/bootsy/version.rb
184
185
  - lib/bootsy.rb
185
186
  - lib/generators/bootsy/install_generator.rb