提交 a0a14c25 编写于 作者: K Kohsuke Kawaguchi

moved breadcrumb related code into an adjunct so that all the relevant pieces are in one place

上级 e4bc362f
此差异由.gitattributes 抑制。
<!--
The MIT License
Copyright (c) 2004-2010, Sun Microsystems, Inc., Kohsuke Kawaguchi,
Daniel Dyer, Seiji Sogabe, Tom Huybrechts, Manufacture Francaise des Pneumatiques
Michelin, Romain Seguy, CloudBees, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
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:i="jelly:fmt" xmlns:x="jelly:xml">
<st:documentation>
Generates breadcrumb, along with its associated dynamic behaviours.
This tag is used by l:layout and not expected to be used by anyone else,
but it's written as separate tag for better readability of code.
</st:documentation>
<tr id="top-nav">
<td id="left-top-nav" colspan="2">
<st:adjunct includes="lib.layout.breadcrumbs_" />
<div class="top-sticker noedge">
<div class="top-sticker-inner">
<div id="right-top-nav">
<j:if test="${norefresh==null}">
<div id="right-top-nav">
<div class="smallfont">
<j:choose>
<j:when test="${h.isAutoRefresh(request)}">
<a href="?auto_refresh=false">${%DISABLE AUTO REFRESH}</a>
</j:when>
<j:otherwise>
<a href="?auto_refresh=true">${%ENABLE AUTO REFRESH}</a>
</j:otherwise>
</j:choose>
</div>
</div>
</j:if>
</div>
<ul id="breadcrumbs">
<j:forEach var="anc" items="${request.ancestors}">
<j:if test="${h.isModel(anc.object) and anc.prev.url!=anc.url}">
<li onmouseover="return foo(this)">
<a href="${anc.url}/">
${anc.object.displayName}
</a>
</li>
</j:if>
</j:forEach>
</ul>
<div id="rendertarget"/>
</div>
</div>
</td>
</tr>
</j:jelly>
\ No newline at end of file
#left-top-nav {
text-align: left;
color: #222;
}
#right-top-nav {
float: right;
margin-right: 1em;
height: 2em;
line-height: 2em;
}
#left-top-nav a {
color: black;
}
#top-nav .a {
color: white;
}
#breadcrumbs {
list-style-type:none;
padding:0;
margin:0;
height: 2em;
border-bottom: 1px solid #d3d7cf;
}
#breadcrumbs LI {
float:left;
line-height:2em;
padding-left:.75em;
color:#555753;
}
#breadcrumbs LI A {
display:block;
padding:0 15px 0 0;
background:url('breadcrumb.gif') no-repeat right center;
}
#breadcrumbs LI A:link, #breadcrumbs LI A:visited {
text-decoration:none;
color:#555753;
}
#breadcrumbs LI A:hover, #crumbs LI A:focus {
color:#3465a4;
}
/** @type {YAHOO.widget.Menu} */
var oMenu;
var xhr;
/**
* @param {HTMLElement} e
* The LI tag that the mouse has wondered into.
*/
function foo(e) {
function showMenu(items) {
oMenu.hide();
oMenu.cfg.setProperty("context",[e,"tl","bl"]);
oMenu.clearContent();
oMenu.addItems(items);
oMenu.render("rendertarget");
oMenu.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.firstChild.getAttribute("href")+"contextMenu", {
onComplete : function (x) {
var a = x.responseText.evalJSON().items;
a.each(function(e) {
e.text = "<img src='"+e.icon+"' width=24 height=24 style='margin: 2px;' alt=''> "+e.displayName;
});
e.items = a;
showMenu(a);
}
});
}
return false;
}
window.addEventListener("load",function(){
oMenu = new YAHOO.widget.Menu("breadcrumb-menu", {position:"dynamic", hidedelay:1000});
})
......@@ -198,86 +198,7 @@ THE SOFTWARE.
</table>
</td>
</tr>
<tr id="top-nav">
<td id="left-top-nav" colspan="2">
<div class="top-sticker noedge">
<div class="top-sticker-inner">
<div id="right-top-nav">
<j:if test="${attrs.norefresh==null}">
<div id="right-top-nav">
<div class="smallfont">
<j:choose>
<j:when test="${h.isAutoRefresh(request)}">
<a href="?auto_refresh=false">${%DISABLE AUTO REFRESH}</a>
</j:when>
<j:otherwise>
<a href="?auto_refresh=true">${%ENABLE AUTO REFRESH}</a>
</j:otherwise>
</j:choose>
</div>
</div>
</j:if>
</div>
<ul id="breadcrumbs">
<j:forEach var="anc" items="${request.ancestors}">
<j:if test="${h.isModel(anc.object) and anc.prev.url!=anc.url}">
<li onmouseover="return foo(this)">
<a href="${anc.url}/">
${anc.object.displayName}
</a>
</li>
</j:if>
</j:forEach>
</ul>
<script><![CDATA[
/** @type {YAHOO.widget.Menu} */
var oMenu;
var xhr;
/**
* @param {HTMLElement} e
* The LI tag that the mouse has wondered into.
*/
function foo(e) {
function showMenu(items) {
oMenu.hide();
oMenu.cfg.setProperty("context",[e,"tl","bl"]);
oMenu.clearContent();
oMenu.addItems(items);
oMenu.render("rendertarget");
oMenu.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.firstChild.getAttribute("href")+"contextMenu", {
onComplete : function (x) {
var a = x.responseText.evalJSON().items;
a.each(function(e) {
e.text = "<img src='"+e.icon+"' width=24 height=24 style='margin: 2px;' alt=''> "+e.displayName;
});
e.items = a;
showMenu(a);
}
});
}
return false;
}
window.addEventListener("load",function(){
oMenu = new YAHOO.widget.Menu("breadcrumb-menu", {position:"dynamic", hidedelay:1000});
})
]]></script>
<div id="rendertarget"/>
</div>
</div>
</td>
</tr>
<l:breadcrumbs />
</table>
<table id="main-table" width="100%" height="70%" border="0"
style="background-image: url(${imagesURL}/jenkins.png);
......
......@@ -79,22 +79,6 @@ dt {
text-decoration: none;
}
#left-top-nav {
text-align: left;
color: #222;
}
#right-top-nav {
float: right;
margin-right: 1em;
height: 2em;
line-height: 2em;
}
#left-top-nav a {
color: black;
}
#main-panel {
padding: 10px;
padding-top: 0px;
......@@ -186,40 +170,6 @@ a.tip:hover span {
text-align: left
}
#top-nav .a {
color: white;
}
#breadcrumbs {
list-style-type:none;
padding:0;
margin:0;
height: 2em;
border-bottom: 1px solid #d3d7cf;
}
#breadcrumbs LI {
float:left;
line-height:2em;
padding-left:.75em;
color:#555753;
}
#breadcrumbs LI A {
display:block;
padding:0 15px 0 0;
background:url('../images/breadcrumb.gif') no-repeat right center;
}
#breadcrumbs LI A:link, #breadcrumbs LI A:visited {
text-decoration:none;
color:#555753;
}
#breadcrumbs LI A:hover, #crumbs LI A:focus {
color:#3465a4;
}
img {
vertical-align: middle;
border: 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册