Have oilsBasePath include protocol and domain
authorThomas Berezansky <tsbere@mvlc.org>
Thu, 26 Jul 2012 14:00:34 +0000 (10:00 -0400)
committerDan Scott <dscott@laurentian.ca>
Mon, 30 Jul 2012 14:54:34 +0000 (10:54 -0400)
As seen by the other end, anyway. This fixes some authtoken related issues
when things like ACQ build links that would otherwise default to http.

Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Signed-off-by: Dan Scott <dscott@laurentian.ca>

Open-ILS/src/templates/base.tt2

index b26a952..0bd3e5e 100644 (file)
@@ -10,7 +10,7 @@
         <script type="text/javascript" src="/js/dojo/dojo/dojo.js"></script>
         <script type="text/javascript" src="[% ctx.media_prefix %]/js/dojo/dojo/openils_dojo.js"></script>
         <script type="text/javascript" src="[% ctx.media_prefix %]/js/dojo/opensrf/md5.js"></script>
-        <script type="text/javascript">var oilsBasePath = '[% ctx.base_path %]'</script>
+        <script type="text/javascript">var oilsBasePath = [% IF ctx.base_path.substr(0,1) == '/' %]location.href.replace(RegExp(location.pathname + '.*'),'') +[% END %] '[% ctx.base_path %]'</script>
         <script type="text/javascript" src="[% ctx.media_prefix %]/js/ui/base.js"></script>
         <script type="text/javascript">
             dojo.require("dijit.layout.LayoutContainer");