File size: 4,861 Bytes
9a1f9ba
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<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>