Commits

J. Ryan Stinnett  committed 2783e95

Restored table behavior of search results and tweaked appearance

  • Participants
  • Parent commits be90c32

Comments (0)

Files changed (1)

File bazaarvoice-customizations

 # HG changeset patch
 # User J. Ryan Stinnett <jryans@gmail.com>
-# Date 1295293584 21600
+# Date 1295344120 21600
 # Node ID a0baf2a260b3a7d8c496cd32e7b323a571462f52
 # Parent 4dcd76ff7b5a03f5c7e5ceb42a0ab3e60d6e6197
 Bazaarvoice-specific customizations
 diff --git a/src/org/opensolaris/opengrok/search/Results.java b/src/org/opensolaris/opengrok/search/Results.java
 --- a/src/org/opensolaris/opengrok/search/Results.java
 +++ b/src/org/opensolaris/opengrok/search/Results.java
-@@ -106,11 +106,11 @@
+@@ -23,18 +23,6 @@
+ 
+ package org.opensolaris.opengrok.search;
+ 
+-import java.io.BufferedReader;
+-import java.io.FileInputStream;
+-import java.io.FileReader;
+-import java.io.IOException;
+-import java.io.InputStreamReader;
+-import java.io.Reader;
+-import java.io.Writer;
+-import java.util.ArrayList;
+-import java.util.LinkedHashMap;
+-import java.util.Map;
+-import java.util.logging.Level;
+-import java.util.zip.GZIPInputStream;
+ import org.apache.lucene.document.Document;
+ import org.apache.lucene.document.Fieldable;
+ import org.apache.lucene.search.ScoreDoc;
+@@ -50,6 +38,19 @@
+ import org.opensolaris.opengrok.web.EftarFileReader;
+ import org.opensolaris.opengrok.web.Util;
+ 
++import java.io.BufferedReader;
++import java.io.FileInputStream;
++import java.io.FileReader;
++import java.io.IOException;
++import java.io.InputStreamReader;
++import java.io.Reader;
++import java.io.Writer;
++import java.util.ArrayList;
++import java.util.LinkedHashMap;
++import java.util.Map;
++import java.util.logging.Level;
++import java.util.zip.GZIPInputStream;
++
+ /**
+  *
+  * @author Chandan
+@@ -106,11 +107,11 @@
          
          for (Map.Entry<String, ArrayList<Document>> entry: dirHash.entrySet()) {
              String parent = entry.getKey();
 +            String tag = (desc == null) ? "" : " - <em>" + desc.get(parent) + "</em>";
  
 -            out.write("<tr class=\"dir\"><td colspan=\"3\">&nbsp;&nbsp;<a href=\"");
-+            out.write("<dt class=\"dir\"><a href=\"");
++            out.write("<tbody class=\"dir\"><tr><th colspan=\"3\"><a href=\"");
              out.write(Util.URIEncodePath(xrefPrefix + parent));
 -            out.write("/\">" + parent + "/</a>" + tag + "</td></tr>");
-+            out.write("/\">" + parent + "/</a>" + tag + "</dt>");
++            out.write("/\">" + parent + "/</a>" + tag + "</th></tr></tbody><tbody class=\"files\">");
  
              boolean alt = false;
              for (Document doc: entry.getValue()) {
-@@ -123,10 +123,10 @@
+@@ -123,10 +124,10 @@
                  }
                  alt ^= true;
                  out.write(">");
 -                out.write("<td class=\"q\"><a href=\""+context+Constants.histL+rpath+"\" title=\"History\">H</a> <a href=\""+context+Constants.xrefP+rpath+"?a=true\" title=\"Annotate\">A</a> <a href=\""+context+Constants.rawP+rpath+"\" title=\"Download\">D</a>");
--                out.write("</td>");
--                out.write("<td class=\"f\"><a href=\"" +
++                out.write("<td class=\"q\"><a class=\"history\" href=\""+context+Constants.histL+rpath+"\" title=\"Open file history\">&nbsp;</a><a class=\"annotate\" href=\""+context+Constants.xrefP+rpath+"?a=true\" title=\"Open file with annotation (commit revisions, authors)\">&nbsp;</a><a class=\"download\" href=\""+context+Constants.rawP+rpath+"\" title=\"Download this file\">&nbsp;</a>");
+                 out.write("</td>");
+                 out.write("<td class=\"f\"><a href=\"" +
 -                        selfUrl + "\">"+self+"</a>&nbsp;</td><td><tt class=\"con\">");
-+                out.write("<dd class=\"q\"><a class=\"history\" href=\""+context+Constants.histL+rpath+"\" title=\"Open file history\">&nbsp;</a><a class=\"annotate\" href=\""+context+Constants.xrefP+rpath+"?a=true\" title=\"Open file with annotation (commit revisions, authors)\">&nbsp;</a><a class=\"download\" href=\""+context+Constants.rawP+rpath+"\" title=\"Download this file\">&nbsp;</a>");
-+                out.write("</dd>");
-+                out.write("<dd class=\"f\"><a href=\"" +
-+                        selfUrl + "\">"+self+"</a></dd><dd class=\"con\">");
++                        selfUrl + "\">"+self+"</a></td><td class=\"con\">");
                  if (sourceContext != null) {
                      String genre = doc.get("t");
                      Definitions tags = null;
-@@ -164,7 +164,7 @@
+@@ -164,8 +165,9 @@
                  if(historyContext != null) {
                      historyContext.getContext(srcRoot + parent, self, rpath, out,context);
                  }
 -                out.write("</tt></td></tr>\n");
-+                out.write("</dd>\n");
++                out.write("</td></tr>\n");
              }
++            out.write("</tbody>");
          }
      }
+ }
 diff --git a/src/org/opensolaris/opengrok/search/context/Context.java b/src/org/opensolaris/opengrok/search/context/Context.java
 --- a/src/org/opensolaris/opengrok/search/context/Context.java
 +++ b/src/org/opensolaris/opengrok/search/context/Context.java
 diff --git a/web/default/style.css b/web/default/style.css
 --- a/web/default/style.css
 +++ b/web/default/style.css
-@@ -1,144 +1,197 @@
+@@ -1,144 +1,199 @@
 -body {
 -background-color: #ffffff;
 -/*font-size: 100.01%; /* 12px [1] */
 +                    .suggestion a {font-weight: bold;}
 +            .term-keyword {color: #ff5200; font-weight: bold;}
 +            .page-more pre strong {background-color: #ffffcc;}
-+            dt.dir {background-color: #f7f7f7; clear: both; margin-bottom: 1em; padding: 0.5em 0.5em 0.25em;}
-+            dd.q {float: left; margin-left: 0; width: 7%;}
-+                dd.q a, div.q a, div.q span.c {background-image: url(./img/icons.gif); background-repeat: no-repeat; display: block; float: left; margin-right: 0.25em; width: 16px; height: 15px;}
-+                dd.q a:hover, dd.q a:active, div.q a:hover, div.q a:active {text-decoration: none;}
-+                    a.history, span.history {background-position: 0 -360px;}
-+                        a.history:hover {background-position: 0 -400px;}
-+                    a.annotate, span.annotate {background-position: 0 -440px;}
-+                        a.annotate:hover {background-position: 0 -480px;}
-+                    a.download {background-position: 0 -520px;}
-+                        a.download:hover {background-position: 0 -560px;}
-+                    a.linenumbers {background-position: 0 -600px;}
-+                        a.linenumbers:hover {background-position: 0 -640px;}
-+                    /*a#highlight-link {display: none;} See mast.jsp for details*/
-+                    a.highlight {background-position: 0 -680px;}
-+                        a.highlight:hover {background-position: 0 -720px;}
-+            dd.f {float: left; margin-left: 0; width: 30%;}
-+            dd.con {float: left; font-family: Consolas, 'Lucida Console', Monaco, monospace; font-size: 0.8em; margin-bottom: 1em; margin-left: 0; width: 63%;}
-+                a.s {color: #000000;} /* matched lines */
-+                .l {color: #999999;} /* line numbers */
++            #results {font-size: 1.4em; width: 100%;}
++                tbody.dir th {font-weight: bold; background-color: #f7f7f7; padding: 0.5em 0.5em 0.25em;}
++                tbody.files td {padding: 1em 0.5em;}
++                td.q {width: 60px; vertical-align: top;}
++                    td.q a, div.q a, div.q span.c {background-image: url(./img/icons.gif); background-repeat: no-repeat; display: block; float: left; margin-right: 0.25em; width: 16px; height: 15px;}
++                    td.q a:hover, td.q a:active, div.q a:hover, div.q a:active {text-decoration: none;}
++                        a.history, span.history {background-position: 0 -360px;}
++                            a.history:hover {background-position: 0 -400px;}
++                        a.annotate, span.annotate {background-position: 0 -440px;}
++                            a.annotate:hover {background-position: 0 -480px;}
++                        a.download {background-position: 0 -520px;}
++                            a.download:hover {background-position: 0 -560px;}
++                        a.linenumbers {background-position: 0 -600px;}
++                            a.linenumbers:hover {background-position: 0 -640px;}
++                        /*a#highlight-link {display: none;} See mast.jsp for details*/
++                        a.highlight {background-position: 0 -680px;}
++                            a.highlight:hover {background-position: 0 -720px;}
++                td.f {vertical-align: top;}
++                td.con {font-family: Consolas, 'Lucida Console', Monaco, monospace; font-size: 0.8em;}
++                    a.s {color: #000000;} /* matched lines */
++                    .l {color: #999999;} /* line numbers */
 +            .link-more {font-family: Helvetica, Helvetica Neue, Arial, sans-serif; font-size: 1.2em; font-style: italic;}
 +            .link-navigate {background-image: url(./img/icons.gif); background-repeat: no-repeat; background-position: 0 -760px; font-family: Consolas, 'Lucida Console', Monaco, monospace; padding-left: 16px;}
 +                .link-navigate:hover {background-position: 0 -800px;}
  
  .sl {color:#999;text-decoration:underline;}
  td.a{color:#000}
-@@ -146,7 +199,6 @@
+@@ -146,7 +201,6 @@
  .s  {color:green;} /* strings */
  .c  {color:#666;} /* comments */
  .b  {color:#000; font-weight:bold;} /* comments */
  .i  {color:#00008b; font-weight:bold;} /* interpolations */
  .di {color:#00008b; font-weight:bold;} /* directives */
  .bi {color:#666;} /* built-in */
-@@ -182,74 +234,6 @@
+@@ -182,74 +236,6 @@
  a.xmt {color:#00f; font-weight:bold; text-decoration:none;} /* method */
  a.xsr {color:#00f; font-weight:bold; text-decoration:none;} /* subroutine */
  
 +                    Results <strong><%=start+1%> - <%=thispage+start%></strong> of <strong><%=totalHits%></strong>, sorted by <%=sortName%></p>
 +                    <p>Completed in <%=(new Date()).getTime() - starttime.getTime()%> milliseconds.</p>
 +                    <%=slider != null ? slider.toString() : "" %>
-+                    
-+                    <dl><%
++		<table id="results"><%
++                
 +                        Context sourceContext = null;
 +                        Summarizer summer = null;
 +                        if (query != null) {
 +                            } catch (IOException e) {
 +                            }
 +                        }
-+                %><div class="spacer">&nbsp;</div></dl>
++                %></table>
 +                <%=slider != null ? slider : ""%>
 +                <%
                      }