Modificata visualizzazione dei Risultati testuali della ricerca

This commit is contained in:
Luca Trupiano 2022-10-04 16:31:07 +02:00
parent cca91c526d
commit 1e4efd3e4c
1 changed files with 9 additions and 6 deletions

View File

@ -600,6 +600,7 @@ $(document).ready(function() {
var resultTablePart4 = '';
var resultTablePart5 = '</tbody></table>';
var resultTable = '';
var latestResult = '';
var rowNum = 1;
for (var i = 0; i < queryFields.length; i++) {
resultTablePart2 = resultTablePart2 + '<th scope="col">' + queryFields[i] + '</th>';
@ -608,18 +609,20 @@ $(document).ready(function() {
$('#resultsId1').empty();
$('#resultsId1').addClass("small pb-2")
$("#risultatitesto").empty();
$("#risultatitesto").append("[\n");
//$("#risultatitesto").append("[\n");
bindingsStream.on('data', (binding) => {
//console.log(binding.toString()); // Quick way to print bindings for testing
//console.log(binding.has('sub')); // Will be true
latestResult = rowNum + '. "' + binding.get('Verso').value + '" (' + binding.get('Cantica').value + ', ' + binding.get('Canto').value + ', Verso ' + binding.get('NumeroVerso').value + ')\n';
$("#risultatitesto").append(latestResult);
resultTablePart4 = '<tr><th scope="row" class="text-muted">' + rowNum++ + '</th>';
for (var i = 0; i < queryFields.length; i++) {
resultTablePart4 = resultTablePart4 + '<td class="text-muted">' + binding.get(queryFields[i]).value + "</td>";
};
resultTable = resultTable + resultTablePart4 + '</tr>';
$("#risultatitesto").append(binding.toString() + ",\n");
//$("#risultatitesto").append(binding.toString() + ",\n");
$("#loader").hide();
//console.log(binding.get('form').value);
//console.log(binding.get('Verso').value);
//console.log(binding.get('form').termType);
//console.log(binding.get('pred').value);
//console.log(binding.get('obj').value);
@ -627,7 +630,7 @@ $(document).ready(function() {
bindingsStream.on('end', () => {
resultTable = resultTable + resultTablePart5;
$("#resultsId1").append(resultTable);
$("#risultatitesto").append("]");
//$("#risultatitesto").append("]");
$("#copiaTesto").prop("disabled", false);
$('#resultTable').DataTable( {
colReorder: true,
@ -893,12 +896,12 @@ $(document).ready(function() {
};
$.fn.copy2clipboard = function() {
$('div[id^="msgCopiata"]').remove();
$('div[id^="msgCopiati"]').remove();
this.select();
$(this).focus();
document.execCommand("copy");
document.getSelection().removeAllRanges();
$(this).after('<div class="mt-2 text-lida3" id="msgCopiata">Copiata nella clipboard</div>');
$(this).after('<div class="mt-2 text-lida3" id="msgCopiati">Copiati nella clipboard</div>');
};