descartes load -- possibly all before show

This commit is contained in:
gauthiier
2020-12-15 17:54:05 +01:00
parent 56aab9e545
commit 696378ebe0
11 changed files with 20174 additions and 24 deletions
+6 -6
View File
@@ -3,11 +3,11 @@
font-family: 'Cormorant Garamond';
font-style: normal;
font-weight: 400;
src: url('http://full-digest-rescheduled.info/fonts/cormorant-garamond-v7-latin/cormorant-garamond-v7-latin-regular.eot'); /* IE9 Compat Modes */
src: url('https://full-digest-rescheduled.info/fonts/cormorant-garamond-v7-latin/cormorant-garamond-v7-latin-regular.eot'); /* IE9 Compat Modes */
src: local('Cormorant Garamond Regular'), local('CormorantGaramond-Regular'),
url('http://full-digest-rescheduled.info/fonts/cormorant-garamond-v7-latin/cormorant-garamond-v7-latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('http://full-digest-rescheduled.info/fonts/cormorant-garamond-v7-latin/cormorant-garamond-v7-latin-regular.woff2') format('woff2'), /* Super Modern Browsers */
url('http://full-digest-rescheduled.info/fonts/cormorant-garamond-v7-latin/cormorant-garamond-v7-latin-regular.woff') format('woff'), /* Modern Browsers */
url('http://full-digest-rescheduled.info/fonts/cormorant-garamond-v7-latin/cormorant-garamond-v7-latin-regular.ttf') format('truetype'), /* Safari, Android, iOS */
url('http://full-digest-rescheduled.info/fonts/cormorant-garamond-v7-latin/cormorant-garamond-v7-latin-regular.svg#CormorantGaramond') format('svg'); /* Legacy iOS */
url('https://full-digest-rescheduled.info/fonts/cormorant-garamond-v7-latin/cormorant-garamond-v7-latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('https://full-digest-rescheduled.info/fonts/cormorant-garamond-v7-latin/cormorant-garamond-v7-latin-regular.woff2') format('woff2'), /* Super Modern Browsers */
url('https://full-digest-rescheduled.info/fonts/cormorant-garamond-v7-latin/cormorant-garamond-v7-latin-regular.woff') format('woff'), /* Modern Browsers */
url('https://full-digest-rescheduled.info/fonts/cormorant-garamond-v7-latin/cormorant-garamond-v7-latin-regular.ttf') format('truetype'), /* Safari, Android, iOS */
url('https://full-digest-rescheduled.info/fonts/cormorant-garamond-v7-latin/cormorant-garamond-v7-latin-regular.svg#CormorantGaramond') format('svg'); /* Legacy iOS */
}
+46 -3
View File
@@ -1,4 +1,47 @@
.cor_large {
.title {
font-family: 'Cormorant Garamond', serif;
font-size: 1500%;
}
font-size: 650%;
margin-left: 0.25em;
}
.cor {
font-family: 'Cormorant Garamond', serif;
}
h1 {
font-family: 'Cormorant Garamond', serif;
}
term {
font-family: 'Cormorant Garamond', serif;
padding-right: 0.5em;
font-size: 150%;
}
ref {
font-family: 'Cormorant Garamond', serif;
padding-right: 0.2em;
font-size: 120%;
}
.keyword-index {
text-indent: -2em;
margin-left: 2em;
margin-right: 2em;
}
#index {
margin-left: 2em;
margin-right: 2em;
}
#footer {
font-family: Courier;
text-align: center;
}
#footer br {
display: block;
margin: 0.5em 0;
}
+70
View File
@@ -0,0 +1,70 @@
$(document).ready(function(){
$('#loading').hide()
$('#info').click( function() {
console.log("click");
$('#info-search').toggle();
});
$('#search').submit(function(e) {
e.preventDefault();
args = $(this).serialize();
$('#results').empty();
// console.log('/search?'+ args)
$('#loading').show()
$.get('/search?'+ args + '&action=search', function(data) {
$('#loading').hide()
console.log(data);
var term = data.keyword.replace(/['"]+/g, '');
var id_str = term.replace(/\s/g, "").replace(/\*/g, "");
console.log(id_str)
$('<div/>', {
id: id_str,
class: "keyword-index",
}).appendTo('#results');
$('#' + id_str).prepend('<term>' + term + '</term>');
$.each(data.results, function(i, item) {
let end = (i == data.results.length - 1 ? "" : ", ")
if (item.url != '') {
$('#' + id_str).append('<ref data-url="' + item.url + '" data-nbr="' + item.nbr + '"><a href="' + item.url + '">' + item.nbr + '</a></ref>' + end);
} else {
$('#' + id_str).append('<ref data-url="' + item.url + '" data-nbr="' + item.nbr + '">' + item.nbr + '</ref>' + end );
}
});
$('#' + id_str).append('<button class="add">+</button>');
$('.add').click(function(e) {
var indx = $(this).parent(".keyword-index");
var term = indx.children("term")[0];
var term_out = $(term).text();
var refs_out = []
var refs = indx.children("ref").each( function() {
let url = $(this).data('url');
let nbr = $(this).data('nbr');
if (url == "") url = "n/a";
refs_out.push({'url': url, 'nbr': nbr});
});
$.ajax ({
type: "POST",
contentType: 'application/json',
url: '/search',
data: JSON.stringify({'action': 'add', 'term': term_out, 'refs': refs_out}),
success: function (d) {
if(d === 'ok') {
location.reload();
}
}
});
// $.post('/search', {'action': 'add', 'term': term_out, 'refs': refs_out}, function(d) {
// if(d === 'ok') {
// location.reload();
// }
// });
});
});
});
});