提交 fd0e34a1 编写于 作者: M mindless

small PluginManager UI updates

- click category heading on Available tab to show/hide plugins in that category
- add initial sort for plugins on Installed tab
- no mouseover bgcolor for Advanced tab


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@31819 71c3de6d-444a-0410-be80-ed276b4c234a
上级 a1557244
......@@ -233,6 +233,7 @@ public abstract class PluginManager extends AbstractModelObject {
stop(); // disable all plugins since classloading from them can lead to StackOverflow
throw e; // let Hudson fail
}
Collections.sort(plugins);
}
});
......
/*
* The MIT License
*
* Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi, Yahoo! Inc., Erik Ramfelt, Tom Huybrechts
* Copyright (c) 2004-2010, Sun Microsystems, Inc., Kohsuke Kawaguchi,
* Yahoo! Inc., Erik Ramfelt, Tom Huybrechts
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
......@@ -67,7 +68,7 @@ import org.kohsuke.stapler.HttpResponses;
*
* @author Kohsuke Kawaguchi
*/
public final class PluginWrapper {
public final class PluginWrapper implements Comparable<PluginWrapper> {
/**
* {@link PluginManager} to which this belongs to.
*/
......@@ -441,6 +442,13 @@ public final class PluginWrapper {
return getUpdateInfo()!=null;
}
/**
* Sort by short name.
*/
public int compareTo(PluginWrapper pw) {
return shortName.compareToIgnoreCase(pw.shortName);
}
//
//
// Action methods
......
......@@ -49,6 +49,12 @@ THE SOFTWARE.
}
}
}
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>
<form method="post" action="install">
......@@ -56,7 +62,8 @@ THE SOFTWARE.
<local:tabBar page="${attrs.page}" xmlns:local="/hudson/PluginManager" />
<table id="plugins" class="sortable pane bigtable">
<tr style="border-top: 0px;">
<th initialSortDir="${isUpdates?null:'down'}" tooltip="${%Check to install the plugin}"
<th initialSortDir="${isUpdates?null:'down'}"
tooltip="${%Check to install the plugin}${isUpdates?'':'&lt;br/&gt;'+'%Click this heading to sort by category'}"
width="32" onclick="showhideCategories(this,1)">${%Install}</th>
<th initialSortDir="${isUpdates?'down':null}"
onclick="showhideCategories(this,0)">${%Name}</th>
......@@ -72,7 +79,7 @@ THE SOFTWARE.
<j:set var="p" value="${p.plugin}" />
<j:if test="${thisCat != lastCat}">
<tr>
<td class="pane" colspan="3">${thisCat}</td>
<td class="pane" colspan="3" onclick="showhideCategory(this)">${thisCat}</td>
</tr>
</j:if>
<j:set var="lastCat" value="${thisCat}" />
......
......@@ -714,8 +714,8 @@ TABLE.fingerprint-in-build TD {
border-top: none;
}
#plugins tr:hover {
background-color: #eeeee8;
#pluginsAdv tr:hover {
background-color: inherit;
}
#plugins tr.already-upgraded {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册