You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2017/04/04 06:14:15 UTC

[11/11] isis git commit: ISIS-1521: adds a panel around the search results

ISIS-1521: adds a panel around the search results


Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/a10afdb7
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/a10afdb7
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/a10afdb7

Branch: refs/heads/master
Commit: a10afdb779ca69450f028ddaa0e7e9d7da2f30dc
Parents: 3f55fe1
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Tue Apr 4 06:45:18 2017 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Tue Apr 4 06:45:18 2017 +0100

----------------------------------------------------------------------
 .../documentation/src/main/asciidoc/index.html  | 58 ++++++++-------
 adocs/documentation/src/main/asciidoc/js/app.js | 16 ++---
 adocs/template/document.html.erb                | 75 ++++++--------------
 3 files changed, 57 insertions(+), 92 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/a10afdb7/adocs/documentation/src/main/asciidoc/index.html
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/index.html b/adocs/documentation/src/main/asciidoc/index.html
index d3c7e7f..810153b 100644
--- a/adocs/documentation/src/main/asciidoc/index.html
+++ b/adocs/documentation/src/main/asciidoc/index.html
@@ -94,20 +94,6 @@
     </style>
 
     <style>
-    .github-fork-ribbon-wrapper.right {
-        position: fixed;
-    }
-    .github-fork-ribbon {
-        background: #090;
-    }
-    .github-fork-ribbon a:hover {
-        background:#0D0;
-        color:#fff;
-        font-size: 1.1em;
-    }
-    </style>
-
-    <style>
         @media only screen and (min-width: 40.063em) {
           .top-bar {
             .contain-to-grid .top-bar {
@@ -246,9 +232,20 @@
                 margin-bottom: 0px;
             }
 
-        </style>
+            #search-panel {
+                display: none;
+                border: lightgray solid 1px;
+                padding: 10px;
+                margin-top: 10px;                
+                margin-bottom: 10px;
+            }
 
-        <style>
+            #search-panel.active {
+                display: inherit;
+            }
+    </style>
+
+    <style>
         /* overriding colony.css stylesheet */
         .literalblock pre, .literalblock pre[class], .listingblock pre, .listingblock pre[class] {
            /*padding: 1.25em 1.5625em 1.125em 1.5625em;*/
@@ -363,11 +360,6 @@
 </head>
 <body>
 
-<div class="github-fork-ribbon-wrapper right" style="position: fixed;">
-    <div class="github-fork-ribbon">
-        <a href="https://github.com/apache/isis#fork-destination-box">Fork me on GitHub</a>
-    </div>
-</div>
 
 <div class="homepage">
     <div class="row">
@@ -421,7 +413,13 @@
 
     <div class="row">
         <div class="large-12 medium-12 columns">
-            <div id="search-results"/>
+            <div id="search-panel">
+                <div id="search-results"></div>
+                <div>
+                    <br/>
+                    <a href=".">clear</a>
+                </div>
+            </div>
         </div>
     </div>
 
@@ -808,14 +806,14 @@ mvn archetype:generate  \
             </div>
 
 
-            <footer>
-              <hr>
-              <p class="small">
-              Copyright &copy; 2010~2016 The Apache&nbsp;Software&nbsp;Foundation, licensed under the Apache&nbsp;License,&nbsp;v2.0.
-              <br/>
-              Apache, the Apache feather logo, Apache&nbsp;Isis, and the Apache&nbsp;Isis project logo are all trademarks of The&nbsp;Apache&nbsp;Software&nbsp;Foundation.
-              </p>
-            </footer>
+        <footer>
+          <hr>
+          <p class="small">
+          Copyright &copy; 2010~2017 The Apache&nbsp;Software&nbsp;Foundation, licensed under the Apache&nbsp;License,&nbsp;v2.0.
+          <br/>
+          Apache, the Apache feather logo, Apache&nbsp;Isis, and the Apache&nbsp;Isis project logo are all trademarks of The&nbsp;Apache&nbsp;Software&nbsp;Foundation.
+          </p>
+        </footer>
 
         </div>
 

http://git-wip-us.apache.org/repos/asf/isis/blob/a10afdb7/adocs/documentation/src/main/asciidoc/js/app.js
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/js/app.js b/adocs/documentation/src/main/asciidoc/js/app.js
index 920a1a2..0da129b 100644
--- a/adocs/documentation/src/main/asciidoc/js/app.js
+++ b/adocs/documentation/src/main/asciidoc/js/app.js
@@ -4,29 +4,25 @@ $('#search-form').submit(function(ev) {
 
     var searchField = $('#search-field');
     var searchText = searchField.val()
-
+    if(!searchText) {
+        $("#search-panel").removeClass("active");
+    }
 
     $.getJSON('/elasticlunr/index.json', function (data) {
 
         var index = elasticlunr.Index.load(data);
-        var searchResults = index.search(searchText 
-        /*,{
-            fields: {
-                title: {boost: 3},
-                description: {boost: 2},
-                body: {boost: 1}
-        }}
-        */
-        );
+        var searchResults = index.search(searchText);
 
         $('#search-results').empty();
         if(searchResults.length === 0) {
 
             if(searchText) {
+                $("#search-panel").addClass("active");
                 $('#search-results').append("<br/>No matches found for '" + searchText + "'<br/><br/>");
             }
 
         } else {
+            $("#search-panel").addClass("active");
             for (var i = 0; i < Math.min(searchResults.length, 20); i++) {
 
                 var searchResult = searchResults[i];

http://git-wip-us.apache.org/repos/asf/isis/blob/a10afdb7/adocs/template/document.html.erb
----------------------------------------------------------------------
diff --git a/adocs/template/document.html.erb b/adocs/template/document.html.erb
index be8a7ac..e23c782 100644
--- a/adocs/template/document.html.erb
+++ b/adocs/template/document.html.erb
@@ -58,52 +58,7 @@
 
     <style>
 
-    <!--
-    <style type="text/css">
-        <%= ::Asciidoctor::Stylesheets.instance.coderay_stylesheet_data %>
-
-        pre.CodeRay code {
-            background-color: inherit;
-            border-style: none;
-        }
-
-        pre.CodeRay code > span:first-child {
-            margin-left: -5px;
-        }
-
-        .literalblock pre,
-        .listingblock pre:not(.highlight),
-        .listingblock pre[class="highlight"],
-        .listingblock pre[class^="highlight "],
-        .listingblock pre.CodeRay,
-        .listingblock pre.prettyprint {
-            background: rgb(253, 250, 246);
-         }
-        .sidebarblock .literalblock pre,
-        .sidebarblock .listingblock pre:not(.highlight),
-        .sidebarblock .listingblock pre[class="highlight"],
-        .sidebarblock .listingblock pre[class^="highlight "],
-        .sidebarblock .listingblock pre.CodeRay,
-        .sidebarblock .listingblock pre.prettyprint {
-            background: rgb(253, 250, 246);
-         }
 
-    <style>
-    -->
-
-    <style>
-    .github-fork-ribbon-wrapper.right {
-        position: fixed;
-    }
-    .github-fork-ribbon {
-        background: #090;
-    }
-    .github-fork-ribbon a:hover {
-        background:#0D0;
-        color:#fff;
-        font-size: 1.1em;
-    }
-    </style>
 
     <style>
         @media only screen and (min-width: 40.063em) {
@@ -141,7 +96,6 @@
             color: #003b6b;
             text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
         }
-        
     </style>
 
     <style>
@@ -250,6 +204,17 @@
             margin-bottom: 0px;
         }
 
+            #search-panel {
+                display: none;
+                border: lightgray solid 1px;
+                padding: 10px;
+                margin-top: 10px;                
+                margin-bottom: 10px;
+            }
+
+            #search-panel.active {
+                display: inherit;
+            }
     </style>
 
     <style>
@@ -387,7 +352,7 @@
             <ul class="title-area">
                 <li class="name">
                     <h1>
-                        <a href="<%= (attr :sitebasedir) %>/index.html">Apache Isis&trade;</a>
+                        <a href="index.html">Apache Isis&trade;</a>
                     </h1>
                 </li>
                 <!-- Remove the class "menu-icon" to get rid of menu icon. Take out "Menu" to just have icon alone -->
@@ -409,10 +374,10 @@
                 <!-- Left Nav Section -->
                 <ul class="left">
 
-                    <li><a href="<%= (attr :sitebasedir) %>/documentation.html">Documentation</a></li>
-                    <li><a href="<%= (attr :sitebasedir) %>/downloads.html">Downloads</a></li>
-                    <li><a href="<%= (attr :sitebasedir) %>/help.html">Help</a></li>
-                    <li><a href="<%= (attr :sitebasedir) %>/asf.html">@ASF</a></li>
+                        <li><a href="documentation.html">Documentation</a></li>
+                        <li><a href="downloads.html">Downloads</a></li>
+                        <li><a href="help.html">Help</a></li>
+                        <li><a href="asf.html">@ASF</a></li>
 
                 </ul>
 
@@ -431,7 +396,13 @@
 
     <div class="row">
         <div class="large-12 medium-12 columns">
-            <div id="search-results"/>
+            <div id="search-panel">
+                <div id="search-results"></div>
+                <div>
+                    <br/>
+                    <a href=".">clear</a>
+                </div>
+            </div>
         </div>
     </div>