Commit 9ee49231 authored by Magdalena Turska's avatar Magdalena Turska
parents b8468a6f 4c423da3
......@@ -79,7 +79,7 @@
<iron-ajax
id="loadContent"
url="[[url]]"
url="[[importPath]][[url]]"
verbose
handle-as="json"
method="get"
......@@ -422,7 +422,7 @@
const link = document.createElement('link');
link.setAttribute('rel', 'stylesheet');
link.setAttribute('type', 'text/css');
link.setAttribute('href', 'transform/' + this.getOdd() + '.css' );
link.setAttribute('href', this.importPath + '../transform/' + this.getOdd() + '.css' );
this.$.view.appendChild(link);
}
......
......@@ -108,7 +108,9 @@ else if (ends-with($exist:resource, ".xql")) then (
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
{
if (contains($exist:path, "/modules")) then
<forward url="{$exist:controller}/modules/{substring-after($exist:path, '/modules/')}"/>
<forward url="{$exist:controller}/modules/{substring-after($exist:path, '/modules/')}">
<set-header name="Access-Control-Allow-Origin" value="*"/>
</forward>
else
<forward url="{$exist:controller}{$exist:path}"/>
}
......@@ -119,7 +121,9 @@ else if (ends-with($exist:resource, ".xql")) then (
else if (contains($exist:path, "/components")) then
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
<forward url="{$exist:controller}/components/{substring-after($exist:path, '/components/')}"/>
<forward url="{$exist:controller}/components/{substring-after($exist:path, '/components/')}">
<set-header name="Access-Control-Allow-Origin" value="*"/>
</forward>
</dispatch>
else if ($logout or $login) then (
......@@ -164,6 +168,7 @@ else if (ends-with($exist:resource, ".html")) then (
<forward url="{$exist:controller}/{$resource}"/>
<view>
<forward url="{$exist:controller}/modules/view.xql">
<set-header name="Access-Control-Allow-Origin" value="*"/>
{
if ($exist:resource = ("search-results.html", "documents.html", "index.html")) then
<set-header name="Cache-Control" value="no-cache"/>
......
<html>
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=yes"/>
<title>Embedding pb-view</title>
<script src="http://localhost:8080/exist/apps/tei-publisher/components/bower_components/webcomponentsjs/webcomponents-loader.js"></script>
<link rel="import" href="http://localhost:8080/exist/apps/tei-publisher/components/dependencies-dev.html"/>
<custom-style>
<style is="custom-style" include="pb-common-styles">
body {
margin: 60px 20px;
}
main {
display: flex;
justify-content: space-between;
}
pb-navigation {
margin-top: 50vh;
}
#toc h1 {
font-size: 16px;
}
</style>
</custom-style>
</head>
<body>
<pb-document id="document1" path="test/F-rom.xml" odd="shakespeare"></pb-document>
<h1>Embedding TEI Publisher Output</h1>
<p>This page demonstrates how to embed TEI Publisher webcomponents into a standalone HTML page to display
pages of a TEI document. For this to work, TEI Publisher needs to run somewhere on a server, so we can load
the components from there.</p>
<main>
<pb-load id="toc" auto url="../templates/toc.html" src="document1" load-once="load-once">Loading ...</pb-load>
<!-- Navigate to previous page -->
<pb-navigation direction="backward" unit="page" keyboard="left">
<paper-fab icon="icons:chevron-left"></paper-fab>
</pb-navigation>
<pb-view id="view1" src="document1" view="page"></pb-view>
<!-- Navigate to next page -->
<pb-navigation direction="forward" unit="page" keyboard="right">
<paper-fab icon="icons:chevron-right"></paper-fab>
</pb-navigation>
</main>
</body>
</html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment