yui-on-rails 0.1.9 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/lib/yui-on-rails/prototype_helper.rb +18 -5
- data/yui-on-rails.gemspec +1 -1
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.10
|
@@ -1,13 +1,26 @@
|
|
1
1
|
module ActionView
|
2
2
|
module Helpers
|
3
3
|
module PrototypeHelper
|
4
|
-
#alias :original_link_to_remote :link_to_remote
|
5
|
-
|
6
4
|
def link_to_remote_with_yui(name, options = {}, html_options = nil)
|
7
|
-
|
8
|
-
|
5
|
+
#myopts = {}
|
6
|
+
[:loading, :loaded, :interactive,:success,:failure,:complete].each do |symb|
|
7
|
+
options.merge!({symb=>"yui_default_#{symb.to_s}()"}) unless options.keys.include?(symb)
|
8
|
+
end
|
9
|
+
#options.merge!({:before=>"default_before()",:complete=>"alert('completed')"})
|
10
|
+
link_to_function(name, remote_function(options), html_options || options.delete(:html))
|
11
|
+
end
|
12
|
+
def form_remote_tag(options = {}, &block)
|
13
|
+
[:loading, :loaded, :interactive,:success,:failure,:complete].each do |symb|
|
14
|
+
options.merge!({symb=>"yui_default_#{symb.to_s}()"}) unless options.keys.include?(symb)
|
15
|
+
end
|
16
|
+
options[:form] = true
|
17
|
+
options[:html] ||= {}
|
18
|
+
options[:html][:onsubmit] =
|
19
|
+
(options[:html][:onsubmit] ? options[:html][:onsubmit] + "; " : "") +
|
20
|
+
"#{remote_function(options)}; return false;"
|
21
|
+
|
22
|
+
form_tag(options[:html].delete(:action) || url_for(options[:url]), options[:html], &block)
|
9
23
|
end
|
10
|
-
alias_method_chain :link_to_remote, :yui
|
11
24
|
end
|
12
25
|
end
|
13
26
|
end
|
data/yui-on-rails.gemspec
CHANGED