Repository: incubator-ponymail
Updated Branches:
  refs/heads/master 40bbaa51e -> 6a6dd9d67


cannot use absolute URLs in HTML pages

This fixes #328

Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/6a6dd9d6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/6a6dd9d6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/6a6dd9d6

Branch: refs/heads/master
Commit: 6a6dd9d67fbbc30496e37fffa50e3f187f729551
Parents: 40bbaa5
Author: Sebb <s...@apache.org>
Authored: Sat Jan 7 17:42:01 2017 +0000
Committer: Sebb <s...@apache.org>
Committed: Sat Jan 7 17:42:01 2017 +0000

----------------------------------------------------------------------
 CHANGELOG.md        | 1 +
 site/api/static.lua | 8 ++++----
 site/list.html      | 4 ++--
 site/search.html    | 4 ++--
 4 files changed, 9 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/6a6dd9d6/CHANGELOG.md
----------------------------------------------------------------------
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1bcc1ae..9fb3835 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -107,6 +107,7 @@
 - flat view mode does not show first line of body (#198)
 - Fetch URLBase once in Javascript
 - absolute URLs must be prefixed with URLBase in JS files (#327)
+- cannot use absolute URLs in HTML pages (#328)
 
 ## CHANGES in 0.9b:
 

http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/6a6dd9d6/site/api/static.lua
----------------------------------------------------------------------
diff --git a/site/api/static.lua b/site/api/static.lua
index 6f6ae98..3d89352 100644
--- a/site/api/static.lua
+++ b/site/api/static.lua
@@ -49,7 +49,7 @@ local function showThreads(r, thread, emails)
         end
         if email then
             local from = r:escape_html(email.from:gsub("(%S+@)", function(a) 
return a:sub(1,3) .. "...@" end))
-            r:puts(([[<li><a href="/thread.html/%s">%s</a> - 
%s<br/><blockquote>%s</blockquote>]]):format(email['message-id'], 
email.subject, from, r:escape_html(v.body or "")) )
+            r:puts(([[<li><a href="../../thread.html/%s">%s</a> - 
%s<br/><blockquote>%s</blockquote>]]):format(email['message-id'], 
email.subject, from, r:escape_html(v.body or "")) )
             showThreads(r, v, emails)
             r:puts("</li>")
         end
@@ -77,7 +77,7 @@ function handle(r)
         local listid = pinfo:match("^/?([^@]+@[^@]+)$"):gsub("@", ".")
         r:puts("<h2>" .. r:escape_html(listid) .. " list archive, last 30 
days</h2>\
                <p style='color:#963; font-size: 125%;'>You are viewing the 
static version of this archive.<br/> \
-               For the interactive version, please visit: <a 
href='/list.html?" .. pinfo:gsub("[<>]", "") .. "'>This page</a></p>")
+               For the interactive version, please visit: <a 
href='../../list.html?" .. pinfo:gsub("[<>]", "") .. "'>This page</a></p>")
         local threads = {}
         local emails = {}
         local emails_full = {}
@@ -228,7 +228,7 @@ function handle(r)
         local a = 0
         for k, v in pairs(lists) do
             a = a + 1
-            r:puts(([[<a href="/api/static.lua/%s@%s">%s@%s list: %u new 
emails</a><br/>]]):format(k, adomain, k, adomain, v))
+            r:puts(([[<a href="static.lua/%s@%s">%s@%s list: %u new 
emails</a><br/>]]):format(k, adomain, k, adomain, v))
         end
         if a == 0 then
             r:puts("Hm, no activity found on any list matching this domain")
@@ -267,7 +267,7 @@ function handle(r)
         local a = 0
         for k, v in pairs(lists) do
             a = a + 1
-            r:puts(([[<a href="/api/static.lua/%s">%s lists: %u new emails 
here.</a><br/>]]):format(k, k, v))
+            r:puts(([[<a href="static.lua/%s">%s lists: %u new emails 
here.</a><br/>]]):format(k, k, v))
         end
         if a == 0 then
             r:puts("Hm, no activity found on any list matching any domains")

http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/6a6dd9d6/site/list.html
----------------------------------------------------------------------
diff --git a/site/list.html b/site/list.html
index f4f23cb..46ff91f 100644
--- a/site/list.html
+++ b/site/list.html
@@ -25,7 +25,7 @@ the License. -->
     <link href="css/popup.css" rel="stylesheet" media="all">
     <link href="css/solar.css" rel="alternate stylesheet" type="text/css" 
title="Solar theme" media="all">
     <link href="css/metro.css" rel="alternate stylesheet" type="text/css" 
title="Metropolis" media="all">
-    <link rel="alternate" href="/api/static.lua"/>
+    <link rel="alternate" href="api/static.lua"/>
     <link rel="stylesheet" 
href="//cdn.jsdelivr.net/font-hack/2.013/css/hack.min.css">
 
     <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media 
queries -->
@@ -101,7 +101,7 @@ the License. -->
               <li><a href="javascript:void(0)" 
onclick="setTheme('default')">Default theme</a></li>
               <li><a href="javascript:void(0)" 
onclick="setTheme('social')">Social theme</a></li>
               <li><a href="javascript:void(0)" 
onclick="setTheme('compact')">Compact theme</a></li>
-              <li><a href="api/static.lua/" 
onclick="location.href='/api/static.lua/' + xlist;return false;">Static HTML 
lists</a></li>
+              <li><a href="api/static.lua/" 
onclick="location.href='api/static.lua/' + xlist;return false;">Static HTML 
lists</a></li>
           </ul>
         </li>
       <li class="dropdown navbar-right" id="listchoice">

http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/6a6dd9d6/site/search.html
----------------------------------------------------------------------
diff --git a/site/search.html b/site/search.html
index fccd580..0d30ed3 100644
--- a/site/search.html
+++ b/site/search.html
@@ -25,7 +25,7 @@ the License. -->
     <link href="css/popup.css" rel="stylesheet" media="all">
     <link href="css/solar.css" rel="alternate stylesheet" type="text/css" 
title="Solar theme" media="all">
     <link href="css/metro.css" rel="alternate stylesheet" type="text/css" 
title="Metropolis" media="all">
-    <link rel="alternate" href="/api/static.lua"/>
+    <link rel="alternate" href="api/static.lua"/>
     <link rel="stylesheet" 
href="//cdn.jsdelivr.net/font-hack/2.013/css/hack.min.css">
 
     <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media 
queries -->
@@ -100,7 +100,7 @@ the License. -->
               <li><a href="javascript:void(0)" 
onclick="setTheme('default')">Default theme</a></li>
               <li><a href="javascript:void(0)" 
onclick="setTheme('social')">Social theme</a></li>
               <li><a href="javascript:void(0)" 
onclick="setTheme('compact')">Compact theme</a></li>
-              <li><a href="api/static.lua/" 
onclick="location.href='/api/static.lua/' + xlist;return false;">Static HTML 
lists</a></li>
+              <li><a href="api/static.lua/" 
onclick="location.href='api/static.lua/' + xlist;return false;">Static HTML 
lists</a></li>
           </ul>
         </li>
       <li class="dropdown navbar-right" id="listchoice">

Reply via email to