Fixed mirroring - made collections work
diff --git a/dev/js/src/init.js b/dev/js/src/init.js
index 4e37a9b..0e49091 100644
--- a/dev/js/src/init.js
+++ b/dev/js/src/init.js
@@ -5,6 +5,7 @@
'tutorial',
'lib/domReady',
'hint/array',
+ 'vc/array',
'lib/alertify',
'api',
'mailToChiffre',
@@ -16,6 +17,7 @@
tutClass,
domReady,
hintArray,
+ vcArray,
alertifyClass) {
// Set hint array for hint helper
@@ -62,12 +64,17 @@
vcname = document.createElement('span');
vcname.setAttribute('id', 'vc-choose');
+ var currentVC = loc.VC_allCorpora;
+ if (KorAP.koralQuery !== undefined && KorAP.koralQuery["collection"]) {
+ currentVC = loc.VC_oneCollection;
+ };
+
vcname.appendChild(
document.createTextNode(
- document.getElementById('vc-name').value ||
- (KorAP.currentVC !== undefined) ? loc.VC_oneCollection : loc.VC_allCorpora
+ document.getElementById('vc-name').value || currentVC
)
);
+
input.parentNode.insertBefore(vcname, input);
};
@@ -133,7 +140,7 @@
// The vc is not visible
else {
if (vc === undefined)
- vc = _getCurrentVC(vcClass);
+ vc = _getCurrentVC(vcClass, vcArray);
view.appendChild(vc.element());
this.classList.add('active');
};
@@ -164,18 +171,20 @@
obj.tutorial.initDocLinks(document);
// There is a currentQuery
- if (KorAP.currentQuery !== undefined) {
+ /*
+ if (KorAP.koralQuery !== undefined) {
var kq = document.createElement('div');
kq.setAttribute('id', 'koralquery');
var kqInner = document.createElement('div');
kq.appendChild(kqInner);
- kqInner.innerHTML = JSON.stringify(KorAP.currentQuery, null, ' ');
+ kqInner.innerHTML = JSON.stringify(KorAP.koralQuery, null, ' ');
hljs.highlightBlock(kqInner);
var sb = document.getElementById('search');
sb.insertBefore(kq, sb.firstChild);
};
+ */
/**
* Add VC creation on submission.
@@ -184,7 +193,7 @@
if (form !== undefined) {
form.addEventListener('submit', function (e) {
if (vc === undefined)
- vc = _getCurrentVC(vcClass);
+ vc = _getCurrentVC(vcClass, vcArray);
if (vc !== undefined)
input.value = vc.toQuery();
@@ -205,18 +214,11 @@
});
// Render Virtual collection
-// TODO:: Use currentQuery!!!
-function _getCurrentVC (vcClass) {
- var vc = vcClass.create([
- ['title', 'string'],
- ['subTitle', 'string'],
- ['pubDate', 'date'],
- ['author', 'string'],
- ['corpusID', 'string']
- ]);
- if (KorAP.currentVC !== undefined)
- vc.fromJson(KorAP.currentVC);
-
+function _getCurrentVC (vcClass, vcArray) {
+ var vc = vcClass.create(vcArray);
+ if (KorAP.koralQuery !== undefined && KorAP.koralQuery["collection"]) {
+ vc.fromJson(KorAP.koralQuery["collection"]);
+ };
return vc;
};
diff --git a/dev/js/src/loc/de.js b/dev/js/src/loc/de.js
index a9eb389..fce90a1 100644
--- a/dev/js/src/loc/de.js
+++ b/dev/js/src/loc/de.js
@@ -5,10 +5,13 @@
// EMPTY, DELETE
// Virtual collection:
+ /*
loc.VC_subTitle = 'Untertitel';
loc.VC_title = 'Titel';
loc.VC_pubDate = 'Veröffentlichungsdatum';
loc.VC_pubPlace = 'Veröffentlichungsort';
+ */
+
loc.VC_allCorpora = 'allen Korpora';
loc.VC_oneCollection = 'einer Kollektion';
diff --git a/dev/js/src/vc/array.js b/dev/js/src/vc/array.js
new file mode 100644
index 0000000..6473a48
--- /dev/null
+++ b/dev/js/src/vc/array.js
@@ -0,0 +1,36 @@
+define(function () {
+ return [
+ ['author', 'string'],
+ ['biblEditionStatement', 'string'],
+ ['corpusAuthor', 'string'],
+ ['corpusEditor', 'string'],
+ ['corpusSigle', 'string'],
+ ['corpusSubTitle', 'string'],
+ ['corpusTitle', 'string'],
+ ['creationDate', 'date'],
+ ['docAuthor', 'string'],
+ ['docEditor', 'string'],
+ ['docSigle', 'string'],
+ ['docSubTitle', 'string'],
+ ['docTitle', 'string'],
+ ['editor', 'string'],
+ ['fileEditionStatement', 'string'],
+ ['keywords', 'string'],
+ ['language', 'string'],
+ ['license', 'string'],
+ ['pages', 'string'],
+ ['pubDate', 'date'],
+ ['publisher', 'string'],
+ ['pubPlace', 'date'],
+ ['reference', 'string'],
+ ['subTitle', 'string'],
+ ['textClass', 'string'],
+ ['textColumn', 'string'],
+ ['textDomain', 'string'],
+ ['textSigle', 'string'],
+ ['textType', 'string'],
+ ['textTypeArt', 'string'],
+ ['textTypeRef', 'string'],
+ ['title', 'string']
+ ]
+});
diff --git a/dev/scss/main/koralquery.scss b/dev/scss/main/koralquery.scss
index d569d77..1aec746 100644
--- a/dev/scss/main/koralquery.scss
+++ b/dev/scss/main/koralquery.scss
@@ -8,6 +8,8 @@
white-space: pre;
background-color: $dark-orange;
> div {
+ overflow-x: auto;
+ font-size: 85%;
background-color: $nearly-white;
margin: {
top: 2pt;