Added option to search over incomplete trees. Also added some validations.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
// Global array to store input names
|
||||
var globalInputList = ['display_size', 'file', 'association_measures', 'labeled_trees', 'node_type_upos', 'fixed_order', 'input_url', 'node_type_lemma', 'root_restriction', 'node_type_form', 'frequency_threshold', 'node_type_none', 'query', 'compare_url', 'compare_file', 'ignored_labels'];
|
||||
var globalInputList = ['display_size', 'file', 'association_measures', 'labeled_trees', 'node_type_upos', 'fixed_order', 'input_url', 'node_type_lemma', 'root_restriction', 'node_type_form', 'frequency_threshold', 'node_type_none', 'query', 'compare_url', 'compare_file', 'ignored_labels', 'complete_trees'];
|
||||
var visualInputList = ['advanced-tree-expand', 'compare-expand']
|
||||
|
||||
// Function to store values to local storage
|
||||
function storeValuesToLocalstorage() {
|
||||
@@ -15,6 +16,10 @@ function storeValuesToLocalstorage() {
|
||||
}
|
||||
}
|
||||
});
|
||||
visualInputList.forEach(function(inputName) {
|
||||
var shown = $('#' + inputName).find('i').text().trim() === 'add';
|
||||
localStorage.setItem(inputName, shown);
|
||||
});
|
||||
}
|
||||
|
||||
// Function to read values from local storage
|
||||
@@ -59,6 +64,13 @@ function readValuesFromLocalstorage() {
|
||||
return [tree_size_min, tree_size_max]
|
||||
}
|
||||
|
||||
function readVariableFromLocalstorage(variableName) {
|
||||
if (localStorage.getItem(variableName) === null) {
|
||||
return true;
|
||||
}
|
||||
return localStorage.getItem(variableName) === 'true';
|
||||
};
|
||||
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function(event) {
|
||||
tree_size = readValuesFromLocalstorage()
|
||||
@@ -129,8 +141,18 @@ function adjustLabelPosition() {
|
||||
$('#unknown-error').hide();
|
||||
});
|
||||
|
||||
$('#advanced-tree').hide();
|
||||
var advancedTreeExpanded = false;
|
||||
var advancedTreeExpanded = readVariableFromLocalstorage('advanced-tree-expand');
|
||||
if (!advancedTreeExpanded) {
|
||||
advancedTreeExpanded = true;
|
||||
$('#advanced-tree').show('fast', function() {
|
||||
adjustLabelPosition();
|
||||
});
|
||||
$('#advanced-tree-expand i').text('remove');
|
||||
} else {
|
||||
advancedTreeExpanded = false;
|
||||
$('#advanced-tree').hide('fast');
|
||||
$('#advanced-tree-expand i').text('add');
|
||||
}
|
||||
$('#advanced-tree-expand').bind('click', function(e) {
|
||||
if (!advancedTreeExpanded){
|
||||
advancedTreeExpanded = true;
|
||||
@@ -145,8 +167,19 @@ function adjustLabelPosition() {
|
||||
}
|
||||
});
|
||||
|
||||
$('#compare-settings').hide();
|
||||
var compareExpanded = false;
|
||||
var compareExpanded = readVariableFromLocalstorage('compare-expand');
|
||||
if (!compareExpanded) {
|
||||
compareExpanded = true;
|
||||
$('#compare-settings').show('fast', function() {
|
||||
adjustLabelPosition();
|
||||
});
|
||||
$('#compare-expand i').text('remove');
|
||||
} else {
|
||||
compareExpanded = false;
|
||||
$('#compare-settings').hide('fast');
|
||||
$('#compare-expand i').text('add');
|
||||
}
|
||||
|
||||
$('#compare-expand').bind('click', function(e) {
|
||||
if (!compareExpanded){
|
||||
compareExpanded = true;
|
||||
@@ -181,6 +214,12 @@ function adjustLabelPosition() {
|
||||
$('input.association_measures').prop('disabled', false);
|
||||
}
|
||||
});
|
||||
$('input.complete_trees').on('change', function(e) {
|
||||
if(this.checked === false) {
|
||||
// $('.modal2').modal('open');
|
||||
$('#modal2').modal('open');
|
||||
}
|
||||
});
|
||||
$('a.example-input-link').click(function(e) {
|
||||
$('#input_url').val(this.href)
|
||||
$('label[for="input_url"]').addClass('active')
|
||||
|
||||
Reference in New Issue
Block a user