accurator/commit

Added example annotation ui.

authorChris Dijkshoorn
Mon Jun 13 13:24:11 2016 +0200
committerChris Dijkshoorn
Mon Jun 13 13:24:11 2016 +0200
commitf192e3d6251261b55df40503af1e2ab8864f3197
treeb571ac811419fb573ee8e597a3f23bb11c302b36
parent504909790a06d2abba44bfe34a1a8ac115bd23d7
Diff style: patch stat
diff --git a/rdf/domain/domain.ttl b/rdf/domain/domain.ttl
index f22a384..908cb24 100644
--- a/rdf/domain/domain.ttl
+++ b/rdf/domain/domain.ttl
@@ -1,6 +1,7 @@
 @prefix accu:   <http://accurator.nl/schema#> .
 @prefix agen:   <http://accurator.nl/generic#> .
 @prefix aui:    <http://accurator.nl/ui/generic#> .
+@prefix aagen:  <http://accurator.nl/ui/annotation/generic#> .
 @prefix auis:   <http://accurator.nl/ui/schema#> .
 @prefix ic:     <http://iconclass.org/> .
 @prefix rdf:    <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@@ -14,7 +15,7 @@ agen:domain a accu:Domain ;
 	accu:hasLabel aui:label ;
 	accu:hasTarget <http://accurator.nl/generic#Target> ;
 	accu:hasUI aui: ;
-	accu:hasAnnotationUI agen:genericUI ;
+	accu:hasAnnotationUI aagen:genericUI ;
 	accu:hasDescriptiveImage agen:mountain .
 
 aui:label auis:textLabel "Generic domain"@en ,
diff --git a/rdf/ui/fields.ttl b/rdf/ui/fields.ttl
new file mode 100644
index 0000000..9898a00
--- /dev/null
+++ b/rdf/ui/fields.ttl
@@ -0,0 +1,29 @@
+@prefix aagen:  <http://accurator.nl/ui/annotation/generic#> .
+@prefix auis:   <http://accurator.nl/ui/schema#> .
+@prefix rdf:    <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs:   <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix dcterms:<http://purl.org/dc/terms/> .
+@prefix skos:   <http://www.w3.org/2004/02/skos/core#> .
+
+# Minimal example ui for generic domain
+
+aagen:genericUI a auis:AnnotationUI ;
+    dcterms:title "Minimal generic domain"@en ;
+    auis:wholeFields (
+        aagen:textWhole
+	);
+	auis:fragmentFields (
+		aagen:textFragment
+	 ) .
+
+aagen:textWhole a auis:DropdownField ;
+	rdfs:label "Description"@en ;
+	rdfs:label "Beschrijving"@nl ;
+	dcterms:comment "add description of artwork"@en ;
+	dcterms:comment "beschrijf het kunstwerk"@nl .
+
+aagen:textFragment a auis:DropdownField ;
+    rdfs:label "Description"@en ;
+    rdfs:label "Beschrijving"@nl ;
+    dcterms:comment "add description of artwork fragment"@en ;
+	dcterms:comment "beschrijf het kunstwerk gedeelte"@nl .
diff --git a/rdf/void.ttl b/rdf/void.ttl
index 128cc86..c736064 100644
--- a/rdf/void.ttl
+++ b/rdf/void.ttl
@@ -21,7 +21,8 @@
 	dcterms:title "Locale and domain agnostic Accurator UI instance" ;
 	lib:source <http://accurator.nl/> ;
 	void:dataDump <ui/labels.ttl> ,
-	 			  <ui/labels_nl.ttl> .
+	 			  <ui/labels_nl.ttl> ,
+				  <ui/fields.ttl> .
 
 <accurator-ui-countries>
 	a void:Dataset ;
diff --git a/web/js/components/field.js b/web/js/components/field.js
index 04f3381..0d058fc 100644
--- a/web/js/components/field.js
+++ b/web/js/components/field.js
@@ -54,8 +54,11 @@ Field.prototype.initDropdown = function() {
 		$(this.node).append(this.annotationList.node);
 	}
 
-	// three sitations for obtaining and adding alternatives array
-	if(this.source instanceof Array) {
+	// four sitations for obtaining and adding alternatives array
+	if (!this.souce) {
+		// 0. only add listerens in case no source is specified
+		this.addDropdownListeners();
+	} else if (this.source instanceof Array) {
 		// 1.  source is an array containing alternatives for dropdown
 		this.alternatives = this.source;
 		this.addTypeAhead();