@teipublisher/pb-components
Version:
Collection of webcomponents underlying TEI Publisher
59 lines (53 loc) • 2.17 kB
HTML
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=yes" />
<title>pb-select-feature Demo</title>
<script src="https://cdn.jsdelivr.net/npm/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script><script type="module" src="../pb-components-bundle.js"></script>
</head>
<body>
<h1>Using pb-select-feature with pb-load</h1>
<pb-demo-snippet>
<template>
<style>
body {
--paper-fab-background: #35424b;
}
main {
display: flex;
justify-content: space-between;
}
.toolbar {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px;
background-color: #E0E0E0;
}
pb-toggle-feature {
display: block;
}
.name {
color: #339900;
}
.choice, .choice-alternate {
color: #888888;
}
</style>
<pb-page endpoint="https://teipublisher.com/exist/apps/tei-publisher" api-version="1.0.0" url-path="query">
<pb-document id="document1" path="test/cortes_to_dantiscus.xml" odd="dantiscus"></pb-document>
<div class="toolbar">
<pb-select-feature id="select-view2" name="view2" label="View" items='[
{"name": "Diplomatic View", "properties": {"user.mode": "diplomatic"}},
{"name": "Normalized View", "properties": {"user.mode": "norm"}}
]' subscribe="loader" emit="loader"></pb-select-feature>
</div>
<main>
<pb-load id="load" url="api/parts/{doc}/html?xpath=//text[@type='source']&view=single" expand
src="document1" auto subscribe="loader" emit="loader" history>Loading document ...</pb-load>
</main>
</pb-page>
</template>
</pb-demo-snippet>
</body>
</html>