-
Notifications
You must be signed in to change notification settings - Fork 1
/
process.js
32 lines (28 loc) · 850 Bytes
/
process.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
function evalResult (result, data, type) {
/*data.results.forEach(function(element){
var res = element.text.substring(0, element.text.indexOf('/b>')) + '/b> – (' + element.id + ') ' + element.text.substring(element.text.indexOf('/b>') + 3)
var erg = {"id": element.id, "text": res };
result.results.push(erg);
});*/
data.forEach(function (entries) {
result.results.push({ "id": entries._id, "text": entries.short.v});
});
}
function queryString (conf, params) {
var query = {
"term": params.term,
"q": params.term,
"_type": "query"
}
return query
}
function handleError (jqXHR, textStatus, errorThrown) {
console.log(jqXHR + " – " + textStatus + " – " + errorThrown);
}
function insertText (elements) {
console.log(elements);
}
function insertLink (link, text) {
console.log(link);
$('#textOutput').text(text);
}