eita-jrails 0.9.0 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +19 -0
- data/assets/images/jquery-ui/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/assets/images/jquery-ui/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/assets/images/jquery-ui/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/assets/images/jquery-ui/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/assets/images/jquery-ui/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/assets/images/jquery-ui/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/assets/images/jquery-ui/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/assets/images/jquery-ui/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/assets/images/jquery-ui/ui-icons_222222_256x240.png +0 -0
- data/assets/images/jquery-ui/ui-icons_2e83ff_256x240.png +0 -0
- data/assets/images/jquery-ui/ui-icons_454545_256x240.png +0 -0
- data/assets/images/jquery-ui/ui-icons_888888_256x240.png +0 -0
- data/assets/images/jquery-ui/ui-icons_cd0a0a_256x240.png +0 -0
- data/assets/javascripts/jquery/jquery-ui-i18n.js +1379 -0
- data/assets/javascripts/jquery/jquery-ui-i18n.min.js +33 -0
- data/assets/javascripts/jrails/jrails.js +0 -12
- data/assets/stylesheets/smoothness/jquery-ui.css +573 -0
- data/lib/action_view/helpers/generator.rb +336 -0
- data/lib/action_view/helpers/jquery_helper.rb +558 -0
- data/lib/action_view/helpers/jquery_ui_helper.rb +165 -0
- data/lib/action_view/helpers/proxies.rb +187 -0
- data/lib/action_view/helpers/scriptaculous_helper.rb +263 -0
- data/lib/action_view/template/handlers/rjs.rb +14 -0
- data/lib/jrails.rb +3 -7
- data/lib/jrails/engine.rb +26 -0
- data/lib/jrails/javascript_helper.rb +97 -0
- data/lib/jrails/on_load_action_controller.rb +2 -0
- data/lib/jrails/on_load_action_view.rb +26 -0
- data/lib/jrails/renderers.rb +12 -0
- data/lib/jrails/rendering.rb +13 -0
- data/lib/jrails/selector_assertions.rb +211 -0
- metadata +37 -12
- data/README.rdoc +0 -27
- data/init.rb +0 -3
- data/install.rb +0 -2
- data/lib/jrails/jquery_selector_assertions.rb +0 -60
@@ -0,0 +1,14 @@
|
|
1
|
+
module ActionView
|
2
|
+
module Template::Handlers
|
3
|
+
class RJS
|
4
|
+
# Default format used by RJS.
|
5
|
+
class_attribute :default_format
|
6
|
+
self.default_format = Mime::JS
|
7
|
+
|
8
|
+
def call(template)
|
9
|
+
"update_page do |page|;#{template.source}\nend"
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
data/lib/jrails.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
$: << File.expand_path("..", __FILE__)
|
2
2
|
|
3
3
|
module JRails
|
4
|
+
|
4
5
|
@@config = {
|
5
6
|
:google => false,
|
6
7
|
:jquery_version => "1.7.2",
|
@@ -33,14 +34,9 @@ module JRails
|
|
33
34
|
def self.jquery_path ; @@jquery_path ; end
|
34
35
|
def self.jqueryui_path ; @@jqueryui_path ; end
|
35
36
|
def self.jqueryui_i18n_path ; @@jqueryui_i18n_path ; end
|
37
|
+
|
36
38
|
end
|
37
39
|
|
38
|
-
require 'jrails/
|
39
|
-
require 'jrails/helpers'
|
40
|
-
require 'jrails/generator'
|
41
|
-
require 'jrails/asset_tag_ext'
|
40
|
+
require 'jrails/engine'
|
42
41
|
require 'jrails/jquery_selector_assertions' if Rails.env.test?
|
43
42
|
|
44
|
-
ActionView::Helpers::PrototypeHelper = ActionView::Helpers::JqueryHelper
|
45
|
-
ActionView::Helpers::ScriptaculousHelper = ActionView::Helpers::JqueryUiHelper
|
46
|
-
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'rails'
|
2
|
+
require 'active_support'
|
3
|
+
|
4
|
+
if defined? Rails::Plugin
|
5
|
+
ActiveSupport.on_load :action_controller do
|
6
|
+
require 'jrails/on_load_action_controller'
|
7
|
+
end
|
8
|
+
|
9
|
+
ActiveSupport.on_load :action_view do
|
10
|
+
require 'jrails/on_load_action_view'
|
11
|
+
end
|
12
|
+
else
|
13
|
+
module JRails
|
14
|
+
class Engine < Rails::Engine
|
15
|
+
initializer 'jrails.initialize' do
|
16
|
+
ActiveSupport.on_load :action_controller do
|
17
|
+
require 'jrails/on_load_action_controller'
|
18
|
+
end
|
19
|
+
|
20
|
+
ActiveSupport.on_load :action_view do
|
21
|
+
require 'jrails/on_load_action_view'
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,97 @@
|
|
1
|
+
require 'action_view/helpers/javascript_helper'
|
2
|
+
|
3
|
+
module ActionView
|
4
|
+
module Helpers
|
5
|
+
JavaScriptHelper.module_eval do
|
6
|
+
|
7
|
+
include ActionView::Helpers::JqueryHelper
|
8
|
+
|
9
|
+
undef_method :button_to_function if method_defined? :button_to_function
|
10
|
+
undef_method :link_to_function if method_defined? :link_to_function
|
11
|
+
|
12
|
+
# Returns a button with the given +name+ text that'll trigger a JavaScript +function+ using the
|
13
|
+
# onclick handler.
|
14
|
+
#
|
15
|
+
# The first argument +name+ is used as the button's value or display text.
|
16
|
+
#
|
17
|
+
# The next arguments are optional and may include the javascript function definition and a hash of html_options.
|
18
|
+
#
|
19
|
+
# The +function+ argument can be omitted in favor of an +update_page+
|
20
|
+
# block, which evaluates to a string when the template is rendered
|
21
|
+
# (instead of making an Ajax request first).
|
22
|
+
#
|
23
|
+
# The +html_options+ will accept a hash of html attributes for the link tag. Some examples are :class => "nav_button", :id => "articles_nav_button"
|
24
|
+
#
|
25
|
+
# Note: if you choose to specify the javascript function in a block, but would like to pass html_options, set the +function+ parameter to nil
|
26
|
+
#
|
27
|
+
# Examples:
|
28
|
+
# button_to_function "Greeting", "alert('Hello world!')"
|
29
|
+
# button_to_function "Delete", "if (confirm('Really?')) do_delete()"
|
30
|
+
# button_to_function "Details" do |page|
|
31
|
+
# page[:details].visual_effect :toggle_slide
|
32
|
+
# end
|
33
|
+
# button_to_function "Details", :class => "details_button" do |page|
|
34
|
+
# page[:details].visual_effect :toggle_slide
|
35
|
+
# end
|
36
|
+
def button_to_function(name, *args, &block)
|
37
|
+
html_options = args.extract_options!.symbolize_keys
|
38
|
+
|
39
|
+
function = block_given? ? update_page(&block) : args[0] || ''
|
40
|
+
onclick = "#{"#{html_options[:onclick]}; " if html_options[:onclick]}#{function};"
|
41
|
+
|
42
|
+
tag(:input, html_options.merge(:type => 'button', :value => name, :onclick => onclick))
|
43
|
+
end
|
44
|
+
|
45
|
+
# link_to_function("Show me more", nil, :id => "more_link") do |page|
|
46
|
+
# page[:details].visual_effect :toggle_blind
|
47
|
+
# page[:more_link].replace_html "Show me less"
|
48
|
+
# end
|
49
|
+
# Produces:
|
50
|
+
# <a href="#" id="more_link" onclick="try {
|
51
|
+
# $("details").visualEffect("toggle_blind");
|
52
|
+
# $("more_link").update("Show me less");
|
53
|
+
# }
|
54
|
+
# catch (e) {
|
55
|
+
# alert('RJS error:\n\n' + e.toString());
|
56
|
+
# alert('$(\"details\").visualEffect(\"toggle_blind\");
|
57
|
+
# \n$(\"more_link\").update(\"Show me less\");');
|
58
|
+
# throw e
|
59
|
+
# };
|
60
|
+
# return false;">Show me more</a>
|
61
|
+
#
|
62
|
+
def link_to_function(name, *args, &block)
|
63
|
+
html_options = args.extract_options!.symbolize_keys
|
64
|
+
|
65
|
+
function = block_given? ? update_page(&block) : args[0] || ''
|
66
|
+
onclick = "#{"#{html_options[:onclick]}; " if html_options[:onclick]}#{function}; return false;"
|
67
|
+
href = html_options[:href] || '#'
|
68
|
+
|
69
|
+
content_tag(:a, name, html_options.merge(:href => href, :onclick => onclick))
|
70
|
+
end
|
71
|
+
|
72
|
+
# This function can be used to render rjs inline
|
73
|
+
#
|
74
|
+
# <%= javascript_function do |page|
|
75
|
+
# page.replace_html :list, :partial => 'list', :object => @list
|
76
|
+
# end %>
|
77
|
+
#
|
78
|
+
def javascript_function(*args, &block)
|
79
|
+
html_options = args.extract_options!
|
80
|
+
function = args[0] || ''
|
81
|
+
|
82
|
+
html_options.symbolize_keys!
|
83
|
+
function = update_page(&block) if block_given?
|
84
|
+
javascript_tag(function)
|
85
|
+
end
|
86
|
+
|
87
|
+
def jquery_id(id)
|
88
|
+
id.to_s.count('#.*,>+~:[/ ') == 0 ? "##{id}" : id
|
89
|
+
end
|
90
|
+
|
91
|
+
def jquery_ids(ids)
|
92
|
+
Array(ids).map{|id| jquery_id(id)}.join(',')
|
93
|
+
end
|
94
|
+
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'action_view/helpers/jquery_helper'
|
2
|
+
require 'action_view/helpers/jquery_ui_helper'
|
3
|
+
require 'action_view/template/handlers/rjs'
|
4
|
+
require 'jrails/javascript_helper'
|
5
|
+
require 'jrails/rendering'
|
6
|
+
|
7
|
+
ActionView::Base.class_eval do
|
8
|
+
cattr_accessor :debug_rjs
|
9
|
+
self.debug_rjs = false
|
10
|
+
end
|
11
|
+
|
12
|
+
ActionView::Base.class_eval do
|
13
|
+
#require 'jrails/asset_tag_ext'
|
14
|
+
include ActionView::Helpers::JqueryHelper
|
15
|
+
include ActionView::Helpers::JqueryUiHelper
|
16
|
+
include ActionView::Helpers::JavaScriptHelper
|
17
|
+
end
|
18
|
+
|
19
|
+
ActionView::TestCase.class_eval do
|
20
|
+
#require 'jrails/asset_tag_ext'
|
21
|
+
include ActionView::Helpers::JqueryHelper
|
22
|
+
include ActionView::Helpers::JqueryUiHelper
|
23
|
+
include ActionView::Helpers::JavaScriptHelper
|
24
|
+
end
|
25
|
+
|
26
|
+
ActionView::Template.register_template_handler :rjs, ActionView::Template::Handlers::RJS.new
|
@@ -0,0 +1,12 @@
|
|
1
|
+
require 'action_controller/metal/renderers'
|
2
|
+
|
3
|
+
module ActionController
|
4
|
+
module Renderers
|
5
|
+
add :update do |proc, options|
|
6
|
+
view_context = self.view_context
|
7
|
+
generator = ActionView::Helpers::JqueryHelper::JavaScriptGenerator.new view_context, &proc
|
8
|
+
self.content_type = Mime::JS
|
9
|
+
self.response_body = generator.to_s
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'action_view/helpers/rendering_helper'
|
2
|
+
|
3
|
+
ActionView::Helpers::RenderingHelper.module_eval do
|
4
|
+
def render_with_update options = {}, locals = {}, &block
|
5
|
+
if options == :update
|
6
|
+
update_page(&block)
|
7
|
+
else
|
8
|
+
render_without_update options, locals, &block
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
alias_method_chain :render, :update
|
13
|
+
end
|
@@ -0,0 +1,211 @@
|
|
1
|
+
require 'active_support/core_ext/module/aliasing'
|
2
|
+
require 'action_controller/vendor/html-scanner'
|
3
|
+
require 'action_dispatch/testing/assertions'
|
4
|
+
require 'action_dispatch/testing/assertions/selector'
|
5
|
+
|
6
|
+
#--
|
7
|
+
# Copyright (c) 2006 Assaf Arkin (http://labnotes.org)
|
8
|
+
# Under MIT and/or CC By license.
|
9
|
+
#++
|
10
|
+
|
11
|
+
ActionDispatch::Assertions::SelectorAssertions.module_eval do
|
12
|
+
# Selects content from the RJS response.
|
13
|
+
#
|
14
|
+
# === Narrowing down
|
15
|
+
#
|
16
|
+
# With no arguments, asserts that one or more elements are updated or
|
17
|
+
# inserted by RJS statements.
|
18
|
+
#
|
19
|
+
# Use the +id+ argument to narrow down the assertion to only statements
|
20
|
+
# that update or insert an element with that identifier.
|
21
|
+
#
|
22
|
+
# Use the first argument to narrow down assertions to only statements
|
23
|
+
# of that type. Possible values are <tt>:replace</tt>, <tt>:replace_html</tt>,
|
24
|
+
# <tt>:show</tt>, <tt>:hide</tt>, <tt>:toggle</tt>, <tt>:remove</tta>,
|
25
|
+
# <tt>:insert_html</tt> and <tt>:redirect</tt>.
|
26
|
+
#
|
27
|
+
# Use the argument <tt>:insert</tt> followed by an insertion position to narrow
|
28
|
+
# down the assertion to only statements that insert elements in that
|
29
|
+
# position. Possible values are <tt>:top</tt>, <tt>:bottom</tt>, <tt>:before</tt>
|
30
|
+
# and <tt>:after</tt>.
|
31
|
+
#
|
32
|
+
# Use the argument <tt>:redirect</tt> followed by a path to check that an statement
|
33
|
+
# which redirects to the specified path is generated.
|
34
|
+
#
|
35
|
+
# Using the <tt>:remove</tt> statement, you will be able to pass a block, but it will
|
36
|
+
# be ignored as there is no HTML passed for this statement.
|
37
|
+
#
|
38
|
+
# === Using blocks
|
39
|
+
#
|
40
|
+
# Without a block, +assert_select_rjs+ merely asserts that the response
|
41
|
+
# contains one or more RJS statements that replace or update content.
|
42
|
+
#
|
43
|
+
# With a block, +assert_select_rjs+ also selects all elements used in
|
44
|
+
# these statements and passes them to the block. Nested assertions are
|
45
|
+
# supported.
|
46
|
+
#
|
47
|
+
# Calling +assert_select_rjs+ with no arguments and using nested asserts
|
48
|
+
# asserts that the HTML content is returned by one or more RJS statements.
|
49
|
+
# Using +assert_select+ directly makes the same assertion on the content,
|
50
|
+
# but without distinguishing whether the content is returned in an HTML
|
51
|
+
# or JavaScript.
|
52
|
+
#
|
53
|
+
# ==== Examples
|
54
|
+
#
|
55
|
+
# # Replacing the element foo.
|
56
|
+
# # page.replace 'foo', ...
|
57
|
+
# assert_select_rjs :replace, "foo"
|
58
|
+
#
|
59
|
+
# # Replacing with the chained RJS proxy.
|
60
|
+
# # page[:foo].replace ...
|
61
|
+
# assert_select_rjs :chained_replace, 'foo'
|
62
|
+
#
|
63
|
+
# # Inserting into the element bar, top position.
|
64
|
+
# assert_select_rjs :insert, :top, "bar"
|
65
|
+
#
|
66
|
+
# # Remove the element bar
|
67
|
+
# assert_select_rjs :remove, "bar"
|
68
|
+
#
|
69
|
+
# # Changing the element foo, with an image.
|
70
|
+
# assert_select_rjs "foo" do
|
71
|
+
# assert_select "img[src=/images/logo.gif""
|
72
|
+
# end
|
73
|
+
#
|
74
|
+
# # RJS inserts or updates a list with four items.
|
75
|
+
# assert_select_rjs do
|
76
|
+
# assert_select "ol>li", 4
|
77
|
+
# end
|
78
|
+
#
|
79
|
+
# # The same, but shorter.
|
80
|
+
# assert_select "ol>li", 4
|
81
|
+
#
|
82
|
+
# # Checking for a redirect.
|
83
|
+
# assert_select_rjs :redirect, root_path
|
84
|
+
def assert_select_rjs(*args, &block)
|
85
|
+
rjs_type = args.first.is_a?(Symbol) ? args.shift : nil
|
86
|
+
id = args.first.is_a?(String) ? args.shift : nil
|
87
|
+
|
88
|
+
# If the first argument is a symbol, it's the type of RJS statement we're looking
|
89
|
+
# for (update, replace, insertion, etc). Otherwise, we're looking for just about
|
90
|
+
# any RJS statement.
|
91
|
+
if rjs_type
|
92
|
+
if rjs_type == :insert
|
93
|
+
position = args.shift
|
94
|
+
id = args.shift
|
95
|
+
insertion = "insert_#{position}".to_sym
|
96
|
+
raise ArgumentError, "Unknown RJS insertion type #{position}" unless RJS_STATEMENTS[insertion]
|
97
|
+
statement = "(#{RJS_STATEMENTS[insertion]})"
|
98
|
+
else
|
99
|
+
raise ArgumentError, "Unknown RJS statement type #{rjs_type}" unless RJS_STATEMENTS[rjs_type]
|
100
|
+
statement = "(#{RJS_STATEMENTS[rjs_type]})"
|
101
|
+
end
|
102
|
+
else
|
103
|
+
statement = "#{RJS_STATEMENTS[:any]}"
|
104
|
+
end
|
105
|
+
|
106
|
+
# Next argument we're looking for is the element identifier. If missing, we pick
|
107
|
+
# any element, otherwise we replace it in the statement.
|
108
|
+
pattern = Regexp.new(
|
109
|
+
id ? statement.gsub(RJS_ANY_ID, "\"#{id}\"") : statement
|
110
|
+
)
|
111
|
+
|
112
|
+
# Duplicate the body since the next step involves destroying it.
|
113
|
+
matches = nil
|
114
|
+
case rjs_type
|
115
|
+
when :remove, :show, :hide, :toggle
|
116
|
+
matches = @response.body.match(pattern)
|
117
|
+
else
|
118
|
+
@response.body.gsub(pattern) do |match|
|
119
|
+
html = unescape_rjs(match)
|
120
|
+
matches ||= []
|
121
|
+
matches.concat HTML::Document.new(html).root.children.select { |n| n.tag? }
|
122
|
+
""
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
if matches
|
127
|
+
assert true # to count the assertion
|
128
|
+
if block_given? && !([:remove, :show, :hide, :toggle].include? rjs_type)
|
129
|
+
begin
|
130
|
+
@selected ||= nil
|
131
|
+
in_scope, @selected = @selected, matches
|
132
|
+
yield matches
|
133
|
+
ensure
|
134
|
+
@selected = in_scope
|
135
|
+
end
|
136
|
+
end
|
137
|
+
matches
|
138
|
+
else
|
139
|
+
# RJS statement not found.
|
140
|
+
case rjs_type
|
141
|
+
when :remove, :show, :hide, :toggle
|
142
|
+
flunk_message = "No RJS statement that #{rjs_type.to_s}s '#{id}' was rendered."
|
143
|
+
else
|
144
|
+
flunk_message = "No RJS statement that replaces or inserts HTML content."
|
145
|
+
end
|
146
|
+
flunk args.shift || flunk_message
|
147
|
+
end
|
148
|
+
end
|
149
|
+
|
150
|
+
protected
|
151
|
+
|
152
|
+
RJS_PATTERN_HTML = "\"((\\\\\"|[^\"])*)\""
|
153
|
+
RJS_ANY_ID = "[\"']([^\"])*[\"']"
|
154
|
+
|
155
|
+
RJS_STATEMENTS = {
|
156
|
+
:chained_replace => "\(jQuery|$\)\\(#{RJS_ANY_ID}\\)\\.replaceWith\\(#{RJS_PATTERN_HTML}\\)",
|
157
|
+
:chained_replace_html => "\(jQuery|$\)\\(#{RJS_ANY_ID}\\)\\.updateWith\\(#{RJS_PATTERN_HTML}\\)",
|
158
|
+
:replace_html => "\(jQuery|$\)\\(#{RJS_ANY_ID}\\)\\.html\\(#{RJS_PATTERN_HTML}\\)",
|
159
|
+
:insert_html => "\(jQuery|$\)\\(#{RJS_ANY_ID}\\)\\.append\\(#{RJS_PATTERN_HTML}\\)",
|
160
|
+
:replace => "\(jQuery|$\)\\(#{RJS_ANY_ID}\\)\\.replaceWith\\(#{RJS_PATTERN_HTML}\\)",
|
161
|
+
:insert_top => "\(jQuery|$\)\\(#{RJS_ANY_ID}\\)\\.prepend\\(#{RJS_PATTERN_HTML}\\)",
|
162
|
+
:insert_bottom => "\(jQuery|$\)\\(#{RJS_ANY_ID}\\)\\.append\\(#{RJS_PATTERN_HTML}\\)",
|
163
|
+
:effect => "\(jQuery|$\)\\(#{RJS_ANY_ID}\\)\\.effect\\(",
|
164
|
+
:highlight => "\(jQuery|$\)\\(#{RJS_ANY_ID}\\)\\.effect\\('highlight'"
|
165
|
+
}
|
166
|
+
[:remove, :show, :hide, :toggle, :reset ].each do |action|
|
167
|
+
RJS_STATEMENTS[action] = "\(jQuery|$\)\\(#{RJS_ANY_ID}\\)\\.#{action}\\(\\)"
|
168
|
+
end
|
169
|
+
|
170
|
+
RJS_STATEMENTS[:any] = Regexp.new("(#{RJS_STATEMENTS.values.join('|')})")
|
171
|
+
RJS_PATTERN_UNICODE_ESCAPED_CHAR = /\\u([0-9a-zA-Z]{4})/
|
172
|
+
|
173
|
+
# +assert_select+ and +css_select+ call this to obtain the content in the HTML
|
174
|
+
# page, or from all the RJS statements, depending on the type of response.
|
175
|
+
def response_from_page_with_rjs
|
176
|
+
content_type = @response.content_type
|
177
|
+
|
178
|
+
if content_type && Mime::JS =~ content_type
|
179
|
+
body = @response.body.dup
|
180
|
+
root = HTML::Node.new(nil)
|
181
|
+
|
182
|
+
while true
|
183
|
+
next if body.sub!(RJS_STATEMENTS[:any]) do |match|
|
184
|
+
html = unescape_rjs(match)
|
185
|
+
matches = HTML::Document.new(html).root.children.select { |n| n.tag? }
|
186
|
+
root.children.concat matches
|
187
|
+
""
|
188
|
+
end
|
189
|
+
break
|
190
|
+
end
|
191
|
+
|
192
|
+
root
|
193
|
+
else
|
194
|
+
response_from_page_without_rjs
|
195
|
+
end
|
196
|
+
end
|
197
|
+
alias_method_chain :response_from_page, :rjs
|
198
|
+
|
199
|
+
# Unescapes a RJS string.
|
200
|
+
def unescape_rjs(rjs_string)
|
201
|
+
# RJS encodes double quotes and line breaks.
|
202
|
+
unescaped= rjs_string.gsub('\"', '"')
|
203
|
+
unescaped.gsub!(/\\\//, '/')
|
204
|
+
unescaped.gsub!('\n', "\n")
|
205
|
+
unescaped.gsub!('\076', '>')
|
206
|
+
unescaped.gsub!('\074', '<')
|
207
|
+
# RJS encodes non-ascii characters.
|
208
|
+
unescaped.gsub!(RJS_PATTERN_UNICODE_ESCAPED_CHAR) {|u| [$1.hex].pack('U*')}
|
209
|
+
unescaped
|
210
|
+
end
|
211
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eita-jrails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron Eisenberger
|
@@ -11,32 +11,58 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date:
|
14
|
+
date: 2014-10-06 00:00:00.000000000 Z
|
15
15
|
dependencies: []
|
16
|
-
description: Using jRails, you can
|
17
|
-
|
18
|
-
email:
|
16
|
+
description: Using jRails, you can still use RJS and Jquery/JqueryUi helpers with
|
17
|
+
the same API as Prototype/Scryptaculous helpers.
|
18
|
+
email: braulio@eita.org.br
|
19
19
|
executables:
|
20
20
|
- jrails
|
21
21
|
extensions: []
|
22
22
|
extra_rdoc_files:
|
23
23
|
- LICENSE
|
24
|
-
- README.
|
24
|
+
- README.md
|
25
25
|
files:
|
26
26
|
- LICENSE
|
27
|
-
- README.
|
27
|
+
- README.md
|
28
|
+
- assets/images/jquery-ui/ui-bg_flat_0_aaaaaa_40x100.png
|
29
|
+
- assets/images/jquery-ui/ui-bg_flat_75_ffffff_40x100.png
|
30
|
+
- assets/images/jquery-ui/ui-bg_glass_55_fbf9ee_1x400.png
|
31
|
+
- assets/images/jquery-ui/ui-bg_glass_65_ffffff_1x400.png
|
32
|
+
- assets/images/jquery-ui/ui-bg_glass_75_dadada_1x400.png
|
33
|
+
- assets/images/jquery-ui/ui-bg_glass_75_e6e6e6_1x400.png
|
34
|
+
- assets/images/jquery-ui/ui-bg_glass_95_fef1ec_1x400.png
|
35
|
+
- assets/images/jquery-ui/ui-bg_highlight-soft_75_cccccc_1x100.png
|
36
|
+
- assets/images/jquery-ui/ui-icons_222222_256x240.png
|
37
|
+
- assets/images/jquery-ui/ui-icons_2e83ff_256x240.png
|
38
|
+
- assets/images/jquery-ui/ui-icons_454545_256x240.png
|
39
|
+
- assets/images/jquery-ui/ui-icons_888888_256x240.png
|
40
|
+
- assets/images/jquery-ui/ui-icons_cd0a0a_256x240.png
|
41
|
+
- assets/javascripts/jquery/jquery-ui-i18n.js
|
42
|
+
- assets/javascripts/jquery/jquery-ui-i18n.min.js
|
28
43
|
- assets/javascripts/jquery/jquery-ui.js
|
29
44
|
- assets/javascripts/jquery/jquery-ui.min.js
|
30
45
|
- assets/javascripts/jquery/jquery.js
|
31
46
|
- assets/javascripts/jquery/jquery.min.js
|
32
47
|
- assets/javascripts/jrails/jrails.js
|
33
48
|
- assets/javascripts/jrails/jrails.min.js
|
49
|
+
- assets/stylesheets/smoothness/jquery-ui.css
|
34
50
|
- bin/jrails
|
35
|
-
-
|
36
|
-
-
|
51
|
+
- lib/action_view/helpers/generator.rb
|
52
|
+
- lib/action_view/helpers/jquery_helper.rb
|
53
|
+
- lib/action_view/helpers/jquery_ui_helper.rb
|
54
|
+
- lib/action_view/helpers/proxies.rb
|
55
|
+
- lib/action_view/helpers/scriptaculous_helper.rb
|
56
|
+
- lib/action_view/template/handlers/rjs.rb
|
37
57
|
- lib/jrails.rb
|
38
58
|
- lib/jrails/asset_tag_ext.rb
|
39
|
-
- lib/jrails/
|
59
|
+
- lib/jrails/engine.rb
|
60
|
+
- lib/jrails/javascript_helper.rb
|
61
|
+
- lib/jrails/on_load_action_controller.rb
|
62
|
+
- lib/jrails/on_load_action_view.rb
|
63
|
+
- lib/jrails/renderers.rb
|
64
|
+
- lib/jrails/rendering.rb
|
65
|
+
- lib/jrails/selector_assertions.rb
|
40
66
|
- lib/tasks/jrails.rake
|
41
67
|
homepage: http://github.com/coletivoEITA/jrails
|
42
68
|
licenses: []
|
@@ -61,6 +87,5 @@ rubyforge_project: jrails
|
|
61
87
|
rubygems_version: 2.2.2
|
62
88
|
signing_key:
|
63
89
|
specification_version: 3
|
64
|
-
summary: jRails is a drop-in jQuery replacement for the
|
65
|
-
helpers.
|
90
|
+
summary: jRails is a drop-in jQuery replacement for the prototope-rails gem.
|
66
91
|
test_files: []
|