提交 8f79492f 编写于 作者: K Kohsuke Kawaguchi

Added navigation menus to general links.

In this change, I've added it to various links in the list view to get
the sense of how it feels like.
上级 95fa53c4
...@@ -25,6 +25,6 @@ THE SOFTWARE. ...@@ -25,6 +25,6 @@ THE SOFTWARE.
<?jelly escape-by-default='true'?> <?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:i="jelly:fmt"> <j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:i="jelly:fmt">
<td style="${indenter.getCss(job)}"> <td style="${indenter.getCss(job)}">
<a href="${jobBaseUrl}${job.shortUrl}" tooltip="${job.name}"> ${job.displayName}</a> <a href="${jobBaseUrl}${job.shortUrl}" class='model-link'> ${job.displayName}</a>
</td> </td>
</j:jelly> </j:jelly>
\ No newline at end of file
...@@ -29,7 +29,7 @@ THE SOFTWARE. ...@@ -29,7 +29,7 @@ THE SOFTWARE.
<j:choose> <j:choose>
<j:when test="${lfBuild!=null}"> <j:when test="${lfBuild!=null}">
${lfBuild.timestampString} ${lfBuild.timestampString}
(<a href="${jobBaseUrl}${job.shortUrl}lastFailedBuild/">${lfBuild.displayName}</a>) (<a href="${jobBaseUrl}${job.shortUrl}lastFailedBuild/" class="model-link">${lfBuild.displayName}</a>)
</j:when> </j:when>
<j:otherwise> <j:otherwise>
${%N/A} ${%N/A}
......
...@@ -29,7 +29,7 @@ THE SOFTWARE. ...@@ -29,7 +29,7 @@ THE SOFTWARE.
<j:choose> <j:choose>
<j:when test="${lstBuild!=null}"> <j:when test="${lstBuild!=null}">
${lstBuild.timestampString} ${lstBuild.timestampString}
(<a href="${jobBaseUrl}${job.shortUrl}lastStableBuild/">${lstBuild.displayName}</a>) (<a href="${jobBaseUrl}${job.shortUrl}lastStableBuild/" class="model-link">${lstBuild.displayName}</a>)
</j:when> </j:when>
<j:otherwise> <j:otherwise>
${%N/A} ${%N/A}
......
...@@ -29,7 +29,7 @@ THE SOFTWARE. ...@@ -29,7 +29,7 @@ THE SOFTWARE.
<j:choose> <j:choose>
<j:when test="${lsBuild!=null}"> <j:when test="${lsBuild!=null}">
${lsBuild.timestampString} ${lsBuild.timestampString}
(<a href="${jobBaseUrl}${job.shortUrl}lastSuccessfulBuild/">${lsBuild.displayName}</a>) (<a href="${jobBaseUrl}${job.shortUrl}lastSuccessfulBuild/" class="model-link">${lsBuild.displayName}</a>)
</j:when> </j:when>
<j:otherwise> <j:otherwise>
${%N/A} ${%N/A}
......
...@@ -19,39 +19,45 @@ var breadcrumbs = (function() { ...@@ -19,39 +19,45 @@ var breadcrumbs = (function() {
menu = new YAHOO.widget.Menu("breadcrumb-menu", {position:"dynamic", hidedelay:1000}); menu = new YAHOO.widget.Menu("breadcrumb-menu", {position:"dynamic", hidedelay:1000});
}); });
jenkinsRules["#breadcrumbs LI"] = function (e) { function handleHover(e) {
// when the mouse hovers over LI, activate the menu function showMenu(items) {
$(e).observe("mouseover", function () { menu.hide();
function showMenu(items) { menu.cfg.setProperty("context", [e, "tl", "bl"]);
menu.hide(); menu.clearContent();
menu.cfg.setProperty("context", [e, "tl", "bl"]); menu.addItems(items);
menu.clearContent(); menu.render("breadcrumb-menu-target");
menu.addItems(items); menu.show();
menu.render("breadcrumb-menu-target"); }
menu.show();
} if (xhr)
xhr.options.onComplete = function () {
}; // ignore the currently pending call
if (e.items) {// use what's already loaded
showMenu(e.items());
} else {// fetch menu on demand
xhr = new Ajax.Request(e.getAttribute("href") + "contextMenu", {
onComplete:function (x) {
var a = x.responseText.evalJSON().items;
a.each(function (e) {
e.text = makeMenuHtml(e.icon, e.displayName);
});
e.items = function() { return a };
showMenu(a);
}
});
}
if (xhr) return false;
xhr.options.onComplete = function () { }
}; // ignore the currently pending call
if (e.items) {// use what's already loaded jenkinsRules["#breadcrumbs LI"] = function (e) {
showMenu(e.items()); // when the mouse hovers over LI, activate the menu
} else {// fetch menu on demand $(e).observe("mouseover", function () { handleHover(e.firstChild) });
xhr = new Ajax.Request(e.firstChild.getAttribute("href") + "contextMenu", { };
onComplete:function (x) {
var a = x.responseText.evalJSON().items;
a.each(function (e) {
e.text = makeMenuHtml(e.icon, e.displayName);
});
e.items = function() { return a };
showMenu(a);
}
});
}
return false; jenkinsRules["A.model-link"] = function (a) {
}); $(a).observe("mouseover", function () { handleHover(a); });
}; };
/** /**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册