caboose-cms 0.5.30 → 0.5.31

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YmJiNzg3OTk5YWQxNWNmM2NhMTU0ZTMzN2FjNDMxODk4NjgwZTVkMw==
4
+ MmNiOTkyNWRjMjA0ZmI0YmRmYWY3NmI3Zjk4ZjlmMTI5OWI3NGUwNg==
5
5
  data.tar.gz: !binary |-
6
- YjA0MWM2Mjc5YzNkOWE0MjEyYTFiMzBkYzc5MzliOTYxNjQ1Y2I3ZA==
6
+ YmUwMzY1NTJjNDg4N2U4NGE0M2NjODhjYTBiMDU2M2Q2M2YxZTdiYw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MmE1ZWFkYzk1NjM1NDYxY2MzODJkMmMwNzJiOTg3NzIzZDk1NDBiNGQwZjg1
10
- ODI1NjMyOWZkZDVkYTMwMjA1NWZhZWVkMTE1NDNhY2QwOGJiYTBmYTQzMDli
11
- ZjFhMjgyMGZlYmMwOTQyY2Q3YTk3MjYwNjlmYTQ0MWYwNDRjZmQ=
9
+ OGJmYWJjYThjMDkwMDg2ZjM4Y2YwN2YwNjE1MDdmZjc5NzM4OGUzOGQzOTU4
10
+ ZjNlMDM3MjhhYzdjMjQwNDRiMzIzYWFkNzc2N2M5MTQ3MzUzMDlmNDZjYTE0
11
+ OTY3Mzc2ZTEyZTkwMzE5NTVmN2M5MzVjOWNiYzEzN2I5NTFlMjM=
12
12
  data.tar.gz: !binary |-
13
- MjQwNzc0M2E3NjVlMTZiMDQ1NmVhZjIyOTRlZjc3NjQzZjY2ODY5NGZhZDc2
14
- ZmE3ZjA3YzBkOGFmZThjNTYwNTZjNTQ5YTVmODZmZGU0ZTYyMmE0ZGVlODBk
15
- ODQ4YmVlOTY0YWQ1ZjYzNzc3YWY3NzQzZGZhZjgzOWJlMDdmYzU=
13
+ Nzc1MzNlOWYzMzBmZjk5YTMyMTVmMjQwMmRiMDU1NjM2NTE4NDQxZDRmZDdi
14
+ NTg5YThkOGYyNmRlZDhjYTYzMjI1ZjQ5MTQwNWZiZDg5MmYzZWJiYzk2MGM4
15
+ ODgyMGRhNzM1NTUwOTE0NTBmZWViYTU0NWJhMTJmNGRkZjVlNGI=
@@ -179,15 +179,16 @@ PageContentController.prototype = {
179
179
  var that = this;
180
180
  $.ajax({
181
181
  url: '/admin/pages/' + this.page_id + '/blocks/tree',
182
- success: function(blocks) {
182
+ success: function(blocks) {
183
+ var count = blocks.length;
183
184
  $(blocks).each(function(i,b) {
184
- that.set_clickable_helper(b, false, false);
185
+ that.set_clickable_helper(b, false, false, (i == count-1));
185
186
  });
186
187
  }
187
188
  });
188
189
  },
189
190
 
190
- set_clickable_helper: function(b, parent_id, parent_allows_child_blocks)
191
+ set_clickable_helper: function(b, parent_id, parent_allows_child_blocks, is_last_child)
191
192
  {
192
193
  var that = this;
193
194
 
@@ -212,7 +213,24 @@ PageContentController.prototype = {
212
213
  )
213
214
  .mouseover(function(e) { $(this).removeClass('new_block_link').addClass('new_block_link_over'); e.stopPropagation(); })
214
215
  .mouseout(function(e) { $(this).removeClass('new_block_link_over').addClass('new_block_link'); e.stopPropagation(); })
215
- );
216
+ );
217
+ if (is_last_child && is_last_child == true)
218
+ {
219
+ $('#block_' + b.id).append($('<div/>')
220
+ .addClass('new_block_link')
221
+ .append($('<div/>').addClass('line'))
222
+ .append($('<a/>')
223
+ .attr('href', '#')
224
+ .html("New Block")
225
+ .click(function(e) {
226
+ e.preventDefault(); e.stopPropagation();
227
+ caboose_modal_url('/admin/pages/' + that.page_id + '/blocks/' + parent_id + '/new?after_id=' + b.id);
228
+ })
229
+ )
230
+ .mouseover(function(e) { $(this).removeClass('new_block_link').addClass('new_block_link_over'); e.stopPropagation(); })
231
+ .mouseout(function(e) { $(this).removeClass('new_block_link_over').addClass('new_block_link'); e.stopPropagation(); })
232
+ );
233
+ }
216
234
  }
217
235
 
218
236
  $('#block_' + b.id).attr('onclick','').unbind('click');
@@ -223,30 +241,31 @@ PageContentController.prototype = {
223
241
 
224
242
  var show_mouseover = true;
225
243
  if (b.children && b.children.length > 0)
226
- {
244
+ {
245
+ var count = b.children.length;
227
246
  $.each(b.children, function(i, b2) {
228
247
  if (b2.field_type == 'block')
229
248
  show_mouseover = false;
230
- that.set_clickable_helper(b2, b.id, b.allow_child_blocks);
249
+ that.set_clickable_helper(b2, b.id, b.allow_child_blocks, i == (count-1));
231
250
  });
232
251
  }
233
- if (b.allow_child_blocks)
234
- {
235
- $('#block_' + b.id).after($('<div/>')
236
- .addClass('new_block_link')
237
- .append($('<div/>').addClass('line'))
238
- .append($('<a/>')
239
- .attr('href', '#')
240
- .html("New Block")
241
- .click(function(e) {
242
- e.preventDefault(); e.stopPropagation();
243
- caboose_modal_url('/admin/pages/' + that.page_id + '/blocks/' + b.id + '/new?after_id=' + b.id);
244
- })
245
- )
246
- .mouseover(function(e) { $(this).removeClass('new_block_link').addClass('new_block_link_over'); e.stopPropagation(); })
247
- .mouseout(function(e) { $(this).removeClass('new_block_link_over').addClass('new_block_link'); e.stopPropagation(); })
248
- );
249
- }
252
+ //if (b.allow_child_blocks)
253
+ //{
254
+ // $('#block_' + b.id).after($('<div/>')
255
+ // .addClass('new_block_link')
256
+ // .append($('<div/>').addClass('line'))
257
+ // .append($('<a/>')
258
+ // .attr('href', '#')
259
+ // .html("New Block")
260
+ // .click(function(e) {
261
+ // e.preventDefault(); e.stopPropagation();
262
+ // caboose_modal_url('/admin/pages/' + that.page_id + '/blocks/' + b.id + '/new?after_id=' + b.id);
263
+ // })
264
+ // )
265
+ // .mouseover(function(e) { $(this).removeClass('new_block_link').addClass('new_block_link_over'); e.stopPropagation(); })
266
+ // .mouseout(function(e) { $(this).removeClass('new_block_link_over').addClass('new_block_link'); e.stopPropagation(); })
267
+ // );
268
+ //}
250
269
  if (show_mouseover)
251
270
  {
252
271
  $('#block_' + b.id).mouseover(function(el) { $('#block_' + b.id).addClass( 'block_over'); });
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.5.30'
2
+ VERSION = '0.5.31'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caboose-cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.30
4
+ version: 0.5.31
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Barry