Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
LinuxSuRen
jenkins
提交
8baeec3d
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,发现更多精彩内容 >>
提交
8baeec3d
编写于
2月 05, 2016
作者:
T
tfennelly
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Give the row header (tr) to the ConfigSection instance
上级
a5e005b3
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
26 addition
and
15 deletion
+26
-15
war/src/main/js/widgets/config/model/ConfigSection.js
war/src/main/js/widgets/config/model/ConfigSection.js
+4
-3
war/src/main/js/widgets/config/model/ConfigTableMetaData.js
war/src/main/js/widgets/config/model/ConfigTableMetaData.js
+22
-12
未找到文件。
war/src/main/js/widgets/config/model/ConfigSection.js
浏览文件 @
8baeec3d
...
...
@@ -9,10 +9,11 @@ module.exports = ConfigSection;
* Configuration table section.
* =======================================================================================
*/
function
ConfigSection
(
parentCMD
,
title
)
{
function
ConfigSection
(
parentCMD
,
headerRow
)
{
this
.
parentCMD
=
parentCMD
;
this
.
title
=
title
;
this
.
id
=
util
.
toId
(
title
);
this
.
headerRow
=
headerRow
;
this
.
title
=
headerRow
.
attr
(
'
title
'
);
this
.
id
=
util
.
toId
(
this
.
title
);
this
.
rows
=
[];
this
.
rowSets
=
undefined
;
this
.
activator
=
undefined
;
...
...
war/src/main/js/widgets/config/model/ConfigTableMetaData.js
浏览文件 @
8baeec3d
...
...
@@ -39,27 +39,33 @@ exports.fromConfigTable = function(configTable) {
sectionRow
.
attr
(
'
title
'
,
sectionTitle
);
});
// Go through the top level <tr> elements (immediately inside the <tbody>)
// and group the related <tr>s based on the "section-header-row", using a "normalized"
// version of the section title as the section id.
var
configTableMetadata
=
new
ConfigTableMetaData
(
configForm
,
configTable
);
var
curSection
=
new
ConfigSection
(
configTableMetadata
,
'
General
'
);
var
topRows
=
configTableMetadata
.
getTopRows
();
var
firstRow
=
configTableMetadata
.
getFirstRow
();
var
curSection
=
undefined
;
configTableMetadata
.
sections
.
push
(
curSection
);
curSection
.
id
=
util
.
toId
(
curSection
.
title
);
// The first set of rows don't have a 'section-header-row', so we manufacture one,
// calling it a "General" section. We do this by marking the first row in the table.
// See the next block of code.
firstRow
.
addClass
(
'
section-header-row
'
);
firstRow
.
attr
(
'
title
'
,
"
General
"
);
var
topRows
=
configTableMetadata
.
getTopRows
();
// Go through the top level <tr> elements (immediately inside the <tbody>)
// and group the related <tr>s based on the "section-header-row", using a "normalized"
// version of the section title as the section id.
topRows
.
each
(
function
()
{
var
tr
=
$
(
this
);
if
(
tr
.
hasClass
(
'
section-header-row
'
))
{
// a new section
var
title
=
tr
.
attr
(
'
title
'
);
curSection
=
new
ConfigSection
(
configTableMetadata
,
title
);
curSection
=
new
ConfigSection
(
configTableMetadata
,
tr
);
configTableMetadata
.
sections
.
push
(
curSection
);
}
curSection
.
rows
.
push
(
tr
);
tr
.
addClass
(
curSection
.
id
);
if
(
curSection
)
{
curSection
.
rows
.
push
(
tr
);
tr
.
addClass
(
curSection
.
id
);
}
else
{
throw
'
Unexpected error. The first row in the config table is expected to be a "section-header-row".
'
;
}
});
var
buttonsRow
=
$
(
'
#bottom-sticker
'
,
configTable
).
closest
(
'
tr
'
);
...
...
@@ -91,6 +97,10 @@ ConfigTableMetaData.prototype.getTopRows = function() {
return
this
.
configTableBody
.
children
(
'
tr
'
);
};
ConfigTableMetaData
.
prototype
.
getFirstRow
=
function
()
{
return
this
.
getTopRows
().
first
();
};
ConfigTableMetaData
.
prototype
.
addWidgetsContainer
=
function
()
{
var
$
=
jQD
.
getJQuery
();
this
.
configWidgets
=
$
(
'
<div class="jenkins-config-widgets"></div>
'
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录