jquery_on_rails 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +4 -1
- data/VERSION +1 -1
- data/jquery_on_rails.gemspec +1 -1
- data/lib/jquery_on_rails/helpers/jquery_helper.rb +35 -0
- data/spec/spec_helper.rb +1 -0
- metadata +2 -2
data/README.rdoc
CHANGED
@@ -1,8 +1,11 @@
|
|
1
1
|
= jquery_on_rails
|
2
2
|
|
3
|
-
A
|
3
|
+
A drop-in replacement for Rails 3 javascript helpers and unobstrusive javacript (ujs)
|
4
4
|
using JQuery instead of prototype/scriptaculous.
|
5
5
|
|
6
|
+
* JavaScriptGenerator and friends refactored from Rails' PrototypeHelper implementation
|
7
|
+
http://github.com/rails/rails
|
8
|
+
|
6
9
|
* Rails 3 unobtrusive JavaScript helpers "borrowed" from Russell Jones
|
7
10
|
http://github.com/CodeOfficer/jquery-helpers-for-rails3
|
8
11
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.2
|
data/jquery_on_rails.gemspec
CHANGED
@@ -308,5 +308,40 @@ module JQueryOnRails
|
|
308
308
|
end
|
309
309
|
|
310
310
|
end
|
311
|
+
|
312
|
+
class JavaScriptProxy < ActionView::Helpers::JavaScriptProxy
|
313
|
+
end
|
314
|
+
class JavaScriptVariableProxy < ActionView::Helpers::JavaScriptVariableProxy
|
315
|
+
end
|
316
|
+
|
317
|
+
# Adapted from Rails 3
|
318
|
+
class JavaScriptElementProxy < JavaScriptProxy
|
319
|
+
def initialize(generator, id)
|
320
|
+
@id = id
|
321
|
+
super(generator, "$(#{::ActiveSupport::JSON.encode('#'+id)})")
|
322
|
+
end
|
323
|
+
|
324
|
+
def [](attribute)
|
325
|
+
append_to_function_chain!(attribute)
|
326
|
+
self
|
327
|
+
end
|
328
|
+
|
329
|
+
def []=(variable, value)
|
330
|
+
assign(variable, value)
|
331
|
+
end
|
332
|
+
|
333
|
+
def replace_html(*options_for_render)
|
334
|
+
call 'html', @generator.send(:render, *options_for_render)
|
335
|
+
end
|
336
|
+
|
337
|
+
def replace(*options_for_render)
|
338
|
+
call 'replaceWith', @generator.send(:render, *options_for_render)
|
339
|
+
end
|
340
|
+
|
341
|
+
def reload(options_for_replace = {})
|
342
|
+
replace(options_for_replace.merge({ :partial => @id.to_s }))
|
343
|
+
end
|
344
|
+
end
|
345
|
+
|
311
346
|
end
|
312
347
|
end
|
data/spec/spec_helper.rb
CHANGED