active_scaffold 3.1.18 → 3.1.19
Sign up to get free protection for your applications and to get access to all the features.
- data/app/assets/javascripts/jquery/active_scaffold.js +11 -11
- data/lib/active_scaffold/bridges/tiny_mce/helpers.rb +6 -1
- data/lib/active_scaffold/extensions/action_view_rendering.rb +5 -1
- data/lib/active_scaffold/extensions/active_association_reflection.rb +2 -2
- data/lib/active_scaffold/version.rb +1 -1
- metadata +4 -4
@@ -275,7 +275,7 @@ jQuery(document).ready(function() {
|
|
275
275
|
Slight modifications by Elliot Winkler
|
276
276
|
*/
|
277
277
|
|
278
|
-
if (typeof(
|
278
|
+
if (typeof(jQuery.fn.delayedObserver) === 'undefined') {
|
279
279
|
(function() {
|
280
280
|
var delayedObserverStack = [];
|
281
281
|
var observed;
|
@@ -303,7 +303,7 @@ if (typeof($.fn.delayedObserver) === 'undefined') {
|
|
303
303
|
);
|
304
304
|
}
|
305
305
|
|
306
|
-
|
306
|
+
jQuery.fn.extend({
|
307
307
|
delayedObserver:function(delay, callback){
|
308
308
|
$this = jQuery(this);
|
309
309
|
|
@@ -362,7 +362,7 @@ var ActiveScaffold = {
|
|
362
362
|
},
|
363
363
|
reload_if_empty: function(tbody, url) {
|
364
364
|
if (this.records_for(tbody).length == 0) {
|
365
|
-
|
365
|
+
jQuery.getScript(url);
|
366
366
|
}
|
367
367
|
},
|
368
368
|
removeSortClasses: function(scaffold) {
|
@@ -543,7 +543,7 @@ var ActiveScaffold = {
|
|
543
543
|
process_checkbox_inplace_edit: function(checkbox, options) {
|
544
544
|
var checked = checkbox.is(':checked');
|
545
545
|
if (checked === true) options['params'] += '&value=1';
|
546
|
-
|
546
|
+
jQuery.ajax({
|
547
547
|
url: options.url,
|
548
548
|
type: "POST",
|
549
549
|
data: options['params'],
|
@@ -638,14 +638,14 @@ var ActiveScaffold = {
|
|
638
638
|
sortable_options.update = function(event, ui) {
|
639
639
|
var url = controller + '/' + options.action + '?'
|
640
640
|
url += jQuery(this).sortable('serialize',{key: encodeURIComponent(jQuery(this).attr('id') + '[]'), expression:/^[^_-](?:[A-Za-z0-9_-]*)-(.*)-row$/});
|
641
|
-
|
641
|
+
jQuery.post(url.append_params(url_params));
|
642
642
|
}
|
643
643
|
}
|
644
644
|
element.sortable(sortable_options);
|
645
645
|
},
|
646
646
|
|
647
647
|
record_select_onselect: function(edit_associated_url, active_scaffold_id, id){
|
648
|
-
|
648
|
+
jQuery.ajax({
|
649
649
|
url: edit_associated_url.split('--ID--').join(id),
|
650
650
|
error: function(xhr, textStatus, errorThrown){
|
651
651
|
ActiveScaffold.report_500_response(active_scaffold_id)
|
@@ -750,13 +750,13 @@ var ActiveScaffold = {
|
|
750
750
|
|
751
751
|
if (send_form) {
|
752
752
|
params = as_form.serialize();
|
753
|
-
params += '&' +
|
753
|
+
params += '&' + jQuery.param({"source_id": source_id});
|
754
754
|
} else {
|
755
755
|
params = {value: val};
|
756
756
|
params.source_id = source_id;
|
757
757
|
}
|
758
758
|
|
759
|
-
|
759
|
+
jQuery.ajax({
|
760
760
|
url: url,
|
761
761
|
data: params,
|
762
762
|
beforeSend: function(event) {
|
@@ -962,7 +962,7 @@ ActiveScaffold.Actions.Record = ActiveScaffold.Actions.Abstract.extend({
|
|
962
962
|
ActiveScaffold.ActionLink.Record = ActiveScaffold.ActionLink.Abstract.extend({
|
963
963
|
close_previous_adapter: function() {
|
964
964
|
var _this = this;
|
965
|
-
|
965
|
+
jQuery.each(this.set.links, function(index, item) {
|
966
966
|
if (item.url != _this.url && item.is_disabled() && item.adapter) {
|
967
967
|
item.enable();
|
968
968
|
item.adapter.remove();
|
@@ -1001,7 +1001,7 @@ ActiveScaffold.ActionLink.Record = ActiveScaffold.ActionLink.Abstract.extend({
|
|
1001
1001
|
|
1002
1002
|
enable: function() {
|
1003
1003
|
var _this = this;
|
1004
|
-
|
1004
|
+
jQuery.each(this.set.links, function(index, item) {
|
1005
1005
|
if (item.url != _this.url) return;
|
1006
1006
|
item.tag.removeClass('disabled');
|
1007
1007
|
});
|
@@ -1009,7 +1009,7 @@ ActiveScaffold.ActionLink.Record = ActiveScaffold.ActionLink.Abstract.extend({
|
|
1009
1009
|
|
1010
1010
|
disable: function() {
|
1011
1011
|
var _this = this;
|
1012
|
-
|
1012
|
+
jQuery.each(this.set.links, function(index, item) {
|
1013
1013
|
if (item.url != _this.url) return;
|
1014
1014
|
item.tag.addClass('disabled');
|
1015
1015
|
});
|
@@ -14,9 +14,14 @@ class ActiveScaffold::Bridges::TinyMce
|
|
14
14
|
|
15
15
|
def active_scaffold_input_text_editor(column, options)
|
16
16
|
options[:class] = "#{options[:class]} mceEditor #{column.options[:class]}".strip
|
17
|
+
|
18
|
+
settings = { :theme => 'simple' }.merge(column.options[:tinymce] || {})
|
19
|
+
settings = settings.to_s.gsub(/:(.+?)\=\>/, '\1:')
|
20
|
+
settings = "tinyMCE.settings = #{settings};"
|
21
|
+
|
17
22
|
html = []
|
18
23
|
html << send(override_input(:textarea), column, options)
|
19
|
-
html << javascript_tag("tinyMCE.execCommand('mceAddControl', false, '#{options[:id]}');") if request.xhr? || params[:iframe]
|
24
|
+
html << javascript_tag(settings + "tinyMCE.execCommand('mceAddControl', false, '#{options[:id]}');") if request.xhr? || params[:iframe]
|
20
25
|
html.join "\n"
|
21
26
|
end
|
22
27
|
|
@@ -4,7 +4,11 @@ module ActionView
|
|
4
4
|
def find_all_templates(name, partial = false, locals = {})
|
5
5
|
prefixes.collect do |prefix|
|
6
6
|
view_paths.collect do |resolver|
|
7
|
-
|
7
|
+
if Rails.version < '3.2.0' # FIXME: remove when rails 3.1 support is dropped
|
8
|
+
temp_args = *args_for_lookup(name, [prefix], partial, locals)
|
9
|
+
else
|
10
|
+
temp_args = *args_for_lookup(name, [prefix], partial, locals, {})
|
11
|
+
end
|
8
12
|
temp_args[1] = temp_args[1][0]
|
9
13
|
resolver.find_all(*temp_args)
|
10
14
|
end
|
@@ -12,11 +12,11 @@ ActiveRecord::Reflection::AssociationReflection.class_eval do
|
|
12
12
|
end
|
13
13
|
end
|
14
14
|
def build_association(*opts, &block)
|
15
|
-
|
15
|
+
@original_build_association_called = true # FIXME: remove when 3.1 support is dropped
|
16
16
|
klass_with_sti(*opts).new(*opts, &block)
|
17
17
|
end
|
18
18
|
def create_association(*opts, &block)
|
19
|
-
|
19
|
+
@original_build_association_called = true # FIXME: remove when 3.1 support is dropped
|
20
20
|
klass_with_sti(*opts).create(*opts, &block)
|
21
21
|
end
|
22
22
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_scaffold
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 37
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 3
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 3.1.
|
9
|
+
- 19
|
10
|
+
version: 3.1.19
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Many, see README
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-01-
|
18
|
+
date: 2012-01-31 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
version_requirements: &id001 !ruby/object:Gem::Requirement
|