UNPKG

@teipublisher/pb-components

Version:
69 lines (63 loc) 3.36 kB
<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 without server reload</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; } .message { display: none; } .message.toggle { display: block; } pb-toggle-feature { display: block; } </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> <p class="message">You are viewing the text in plain reading view.</p> <div class="toolbar"> <pb-select-feature id="select-view1" name="view1" label="View" items='[ {"name": "Diplomatic View", "selectors": [{"selector": ".choice,.choice-alternate,br", "state": false},{"selector": ".tei-foreign,pb-highlight,pb-popover", "command": "disable"}, {"selector": ".message", "state": false, "global": true}]}, {"name": "Normalized View", "selectors": [{"selector": ".choice,.choice-alternate,br", "state": true},{"selector": ".tei-foreign,pb-highlight,pb-popover", "command": "disable"}, {"selector": ".message", "state": false, "global": true}]}, {"name": "Plain Reading View", "selectors": [{"selector": ".choice,.choice-alternate,br", "state": true}, {"selector": ".tei-foreign,pb-highlight,pb-popover", "command": "disable", "state": true}, {"selector": ".message", "state": true, "global": true}]} ]' emit="ex2" subscribe="ex2"></pb-select-feature> <!-- Navigate to previous page --> <pb-navigation direction="backward" keyboard="left" emit="ex2" subscribe="ex2"> <paper-icon-button icon="icons:chevron-left"></paper-icon-button> </pb-navigation> <!-- Navigate to next page --> <pb-navigation direction="forward" keyboard="right" emit="ex2" subscribe="ex2"> <paper-icon-button icon="icons:chevron-right"></paper-icon-button> </pb-navigation> </div> <main> <pb-view id="view1" src="document1" view="single" xpath="//text[@type='source']" emit="ex2" subscribe="ex2"></pb-view> </main> </pb-page> </template> </pb-demo-snippet> </body> </html>