it-logica-application-backbone 1.3.9 → 1.3.10
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/app/assets/javascripts/backbone_js/ladas_editable_table_aligner.js.coffee +27 -1
- data/app/assets/javascripts/backbone_js/ladas_editable_table_builder.js.coffee +9 -6
- data/app/views/helpers/_build_date_picker_js_code.html.erb +13 -0
- data/app/views/helpers/editable_table/_build_table_wrapper.html.erb +5 -11
- data/it-logica-application-backbone.gemspec +3 -2
- data/lib/view_mixins/form.rb +7 -2
- metadata +18 -17
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.3.
|
1
|
+
1.3.10
|
@@ -1,5 +1,8 @@
|
|
1
1
|
class EditableTableAligner
|
2
2
|
@align_table: (obj, xhr) ->
|
3
|
+
# adds on first row to body, so there will always be one
|
4
|
+
EditableTableAligner.make_leading_body_row(obj)
|
5
|
+
|
3
6
|
# move colhead class to left column
|
4
7
|
EditableTableAligner.align_static_left_columns(obj, xhr)
|
5
8
|
|
@@ -20,6 +23,9 @@ class EditableTableAligner
|
|
20
23
|
EditableTableAligner.register_align_table_size()
|
21
24
|
|
22
25
|
@align_after_rows_update: (obj) ->
|
26
|
+
# adds on first row to body, so there will always be one
|
27
|
+
EditableTableAligner.make_leading_body_row(obj)
|
28
|
+
|
23
29
|
# tr_class td_class, etc
|
24
30
|
apply_modifiers_of_the_table($("#" + obj.form_id));
|
25
31
|
|
@@ -37,6 +43,26 @@ class EditableTableAligner
|
|
37
43
|
#########################
|
38
44
|
### private methods #########
|
39
45
|
##############################
|
46
|
+
@make_leading_body_row: (obj) ->
|
47
|
+
unless $("#" + obj.form_id + "_ajax_content").find("tr.leading_tbody_row").length > 0
|
48
|
+
#$("#" + obj.form_id + "_ajax_content").find("tr.leading_tbody_row").remove()
|
49
|
+
|
50
|
+
orig = $("#" + obj.form_id).find('tr.filtering_tr')
|
51
|
+
new_tr = $('<tr></tr>').addClass("leading_tbody_row").css("height", "1px").css("border-width", "0").css("border", "0").attr("data-row-count-number", "leading_tbody_row")
|
52
|
+
|
53
|
+
orig.each (index, element) =>
|
54
|
+
$(element).find("th").each (td_index, td_element) =>
|
55
|
+
el = $("<td></td>")
|
56
|
+
if $(td_element).hasClass("headcol")
|
57
|
+
el.addClass("headcol")
|
58
|
+
|
59
|
+
el.attr("data-width-align-id", $(td_element).data("width-align-id"))
|
60
|
+
|
61
|
+
|
62
|
+
new_tr.append(el)
|
63
|
+
|
64
|
+
$("#" + obj.form_id + "_ajax_content").prepend(new_tr)
|
65
|
+
|
40
66
|
|
41
67
|
@align_widths: (obj) ->
|
42
68
|
# HAVE TO UNSET TABLE WIDTH IF AUTOSET
|
@@ -55,7 +81,7 @@ class EditableTableAligner
|
|
55
81
|
width_align_id = th.data("width-align-id")
|
56
82
|
|
57
83
|
td = $("#" + obj.form_id).find('td[data-width-align-id="' + width_align_id + '"]').first()
|
58
|
-
|
84
|
+
console.log(td)
|
59
85
|
#careful delete one by one, or scrolling will be lost
|
60
86
|
# have to delete it from elements, otherwise the width would increase (alwazs adding padding nad vbroder to outerWidth)
|
61
87
|
th.css({
|
@@ -38,6 +38,8 @@ class EditableTableBuilder
|
|
38
38
|
|
39
39
|
EditableTableAligner.align_after_rows_update(obj)
|
40
40
|
|
41
|
+
|
42
|
+
|
41
43
|
#############################################################################33
|
42
44
|
##############################private #######################################333
|
43
45
|
##############################################################################33
|
@@ -69,6 +71,7 @@ class EditableTableBuilder
|
|
69
71
|
CheckboxPool.checkboxes_finalize()
|
70
72
|
EditableTableBuilder.add_summary_row()
|
71
73
|
|
74
|
+
|
72
75
|
@add_summary_row: ->
|
73
76
|
functions_present = EditableTableBuilder.obj.row? && EditableTableBuilder.obj.row.functions?
|
74
77
|
|
@@ -178,7 +181,7 @@ class EditableTableBuilder
|
|
178
181
|
|
179
182
|
if row_count == 1
|
180
183
|
EditableTableBuilder.html += '<td class="' + el_class + '" '
|
181
|
-
EditableTableBuilder.html += 'data-width-align-id="special_checbox_filtering"'
|
184
|
+
#EditableTableBuilder.html += 'data-width-align-id="special_checbox_filtering"'
|
182
185
|
else
|
183
186
|
EditableTableBuilder.html += '<td class="' + el_class + '" '
|
184
187
|
EditableTableBuilder.html += '">'
|
@@ -205,7 +208,7 @@ class EditableTableBuilder
|
|
205
208
|
|
206
209
|
if row_count == 1
|
207
210
|
EditableTableBuilder.html += '<td class="' + static_left_column_class + '"'
|
208
|
-
EditableTableBuilder.html += 'data-width-align-id="special_functions">'
|
211
|
+
#EditableTableBuilder.html += 'data-width-align-id="special_functions">'
|
209
212
|
else
|
210
213
|
EditableTableBuilder.html += '<td class="' + static_left_column_class + '">'
|
211
214
|
|
@@ -241,10 +244,10 @@ class EditableTableBuilder
|
|
241
244
|
EditableTableBuilder.html += ' onclick="EditableTableModalDialog.show(this, \'' + EditableTableBuilder.obj.editable_table_edit_cell_path + '\')"'
|
242
245
|
|
243
246
|
# row number 1 of body is for width synchronizin with header (if I edit first row, it will affect all others)
|
244
|
-
if row_count == 1
|
245
|
-
EditableTableBuilder.html += ' data-width-align-id="'
|
246
|
-
EditableTableBuilder.html += cell_name
|
247
|
-
EditableTableBuilder.html += '"'
|
247
|
+
# if row_count == 1
|
248
|
+
# EditableTableBuilder.html += ' data-width-align-id="'
|
249
|
+
# EditableTableBuilder.html += cell_name
|
250
|
+
# EditableTableBuilder.html += '"'
|
248
251
|
|
249
252
|
EditableTableBuilder.html += ' class="' + col.class
|
250
253
|
# adding colhead class, determines if it will be moved to static left column
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<script type="text/javascript">
|
2
|
+
$.datepicker.setDefaults($.datepicker.regional[ "cs" ]);
|
3
|
+
$('<%= selector %>').datepicker({
|
4
|
+
dateFormat:"yy-mm-dd",
|
5
|
+
timeFormat:'hh:mm z',
|
6
|
+
//showTimezone: true,
|
7
|
+
timezone: "+0100",
|
8
|
+
separator:' ',
|
9
|
+
changeYear:true,
|
10
|
+
yearRange:'<%= Date.today.year - 100 %>:<%= Date.today.year + 30 %>',
|
11
|
+
changeMonth:true
|
12
|
+
});
|
13
|
+
</script>
|
@@ -66,17 +66,11 @@
|
|
66
66
|
</script>
|
67
67
|
|
68
68
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
separator:' ',
|
75
|
-
changeYear:true,
|
76
|
-
yearRange:'<%= Date.today.year - 100 %>:<%= Date.today.year + 30 %>',
|
77
|
-
changeMonth:true
|
78
|
-
});
|
79
|
-
</script>
|
69
|
+
|
70
|
+
|
71
|
+
<%= build_datetime_picker_js_code('.datetime_class') %>
|
72
|
+
<%= build_date_picker_js_code('.date_class') %>
|
73
|
+
|
80
74
|
|
81
75
|
|
82
76
|
<script type="text/javascript">
|
@@ -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.3.
|
8
|
+
s.version = "1.3.10"
|
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 = "2013-
|
12
|
+
s.date = "2013-02-18"
|
13
13
|
s.description = "longer description of your gem"
|
14
14
|
s.email = "ladislav.smola@it-logica.cz"
|
15
15
|
s.extra_rdoc_files = [
|
@@ -491,6 +491,7 @@ Gem::Specification.new do |s|
|
|
491
491
|
"app/views/helpers/_build_ajax_callback_code.html.erb",
|
492
492
|
"app/views/helpers/_build_breadcrumb.html.erb",
|
493
493
|
"app/views/helpers/_build_datafiles.html.erb",
|
494
|
+
"app/views/helpers/_build_date_picker_js_code.html.erb",
|
494
495
|
"app/views/helpers/_build_datetime_picker_js_code.html.erb",
|
495
496
|
"app/views/helpers/_build_table.html.erb",
|
496
497
|
"app/views/helpers/_build_table_data.html.erb",
|
data/lib/view_mixins/form.rb
CHANGED
@@ -46,8 +46,13 @@ module ViewMixins
|
|
46
46
|
end
|
47
47
|
|
48
48
|
#todo ladas connect regional to locale and timezone to browser timezone
|
49
|
-
def build_datetime_picker_js_code(selector, regional=nil,timezone=nil)
|
50
|
-
render :partial => '/helpers/build_datetime_picker_js_code', :layout => false, :locals => {:selector => selector, :regional => regional, :timezone => timezone
|
49
|
+
def build_datetime_picker_js_code(selector, regional=nil, timezone=nil)
|
50
|
+
render :partial => '/helpers/build_datetime_picker_js_code', :layout => false, :locals => {:selector => selector, :regional => regional, :timezone => timezone}
|
51
51
|
end
|
52
|
+
|
53
|
+
def build_date_picker_js_code(selector, regional=nil, timezone=nil)
|
54
|
+
render :partial => '/helpers/build_date_picker_js_code', :layout => false, :locals => {:selector => selector, :regional => regional, :timezone => timezone}
|
55
|
+
end
|
56
|
+
|
52
57
|
end
|
53
58
|
end
|
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.3.
|
4
|
+
version: 1.3.10
|
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: 2013-
|
12
|
+
date: 2013-02-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: htmlentities
|
16
|
-
requirement: &
|
16
|
+
requirement: &67702000 !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: *
|
24
|
+
version_requirements: *67702000
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: jquery-rails
|
27
|
-
requirement: &
|
27
|
+
requirement: &67700850 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - =
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 2.1.3
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *67700850
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: shoulda
|
38
|
-
requirement: &
|
38
|
+
requirement: &67699280 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *67699280
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rdoc
|
49
|
-
requirement: &
|
49
|
+
requirement: &70231560 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '3.12'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70231560
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: bundler
|
60
|
-
requirement: &
|
60
|
+
requirement: &70230640 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ~>
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: 1.1.0
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70230640
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: jeweler
|
71
|
-
requirement: &
|
71
|
+
requirement: &70229770 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ~>
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: 1.8.4
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *70229770
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: simplecov
|
82
|
-
requirement: &
|
82
|
+
requirement: &70228790 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ! '>='
|
@@ -87,7 +87,7 @@ dependencies:
|
|
87
87
|
version: '0'
|
88
88
|
type: :development
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *70228790
|
91
91
|
description: longer description of your gem
|
92
92
|
email: ladislav.smola@it-logica.cz
|
93
93
|
executables: []
|
@@ -570,6 +570,7 @@ files:
|
|
570
570
|
- app/views/helpers/_build_ajax_callback_code.html.erb
|
571
571
|
- app/views/helpers/_build_breadcrumb.html.erb
|
572
572
|
- app/views/helpers/_build_datafiles.html.erb
|
573
|
+
- app/views/helpers/_build_date_picker_js_code.html.erb
|
573
574
|
- app/views/helpers/_build_datetime_picker_js_code.html.erb
|
574
575
|
- app/views/helpers/_build_table.html.erb
|
575
576
|
- app/views/helpers/_build_table_data.html.erb
|
@@ -632,7 +633,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
632
633
|
version: '0'
|
633
634
|
segments:
|
634
635
|
- 0
|
635
|
-
hash:
|
636
|
+
hash: -855909535
|
636
637
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
637
638
|
none: false
|
638
639
|
requirements:
|