caboose-cms 0.4.114 → 0.4.115

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
- ZjNmNDgyNjU5YjI0ODRkOTdhZTQwZDRiZDUyMDEzMjUyODlhYjIxMA==
4
+ NjIzMzM0ODBmODgyNzExYjQ0NzBmNDYxMzI2OGI4MWFhODRhMjhjNw==
5
5
  data.tar.gz: !binary |-
6
- YzhmMDRlNzliMzM3M2JlNjg5MjZkNjRiOTA1OGRhMDNmNWUxMzM3ZQ==
6
+ NmMwZWEwMWMzODM0MjM1ZTUxYmNiZGJkMDU2MTY4M2VlYzhjMzMzNw==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- ODg2NjIxZGFjYzdlNDczMDUzNWE0NDFhZDJhYmM5MzI5MWVlNmIwMzhmNmRm
10
- MjFlYjc0MmU0NjU4ZTM0NDlkMmEzZTdlMTM3OTdhN2M1OTU0Zjc0ZGRiYjRj
11
- ZmQ2MDBiOGM0MWY3NzNlMzFmZmViOTVkZDUyMDFhZGU5MmU0Yjc=
9
+ ODcyNWI3YTU3YTY5NzdmNTU2NWNkZDViNDhiMDc2MTZkODRmMGJmYTQ5OWY1
10
+ MzJkNmQ1NDkyODhjNTdlZDEzNjE3NzI3M2EyYWI4NzRiMjU3YTJlMGU0Y2Y4
11
+ ZTRjZDRhZWZlYjczZmJkMTNkNmFhOTY2NzFmNzViYjZmYmI1MDM=
12
12
  data.tar.gz: !binary |-
13
- NmU5N2Q2ZGNkMjhmNDBiMjc5ZWZmMDJmYjBkMzY5ZmM5YzNmOWU1MTA5MTE0
14
- Mjg0OTU5ODlmMjFiOGFkZWU4YjU3MzVlYmQ4ZDRkNDAwMGIyZTA4YjliMDYz
15
- Nzg1MWRhMjQzODYxZTA5NDIzZWVlNTZkZjVhMWU3MDBjN2E1Y2Y=
13
+ Mzk5ZDVhY2RmMGY3NTA5YTJkMWJkY2I1ZWY2MTMwNGZhMzg1ZDAwZmU5YWRl
14
+ OTY0ZWFmZDcxMzE0MmNlZmQzYWJjZTU4NjEzNWJhMDBmMjBmNGU5N2IyMGIz
15
+ NmM4ZDRmYTI2NDg0ZTYyODIwNTM2ZDhlNDFiNWI4NGY3ZGFjN2Q=
@@ -26,7 +26,8 @@ Attribute.prototype = {
26
26
  upload_text: false,
27
27
  image_refresh_delay: false,
28
28
  minute_increment: 15,
29
- hour_increment: 1,
29
+ hour_increment: 1,
30
+ show_check_all: true,
30
31
 
31
32
  update_url: false,
32
33
  options_url: false,
@@ -39,7 +39,37 @@ BoundCheckboxMultiple = BoundControl.extend({
39
39
 
40
40
  view: function() {
41
41
  var that = this;
42
- var tbody = $('<tbody/>');
42
+ var tbody = $('<tbody/>');
43
+
44
+ if (this.attribute.show_check_all)
45
+ {
46
+ var all_checked = true
47
+ $.each(this.attribute.options, function(i, option) {
48
+ if (that.attribute.value.indexOf(option.value) == -1)
49
+ {
50
+ all_checked = false;
51
+ return;
52
+ }
53
+ });
54
+ var input = $('<input/>')
55
+ .attr('id', that.el + '_all')
56
+ .attr('type', 'checkbox')
57
+ .val('all')
58
+ .css('position', 'relative')
59
+ .on('change', function() {
60
+ var checked = $(this).prop('checked');
61
+ that.save('all', checked);
62
+ $.each(that.attribute.options, function(i, option) {
63
+ $('#' + that.el + '_' + i).prop('checked', checked);
64
+ });
65
+ });
66
+ if (all_checked)
67
+ input.attr('checked', 'true');
68
+ tbody.append($('<tr/>')
69
+ .append($('<td/>').append(input))
70
+ .append($('<td/>').append($('<label/>').attr('for', that.el + '_all').html('Check All')))
71
+ );
72
+ }
43
73
  $.each(that.attribute.options, function(i, option) {
44
74
  var checked = that.attribute.value.indexOf(option.value) > -1;
45
75
  tbody.append($('<tr/>')
@@ -50,7 +80,17 @@ BoundCheckboxMultiple = BoundControl.extend({
50
80
  .attr('checked', checked)
51
81
  .val(option.value)
52
82
  .css('position', 'relative')
53
- .on('change', function() { that.save($(this).val(), $(this).prop('checked')); })
83
+ .on('change', function() {
84
+ that.save($(this).val(), $(this).prop('checked'));
85
+ if (that.attribute.show_check_all)
86
+ {
87
+ var all_checked = true;
88
+ $.each(that.attribute.options, function(j, option) {
89
+ if ($('#' + that.el + '_' + j).prop('checked') == false) all_checked = false;
90
+ });
91
+ $('#' + that.el + '_all').prop('checked', all_checked);
92
+ }
93
+ })
54
94
  )
55
95
  )
56
96
  .append($('<td/>').append($('<label/>').attr('for', that.el + '_' + i).html(option.text)))
@@ -11,7 +11,7 @@ tinyMCE.init({
11
11
  height: '300px',
12
12
  convert_urls: false,
13
13
  plugins: 'advlist autolink lists link image charmap print preview hr anchor pagebreak searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking table contextmenu directionality emoticons template paste textcolor caboose',
14
- toolbar1: 'caboose_save caboose_cancel | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image',
14
+ toolbar1: 'caboose_save caboose_cancel | bold italic forecolor backcolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image',
15
15
  image_advtab: true,
16
16
  external_plugins: { 'caboose': '//#{Caboose::cdn_domain}/assets/tinymce/plugins/caboose/plugin.js' },
17
17
  setup: function(editor) {
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.4.114'
2
+ VERSION = '0.4.115'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caboose-cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.114
4
+ version: 0.4.115
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Barry
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-18 00:00:00.000000000 Z
11
+ date: 2014-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails