it-logica-application-backbone 1.2.16 → 1.2.17

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.16
1
+ 1.2.17
@@ -44,6 +44,7 @@ class EditableTableBuilder
44
44
 
45
45
 
46
46
  @make_table: ->
47
+ CheckboxPool.checkboxes_initialize()
47
48
  row_count = 0
48
49
  for row in EditableTableBuilder.obj.data
49
50
  do (row) ->
@@ -65,6 +66,7 @@ class EditableTableBuilder
65
66
 
66
67
  EditableTableBuilder.html += '</tr>'
67
68
 
69
+ CheckboxPool.checkboxes_finalize()
68
70
  EditableTableBuilder.add_summary_row()
69
71
 
70
72
  @add_summary_row: ->
@@ -164,7 +166,11 @@ class EditableTableBuilder
164
166
  EditableTableBuilder.html += ' onclick="CheckboxPool.change($(this))"'
165
167
  #console.log CheckboxPool.get_pool_by_form_id(TableBuilder.obj.form_id, row.row_id)
166
168
  #console.log CheckboxPool.include_value(TableBuilder.obj.form_id, row.row_id)
167
- EditableTableBuilder.html += ' checked="checked"' if CheckboxPool.include_value(EditableTableBuilder.obj.form_id, row.row_id)
169
+ if CheckboxPool.include_value(EditableTableBuilder.obj.form_id, row.row_id)
170
+ EditableTableBuilder.html += ' checked="checked"'
171
+ else
172
+ # if not all checkboxes are checkde, the main checkboxes will not be checked
173
+ CheckboxPool.checkboxes_not_all_checked()
168
174
  EditableTableBuilder.html += ' value="' + row.row_id + '">'
169
175
 
170
176
 
@@ -9,6 +9,7 @@ class TableBuilder
9
9
  return TableBuilder.html
10
10
 
11
11
  @make_table: ->
12
+ CheckboxPool.checkboxes_initialize()
12
13
  for row in TableBuilder.obj.data
13
14
  do (row) ->
14
15
  TableBuilder.html += '<tr>'
@@ -20,6 +21,7 @@ class TableBuilder
20
21
 
21
22
  TableBuilder.html += '</tr>'
22
23
 
24
+ CheckboxPool.checkboxes_finalize()
23
25
  TableBuilder.add_summary_row()
24
26
 
25
27
  @add_summary_row: ->
@@ -83,6 +85,8 @@ class TableBuilder
83
85
 
84
86
  TableBuilder.html += summarize_all if summarize_all_present
85
87
 
88
+
89
+
86
90
  @add_row_checkboxes: (row) ->
87
91
  if TableBuilder.obj.checkboxes?
88
92
  TableBuilder.html += '<td class="chbox">'
@@ -90,7 +94,12 @@ class TableBuilder
90
94
  TableBuilder.html += ' onclick="CheckboxPool.change($(this))"'
91
95
  #console.log CheckboxPool.get_pool_by_form_id(TableBuilder.obj.form_id, row.row_id)
92
96
  #console.log CheckboxPool.include_value(TableBuilder.obj.form_id, row.row_id)
93
- TableBuilder.html += ' checked="checked"' if CheckboxPool.include_value(TableBuilder.obj.form_id, row.row_id)
97
+ if CheckboxPool.include_value(TableBuilder.obj.form_id, row.row_id)
98
+ TableBuilder.html += ' checked="checked"'
99
+ else
100
+ # if not all checkboxes are checkde, the main checkboxes will not be checked
101
+ CheckboxPool.checkboxes_not_all_checked()
102
+
94
103
  TableBuilder.html += ' value="' + row.row_id + '">'
95
104
 
96
105
 
@@ -42,6 +42,20 @@ class CheckboxPool
42
42
  CheckboxPool.uncheck_page(form_id)
43
43
 
44
44
 
45
+ @checkboxes_initialize: ->
46
+ # some beahviour before initialize checkboxes
47
+ # I am tracking if all checkboxes are checked, setting as true, will set as false if some is not set
48
+ CheckboxPool.all_checkboxes_on_page_checked = true
49
+
50
+ @checkboxes_not_all_checked: ->
51
+ CheckboxPool.all_checkboxes_on_page_checked = false
52
+
53
+ @checkboxes_finalize: ->
54
+ if CheckboxPool.all_checkboxes_on_page_checked
55
+ $('#checkbox_all_checked_unchecked').attr('checked', 'checked')
56
+ else
57
+ $('#checkbox_all_checked_unchecked').removeAttr('checked')
58
+
45
59
 
46
60
  #######################################################
47
61
  #private
@@ -75,7 +75,7 @@
75
75
  <tr class="sorting_tr">
76
76
  <% if !settings[:checkboxes].blank? && settings[:checkboxes] %>
77
77
  <th class="chbox">
78
- <input type="checkbox" title="Označit/odznačit vše na stránce" onclick="CheckboxPool.check_or_uncheck_page(this, '<%= settings[:form_id] %>')" id=""/>
78
+ <input type="checkbox" title="Označit/odznačit vše na stránce" onclick="CheckboxPool.check_or_uncheck_page(this, '<%= settings[:form_id] %>')" id="checkbox_all_checked_unchecked"/>
79
79
  </th>
80
80
  <% end %>
81
81
  <% if !settings[:row].blank? && !settings[:row][:functions].blank? %>
@@ -83,7 +83,7 @@
83
83
  <tr class="sorting_tr" data-row-count-number="row_with_sorting">
84
84
  <% if !settings[:checkboxes].blank? && settings[:checkboxes] %>
85
85
  <th class="chbox <%= "headcol" if !settings[:static_columns_left_side].blank? %>">
86
- <input type="checkbox" title="Označit/odznačit vše na stránce" onclick="CheckboxPool.check_or_uncheck_page(this, '<%= settings[:form_id] %>')" id=""/>
86
+ <input type="checkbox" title="Označit/odznačit vše na stránce" onclick="CheckboxPool.check_or_uncheck_page(this, '<%= settings[:form_id] %>')" id="checkbox_all_checked_unchecked"/>
87
87
  </th>
88
88
  <% end %>
89
89
  <% if !settings[:row].blank? && !settings[:row][:functions].blank? %>
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "it-logica-application-backbone"
8
- s.version = "1.2.16"
8
+ s.version = "1.2.17"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Ladas"]
12
- s.date = "2012-11-08"
12
+ s.date = "2012-11-14"
13
13
  s.description = "longer description of your gem"
14
14
  s.email = "ladislav.smola@it-logica.cz"
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: it-logica-application-backbone
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.16
4
+ version: 1.2.17
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-08 00:00:00.000000000 Z
12
+ date: 2012-11-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: htmlentities
16
- requirement: &73081730 !ruby/object:Gem::Requirement
16
+ requirement: &75661520 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *73081730
24
+ version_requirements: *75661520
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: shoulda
27
- requirement: &73081330 !ruby/object:Gem::Requirement
27
+ requirement: &75661100 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *73081330
35
+ version_requirements: *75661100
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rdoc
38
- requirement: &73080920 !ruby/object:Gem::Requirement
38
+ requirement: &75660730 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '3.12'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *73080920
46
+ version_requirements: *75660730
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: bundler
49
- requirement: &73080450 !ruby/object:Gem::Requirement
49
+ requirement: &75660380 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 1.1.0
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *73080450
57
+ version_requirements: *75660380
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: jeweler
60
- requirement: &73079840 !ruby/object:Gem::Requirement
60
+ requirement: &75659940 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: 1.8.4
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *73079840
68
+ version_requirements: *75659940
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: simplecov
71
- requirement: &73079290 !ruby/object:Gem::Requirement
71
+ requirement: &75659470 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,7 +76,7 @@ dependencies:
76
76
  version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *73079290
79
+ version_requirements: *75659470
80
80
  description: longer description of your gem
81
81
  email: ladislav.smola@it-logica.cz
82
82
  executables: []
@@ -617,7 +617,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
617
617
  version: '0'
618
618
  segments:
619
619
  - 0
620
- hash: -812172675
620
+ hash: 930931091
621
621
  required_rubygems_version: !ruby/object:Gem::Requirement
622
622
  none: false
623
623
  requirements: