simple_form_extension 1.0.1 → 1.0.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: cd6ebc653068a82c826a7b64d2a490c772a11bc8
4
- data.tar.gz: b94a074230506ffaf6d9f0d6fa08268ea62b0210
3
+ metadata.gz: ea59ede6a94b45cc916f9893e98d6d52d14d82fb
4
+ data.tar.gz: 468d96632eec854fe28ed4418de68d70a611d156
5
5
  SHA512:
6
- metadata.gz: 1a94db520d3eabee92fa9c28d5e322286fe1800293ba2575a89cc2c8a358f79f1c3dbeb980248ad1310b1e8752319d86432d4d7a2cd9851760141cade0ccf836
7
- data.tar.gz: 52694a893078b855a2e90d90dc502a610e3463b60111d0324c47d465c3d4509b7af5a780fc98e250411b192e8338b37e691172cf45054e31de9ed5c52da4f5f9
6
+ metadata.gz: a33fa18e43b25bb9b5e47803f34965969650095f60bce5ff942502fdf36fc4930923f3e78955835f82d26f0ad88dd12f94d6c17124130ce75a44ba7404402af9
7
+ data.tar.gz: 80e416972028cf6a8e2d317f2dc17a0df8718e068b1342ad3bd0cd2234a326d96ed7a3e1d5e51facecdc3d7a5731bd755f655654860c900305b8e1bfd3673ece
@@ -10,6 +10,7 @@ module SimpleFormExtension
10
10
 
11
11
  def copy_locales
12
12
  template "config/locales/simple_form_extension.en.yml"
13
+ template "config/locales/simple_form_extension.fr.yml"
13
14
  end
14
15
  end
15
16
  end
@@ -0,0 +1,9 @@
1
+ fr:
2
+ simple_form:
3
+ extension:
4
+ file:
5
+ select: "Sélectionnez un fichier"
6
+ change: "Changer"
7
+ image:
8
+ select: "Sélectionnez une image"
9
+ change: "Changer"
@@ -13,8 +13,8 @@ module SimpleFormExtension
13
13
  </div>
14
14
  <div class=\"input-group-btn\">
15
15
  <div class=\"btn btn-default btn-file\" type=\"button\">
16
- <span class=\"fileinput-new\">#{ translate('file.select') }</span>
17
- <span class=\"fileinput-exists\">#{ translate('file.change') }</span>
16
+ <span class=\"fileinput-new\">#{ _translate('file.select') }</span>
17
+ <span class=\"fileinput-exists\">#{ _translate('file.change') }</span>
18
18
  #{@builder.file_field(attribute_name, input_html_options)}
19
19
  </div>
20
20
  <button class=\"btn btn-danger fileinput-exists\" data-dismiss=\"fileinput\" type=\"button\"><i class=\"fa fa-times\"></i></button>
@@ -9,8 +9,8 @@ module SimpleFormExtension
9
9
  "<div class=\"fileinput fileinput-new\" data-provides=\"fileinput\">
10
10
  <div class=\"\">
11
11
  <div class=\"btn btn-default btn-file\" type=\"button\">
12
- <span class=\"fileinput-new\">#{ translate('image.select') }</span>
13
- <span class=\"fileinput-exists\">#{ translate('image.change') }</span>
12
+ <span class=\"fileinput-new\">#{ _translate('image.select') }</span>
13
+ <span class=\"fileinput-exists\">#{ _translate('image.change') }</span>
14
14
  #{@builder.file_field(attribute_name, input_html_options)}
15
15
  </div>
16
16
  <button class=\"btn btn-danger fileinput-exists pull-right\" data-dismiss=\"fileinput\" type=\"button\"><i class=\"fa fa-times\"></i></button>
@@ -1,6 +1,6 @@
1
1
  module SimpleFormExtension
2
2
  module Translations
3
- def translate(key, options = {})
3
+ def _translate(key, options = {})
4
4
  I18n.translate(['simple_form.extension', key].join('.'))
5
5
  end
6
6
  end
@@ -1,3 +1,3 @@
1
1
  module SimpleFormExtension
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
@@ -5,12 +5,19 @@ initRedactor = ->
5
5
  if (csrf_param isnt undefined and csrf_token isnt undefined)
6
6
  params = csrf_param + "=" + encodeURIComponent(csrf_token);
7
7
 
8
- $('[data-redactor]').redactor(
9
- imageUpload: "/redactor_rails/pictures?" + params
10
- imageGetJson: "/redactor_rails/pictures"
11
- path: "/assets/redactor-rails"
12
- css: "style.css"
13
- )
8
+ $('[data-redactor]').each (i, el) ->
9
+ $textArea = $(el)
10
+ # Avoid double initialization
11
+ unless $textArea.data('initialized.redactor')
12
+ $textArea.redactor
13
+ imageUpload: ["/redactor_rails/pictures", params].join('?')
14
+ imageGetJson: "/redactor_rails/pictures"
15
+ path: "/assets/redactor-rails"
16
+ css: "style.css"
17
+ $textArea.data('initialized.redactor', true)
14
18
 
15
- $(document).ready(initRedactor);
16
- $(window).bind('page:change', initRedactor);
19
+
20
+ $(document).ready ->
21
+ initRedactor() if Turbolinks is undefined
22
+
23
+ $(document).on('page:change', initRedactor);
@@ -1,2 +1,2 @@
1
- #= require redactor-rails/redactor
1
+ #= require redactor-rails/redactor.min
2
2
  #= require_tree ./simple_form_extension
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_form_extension
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexandre Vasseur
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-11 00:00:00.000000000 Z
11
+ date: 2014-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -96,6 +96,7 @@ files:
96
96
  - lib/generators/simple_form_extension/install_generator.rb
97
97
  - lib/generators/simple_form_extension/templates/config/initializers/simple_form_extension.rb
98
98
  - lib/generators/simple_form_extension/templates/config/locales/simple_form_extension.en.yml
99
+ - lib/generators/simple_form_extension/templates/config/locales/simple_form_extension.fr.yml
99
100
  - lib/simple_form_extension.rb
100
101
  - lib/simple_form_extension/.DS_Store
101
102
  - lib/simple_form_extension/components.rb