From eadd4e028830314515b39a000d86a09384f0db75 Mon Sep 17 00:00:00 2001 From: cesare Date: Fri, 18 Nov 2022 12:48:53 +0100 Subject: [PATCH] badge canto work in progress --- css/browsingldc.css | 4 ++-- index_2.0.html | 2 +- js/cesareBrowse.js | 14 ++++++++------ 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/css/browsingldc.css b/css/browsingldc.css index 6517a18..0921416 100644 --- a/css/browsingldc.css +++ b/css/browsingldc.css @@ -170,8 +170,8 @@ p{ margin-bottom: 60px; } .titolo-canto { - margin-bottom: 5px; - font-size: 40px; + margin-bottom: 8px; + font-size: 24px; } .canto-meta { margin-bottom: 20px; diff --git a/index_2.0.html b/index_2.0.html index 6b51011..7eb7de7 100644 --- a/index_2.0.html +++ b/index_2.0.html @@ -99,7 +99,7 @@
- 114 + 1 2 3 4 diff --git a/js/cesareBrowse.js b/js/cesareBrowse.js index e6dd21d..4f992b5 100644 --- a/js/cesareBrowse.js +++ b/js/cesareBrowse.js @@ -3,6 +3,7 @@ */ $(document).ready(function() { + const cantobadgeclass='badge badge-outline-info badge-pill' const sparqlGenerator = sparqljs.Generator; const myEngine = new Comunica.QueryEngine(); @@ -505,8 +506,8 @@ jQuery(document).delegate('#cleanresult', 'click', function(e) { //licanto.appendTo('#listacanti') licanto.appendTo(divListaCanti) var divcanto = $('
') - var titolocanto = $('

') - titolocanto.append(canto) + var titolocanto = $('

') + titolocanto.append(cantica+", "+canto) divcanto.attr('class', 'canto') divcanto.attr('style', 'display:none') divcanto.attr('id', (cantica + canto).replace(" ", "_")) @@ -592,7 +593,8 @@ jQuery(document).delegate('#cleanresult', 'click', function(e) { let count = resultsInCantica.reduce((n, x) => n + (x === cantica), 0); // var spanbadgecantica=$(''); - spanbadgecantica.attr('class', 'badge badge-primary badge-pill'); + spanbadgecantica.attr('class', 'badge badge-primary badge-pill ml-1'); + //spanbadgecantica.attr('class', 'position-absolute top-0 start-100 translate-middle badge rounded-pill badge-primary'); spanbadgecantica.append(count) //spanbadgecantica.insertAfter($('#cantica'+i)) spanbadgecantica.appendTo($('#cantica'+i)) @@ -604,11 +606,11 @@ jQuery(document).delegate('#cleanresult', 'click', function(e) { if (k==0) continue let count = resultsInCanto.reduce((n, x) => n + (x === cantica+'Canto '+k), 0); - // + //14 var spanbadge=$(''); - spanbadge.attr('class', 'badge badge-notification '); - spanbadge.append('('+count+')') + spanbadge.attr('class', cantobadgeclass); + spanbadge.append(count) //$("[name='nameofobject']") spanbadge.appendTo($('[name="'+cantica+'Canto '+k+'"]')) //spanbadge.insertAfter($('[name="'+cantica+'Canto '+k+'"]'))