tb_banners 1.1.5 → 1.1.6

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: a46f87c6d2c6bc161da7d1d2948d5a601e986298
4
- data.tar.gz: 2a84a2035397ceef9899c8411c212f798f8cb029
3
+ metadata.gz: 50d873e8b6bba3f5f08288918c8100c5546b9057
4
+ data.tar.gz: daadd24a362d3186dfebb7f5dcb394472f0260c2
5
5
  SHA512:
6
- metadata.gz: e45015bd7458996b6d8e3fcc3a84526462cbcb38416030ac75998cffa4883169eee1dc55a4b1c2e4780dbda3391360be84d64c0d792df75eb4c1b0e504d334cf
7
- data.tar.gz: b050dd66e50d72322c0a9b379d48b5685c73124416c1d4f4210b61702bdd33c12af616c793011e10182fbfd19913abcbef26d729aafbd973501a35d76291b2a3
6
+ metadata.gz: 2482155bf98292c20eb8a57b25f90f5d3a530543a548e0e4b8a5e7cae11b23f685e9e892e9e82a339ee782e4768450aaabc3b6da0d76c137d60d1c4d67da3de0
7
+ data.tar.gz: 3b054e98e9dd8d2f4bc2de4ae5f07dc98985d5ba8ed1dc4bb40030fa957a3e1b89619ddb82cd1a5fe6109c3d4e0aac1ea8d07c6ca360c8d27d045a70a3b6f7be
data/README.markdown CHANGED
@@ -48,7 +48,12 @@ A number of view helpers are provided for displaying banners in your templates.
48
48
 
49
49
  `spud_banners_for_set(set_or_identifier, options)`
50
50
 
51
- Accepts the banner set name as a String or Symbol and returns an html template. Options hash accepts a `:limit` parameter for limiting the number of banners returned. This helper also accepts a block argument for rendering custom html.
51
+ Accepts the banner set name as a String or Symbol and returns an html template. This helper also accepts a block argument for rendering custom html.
52
+
53
+ **Options:**
54
+
55
+ - `limit`: Limit how many banners you wish to render
56
+ - `background_image`: Pass `true` in order to render the banners as divs with css background images instead of image tags. Defaults to `false`. **This is required when rendering banners with rich text.**
52
57
 
53
58
  ```ruby
54
59
  spud_banner_tag(banner)
@@ -23,6 +23,20 @@ spud.admin.banners = new function(){
23
23
  stop: self.sortedBanners,
24
24
  helper: fixHelper
25
25
  });
26
+
27
+ /*
28
+ * Workaround for bug when using Bootstrap 2 + Tinymce 4 that prevents the creation of hyperlinks while
29
+ * running in a modal dialog
30
+ *
31
+ * See: http://stackoverflow.com/questions/18111582/tinymce-4-links-plugin-modal-in-not-editable
32
+ *
33
+ * NOTE: REMOVE THIS CODE WHEN UPGRADING TO BOOTSTRAP 3
34
+ */
35
+ $(document).on('focusin', function(e) {
36
+ if($(e.target).closest(".mce-window").length){
37
+ e.stopImmediatePropagation();
38
+ }
39
+ });
26
40
  };
27
41
 
28
42
  // http://www.foliotek.com/devblog/make-table-rows-sortable-using-jquery-ui-sortable/
@@ -44,6 +58,7 @@ spud.admin.banners = new function(){
44
58
  title: 'Upload Banner',
45
59
  html: html
46
60
  });
61
+ initForm();
47
62
  }
48
63
  });
49
64
  };
@@ -60,6 +75,7 @@ spud.admin.banners = new function(){
60
75
  title: 'Edit Banner',
61
76
  html: html
62
77
  });
78
+ initForm();
63
79
  }
64
80
  });
65
81
  };
@@ -167,6 +183,7 @@ spud.admin.banners = new function(){
167
183
 
168
184
  self.onLegacyUploadError = function(html){
169
185
  $('.spud_banner_form').replaceWith(html);
186
+ initForm();
170
187
  };
171
188
 
172
189
  self.sortedBanners = function(e, ui){
@@ -184,9 +201,10 @@ spud.admin.banners = new function(){
184
201
  // Form Page
185
202
  ////////////
186
203
 
187
- this.form = function(){
204
+ var initForm = function(){
188
205
  var richText = $('#spud_banner_rich_text');
189
206
  if(richText){
207
+ tinymce.EditorManager.execCommand('mceRemoveEditor', true, 'spud_banner_rich_text');
190
208
  spud.admin.editor.init({
191
209
  selector: '#spud_banner_rich_text',
192
210
  buttons: ['bold','italic','underline','formatselect','|','bullist','numlist','|','link','unlink','anchor', '|', 'code'],
@@ -195,4 +213,5 @@ spud.admin.banners = new function(){
195
213
  });
196
214
  }
197
215
  };
216
+
198
217
  }();
@@ -67,7 +67,3 @@
67
67
  <% end %>
68
68
 
69
69
  <iframe id="spud_banners_upload_target" name="spud_banners_upload_target" style="display:none;"></iframe>
70
-
71
- <script>
72
- $(document).ready(spud.admin.banners.form);
73
- </script>
@@ -1,5 +1,5 @@
1
1
  module Spud
2
2
  module Banners
3
- VERSION = "1.1.5"
3
+ VERSION = "1.1.6"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tb_banners
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.5
4
+ version: 1.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Westlake
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-20 00:00:00.000000000 Z
11
+ date: 2015-01-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -290,7 +290,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
290
290
  version: '0'
291
291
  requirements: []
292
292
  rubyforge_project:
293
- rubygems_version: 2.2.1
293
+ rubygems_version: 2.4.5
294
294
  signing_key:
295
295
  specification_version: 4
296
296
  summary: Twice Baked Banners