menu.jspf revision 73100f4d1c412f00eb2568969d935cf3182b0d77
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl<%--
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl$Id$
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl
d611dadcc74db10ba533ee6859308f5fc505aee1Michael BieblCDDL HEADER START
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl
d611dadcc74db10ba533ee6859308f5fc505aee1Michael BieblThe contents of this file are subject to the terms of the
d611dadcc74db10ba533ee6859308f5fc505aee1Michael BieblCommon Development and Distribution License (the "License").
d611dadcc74db10ba533ee6859308f5fc505aee1Michael BieblYou may not use this file except in compliance with the License.
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl
d611dadcc74db10ba533ee6859308f5fc505aee1Michael BieblSee LICENSE.txt included in this distribution for the specific
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebllanguage governing permissions and limitations under the License.
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl
d611dadcc74db10ba533ee6859308f5fc505aee1Michael BieblWhen distributing Covered Code, include this CDDL HEADER in each
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Bieblfile and include the License file at LICENSE.txt.
d611dadcc74db10ba533ee6859308f5fc505aee1Michael BieblIf applicable, add the following below this CDDL HEADER, with the
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Bieblfields enclosed by brackets "[]" replaced with your own identifying
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Bieblinformation: Portions Copyright [yyyy] [name of copyright owner]
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl
d611dadcc74db10ba533ee6859308f5fc505aee1Michael BieblCDDL HEADER END
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl
a72d698d0d9ff9c158155b44cdc77376df31a317Dave ReisnerCopyright 2007 Sun Microsystems, Inc. All rights reserved.
a72d698d0d9ff9c158155b44cdc77376df31a317Dave ReisnerUse is subject to license terms.
a72d698d0d9ff9c158155b44cdc77376df31a317Dave Reisner
a72d698d0d9ff9c158155b44cdc77376df31a317Dave ReisnerPortions Copyright 2011 Jens Elkner.
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl--%><%@page import="
2720e0c0f006f9951550648b68f74d6772426f39Daniel J Walshjava.util.SortedSet,
2720e0c0f006f9951550648b68f74d6772426f39Daniel J Walshjava.util.TreeMap,
2720e0c0f006f9951550648b68f74d6772426f39Daniel J Walshjava.util.Map.Entry,
2720e0c0f006f9951550648b68f74d6772426f39Daniel J Walshjava.util.List,
2720e0c0f006f9951550648b68f74d6772426f39Daniel J Walshjava.util.HashMap,
2720e0c0f006f9951550648b68f74d6772426f39Daniel J Walshjava.util.ArrayList,
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Bieblorg.opensolaris.opengrok.configuration.Project,
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Bieblorg.opensolaris.opengrok.search.QueryBuilder,
023dd03a4299f3ee0889d2f8dab45ab18e2f27f0Evgeny Vereshchaginorg.opensolaris.opengrok.web.PageConfig,
023dd03a4299f3ee0889d2f8dab45ab18e2f27f0Evgeny Vereshchaginorg.opensolaris.opengrok.web.Prefix,
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Bieblorg.opensolaris.opengrok.web.Util"
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl%><%
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl/* ---------------------- menu.jspf start --------------------- */
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl{
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl // PageConfig cfg = PageConfig.get(request);
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl
be8f4a9fa732d61e845e1ab1a62ac3a6b368d3a7Zbigniew Jędrzejewski-Szmek List<Project> projects = cfg.getEnv().getProjects();
be8f4a9fa732d61e845e1ab1a62ac3a6b368d3a7Zbigniew Jędrzejewski-Szmek if (projects == null) {
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl projects = new ArrayList<Project>(0);
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl }
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl TreeMap<String, String> pMap = new TreeMap<String, String>();
a331b5e6d4724365bad9edeb9420c7e26e7f50daJan Janssen QueryBuilder queryParams = cfg.getQueryBuilder();
a331b5e6d4724365bad9edeb9420c7e26e7f50daJan Janssen if (projects.size() != 0) {
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl for (Project p : projects) {
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl String name = p.getDescription();
b4f91f2ba354c16dc23111cc231010c975c717a2Carlos Morata Castillo String esc = Util.formQuoteEscape(p.getDescription());
b4f91f2ba354c16dc23111cc231010c975c717a2Carlos Morata Castillo pMap.put(name, esc);
b4f91f2ba354c16dc23111cc231010c975c717a2Carlos Morata Castillo }
1a51b1b1c274c8b8047f9296e4bacbd89f3f9c14Marcos Mello StringBuilder jsProjects = new StringBuilder(64);
b68b76897aca23f613afdc39a760992c711a7671Lennart Poettering jsProjects.append('\'');
2720e0c0f006f9951550648b68f74d6772426f39Daniel J Walsh for (String name : cfg.getRequestedProjects()) {
6409d3af08f0ce42acbfd7e7978a9bbb3312511eEvgeny Vereshchagin jsProjects.append(name).append("','");
23c35c82c43cfb0997ef6dedfd39d5acac44e7d7Marcos Mello }
6409d3af08f0ce42acbfd7e7978a9bbb3312511eEvgeny Vereshchagin if (jsProjects.length() > 1) {
2720e0c0f006f9951550648b68f74d6772426f39Daniel J Walsh jsProjects.setLength(jsProjects.length()-2);
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl } else {
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl jsProjects.setLength(0);
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl }
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl%>
b68b76897aca23f613afdc39a760992c711a7671Lennart Poettering<script type="text/javascript">/* <![CDATA[ */
a331b5e6d4724365bad9edeb9420c7e26e7f50daJan Janssen document.projects = [ <%= Util.encode(jsProjects.toString())
a331b5e6d4724365bad9edeb9420c7e26e7f50daJan Janssen %> ];document.xrefPath = '<%= request.getContextPath() + Prefix.XREF_P
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl %>';document.domReady.push(function() { domReadyMenu(); });
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl/* ]]> */
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl</script><%
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl }
7524c3cf4485bb9afd4ef0bf005a89f0319c19cdZbigniew Jędrzejewski-Szmek%>
7524c3cf4485bb9afd4ef0bf005a89f0319c19cdZbigniew Jędrzejewski-Szmek<form action="search" id="sbox">
7524c3cf4485bb9afd4ef0bf005a89f0319c19cdZbigniew Jędrzejewski-Szmek
7524c3cf4485bb9afd4ef0bf005a89f0319c19cdZbigniew Jędrzejewski-Szmek<div id="qtbl">
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl<table>
e4e5a85f34db9b18a5ae84a659fcdaf7e494dec1Ronny Chevalier <tr>
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl <td><label for="s1">Full&nbsp;Search</label></td>
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl <td><input tabindex="1" class="q" name="q" id="s1" value="<%=
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl Util.formQuoteEscape(queryParams.getFreetext()) %>"/></td>
2720e0c0f006f9951550648b68f74d6772426f39Daniel J Walsh </tr>
2720e0c0f006f9951550648b68f74d6772426f39Daniel J Walsh <tr>
2720e0c0f006f9951550648b68f74d6772426f39Daniel J Walsh <td><label for="s2">Definition</label></td>
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl <td><input class="q" tabindex="2" name="defs" id="s2" value="<%=
be8f4a9fa732d61e845e1ab1a62ac3a6b368d3a7Zbigniew Jędrzejewski-Szmek Util.formQuoteEscape(queryParams.getDefs()) %>"/></td>
be8f4a9fa732d61e845e1ab1a62ac3a6b368d3a7Zbigniew Jędrzejewski-Szmek </tr>
be8f4a9fa732d61e845e1ab1a62ac3a6b368d3a7Zbigniew Jędrzejewski-Szmek <tr>
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl <td><label for="s3">Symbol</label></td>
1535fb73799f1c6079e8329af5d710bf9d55cbafHarald Hoyer <td><input class="q" tabindex="3" name="refs" id="s3" value="<%=
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl Util.formQuoteEscape(queryParams.getRefs()) %>"/></td>
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl </tr>
1535fb73799f1c6079e8329af5d710bf9d55cbafHarald Hoyer <tr>
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl <td><label for="s4">File&nbsp;Path</label></td>
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl <td><input class="q" tabindex="4" name="path" id="s4" value="<%=
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl Util.formQuoteEscape(queryParams.getPath()) %>"/></td>
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl </tr>
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl <tr>
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl <td><label for="s5">History</label></td>
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl <td><input class="q" tabindex="5" name="hist" id="s5" value="<%=
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl Util.formQuoteEscape(queryParams.getHist()) %>"/></td>
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl </tr>
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl<%-- TODO Bug 11749
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl<%
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl if (projects.size() != 0) {
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl String imgDir = cfg.getCssDir() + "/img/";
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl %>
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl <tr>
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl <td>Project(s)</td>
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl <td>
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl <table class="combo_table" id="combotable">
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl <tbody>
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl <tr>
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl <td class="combo_td1"><div class="combo_div4"
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl style="background: transparent url(<%=
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl imgDir %>transparent_pixel.gif)
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl repeat scroll 0% 0%;"><input
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl class="combo_input1 combo_input" id="project"
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl name="project" size="25"
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl value="<%= cfg.getRequestedProjectsAsString()
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl %>"/></div>
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl </td>
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl <td valign="top" align="left" class="combo_td2"
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl id="combotable_button"><a
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl onclick='javascript: $("#project").click();
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl $("#project").click();'/><img style="display: none;"
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl alt="" src="<%= imgDir %>button2.png"/>
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl </td>
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl </tr>
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl </tbody>
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl </table></td>
d611dadcc74db10ba533ee6859308f5fc505aee1Michael Biebl </tr><%
}
%>
--%>
</table>
</div><%
if (projects.size() != 0) {
%>
<div id="ptbl">
<p><label for="project">In Project(s)</label> <button tabindex="6" type="button"
onclick="javascript: selectAllProjects(); return false;"
>select all</button>&nbsp;<button tabindex="7" type="button"
onclick="javascript: invertAllProjects(); return false;"
>invert selection</button> </p>
<select tabindex="8" ondblclick="javascript: goFirstProject();"
onkeyup="javascript: checkEnter(event);" class="q" id="project"
name="project" multiple="multiple" size="<%=
Math.min(6, projects.size()) %>"><%
SortedSet<String> pRequested = cfg.getRequestedProjects();
for (Entry<String,String> e : pMap.entrySet()) {
// TODO below "selected" has no effect if one refreshes the page
// with F5 also below ondblclick doesn't work in IE ...
// ondblclick="javascript:goFirstProject();"
%>
<option value="<%= e.getValue() %>"<%
if (pRequested.contains(e.getKey())) {
%> selected="selected"<%
}
%>><%= e.getValue() %></option><%
}
%>
</select>
</div><%
}
%>
<p><input
tabindex="9" class="submit" type="submit" value="Search"/> <input
tabindex="10" class="submit" onclick="javascript: sbox.q.value='';
sbox.defs.value = ''; sbox.refs.value = ''; sbox.path.value = '';
sbox.hist.value = ''; sbox.project.value ='';" type="button"
value=" Clear "/> <button class="help"
tabindex="11" onclick="window.open('help.jsp')">Help</button>
</p>
</form>
<%
}
/* ---------------------- menu.jspf end --------------------- */
%>