提交 4c92e2ac 编写于 作者: K Kohsuke Kawaguchi

Added the filter textbox to the update center selector.

上级 246be7ca
......@@ -55,7 +55,8 @@ Upcoming changes</a>
<!-- Record your changes in the trunk here. -->
<div id="trunk" style="display:none"><!--=TRUNK-BEGIN=-->
<ul class=image>
<li class=>
<li class=rfe>
Added the filter textbox to the update center selector.
</ul>
</div><!--=TRUNK-END=-->
......
#filter-box {
background: white url('/images/16x16/search.gif') no-repeat 2px center;
padding-left: 20px;
width: 15em;
}
#filter-container {
margin: 1em;
text-align: right;
}
function showhideCategories(hdr,on) {
var table = hdr.parentNode.parentNode.parentNode,
newDisplay = on ? '' : 'none',
nameList = new Array(), name;
for (var i = 1; i < table.rows.length; i++) {
if (on || table.rows[i].cells.length == 1)
table.rows[i].style.display = newDisplay;
else {
// Hide duplicate rows for a plugin when not viewing by-category
name = table.rows[i].cells[1].getAttribute('data');
if (nameList[name] == 1) table.rows[i].style.display = 'none';
nameList[name] = 1;
}
}
}
function showhideCategory(col) {
var row = col.parentNode.nextSibling;
var newDisplay = row && row.style.display == 'none' ? '' : 'none';
for (; row && row.cells.length > 1; row = row.nextSibling)
row.style.display = newDisplay;
}
Behaviour.register({
"#filter-box": function(e) {
function applyFilter() {
var filter = e.value.toLowerCase();
["TR.plugin","TR.plugin-category"].each(function(clz) {
var items = document.getElementsBySelector(clz);
for (var i=0; i<items.length; i++) {
var visible = (filter=="" || items[i].innerHTML.toLowerCase().indexOf(filter)>=0);
items[i].style.display = (visible ? "" : "none");
}
});
}
e.onkeyup = applyFilter;
}
});
......@@ -34,31 +34,13 @@ THE SOFTWARE.
<l:layout title="${%Update Center}" permission="${app.ADMINISTER}" norefresh="true">
<st:include page="sidepanel.jelly"/>
<l:main-panel>
<script type="text/javascript">// &lt;![CDATA[
function showhideCategories(hdr,on) {
var table = hdr.parentNode.parentNode.parentNode,
newDisplay = on ? '' : 'none',
nameList = new Array(), name;
for (var i = 1; i &lt; table.rows.length; i++) {
if (on || table.rows[i].cells.length == 1)
table.rows[i].style.display = newDisplay;
else {
// Hide duplicate rows for a plugin when not viewing by-category
name = table.rows[i].cells[1].getAttribute('data');
if (nameList[name] == 1) table.rows[i].style.display = 'none';
nameList[name] = 1;
}
}
}
function showhideCategory(col) {
var row = col.parentNode.nextSibling;
var newDisplay = row &amp;&amp; row.style.display == 'none' ? '' : 'none';
for (; row &amp;&amp; row.cells.length &gt; 1; row = row.nextSibling)
row.style.display = newDisplay;
}
// ]]&gt;
</script>
<st:adjunct includes="hudson.PluginManager._table"/>
<form method="post" action="install">
<div id="filter-container">
${%Filter}:
<input type="text" id="filter-box"/>
</div>
<j:set var="isUpdates" value="${attrs.page=='updates'}" />
<local:tabBar page="${attrs.page}" xmlns:local="/hudson/PluginManager" />
<table id="plugins" class="sortable pane bigtable">
......@@ -79,7 +61,7 @@ THE SOFTWARE.
<j:set var="thisCat" value="${p.category}" />
<j:set var="p" value="${p.plugin}" />
<j:if test="${thisCat != lastCat}">
<tr>
<tr class="plugin-category" name="${thisCat}">
<td class="pane" colspan="4" onclick="showhideCategory(this)">${thisCat}</td>
</tr>
</j:if>
......@@ -88,7 +70,7 @@ THE SOFTWARE.
<j:set var="installJob" value="${isUpdates ? app.updateCenter.getJob(p) : null}" />
<j:set var="installedOk"
value="${installJob.status.success and installJob.plugin.version==p.version}" />
<tr class="${installJob!=null ? 'already-upgraded' : null}">
<tr class="${installJob!=null ? 'already-upgraded' : ''} plugin" name="${p.displayName}">
<td class="pane" align="center" data="${thisCat}_">
<input type="checkbox" name="plugin.${p.name}.${p.sourceId}"
checked="${installedOk ? 'checked' : null}"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册