Improvements to keyword adding
This commit is contained in:
parent
1225d605c3
commit
dcd777610a
@ -68,8 +68,8 @@
|
|||||||
$('#historyIndex').on('slideStop', onSelectSnapshot);
|
$('#historyIndex').on('slideStop', onSelectSnapshot);
|
||||||
|
|
||||||
$('#learn').click(function() {
|
$('#learn').click(function() {
|
||||||
var keyword = prompt('Input keyword to learn as');
|
var keyword = prompt('Input keyword to learn as (alphanumeric, no spaces)');
|
||||||
if (name === null) {
|
if (keyword === null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -80,7 +80,9 @@
|
|||||||
|
|
||||||
$.getJSON('/add_keyword', query, function(results) {
|
$.getJSON('/add_keyword', query, function(results) {
|
||||||
if (results.success) {
|
if (results.success) {
|
||||||
|
_ctx.parameters.keywords[keyword] = query.features;
|
||||||
|
$('#searchKeyword').append($('<option></option>', { value: keyword, text: keyword }));
|
||||||
|
$('#searchKeyword').val(keyword);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
alert('Failed to learn keyword');
|
alert('Failed to learn keyword');
|
||||||
|
Loading…
Reference in New Issue
Block a user