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:56:09 UTC

isis git commit: ISIS-1521: refactors handling of basedir for search service

Repository: isis
Updated Branches:
  refs/heads/master a10afdb77 -> 41e4a1bec


ISIS-1521: refactors handling of basedir for search service

(previous approach broke relative img links)


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

Branch: refs/heads/master
Commit: 41e4a1bec8722f81c36c13e0a9b2c0258a68b274
Parents: a10afdb
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Tue Apr 4 07:55:50 2017 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Tue Apr 4 07:56:00 2017 +0100

----------------------------------------------------------------------
 .../documentation/src/main/asciidoc/index.html  |  4 +--
 adocs/documentation/src/main/asciidoc/js/app.js |  4 ++-
 adocs/template/document.html.erb                | 34 +++++++++++---------
 3 files changed, 23 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/41e4a1be/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 810153b..21ce21b 100644
--- a/adocs/documentation/src/main/asciidoc/index.html
+++ b/adocs/documentation/src/main/asciidoc/index.html
@@ -6,7 +6,6 @@
 
     <title>Apache Isis</title>
 
-    <base href="." />
 
     <!--
         Licensed to the Apache Software Foundation (ASF) under one
@@ -40,7 +39,8 @@
     <link href="css/slick/1.5.0/slick.css" rel="stylesheet">
     <link href="css/slick/1.5.0/slick-theme.css" rel="stylesheet">
 
-
+    <!-- pass the basedir through to app.js -->
+    <div id="basedir" style="display:none;">./</div>
 
 
 

http://git-wip-us.apache.org/repos/asf/isis/blob/41e4a1be/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 0da129b..45c2c13 100644
--- a/adocs/documentation/src/main/asciidoc/js/app.js
+++ b/adocs/documentation/src/main/asciidoc/js/app.js
@@ -2,6 +2,8 @@ $('#search-form').submit(function(ev) {
     ev.preventDefault(); // to stop the form from submitting
     /* Validations go here */
 
+    var basedir = $('#basedir').text().trim();
+
     var searchField = $('#search-field');
     var searchText = searchField.val()
     if(!searchText) {
@@ -32,7 +34,7 @@ $('#search-form').submit(function(ev) {
 
                 var title = doc.title;
                 var description = doc.description;
-                var url = doc.url;
+                var url = basedir + doc.url;
                 var score = searchResult['score'];
                 var percentScore = score.toFixed(2);
 

http://git-wip-us.apache.org/repos/asf/isis/blob/41e4a1be/adocs/template/document.html.erb
----------------------------------------------------------------------
diff --git a/adocs/template/document.html.erb b/adocs/template/document.html.erb
index e23c782..572c276 100644
--- a/adocs/template/document.html.erb
+++ b/adocs/template/document.html.erb
@@ -6,8 +6,6 @@
 
     <title><%= document.name %></title>
 
-    <base href="<%= (attr :_basedir) %>" />
-    
     <!--
         Licensed to the Apache Software Foundation (ASF) under one
         or more contributor license agreements.  See the NOTICE file
@@ -34,11 +32,11 @@
 
 
     <!-- TODO: need to (re)instate CDN in the future (not using for now just so can develop off-line -->
-    <link href="css/foundation/5.5.1/foundation.css" rel="stylesheet" />
-    <script src="js/foundation/5.5.1/vendor/modernizr.js"></script>
-    <link href="css/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet">
-    <link href="css/asciidoctor/colony.css" rel="stylesheet">
-    <link href="css/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet">
+    <link href="<%= (attr :_basedir) %>css/foundation/5.5.1/foundation.css" rel="stylesheet" />
+    <script src="<%= (attr :_basedir) %>js/foundation/5.5.1/vendor/modernizr.js"></script>
+    <link href="<%= (attr :_basedir) %>css/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet">
+    <link href="<%= (attr :_basedir) %>css/asciidoctor/colony.css" rel="stylesheet">
+    <link href="<%= (attr :_basedir) %>css/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet">
 
 
 
@@ -347,12 +345,16 @@
 
 <div class="row">
 
+    <!-- pass the basedir through to app.js -->
+    <div id="basedir" style="display:none;"><%= (attr :_basedir) %></div>
+    
+
     <div class="fixed contain-to-grid header">
         <nav class="top-bar" data-topbar role="navigation" style="max-width: 80rem">
             <ul class="title-area">
                 <li class="name">
                     <h1>
-                        <a href="index.html">Apache Isis&trade;</a>
+                        <a href="<%= (attr :_basedir) %>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 -->
@@ -437,19 +439,19 @@
 </div>
 
 
-<script src="js/foundation/5.5.1/vendor/jquery.js"></script>
-<script src="js/foundation/5.5.1/foundation.min.js"></script>
+<script src="<%= (attr :_basedir) %>js/foundation/5.5.1/vendor/jquery.js"></script>
+<script src="<%= (attr :_basedir) %>js/foundation/5.5.1/foundation.min.js"></script>
 
 
-<link href="css/jquery.tocify/1.9.0/jquery.tocify.css" rel="stylesheet">
-<script src="js/jqueryui/1.11.4/jquery-ui.min.js"></script>
-<script src="js/jquery.tocify/1.9.0/jquery.tocify.js"></script>
+<link href="<%= (attr :_basedir) %>css/jquery.tocify/1.9.0/jquery.tocify.css" rel="stylesheet">
+<script src="<%= (attr :_basedir) %>js/jqueryui/1.11.4/jquery-ui.min.js"></script>
+<script src="<%= (attr :_basedir) %>js/jquery.tocify/1.9.0/jquery.tocify.js"></script>
 
-<script src="js/slick/1.5.0/slick.min.js"></script>
+<script src="<%= (attr :_basedir) %>js/slick/1.5.0/slick.min.js"></script>
 
-<script src="js/elasticlunr/elasticlunr.min.js"></script>
+<script src="<%= (attr :_basedir) %>js/elasticlunr/elasticlunr.min.js"></script>
 
-<script src="js/app.js"></script>
+<script src="<%= (attr :_basedir) %>js/app.js"></script>
 
 
 <script type="text/javascript">