it-logica-application-backbone 1.2.22 → 1.2.23

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.22
1
+ 1.2.23
@@ -2,42 +2,37 @@ class EditableTableAligner
2
2
  @align_table: (obj, xhr) ->
3
3
  # move colhead class to left column
4
4
  EditableTableAligner.align_static_left_columns(obj, xhr)
5
- console.log("left columns moved")
6
-
7
5
 
8
6
  # allowing of paired scrolling
9
7
  EditableTableAligner.paired_left_right_scrolling(obj)
10
- console.log("left right scrolling paired")
11
8
  EditableTableAligner.paired_up_down_scrolling(obj)
12
- console.log("up down scrolling paired")
13
-
14
9
 
15
10
  # align widths and heights at last after moving all columns
16
11
  # align withs of header and body of table
17
12
  EditableTableAligner.align_widths(obj)
18
- console.log("align widths")
19
-
20
13
 
21
14
  # aligning heights of static left or right columns and center content of table
22
15
  EditableTableAligner.align_heights(obj)
23
- console.log("align heights")
16
+
24
17
 
25
18
  if (obj.editable_table_automatic_size? && obj.editable_table_automatic_size)
26
19
  if !xhr
27
20
  EditableTableAligner.register_align_table_size()
28
21
 
29
22
  @align_after_rows_update: (obj) ->
23
+ # tr_class td_class, etc
24
+ apply_modifiers_of_the_table($("#" + obj.form_id));
25
+
30
26
  # move colhead class to left column
31
27
  EditableTableAligner.align_static_left_columns_after_row_update(obj)
32
- console.log("left columns moved")
33
28
 
34
29
  # align widths and heights at last after moving all columns
35
30
  # align withs of header and body of table
36
31
  EditableTableAligner.align_widths(obj)
37
- console.log("roew align widths")
32
+
38
33
  # aligning heights of static left or right columns and center content of table
39
34
  EditableTableAligner.align_heights(obj)
40
- console.log("roew align heights")
35
+
41
36
 
42
37
  #########################
43
38
  ### private methods #########
@@ -50,6 +45,7 @@ class EditableTableAligner
50
45
 
51
46
  # going trough headers th
52
47
  # console.log($("#" + obj.form_id).find('td[data-width-align-id]'))
48
+ # todo ladas !!!!!!!1 kdyz upravuju prvni radek tak se tabulka hybe, jako prvni radek bych mozna mel dat prazdny radek s vyskou 0
53
49
  $("#" + obj.form_id).find('th[data-width-align-id]').each (index, element) =>
54
50
 
55
51
  # loading paired td and th
@@ -134,7 +130,7 @@ class EditableTableAligner
134
130
  head = $("#" + obj.form_id).find(".fixedLeftColumn .table_head thead")
135
131
  # first clear the head, but only if not by XHR, head is not sent by ajax
136
132
 
137
- console.log(xhr)
133
+
138
134
  if xhr? && !xhr
139
135
  head.html("")
140
136
  # then fill it with actual data
@@ -50,7 +50,7 @@ class EditableTableBuilder
50
50
  do (row) ->
51
51
  row_count += 1
52
52
  EditableTableBuilder.html += '<tr data-row-count-number="' + row_count + '"'
53
- console.log(EditableTableBuilder.obj.row_colors)
53
+
54
54
  if EditableTableBuilder.obj.row_colors?
55
55
  if EditableTableBuilder.obj.row_colors[row.row_id]?
56
56
  style = 'color:' + EditableTableBuilder.obj.row_colors[row.row_id]["color"]
@@ -102,7 +102,18 @@ class EditableTableBuilder
102
102
  summarize_page += '<div class="summarize_page non-breakable-collumn">'
103
103
  summarize_page += if col.summarize_page_label? then col.summarize_page_label else ''
104
104
  summarize_page += '<span class="value">'
105
- summarize_page += if col.summarize_page_value? then col.summarize_page_value else 0
105
+ # todo ladas toto je treba uzavrit do formatovani jedne bunky
106
+ if col.summarize_page_value?
107
+ if (is_hash(col.summarize_page_value ))
108
+ if col.summarize_page_value.name?
109
+ summarize_page += col.summarize_page_value.name
110
+ else
111
+ summarize_page += 0
112
+ else
113
+ summarize_page += col.summarize_page_value
114
+ else
115
+ summarize_page += 0
116
+
106
117
  summarize_page += '</span>'
107
118
  summarize_page += '</div>'
108
119
 
@@ -141,7 +152,17 @@ class EditableTableBuilder
141
152
  summarize_all += '<div class="summarize_all non-breakable-collumn">'
142
153
  summarize_all += if col.summarize_all_label? then col.summarize_all_label else ''
143
154
  summarize_all += '<span class="value">'
144
- summarize_all += if col.summarize_all_value? then col.summarize_all_value else 0
155
+ # todo ladas toto je treba uzavrit do formatovani jedne bunky
156
+ if col.summarize_all_value?
157
+ if (is_hash(col.summarize_all_value ))
158
+ if col.summarize_all_value.name?
159
+ summarize_all += col.summarize_all_value.name
160
+ else
161
+ summarize_all += 0
162
+ else
163
+ summarize_all += col.summarize_all_value
164
+ else
165
+ summarize_all += 0
145
166
  summarize_all += '</span>'
146
167
  summarize_all += '</div>'
147
168
  summarize_all += '</td>'
@@ -237,21 +258,29 @@ class EditableTableBuilder
237
258
  EditableTableBuilder.html += '<div class="non-breakable-collumn">' if true
238
259
  #col.non_breakable? && col.non_breakable
239
260
 
240
- if (is_hash(row[col.table + '_' + col.name]))
261
+ active_cell
262
+ if EditableTableBuilder.valid_table(col.table)
263
+ active_cell = row[col.table + '_' + col.name]
264
+ else
265
+ active_cell = row[col.name]
266
+
267
+
268
+
269
+ if (is_hash(active_cell))
241
270
  # hash span or href (styled as button)
242
- button_settings = row[col.table + '_' + col.name]
271
+ button_settings = active_cell
243
272
  button_settings = {} if !button_settings?
244
273
  EditableTableBuilder.make_column_from_hash(button_settings, row, col)
245
274
 
246
- else if (is_array(row[col.table + '_' + col.name]))
275
+ else if (is_array(active_cell))
247
276
  # array of hashes (probably buttons)
248
- one_cell_buttons = row[col.table + '_' + col.name]
277
+ one_cell_buttons = active_cell
249
278
  for one_cell_button in one_cell_buttons
250
279
  do (one_cell_button) ->
251
280
  one_cell_button = {} if !one_cell_buttons?
252
281
  EditableTableBuilder.make_column_from_hash(one_cell_button, row, col)
253
282
 
254
- else if (is_string(row[col.table + '_' + col.name]))
283
+ else if (is_string(active_cell))
255
284
  # its just string
256
285
  text = ""
257
286
  text = row[col.table + '_' + col.name] if row[col.table + '_' + col.name]?
@@ -331,7 +360,11 @@ class EditableTableBuilder
331
360
  else
332
361
  EditableTableBuilder.html += '</span>'
333
362
 
334
-
363
+ @valid_table: (table_name) ->
364
+ if (table_name == "___sql_expression___")
365
+ false
366
+ else
367
+ true
335
368
 
336
369
 
337
370
  @make_row_function_button: (button_settings, row, col) ->
@@ -32,14 +32,14 @@
32
32
  <% if settings[:template].blank? %>
33
33
  var parsed_settings = jQuery.parseJSON(parsed_response['settings'])
34
34
  var html_from_json = EditableTableBuilder.render_tbody(parsed_settings);
35
- console.log("created")
35
+
36
36
  TableSummaries.refresh(parsed_settings);
37
- console.log("summaries")
37
+
38
38
 
39
39
  $("#<%= settings[:form_id] %>_ajax_content").html(html_from_json);
40
40
  apply_modifiers_of_the_table($("#<%= settings[:form_id] %>_ajax_content"));
41
41
  EditableTableAligner.align_table(parsed_settings, true);
42
- console.log("aligned")
42
+
43
43
 
44
44
  <% else %>
45
45
  var raw_html = parsed_response['settings']
@@ -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.22"
8
+ s.version = "1.2.23"
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-15"
12
+ s.date = "2012-11-26"
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.22
4
+ version: 1.2.23
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-15 00:00:00.000000000 Z
12
+ date: 2012-11-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: htmlentities
16
- requirement: &75696700 !ruby/object:Gem::Requirement
16
+ requirement: &81606180 !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: *75696700
24
+ version_requirements: *81606180
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: shoulda
27
- requirement: &75696260 !ruby/object:Gem::Requirement
27
+ requirement: &81605730 !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: *75696260
35
+ version_requirements: *81605730
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rdoc
38
- requirement: &75695800 !ruby/object:Gem::Requirement
38
+ requirement: &81605270 !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: *75695800
46
+ version_requirements: *81605270
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: bundler
49
- requirement: &75695230 !ruby/object:Gem::Requirement
49
+ requirement: &81604680 !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: *75695230
57
+ version_requirements: *81604680
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: jeweler
60
- requirement: &75694680 !ruby/object:Gem::Requirement
60
+ requirement: &81604140 !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: *75694680
68
+ version_requirements: *81604140
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: simplecov
71
- requirement: &75694330 !ruby/object:Gem::Requirement
71
+ requirement: &81603800 !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: *75694330
79
+ version_requirements: *81603800
80
80
  description: longer description of your gem
81
81
  email: ladislav.smola@it-logica.cz
82
82
  executables: []
@@ -618,7 +618,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
618
618
  version: '0'
619
619
  segments:
620
620
  - 0
621
- hash: -574375823
621
+ hash: 397464157
622
622
  required_rubygems_version: !ruby/object:Gem::Requirement
623
623
  none: false
624
624
  requirements: