effective_regions 1.6.9 → 1.6.10

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c9f82190ecd2296db295d5c696a8b9646f2f9ab7
4
- data.tar.gz: a7e9fdfc4ba4a211b41ff8ac8b8dca12906a95ef
3
+ metadata.gz: 9fdddd53fa7f1c06d80002e54459609dc5d01ce7
4
+ data.tar.gz: 2a030db0aa45f3fc6ab729020e70d524345916e4
5
5
  SHA512:
6
- metadata.gz: c26e21faa582d9d43108516097b74790299757dbe97a8fa4fa5bdbd69a1b07953aa7a92effa12ec31af8f82366617b0852ed4466d236c6f435104d94c5b7c83d
7
- data.tar.gz: 0ca0574207c198bf73edff22c96bfa55d535142b540c007add7c34ee23770e1e40499e280d272894efb15adeade794bb4a4641cff56e9fba818ae08bd12ee35b
6
+ metadata.gz: 82f3a458311e575e5e96a9f6f4677bff2ff37fd5f0d1f96b67f247b28d2a014816fe6e8cc8af84a6bee177619c4017fb24125c461be311e3dc4e298bb4ef6c9f
7
+ data.tar.gz: bc6066d418d52d7e431f252860ee5bf5c0eefbeec165735a50b0860c09d22080e823ee85543db7ee85a7b961cbf2b64cbf3528d72f0d56406b69a9e8558adfb4
data/README.md CHANGED
@@ -552,13 +552,6 @@ and then in your routes.rb:
552
552
  get '/effective/snippets/posts', :to => 'effective/snippets/posts#index'
553
553
  ```
554
554
 
555
- ### Summary
556
-
557
- This Snippet makes an AJAX request to the server and receives a JSON response containing all the Posts. The Posts are displayed in a select drop-down, and when one is chosen, inserted into the given region.
558
-
559
-
560
- ## Snippet Usage
561
-
562
555
  ### Default Content
563
556
 
564
557
  We can pre-populate an effective_region's default content with some posts. These posts will be displayed until a user edits that region and selects some specific posts.
@@ -573,39 +566,9 @@ We can pre-populate an effective_region's default content with some posts. Thes
573
566
 
574
567
  Using the `snippet_locals` approach as above prevents an N+1 query when each snippet has to look up its own post.
575
568
 
576
- ### Inline
577
-
578
- By default, all snippets are wrapped with a block level `<div>`.
579
-
580
- To to use an inline `<span>` wrapper instead, change the snippet model file:
581
-
582
- ```ruby
583
- module Effective
584
- module Snippets
585
- class CurrentUserInfo < Snippet
586
- attribute :display_method, String
587
-
588
- def snippet_tag
589
- :span
590
- end
591
-
592
- end
593
- end
594
- end
595
- ```
596
-
597
- ### Javascript event
598
-
599
- Watch for the `effectiveSnippetReady` event to run custom javascript after a snippet has been initialized.
600
-
601
- This event is fired once for each snippet, after the page has loaded, and the snippet is completely displayed.
602
-
603
- It is also fired after the OK button is clicked on the dialog screen.
569
+ ### Summary
604
570
 
605
- ```coffeescript
606
- $(document).on 'effectiveSnippetReady', (event, snippet, element) ->
607
- $(element).html('overwrite the entire content')
608
- ```
571
+ This Snippet makes an AJAX request to the server and receives a JSON response containing all the Posts. The Posts are displayed in a select drop-down, and when one is chosen, inserted into the given region.
609
572
 
610
573
 
611
574
  ## Templates
@@ -103,11 +103,6 @@ module EffectiveRegionsHelper
103
103
  content = render(:partial => snippet.to_partial_path, :object => snippet, :locals => {:snippet => snippet})
104
104
  end
105
105
 
106
- if content.present?
107
- binding.pry
108
- content += render(:partial => 'effective_regions/snippet_ready_javascript', :locals => {:snippet => snippet})
109
- end
110
-
111
106
  if effectively_editing? && can_edit
112
107
  content_tag(snippet.snippet_tag, content, :data => {'effective-snippet' => snippet.class_name, 'snippet-data' => snippet.data().to_json})
113
108
  else
@@ -30,11 +30,10 @@ module Effective
30
30
 
31
31
  Effective::Region.with_snippets
32
32
  .where("#{EffectiveRegions.regions_table_name}.snippets ILIKE ?", "%class_name: #{name}%")
33
- .map(&:snippet_objects)
34
- .flatten
33
+ .flat_map { |region| region.snippet_objects }
35
34
  .select { |snippet| snippet.class_name == name }
36
35
  else
37
- Effective::Region.with_snippets.map(&:snippet_objects).flatten
36
+ Effective::Region.with_snippets.flat_map { |region| region.snippet_objects }
38
37
  end
39
38
  end
40
39
 
@@ -1,3 +1,3 @@
1
1
  module EffectiveRegions
2
- VERSION = '1.6.9'.freeze
2
+ VERSION = '1.6.10'.freeze
3
3
  end
metadata CHANGED
@@ -1,69 +1,69 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_regions
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.9
4
+ version: 1.6.10
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: 2016-02-18 00:00:00.000000000 Z
11
+ date: 2016-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 3.2.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: 3.2.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: effective_ckeditor
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: 1.7.4
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: 1.7.4
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: haml-rails
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: virtus
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  description: Create editable content regions within your existing, ordinary ActionView::Base
@@ -95,7 +95,6 @@ files:
95
95
  - app/views/effective/snippets/_current_user_info.html.haml
96
96
  - app/views/effective/templates/_image_and_title.html.haml
97
97
  - app/views/effective_regions/_include_tags_javascript.html.haml
98
- - app/views/effective_regions/_snippet_ready_javascript.html.haml
99
98
  - config/routes.rb
100
99
  - db/migrate/01_create_effective_regions.rb.erb
101
100
  - lib/effective_regions.rb
@@ -151,17 +150,17 @@ require_paths:
151
150
  - lib
152
151
  required_ruby_version: !ruby/object:Gem::Requirement
153
152
  requirements:
154
- - - '>='
153
+ - - ">="
155
154
  - !ruby/object:Gem::Version
156
155
  version: '0'
157
156
  required_rubygems_version: !ruby/object:Gem::Requirement
158
157
  requirements:
159
- - - '>='
158
+ - - ">="
160
159
  - !ruby/object:Gem::Version
161
160
  version: '0'
162
161
  requirements: []
163
162
  rubyforge_project:
164
- rubygems_version: 2.4.6
163
+ rubygems_version: 2.4.5.1
165
164
  signing_key:
166
165
  specification_version: 4
167
166
  summary: Create editable content regions within your existing, ordinary ActionView::Base
@@ -1,7 +0,0 @@
1
- :javascript
2
- $(document).on('ready', function() {
3
- console.log;
4
- console.log($(this));
5
- console.log($(this).parent('script').parent());
6
- $(document).trigger('effectiveSnippetReady');
7
- });