提交 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.
<?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">
<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>
</j:jelly>
\ No newline at end of file
......@@ -29,7 +29,7 @@ THE SOFTWARE.
<j:choose>
<j:when test="${lfBuild!=null}">
${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:otherwise>
${%N/A}
......
......@@ -29,7 +29,7 @@ THE SOFTWARE.
<j:choose>
<j:when test="${lstBuild!=null}">
${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:otherwise>
${%N/A}
......
......@@ -29,7 +29,7 @@ THE SOFTWARE.
<j:choose>
<j:when test="${lsBuild!=null}">
${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:otherwise>
${%N/A}
......
......@@ -19,39 +19,45 @@ var breadcrumbs = (function() {
menu = new YAHOO.widget.Menu("breadcrumb-menu", {position:"dynamic", hidedelay:1000});
});
jenkinsRules["#breadcrumbs LI"] = function (e) {
// when the mouse hovers over LI, activate the menu
$(e).observe("mouseover", function () {
function showMenu(items) {
menu.hide();
menu.cfg.setProperty("context", [e, "tl", "bl"]);
menu.clearContent();
menu.addItems(items);
menu.render("breadcrumb-menu-target");
menu.show();
}
function handleHover(e) {
function showMenu(items) {
menu.hide();
menu.cfg.setProperty("context", [e, "tl", "bl"]);
menu.clearContent();
menu.addItems(items);
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)
xhr.options.onComplete = function () {
}; // ignore the currently pending call
return false;
}
if (e.items) {// use what's already loaded
showMenu(e.items());
} else {// fetch menu on demand
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);
}
});
}
jenkinsRules["#breadcrumbs LI"] = function (e) {
// when the mouse hovers over LI, activate the menu
$(e).observe("mouseover", function () { handleHover(e.firstChild) });
};
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.
先完成此消息的编辑!
想要评论请 注册