Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
71931e2e
R
rails
项目概览
张重言
/
rails
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rails
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
71931e2e
编写于
5月 13, 2012
作者:
R
Rafael Mendonça França
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove `:mouseover` option from `image_tag` helper.
上级
2ef29ef9
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
3 addition
and
21 deletion
+3
-21
actionpack/CHANGELOG.md
actionpack/CHANGELOG.md
+3
-1
actionpack/lib/action_view/helpers/asset_tag_helper.rb
actionpack/lib/action_view/helpers/asset_tag_helper.rb
+0
-12
actionpack/test/template/asset_tag_helper_test.rb
actionpack/test/template/asset_tag_helper_test.rb
+0
-8
未找到文件。
actionpack/CHANGELOG.md
浏览文件 @
71931e2e
## Rails 4.0.0 (unreleased) ##
*
The
`select`
method (select tag) forces :include_blank if
`required`
is true and
*
Remove
`:mouseover`
option from
`image_tag`
helper.
*Rafael Mendonça França*
*
The
`select`
method (select tag) forces :include_blank if
`required`
is true and
`display size`
is one and
`multiple`
is not true.
*Angelo Capilleri*
*
Copy literal route constraints to defaults so that url generation know about them.
...
...
actionpack/lib/action_view/helpers/asset_tag_helper.rb
浏览文件 @
71931e2e
...
...
@@ -363,9 +363,6 @@ def font_url(source)
# * <tt>:size</tt> - Supplied as "{Width}x{Height}", so "30x45" becomes
# width="30" and height="45". <tt>:size</tt> will be ignored if the
# value is not in the correct format.
# * <tt>:mouseover</tt> - Set an alternate image to be used when the onmouseover
# event is fired, and sets the original image to be replaced onmouseout.
# This can be used to implement an easy image toggle that fires on onmouseover.
#
# ==== Examples
# image_tag("icon") # =>
...
...
@@ -380,10 +377,6 @@ def font_url(source)
# <img alt="Icon" height="32" src="/icons/icon.gif" width="32" />
# image_tag("/icons/icon.gif", :class => "menu_icon") # =>
# <img alt="Icon" class="menu_icon" src="/icons/icon.gif" />
# image_tag("mouse.png", :mouseover => "/assets/mouse_over.png") # =>
# <img src="/assets/mouse.png" onmouseover="this.src='/assets/mouse_over.png'" onmouseout="this.src='/assets/mouse.png'" alt="Mouse" />
# image_tag("mouse.png", :mouseover => image_path("mouse_over.png")) # =>
# <img src="/assets/mouse.png" onmouseover="this.src='/assets/mouse_over.png'" onmouseout="this.src='/assets/mouse.png'" alt="Mouse" />
def
image_tag
(
source
,
options
=
{})
options
=
options
.
symbolize_keys
...
...
@@ -397,11 +390,6 @@ def image_tag(source, options={})
options
[
:width
],
options
[
:height
]
=
size
.
split
(
"x"
)
if
size
=~
%r{^
\d
+x
\d
+$}
end
if
mouseover
=
options
.
delete
(
:mouseover
)
options
[
:onmouseover
]
=
"this.src='
#{
path_to_image
(
mouseover
)
}
'"
options
[
:onmouseout
]
=
"this.src='
#{
src
}
'"
end
tag
(
"img"
,
options
)
end
...
...
actionpack/test/template/asset_tag_helper_test.rb
浏览文件 @
71931e2e
...
...
@@ -203,8 +203,6 @@ def teardown
%(image_tag(".pdf.png"))
=>
%(<img alt=".pdf" src="/images/.pdf.png" />)
,
%(image_tag("http://www.rubyonrails.com/images/rails.png"))
=>
%(<img alt="Rails" src="http://www.rubyonrails.com/images/rails.png" />)
,
%(image_tag("//www.rubyonrails.com/images/rails.png"))
=>
%(<img alt="Rails" src="//www.rubyonrails.com/images/rails.png" />)
,
%(image_tag("mouse.png", :mouseover => "/images/mouse_over.png"))
=>
%(<img alt="Mouse" onmouseover="this.src='/images/mouse_over.png'" onmouseout="this.src='/images/mouse.png'" src="/images/mouse.png" />)
,
%(image_tag("mouse.png", :mouseover => image_path("mouse_over.png")))
=>
%(<img alt="Mouse" onmouseover="this.src='/images/mouse_over.png'" onmouseout="this.src='/images/mouse.png'" src="/images/mouse.png" />)
,
%(image_tag("mouse.png", :alt => nil))
=>
%(<img src="/images/mouse.png" />)
,
%(image_tag("data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==", :alt => nil))
=>
%(<img src="data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" />)
,
}
...
...
@@ -1324,8 +1322,6 @@ def test_should_compute_proper_path
assert_dom_equal
(
%(/collaboration/hieraki/javascripts/xmlhr.js)
,
javascript_path
(
"xmlhr"
))
assert_dom_equal
(
%(/collaboration/hieraki/stylesheets/style.css)
,
stylesheet_path
(
"style"
))
assert_dom_equal
(
%(/collaboration/hieraki/images/xml.png)
,
image_path
(
"xml.png"
))
assert_dom_equal
(
%(<img alt="Mouse" onmouseover="this.src='/collaboration/hieraki/images/mouse_over.png'" onmouseout="this.src='/collaboration/hieraki/images/mouse.png'" src="/collaboration/hieraki/images/mouse.png" />)
,
image_tag
(
"mouse.png"
,
:mouseover
=>
"/images/mouse_over.png"
))
assert_dom_equal
(
%(<img alt="Mouse2" onmouseover="this.src='/collaboration/hieraki/images/mouse_over2.png'" onmouseout="this.src='/collaboration/hieraki/images/mouse2.png'" src="/collaboration/hieraki/images/mouse2.png" />)
,
image_tag
(
"mouse2.png"
,
:mouseover
=>
image_path
(
"mouse_over2.png"
)))
end
def
test_should_ignore_relative_root_path_on_complete_url
...
...
@@ -1338,8 +1334,6 @@ def test_should_compute_proper_path_with_asset_host
assert_dom_equal
(
%(gopher://assets.example.com/collaboration/hieraki/javascripts/xmlhr.js)
,
javascript_path
(
"xmlhr"
))
assert_dom_equal
(
%(gopher://assets.example.com/collaboration/hieraki/stylesheets/style.css)
,
stylesheet_path
(
"style"
))
assert_dom_equal
(
%(gopher://assets.example.com/collaboration/hieraki/images/xml.png)
,
image_path
(
"xml.png"
))
assert_dom_equal
(
%(<img alt="Mouse" onmouseover="this.src='gopher://assets.example.com/collaboration/hieraki/images/mouse_over.png'" onmouseout="this.src='gopher://assets.example.com/collaboration/hieraki/images/mouse.png'" src="gopher://assets.example.com/collaboration/hieraki/images/mouse.png" />)
,
image_tag
(
"mouse.png"
,
:mouseover
=>
"/images/mouse_over.png"
))
assert_dom_equal
(
%(<img alt="Mouse2" onmouseover="this.src='gopher://assets.example.com/collaboration/hieraki/images/mouse_over2.png'" onmouseout="this.src='gopher://assets.example.com/collaboration/hieraki/images/mouse2.png'" src="gopher://assets.example.com/collaboration/hieraki/images/mouse2.png" />)
,
image_tag
(
"mouse2.png"
,
:mouseover
=>
image_path
(
"mouse_over2.png"
)))
end
def
test_should_compute_proper_path_with_asset_host_and_default_protocol
...
...
@@ -1348,8 +1342,6 @@ def test_should_compute_proper_path_with_asset_host_and_default_protocol
assert_dom_equal
(
%(gopher://assets.example.com/collaboration/hieraki/javascripts/xmlhr.js)
,
javascript_path
(
"xmlhr"
))
assert_dom_equal
(
%(gopher://assets.example.com/collaboration/hieraki/stylesheets/style.css)
,
stylesheet_path
(
"style"
))
assert_dom_equal
(
%(gopher://assets.example.com/collaboration/hieraki/images/xml.png)
,
image_path
(
"xml.png"
))
assert_dom_equal
(
%(<img alt="Mouse" onmouseover="this.src='gopher://assets.example.com/collaboration/hieraki/images/mouse_over.png'" onmouseout="this.src='gopher://assets.example.com/collaboration/hieraki/images/mouse.png'" src="gopher://assets.example.com/collaboration/hieraki/images/mouse.png" />)
,
image_tag
(
"mouse.png"
,
:mouseover
=>
"/images/mouse_over.png"
))
assert_dom_equal
(
%(<img alt="Mouse2" onmouseover="this.src='gopher://assets.example.com/collaboration/hieraki/images/mouse_over2.png'" onmouseout="this.src='gopher://assets.example.com/collaboration/hieraki/images/mouse2.png'" src="gopher://assets.example.com/collaboration/hieraki/images/mouse2.png" />)
,
image_tag
(
"mouse2.png"
,
:mouseover
=>
image_path
(
"mouse_over2.png"
)))
end
def
test_should_compute_proper_url_with_asset_host
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录