effective_form_inputs 0.8.7 → 0.8.8

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: 5e29d7adcba10153ba227c0a57d8f932751c0421
4
- data.tar.gz: e9ce8f96ea31f6c403dc5c7a72e44b3e21dd045a
3
+ metadata.gz: b27b137d43729afe8f73c2ad90f1472a5d7fe72a
4
+ data.tar.gz: beb2a984a5262a8c00e0596c8f9c22d3a04d9657
5
5
  SHA512:
6
- metadata.gz: 072a6b75bed552aaa270adfa8a3b2c4629e9459a29622d7eaaf32f91ee29a8d0fb9a19920ef17f352c583fa51d87176b04a306d5a97fddba2f61a51c1d4c79f6
7
- data.tar.gz: 31e2f0a827ba0aafd096e10983ea9ea1067d4a8e1b386c983c316c0d750aeb13fcd678a999a01164e0074f31b427e07a22cc6b3855c044309a3e14a12147fdb1
6
+ metadata.gz: e41f7b8acc42cef070a9dda74f757c27aca0eb8848bd927af6f39a6c41d1df65eed188313e2e62c891b352ecd162e89f3cf77178bb0e54481beddef6ff51cc4f
7
+ data.tar.gz: 7701c46726dc9b8008ab4c84778b0a573133ff16c37b855a548c27b916a0843ccb59eb3cfa5c17fab96f75917848cf7583048494d858525fcf8b90875e23ec7f
@@ -11,29 +11,33 @@ initialize = ->
11
11
  setupCkeditor = ($inputs) ->
12
12
  return unless $inputs.length > 0
13
13
 
14
+ input_js_options = $inputs.first().data('input-js-options') || {}
15
+
14
16
  ckeditor_present = ((try CKEDITOR.version) || '').length > 0
15
- use_effective_assets = ($inputs.first().data('input-js-options') || {})['effective_assets'] == true
17
+ use_effective_assets = input_js_options['effective_assets'] == true
16
18
  $head = $('head')
17
19
 
18
20
  unless ckeditor_present
19
- $head.append("<script src='/assets/effective_ckeditor.js' />")
20
- $head.append("<link href='/assets/effective_ckeditor.css' type='text/css', media='screen' rel='stylesheet' />")
21
+ $head.append("<link href='#{input_js_options['effective_ckeditor_css_path']}' type='text/css', media='screen' rel='stylesheet' />")
22
+ jQuery.ajax({url: input_js_options['effective_ckeditor_js_path'], dataType: 'script', cache: true, async: false})
21
23
 
22
24
  if use_effective_assets
23
25
  $head.append("
24
26
  <script>
25
- CKEDITOR.config['effective_regions'] = {
26
- 'snippets': {
27
- 'effective_asset': {
28
- 'dialog_url':'/assets/effective/snippets/effective_asset.js',
29
- 'label':'Effective asset',
30
- 'description':'Insert Effective asset',
31
- 'inline':true,
32
- 'editables':false,
33
- 'tag':'span'
34
- }
35
- }
36
- };
27
+ try {
28
+ CKEDITOR.config['effective_regions'] = {
29
+ 'snippets': {
30
+ 'effective_asset': {
31
+ 'dialog_url':'/assets/effective/snippets/effective_asset.js',
32
+ 'label':'Effective asset',
33
+ 'description':'Insert Effective asset',
34
+ 'inline':true,
35
+ 'editables':false,
36
+ 'tag':'span'
37
+ }
38
+ }
39
+ };
40
+ } catch(e) {};
37
41
  </script>
38
42
  ");
39
43
 
@@ -1,10 +1,14 @@
1
1
  module Inputs
2
2
  module EffectiveCkeditorTextArea
3
3
  class Input < Effective::FormInput
4
- delegate :content_tag, :text_area_tag, :to => :@template
4
+ delegate :content_tag, :text_area_tag, :asset_path, :to => :@template
5
5
 
6
6
  def default_input_js
7
- {effective_assets: defined?(EffectiveAssets).present? }
7
+ {
8
+ effective_assets: defined?(EffectiveAssets).present?,
9
+ effective_ckeditor_js_path: asset_path('effective_ckeditor.js'),
10
+ effective_ckeditor_css_path: asset_path('effective_ckeditor.css')
11
+ }
8
12
  end
9
13
 
10
14
  def default_input_html
@@ -1,3 +1,3 @@
1
1
  module EffectiveFormInputs
2
- VERSION = '0.8.7'.freeze
2
+ VERSION = '0.8.8'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_form_inputs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.7
4
+ version: 0.8.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-03 00:00:00.000000000 Z
11
+ date: 2015-12-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails