Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
jenkins
提交
d7a4e08a
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,发现更多精彩内容 >>
提交
d7a4e08a
编写于
1月 14, 2011
作者:
K
Kohsuke Kawaguchi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
added a new note that creates expandable details.
上级
030671bf
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
141 addition
and
0 deletion
+141
-0
core/src/main/java/hudson/console/ConsoleNote.java
core/src/main/java/hudson/console/ConsoleNote.java
+2
-0
core/src/main/java/hudson/console/ExpandableDetailsNote.java
core/src/main/java/hudson/console/ExpandableDetailsNote.java
+76
-0
core/src/main/java/hudson/console/HudsonExceptionNote.java
core/src/main/java/hudson/console/HudsonExceptionNote.java
+23
-0
core/src/main/java/hudson/console/HyperlinkNote.java
core/src/main/java/hudson/console/HyperlinkNote.java
+23
-0
core/src/main/resources/hudson/console/ExpandableDetailsNote/script.js
.../resources/hudson/console/ExpandableDetailsNote/script.js
+11
-0
core/src/main/resources/hudson/console/ExpandableDetailsNote/style.css
.../resources/hudson/console/ExpandableDetailsNote/style.css
+6
-0
未找到文件。
core/src/main/java/hudson/console/ConsoleNote.java
浏览文件 @
d7a4e08a
...
...
@@ -23,6 +23,7 @@
*/
package
hudson.console
;
import
hudson.Functions
;
import
hudson.MarkupText
;
import
hudson.model.Describable
;
import
hudson.model.Hudson
;
...
...
@@ -117,6 +118,7 @@ import java.util.zip.GZIPOutputStream;
*
* @author Kohsuke Kawaguchi
* @see ConsoleAnnotationDescriptor
* @see Functions#generateConsoleAnnotationScriptAndStylesheet()
* @since 1.349
*/
public
abstract
class
ConsoleNote
<
T
>
implements
Serializable
,
Describable
<
ConsoleNote
<?>>
{
...
...
core/src/main/java/hudson/console/ExpandableDetailsNote.java
0 → 100644
浏览文件 @
d7a4e08a
/*
* The MIT License
*
* Copyright (c) 2010-2011, CloudBees, 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.
*/
package
hudson.console
;
import
hudson.Extension
;
import
hudson.MarkupText
;
import
java.io.IOException
;
import
java.util.logging.Level
;
import
java.util.logging.Logger
;
/**
* Renders a button that can be clicked to reveal additional block tag (and HTML inside it.)
*
* <p>
* Useful if you want the user to be able to see additional details.
*
* @author Kohsuke Kawaguchi
* @since 1.395
*/
public
class
ExpandableDetailsNote
extends
ConsoleNote
{
private
final
String
caption
;
private
final
String
html
;
public
ExpandableDetailsNote
(
String
caption
,
String
html
)
{
this
.
caption
=
caption
;
this
.
html
=
html
;
}
@Override
public
ConsoleAnnotator
annotate
(
Object
context
,
MarkupText
text
,
int
charPos
)
{
text
.
addMarkup
(
charPos
,
"<input type=button value='"
+
caption
+
"' class='reveal-expandable-detail'><div class='expandable-detail'>"
+
html
+
"</div>"
);
return
null
;
}
public
static
String
encodeTo
(
String
buttonCaption
,
String
html
)
{
try
{
return
new
ExpandableDetailsNote
(
buttonCaption
,
html
).
encode
();
}
catch
(
IOException
e
)
{
// impossible, but don't make this a fatal problem
LOGGER
.
log
(
Level
.
WARNING
,
"Failed to serialize "
+
HyperlinkNote
.
class
,
e
);
return
""
;
}
}
@Extension
public
static
final
class
DescriptorImpl
extends
ConsoleAnnotationDescriptor
{
public
String
getDisplayName
()
{
return
"Expandable details"
;
}
}
private
static
final
Logger
LOGGER
=
Logger
.
getLogger
(
ExpandableDetailsNote
.
class
.
getName
());
}
core/src/main/java/hudson/console/HudsonExceptionNote.java
浏览文件 @
d7a4e08a
/*
* The MIT License
*
* Copyright (c) 2010-2011, CloudBees, 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.
*/
package
hudson.console
;
import
hudson.Extension
;
...
...
core/src/main/java/hudson/console/HyperlinkNote.java
浏览文件 @
d7a4e08a
/*
* The MIT License
*
* Copyright (c) 2010-2011, CloudBees, 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.
*/
package
hudson.console
;
import
hudson.Extension
;
...
...
core/src/main/resources/hudson/console/ExpandableDetailsNote/script.js
0 → 100644
浏览文件 @
d7a4e08a
(
function
()
{
Behaviour
.
register
({
"
INPUT.reveal-expandable-detail
"
:
function
(
e
)
{
var
detail
=
e
.
nextSibling
;
makeButton
(
e
,
function
()
{
detail
.
style
.
display
=
(
detail
.
style
.
display
==
"
block
"
)?
"
none
"
:
"
block
"
;
});
}
});
}());
core/src/main/resources/hudson/console/ExpandableDetailsNote/style.css
0 → 100644
浏览文件 @
d7a4e08a
DIV
.expandable-detail
{
display
:
none
;
background-color
:
#d3d7cf
;
margin
:
0.5em
;
padding
:
0.5em
;
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录