Cleanup and simplify JS code
Change-Id: I393e22763c1a1d18878026bf459b747b150429fb
diff --git a/dev/js/src/api.js b/dev/js/src/api.js
index 2767015..89534be 100644
--- a/dev/js/src/api.js
+++ b/dev/js/src/api.js
@@ -18,11 +18,11 @@
// match is a KorAP.Match object
var url = KorAP.URL;
url += '/corpus';
-/*
- url += '/' + match.corpusID;
- url += '/' + match.docID;
- url += '/' + match.textID;
-*/
+ /*
+ url += '/' + match.corpusID;
+ url += '/' + match.docID;
+ url += '/' + match.textID;
+ */
var legacySigle = new RegExp('^([^_]+)_([^\\.]+)\\.(.+?)$');
@@ -55,6 +55,7 @@
KorAP.API.getJSON(url, cb);
};
+
/**
* Retrieve information about collections
*/
@@ -62,6 +63,7 @@
KorAP.API.getJSON(KorAP.URL + '/collection', cb);
};
+
/**
* General method to retrieve JSON information
*/
@@ -72,12 +74,12 @@
req.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
req.onreadystatechange = function () {
/*
- States:
- 0 - unsent (prior to open)
- 1 - opened (prior to send)
- 2 - headers received
- 3 - loading (responseText has partial data)
- 4 - done
+ States:
+ 0 - unsent (prior to open)
+ 1 - opened (prior to send)
+ 2 - headers received
+ 3 - loading (responseText has partial data)
+ 4 - done
*/
if (this.readyState == 4) {