diff --git a/index_work_grid.html b/index_work_grid.html index 6f8c42c..06697d5 100644 --- a/index_work_grid.html +++ b/index_work_grid.html @@ -804,7 +804,7 @@
+ name="tra">
div').length + 1, - element = null, - element = content.clone(); - //alert(size); - element.attr('id', 'cg-'+size); - //element.attr('class', "stripe-dark") - //element.find('.delete-record').attr('data-id', size); - element.appendTo('#condizioni'); - element.find('.sn').html(size); - grammarconditions=grammarconditions+1 - - if (size==1) - jQuery('#grammarbutton').attr('style', "display:block;") - }); - - jQuery(document).delegate('a.add-record-sint', 'click', function(e) { - e.preventDefault(); - var content = jQuery('#tiposintattico div'), - size = jQuery('#condizioni >div').length + 1, - element = null, - element = content.clone(); - element.attr('id', 'ts-'+size); - //element.attr('class', "stripe-dark") - //element.find('.delete-record').attr('data-id', size); - element.appendTo('#condizioni'); - element.find('.sn').html(size); - if (size==1) - jQuery('#grammarbutton').attr('style', "display:block;") - }); - - - jQuery(document).delegate('select.catgram', 'change', function(e) { - e.preventDefault(); - //alert ($('#types').find(":selected").val()) - alert ($(this).closest('div').attr('id')) - - containerid='dettaglio_'+$(this).closest('div').attr('id') - //if ($('#types').find(":selected").val()=='verbovolgare'){ - if ($(this).val()=='verbovolgare'){ - //alert($('#types').find(":selected").val()); - var content = jQuery('#categoriaverbo >div'), - size = jQuery('#dettaglifiltri').length + 1, - element = null, - element = content.clone(); - - } - if ($(this).val()=='sostantivovolgare'){ - //alert($('#types').find(":selected").val()); - var content = jQuery('#categoriasostantivo >div'), - size = jQuery('#dettaglifiltri').length + 1, - element = null, - element = content.clone(); - } - if ($(this).val()=='aggettivovolgare'){ - var keys = Object.keys(aggettivoJson.filtri); - alert(keys) - } - element.attr('style',"display: block;") - //element.appendTo('#dettaglifiltri'); - - var test=jQuery('#'+containerid) - test.remove() - - - element.appendTo('#dettaglifiltri'); - var container = jQuery('#dettaglifiltri'); - container.attr('id', containerid); - var divdf = jQuery('#divdettaglifiltri >div'), - detelement = null, - detelement = divdf.clone(); - detelement.attr('id','dettaglifiltri') - detelement.appendTo("#query") - element.find('.sn').html(size); - - }); - - - jQuery(document).delegate('input.delete-record', 'click', function(e) { - e.preventDefault(); - var didConfirm = confirm("Sei sicuro di voler eliminare la condizione?"); - if (didConfirm == true) { - var id = jQuery(this).attr('data-id'); - var targetDiv = jQuery(this).attr('targetDiv'); - jQuery('#rec-' + id).remove(); - - if (jQuery('#condizioni >tbody >tr').length==0) - jQuery('#grammarbutton').attr('style', "display:none;") - //regnerate index number on table - $('#condizioni_body tr').each(function(index){ - $(this).find('span.sn').html(index+1); - - }); - return true; - } else { - return false; - } -}); - }); \ No newline at end of file + $(this).addClass('bg-white').addClass('red'); + $(this).siblings().removeClass('bg-white').removeClass('red'); + }); + + jQuery(document).delegate('a.add-record', 'click', function(e) { + e.preventDefault(); + var content = jQuery('#categoriagrammaticale div'), + size = jQuery('#condizioni >div').length + 1, + element = null, + element = content.clone(); + //alert(size); + element.attr('id', 'cg-' + size); + //element.attr('class', "stripe-dark") + //element.find('.delete-record').attr('data-id', size); + element.appendTo('#condizioni'); + element.find('.sn').html(size); + grammarconditions = grammarconditions + 1 + + if (size == 1) + jQuery('#grammarbutton').attr('style', "display:block;") + }); + + jQuery(document).delegate('a.add-record-sint', 'click', function(e) { + e.preventDefault(); + var content = jQuery('#tiposintattico div'), + size = jQuery('#condizioni >div').length + 1, + element = null, + element = content.clone(); + element.attr('id', 'ts-' + size); + //element.attr('class', "stripe-dark") + //element.find('.delete-record').attr('data-id', size); + element.appendTo('#condizioni'); + element.find('.sn').html(size); + if (size == 1) + jQuery('#grammarbutton').attr('style', "display:block;") + }); + + + jQuery(document).delegate('select.catgram', 'change', function(e) { + e.preventDefault(); + //alert ($('#types').find(":selected").val()) + alert($(this).closest('div').attr('id')) + + containerid = 'dettaglio_' + $(this).closest('div').attr('id') + //if ($('#types').find(":selected").val()=='verbovolgare'){ + if ($(this).val() == 'verbovolgare') { + //alert($('#types').find(":selected").val()); + var content = jQuery('#categoriaverbo >div'), + size = jQuery('#dettaglifiltri').length + 1, + element = null, + element = content.clone(); + + } + if ($(this).val() == 'sostantivovolgare') { + //alert($('#types').find(":selected").val()); + var content = jQuery('#categoriasostantivo >div'), + size = jQuery('#dettaglifiltri').length + 1, + element = null, + element = content.clone(); + } + + //alert($(this).val()) + + if (Object.keys(categorie).includes($(this).val())) { + //alert(categorie[$(this).val()]) + var filtro = categorie[$(this).val()] + //var keys = Object.keys(aggettivoJson.filtri); + var keys = Object.keys(categorieJson[filtro]) + for (key in keys) { + //alert(aggettivoJson.filtri[keys[key]]) + var vals = categorieJson[filtro][keys[key]] + if (vals.length == 2) { + var element = $('
'); + element.attr('class', ' w-15 pa1 mr2'); + var rbfieldset = $('
'), + flexdiv1 = $('
'), + flexdiv2 = $('
'), + input1 = $(''), + input2 = $(''), + label1 = $('