Improved tabbing
diff --git a/dev/js/src/hint.js b/dev/js/src/hint.js
index e07785b..f2f3149 100644
--- a/dev/js/src/hint.js
+++ b/dev/js/src/hint.js
@@ -30,11 +30,6 @@
/**
* Return keycode based on event
*/
- function _codeFromEvent (e) {
- if ((e.charCode) && (e.keyCode==0))
- return e.charCode
- return e.keyCode;
- };
// Initialize hint array
diff --git a/dev/js/src/init.js b/dev/js/src/init.js
index 3f6d3a5..9aa410d 100644
--- a/dev/js/src/init.js
+++ b/dev/js/src/init.js
@@ -94,6 +94,7 @@
'#search > ol > li:not(.active)'
);
var i = 0;
+
for (i = 0; i < inactiveLi.length; i++) {
inactiveLi[i].addEventListener('click', function (e) {
if (this._match !== undefined)
@@ -103,6 +104,20 @@
};
e.halt();
});
+ inactiveLi[i].addEventListener('keydown', function (e) {
+ var code = _codeFromEvent(e);
+
+ switch (code) {
+ case 32:
+ if (this._match !== undefined)
+ this._match.toggle();
+ else {
+ matchClass.create(this).open();
+ };
+ e.halt();
+ break;
+ };
+ });
};
var result = document.getElementById('resultinfo');
@@ -292,4 +307,3 @@
};
return vc;
};
-
diff --git a/dev/js/src/match.js b/dev/js/src/match.js
index f6fbd41..88c87fb 100644
--- a/dev/js/src/match.js
+++ b/dev/js/src/match.js
@@ -190,6 +190,14 @@
return true;
},
+ // Todo: Test toggle
+ toggle : function () {
+ if (this._element.classList.contains('active'))
+ this.close();
+ else
+ this.open();
+ },
+
/**
* Close info view
diff --git a/dev/js/src/util.js b/dev/js/src/util.js
index f17ec2a..00a2bd5 100644
--- a/dev/js/src/util.js
+++ b/dev/js/src/util.js
@@ -35,6 +35,14 @@
node.removeChild(node.firstChild);
};
+// Utility to get either the charCode
+// or the keyCode of an event
+function _codeFromEvent (e) {
+ if ((e.charCode) && (e.keyCode==0))
+ return e.charCode
+ return e.keyCode;
+};
+
define(function () {
// Todo: That's double now!
diff --git a/dev/js/src/vc.js b/dev/js/src/vc.js
index 0685242..0bc7284 100644
--- a/dev/js/src/vc.js
+++ b/dev/js/src/vc.js
@@ -55,7 +55,7 @@
"use strict";
// ???
- KorAP._validStringMatchRE = new RegExp("^(?:eq|ne|contains|excludes)$");
+ KorAP._validStringMatchRE = new RegExp("^(?:eq|ne|contains(?:not)?|excludes)$");
KorAP._validDateMatchRE = new RegExp("^[lg]?eq$");
KorAP._validDateRE = new RegExp("^(?:\\d{4})(?:-\\d\\d(?:-\\d\\d)?)?$");
KorAP._overrideStyles = false;
@@ -112,7 +112,7 @@
['eq', null],
['ne', null],
['contains', null],
- ['excludes', null]
+ ['containsnot', null]
]),
'date' : menuClass.create([
['eq', null],
@@ -123,7 +123,7 @@
['eq', null],
['ne', null],
['contains', null],
- ['excludes', null]
+ ['containsnot', null]
])
};
};
diff --git a/dev/js/src/vc/doc.js b/dev/js/src/vc/doc.js
index 66dfc6e..07943f0 100644
--- a/dev/js/src/vc/doc.js
+++ b/dev/js/src/vc/doc.js
@@ -557,6 +557,9 @@
case "excludes":
string += '!~';
break;
+ case "containsnot":
+ string += '!~';
+ break;
case "geq":
string += 'since';
break;