Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
jenkins
提交
2c240bdc
J
jenkins
项目概览
xxadev
/
jenkins
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
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,发现更多精彩内容 >>
提交
2c240bdc
编写于
3月 01, 2013
作者:
O
Oliver Gondža
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[FIXED JENKINS-17030] Enable word breaking for job names
上级
d391bbee
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
64 addition
and
8 deletion
+64
-8
core/src/main/java/hudson/Functions.java
core/src/main/java/hudson/Functions.java
+16
-0
core/src/main/resources/hudson/matrix/MatrixProject/index.jelly
...rc/main/resources/hudson/matrix/MatrixProject/index.jelly
+1
-1
core/src/main/resources/hudson/model/Job/index.jelly
core/src/main/resources/hudson/model/Job/index.jelly
+1
-1
core/src/main/resources/hudson/views/JobColumn/column.jelly
core/src/main/resources/hudson/views/JobColumn/column.jelly
+2
-2
core/src/main/resources/lib/hudson/buildListTable.jelly
core/src/main/resources/lib/hudson/buildListTable.jelly
+1
-1
core/src/main/resources/lib/hudson/executors.jelly
core/src/main/resources/lib/hudson/executors.jelly
+1
-1
core/src/main/resources/lib/hudson/jobLink.jelly
core/src/main/resources/lib/hudson/jobLink.jelly
+1
-1
core/src/main/resources/lib/hudson/queue.jelly
core/src/main/resources/lib/hudson/queue.jelly
+1
-1
core/src/main/resources/lib/layout/breakable.jelly
core/src/main/resources/lib/layout/breakable.jelly
+33
-0
core/src/test/java/hudson/FunctionsTest.java
core/src/test/java/hudson/FunctionsTest.java
+7
-0
未找到文件。
core/src/main/java/hudson/Functions.java
浏览文件 @
2c240bdc
...
...
@@ -1716,4 +1716,20 @@ public class Functions {
DecimalFormat
format
=
new
DecimalFormat
(
"#0.00"
);
return
format
.
format
(
number
)
+
" "
+
measure
;
}
/**
* Get a string that can be safely broken to several lines when necessary.
*
* This implementation inserts <wbr> tags into string. It allows browsers
* to wrap line before any sequence of punctuation characters or anywhere
* in the middle of prolonged sequences of word characters.
*
* @since 1.516
*/
public
static
String
breakableString
(
final
String
plain
)
{
return
plain
.
replaceAll
(
"(\\p{Punct}+\\w)"
,
"<wbr>$1"
)
.
replaceAll
(
"(\\w{10})(?=\\w{3})"
,
"$1<wbr>"
)
;
}
}
core/src/main/resources/hudson/matrix/MatrixProject/index.jelly
浏览文件 @
2c240bdc
...
...
@@ -27,7 +27,7 @@ THE SOFTWARE.
<l:layout title="${it.name}">
<st:include page="sidepanel.jelly" />
<l:main-panel>
<h1>${%Project}
${it.displayName}
</h1>
<h1>${%Project}
<l:breakable value="${it.displayName}"/>
</h1>
<j:if test="${it.name!=it.displayName}">
${%Project name}: ${it.fullName}
</j:if>
...
...
core/src/main/resources/hudson/model/Job/index.jelly
浏览文件 @
2c240bdc
...
...
@@ -27,7 +27,7 @@ THE SOFTWARE.
<l:layout title="${it.displayName}">
<st:include page="sidepanel.jelly" />
<l:main-panel>
<h1>${it.pronoun}
${it.displayName}
</h1>
<h1>${it.pronoun}
<l:breakable value="${it.displayName}"/>
</h1>
<j:if test="${(it.name!=it.displayName) and (it.class.name!='hudson.matrix.MatrixConfiguration')}">
${%Project name}: ${it.fullName}
</j:if>
...
...
core/src/main/resources/hudson/views/JobColumn/column.jelly
浏览文件 @
2c240bdc
...
...
@@ -25,6 +25,6 @@ THE SOFTWARE.
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:i="jelly:fmt">
<td style="${indenter.getCss(job)}">
<a href="${jobBaseUrl}${job.shortUrl}" class='model-link inside'>
${h.getRelativeDisplayNameFrom(job,currentView.owner.itemGroup)}
</a>
<a href="${jobBaseUrl}${job.shortUrl}" class='model-link inside'>
<l:breakable value="${h.getRelativeDisplayNameFrom(job,currentView.owner.itemGroup)}"/>
</a>
</td>
</j:jelly>
\ No newline at end of file
</j:jelly>
core/src/main/resources/lib/hudson/buildListTable.jelly
浏览文件 @
2c240bdc
...
...
@@ -53,7 +53,7 @@ THE SOFTWARE.
</a>
</td>
<td>
<a href="${jobBaseUrl}${b.parent.url}" class="model-link">
${b.parent.fullDisplayName}
</a>
<a href="${jobBaseUrl}${b.parent.url}" class="model-link">
<l:breakable value="${b.parent.fullDisplayName}"/>
</a>
<st:nbsp/>
<a href="${jobBaseUrl}${b.url}" class="model-link inside">${b.displayName}</a>
</td>
...
...
core/src/main/resources/lib/hudson/executors.jelly
浏览文件 @
2c240bdc
...
...
@@ -79,7 +79,7 @@ THE SOFTWARE.
</j:invokeStatic>
<j:choose>
<j:when test="${h.hasPermission(exeparent,exeparent.READ)}">
<a href="${rootURL}/${exeparent.url}">
${exeparent.fullDisplayName}
</a> <a href="${rootURL}/${exe.url}" class="model-link inside">#${exe.number}</a>
<a href="${rootURL}/${exeparent.url}">
<l:breakable value="${exeparent.fullDisplayName}"/>
</a> <a href="${rootURL}/${exe.url}" class="model-link inside">#${exe.number}</a>
<t:buildProgressBar build="${exe}" executor="${executor}"/>
</j:when>
<j:otherwise>
...
...
core/src/main/resources/lib/hudson/jobLink.jelly
浏览文件 @
2c240bdc
...
...
@@ -32,5 +32,5 @@ THE SOFTWARE.
</st:documentation>
<img src="${imagesURL}/16x16/${job.buildStatusUrl}" alt="${job.iconColor.description}" height="16" width="16"/>
<a href="${h.getRelativeLinkTo(job)}" class="model-link">
${job.fullDisplayName}
</a>
<a href="${h.getRelativeLinkTo(job)}" class="model-link">
<l:breakable value="${job.fullDisplayName}"/>
</a>
</j:jelly>
core/src/main/resources/lib/hudson/queue.jelly
浏览文件 @
2c240bdc
...
...
@@ -63,7 +63,7 @@ THE SOFTWARE.
<j:choose>
<j:when test="${h.hasPermission(item.task,item.task.READ)}">
<a href="${rootURL}/${item.task.url}" class="model-link inside tl-tr" tooltip="${item.why}${h.escape(item.params)}<br>${%WaitingFor(item.inQueueForString)}">
${item.task.fullDisplayName}
<l:breakable value="${item.task.fullDisplayName}"/>
</a>
<!-- XXX include estimated number as in BuildHistoryWidget/entries.jelly if possible -->
<j:if test="${stuck}">
...
...
core/src/main/resources/lib/layout/breakable.jelly
0 → 100644
浏览文件 @
2c240bdc
<!--
The MIT License
Copyright (c) 2013 Red Hat, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler">
<st:documentation>
Send escaped value to output decorated to be safely broken into lines when necessary
<st:attribute name="value" use="required">
Unescaped value to output
</st:attribute>
</st:documentation>
${h.breakableString(h.escape(value))}
</j:jelly>
core/src/test/java/hudson/FunctionsTest.java
浏览文件 @
2c240bdc
...
...
@@ -264,4 +264,11 @@ public class FunctionsTest {
}
}
@Test
public
void
testBreakableString
()
{
assertEquals
(
"Hello world!"
,
Functions
.
breakableString
(
"Hello world!"
));
assertEquals
(
"H<wbr>,e<wbr>.l<wbr>/l<wbr>:o<wbr>-w<wbr>_o<wbr>=+|d"
,
Functions
.
breakableString
(
"H,e.l/l:o-w_o=+|d"
));
assertEquals
(
"ALongStrin<wbr>gThatCanNo<wbr>tBeBrokenB<wbr>yDefault"
,
Functions
.
breakableString
(
"ALongStringThatCanNotBeBrokenByDefault"
));
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录