Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
paulpestov committed Jan 9, 2025
2 parents 78c114a + b697eba commit 589543d
Show file tree
Hide file tree
Showing 22 changed files with 545 additions and 317 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ There are options to
},
{
"label": "text",
"width": 1.5,
"views": [
{
"id": "text1",
Expand Down Expand Up @@ -297,6 +298,7 @@ There are options to
| panels[i].views | ViewConfig[] | ↓ | Defines an array of views inside of a panel. If there are multiple views, we display them in tabs. If there is only one view we omit the tabs and display the view directly inside the panel. |
| panels[i].views[j].id | String | `view-j` | Unique identifier for the view across the app. |
| panels[i].views[j].label | String | `View j` | Sets the label which appears in the tab header. If there is only one view then this label will be displayed as panel header label. Translatable. |
| panels[i].views[j].width | Number | 1 | Defines a width multiplier to a panel default width. Values between 1 and 10 are allowed. Float values allowed. Causes horizontal overflow. Ignored on mobile screens since the default width takes the whole screen width. |
| panels[i].views[j].default | Boolean | `false` | Specifies whether this view should be visible at the initial start of the app. If no `default` keys provided on views or all `default` keys are set to `false`, then the first view will be considered as default. |
| panels[i].views[j].connector | Object | ↓ | Defines which view component and its options. Each view can have its own arbitrary config options. |
| panels[i].views[j].connector.id | Number | null | Defines the component id which will be rendered dynamically for this view. See view connectors. |
Expand Down
340 changes: 176 additions & 164 deletions examples/ahiqar-arabic-karshuni-local.html
Original file line number Diff line number Diff line change
@@ -1,175 +1,187 @@
<!DOCTYPE html>
<html>
<head><title>TIDO</title>
<meta charset="utf-8">
<meta name="description" content="">
<meta name="format-detection" content="telephone=no">
<meta name="msapplication-tap-highlight" content="no">
<meta name="viewport" content="initial-scale=1,maximum-scale=5,minimum-scale=1,width=device-width">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<link rel="stylesheet" href="dist/tido.css">
<style>
html, body {
margin: 0;
}
#app {
height: 100vh;
}
</style>
</head>
<body>
<noscript><strong>We're sorry but TIDO doesn't work properly without JavaScript enabled. Please enable it to
continue.</strong></noscript>
<head>
<title>TIDO</title>
<meta charset="utf-8" />
<meta name="description" content="" />
<meta name="format-detection" content="telephone=no" />
<meta name="msapplication-tap-highlight" content="no" />
<meta
name="viewport"
content="initial-scale=1,maximum-scale=5,minimum-scale=1,width=device-width"
/>
<link rel="icon" type="image/x-icon" href="favicon.ico" />
<link rel="stylesheet" href="dist/tido.css" />
<style>
html,
body {
margin: 0;
}
#app {
height: 100vh;
}
</style>
</head>
<body>
<noscript
><strong
>We're sorry but TIDO doesn't work properly without JavaScript enabled.
Please enable it to continue.</strong
></noscript
>

<div id="app"></div>
<script src="dist/tido.js"></script>
<script>
window.addEventListener('load', function () {
window.tido = new window.Tido({
"collection": "http://localhost:8181/ahiqar/textapi/ahiqar/arabic-karshuni/collection.json",
"labels": {
"item": "Sheet",
"manifest": "Manuscript"
},
"colors": {
"forceMode": "light",
"primary": "#1a3771"
},
"panels": [
{
"label": "contents_and_metadata",
"views": [
{
"id": "tree",
"label": "contents",
"connector": {
"id": 1
}
<div id="app"></div>
<script src="dist/tido.js"></script>
<script>
window.addEventListener("load", function () {
window.tido = new window.Tido({
collection:
"http://localhost:8181/ahiqar/textapi/ahiqar/arabic-karshuni/collection.json",
labels: {
item: "Sheet",
manifest: "Manuscript",
},
colors: {
forceMode: "light",
primary: "#1a3771",
},
{
"id": "metadata",
"label": "metadata",
"connector": {
"id": 2,
"options": {
"collection": {
"all": true
panels: [
{
label: "contents_and_metadata",
views: [
{
id: "tree",
label: "contents",
connector: {
id: 1,
},
},
"manifest": {
"all": true
{
id: "metadata",
label: "metadata",
connector: {
id: 2,
options: {
collection: {
all: true,
},
manifest: {
all: true,
},
item: {
all: true,
},
citationKey: "Citation",
},
},
},
"item": {
"all": true
}
}
}
}
]
},
{
"label": "image",
"views": [
{
"id": "image",
"label": "Image",
"connector": {
"id": 3
}
}]
},
{
"label": "text",
"views": [
{
"id": "text1",
"label": "Transcription",
"default": true,
"connector": {
"id": 4,
"options": {
"type": "transcription"
}
}
},
{
"id": "text2",
"label": "Transliteration",
"connector": {
"id": 4,
"options": {
"type": "transliteration"
}
}
}
]
},
{
"label": "annotations",
"views": [
{
"id": "annotations1",
"label": "Editorial",
"connector": {
"id": 5,
"options": {
"types": [
{
"name": "Person",
"icon": "person"
],
},
{
label: "image",
views: [
{
id: "image",
label: "Image",
connector: {
id: 3,
},
{
"name": "Place",
"icon": "marker"
},
],
},
{
label: "text",
views: [
{
id: "text1",
label: "Transcription",
default: true,
connector: {
id: 4,
options: {
type: "transcription",
},
},
{
"name": "Editorial Comment",
"icon": "chat"
},
{
id: "text2",
label: "Transliteration",
connector: {
id: 4,
options: {
type: "transliteration",
},
},
{
"name": "Reference",
"icon": "externalLink"
}
]
}
}
},
{
"id": "annotations2",
"label": "Motif",
"connector": {
"id": 5,
"options": {
"types": [
{
"name": "Motif",
"icon": "pen"
}
]
}
}
},
],
},
{
label: "annotations",
views: [
{
id: "annotations1",
label: "Editorial",
connector: {
id: 5,
options: {
types: [
{
name: "Person",
icon: "person",
},
{
name: "Place",
icon: "marker",
},
{
name: "Editorial Comment",
icon: "chat",
},
{
name: "Reference",
icon: "externalLink",
},
],
},
},
},
{
id: "annotations2",
label: "Motif",
connector: {
id: 5,
options: {
types: [
{
name: "Motif",
icon: "pen",
},
],
},
},
},
{
id: "annotations3",
label: "Variants",
connector: {
id: 6,
},
},
],
},
],
translations: {
en: {
contents_and_metadata: "Contents & Metadata",
next_item: "Next Sheet",
previous_item: "Previous Sheet",
next_manifest: "Next Manuscript",
previous_manifest: "Previous Manuscript",
item: "Sheet",
},
},
{
"id": "annotations3",
"label": "Variants",
"connector": {
"id": 6
}
}
]
}
],
"translations": {
"en": {
"contents_and_metadata": "Contents & Metadata",
"next_item": "Next Sheet",
"previous_item": "Previous Sheet",
"next_manifest": "Next Manuscript",
"previous_manifest": "Previous Manuscript",
"item": "Sheet"
}
}
});
});
</script>
</body>
});
});
</script>
</body>
</html>
Loading

0 comments on commit 589543d

Please sign in to comment.