Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
LinuxSuRen
jenkins
提交
9db14369
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,发现更多精彩内容 >>
提交
9db14369
编写于
2月 16, 2012
作者:
K
Kohsuke Kawaguchi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added a mechanism to show the notification bar.
上级
71324e1e
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
120 addition
and
2 deletion
+120
-2
changelog.html
changelog.html
+2
-0
ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/NotificationBar.java
...main/java/jenkins/plugins/ui_samples/NotificationBar.java
+29
-0
ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/NotificationBar/index.groovy
...s/jenkins/plugins/ui_samples/NotificationBar/index.groovy
+17
-0
ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/NotificationBar/index.properties
...nkins/plugins/ui_samples/NotificationBar/index.properties
+4
-0
war/pom.xml
war/pom.xml
+1
-1
war/src/main/webapp/css/style.css
war/src/main/webapp/css/style.css
+11
-0
war/src/main/webapp/scripts/hudson-behavior.js
war/src/main/webapp/scripts/hudson-behavior.js
+56
-1
未找到文件。
changelog.html
浏览文件 @
9db14369
...
...
@@ -58,6 +58,8 @@ Upcoming changes</a>
<li
class=
rfe
>
System Message - Doesnt appear on any view other than the default view.
(
<a
href=
"https://issues.jenkins-ci.org/browse/JENKINS-7733"
>
issue 7733
</a>
)
<li
class=
"rfe"
>
Added UI component to show notification bar at the top of the page
</ul>
</div>
<!--=TRUNK-END=-->
...
...
ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/NotificationBar.java
0 → 100644
浏览文件 @
9db14369
package
jenkins.plugins.ui_samples
;
import
hudson.Extension
;
import
java.util.Arrays
;
import
java.util.List
;
/**
* @author Kohsuke Kawaguchi
*/
@Extension
public
class
NotificationBar
extends
UISample
{
@Override
public
String
getDescription
()
{
return
"Notification bar shows a transient message on the top of the page"
;
}
public
List
<
SourceFile
>
getSourceFiles
()
{
// TODO: generate this from index
return
Arrays
.
asList
(
new
SourceFile
(
"index.groovy"
));
}
@Extension
public
static
final
class
DescriptorImpl
extends
UISampleDescriptor
{
}
}
ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/NotificationBar/index.groovy
0 → 100644
浏览文件 @
9db14369
package
jenkins.plugins.ui_samples.NotificationBar
;
import
lib.JenkinsTagLib
def
st
=
namespace
(
"jelly:stapler"
)
t
=
namespace
(
JenkinsTagLib
.
class
)
namespace
(
"/lib/samples"
).
sample
(
title:
_
(
"Notification Bar"
))
{
p
(
_
(
"blurb"
))
p
(
"To show a notification bar, call <tt>notificationBar.show('message')"
);
button
(
onclick:
"notificationBar.show('This is a notification');"
,
"Show a notification bar"
)
p
(
_
(
"blurb.hide"
))
button
(
onclick:
"notificationBar.hide();"
,
"Hide it now"
)
}
ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/NotificationBar/index.properties
0 → 100644
浏览文件 @
9db14369
blurb
=
Notification bar shows a message that disappears in a few seconds.
\
It is typically used to provide feedback for asynchronous operations.
blurb.hide
=
A notification bar will auto-hide itself, but you can programmatically hide it via <tt>notificationBar.hide()</tt>
\ No newline at end of file
war/pom.xml
浏览文件 @
9db14369
...
...
@@ -394,7 +394,7 @@ THE SOFTWARE.
<systemProperty>
<!-- enable the plugins in main by default -->
<name>
hudson.bundled.plugins
</name>
<value>
<value>
<!-- run "mvn install" once will generate the.hpl -->
${basedir}/../maven-plugin/target/test-classes/the.hpl,
${basedir}/../ui-samples-plugin/target/test-classes/the.hpl,
${project.build.directory}/${project.build.finalName}/WEB-INF/plugins/javadoc.hpi
...
...
war/src/main/webapp/css/style.css
浏览文件 @
9db14369
...
...
@@ -1002,6 +1002,17 @@ table.progress-bar.red td.progress-bar-done {
background-color
:
#cc0000
;
}
/* ========================= notification bar ========================= */
#notification-bar
{
width
:
100%
;
position
:
fixed
;
text-align
:
center
;
left
:
0px
;
font-size
:
2em
;
z-index
:
999
;
border-bottom
:
1px
solid
black
;
}
/* ========================= YUI dialog ========================= */
.dialog
.hd
{
...
...
war/src/main/webapp/scripts/hudson-behavior.js
浏览文件 @
9db14369
...
...
@@ -2539,4 +2539,59 @@ var layoutUpdateCallback = {
for
(
var
i
=
0
,
length
=
this
.
callbacks
.
length
;
i
<
length
;
i
++
)
this
.
callbacks
[
i
]();
}
}
\ No newline at end of file
}
// notification bar
var
notificationBar
=
{
OPACITY
:
0.8
,
DELAY
:
3000
,
// milliseconds to auto-close the notification
div
:
null
,
// the main 'notification-bar' DIV
token
:
null
,
// timer for cancelling auto-close
init
:
function
()
{
if
(
this
.
div
==
null
)
{
this
.
div
=
document
.
createElement
(
"
div
"
);
YAHOO
.
util
.
Dom
.
setStyle
(
this
.
div
,
"
opacity
"
,
0
);
this
.
div
.
id
=
"
notification-bar
"
;
document
.
body
.
insertBefore
(
this
.
div
,
document
.
body
.
firstChild
);
var
self
=
this
;
this
.
div
.
onclick
=
function
()
{
self
.
hide
();
};
}
},
// cancel pending auto-hide timeout
clearTimeout
:
function
()
{
if
(
this
.
token
)
window
.
clearTimeout
(
this
.
token
);
this
.
token
=
null
;
},
// hide the current notification bar, if it's displayed
hide
:
function
()
{
this
.
clearTimeout
();
new
YAHOO
.
util
.
Anim
(
this
.
div
,
{
opacity
:
{
to
:
0
}
},
0.3
,
YAHOO
.
util
.
Easing
.
easeIn
).
animate
();
},
// show a notification bar
show
:
function
(
text
,
options
)
{
options
=
options
||
{}
this
.
init
();
this
.
div
.
style
.
backgroundColor
=
options
.
backgroundColor
||
"
#fff
"
;
this
.
div
.
style
.
height
=
this
.
div
.
style
.
lineHeight
=
options
.
height
||
"
40px
"
;
if
(
options
.
icon
)
text
=
"
<img src='
"
+
rootURL
+
"
/images/24x24/
"
+
options
.
icon
+
"
'>
"
+
text
;
this
.
div
.
innerHTML
=
text
;
new
YAHOO
.
util
.
Anim
(
this
.
div
,
{
opacity
:
{
to
:
this
.
OPACITY
}
},
1
,
YAHOO
.
util
.
Easing
.
easeOut
).
animate
();
this
.
clearTimeout
();
var
self
=
this
;
this
.
token
=
window
.
setTimeout
(
function
(){
self
.
hide
();},
this
.
DELAY
);
}
};
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录