wice_grid 3.0.4 → 3.2.0.pre1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +24 -2
- data/README.rdoc +282 -316
- data/RELEASE_NOTES_3.2.pre1.rdoc +82 -0
- data/Rakefile +4 -2
- data/SAVED_QUERIES_HOWTO.rdoc +18 -31
- data/VERSION +1 -1
- data/lib/generators/wice_grid/add_migration_for_serialized_queries_generator.rb +22 -0
- data/lib/generators/wice_grid/install_generator.rb +20 -0
- data/lib/generators/wice_grid/templates/create_wice_grid_serialized_queries.rb +13 -0
- data/lib/generators/wice_grid/templates/wice_grid.css.scss +139 -0
- data/lib/generators/wice_grid/templates/wice_grid.yml +113 -19
- data/lib/generators/wice_grid/templates/wice_grid_config.rb +17 -41
- data/lib/grid_output_buffer.rb +3 -2
- data/lib/grid_renderer.rb +63 -102
- data/lib/helpers/js_calendar_helpers.rb +27 -157
- data/lib/helpers/wice_grid_misc_view_helpers.rb +1 -66
- data/lib/helpers/wice_grid_serialized_queries_view_helpers.rb +41 -32
- data/lib/helpers/wice_grid_view_helpers.rb +138 -274
- data/lib/table_column_matrix.rb +11 -11
- data/lib/view_columns.rb +41 -350
- data/lib/view_columns/action_view_column.rb +45 -0
- data/lib/view_columns/column_processor_index.rb +16 -0
- data/lib/view_columns/view_column_boolean.rb +23 -0
- data/lib/view_columns/view_column_custom_dropdown.rb +81 -0
- data/lib/view_columns/view_column_date.rb +17 -0
- data/lib/view_columns/view_column_datetime.rb +85 -0
- data/lib/view_columns/view_column_float.rb +7 -0
- data/lib/view_columns/view_column_integer.rb +38 -0
- data/lib/view_columns/view_column_string.rb +63 -0
- data/lib/wice_grid.rb +23 -26
- data/lib/wice_grid_controller.rb +14 -15
- data/lib/wice_grid_misc.rb +3 -3
- data/lib/wice_grid_serialized_queries_controller.rb +15 -18
- data/lib/wice_grid_spreadsheet.rb +2 -2
- data/lib/will_paginate_paginator.rb +31 -0
- data/test/readme.txt +1 -0
- data/{lib/generators/wice_grid/templates/icons → vendor/assets/images/icons/grid}/arrow_down.gif +0 -0
- data/{lib/generators/wice_grid/templates/icons → vendor/assets/images/icons/grid}/arrow_up.gif +0 -0
- data/{lib/generators/wice_grid/templates/icons → vendor/assets/images/icons/grid}/calendar_view_month.png +0 -0
- data/vendor/assets/images/icons/grid/collapse.gif +0 -0
- data/{lib/generators/wice_grid/templates/icons → vendor/assets/images/icons/grid}/delete.png +0 -0
- data/vendor/assets/images/icons/grid/expand.gif +0 -0
- data/{lib/generators/wice_grid/templates/icons → vendor/assets/images/icons/grid}/page_white_excel.png +0 -0
- data/{lib/generators/wice_grid/templates/icons → vendor/assets/images/icons/grid}/page_white_find.png +0 -0
- data/{lib/generators/wice_grid/templates/icons → vendor/assets/images/icons/grid}/table.png +0 -0
- data/{lib/generators/wice_grid/templates/icons → vendor/assets/images/icons/grid}/table_refresh.png +0 -0
- data/{lib/generators/wice_grid/templates/icons → vendor/assets/images/icons/grid}/tick_all.png +0 -0
- data/{lib/generators/wice_grid/templates/icons → vendor/assets/images/icons/grid}/untick_all.png +0 -0
- data/vendor/assets/javascripts/wice_grid.js +3 -0
- data/vendor/assets/javascripts/wice_grid_init.js.coffee +247 -0
- data/vendor/assets/javascripts/wice_grid_processor.js.coffee +128 -0
- data/vendor/assets/javascripts/wice_grid_saved_queries_init.js.coffee +103 -0
- data/wice_grid.gemspec +44 -50
- metadata +68 -94
- data/lib/generators/wice_grid/templates/calendarview.css +0 -107
- data/lib/generators/wice_grid/templates/calendarview.js +0 -1168
- data/lib/generators/wice_grid/templates/icons/expand.png +0 -0
- data/lib/generators/wice_grid/templates/wice_grid.css +0 -173
- data/lib/generators/wice_grid/templates/wice_grid_jquery.js +0 -162
- data/lib/generators/wice_grid/templates/wice_grid_prototype.js +0 -154
- data/lib/generators/wice_grid/wice_grid_assets_jquery_generator.rb +0 -32
- data/lib/generators/wice_grid/wice_grid_assets_prototype_generator.rb +0 -34
- data/lib/js_adaptors/jquery_adaptor.rb +0 -157
- data/lib/js_adaptors/js_adaptor.rb +0 -12
- data/lib/js_adaptors/prototype_adaptor.rb +0 -179
- data/lib/tasks/wice_grid_tasks.rake +0 -28
- data/lib/views/create.rjs +0 -13
- data/lib/views/create_jq.rjs +0 -31
- data/lib/views/delete.rjs +0 -12
- data/lib/views/delete_jq.rjs +0 -26
- data/test/.gitignore +0 -2
- data/test/database.yml +0 -21
- data/test/schema.rb +0 -33
- data/test/test_helper.rb +0 -89
- data/test/views/projects_and_people_grid.html.erb +0 -12
- data/test/views/projects_and_people_grid_invalid.html.erb +0 -12
- data/test/views/simple_projects_grid.html.erb +0 -9
- data/test/wice_grid_core_ext_test.rb +0 -183
- data/test/wice_grid_functional_test.rb +0 -68
- data/test/wice_grid_misc_test.rb +0 -41
- data/test/wice_grid_test.rb +0 -42
- data/test/wice_grid_view_helper_test.rb +0 -12
@@ -1,32 +0,0 @@
|
|
1
|
-
module WiceGrid #:nodoc:
|
2
|
-
module Generators #:nodoc:
|
3
|
-
class WiceGridAssetsJqueryGenerator < Rails::Generators::Base #:nodoc:
|
4
|
-
|
5
|
-
desc "Copy WiceGrid assets for JQuery based apps"
|
6
|
-
source_root File.expand_path('../templates', __FILE__)
|
7
|
-
|
8
|
-
def active_js_framework #:nodoc:
|
9
|
-
'jquery'
|
10
|
-
end
|
11
|
-
def inactive_js_framework #:nodoc:
|
12
|
-
'prototype'
|
13
|
-
end
|
14
|
-
|
15
|
-
|
16
|
-
def copy_stuff #:nodoc:
|
17
|
-
template 'wice_grid_config.rb', 'config/initializers/wice_grid_config.rb'
|
18
|
-
|
19
|
-
copy_file 'wice_grid.yml', 'config/locales/wice_grid.yml'
|
20
|
-
|
21
|
-
copy_file 'wice_grid_jquery.js', 'public/javascripts/wice_grid.js'
|
22
|
-
copy_file 'wice_grid.css', 'public/stylesheets/wice_grid.css'
|
23
|
-
|
24
|
-
%w(arrow_down.gif calendar_view_month.png expand.png page_white_find.png table_refresh.png
|
25
|
-
arrow_up.gif delete.png page_white_excel.png table.png tick_all.png untick_all.png ).each do |f|
|
26
|
-
copy_file "icons/#{f}", "public/images/icons/grid/#{f}"
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
@@ -1,34 +0,0 @@
|
|
1
|
-
module WiceGrid #:nodoc:
|
2
|
-
module Generators #:nodoc:
|
3
|
-
class WiceGridAssetsPrototypeGenerator < Rails::Generators::Base #:nodoc:
|
4
|
-
|
5
|
-
desc "Copy WiceGrid assets for Prototype based apps"
|
6
|
-
source_root File.expand_path('../templates', __FILE__)
|
7
|
-
|
8
|
-
|
9
|
-
def active_js_framework #:nodoc:
|
10
|
-
'prototype'
|
11
|
-
end
|
12
|
-
def inactive_js_framework #:nodoc:
|
13
|
-
'jquery'
|
14
|
-
end
|
15
|
-
|
16
|
-
def copy_stuff #:nodoc:
|
17
|
-
template 'wice_grid_config.rb', 'config/initializers/wice_grid_config.rb'
|
18
|
-
|
19
|
-
copy_file 'wice_grid.yml', 'config/locales/wice_grid.yml'
|
20
|
-
|
21
|
-
copy_file 'wice_grid_prototype.js', 'public/javascripts/wice_grid.js'
|
22
|
-
copy_file 'calendarview.js', 'public/javascripts/calendarview.js'
|
23
|
-
copy_file 'wice_grid.css', 'public/stylesheets/wice_grid.css'
|
24
|
-
copy_file 'calendarview.css', 'public/stylesheets/calendarview.css'
|
25
|
-
|
26
|
-
%w(arrow_down.gif calendar_view_month.png expand.png page_white_find.png table_refresh.png
|
27
|
-
arrow_up.gif delete.png page_white_excel.png table.png tick_all.png untick_all.png ).each do |f|
|
28
|
-
copy_file "icons/#{f}", "public/images/icons/grid/#{f}"
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
@@ -1,157 +0,0 @@
|
|
1
|
-
# encoding: UTF-8
|
2
|
-
module Wice::JsAdaptor #:nodoc:
|
3
|
-
|
4
|
-
module Jquery #:nodoc:
|
5
|
-
|
6
|
-
def self.included(base) #:nodoc:
|
7
|
-
base.extend(ClassMethods)
|
8
|
-
end
|
9
|
-
|
10
|
-
module ClassMethods #:nodoc:
|
11
|
-
|
12
|
-
def init #:nodoc:
|
13
|
-
end
|
14
|
-
|
15
|
-
def dom_loaded #:nodoc:
|
16
|
-
%/$(document).ready(function(){\n/
|
17
|
-
end
|
18
|
-
|
19
|
-
def reset_button_initialization(grid_name, reset_grid_javascript) #:nodoc:
|
20
|
-
%/ $('div##{grid_name}.wice_grid_container .reset').click(function(e){\n/+
|
21
|
-
%/ #{reset_grid_javascript};\n/+
|
22
|
-
%/ });\n/
|
23
|
-
end
|
24
|
-
|
25
|
-
def submit_button_initialization(grid_name, submit_grid_javascript) #:nodoc:
|
26
|
-
%/ $('div##{grid_name}.wice_grid_container .submit').click(function(e){\n/+
|
27
|
-
%/ #{submit_grid_javascript};\n/+
|
28
|
-
%/ });\n/
|
29
|
-
end
|
30
|
-
|
31
|
-
def show_hide_button_initialization(grid_name, filter_row_id) #:nodoc:
|
32
|
-
%/ $('##{grid_name}_show_icon').click(function(){\n/+
|
33
|
-
%/ $('##{grid_name}_show_icon').hide();\n/+
|
34
|
-
%/ $('##{grid_name}_hide_icon').show();\n/+
|
35
|
-
%/ $('##{filter_row_id}').show();\n/+
|
36
|
-
%/ })\n/+
|
37
|
-
%/ $('##{grid_name}_hide_icon').click(function(){\n/+
|
38
|
-
%/ $('##{grid_name}_show_icon').show();\n/+
|
39
|
-
%/ $('##{grid_name}_hide_icon').hide();\n/+
|
40
|
-
%/ $('##{filter_row_id}').hide();\n/+
|
41
|
-
%/ });\n/
|
42
|
-
end
|
43
|
-
|
44
|
-
def enter_key_event_registration(grid_name) #:nodoc:
|
45
|
-
%! $('div##{grid_name}.wice_grid_container .wice_grid_filter_row input[type=text], .#{grid_name}_detached_filter input[type=text]').keydown(function(event){\n! +
|
46
|
-
%! if (event.keyCode == 13) {#{grid_name}.process()}\n! +
|
47
|
-
%! });\n!
|
48
|
-
end
|
49
|
-
|
50
|
-
def csv_export_icon_initialization(grid_name) #:nodoc:
|
51
|
-
%! $('div##{grid_name}.wice_grid_container .export_to_csv_button').click(function(e){\n! +
|
52
|
-
%! #{grid_name}.export_to_csv()\n! +
|
53
|
-
%! });\n!
|
54
|
-
end
|
55
|
-
|
56
|
-
def auto_reloading_selects_event_initialization(grid_name) #:nodoc:
|
57
|
-
%! $('div##{grid_name}.wice_grid_container select.auto_reload, .#{grid_name}_detached_filter select.auto_reload').change(function(e){\n! +
|
58
|
-
%! #{grid_name}.process()\n! +
|
59
|
-
%! });\n!
|
60
|
-
end
|
61
|
-
|
62
|
-
def auto_reloading_inputs_event_initialization(grid_name) #:nodoc:
|
63
|
-
%! $('div##{grid_name}.wice_grid_container input.auto_reload, .#{grid_name}_detached_filter input.auto_reload').keyup(function(event, element){\n! +
|
64
|
-
%! #{grid_name}.process(this.id);\n! +
|
65
|
-
%! });\n!
|
66
|
-
end
|
67
|
-
|
68
|
-
def auto_reloading_inputs_with_negation_checkboxes_event_initialization(grid_name) #:nodoc:
|
69
|
-
%! $('div##{grid_name}.wice_grid_container input.negation_checkbox, .#{grid_name}_detached_filter input.negation_checkbox').click(function(event, element){\n! +
|
70
|
-
%! #{grid_name}.process(this.id);\n! +
|
71
|
-
%! });\n!
|
72
|
-
end
|
73
|
-
|
74
|
-
|
75
|
-
def auto_reloading_calendar_event_initialization(grid_name) #:nodoc:
|
76
|
-
%! $(document).bind('wg:calendarChanged_#{grid_name}', function(event){\n! +
|
77
|
-
%! #{grid_name}.process()\n! +
|
78
|
-
%! });\n!
|
79
|
-
end
|
80
|
-
|
81
|
-
def show_all_link_initialization(grid_name, confirmation, parameters_json) #:nodoc:
|
82
|
-
%/ $('div##{grid_name}.wice_grid_container .show_all_link').click(function(e){ \n/ +
|
83
|
-
%/ #{confirmation} #{grid_name}.reload_page_for_given_grid_state(#{parameters_json}) \n/ +
|
84
|
-
%/})\n/
|
85
|
-
end
|
86
|
-
|
87
|
-
def back_to_pagination_link_initialization(grid_name, parameters_json) #:nodoc:
|
88
|
-
%/ $('div##{grid_name}.wice_grid_container .show_all_link').click(function(e){\n/ +
|
89
|
-
%/ #{grid_name}.reload_page_for_given_grid_state(#{parameters_json})\n/ +
|
90
|
-
%/ })\n/
|
91
|
-
end
|
92
|
-
|
93
|
-
def call_to_save_query_and_key_event_initialization_for_saving_queries(
|
94
|
-
id_and_name, grid_name, base_path_to_query_controller, parameters_json, ids_json) #:nodoc:
|
95
|
-
%/ function #{grid_name}_save_query(){\n/ +
|
96
|
-
%` if ( typeof(#{grid_name}) != "undefined")\n` +
|
97
|
-
%! #{grid_name}.save_query('#{id_and_name}', $('##{id_and_name}')[0].value, '#{base_path_to_query_controller}', #{parameters_json}, #{ids_json})\n! +
|
98
|
-
%/}\n/ +
|
99
|
-
%/ $('##{id_and_name}').keydown(function(event){\n/ +
|
100
|
-
%/ if (event.keyCode == 13) #{grid_name}_save_query();\n/ +
|
101
|
-
%/ })\n/
|
102
|
-
end
|
103
|
-
|
104
|
-
def js_framework_specific_calendar_assets(view) #:nodoc:
|
105
|
-
''
|
106
|
-
end
|
107
|
-
|
108
|
-
def js_framework_specific_calendar_js_name #:nodoc:
|
109
|
-
nil
|
110
|
-
end
|
111
|
-
|
112
|
-
def js_framework_specific_calendar_css_name #:nodoc:
|
113
|
-
nil
|
114
|
-
end
|
115
|
-
|
116
|
-
def action_column_initialization(grid_name) #:nodoc:
|
117
|
-
%! $('div##{grid_name}.wice_grid_container .select_all').click(function(e){\n! +
|
118
|
-
%! $('div##{grid_name}.wice_grid_container .sel input').each(function(i, checkbox){\n! +
|
119
|
-
%! checkbox.checked = true;\n! +
|
120
|
-
%! })\n! +
|
121
|
-
%! })\n! +
|
122
|
-
%! $('div##{grid_name}.wice_grid_container .deselect_all').click(function(e){\n! +
|
123
|
-
%! $('div##{grid_name}.wice_grid_container .sel input').each(function(i, checkbox){\n! +
|
124
|
-
%! checkbox.checked = false;\n! +
|
125
|
-
%! })\n! +
|
126
|
-
%! })\n!
|
127
|
-
end
|
128
|
-
|
129
|
-
def fade_this(notification_messages_id) #:nodoc:
|
130
|
-
"$('##{notification_messages_id}').effect('fade')"
|
131
|
-
end
|
132
|
-
|
133
|
-
def focus_element(element_to_focus) #:nodoc:
|
134
|
-
%! var elements = $('##{element_to_focus}');\n! +
|
135
|
-
%! if (elements[0]){\n! +
|
136
|
-
%! var elToFocus = elements[0];\n! +
|
137
|
-
%! elToFocus.value = elToFocus.value;\n! + # this will just place the cursor at the end of the text input
|
138
|
-
%! elToFocus.focus();\n! +
|
139
|
-
%! }\n!
|
140
|
-
end
|
141
|
-
|
142
|
-
|
143
|
-
def update_ranges(grid_name)
|
144
|
-
%! $('div##{grid_name}.wice_grid_container .range-start, .#{grid_name}_detached_filter .range-start').keyup(function(e, a){\n! +
|
145
|
-
%! var endRange = $(e.target).next();\n! +
|
146
|
-
%! if (e.target.value){\n! +
|
147
|
-
%! endRange.val(#{Wice::ConfigurationProvider.value_for(:SECOND_RANGE_VALUE_FOLLOWING_THE_FIRST)} + parseInt(e.target.value));\n! +
|
148
|
-
%! }else{\n! +
|
149
|
-
%! endRange.val('');\n! +
|
150
|
-
%! }\n! +
|
151
|
-
%! });\n!
|
152
|
-
end
|
153
|
-
|
154
|
-
end
|
155
|
-
|
156
|
-
end
|
157
|
-
end
|
@@ -1,12 +0,0 @@
|
|
1
|
-
# encoding: UTF-8
|
2
|
-
|
3
|
-
module Wice::JsAdaptor #:nodoc:
|
4
|
-
mattr_accessor :calendar_module
|
5
|
-
def self.init #:nodoc:
|
6
|
-
if Wice::ConfigurationProvider.value_for(:JS_FRAMEWORK) == :prototype
|
7
|
-
include Wice::JsAdaptor::Prototype
|
8
|
-
else
|
9
|
-
include Wice::JsAdaptor::Jquery
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
@@ -1,179 +0,0 @@
|
|
1
|
-
# encoding: UTF-8
|
2
|
-
module Wice::JsAdaptor #:nodoc:
|
3
|
-
|
4
|
-
module Prototype #:nodoc:
|
5
|
-
|
6
|
-
def self.included(base) #:nodoc:
|
7
|
-
base.extend(ClassMethods)
|
8
|
-
end
|
9
|
-
|
10
|
-
module ClassMethods #:nodoc:
|
11
|
-
def init #:nodoc:
|
12
|
-
end
|
13
|
-
|
14
|
-
def dom_loaded #:nodoc:
|
15
|
-
%/ document.observe("dom:loaded", function() {\n/
|
16
|
-
end
|
17
|
-
|
18
|
-
def reset_button_initialization(grid_name, reset_grid_javascript) #:nodoc:
|
19
|
-
%/ $$('div##{grid_name}.wice_grid_container .reset').each(function(e){\n/+
|
20
|
-
%/ e.observe('click', function(){\n/+
|
21
|
-
%/ #{reset_grid_javascript};\n/+
|
22
|
-
%/ })\n/+
|
23
|
-
%/ });\n/
|
24
|
-
end
|
25
|
-
|
26
|
-
def submit_button_initialization(grid_name, submit_grid_javascript) #:nodoc:
|
27
|
-
%/ $$('div##{grid_name}.wice_grid_container .submit').each(function(e){\n/+
|
28
|
-
%/ e.observe('click', function(){\n/+
|
29
|
-
%/ #{submit_grid_javascript};\n/+
|
30
|
-
%/ })\n/+
|
31
|
-
%/ });\n/
|
32
|
-
end
|
33
|
-
|
34
|
-
def show_hide_button_initialization(grid_name, filter_row_id) #:nodoc:
|
35
|
-
%/ $('#{grid_name}_show_icon').observe('click', function(){\n/+
|
36
|
-
%/ Element.toggle('#{grid_name}_show_icon');\n/+
|
37
|
-
%/ Element.toggle('#{grid_name}_hide_icon');\n/+
|
38
|
-
%/ $('#{filter_row_id}').show();\n/+
|
39
|
-
%/ })\n/+
|
40
|
-
%/ $('#{grid_name}_hide_icon').observe('click', function(){\n/+
|
41
|
-
%/ Element.toggle('#{grid_name}_show_icon');\n/+
|
42
|
-
%/ Element.toggle('#{grid_name}_hide_icon');\n/+
|
43
|
-
%/ $('#{filter_row_id}').hide();\n/+
|
44
|
-
%/ });\n/
|
45
|
-
end
|
46
|
-
|
47
|
-
def enter_key_event_registration(grid_name) #:nodoc:
|
48
|
-
%! $$('div##{grid_name}.wice_grid_container .wice_grid_filter_row input[type=text], .#{grid_name}_detached_filter input[type=text]').each(function(e){\n! +
|
49
|
-
%! e.observe('keydown', function(event){\n! +
|
50
|
-
%! if (event.keyCode == 13) {#{grid_name}.process()}\n! +
|
51
|
-
%! })\n! +
|
52
|
-
%! });\n!
|
53
|
-
end
|
54
|
-
|
55
|
-
def csv_export_icon_initialization(grid_name) #:nodoc:
|
56
|
-
%! $$('div##{grid_name}.wice_grid_container .export_to_csv_button').each(function(e){\n! +
|
57
|
-
%! e.observe('click', function(event){\n! +
|
58
|
-
%! #{grid_name}.export_to_csv()\n! +
|
59
|
-
%! })\n! +
|
60
|
-
%! });\n!
|
61
|
-
end
|
62
|
-
|
63
|
-
def auto_reloading_selects_event_initialization(grid_name) #:nodoc:
|
64
|
-
%! $$('div##{grid_name}.wice_grid_container select.auto_reload', '.#{grid_name}_detached_filter select.auto_reload').each(function(e){\n! +
|
65
|
-
%! e.observe('change', function(event){\n! +
|
66
|
-
%! #{grid_name}.process()\n! +
|
67
|
-
%! })\n! +
|
68
|
-
%! });\n!
|
69
|
-
end
|
70
|
-
|
71
|
-
def auto_reloading_inputs_event_initialization(grid_name) #:nodoc:
|
72
|
-
%! $$('div##{grid_name}.wice_grid_container input.auto_reload', '.#{grid_name}_detached_filter input.auto_reload').each(function(e){\n! +
|
73
|
-
%! e.observe('keyup', function(event){\n! +
|
74
|
-
%! #{grid_name}.process(event.element().id)\n! +
|
75
|
-
%! })\n! +
|
76
|
-
%! });\n!
|
77
|
-
end
|
78
|
-
|
79
|
-
def auto_reloading_inputs_with_negation_checkboxes_event_initialization(grid_name) #:nodoc:
|
80
|
-
%! $$('div##{grid_name}.wice_grid_container input.negation_checkbox', '.#{grid_name}_detached_filter input.negation_checkbox').each(function(e){\n! +
|
81
|
-
%! e.observe('click', function(event){\n! +
|
82
|
-
%! #{grid_name}.process(event.element().id)\n! +
|
83
|
-
%! })\n! +
|
84
|
-
%! });\n!
|
85
|
-
end
|
86
|
-
|
87
|
-
|
88
|
-
def auto_reloading_calendar_event_initialization(grid_name) #:nodoc:
|
89
|
-
%! document.observe('wg:calendarChanged_#{grid_name}', function(event){\n! +
|
90
|
-
%! #{grid_name}.process()\n! +
|
91
|
-
%! });\n!
|
92
|
-
end
|
93
|
-
|
94
|
-
|
95
|
-
def show_all_link_initialization(grid_name, confirmation, parameters_json) #:nodoc:
|
96
|
-
%/ $$('div##{grid_name}.wice_grid_container .show_all_link').each(function(e){\n/ +
|
97
|
-
%/ e.observe('click', function(){\n/ +
|
98
|
-
%/ #{confirmation} #{grid_name}.reload_page_for_given_grid_state(#{parameters_json})\n/ +
|
99
|
-
%/ })\n/ +
|
100
|
-
%/ })\n/
|
101
|
-
end
|
102
|
-
|
103
|
-
|
104
|
-
def back_to_pagination_link_initialization(grid_name, parameters_json) #:nodoc:
|
105
|
-
%/ $$('div##{grid_name}.wice_grid_container .show_all_link').each(function(e){\n/ +
|
106
|
-
%/ e.observe('click', function(){\n/ +
|
107
|
-
%/ #{grid_name}.reload_page_for_given_grid_state(#{parameters_json})\n/ +
|
108
|
-
%/ })\n/ +
|
109
|
-
%/ })\n/
|
110
|
-
end
|
111
|
-
|
112
|
-
def call_to_save_query_and_key_event_initialization_for_saving_queries(
|
113
|
-
id_and_name, grid_name, base_path_to_query_controller, parameters_json, ids_json) #:nodoc:
|
114
|
-
%/ function #{grid_name}_save_query(){\n/ +
|
115
|
-
%` if ( typeof(#{grid_name}) != "undefined")\n` +
|
116
|
-
%/ #{grid_name}.save_query('#{id_and_name}', $F('#{id_and_name}'), '#{base_path_to_query_controller}', #{parameters_json}, #{ids_json})\n/ +
|
117
|
-
%/ }\n/ +
|
118
|
-
%/ $('#{id_and_name}').observe('keydown', function(event){\n/ +
|
119
|
-
%/ if (event.keyCode == 13) #{grid_name}_save_query();\n/ +
|
120
|
-
%/ })\n/
|
121
|
-
end
|
122
|
-
|
123
|
-
|
124
|
-
def js_framework_specific_calendar_assets(view) #:nodoc:
|
125
|
-
view.stylesheet_link_tag("calendarview.css") + view.javascript_include_tag("calendarview.js")
|
126
|
-
end
|
127
|
-
|
128
|
-
def js_framework_specific_calendar_js_name #:nodoc:
|
129
|
-
'calendarview.js'
|
130
|
-
end
|
131
|
-
|
132
|
-
def js_framework_specific_calendar_css_name #:nodoc:
|
133
|
-
'calendarview.css'
|
134
|
-
end
|
135
|
-
|
136
|
-
|
137
|
-
def action_column_initialization(grid_name) #:nodoc:
|
138
|
-
%! $$('div##{grid_name}.wice_grid_container .select_all').each(function(e){\n! +
|
139
|
-
%! e.observe('click', function(){\n! +
|
140
|
-
%! $$('div##{grid_name}.wice_grid_container .sel input').each(function(checkbox){\n! +
|
141
|
-
%! checkbox.checked = true;\n! +
|
142
|
-
%! })\n! +
|
143
|
-
%! })\n! +
|
144
|
-
%! })\n! +
|
145
|
-
%! $$('div##{grid_name}.wice_grid_container .deselect_all').each(function(e){\n! +
|
146
|
-
%! e.observe('click', function(){\n! +
|
147
|
-
%! $$('div##{grid_name}.wice_grid_container .sel input').each(function(checkbox){\n! +
|
148
|
-
%! checkbox.checked = false;\n! +
|
149
|
-
%! })\n! +
|
150
|
-
%! })\n! +
|
151
|
-
%! })\n!
|
152
|
-
end
|
153
|
-
|
154
|
-
def fade_this(notification_messages_id) #:nodoc:
|
155
|
-
"new Effect.Fade(this)"
|
156
|
-
end
|
157
|
-
|
158
|
-
def focus_element(element_to_focus) #:nodoc:
|
159
|
-
%! var elToFocus = $('#{element_to_focus}');\n! +
|
160
|
-
%! elToFocus.focus();\n! +
|
161
|
-
%! elToFocus.value = elToFocus.value;\n! # this will just place the cursor at the end of the text input
|
162
|
-
end
|
163
|
-
|
164
|
-
def update_ranges(grid_name)
|
165
|
-
%/ $$('div##{grid_name}.wice_grid_container .range-start, .#{grid_name}_detached_filter .range-start').each(function(e){\n/+
|
166
|
-
%/ e.observe('keyup', function(){\n/+
|
167
|
-
%! var endRange = e.next();\n! +
|
168
|
-
%! if (e.value){\n! +
|
169
|
-
%/ endRange.value = #{Wice::ConfigurationProvider.value_for(:SECOND_RANGE_VALUE_FOLLOWING_THE_FIRST)} + parseInt(e.value);\n/ +
|
170
|
-
%/ }else{\n/ +
|
171
|
-
%/ endRange.value = '';\n/ +
|
172
|
-
%/ }\n/ +
|
173
|
-
%/ })\n/+
|
174
|
-
%/ });\n/
|
175
|
-
end
|
176
|
-
|
177
|
-
end
|
178
|
-
end
|
179
|
-
end
|
@@ -1,28 +0,0 @@
|
|
1
|
-
namespace "wice_grid" do
|
2
|
-
|
3
|
-
desc "Create a table to store saved queries"
|
4
|
-
task :create_queries_table => :environment do
|
5
|
-
|
6
|
-
class CreateWiceGridSerializedQueriesTable < ::ActiveRecord::Migration
|
7
|
-
def self.up
|
8
|
-
create_table :wice_grid_serialized_queries do |t|
|
9
|
-
t.column :name, :string
|
10
|
-
t.column :grid_name, :string
|
11
|
-
t.column :query, :text
|
12
|
-
|
13
|
-
t.timestamps
|
14
|
-
end
|
15
|
-
add_index :wice_grid_serialized_queries, :grid_name
|
16
|
-
add_index :wice_grid_serialized_queries, [:grid_name, :id]
|
17
|
-
end
|
18
|
-
|
19
|
-
def self.down
|
20
|
-
drop_table :wice_grid_serialized_queries
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
CreateWiceGridSerializedQueriesTable.up
|
25
|
-
end
|
26
|
-
|
27
|
-
|
28
|
-
end
|