Circumvent value checking on dates when newly created in VC builder
Change-Id: Idcf378960d863a3072213d7070c7ac75876438db
diff --git a/dev/js/src/vc/doc.js b/dev/js/src/vc/doc.js
index 41b72ad..bdedb70 100644
--- a/dev/js/src/vc/doc.js
+++ b/dev/js/src/vc/doc.js
@@ -34,6 +34,10 @@
upgradeTo(this).
fromJson(json);
+ if (obj === undefined) {
+ console.log(json);
+ };
+
// Bind the parent
if (parent !== undefined)
obj._parent = parent;
@@ -209,6 +213,7 @@
// Check the VC list if the field is known
var type = KorAP._vcKeyMenu.typeOf(this.key());
if (type != undefined) {
+ console.log("Guessed the type for " + this.key() + " to be " + type);
json["type"] = "type:" + type;
};
};
diff --git a/dev/js/src/vc/unspecified.js b/dev/js/src/vc/unspecified.js
index 0395685..56d0869 100644
--- a/dev/js/src/vc/unspecified.js
+++ b/dev/js/src/vc/unspecified.js
@@ -41,12 +41,9 @@
return null;
// Set JSON-LD type
- var newDoc = docClass.create(this._parent, {
- "@type" : "koral:doc",
- "value" : "",
- "key" : v
- });
-
+ var newDoc = docClass.create(this._parent);
+ newDoc.key(v);
+
// Unspecified document on root
if (this._parent.ldType() === null) {
this._parent.root(newDoc);
@@ -120,6 +117,7 @@
// Get the key menu
var menu = KorAP._vcKeyMenu;
+
// Add key menu element at the correct position
this._element.insertBefore(
menu.element(),