interviews_daudet / data /daudetFacettes.html
de-francophones's picture
Upload 173 files
9a1f9ba verified
<html xmlns:tei="http://www.tei-c.org/ns/1.0">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>
Faceted Search JavaScript Library
</title><style>
/* First come the styles which are used in the demo */
.facetsearch {
display: inline-block;
width: 200px;
vertical-align: top;
padding : 10px;
}
.facetlist{
overflow-y: scroll;
height: 150px;
}
.activeorderby,
.activefacet {
color: red;
}
.bottomline {
padding: 10px 0 10px 0;
font-weight: bold;
}
.bottomline .orderby,
.bottomline .facettotalcount {
display: inline-block;
}
.bottomline .orderby ul,
.bottomline .orderby li {
display: inline;
padding: 0;
}
.bottomline .orderby-title {
margin: 0 0 0 10px;
}
.bottomline .deselectstartover {
float: right;
}
#language {
width: 400px;
}
#language .facetlist{
column-count: 2;
-webkit-column-count: 2;
-moz-column-count: 2;
-o-column-count: 2;
}
.item {
width: 150px;
height: 150px;
margin: 0 10px 10px 0;
display: inline-block;
vertical-align: top;
}
.item h4 {
font-size: 1.2em;
}
.item .tags {
font-weight: bold;
color: gray;
}
img {
display: none;
}
#showmorebutton {
border: 1px solid #AAA;
border-radius: 15px;
background-color: #DDD;
margin: 0 0 10px 0;
padding: 10px;
width: 100%;
display: block;
text-align: center;
cursor: pointer;
}
/* These styles are just general purpose styles to make the page look a little less aweful */
* {
margin: 0;
padding: 0;
}
body {
padding: 20px;
font-family: sans-serif;
font-size: 14px;
}
#wrapper, #documentation {
margin: 0 auto;
width: 800px;
}
p {
padding-bottom: 1em;
line-height: 1.3em;
}
h1, h2, h3{
margin: 0 0 1em 0;
}
tt {
background-color: #EEE;
border: 1px solid #CCC;
}
</style></head>
<body>
<div>
<p>
Vous pouvez sélectionner les interviews en cliquant sur des valeurs possibles de 'Journaliste', 'statut du texte', 'toponymes principaux', 'auteurs cités', etc. Ce faisant, la liste de résultats (en bas de la page) change. Vous pouvez enfin accéder aux textes en cliquant sur l'un des dits résultats. Vous pouvez revenir à la liste complète des interviews en cliquant sur 'nouvelle recherche'.
</p>
<div id="facets"></div>
<div id="results"></div>
</div><script src="Outils/jquery-1.6.2.js"></script><script src="Outils/underscore-1.1.7.js"></script><script src="Outils/facetedsearch.js"></script><script>
$(function(){
var item_template =
'<div>' +
'<h4><a href="<%= obj.fichier%>"><%= obj.fichier%></a></h4>' +
'<p class="tags">' +
'<% if (obj.type_corpus) { %><%= obj.type_corpus %><% } %>' +
'<% if (obj.genre) { %>, <%= obj.genre %><% } %>' +
'</p>' +
'<p><%= obj.resume %></p>' +
'</div>';
settings = {
items : example_items,
facets : {
'journal' : 'journal',
'annee' : 'annee',
'Journaliste' : 'Journaliste',
'Statut du texte' : 'Statut du texte',
'Toponymes principaux' : 'Toponymes principaux',
'Sujet Principal' : 'Sujet Principal',
'Auteurs cités' : 'Auteurs cités',
'Titres d\'œuvres' : 'Titres d\'oeuvres',
'Autres noms propres cités' : 'Autres noms propres cités'
},
resultSelector : '#results',
facetSelector : '#facets',
resultTemplate : item_template,
paginationCount : 50,
orderByOptions : {},
facetSortOption : {}
}
// use them!
$.facetelize(settings);
});
</script><script>
// Most of the time I suppose you would use jQuery to get your data;
/*
$.getJSON( "http:/example.com", function(data){
$.facetelize....
});
*/
var example_items = (function() {
var example_items = null;
$.ajax({
'async': false,
'global': false,
'url': "MDDaudet.json",
'dataType': "json",
'success': function (data) {
example_items = data;
}
})
return example_items;
})();
</script></body>
</html>