active_scaffold_vho 3.0.9 → 3.0.10
Sign up to get free protection for your applications and to get access to all the features.
- data/active_scaffold_vho.gemspec +6 -7
- data/frontends/default/javascripts/jquery/active_scaffold.js +1 -0
- data/frontends/default/javascripts/prototype/active_scaffold.js +2 -0
- data/frontends/default/stylesheets/stylesheet.css +5 -1
- data/frontends/default/views/destroy.js.rjs +14 -2
- data/frontends/default/views/on_create.js.rjs +3 -3
- data/frontends/default/views/on_update.js.rjs +1 -1
- data/init.rb +0 -2
- data/lib/active_scaffold/actions/create.rb +1 -1
- data/lib/active_scaffold/actions/delete.rb +1 -1
- data/lib/{active_record_permissions.rb → active_scaffold/active_record_permissions.rb} +0 -0
- data/lib/active_scaffold/bridges/calendar_date_select/lib/as_cds_bridge.rb +8 -4
- data/lib/active_scaffold/data_structures/action_links.rb +11 -1
- data/lib/active_scaffold/data_structures/column.rb +1 -0
- data/lib/active_scaffold/finder.rb +1 -0
- data/lib/active_scaffold/helpers/controller_helpers.rb +9 -4
- data/lib/active_scaffold/helpers/id_helpers.rb +5 -5
- data/lib/{paginator.rb → active_scaffold/paginator.rb} +0 -0
- data/lib/{responds_to_parent.rb → active_scaffold/responds_to_parent.rb} +0 -0
- data/lib/active_scaffold/version.rb +1 -1
- data/lib/active_scaffold.rb +6 -6
- data/lib/{environment.rb → active_scaffold_env.rb} +0 -0
- data/lib/active_scaffold_vho.rb +1 -1
- data/lib/extensions/paginator_extensions.rb +1 -1
- data/lib/generators/active_scaffold_setup/active_scaffold_setup_generator.rb +3 -3
- metadata +8 -9
- data/lib/dhtml_confirm.rb +0 -54
data/active_scaffold_vho.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{active_scaffold_vho}
|
8
|
-
s.version = "3.0.
|
8
|
+
s.version = "3.0.10"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Many, see README"]
|
12
|
-
s.date = %q{2011-01
|
12
|
+
s.date = %q{2011-02-01}
|
13
13
|
s.description = %q{Save time and headaches, and create a more easily maintainable set of pages, with ActiveScaffold. ActiveScaffold handles all your CRUD (create, read, update, delete) user interface needs, leaving you more time to focus on more challenging (and interesting!) problems.}
|
14
14
|
s.email = %q{activescaffold@googlegroups.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -102,7 +102,6 @@ Gem::Specification.new do |s|
|
|
102
102
|
"frontends/default/views/update_column.js.rjs",
|
103
103
|
"frontends/default/views/update_row.js.rjs",
|
104
104
|
"init.rb",
|
105
|
-
"lib/active_record_permissions.rb",
|
106
105
|
"lib/active_scaffold.rb",
|
107
106
|
"lib/active_scaffold/actions/common_search.rb",
|
108
107
|
"lib/active_scaffold/actions/core.rb",
|
@@ -116,6 +115,7 @@ Gem::Specification.new do |s|
|
|
116
115
|
"lib/active_scaffold/actions/show.rb",
|
117
116
|
"lib/active_scaffold/actions/subform.rb",
|
118
117
|
"lib/active_scaffold/actions/update.rb",
|
118
|
+
"lib/active_scaffold/active_record_permissions.rb",
|
119
119
|
"lib/active_scaffold/attribute_params.rb",
|
120
120
|
"lib/active_scaffold/bridges/ancestry/bridge.rb",
|
121
121
|
"lib/active_scaffold/bridges/ancestry/lib/ancestry_bridge.rb",
|
@@ -195,11 +195,12 @@ Gem::Specification.new do |s|
|
|
195
195
|
"lib/active_scaffold/locale/ja.yml",
|
196
196
|
"lib/active_scaffold/locale/ru.yml",
|
197
197
|
"lib/active_scaffold/marked_model.rb",
|
198
|
+
"lib/active_scaffold/paginator.rb",
|
199
|
+
"lib/active_scaffold/responds_to_parent.rb",
|
198
200
|
"lib/active_scaffold/version.rb",
|
199
201
|
"lib/active_scaffold_assets.rb",
|
202
|
+
"lib/active_scaffold_env.rb",
|
200
203
|
"lib/active_scaffold_vho.rb",
|
201
|
-
"lib/dhtml_confirm.rb",
|
202
|
-
"lib/environment.rb",
|
203
204
|
"lib/extensions/action_controller_rendering.rb",
|
204
205
|
"lib/extensions/action_view_rendering.rb",
|
205
206
|
"lib/extensions/action_view_resolver.rb",
|
@@ -223,8 +224,6 @@ Gem::Specification.new do |s|
|
|
223
224
|
"lib/generators/active_scaffold_controller/templates/controller.rb",
|
224
225
|
"lib/generators/active_scaffold_setup/USAGE",
|
225
226
|
"lib/generators/active_scaffold_setup/active_scaffold_setup_generator.rb",
|
226
|
-
"lib/paginator.rb",
|
227
|
-
"lib/responds_to_parent.rb",
|
228
227
|
"public/blank.html",
|
229
228
|
"shoulda_macros/macros.rb",
|
230
229
|
"test/bridges/bridge_test.rb",
|
@@ -445,6 +445,7 @@ var ActiveScaffold = {
|
|
445
445
|
}
|
446
446
|
}
|
447
447
|
row.remove();
|
448
|
+
tbody = $(tbody);
|
448
449
|
this.stripe(tbody);
|
449
450
|
this.decrement_record_count(tbody.up('div.active-scaffold'));
|
450
451
|
this.reload_if_empty(tbody, page_reload_url);
|
@@ -512,6 +513,7 @@ var ActiveScaffold = {
|
|
512
513
|
var element = event.element();
|
513
514
|
toggable.toggle();
|
514
515
|
element.innerHTML = (toggable.style.display == 'none') ? options.show_label : options.hide_label;
|
516
|
+
return false;
|
515
517
|
});
|
516
518
|
},
|
517
519
|
|
@@ -312,6 +312,11 @@ line-height: 16px;
|
|
312
312
|
white-space: nowrap;
|
313
313
|
}
|
314
314
|
|
315
|
+
.active-scaffold tr.record td.actions a.disabled {
|
316
|
+
color: #666;
|
317
|
+
opacity: 0.5;
|
318
|
+
}
|
319
|
+
|
315
320
|
.active-scaffold .actions .action_group div:hover {
|
316
321
|
background-color: #ff8;
|
317
322
|
}
|
@@ -438,7 +443,6 @@ right: 0px;
|
|
438
443
|
.active-scaffold .active-scaffold .active-scaffold-header div.actions a,
|
439
444
|
.active-scaffold .active-scaffold .active-scaffold-header div.actions div {
|
440
445
|
font: bold 11px verdana, sans-serif;
|
441
|
-
padding: 0 2px 1px 17px;
|
442
446
|
}
|
443
447
|
|
444
448
|
.blue-theme .active-scaffold .active-scaffold-header div.actions a,
|
@@ -1,5 +1,17 @@
|
|
1
|
+
messages_id = active_scaffold_messages_id
|
1
2
|
if controller.send(:successful?)
|
2
|
-
if (
|
3
|
+
if render_parent? && controller.respond_to?(:render_component_into_view)
|
4
|
+
render_parent_options
|
5
|
+
if render_parent_action == :row
|
6
|
+
# TODO: That s not working with delete....
|
7
|
+
page << "ActiveScaffold.delete_record_row('#{element_row_id(:controller_id => "as_#{id_from_controller(params[:eid] || params[:parent_sti])}", :action => 'list', :id => params[:id])}','#{url_for(params_for(:action => :index, :id => nil, :page => [active_scaffold_config.list.user.page.to_i - 1, 1].max, :escape => false))}');"
|
8
|
+
messages_id = active_scaffold_messages_id(:controller_id => "as_#{id_from_controller(params[:eid] || params[:parent_sti])}")
|
9
|
+
elsif render_parent_action == :index
|
10
|
+
parent_rendered = controller.send(:render_component_into_view, render_parent_options)
|
11
|
+
page << parent_rendered
|
12
|
+
end
|
13
|
+
#page.call 'ActiveScaffold.replace', active_scaffold_calculations_id, render(:partial => 'list_calculations') if active_scaffold_config.list.columns.any? {|c| c.calculation?}
|
14
|
+
elsif (active_scaffold_config.delete.refresh_list)
|
3
15
|
page.call 'ActiveScaffold.replace_html', active_scaffold_content_id, render(:partial => 'list', :layout => false)
|
4
16
|
else
|
5
17
|
page << "ActiveScaffold.delete_record_row('#{element_row_id(:action => 'list', :id => params[:id])}','#{url_for(params_for(:action => :index, :id => nil, :page => [active_scaffold_config.list.user.page.to_i - 1, 1].max, :escape => false))}');"
|
@@ -8,4 +20,4 @@ if controller.send(:successful?)
|
|
8
20
|
else
|
9
21
|
flash[:error] = active_scaffold_error_messages_for(@record, :object_name => "#{@record.class.model_name.human.downcase}#{@record.new_record? ? '' : ": #{@record.to_label}"}", :header_message => '', :message => "#{@record.class.model_name.human.downcase}#{@record.new_record? ? '' : ": #{@record.to_label}"}", :container_tag => nil, :list_type => :br)
|
10
22
|
end
|
11
|
-
page.call 'ActiveScaffold.replace_html',
|
23
|
+
page.call 'ActiveScaffold.replace_html', messages_id, render(:partial => 'messages')
|
@@ -3,9 +3,9 @@ insert_at ||= :top
|
|
3
3
|
page << "var action_link = ActiveScaffold.find_action_link('#{form_selector}');"
|
4
4
|
page << "action_link.update_flash_messages('#{escape_javascript(render(:partial => 'messages').strip)}');"
|
5
5
|
if controller.send :successful?
|
6
|
-
if render_parent? && respond_to?(:
|
7
|
-
parent_rendered =
|
8
|
-
if
|
6
|
+
if render_parent? && controller.respond_to?(:render_component_into_view)
|
7
|
+
parent_rendered = controller.send(:render_component_into_view, render_parent_options)
|
8
|
+
if nested_singular_association?
|
9
9
|
page << "action_link.close('#{escape_javascript(parent_rendered)}');"
|
10
10
|
else
|
11
11
|
if render_parent_action == :row
|
@@ -5,7 +5,7 @@ page << "action_link.update_flash_messages('#{escape_javascript(render(:partial
|
|
5
5
|
if controller.send :successful?
|
6
6
|
if render_parent? && controller.respond_to?(:render_component_into_view)
|
7
7
|
parent_rendered = controller.send(:render_component_into_view, render_parent_options)
|
8
|
-
if
|
8
|
+
if nested_singular_association?
|
9
9
|
page << "action_link.close('#{escape_javascript(parent_rendered)}');"
|
10
10
|
else
|
11
11
|
if render_parent_action == :row
|
data/init.rb
CHANGED
@@ -61,7 +61,7 @@ module ActiveScaffold::Actions
|
|
61
61
|
end
|
62
62
|
|
63
63
|
def create_respond_to_js
|
64
|
-
if active_scaffold_config.create.refresh_list &&
|
64
|
+
if successful? && active_scaffold_config.create.refresh_list && !render_parent?
|
65
65
|
do_search if respond_to? :do_search
|
66
66
|
do_list
|
67
67
|
end
|
@@ -23,7 +23,7 @@ module ActiveScaffold::Actions
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def destroy_respond_to_js
|
26
|
-
if active_scaffold_config.delete.refresh_list &&
|
26
|
+
if successful? && active_scaffold_config.delete.refresh_list && !render_parent?
|
27
27
|
do_search if respond_to? :do_search
|
28
28
|
do_list
|
29
29
|
end
|
File without changes
|
@@ -49,14 +49,18 @@ module ActiveScaffold
|
|
49
49
|
end
|
50
50
|
|
51
51
|
module ViewHelpers
|
52
|
+
def self.included(base)
|
53
|
+
base.alias_method_chain :active_scaffold_stylesheets, :calendar_date_select
|
54
|
+
base.alias_method_chain :active_scaffold_javascripts, :calendar_date_select
|
55
|
+
end
|
52
56
|
# Provides stylesheets to include with +stylesheet_link_tag+
|
53
|
-
def
|
54
|
-
|
57
|
+
def active_scaffold_stylesheets_with_calendar_date_select(frontend = :default)
|
58
|
+
active_scaffold_stylesheets_without_calendar_date_select + [calendar_date_select_stylesheets]
|
55
59
|
end
|
56
60
|
|
57
61
|
# Provides stylesheets to include with +stylesheet_link_tag+
|
58
|
-
def
|
59
|
-
|
62
|
+
def active_scaffold_javascripts_with_calendar_date_select(frontend = :default)
|
63
|
+
active_scaffold_javascripts_without_calendar_date_select + [calendar_date_select_javascripts]
|
60
64
|
end
|
61
65
|
end
|
62
66
|
end
|
@@ -71,11 +71,21 @@ module ActiveScaffold::DataStructures
|
|
71
71
|
def delete(val)
|
72
72
|
self.each({:include_set => true}) do |link, set|
|
73
73
|
if link.action == val.to_s
|
74
|
-
set.delete_if {|item|item.action == val.to_s}
|
74
|
+
set.delete_if {|item| item.is_a?(ActiveScaffold::DataStructures::ActionLink) && item.action == val.to_s}
|
75
75
|
end
|
76
76
|
end
|
77
77
|
end
|
78
78
|
|
79
|
+
def delete_group(name)
|
80
|
+
@set.each do |group|
|
81
|
+
if group.name == name
|
82
|
+
@set.delete_if {|item| item.is_a?(ActiveScaffold::DataStructures::ActionLinks) && item.name == name}
|
83
|
+
else
|
84
|
+
group.delete_group(name)
|
85
|
+
end if group.is_a?(ActiveScaffold::DataStructures::ActionLinks)
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
79
89
|
# iterates over the links, possibly by type
|
80
90
|
def each(options = {}, &block)
|
81
91
|
@set.each {|item|
|
@@ -270,6 +270,7 @@ module ActiveScaffold::DataStructures
|
|
270
270
|
@actions_for_association_links = self.class.actions_for_association_links.clone if @association
|
271
271
|
@options = {:format => :i18n_number} if @column.try(:number?)
|
272
272
|
@form_ui = :checkbox if @column and @column.type == :boolean
|
273
|
+
@form_ui = :textarea if @column and @column.type == :text
|
273
274
|
@allow_add_existing = true
|
274
275
|
@form_ui = self.class.association_form_ui if @association && self.class.association_form_ui
|
275
276
|
|
@@ -292,6 +292,7 @@ module ActiveScaffold
|
|
292
292
|
def append_to_query(query, options)
|
293
293
|
options.assert_valid_keys :where, :select, :group, :order, :limit, :offset, :joins, :includes, :lock, :readonly, :from
|
294
294
|
options.reject{|k, v| v.blank?}.inject(query) do |query, (k, v)|
|
295
|
+
query = query.except(:order) if k.to_sym == :order
|
295
296
|
query.send((k.to_sym), v)
|
296
297
|
end
|
297
298
|
end
|
@@ -2,7 +2,7 @@ module ActiveScaffold
|
|
2
2
|
module Helpers
|
3
3
|
module ControllerHelpers
|
4
4
|
def self.included(controller)
|
5
|
-
controller.class_eval { helper_method :params_for, :main_path_to_return, :render_parent?, :render_parent_options, :render_parent_action}
|
5
|
+
controller.class_eval { helper_method :params_for, :main_path_to_return, :render_parent?, :render_parent_options, :render_parent_action, :nested_singular_association?}
|
6
6
|
end
|
7
7
|
|
8
8
|
include ActiveScaffold::Helpers::IdHelpers
|
@@ -50,17 +50,21 @@ module ActiveScaffold
|
|
50
50
|
end
|
51
51
|
end
|
52
52
|
|
53
|
+
def nested_singular_association?
|
54
|
+
nested? && (nested.belongs_to? || nested.has_one?)
|
55
|
+
end
|
56
|
+
|
53
57
|
def render_parent?
|
54
|
-
|
58
|
+
nested_singular_association? || params[:parent_sti]
|
55
59
|
end
|
56
60
|
|
57
61
|
def render_parent_options
|
58
|
-
if
|
62
|
+
if nested_singular_association?
|
59
63
|
{:controller => nested.parent_scaffold.controller_path, :action => :row, :id => nested.parent_id}
|
60
64
|
elsif params[:parent_sti]
|
61
65
|
options = {:controller => params[:parent_sti], :action => render_parent_action(params[:parent_sti])}
|
62
66
|
if render_parent_action(params[:parent_sti]) == :index
|
63
|
-
options
|
67
|
+
options.merge(params.slice(:eid))
|
64
68
|
else
|
65
69
|
options.merge({:id => @record.id})
|
66
70
|
end
|
@@ -73,6 +77,7 @@ module ActiveScaffold
|
|
73
77
|
parent_controller = "#{controller_path.to_s.camelize}Controller".constantize
|
74
78
|
@parent_action = :index if action_name == 'create' && parent_controller.active_scaffold_config.actions.include?(:create) && parent_controller.active_scaffold_config.create.refresh_list == true
|
75
79
|
@parent_action = :index if action_name == 'update' && parent_controller.active_scaffold_config.actions.include?(:update) && parent_controller.active_scaffold_config.update.refresh_list == true
|
80
|
+
@parent_action = :index if action_name == 'destroy' && parent_controller.active_scaffold_config.actions.include?(:delete) && parent_controller.active_scaffold_config.delete.refresh_list == true
|
76
81
|
rescue ActiveScaffold::ControllerNotFound
|
77
82
|
end if @parent_action.nil?
|
78
83
|
@parent_action
|
@@ -6,8 +6,8 @@ module ActiveScaffold
|
|
6
6
|
controller.to_s.gsub("/", "__")
|
7
7
|
end
|
8
8
|
|
9
|
-
def controller_id
|
10
|
-
controller_id ||= 'as_' + id_from_controller(
|
9
|
+
def controller_id(controller = (params[:eid] || params[:parent_controller] || params[:controller]))
|
10
|
+
controller_id ||= 'as_' + id_from_controller(controller)
|
11
11
|
end
|
12
12
|
|
13
13
|
def active_scaffold_id
|
@@ -22,8 +22,8 @@ module ActiveScaffold
|
|
22
22
|
"#{controller_id}-tbody"
|
23
23
|
end
|
24
24
|
|
25
|
-
def active_scaffold_messages_id
|
26
|
-
"#{controller_id}-messages"
|
25
|
+
def active_scaffold_messages_id(options = {})
|
26
|
+
"#{options[:controller_id] || controller_id}-messages"
|
27
27
|
end
|
28
28
|
|
29
29
|
def active_scaffold_calculations_id(column = nil)
|
@@ -59,7 +59,7 @@ module ActiveScaffold
|
|
59
59
|
options[:action] ||= params[:action]
|
60
60
|
options[:id] ||= params[:id]
|
61
61
|
options[:id] ||= params[:parent_id]
|
62
|
-
clean_id "#{controller_id}-#{options[:action]}-#{options[:id]}-row"
|
62
|
+
clean_id "#{options[:controller_id] || controller_id}-#{options[:action]}-#{options[:id]}-row"
|
63
63
|
end
|
64
64
|
|
65
65
|
def element_cell_id(options = {})
|
File without changes
|
File without changes
|
data/lib/active_scaffold.rb
CHANGED
@@ -12,10 +12,9 @@ rescue LoadError
|
|
12
12
|
end
|
13
13
|
|
14
14
|
require 'active_scaffold_assets'
|
15
|
-
require 'active_record_permissions'
|
16
|
-
require '
|
17
|
-
require '
|
18
|
-
require 'responds_to_parent'
|
15
|
+
require 'active_scaffold/active_record_permissions'
|
16
|
+
require 'active_scaffold/paginator'
|
17
|
+
require 'active_scaffold/responds_to_parent'
|
19
18
|
|
20
19
|
require 'active_scaffold/version'
|
21
20
|
|
@@ -330,17 +329,18 @@ module ActiveScaffold
|
|
330
329
|
end
|
331
330
|
end
|
332
331
|
|
333
|
-
require '
|
332
|
+
require 'active_scaffold_env'
|
334
333
|
|
335
334
|
##
|
336
335
|
## Run the install assets script, too, just to make sure
|
337
336
|
## But at least rescue the action in production
|
338
337
|
##
|
338
|
+
|
339
339
|
Rails::Application.initializer("active_scaffold.install_assets") do
|
340
340
|
begin
|
341
341
|
ActiveScaffoldAssets.copy_to_public(ActiveScaffold.root, {:clean_up_destination => true})
|
342
342
|
rescue
|
343
343
|
raise $! unless Rails.env == 'production'
|
344
344
|
end
|
345
|
-
end
|
345
|
+
end if defined?(ACTIVE_SCAFFOLD_GEM)
|
346
346
|
|
File without changes
|
data/lib/active_scaffold_vho.rb
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
|
1
|
+
ACTIVE_SCAFFOLD_GEM = true
|
2
2
|
require 'active_scaffold'
|
@@ -8,7 +8,7 @@ module Rails
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def install_plugins
|
11
|
-
unless defined?(
|
11
|
+
unless defined?(ACTIVE_SCAFFOLD_GEM)
|
12
12
|
plugin 'verification', :git => 'git://github.com/rails/verification.git'
|
13
13
|
plugin 'render_component', :git => 'git://github.com/vhochstein/render_component.git'
|
14
14
|
end
|
@@ -21,9 +21,9 @@ module Rails
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def configure_active_scaffold
|
24
|
-
unless defined?(
|
24
|
+
unless defined?(ACTIVE_SCAFFOLD_GEM)
|
25
25
|
if js_lib == 'jquery'
|
26
|
-
gsub_file 'vendor/plugins/active_scaffold/lib/
|
26
|
+
gsub_file 'vendor/plugins/active_scaffold/lib/active_scaffold_env.rb', /#ActiveScaffold.js_framework = :jquery/, 'ActiveScaffold.js_framework = :jquery'
|
27
27
|
end
|
28
28
|
else
|
29
29
|
if js_lib == 'jquery'
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_scaffold_vho
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 3
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 3.0.
|
9
|
+
- 10
|
10
|
+
version: 3.0.10
|
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: 2011-01
|
18
|
+
date: 2011-02-01 00:00:00 +01:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -217,7 +217,6 @@ files:
|
|
217
217
|
- frontends/default/views/update_column.js.rjs
|
218
218
|
- frontends/default/views/update_row.js.rjs
|
219
219
|
- init.rb
|
220
|
-
- lib/active_record_permissions.rb
|
221
220
|
- lib/active_scaffold.rb
|
222
221
|
- lib/active_scaffold/actions/common_search.rb
|
223
222
|
- lib/active_scaffold/actions/core.rb
|
@@ -231,6 +230,7 @@ files:
|
|
231
230
|
- lib/active_scaffold/actions/show.rb
|
232
231
|
- lib/active_scaffold/actions/subform.rb
|
233
232
|
- lib/active_scaffold/actions/update.rb
|
233
|
+
- lib/active_scaffold/active_record_permissions.rb
|
234
234
|
- lib/active_scaffold/attribute_params.rb
|
235
235
|
- lib/active_scaffold/bridges/ancestry/bridge.rb
|
236
236
|
- lib/active_scaffold/bridges/ancestry/lib/ancestry_bridge.rb
|
@@ -310,11 +310,12 @@ files:
|
|
310
310
|
- lib/active_scaffold/locale/ja.yml
|
311
311
|
- lib/active_scaffold/locale/ru.yml
|
312
312
|
- lib/active_scaffold/marked_model.rb
|
313
|
+
- lib/active_scaffold/paginator.rb
|
314
|
+
- lib/active_scaffold/responds_to_parent.rb
|
313
315
|
- lib/active_scaffold/version.rb
|
314
316
|
- lib/active_scaffold_assets.rb
|
317
|
+
- lib/active_scaffold_env.rb
|
315
318
|
- lib/active_scaffold_vho.rb
|
316
|
-
- lib/dhtml_confirm.rb
|
317
|
-
- lib/environment.rb
|
318
319
|
- lib/extensions/action_controller_rendering.rb
|
319
320
|
- lib/extensions/action_view_rendering.rb
|
320
321
|
- lib/extensions/action_view_resolver.rb
|
@@ -338,8 +339,6 @@ files:
|
|
338
339
|
- lib/generators/active_scaffold_controller/templates/controller.rb
|
339
340
|
- lib/generators/active_scaffold_setup/USAGE
|
340
341
|
- lib/generators/active_scaffold_setup/active_scaffold_setup_generator.rb
|
341
|
-
- lib/paginator.rb
|
342
|
-
- lib/responds_to_parent.rb
|
343
342
|
- public/blank.html
|
344
343
|
- shoulda_macros/macros.rb
|
345
344
|
- test/bridges/bridge_test.rb
|
data/lib/dhtml_confirm.rb
DELETED
@@ -1,54 +0,0 @@
|
|
1
|
-
# Matt Mower <matt@cominded.com>
|
2
|
-
#
|
3
|
-
# A base class for creating DHTML confirmation types.
|
4
|
-
#
|
5
|
-
# The real work is done by the onclick_function and onclick_handler methods. In
|
6
|
-
# general it should only be required to override the default onclick_handler
|
7
|
-
# method and provide the specific Javascript required to invoke the DHTML confirm
|
8
|
-
# dialog of your choice.
|
9
|
-
#
|
10
|
-
# It is up to this dialog, if the user confirms the intended action, to invoke
|
11
|
-
# the function window.gFireModalLink() to trigger the intended action of the link.
|
12
|
-
# For example, using the Modalbox library, you would use something like:
|
13
|
-
#
|
14
|
-
# Modalbox.hide( {
|
15
|
-
# afterHide: function() {
|
16
|
-
# window.gFireModalLink();
|
17
|
-
# } } );
|
18
|
-
#
|
19
|
-
# By default the only action recognized is :value which is used to add a
|
20
|
-
# dhtml_confirm attribute to the link <a> tag. This value is detected by the
|
21
|
-
# ActiveScaffold link and triggers the DHTML confirmation logic.
|
22
|
-
#
|
23
|
-
class DHTMLConfirm
|
24
|
-
attr_accessor :value, :message, :options
|
25
|
-
|
26
|
-
def initialize( options = {} )
|
27
|
-
@options = options
|
28
|
-
@value = @options.delete(:value) { |key| "yes" }
|
29
|
-
@message = @options.delete(:message) { |key| "Are you sure?" }
|
30
|
-
end
|
31
|
-
|
32
|
-
def onclick_function( controller, link_id )
|
33
|
-
script = <<-END
|
34
|
-
window.gFireModalLink = function() {
|
35
|
-
var link = $('#{link_id}').action_link;
|
36
|
-
link.open_action.call( link );
|
37
|
-
};
|
38
|
-
#{ensure_termination(onclick_handler(controller,link_id))}
|
39
|
-
return false;
|
40
|
-
END
|
41
|
-
# script = "window.gModalLink = $('#{link_id}').action_link;#{onclick_handler(controller,link_id)}return false;"
|
42
|
-
end
|
43
|
-
|
44
|
-
def onclick_handler( controller, link_id )
|
45
|
-
""
|
46
|
-
end
|
47
|
-
|
48
|
-
protected
|
49
|
-
def ensure_termination( expression )
|
50
|
-
expression =~ /;$/ ? expression : "#{expression};"
|
51
|
-
end
|
52
|
-
|
53
|
-
end
|
54
|
-
|