Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
LinuxSuRen
jenkins
提交
737a7dfe
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,发现更多精彩内容 >>
提交
737a7dfe
编写于
11月 07, 2011
作者:
K
Kohsuke Kawaguchi
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'pull-243'
上级
2f9fff92
b4ad3fbf
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
89 addition
and
7 deletion
+89
-7
changelog.html
changelog.html
+3
-0
core/src/main/java/hudson/markup/MarkupFormatter.java
core/src/main/java/hudson/markup/MarkupFormatter.java
+17
-0
core/src/main/resources/hudson/model/AbstractModelObject/descriptionForm.jelly
...es/hudson/model/AbstractModelObject/descriptionForm.jelly
+1
-1
core/src/main/resources/hudson/model/AbstractModelObject/editDescription.jelly
...es/hudson/model/AbstractModelObject/editDescription.jelly
+1
-1
core/src/main/resources/hudson/model/Job/configure.jelly
core/src/main/resources/hudson/model/Job/configure.jelly
+1
-1
core/src/main/resources/hudson/model/Run/configure.jelly
core/src/main/resources/hudson/model/Run/configure.jelly
+1
-1
core/src/main/resources/hudson/model/View/configure.jelly
core/src/main/resources/hudson/model/View/configure.jelly
+1
-1
core/src/main/resources/jenkins/model/Jenkins/configure.jelly
.../src/main/resources/jenkins/model/Jenkins/configure.jelly
+1
-1
core/src/main/resources/lib/form/textarea.jelly
core/src/main/resources/lib/form/textarea.jelly
+14
-0
war/src/main/webapp/css/style.css
war/src/main/webapp/css/style.css
+10
-0
war/src/main/webapp/scripts/hudson-behavior.js
war/src/main/webapp/scripts/hudson-behavior.js
+39
-1
未找到文件。
changelog.html
浏览文件 @
737a7dfe
...
...
@@ -70,6 +70,9 @@ Upcoming changes</a>
<li
class=
rfe
>
Managed windows slaves can be now run as a specific user account
(
<a
href=
"https://github.com/jenkinsci/jenkins/pull/289"
>
pull #289
</a>
)
<li
class=
rfe
>
Description field now has the preview button to test it inline.
(
<a
href=
"https://github.com/jenkinsci/jenkins/pull/243"
>
pull #243
</a>
)
<li
class=
rfe
>
Maven mojo records can be now sorted
</ul>
...
...
core/src/main/java/hudson/markup/MarkupFormatter.java
浏览文件 @
737a7dfe
...
...
@@ -25,7 +25,14 @@ package hudson.markup;
import
hudson.ExtensionPoint
;
import
hudson.model.AbstractDescribableImpl
;
import
hudson.util.HttpResponses
;
import
jenkins.model.Jenkins
;
import
org.kohsuke.stapler.HttpResponse
;
import
org.kohsuke.stapler.QueryParameter
;
import
org.kohsuke.stapler.StaplerRequest
;
import
org.kohsuke.stapler.StaplerResponse
;
import
javax.servlet.ServletException
;
import
java.io.IOException
;
import
java.io.StringWriter
;
import
java.io.Writer
;
...
...
@@ -91,4 +98,14 @@ public abstract class MarkupFormatter extends AbstractDescribableImpl<MarkupForm
public
MarkupFormatterDescriptor
getDescriptor
()
{
return
(
MarkupFormatterDescriptor
)
super
.
getDescriptor
();
}
/**
* Generate HTML for preview, using markup formatter.
* Can be called from other views.
*/
public
HttpResponse
doPreviewDescription
(
@QueryParameter
String
text
)
throws
IOException
{
StringWriter
w
=
new
StringWriter
();
translate
(
text
,
w
);
return
HttpResponses
.
html
(
w
.
toString
());
}
}
core/src/main/resources/hudson/model/AbstractModelObject/descriptionForm.jelly
浏览文件 @
737a7dfe
...
...
@@ -35,7 +35,7 @@ THE SOFTWARE.
<table>
<f:entry help="${app.markupFormatter.helpUrl}">
<f:textarea name="description" value="${it.description}"
codemirror-mode="${app.markupFormatter.codeMirrorMode}" codemirror-config="${app.markupFormatter.codeMirrorConfig}"/>
codemirror-mode="${app.markupFormatter.codeMirrorMode}" codemirror-config="${app.markupFormatter.codeMirrorConfig}"
previewEndpoint="/markupFormatter/previewDescription"
/>
</f:entry>
</table>
<div align="right">
...
...
core/src/main/resources/hudson/model/AbstractModelObject/editDescription.jelly
浏览文件 @
737a7dfe
...
...
@@ -34,7 +34,7 @@ THE SOFTWARE.
<table>
<f:entry help="${app.markupFormatter.helpUrl}">
<f:textarea name="description" value="${it.description}"
codemirror-mode="${app.markupFormatter.codeMirrorMode}" codemirror-config="${app.markupFormatter.codeMirrorConfig}"/>
codemirror-mode="${app.markupFormatter.codeMirrorMode}" codemirror-config="${app.markupFormatter.codeMirrorConfig}"
previewEndpoint="/markupFormatter/previewDescription"
/>
</f:entry>
</table>
<f:submit value="${%Submit}" />
...
...
core/src/main/resources/hudson/model/Job/configure.jelly
浏览文件 @
737a7dfe
...
...
@@ -41,7 +41,7 @@ THE SOFTWARE.
</f:entry>
</j:if>
<f:entry title="${%Description}" help="${app.markupFormatter.helpUrl}">
<f:textarea name="description" value="${it.description}" codemirror-mode="${app.markupFormatter.codeMirrorMode}" codemirror-config="${app.markupFormatter.codeMirrorConfig}"/>
<f:textarea name="description" value="${it.description}" codemirror-mode="${app.markupFormatter.codeMirrorMode}" codemirror-config="${app.markupFormatter.codeMirrorConfig}"
previewEndpoint="/markupFormatter/previewDescription"
/>
</f:entry>
<j:if test="${it.supportsLogRotator()}">
...
...
core/src/main/resources/hudson/model/Run/configure.jelly
浏览文件 @
737a7dfe
...
...
@@ -33,7 +33,7 @@ THE SOFTWARE.
<f:textbox name="displayName" value="${it.hasCustomDisplayName()?it.displayName:''}"/>
</f:entry>
<f:entry title="${%Description}" help="/help/run-config/description.html">
<f:textarea name="description" value="${it.description}" codemirror-mode="${app.markupFormatter.codeMirrorMode}" codemirror-config="${app.markupFormatter.codeMirrorConfig}"/>
<f:textarea name="description" value="${it.description}" codemirror-mode="${app.markupFormatter.codeMirrorMode}" codemirror-config="${app.markupFormatter.codeMirrorConfig}"
previewEndpoint="/markupFormatter/previewDescription"
/>
</f:entry>
<j:if test="${h.hasPermission(it,it.UPDATE)}">
...
...
core/src/main/resources/hudson/model/View/configure.jelly
浏览文件 @
737a7dfe
...
...
@@ -39,7 +39,7 @@ THE SOFTWARE.
<f:textbox name="name" value="${it.viewName}" />
</f:entry>
<f:entry title="${%Description}" help="/help/view-config/description.html">
<f:textarea name="description" field="description" codemirror-mode="${app.markupFormatter.codeMirrorMode}" codemirror-config="${app.markupFormatter.codeMirrorConfig}"/>
<f:textarea name="description" field="description" codemirror-mode="${app.markupFormatter.codeMirrorMode}" codemirror-config="${app.markupFormatter.codeMirrorConfig}"
previewEndpoint="/markupFormatter/previewDescription"
/>
</f:entry>
<f:entry title="${%Filter build queue}" help="/help/view-config/filter-queue.html">
<f:checkbox name="filterQueue" field="filterQueue"/>
...
...
core/src/main/resources/jenkins/model/Jenkins/configure.jelly
浏览文件 @
737a7dfe
...
...
@@ -48,7 +48,7 @@ THE SOFTWARE.
</f:advanced>
<f:entry title="${%System Message}" help="/help/system-config/systemMessage.html">
<f:textarea name="system_message" value="${it.systemMessage}"
codemirror-mode="${app.markupFormatter.codeMirrorMode}" codemirror-config="${app.markupFormatter.codeMirrorConfig}"/>
codemirror-mode="${app.markupFormatter.codeMirrorMode}" codemirror-config="${app.markupFormatter.codeMirrorConfig}"
previewEndpoint="/markupFormatter/previewDescription"
/>
</f:entry>
<!-- global configuration from everyone -->
...
...
core/src/main/resources/lib/form/textarea.jelly
浏览文件 @
737a7dfe
...
...
@@ -60,6 +60,10 @@ THE SOFTWARE.
Specifies additional key/value pairs in the JSON format (except the start and end bracket)
to be passed as CodeMirror option object.
</st:attribute>
<st:attribute name="previewEndpoint">
If specified, this text area has preview feature.
The previewEndpoint is used to obtain formatted html.
</st:attribute>
</st:documentation>
<f:prepareDatabinding />
...
...
@@ -80,4 +84,14 @@ THE SOFTWARE.
</textarea>
<!-- resize handle -->
<div class="textarea-handle"/>
<j:if test="${attrs.previewEndpoint!=null}">
<div class="textarea-preview-container">
<a href="#" class="textarea-show-preview" previewEndpoint="${attrs.previewEndpoint}">${%Preview}</a>
<st:nbsp/>
<a href="#" class="textarea-hide-preview">${%Hide preview}</a>
<div class="textarea-preview">
<!-- div for preview -->
</div>
</div>
</j:if>
</j:jelly>
war/src/main/webapp/css/style.css
浏览文件 @
737a7dfe
...
...
@@ -1003,3 +1003,13 @@ table.progress-bar.red td.progress-bar-done {
.tag7
{
font-size
:
1.70em
;
}
.tag8
{
font-size
:
1.80em
;
}
.tag9
{
font-size
:
1.90em
;
}
/* ========================= textarea.jelly ================== */
.textarea-preview-container
{
text-align
:
left
;
}
.textarea-preview
{
background-color
:
#F0F0F0
;
padding
:
0.5em
;
}
war/src/main/webapp/scripts/hudson-behavior.js
浏览文件 @
737a7dfe
...
...
@@ -1194,6 +1194,45 @@ var hudsonRules = {
"
.button-with-dropdown
"
:
function
(
e
)
{
new
YAHOO
.
widget
.
Button
(
e
,
{
type
:
"
menu
"
,
menu
:
e
.
nextSibling
});
},
"
DIV.textarea-preview-container
"
:
function
(
e
)
{
var
previewDiv
=
findElementsBySelector
(
e
,
"
.textarea-preview
"
)[
0
];
var
showPreview
=
findElementsBySelector
(
e
,
"
.textarea-show-preview
"
)[
0
];
var
hidePreview
=
findElementsBySelector
(
e
,
"
.textarea-hide-preview
"
)[
0
];
$
(
hidePreview
).
hide
();
$
(
previewDiv
).
hide
();
showPreview
.
onclick
=
function
()
{
// Several TEXTAREAs may exist if CodeMirror is enabled. The first one has reference to the CodeMirror object.
var
textarea
=
e
.
parentNode
.
getElementsByTagName
(
"
TEXTAREA
"
)[
0
];
var
text
=
textarea
.
codemirrorObject
?
textarea
.
codemirrorObject
.
getValue
()
:
textarea
.
value
;
var
render
=
function
(
txt
)
{
$
(
hidePreview
).
show
();
$
(
previewDiv
).
show
();
previewDiv
.
innerHTML
=
txt
;
};
new
Ajax
.
Request
(
rootURL
+
showPreview
.
getAttribute
(
"
previewEndpoint
"
),
{
method
:
"
POST
"
,
requestHeaders
:
"
Content-Type: application/x-www-form-urlencoded
"
,
parameters
:
{
text
:
text
},
onSuccess
:
function
(
obj
)
{
render
(
obj
.
responseText
)
},
onFailure
:
function
(
obj
)
{
render
(
obj
.
status
+
"
"
+
obj
.
statusText
+
"
<HR/>
"
+
obj
.
responseText
)
}
});
return
false
;
}
hidePreview
.
onclick
=
function
()
{
$
(
hidePreview
).
hide
();
$
(
previewDiv
).
hide
();
};
}
};
...
...
@@ -2357,4 +2396,3 @@ function createComboBox(idOrField,valueFunction) {
Ajax
.
Request
.
prototype
.
dispatchException
=
function
(
e
)
{
throw
e
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录