Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
LinuxSuRen
jenkins
提交
b31bb1cc
J
jenkins
项目概览
LinuxSuRen
/
jenkins
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
J
jenkins
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b31bb1cc
编写于
1月 26, 2015
作者:
T
tfennelly
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[FIXED JENKINS-26406] Build history text field wrap fails when containing markup
上级
a944634e
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
52 addition
and
12 deletion
+52
-12
war/src/main/webapp/css/style.css
war/src/main/webapp/css/style.css
+0
-1
war/src/main/webapp/scripts/hudson-behavior.js
war/src/main/webapp/scripts/hudson-behavior.js
+52
-11
未找到文件。
war/src/main/webapp/css/style.css
浏览文件 @
b31bb1cc
...
...
@@ -956,7 +956,6 @@ table.parameters > tbody:hover {
margin-top
:
5px
;
white-space
:
normal
;
opacity
:
0.6
;
font-style
:
italic
;
}
#buildHistory
.build-row-cell
{
...
...
war/src/main/webapp/scripts/hudson-behavior.js
浏览文件 @
b31bb1cc
...
...
@@ -1681,9 +1681,9 @@ function updateBuildHistory(ajaxUrl,nBuild) {
resetCellOverflows
();
// Insert zero-width spaces so as to allow text to wrap, allowing us to get the true clientWidth.
insertZeroWidthSpaces
(
displayName
,
2
);
insertZeroWidthSpaces
InElementText
(
displayName
,
2
);
if
(
desc
)
{
insertZeroWidthSpaces
(
desc
,
30
);
insertZeroWidthSpaces
InElementText
(
desc
,
30
);
markMultiline
();
}
...
...
@@ -1701,7 +1701,7 @@ function updateBuildHistory(ajaxUrl,nBuild) {
// If the name is overflowed, lets remove the zero-width spaces we added above and
// re-add zero-width spaces with a bigger max word sizes.
removeZeroWidthSpaces
(
displayName
);
insertZeroWidthSpaces
(
displayName
,
20
);
insertZeroWidthSpaces
InElementText
(
displayName
,
20
);
}
function
fitToControlsHeight
(
element
)
{
...
...
@@ -1871,11 +1871,11 @@ function updateBuildHistory(ajaxUrl,nBuild) {
// Insert zero-width spaces in text that may cause overflow distortions.
var
displayNames
=
$
(
bh
).
getElementsBySelector
(
'
.display-name
'
);
for
(
var
i
=
0
;
i
<
displayNames
.
length
;
i
++
)
{
insertZeroWidthSpaces
(
displayNames
[
i
],
2
);
insertZeroWidthSpaces
InElementText
(
displayNames
[
i
],
2
);
}
var
descriptions
=
$
(
bh
).
getElementsBySelector
(
'
.desc
'
);
for
(
var
i
=
0
;
i
<
descriptions
.
length
;
i
++
)
{
insertZeroWidthSpaces
(
descriptions
[
i
],
30
);
insertZeroWidthSpaces
InElementText
(
descriptions
[
i
],
30
);
}
for
(
var
i
=
0
;
i
<
rows
.
length
;
i
++
)
{
...
...
@@ -1968,13 +1968,17 @@ function getElementOverflowParams(element) {
}
var
zeroWidthSpace
=
String
.
fromCharCode
(
8203
);
function
insertZeroWidthSpaces
(
element
,
maxWordSize
)
{
if
(
Element
.
hasClassName
(
element
,
'
zws-inserted
'
))
{
// already done.
var
ELEMENT_NODE
=
1
;
var
TEXT_NODE
=
3
;
function
insertZeroWidthSpacesInText
(
textNode
,
maxWordSize
)
{
if
(
textNode
.
textContent
.
length
<
maxWordSize
)
{
return
;
}
var
words
=
element
.
textContent
.
split
(
/
\s
+/
);
// capture the original text
textNode
.
preZWSText
=
textNode
.
textContent
;
var
words
=
textNode
.
textContent
.
split
(
/
\s
+/
);
var
newTextContent
=
''
;
var
splitRegex
=
new
RegExp
(
'
.{1,
'
+
maxWordSize
+
'
}
'
,
'
g
'
);
...
...
@@ -1995,12 +1999,49 @@ function insertZeroWidthSpaces(element, maxWordSize) {
newTextContent
+=
'
'
;
}
element
.
textContent
=
newTextContent
;
textNode
.
textContent
=
newTextContent
;
}
function
insertZeroWidthSpacesInElementText
(
element
,
maxWordSize
)
{
if
(
Element
.
hasClassName
(
element
,
'
zws-inserted
'
))
{
// already done.
return
;
}
if
(
!
element
.
hasChildNodes
())
{
return
;
}
var
children
=
element
.
childNodes
;
for
(
var
i
=
0
;
i
<
children
.
length
;
i
++
)
{
var
child
=
children
[
i
];
if
(
child
.
nodeType
===
TEXT_NODE
)
{
insertZeroWidthSpacesInText
(
child
,
maxWordSize
);
}
else
if
(
child
.
nodeType
===
ELEMENT_NODE
)
{
insertZeroWidthSpacesInElementText
(
child
,
maxWordSize
);
}
}
Element
.
addClassName
(
element
,
'
zws-inserted
'
);
}
function
removeZeroWidthSpaces
(
element
)
{
if
(
element
)
{
element
.
textContent
=
element
.
textContent
.
replace
(
zeroWidthSpace
,
''
);
if
(
!
Element
.
hasClassName
(
element
,
'
zws-inserted
'
))
{
// Doesn't have ZWSed text.
return
;
}
if
(
!
element
.
hasChildNodes
())
{
return
;
}
var
children
=
element
.
childNodes
;
for
(
var
i
=
0
;
i
<
children
.
length
;
i
++
)
{
var
child
=
children
[
i
];
if
(
child
.
nodeType
===
TEXT_NODE
&&
child
.
preZWSText
)
{
child
.
textContent
=
child
.
preZWSText
;
}
else
if
(
child
.
nodeType
===
ELEMENT_NODE
)
{
removeZeroWidthSpaces
(
child
);
}
}
Element
.
removeClassName
(
element
,
'
zws-inserted
'
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录