Multiple fixes listed in 2024-01-03 changelog
This commit is contained in:
@@ -74,4 +74,18 @@ td {
|
||||
text-align: center;
|
||||
border-right: solid 1px #bbbbbb;
|
||||
border-left: solid 1px #bbbbbb;
|
||||
}
|
||||
}
|
||||
|
||||
.validation-error {
|
||||
display: block;
|
||||
color: #F44336;
|
||||
position: relative;
|
||||
min-height: 18px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 993px) {
|
||||
.container {
|
||||
width: 60%;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,55 @@
|
||||
// Global array to store input names
|
||||
var globalInputList = ['tree_size_min', 'tree_size_max', 'file', 'association_measures', 'labeled_trees', 'node_type_upos', 'fixed_order', 'input_url', 'node_type_lemma', 'root_restriction', 'node_type_form'];
|
||||
|
||||
// Function to store values to local storage
|
||||
function storeValuesToLocalstorage() {
|
||||
globalInputList.forEach(function(inputName) {
|
||||
var inputElement = $('[name="' + inputName + '"]');
|
||||
|
||||
if (inputElement.length > 0) {
|
||||
var inputType = inputElement.attr('type');
|
||||
if (inputType === 'text' | inputType === 'hidden') {
|
||||
localStorage.setItem(inputName, inputElement.val());
|
||||
} else if (inputType === 'checkbox') {
|
||||
localStorage.setItem(inputName, inputElement.prop('checked'));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Function to read values from local storage
|
||||
function readValuesFromLocalstorage() {
|
||||
globalInputList.forEach(function(inputName) {
|
||||
var inputElement = $('[name="' + inputName + '"]');
|
||||
|
||||
if (inputElement.length > 0) {
|
||||
var inputType = inputElement.attr('type');
|
||||
if (inputType === 'text') {
|
||||
var text_val = localStorage.getItem(inputName);
|
||||
if (text_val !== '' & text_val !== null) {
|
||||
// set label to active
|
||||
$("label[for='" + inputElement.attr('id') + "']").addClass('active');
|
||||
}
|
||||
inputElement.val(text_val);
|
||||
|
||||
} else if (inputType === 'checkbox') {
|
||||
var check_value = localStorage.getItem(inputName);
|
||||
if (check_value !== null) {
|
||||
inputElement.prop('checked', check_value === 'true');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
var tree_size_min = localStorage.getItem('tree_size_min') !== null ? localStorage.getItem('tree_size_min') : 2;
|
||||
var tree_size_max = localStorage.getItem('tree_size_max') !== null ? localStorage.getItem('tree_size_max') : 3;
|
||||
return [tree_size_min, tree_size_max]
|
||||
}
|
||||
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function(event) {
|
||||
tree_size = readValuesFromLocalstorage()
|
||||
|
||||
var valuesForSlider = [2,3,4,5];
|
||||
|
||||
var format = {
|
||||
@@ -11,7 +62,7 @@ document.addEventListener("DOMContentLoaded", function(event) {
|
||||
};
|
||||
var slider = document.getElementById('slider');
|
||||
noUiSlider.create(slider, {
|
||||
start: [2, 3],
|
||||
start: [tree_size[0], tree_size[1]],
|
||||
connect: true,
|
||||
tooltips: true,
|
||||
step: 1,
|
||||
@@ -30,11 +81,15 @@ document.addEventListener("DOMContentLoaded", function(event) {
|
||||
|
||||
}); // end of document ready
|
||||
$(document).ready(function(){
|
||||
$('#advanced-tree').hide();
|
||||
$('.input-field span.helper-text').hide();
|
||||
$('.input-field').bind('mouseenter', function(e) {
|
||||
$(this).find('span.helper-text').show('fast')
|
||||
$('.input-field input[type="checkbox"]').on('change', function() {
|
||||
var isChecked = $('.input-field input[type="checkbox"]:checked').length > 0;
|
||||
$('#node-type-error').hide();
|
||||
});
|
||||
$('#submit-form input').on('change', function() {
|
||||
$('#unknown-error').hide();
|
||||
});
|
||||
|
||||
$('#advanced-tree').hide();
|
||||
var advancedTreeExpanded = false;
|
||||
$('#advanced-tree-expand').bind('click', function(e) {
|
||||
if (!advancedTreeExpanded){
|
||||
@@ -46,10 +101,6 @@ document.addEventListener("DOMContentLoaded", function(event) {
|
||||
$('#advanced-tree').hide('fast');
|
||||
$('#advanced-tree-expand i').text('add');
|
||||
}
|
||||
$(this).find('span.helper-text').show('fast')
|
||||
});
|
||||
$('.input-field').bind('mouseleave', function(e) {
|
||||
$(this).find('span.helper-text').hide('fast')
|
||||
});
|
||||
});
|
||||
|
||||
@@ -66,6 +117,8 @@ document.addEventListener("DOMContentLoaded", function(event) {
|
||||
.attr("name", "tree_size_max")
|
||||
.attr("value", tree_size_max)
|
||||
.appendTo("#submit-form");
|
||||
|
||||
storeValuesToLocalstorage();
|
||||
return true;
|
||||
});
|
||||
})(jQuery); // end of jQuery name space
|
||||
|
||||
Reference in New Issue
Block a user