wice_grid 3.0.0.pre3 → 3.0.0.pre4

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.0.0.pre3
1
+ 3.0.0.pre4
@@ -142,7 +142,14 @@ if defined?(Wice::Defaults)
142
142
  # format defined by +DATETIME_FORMAT+ and must generate a DateTime object.
143
143
  # In many cases <tt>Time.zone.parse</tt> is enough, for instance, <tt>%Y-%m-%d</tt>. If you change the format, make sure to check this code
144
144
  # and modify it if needed.
145
- Wice::Defaults::DATETIME_PARSER = lambda{|datetime_string| Time.zone.parse(datetime_string) }
145
+ Wice::Defaults::DATETIME_PARSER = lambda{|datetime_string|
146
+ if Time.zone
147
+ Time.zone.parse(datetime_string)
148
+ else
149
+ Time.parse(datetime_string)
150
+ end
151
+ }
152
+
146
153
 
147
154
  # With Calendar helpers enabled the parameter sent is the string displayed. This lambda will be given a date string in the
148
155
  # format defined by +DATETIME+ and must generate a Date object.
@@ -37,7 +37,7 @@ function WiceGridProcessor(name, base_request_for_filter, base_link_for_show_all
37
37
  window.location = request;
38
38
  }
39
39
 
40
- this.save_query = function(query_name, base_path_to_query_controller, grid_state, input_ids){
40
+ this.save_query = function(field_id, query_name, base_path_to_query_controller, grid_state, input_ids){
41
41
  if (input_ids instanceof Array) {
42
42
  input_ids.each(function(dom_id){
43
43
  grid_state.push(['extra[' + dom_id + ']', $('#'+ dom_id)[0].value])
@@ -51,6 +51,7 @@ function WiceGridProcessor(name, base_request_for_filter, base_link_for_show_all
51
51
  async: true,
52
52
  data: request_path + '&query_name=' + encodeURIComponent(query_name),
53
53
  dataType: 'script',
54
+ success: function(){$('#' + field_id).val('')},
54
55
  type: 'POST'
55
56
  });
56
57
  }
@@ -38,7 +38,7 @@ function WiceGridProcessor(name, base_request_for_filter, base_link_for_show_all
38
38
  window.location = request;
39
39
  }
40
40
 
41
- this.save_query = function(query_name, base_path_to_query_controller, grid_state, input_ids){
41
+ this.save_query = function(field_id, query_name, base_path_to_query_controller, grid_state, input_ids){
42
42
  if (input_ids instanceof Array) {
43
43
  input_ids.each(function(dom_id){
44
44
  grid_state.push(['extra[' + dom_id + ']', $F(dom_id)])
@@ -50,6 +50,7 @@ function WiceGridProcessor(name, base_request_for_filter, base_link_for_show_all
50
50
  new Ajax.Request(base_path_to_query_controller, {
51
51
  asynchronous:true,
52
52
  evalScripts:true,
53
+ onSuccess: function(){ $(field_id).value = "" },
53
54
  parameters: request_path + '&query_name=' + encodeURIComponent(query_name)
54
55
  })
55
56
  }
@@ -35,9 +35,10 @@ module Wice
35
35
  else
36
36
  ''
37
37
  end +
38
+ '<div class="wg-saved-query-input-controls">'+
38
39
  text_field_tag(id_and_name, '', :size => 20, :onkeydown=>'', :id => id_and_name) +
39
40
  button_to_function(WiceGridNlMessageProvider.get_message(:SAVE_QUERY_BUTTON_LABEL), "#{grid_name}_save_query()" ) +
40
- '</div>' +
41
+ '</div></div>' +
41
42
  javascript_tag do
42
43
  JsAdaptor.call_to_save_query_and_key_event_initialization_for_saving_queries(
43
44
  id_and_name, grid_name, base_path_to_query_controller, parameters.to_json, ids.to_json
@@ -94,7 +94,7 @@ module Wice::JsAdaptor #:nodoc:
94
94
  id_and_name, grid_name, base_path_to_query_controller, parameters_json, ids_json) #:nodoc:
95
95
  %/ function #{grid_name}_save_query(){\n/ +
96
96
  %` if ( typeof(#{grid_name}) != "undefined")\n` +
97
- %! #{grid_name}.save_query($('##{id_and_name}')[0].value, '#{base_path_to_query_controller}', #{parameters_json}, #{ids_json})\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
98
  %/}\n/ +
99
99
  %/ $('##{id_and_name}').keydown(function(event){\n/ +
100
100
  %/ if (event.keyCode == 13) #{grid_name}_save_query();\n/ +
@@ -113,7 +113,7 @@ module Wice::JsAdaptor #:nodoc:
113
113
  id_and_name, grid_name, base_path_to_query_controller, parameters_json, ids_json) #:nodoc:
114
114
  %/ function #{grid_name}_save_query(){\n/ +
115
115
  %` if ( typeof(#{grid_name}) != "undefined")\n` +
116
- %/ #{grid_name}.save_query($F('#{id_and_name}'), '#{base_path_to_query_controller}', #{parameters_json}, #{ids_json})\n/ +
116
+ %/ #{grid_name}.save_query('#{id_and_name}', $F('#{id_and_name}'), '#{base_path_to_query_controller}', #{parameters_json}, #{ids_json})\n/ +
117
117
  %/ }\n/ +
118
118
  %/ $('#{id_and_name}').observe('keydown', function(event){\n/ +
119
119
  %/ if (event.keyCode == 13) #{grid_name}_save_query();\n/ +
data/wice_grid.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{wice_grid}
8
- s.version = "3.0.0.pre3"
8
+ s.version = "3.0.0.pre4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Yuri Leikind"]
12
- s.date = %q{2011-02-18}
12
+ s.date = %q{2011-04-21}
13
13
  s.description = %q{A Rails grid plugin to create grids with sorting, pagination, and (automatically generated) filters }
14
14
  s.email = %q{yuri.leikind@gmail.com}
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wice_grid
3
3
  version: !ruby/object:Gem::Version
4
- hash: -1876988210
4
+ hash: -1876988209
5
5
  prerelease: true
6
6
  segments:
7
7
  - 3
8
8
  - 0
9
9
  - 0
10
- - pre3
11
- version: 3.0.0.pre3
10
+ - pre4
11
+ version: 3.0.0.pre4
12
12
  platform: ruby
13
13
  authors:
14
14
  - Yuri Leikind
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-02-18 00:00:00 +01:00
19
+ date: 2011-04-21 00:00:00 +02:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency