@@ -48,6 +58,7 @@ DataRef.propTypes = {
member: PropTypes.object.isRequired,
memberType: PropTypes.string.isRequired,
datatype: PropTypes.string.isRequired,
+ rngContent: PropTypes.bool,
available: PropTypes.bool,
restriction: PropTypes.string,
attribute: PropTypes.string,
diff --git a/src/components/DatatypeContent.js b/src/components/DatatypeContent.js
index 61090cd..c2c00d1 100644
--- a/src/components/DatatypeContent.js
+++ b/src/components/DatatypeContent.js
@@ -3,6 +3,7 @@ import PropTypes from 'prop-types'
import DataRef from './DataRef'
import ValList from './ValList'
import { _i18n } from '../localization/i18n'
+import Rng from './Rng'
export default class DatatypeContent extends Component {
constructor(props) {
@@ -32,6 +33,14 @@ export default class DatatypeContent extends Component {
let contentType = null
let grouping = null
if (content[0]) {
+ if (content[0].type === 'rng') {
+ return (
)
+ }
contentType = content[0].type !== 'sequence' && content[0].type !== 'alternate' ? null : content[0].type
// Go down to sequence or alternate if needed.
// We assume there is only one level, though more are possible.
diff --git a/src/components/Rng.js b/src/components/Rng.js
new file mode 100644
index 0000000..04d8f65
--- /dev/null
+++ b/src/components/Rng.js
@@ -0,0 +1,61 @@
+import React, { Component } from 'react'
+import PropTypes from 'prop-types'
+import AceEditor from 'react-ace'
+import ReactResizeDetector from 'react-resize-detector'
+import { _i18n } from '../localization/i18n'
+
+import 'brace/mode/xml'
+import 'brace/theme/tomorrow'
+
+export default class Rng extends Component {
+ constructor(props) {
+ super(props)
+ }
+
+ onResize() {
+ this.ace.editor.resize()
+ }
+
+ render() {
+ const i18n = _i18n(this.props.language, 'Rng')
+ return (
+
{
+
+
+ {i18n('RelaxNG elements cannot be edited in Roma.')}
+
+
{ ae ? this.ace = ae : null }}
+ mode="xml"
+ theme="tomorrow"
+ name={`ace_rng`}
+ fontSize={14}
+ showPrintMargin={false}
+ showGutter
+ value={this.props.rngContent}
+ height="100px"
+ width="80%"
+ readOnly
+ editorProps={{
+ $blockScrolling: Infinity
+ }}/>
+ {this.onResize()}} />
+
+ }
+
+ )
+ }
+}
+
+// Omitting desc delete button for now until different languages get implemented.
+/*
+
+ { this.props.delete(pos) }}>clear
+
+*/
+
+Rng.propTypes = {
+ rngContent: PropTypes.string.isRequired,
+ language: PropTypes.string.isRequired
+}
diff --git a/src/localization/i18n.json b/src/localization/i18n.json
index a66f545..4d56e32 100644
--- a/src/localization/i18n.json
+++ b/src/localization/i18n.json
@@ -2020,5 +2020,15 @@
"pt-notchecked": "Gerado com a versão RomaJS",
"zh-notchecked": "用RomaJS版本生成的"
}
+ },
+ "Rng": {
+ "RelaxNG elements cannot be edited in Roma.": {
+ "it": "Gli elementi RelaxNG non possono essere modificati con Roma.",
+ "fr-notchecked": "Les éléments RelaxNG ne peuvent pas être modifiés avec Roma.",
+ "es-notchecked": "Los elementos RelaxNG no pueden editarse con Roma.",
+ "de-notchecked": "RelaxNG-Elemente können nicht mit Roma bearbeitet werden.",
+ "pt-notchecked": "Os elementos RelaxNG não podem ser editados com Roma.",
+ "zh-notchecked": "RelaxNG 元素無法使用Roma編輯。"
+ }
}
}
diff --git a/src/reducers/index.js b/src/reducers/index.js
index db2011e..9c95359 100644
--- a/src/reducers/index.js
+++ b/src/reducers/index.js
@@ -120,12 +120,12 @@ function customization(state = {
msg = i18n('This does not appear to be a TEI document.')
throw Error(msg)
}
- for (const el of Array.from(schemaSpec.getElementsByTagNameNS('http://relaxng.org/ns/structure/1.0', '*'))) {
- if (!el.closest('egXML')) {
- msg = i18n('ODD Documents with RELAX NG elements are not supported.')
- throw Error(msg)
- }
- }
+ // for (const el of Array.from(schemaSpec.getElementsByTagNameNS('http://relaxng.org/ns/structure/1.0', '*'))) {
+ // if (!el.closest('egXML')) {
+ // msg = i18n('ODD Documents with RELAX NG elements are not supported.')
+ // throw Error(msg)
+ // }
+ // }
let hasSource = false
for (const el of Array.from(schemaSpec.getElementsByTagNameNS('http://www.tei-c.org/ns/1.0', '*'))) {
if (!el.closest('egXML') && el.getAttribute('source')) {
diff --git a/src/utils/urls.js b/src/utils/urls.js
index 61a790d..97d1552 100644
--- a/src/utils/urls.js
+++ b/src/utils/urls.js
@@ -5,8 +5,11 @@
Set custom URLs values here.
*/
-export const TEIGARAGE_PROTOCOL = 'https'
-export const TEIGARAGE_LOCATION = 'teigarage.tei-c.org'
+// export const TEIGARAGE_PROTOCOL = 'https'
+// export const TEIGARAGE_LOCATION = 'teigarage.tei-c.org'
+
+export const TEIGARAGE_PROTOCOL = 'http'
+export const TEIGARAGE_LOCATION = 'localhost:8080'
export const DATASOURCES_PROTOCOL = 'https'
export const DATASOURCES_LOCATION = 'tei-c.org/Vault/P5/current/xml/tei/odd'