Introduced text type to VC and improve test suite
Change-Id: Ic51f3de112af5ec8d35bbae3bd97e988dbdb1a47
diff --git a/dev/js/src/vc/array.js b/dev/js/src/vc/array.js
index 9c7bf4d..8a47a3d 100644
--- a/dev/js/src/vc/array.js
+++ b/dev/js/src/vc/array.js
@@ -2,19 +2,19 @@
return [
// layerInfo // stored
// tokenSource // stored
- ['author', 'string'], // text
+ ['author', 'text'], // text
// ['biblEditionStatement', 'string'], // stored
- ['corpusAuthor', 'string'], // text
+ ['corpusAuthor', 'text'], // text
// ['corpusEditor', 'string'], // stored
['corpusSigle', 'string'], // string
- ['corpusSubTitle', 'string'], // text
- ['corpusTitle', 'string'], // text
+ ['corpusSubTitle', 'text'] , // text
+ ['corpusTitle', 'text'], // text
['creationDate', 'date'], // int
- ['docAuthor', 'string'], // text
+ ['docAuthor', 'text'], // text
// ['docEditor', 'string'], // stored
['docSigle', 'string'], // string
- ['docSubTitle', 'string'], // text
- ['docTitle', 'string'], // text
+ ['docSubTitle', 'text'], // text
+ ['docTitle', 'text'], // text
// ['editor', 'string'], // stored
// ['fileEditionStatement', 'string'], // stored
['foundries', 'string'], // keywords
@@ -26,7 +26,7 @@
// ['publisher', 'string'], // stored
['pubPlace', 'string'], // string
// ['reference', 'string'], // stored
- ['subTitle', 'string'], // text
+ ['subTitle', 'text'], // text
['textClass', 'string'], // keyword
['textColumn', 'string'], // string
['textDomain', 'string'], // string
@@ -34,6 +34,6 @@
['textType', 'string'], // string
['textTypeArt', 'string'], // string
['textTypeRef', 'string'], // string
- ['title', 'string'] // text
+ ['title', 'text'] // text
]
});
diff --git a/dev/js/src/vc/doc.js b/dev/js/src/vc/doc.js
index f3e5559..f173de8 100644
--- a/dev/js/src/vc/doc.js
+++ b/dev/js/src/vc/doc.js
@@ -9,7 +9,6 @@
'util'
], function (jsonldClass, rewriteListClass, stringValClass) {
- _validRegexMatchRE = new RegExp("^(?:eq|ne)$");
const loc = KorAP.Locale;
loc.EMPTY = loc.EMPTY || '⋯';
@@ -253,7 +252,7 @@
// Try to create a regular expression
var check = new RegExp(json["value"]);
- if (!_validRegexMatchRE.test(this.matchop())) {
+ if (!KorAP._validStringMatchRE.test(this.matchop())) {
KorAP.log(802, "Match type is not supported by value type");
// Rewrite method
diff --git a/dev/js/src/vc/item.js b/dev/js/src/vc/item.js
index d2c6fc1..f9267e8 100644
--- a/dev/js/src/vc/item.js
+++ b/dev/js/src/vc/item.js
@@ -80,7 +80,8 @@
// Create list item
var li = document.createElement("li");
- li.setAttribute("data-type", this._type);
+ if (this._type)
+ li.setAttribute("data-type", this._type);
li.setAttribute("data-key", this._key);
// Connect action
diff --git a/dev/js/src/vc/unspecified.js b/dev/js/src/vc/unspecified.js
index daa7c88..0395685 100644
--- a/dev/js/src/vc/unspecified.js
+++ b/dev/js/src/vc/unspecified.js
@@ -120,7 +120,6 @@
// Get the key menu
var menu = KorAP._vcKeyMenu;
-
// Add key menu element at the correct position
this._element.insertBefore(
menu.element(),