active_scaffold 3.4.19 → 3.4.20

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4522a06a683825a65e9660092377e48da966cf7b
4
- data.tar.gz: 0b81519fc84c1b1e9cc41de416d91a80d25fcdb9
3
+ metadata.gz: 42baa20c0dc8c0bcc7f9d1f8f9458de2135d4def
4
+ data.tar.gz: d5cf0f64b77a05dcf00dafbd57533df34033a18b
5
5
  SHA512:
6
- metadata.gz: 72fbd86f4e970a0956747ffbda27cf02dd7c3ef75733e4e88af919b6753339f192f3343e158b21ddab2d9c9e12c9951e95a3a18c6a74063658521a04f2630637
7
- data.tar.gz: 39c90ee5898d11f75d8e587138a641de6edc9048776f243d535fc10b4508ce06395d5e8616060938384d153c40ca81d04330cc2880251af1623ef9695fb43de5
6
+ metadata.gz: 9e45bf8388302307fe80cf19293c71efa2779289931fbe4fa852ab10b56c32c4b3b2f9da22d1a4c3426cf80879555e94b0722bd8395c5dbfe267bcc92400717c
7
+ data.tar.gz: 869a983b83016caf7aaf93d213a2392e056ccfcc0c41b51149fd17292542fd5e42ee8083271f4b15e8ba25cd0d1a6844874e91823f7c06baf2c36aa53645b760
data/CHANGELOG CHANGED
@@ -1,3 +1,12 @@
1
+ - Update tinymce bridge for tinyMCE 4.x
2
+ - Ignore :format in conditions_from_params
3
+ - column with :radio form_ui works like :select form_ui in list and show
4
+ - Fix default opt_value in search_range when comparator options is overrided
5
+ - translate include_blank in select search_ui
6
+ - Add column.css_class to li tag on field search
7
+ - Allow to set having in custom_finder_options
8
+
9
+ = 3.4.19
1
10
  - Fix rails bug on set_inverse_instance for has_one :through associations which has_many inverse association
2
11
  - Fix warn when form is changed
3
12
 
@@ -1,7 +1,7 @@
1
1
  var action_link_close = ActiveScaffold.ActionLink.Abstract.prototype.close;
2
2
  ActiveScaffold.ActionLink.Abstract.prototype.close = function() {
3
3
  jQuery(this.adapter).find('textarea.mceEditor').each(function(index, elem) {
4
- tinyMCE.execCommand('mceRemoveControl', false, jQuery(elem).attr('id'));
4
+ tinyMCE.execCommand('mceRemoveEditor', false, jQuery(elem).attr('id'));
5
5
  });
6
6
  action_link_close.apply(this);
7
7
  };
@@ -1,7 +1,7 @@
1
1
  var action_link_close = ActiveScaffold.ActionLink.Abstract.prototype.close;
2
2
  ActiveScaffold.ActionLink.Abstract.prototype.close = function() {
3
3
  this.adapter.select('textarea.mceEditor').each(function(elem) {
4
- tinyMCE.execCommand('mceRemoveControl', false, elem.id);
4
+ tinyMCE.execCommand('mceRemoveEditor', false, elem.id);
5
5
  });
6
6
  action_link_close.apply(this);
7
7
  };
@@ -9,7 +9,7 @@ form_tag url_options, options %>
9
9
  <ol class="form">
10
10
  <% visibles, hiddens = visibles_and_hiddens(active_scaffold_config.field_search) %>
11
11
  <% visibles.each do |column| -%>
12
- <li class="form-element"><%= search_attribute(column, @record) %></li>
12
+ <li class="form-element <%= column.css_class unless column.css_class.is_a?(Proc) %>"><%= search_attribute(column, @record) %></li>
13
13
  <% end -%>
14
14
  <% unless hiddens.empty? -%>
15
15
  <li class="sub-section">
@@ -20,7 +20,7 @@ form_tag url_options, options %>
20
20
  </h5>
21
21
  <ol id ="<%= further_options_id %>" class="form" style="display:none;">
22
22
  <% hiddens.each do |column| -%>
23
- <li class="form-element"><%= search_attribute(column, @record) %></li>
23
+ <li class="form-element <%= column.css_class unless column.css_class.is_a?(Proc) %>"><%= search_attribute(column, @record) %></li>
24
24
  <% end -%>
25
25
  </ol>
26
26
  </li>
@@ -208,7 +208,7 @@ module ActiveScaffold::Actions
208
208
  def conditions_from_params
209
209
  @conditions_from_params ||= begin
210
210
  conditions = {}
211
- params.except(:controller, :action, :page, :sort, :sort_direction, :id).each do |key, value|
211
+ params.except(:controller, :action, :page, :sort, :sort_direction, :format, :id).each do |key, value|
212
212
  column = active_scaffold_config.model.columns_hash[key.to_s]
213
213
  next unless column
214
214
  key = key.to_sym
@@ -15,22 +15,22 @@ class ActiveScaffold::Bridges::TinyMce
15
15
  def active_scaffold_input_text_editor(column, options)
16
16
  options[:class] = "#{options[:class]} mceEditor #{column.options[:class]}".strip
17
17
 
18
- settings = {:theme => 'simple'}.merge(column.options[:tinymce] || {})
18
+ settings = {:theme => 'modern'}.merge(column.options[:tinymce] || {})
19
19
  settings = settings.to_json
20
20
  settings = "tinyMCE.settings = #{settings};"
21
21
 
22
22
  html = []
23
23
  html << send(override_input(:textarea), column, options)
24
- html << javascript_tag(settings + "tinyMCE.execCommand('mceAddControl', false, '#{options[:id]}');") if request.xhr? || params[:iframe]
24
+ html << javascript_tag(settings + "tinyMCE.execCommand('mceAddEditor', false, '#{options[:id]}');") if request.xhr? || params[:iframe]
25
25
  html.join "\n"
26
26
  end
27
27
 
28
28
  def onsubmit_with_tiny_mce
29
29
  case ActiveScaffold.js_framework
30
30
  when :jquery
31
- submit_js = 'tinyMCE.triggerSave();jQuery(\'textarea.mceEditor\').each(function(index, elem) { tinyMCE.execCommand(\'mceRemoveControl\', false, jQuery(elem).attr(\'id\')); });'
31
+ submit_js = 'tinyMCE.triggerSave();jQuery(\'textarea.mceEditor\').each(function(index, elem) { tinyMCE.execCommand(\'mceRemoveEditor\', false, jQuery(elem).attr(\'id\')); });'
32
32
  when :prototype
33
- submit_js = 'tinyMCE.triggerSave();this.select(\'textarea.mceEditor\').each(function(elem) { tinyMCE.execCommand(\'mceRemoveControl\', false, elem.id); });'
33
+ submit_js = 'tinyMCE.triggerSave();this.select(\'textarea.mceEditor\').each(function(elem) { tinyMCE.execCommand(\'mceRemoveEditor\', false, elem.id); });'
34
34
  end
35
35
  [onsubmit_without_tiny_mce, submit_js].compact.join ';'
36
36
  end
@@ -429,7 +429,7 @@ module ActiveScaffold
429
429
  end
430
430
 
431
431
  def append_to_query(relation, options)
432
- options.assert_valid_keys :where, :select, :group, :reorder, :limit, :offset, :joins, :outer_joins, :includes, :lock, :readonly, :from, :conditions, :preload, (:references if Rails::VERSION::MAJOR >= 4)
432
+ options.assert_valid_keys :where, :select, :having, :group, :reorder, :limit, :offset, :joins, :outer_joins, :includes, :lock, :readonly, :from, :conditions, :preload, (:references if Rails::VERSION::MAJOR >= 4)
433
433
  relation = options.reject { |_, v| v.blank? }.inject(relation) do |rel, (k, v)|
434
434
  k == :conditions ? apply_conditions(rel, *v) : rel.send(k, v)
435
435
  end
@@ -105,7 +105,7 @@ module ActiveScaffold
105
105
  def format_column_value(record, column, value = nil)
106
106
  value ||= record.send(column.name) unless record.nil?
107
107
  if column.association.nil?
108
- if column.form_ui == :select && column.options[:options]
108
+ if [:select, :radio].include?(column.form_ui) && column.options[:options]
109
109
  text, val = column.options[:options].find { |text, val| (val.nil? ? text : val).to_s == value.to_s }
110
110
  value = active_scaffold_translated_option(column, text, val).first if text
111
111
  end
@@ -114,6 +114,7 @@ module ActiveScaffold
114
114
  html_options[:name] += '[]'
115
115
  else
116
116
  options[:include_blank] ||= as_(:_select_)
117
+ active_scaffold_translate_select_options(options)
117
118
  end
118
119
 
119
120
  if (optgroup = options.delete(:optgroup))
@@ -185,11 +186,10 @@ module ActiveScaffold
185
186
  select_options = active_scaffold_search_range_comparator_options(column)
186
187
  if active_scaffold_search_range_string?(column)
187
188
  text_field_size = 15
188
- opt_value ||= '%?%'
189
189
  else
190
190
  text_field_size = 10
191
- opt_value ||= '='
192
191
  end
192
+ opt_value ||= select_options[0][1]
193
193
 
194
194
  from_value = controller.class.condition_value_for_numeric(column, from_value)
195
195
  to_value = controller.class.condition_value_for_numeric(column, to_value)
@@ -2,7 +2,7 @@ module ActiveScaffold
2
2
  module Version
3
3
  MAJOR = 3
4
4
  MINOR = 4
5
- PATCH = 19
5
+ PATCH = 20
6
6
 
7
7
  STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end
@@ -15,7 +15,7 @@ class TinyMceTest < ActionView::TestCase
15
15
  @record = Company.new
16
16
  expects(:request).returns(stub(:xhr? => true))
17
17
 
18
- assert_dom_equal %{<textarea name=\"record[name]\" class=\"name-input mceEditor\" id=\"record_name\">\n</textarea>\n<script#{' type="text/javascript"' if Rails::VERSION::MAJOR < 4}>\n//<![CDATA[\ntinyMCE.settings = {\"theme\":\"simple\"};tinyMCE.execCommand('mceAddControl', false, 'record_name');\n//]]>\n</script>}, active_scaffold_input_text_editor(config.columns[:name], :name => 'record[name]', :id => 'record_name', :class => 'name-input', :object => @record)
18
+ assert_dom_equal %{<textarea name=\"record[name]\" class=\"name-input mceEditor\" id=\"record_name\">\n</textarea>\n<script#{' type="text/javascript"' if Rails::VERSION::MAJOR < 4}>\n//<![CDATA[\ntinyMCE.settings = {\"theme\":\"modern\"};tinyMCE.execCommand('mceAddEditor', false, 'record_name');\n//]]>\n</script>}, active_scaffold_input_text_editor(config.columns[:name], :name => 'record[name]', :id => 'record_name', :class => 'name-input', :object => @record)
19
19
  end
20
20
 
21
21
  protected
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_scaffold
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.19
4
+ version: 3.4.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Many, see README
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-27 00:00:00.000000000 Z
11
+ date: 2015-04-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: brakeman