mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-21 17:50:13 +01:00
Removed superfluous 'tracks' directory at the root of the repository.
Testing commits to github.
This commit is contained in:
parent
6a42901514
commit
4cbf5a34d3
2269 changed files with 0 additions and 0 deletions
57
vendor/plugins/unobtrusive_javascript/lib/ujs/javascript_proxies.rb
vendored
Normal file
57
vendor/plugins/unobtrusive_javascript/lib/ujs/javascript_proxies.rb
vendored
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
module ActionView
|
||||
module Helpers
|
||||
class JavaScriptProxy
|
||||
public :method_missing
|
||||
|
||||
protected
|
||||
|
||||
def wrap(function, *args)
|
||||
args = [function_chain[-1].chomp(';')].concat(args.collect(&:to_json)).join(', ')
|
||||
replace_line("#{function.to_s}(#{args});")
|
||||
end
|
||||
|
||||
def replace_line(new_line)
|
||||
function_chain[-1] = new_line
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
module UJS
|
||||
module JavascriptProxies
|
||||
|
||||
class ReferencedJavascriptElementProxy < ActionView::Helpers::JavaScriptElementProxy
|
||||
|
||||
def initialize(generator, var)
|
||||
@generator = generator
|
||||
@generator << var
|
||||
end
|
||||
|
||||
def reload; end
|
||||
|
||||
end
|
||||
|
||||
class JavascriptArgumentProxy
|
||||
def initialize(proxy, *contructor_args)
|
||||
@proxy, @args = proxy, contructor_args
|
||||
end
|
||||
|
||||
def method_missing(meth, *args)
|
||||
proxy = @proxy.new(*@args)
|
||||
proxy.__send__(meth, *args)
|
||||
end
|
||||
end
|
||||
|
||||
class JavascriptEventProxy < ActionView::Helpers::JavaScriptProxy
|
||||
def stop
|
||||
wrap('Event.stop')
|
||||
end
|
||||
|
||||
def element
|
||||
wrap('Event.element')
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue