Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
LinuxSuRen
jenkins
提交
d7d7bdb5
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,发现更多精彩内容 >>
提交
d7d7bdb5
编写于
1月 21, 2016
作者:
T
tfennelly
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixing section finder
上级
97c79c35
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
43 addition
and
10 deletion
+43
-10
war/src/main/js/util/jquery-ext.js
war/src/main/js/util/jquery-ext.js
+25
-0
war/src/main/js/widgets/config/table-metadata.js
war/src/main/js/widgets/config/table-metadata.js
+18
-10
未找到文件。
war/src/main/js/util/jquery-ext.js
0 → 100644
浏览文件 @
d7d7bdb5
/*
* Some internal jQuery extensions.
*/
var
jQD
=
require
(
'
jquery-detached
'
);
// We are going to be adding "stuff" to jQuery. We create a totally new jQuery instance
// because we do NOT want to run the risk of polluting the shared instance.
var
$ext
=
jQD
.
newJQuery
();
/**
* A pseudo selector that performs a case insensitive text contains search i.e. the same
* as the standard ':contains' selector, but case insensitive.
*/
$ext
.
expr
[
"
:
"
].
containsci
=
$ext
.
expr
.
createPseudo
(
function
(
text
)
{
return
function
(
element
)
{
var
elementText
=
$ext
(
element
).
text
();
var
result
=
(
elementText
.
toUpperCase
().
indexOf
(
text
.
toUpperCase
())
!==
-
1
);
return
result
;
};
});
exports
.
getJQuery
=
function
()
{
return
$ext
;
};
\ No newline at end of file
war/src/main/js/widgets/config/table-metadata.js
浏览文件 @
d7d7bdb5
...
...
@@ -2,7 +2,7 @@
* Internal support module for config tables.
*/
var
jQD
=
require
(
'
jquery-detached
'
);
var
jQD
=
require
(
'
../../util/jquery-ext.js
'
);
exports
.
markConfigForm
=
function
(
configTable
)
{
var
form
=
configTable
.
closest
(
'
form
'
);
...
...
@@ -187,23 +187,31 @@ ConfigSection.prototype.getRowSetLabels = function() {
ConfigSection
.
prototype
.
highlightText
=
function
(
text
)
{
var
$
=
jQD
.
getJQuery
();
var
selector
=
"
:contains('
"
+
text
+
"
')
"
;
var
selector
=
"
:contains
ci
('
"
+
text
+
"
')
"
;
for
(
var
i
=
0
;
i
<
this
.
rows
.
length
;
i
++
)
{
var
row
=
this
.
rows
[
i
];
/*jshint loopfunc: true */
$
(
'
span.highlight
'
,
row
).
each
(
function
()
{
// jshint ignore:line
var
highlight
=
$
(
this
);
highlight
.
before
(
highligh
t
.
text
());
highlight
.
remove
();
$
(
'
span.highlight
-split
'
,
row
).
each
(
function
()
{
// jshint ignore:line
var
highlight
Split
=
$
(
this
);
highlight
Split
.
before
(
highlightSpli
t
.
text
());
highlight
Split
.
remove
();
});
if
(
text
!==
''
)
{
var
regex
=
new
RegExp
(
'
(
'
+
text
+
'
)
'
,
"
gi
"
);
/*jshint loopfunc: true */
$
(
selector
,
row
).
find
(
'
:not(:input)
'
).
html
(
function
(
_
,
html
)
{
var
regex
=
new
RegExp
(
text
,
"
g
"
);
return
html
.
replace
(
regex
,
'
<span class="highlight">
'
+
text
+
'
</span>
'
);
$
(
selector
,
row
).
find
(
'
:not(:input)
'
).
each
(
function
()
{
var
$this
=
$
(
this
);
$this
.
contents
().
each
(
function
()
{
// We specifically only mess with text nodes
if
(
this
.
nodeType
===
3
)
{
var
highlightedMarkup
=
this
.
wholeText
.
replace
(
regex
,
'
<span class="highlight">$1</span>
'
);
$
(
this
).
replaceWith
(
'
<span class="highlight-split">
'
+
highlightedMarkup
+
'
</span>
'
);
}
});
});
}
}
...
...
@@ -418,7 +426,7 @@ ConfigTableMetaData.prototype.showSections = function(withText) {
}
else
{
if
(
this
.
hasSections
())
{
var
$
=
jQD
.
getJQuery
();
var
selector
=
"
:contains('
"
+
withText
+
"
')
"
;
var
selector
=
"
:contains
ci
('
"
+
withText
+
"
')
"
;
var
sectionsWithText
=
[];
for
(
var
i2
=
0
;
i2
<
this
.
sections
.
length
;
i2
++
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录