Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Url handling dp #102

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"
9 changes: 5 additions & 4 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 14.x
uses: actions/setup-node@v1
- uses: actions/checkout@v3
- name: Use Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: "14.x"
node-version: 16
cache: 'npm'
- name: npm install and build
run:
npm ci
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/release.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ jobs:
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/setup-node@v1
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "14.x"
node-version: 'lts/*'
cache: 'npm'
- name: npm install and build
run:
npm ci
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
node_modules
.*
!.travis.yml
!.github/
!.editorconfig
!.npmignore
!.gitignore
Expand Down
20 changes: 0 additions & 20 deletions .travis.yml

This file was deleted.

3 changes: 2 additions & 1 deletion demo/demos.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"pb-view": {
"demo/pb-view.html": "View TEI document",
"demo/pb-view2.html": "Docbook document",
"demo/pb-view3.html": "Manipulating content via JS"
"demo/pb-view3.html": "Manipulating content via JS",
"demo/pb-view4.html": "Navigating links"
},
"pb-document": {
"demo/pb-document.html": "Demo"
Expand Down
3 changes: 2 additions & 1 deletion demo/pb-browse-docs.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@
border-bottom: 1px solid #a0a0a0;
}
</style>
<pb-page endpoint="http://localhost:8080/exist/apps/tei-publisher">
<pb-page endpoint="http://localhost:8080/exist/apps/tei-publisher"
url-doc="path|query" url-skip="lang," url-id="query|hash">
<div class="toolbar">
<pb-login id="login" group="tei"></pb-login>
<pb-lang label="language" selected="en">
Expand Down
2 changes: 1 addition & 1 deletion demo/pb-collapse.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
margin: 10px 20px;
}
</style>
<pb-page endpoint="http://localhost:8080/exist/apps/tei-publisher">
<pb-page endpoint="http://localhost:8080/exist/apps/tei-publisher" url-path="query">
<pb-document id="document1" path="test/osinski.xml" odd="osinski"></pb-document>
<pb-collapse toggles>
<div slot="collapse-trigger">Metadata</div>
Expand Down
2 changes: 1 addition & 1 deletion demo/pb-collapse2.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
margin: 10px 20px;
}
</style>
<pb-page endpoint="http://localhost:8080/exist/apps/tei-publisher">
<pb-page endpoint="http://localhost:8080/exist/apps/tei-publisher" url-path="query">
<pb-document id="document1" path="test/osinski.xml" odd="osinski"></pb-document>
<pb-collapse emit="meta">
<div slot="collapse-trigger">Metadata</div>
Expand Down
2 changes: 1 addition & 1 deletion demo/pb-combo-box.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<pb-demo-snippet>
<template>
<pb-page locales="../i18n/{{ns}}/{{lng}}.json" endpoint=".">
<h2>Using pb-multi-select with a standard HTML form</h2>
<h2>Using pb-combo-box with a standard HTML form</h2>
<form id="form" action="">
<fieldset>
<p>Select single option from a remote data source</p>
Expand Down
6 changes: 3 additions & 3 deletions demo/pb-document.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@
flex: 1 0;
}
</style>
<pb-page endpoint="http://localhost:8080/exist/apps/tei-publisher">
<pb-document id="document1" path="test/kant_rvernunft_1781.TEI-P5.xml" odd="dta" view="page"></pb-document>
<pb-page endpoint="http://localhost:8080/exist/apps/tei-publisher" url-path="query">
<pb-document id="document1" path="test/kant_rvernunft_1781.TEI-P5.xml" odd="dta" view="page" disable-history></pb-document>
<pb-document id="document2" path="doc/documentation.xml" odd="docbook" view="div"></pb-document>

<!-- Display two document views side by side -->
<main>
<pb-view id="view1" src="document1"></pb-view>
<pb-view id="view1" src="document1" disable-history></pb-view>
<pb-view id="view2" src="document2"></pb-view>
</main>
</pb-page>
Expand Down
2 changes: 1 addition & 1 deletion demo/pb-drawer.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
color: #222222;
}
</style>
<pb-page endpoint="http://localhost:8080/exist/apps/tei-publisher">
<pb-page endpoint="http://localhost:8080/exist/apps/tei-publisher" url-path="query">
<pb-document id="document1" path="test/kant_rvernunft_1781.TEI-P5.xml" odd="dta"></pb-document>
<div class="toolbar">
<paper-icon-button id="tocToggle" class="toc-toggle" icon="icons:view-list"></paper-icon-button>
Expand Down
2 changes: 1 addition & 1 deletion demo/pb-drawer2.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
content: ': ';
}
</style>
<pb-page endpoint="http://localhost:8080/exist/apps/tei-publisher">
<pb-page endpoint="http://localhost:8080/exist/apps/tei-publisher" url-path="query">
<pb-document id="document1" path="test//orlik_to_serafin.xml" odd="serafin"></pb-document>
<pb-progress></pb-progress>
<p>Disable popovers for names and places. Show the information in the drawer instead if a name is clicked.
Expand Down
2 changes: 1 addition & 1 deletion demo/pb-edit-app.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</head>

<body>
<pb-page endpoint="http://localhost:8080/exist/apps/tei-publisher">
<pb-page endpoint="http://localhost:8080/exist/apps/tei-publisher" url-path="query">
<pb-login group="tei"></pb-login>
<pb-edit-app></pb-edit-app>
</pb-page>
Expand Down
2 changes: 1 addition & 1 deletion demo/pb-facsimile-2.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
margin-right: 20px;
}
</style>
<pb-page endpoint="http://localhost:8080/exist/apps/tei-publisher">
<pb-page endpoint="http://localhost:8080/exist/apps/tei-publisher" url-path="query">
<pb-document id="document1" path="test/cortes_to_dantiscus.xml" odd="dantiscus"></pb-document>
<main>
<pb-facsimile base-uri="https://apps.existsolutions.com/cantaloupe/iiif/2/" default-zoom-level="0"
Expand Down
2 changes: 1 addition & 1 deletion demo/pb-facsimile.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
border-bottom: 1px solid #606060;
}
</style>
<pb-page endpoint="http://localhost:8080/exist/apps/tei-publisher">
<pb-page endpoint="http://localhost:8080/exist/apps/tei-publisher" url-path="query">
<!-- Display facsimile -->
<main>
<div>
Expand Down
2 changes: 1 addition & 1 deletion demo/pb-grid.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<body>
<pb-demo-snippet>
<template>
<pb-page endpoint="http://localhost:8080/exist/apps/tei-publisher">
<pb-page endpoint="http://localhost:8080/exist/apps/tei-publisher" url-path="query">
<pb-document id="document1" path="test/orlik_to_serafin.xml" odd="serafin" view="single"></pb-document>

<pb-grid-action action="add" class="grid-add" grid="#grid" initial="1">
Expand Down
2 changes: 1 addition & 1 deletion demo/pb-link.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
text-decoration: none;
}
</style>
<pb-page endpoint="http://localhost:8080/exist/apps/tei-publisher">
<pb-page endpoint="http://localhost:8080/exist/apps/tei-publisher" url-path="query">
<pb-document id="document1" path="test/graves6.xml" odd="graves"></pb-document>
<main>
<ul>
Expand Down
6 changes: 3 additions & 3 deletions demo/pb-load.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@
color: #222222;
}
</style>
<pb-page endpoint="http://localhost:8080/exist/apps/tei-publisher">
<pb-document id="document1" path="test/kant_rvernunft_1781.TEI-P5.xml" odd="dta"></pb-document>
<pb-page endpoint="http://localhost:8080/exist/apps/tei-publisher" url-path="query">
<pb-document id="document1" path="test/kant_rvernunft_1781.TEI-P5.xml" odd="dta" view="page"></pb-document>

<main>
<pb-load url="api/document/{doc}/contents?target=transcription&icons=true" expand src="document1" auto>Loading table of
contents...</pb-load>
<div class="transcription">
<pb-view src="document1" subscribe="transcription" view="page"></pb-view>
<pb-view src="document1" subscribe="transcription"></pb-view>
</div>
</main>
</pb-page>
Expand Down
2 changes: 1 addition & 1 deletion demo/pb-search.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
margin-right: 10px;
}
</style>
<pb-page endpoint="http://localhost:8080/exist/apps/tei-publisher">
<pb-page endpoint="http://localhost:8080/exist/apps/tei-publisher" url-path="query">
<pb-progress></pb-progress>
<main>
<pb-search id="search-form">
Expand Down
2 changes: 1 addition & 1 deletion demo/pb-search2.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
margin-right: 10px;
}
</style>
<pb-page endpoint="http://localhost:8080/exist/apps/tei-publisher">
<pb-page endpoint="http://localhost:8080/exist/apps/tei-publisher" url-path="query">
<pb-progress></pb-progress>
<main>
<pb-search id="search-form">
Expand Down
2 changes: 1 addition & 1 deletion demo/pb-search3.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
}

</style>
<pb-page endpoint="http://localhost:8080/exist/apps/tei-publisher">
<pb-page endpoint="http://localhost:8080/exist/apps/tei-publisher" url-path="query">
<pb-progress></pb-progress>
<main>
<h2>multi-select</h2>
Expand Down
4 changes: 2 additions & 2 deletions demo/pb-select-feature.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ <h1>Using pb-select-feature with pb-view</h1>
display: block;
}
</style>
<pb-page endpoint="http://localhost:8080/exist/apps/tei-publisher">
<pb-page endpoint="http://localhost:8080/exist/apps/tei-publisher" 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-view1" name="view1" label="View" items='[
{"name": "Diplomatic View", "properties": {"mode": "diplomatic", "view": "page"}},
{"name": "Normalized View", "properties": {"mode": "norm", "view": "single"}}
{"name": "Normalized View", "properties": {"mode": "norm", "view": "single", "root": null}}
]'></pb-select-feature>
<pb-navigation direction="backward" keyboard="left">
<paper-icon-button icon="icons:chevron-left"></paper-icon-button>
Expand Down
15 changes: 11 additions & 4 deletions demo/pb-select-feature2.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,25 @@ <h1>Using pb-select-feature without server reload</h1>
padding: 10px;
background-color: #E0E0E0;
}
.message {
display: none;
}
.message.toggle {
display: block;
}
pb-toggle-feature {
display: block;
}
</style>
<pb-page endpoint="http://localhost:8080/exist/apps/tei-publisher">
<pb-page endpoint="http://localhost:8080/exist/apps/tei-publisher" 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"}]},
{"name": "Normalized View", "selectors": [{"selector": ".choice,.choice-alternate,br", "state": true},{"selector": ".tei-foreign,pb-highlight,pb-popover", "command": "disable"}]},
{"name": "Plain Reading View", "selectors": [{"selector": ".choice,.choice-alternate,br", "state": true}, {"selector": ".tei-foreign,pb-highlight,pb-popover", "command": "disable", "state": true}]}
{"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">
Expand Down
4 changes: 2 additions & 2 deletions demo/pb-select-feature3.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ <h1>Using pb-select-feature with pb-load</h1>
color: #888888;
}
</style>
<pb-page endpoint="http://localhost:8080/exist/apps/tei-publisher">
<pb-page endpoint="http://localhost:8080/exist/apps/tei-publisher" url-path="query">
<pb-document id="document1" path="test/cortes_to_dantiscus.xml" odd="dantiscus"></pb-document>

<div class="toolbar">
Expand All @@ -63,7 +63,7 @@ <h1>Using pb-select-feature with pb-load</h1>
</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">Loading document ...</pb-load>
src="document1" auto subscribe="loader" emit="loader" history>Loading document ...</pb-load>
</main>
</pb-page>
</template>
Expand Down
6 changes: 3 additions & 3 deletions demo/pb-toggle-feature.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,17 @@ <h1>Using pb-toggle-feature with pb-view</h1>
display: block;
}
</style>
<pb-page endpoint="http://localhost:8080/exist/apps/tei-publisher">
<pb-page endpoint="http://localhost:8080/exist/apps/tei-publisher" url-path="query">
<pb-document id="document1" path="test/cortes_to_dantiscus.xml" odd="dantiscus"></pb-document>

<div class="toolbar">
<pb-toggle-feature name="highlight1" selector=".tei-foreign,pb-highlight,pb-popover"
<pb-toggle-feature name="plain" selector=".tei-foreign,pb-highlight,pb-popover"
action="disable" default="off">Plain Reading View</pb-toggle-feature>
<!-- pass a parameter 'mode'. pb-view will forward this to the ODD as a user-defined parameter-->
<pb-toggle-feature name="mode" on="diplomatic" off="norm">Diplomatic View</pb-toggle-feature>
<!-- directly change properties of the pb-view -->
<pb-toggle-feature name="view" on="page" off="single" default="off">Page View</pb-toggle-feature>
<pb-toggle-feature name="xpath" default="off"
<pb-toggle-feature name="translation" default="off"
properties-on='{"xpath": "//text[@type=&apos;translation&apos;]", "odd": "teipublisher", "nodeId": null, "view": "single"}'
properties-off='{"xpath": "//text[@type=&apos;source&apos;]", "odd": "dantiscus"}'>
Translation
Expand Down
6 changes: 3 additions & 3 deletions demo/pb-toggle-feature2.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ <h1>Toggling features without content reload</h1>
display: block;
}
</style>
<pb-page endpoint="http://localhost:8080/exist/apps/tei-publisher">
<pb-page endpoint="http://localhost:8080/exist/apps/tei-publisher" url-path="query">
<pb-document id="document2" path="test/cortes_to_dantiscus.xml" odd="dantiscus"></pb-document>
<div class="toolbar">
<pb-toggle-feature name="highlight2" selector=".tei-foreign,pb-highlight,pb-popover"
<pb-toggle-feature name="plain" selector=".tei-foreign,pb-highlight,pb-popover"
action="disable" default="off" emit="ex2" subscribe="ex2">Plain Reading View</pb-toggle-feature>
<pb-toggle-feature name="norm2" selector=".choice,.choice-alternate,br" emit="ex2" subscribe="ex2">
<pb-toggle-feature name="norm" selector=".choice,.choice-alternate,br" emit="ex2" subscribe="ex2">
Normalized View</pb-toggle-feature>
<!-- Navigate to previous page -->
<pb-navigation direction="backward" keyboard="left" emit="ex2" subscribe="ex2">
Expand Down
6 changes: 3 additions & 3 deletions demo/pb-toggle-feature3.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,19 @@ <h1>Using pb-toggle-feature with pb-load</h1>
color: #888888;
}
</style>
<pb-page endpoint="http://localhost:8080/exist/apps/tei-publisher">
<pb-page endpoint="http://localhost:8080/exist/apps/tei-publisher" url-path="query">
<pb-document id="document3" path="test/cortes_to_dantiscus.xml" odd="dantiscus"></pb-document>

<div class="toolbar">
<!-- pass a parameter 'mode'. pb-view will forward this to the ODD as a user-defined parameter -->
<!-- note that we have to prefix the parameter with 'user.' because that's how components.xql expects it -->
<pb-toggle-feature id="toggle2" emit="loader" subscribe="loader" name="user.mode"
on="diplomatic" off="norm" default="on">Diplomatic View</pb-toggle-feature>
on="diplomatic" off="norm" default="diplomatic">Diplomatic View</pb-toggle-feature>
</div>
<main>
<!-- call components.xql to retrieve the full source text -->
<pb-load url="api/parts/{doc}/html?xpath=//text[@type='source']&view=single" expand
src="document3" auto subscribe="loader" emit="loader">Loading document ...</pb-load>
src="document3" auto subscribe="loader" emit="loader" history="history">Loading document ...</pb-load>
</main>
</pb-page>
</template>
Expand Down
Loading