summaryrefslogtreecommitdiff
path: root/ext/data
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2022-03-17 19:01:59 -0400
committerGitHub <noreply@github.com>2022-03-17 19:01:59 -0400
commit7a2ab866099edffaba471ad808593f67ee796b21 (patch)
treeddfe746ed76e16d80e0ac6e3029e2bc1049544d2 /ext/data
parent8aa060337cea2bb8fce7864d509d07df4688f1c2 (diff)
Structured content links (#2089)
* Update CSS to JSON converter to generalize the remove-property comment * Fix navigation not being updated when _clearContent is run * Add structured content schema for link tags * Add test links * Add external-link icon * Pass Display instance to DisplayContentManager * Update structured content generation * Update link styles
Diffstat (limited to 'ext/data')
-rw-r--r--ext/data/schemas/dictionary-term-bank-v3-schema.json23
-rw-r--r--ext/data/structured-content-style.json6
2 files changed, 29 insertions, 0 deletions
diff --git a/ext/data/schemas/dictionary-term-bank-v3-schema.json b/ext/data/schemas/dictionary-term-bank-v3-schema.json
index 9898a15e..268a2c11 100644
--- a/ext/data/schemas/dictionary-term-bank-v3-schema.json
+++ b/ext/data/schemas/dictionary-term-bank-v3-schema.json
@@ -185,6 +185,29 @@
"enum": ["px", "em"]
}
}
+ },
+ {
+ "type": "object",
+ "description": "Link tag.",
+ "required": [
+ "tag",
+ "href"
+ ],
+ "additionalProperties": false,
+ "properties": {
+ "tag": {
+ "type": "string",
+ "const": "a"
+ },
+ "content": {
+ "$ref": "#/definitions/structuredContent"
+ },
+ "href": {
+ "type": "string",
+ "description": "The URL for the link. URLs starting with a ? are treated as internal links to other dictionary content.",
+ "pattern": "^(?:https?:|\\?)[\\w\\W]*"
+ }
+ }
}
]
}
diff --git a/ext/data/structured-content-style.json b/ext/data/structured-content-style.json
index ae216abd..fe222486 100644
--- a/ext/data/structured-content-style.json
+++ b/ext/data/structured-content-style.json
@@ -294,6 +294,12 @@
]
},
{
+ "selectors": [".gloss-link-external-icon"],
+ "styles": [
+ ["display", "none"]
+ ]
+ },
+ {
"selectors": [".gloss-sc-table-container"],
"styles": [
["display", "block"]