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

Icon fixes #453

Merged
merged 3 commits into from
Jul 16, 2024
Merged
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
43 changes: 37 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -351,14 +351,45 @@ no options

##### Annotations

| Name | Type | Default | Description |
|-------------------------|------------------------|--------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| types | AnnotationTypeConfig[] | `[]` | Defines annotation types that should be displayed in this view. The Annotation API response will then be filtered according to this config. |
| types[i].name | String | `null` | Specifies the name which corresponds to the `x-content-type` property from annotations response. |
| types[i].index | String | `null` | Specifies the index name that should be used in the annotation item. TIDO uses Bootstrap Icons, please lookup the allowed values [here](https:/quasarframework/quasar/blob/dev/extras/bootstrap-icons/icons.json) |
| types[i].displayWhen | String | `null` | Text content type that was specified under [Text options](#text). Annotation will only be shown if that content type is currently active. |
| Name | Type | Default | Description |
|-------------------------|------------------------|--------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| types | AnnotationTypeConfig[] | `[]` | Defines annotation types that should be displayed in this view. The Annotation API response will then be filtered according to this config. |
| types[i].name | String | `null` | Specifies the name which corresponds to the `x-content-type` property from annotations response. |
| types[i].icon | String | `null` | Specifies an icon that is displayed on the left of the annotation item. Currently we provide only a fixed list of possible icons. [here](#icons) |
| types[i].index | String | `null` | Specifies the index name that should be used in the annotation item. TIDO uses Bootstrap Icons, please lookup the allowed values [here](https:/quasarframework/quasar/blob/dev/extras/bootstrap-icons/icons.json) |
| types[i].displayWhen | String | `null` | Text content type that was specified under [Text options](#text). Annotation will only be shown if that content type is currently active. |
| types[i].annotationType | String | `annotation` | Controls the look of the annotation item. Allowed values: `annotation` or `text`. Currently the only difference is that there is no index at type `text`. |

###### Icons

Below you can find a list of icons that can be used for annotation items. Please use these as values for the `icon`
configuration option at annotations.
- archive
- arrowLeft
- arrowRight
- bank
- book
- chat
- check
- code
- dropdown
- externalLink
- fullscreen
- info
- journals
- marker
- minus
- moon
- pen
- pencil
- person
- reset
- sun
- translate
- warning
- zoomIn
- zoomOut

## Methods

The instantiated TIDO Object exposes methods to control TIDO's behaviour programmatically.
Expand Down
16 changes: 8 additions & 8 deletions examples/gfl.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
}

window.addEventListener('load', function () {
const tido = new Tido({
new Tido({
manifest: "https://goethes-farbenlehre-berlin.sub.uni-goettingen.de/textapi/Z_1822-02-20_k/manifest.json",
labels: {
item: "Seite",
Expand Down Expand Up @@ -96,7 +96,7 @@
types: [
{
name: "Editorial Comment",
icon: "biChatFill"
icon: "chat"
},
{
name: "Abstract",
Expand All @@ -116,27 +116,27 @@
types: [
{
name: "Person",
icon: "biPersonFill"
icon: "person"
paulpestov marked this conversation as resolved.
Show resolved Hide resolved
},
{
name: "Place",
icon: "biGeoAltFill"
icon: "marker"
},
{
name: "Org",
icon: "biBank2"
icon: "bank"
},
{
name: "Object",
icon: "biArchiveFill"
icon: "archive"
},
{
name: "Date",
icon: "biCalendarWeek"
icon: "calendar"
},
{
name: "Work",
icon: "biJournals"
icon: "journals"
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion src/utils/annotations.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const createSvgIcon = (name) => {
figure.classList.add(`icon-${name}`);
style.innerHTML = `
.icon-${name}::after {
content: url('data:image/svg+xml; utf8, ${iconString}');
content: url('data:image/svg+xml; utf8, ${iconString}') !important;
}
`;
figure.appendChild(style);
Expand Down