Nouvelle version du client Scrutari
This commit is contained in:
parent
b6323555b3
commit
410ca05205
@ -1,46 +1,8 @@
|
||||
[===============================================================(#REM)
|
||||
Configuration du client Scrutari
|
||||
]
|
||||
<script>
|
||||
$(function () {
|
||||
var scrutariConfig = new Scrutari.Config("libreavous", "https://sct2.scrutari.net/sct/april_libreavous/", "fr", "site", {
|
||||
paginationLength: 50
|
||||
});
|
||||
Scrutari.Client.init(scrutariConfig, "scrutari_client", {
|
||||
withCorpus: false,
|
||||
ficheTarget: "_blank",
|
||||
ficheBodyList: "fiche_mtitre,fiche_msoustitre,libreavous_start_ul,fiche_primaryattributearray,fiche_mcomplementarray,fiche_secondaryattributearray,fiche_motclearray,fiche_bythesaurusarray,libreavous_end_ul", //Ajout de libreavous_start_ul et libreavous_end_ul, retrait de fiche_year
|
||||
initialQuery: "[(#ENV*{q}|scrutari_escape_query)]",
|
||||
initialQId: "[(#ENV*{qid}|scrutari_escape_query)]",
|
||||
ignoreList: "area-title",
|
||||
permalinkPattern: "https://www.libreavous.org/spip.php?page=scrutarijs&qid=$QID",
|
||||
hooks: {
|
||||
completeFiche : function (scrutariResult, fiche, categoryName) { //Extrait le numéro du titre
|
||||
let start = fiche.mtitre[0];
|
||||
let numero = "";
|
||||
if (start.startsWith("#")) {
|
||||
let idx = start.indexOf("-");
|
||||
if (idx > 0) {
|
||||
numero = start.substring(0, idx).trim();
|
||||
fiche.mtitre[0] = start.substring(idx + 1);
|
||||
}
|
||||
}
|
||||
fiche._numero = numero;
|
||||
}
|
||||
}
|
||||
|
||||
}, function (client) {
|
||||
client.$({_element: "button"}).addClass("btn"); //Ajout de la classe btn à tous les boutons du client
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
[===============================================================(#REM)
|
||||
Déclaration du bloc destiné à recevoir le client
|
||||
]
|
||||
<article class="texte_content">
|
||||
<BOUCLE_entete(ARTICLES){page=introrecherchescrutari}>
|
||||
<BOUCLE_entete(ARTICLES){page=recherchescrutari}>
|
||||
<header class="cartouche">
|
||||
[<p class="#EDIT{surtitre} surtitre">#(#SURTITRE)</p>]
|
||||
<h1><span class="#EDIT{titre} article__titre">#TITRE</span>[
|
||||
@ -52,7 +14,109 @@ Déclaration du bloc destiné à recevoir le client
|
||||
[<div class="#EDIT{texte} article__texte">(#TEXTE|adaptive_images{#CONST{_CONTENT_WIDTH},0})</div>]
|
||||
</div>
|
||||
</BOUCLE_entete>
|
||||
|
||||
[===============================================================(#REM)
|
||||
Structure du client
|
||||
]
|
||||
<div id="scrutari_client">
|
||||
|
||||
<!-- main -->
|
||||
<!-- main.main-form -->
|
||||
<form data-scrutari-form="mainsearch">
|
||||
<!-- main.main-form.area-input -->
|
||||
<div data-scrutari-area="input">
|
||||
<input type="search" class="scrutari-input-Text" size="40" name="q" value="" placeholder="Chercher un sujet, un-e intervenant-e…">
|
||||
<button type="submit" class="btn">Rechercher</button>
|
||||
</div>
|
||||
<!-- /main.main-form.area-input -->
|
||||
<!-- main.main-form.area-parameters -->
|
||||
<details data-scrutari-area="parameters">
|
||||
<summary>Option de recherche avancée</summary>
|
||||
<div>
|
||||
<p>
|
||||
<a href="#aide" data-lity type="button" title="Aide sur les relations">
|
||||
?<i class="fas fa-question"></i>
|
||||
</a>
|
||||
<span>Relations :</span>
|
||||
<label class="scrutari-Label"><input type="radio" name="q-mode" value="intersection" checked> Et</label>
|
||||
<label class="scrutari-Label"><input type="radio" name="q-mode" value="union"> Ou</label>
|
||||
<label class="scrutari-Label"><input type="radio" name="q-mode" value="operation"> Avancée</label>
|
||||
</p>
|
||||
<p>
|
||||
<button data-scrutari-button="showModal" data-scrutari-target="help_ponderation" type="button" title="Aide sur la priorité"> <i class="fa-solid fa-circle-question"></i>
|
||||
</button>
|
||||
<span>Priorité :</span>
|
||||
<label class="scrutari-Label"><input type="radio" name="ponderation" value="pertinence" checked> Pertinence</label>
|
||||
<label class="scrutari-Label"><input type="radio" name="ponderation" value="date"> Date</label>
|
||||
</p>
|
||||
<p>
|
||||
<button data-scrutari-button="showModal" data-scrutari-target="help_periode" type="button" title="Aide sur la période">?</button>
|
||||
<span>Période :</span>
|
||||
<input type="text" class="scrutari-input-Text" name="periode" value="" size="20">
|
||||
</p>
|
||||
<p>
|
||||
<button data-scrutari-button="showModal" data-scrutari-target="help_periode" type="button" title="Aide sur « élargir »">
|
||||
<i class="fa-solid fa-circle-question"></i>
|
||||
</button>
|
||||
<span>Élargir :</span>
|
||||
<label class="scrutari-Label"><input type="radio" name="wildchar" value="end" checked> Oui*</label>
|
||||
<label class="scrutari-Label"><input type="radio" name="wildchar" value="none"> Non</label>
|
||||
</p>
|
||||
</div>
|
||||
</details>
|
||||
<!-- /main.main-form.area-parameters -->
|
||||
</form>
|
||||
<!-- /main.main-form -->
|
||||
<!-- main.area-result -->
|
||||
<div data-scrutari-area="result" class="scrutari-area-Result">
|
||||
<div class="scrutari-Hidden" data-scrutari-hidden="empty">
|
||||
<h2>Votre recherche</h2>
|
||||
<p id="scrutari_lav_sequence" class="scrutari-lav-Sequence"></p>
|
||||
</div>
|
||||
<div class="scrutari-Hidden" data-scrutari-hidden="empty">
|
||||
<p>Filtrer les résultats :
|
||||
<label class="scrutari-lav-Filtre"><input type="radio" name="lav-site" value="tous" checked> Tous</label>
|
||||
<span data-scrutari-count="total-tous" class="scrutari-lav-Total">(<span data-scrutari-component="value"></span>)</span>
|
||||
<label class="scrutari-lav-Filtre"><input type="radio" name="lav-site" value="libreavous" class="scrutari-lav-Total"> Libre à vous !</label>
|
||||
<span data-scrutari-count="total-libreavous" class="scrutari-lav-Total">(<span data-scrutari-component="value"></span>)</span>
|
||||
<label class="scrutari-lav-Filtre"><input type="radio" name="lav-site" value="librealire"> Libre à lire</label>
|
||||
<span data-scrutari-count="total-librealire" class="scrutari-lav-Total">(<span data-scrutari-component="value"></span>)</span>
|
||||
</p>
|
||||
</div>
|
||||
<!-- main.area-result.result-history -->
|
||||
<div class="scrutari-Hidden scrutari-lav-history-Container" data-scrutari-hidden="start">
|
||||
<span class="scrutari-lav-history-Label">Votre historique :</span>
|
||||
<div data-scrutari-block="historyList" class="scrutari-lav-history-List">
|
||||
</div>
|
||||
<span>
|
||||
<button class="scrutari-lav-history-Clear" data-scrutari-button="clearHistory" title="Vider l’historique"><i class="fa-solid fa-delete-left"></i></button>
|
||||
</span>
|
||||
</div>
|
||||
<!-- /main.area-result.result-history -->
|
||||
<!-- main.area-result.result-links -->
|
||||
<div class="scrutari-Hidden" data-scrutari-hidden="empty">
|
||||
<p>Partager votre recherche :
|
||||
<a href="#" data-scrutari-link="permalink" data-scrutari-button="copyPermalink" target="_blank" class="btn taille80 blanc">Copier l’URL</a>
|
||||
<a href="#" data-scrutari-link="csv" target="_blank" class="btn taille80 blanc">Télécharger (CSV)</a>
|
||||
<a href="#" data-scrutari-link="ods" target="_blank" class="btn taille80 blanc">Télécharger (ODS)</a>
|
||||
<a href="#" data-scrutari-link="atom" target="_blank" class="btn taille80 blanc">S’abonner (Atom)</a>
|
||||
</p>
|
||||
</div>
|
||||
<!-- /main.area-result.result-links -->
|
||||
<div class="scrutari-Hidden" data-scrutari-hidden="empty">
|
||||
<h2>Vos résultats</h2>
|
||||
</div>
|
||||
<div data-scrutari-block="paginationBlock"></div>
|
||||
<div class="scrutari-Hidden" data-scrutari-hidden="empty">
|
||||
<!-- main.area-result.result-poweredby -->
|
||||
<p class="scrutari-links-Poweredby"><a href="http://www.scrutari.net" target="_blank"><span class="scrutari-icon-Logo"></span> Recherche effectuée par Scrutari</a></p>
|
||||
<!-- /main.area-result.result-poweredby -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- /main.area-result -->
|
||||
<!-- /main -->
|
||||
|
||||
|
||||
</div>
|
||||
</article>
|
||||
|
||||
@ -61,32 +125,6 @@ Déclaration du bloc destiné à recevoir le client
|
||||
Partie consacrée à la réécriture des gabarits
|
||||
voir https://framagit.org/Scrutari/scrutarijs/-/wikis/adaptation#reformuler-un-%C3%A9lement-de-structure-et-de-gabarit
|
||||
]
|
||||
<script data-name="fiche_mtitre" type="text/x-scrutari-template">
|
||||
<p class="scrutari-fiche-Titre surtitre">
|
||||
{{if _numero}}
|
||||
<span class="num_emission">{{: _numero}}</span>
|
||||
{{/if}}
|
||||
<a href="{{:href}}"
|
||||
class="scrutari-fiche-Link"
|
||||
data-scrutari-link="fiche_{{:codefiche}}"
|
||||
{{if _target}} target="{{:_target}}"{{/if}}>
|
||||
{{if mtitre}}
|
||||
{{:~scrutari_mark(mtitre)}}
|
||||
{{else}}
|
||||
{{:href}}
|
||||
{{/if}}
|
||||
</a>
|
||||
</p>
|
||||
</script>
|
||||
|
||||
<script data-name="libreavous_start_ul" type="text/x-scrutari-template">
|
||||
<ul class="spip">
|
||||
</script>
|
||||
|
||||
<script data-name="libreavous_end_ul" type="text/x-scrutari-template">
|
||||
</ul>
|
||||
</script>
|
||||
|
||||
<script data-name="fiche_attribute" type="text/x-scrutari-template">
|
||||
{{if type!=="block"}}
|
||||
<li>
|
||||
@ -109,3 +147,34 @@ voir https://framagit.org/Scrutari/scrutarijs/-/wikis/adaptation#reformuler-un-%
|
||||
</li>
|
||||
{{/if}}
|
||||
</script>
|
||||
<script data-name="fiche_mtitre" type="text/x-scrutari-template">
|
||||
<p class="scrutari-fiche-Titre surtitre">
|
||||
{{if _numero}}
|
||||
<span class="num_emission">{{: _numero}}</span>
|
||||
{{/if}}
|
||||
<a href="{{:href}}"
|
||||
class="scrutari-fiche-Link"
|
||||
data-scrutari-link="fiche_{{:codefiche}}"
|
||||
{{if _target}} target="{{:_target}}"{{/if}}>
|
||||
{{if mtitre}}
|
||||
{{:~scrutari_mark(mtitre)}}
|
||||
{{else}}
|
||||
{{:href}}
|
||||
{{/if}}
|
||||
</a>
|
||||
</p>
|
||||
</script>
|
||||
<script data-name="libreavous_end_ul" type="text/x-scrutari-template">
|
||||
</ul>
|
||||
</script>
|
||||
<script data-name="libreavous_start_ul" type="text/x-scrutari-template">
|
||||
<ul class="spip">
|
||||
</script>
|
||||
<script data-name="pagination_lav" type="text/x-scrutari-template">
|
||||
{{for array}}
|
||||
<div class="{{if !active}}scrutari-Hidden{{/if}}" data-scrutari-block="ficheGroup{{:suffix}}" data-scrutari-name="{{:name}}">
|
||||
<div data-scrutari-block="ficheList{{:suffix}}"></div>
|
||||
<div data-scrutari-block="bottomTabs{{:suffix}}"></div>
|
||||
</div>
|
||||
{{/for}}
|
||||
</script>
|
||||
|
@ -1,3 +1,6 @@
|
||||
[(#REM) Version 2.4.2 de Lity (à supprimer à la migration vers Spip 4.1)]
|
||||
[<script src="(#CHEMIN{javascript/lity/lity.js}|timestamp)"></script>]
|
||||
|
||||
|
||||
[(#REM) Version 1.0.7 de JsRender]
|
||||
[<script src="(#CHEMIN{javascript/jsrender/jsrender.min.js}|timestamp)"></script>]
|
||||
@ -8,9 +11,12 @@
|
||||
[(#REM) Version française]
|
||||
[<script src="(#CHEMIN{javascript/scrutarijs/l10n/fr.js}|timestamp)"></script>]
|
||||
|
||||
[(#REM) Structure et gabarits correspondant à l'absence de framework]
|
||||
[<script src="(#CHEMIN{javascript/scrutarijs/frameworks/none.js}|timestamp)"></script>]
|
||||
[(#REM) Client spécial LAV, c'est lui qui doit recevoir les modifications et adaptations]
|
||||
[<script src="(#CHEMIN{javascript/scrutarijs/Scrutari.Lav.js}|timestamp)"></script>]
|
||||
|
||||
[(#REM) Structure et gabarits par défaut]
|
||||
[<script src="(#CHEMIN{javascript/scrutarijs/frameworks/_default.js}|timestamp)"></script>]
|
||||
|
||||
[<link rel="stylesheet" href="(#CSS{javascript/lity/lity.css})" type="text/css" />]
|
||||
[<link rel="stylesheet" href="(#CSS{javascript/scrutarijs/scrutarijs.css})" type="text/css" />]
|
||||
[<link rel="stylesheet" href="(#CSS{javascript/scrutarijs/frameworks/none.css})" type="text/css" />]
|
||||
[<link rel="stylesheet" href="(#CSS{javascript/scrutarijs/perso.css})" type="text/css" />]
|
||||
|
200
squelettes/javascript/lity/lity.css
Normal file
200
squelettes/javascript/lity/lity.css
Normal file
@ -0,0 +1,200 @@
|
||||
/*! Lity - v2.4.1 - 2020-04-26
|
||||
* http://sorgalla.com/lity/
|
||||
* Copyright (c) 2015-2020 Jan Sorgalla; Licensed MIT */
|
||||
.lity {
|
||||
z-index: 9990;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
white-space: nowrap;
|
||||
background: #0b0b0b;
|
||||
background: rgba(0, 0, 0, 0.9);
|
||||
outline: none !important;
|
||||
opacity: 0;
|
||||
-webkit-transition: opacity 0.3s ease;
|
||||
-o-transition: opacity 0.3s ease;
|
||||
transition: opacity 0.3s ease;
|
||||
}
|
||||
.lity.lity-opened {
|
||||
opacity: 1;
|
||||
}
|
||||
.lity.lity-closed {
|
||||
opacity: 0;
|
||||
}
|
||||
.lity * {
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.lity-wrap {
|
||||
z-index: 9990;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
text-align: center;
|
||||
outline: none !important;
|
||||
}
|
||||
.lity-wrap:before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
height: 100%;
|
||||
vertical-align: middle;
|
||||
margin-right: -0.25em;
|
||||
}
|
||||
.lity-loader {
|
||||
z-index: 9991;
|
||||
color: #fff;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
margin-top: -0.8em;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
font-size: 14px;
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
opacity: 0;
|
||||
-webkit-transition: opacity 0.3s ease;
|
||||
-o-transition: opacity 0.3s ease;
|
||||
transition: opacity 0.3s ease;
|
||||
}
|
||||
.lity-loading .lity-loader {
|
||||
opacity: 1;
|
||||
}
|
||||
.lity-container {
|
||||
z-index: 9992;
|
||||
position: relative;
|
||||
text-align: left;
|
||||
vertical-align: middle;
|
||||
display: inline-block;
|
||||
white-space: normal;
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
outline: none !important;
|
||||
}
|
||||
.lity-content {
|
||||
z-index: 9993;
|
||||
width: 100%;
|
||||
-webkit-transform: scale(1);
|
||||
-ms-transform: scale(1);
|
||||
-o-transform: scale(1);
|
||||
transform: scale(1);
|
||||
-webkit-transition: -webkit-transform 0.3s ease;
|
||||
transition: -webkit-transform 0.3s ease;
|
||||
-o-transition: -o-transform 0.3s ease;
|
||||
transition: transform 0.3s ease;
|
||||
transition: transform 0.3s ease, -webkit-transform 0.3s ease, -o-transform 0.3s ease;
|
||||
}
|
||||
.lity-loading .lity-content,
|
||||
.lity-closed .lity-content {
|
||||
-webkit-transform: scale(0.8);
|
||||
-ms-transform: scale(0.8);
|
||||
-o-transform: scale(0.8);
|
||||
transform: scale(0.8);
|
||||
}
|
||||
.lity-content:after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
display: block;
|
||||
right: 0;
|
||||
width: auto;
|
||||
height: auto;
|
||||
z-index: -1;
|
||||
-webkit-box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
|
||||
box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
|
||||
}
|
||||
.lity-close {
|
||||
z-index: 9994;
|
||||
width: 35px;
|
||||
height: 35px;
|
||||
position: fixed;
|
||||
right: 0;
|
||||
top: 0;
|
||||
-webkit-appearance: none;
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
text-align: center;
|
||||
padding: 0;
|
||||
color: #fff;
|
||||
font-style: normal;
|
||||
font-size: 35px;
|
||||
font-family: Arial, Baskerville, monospace;
|
||||
line-height: 35px;
|
||||
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
|
||||
border: 0;
|
||||
background: none;
|
||||
outline: none;
|
||||
-webkit-box-shadow: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
.lity-close::-moz-focus-inner {
|
||||
border: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.lity-close:hover,
|
||||
.lity-close:focus,
|
||||
.lity-close:active,
|
||||
.lity-close:visited {
|
||||
text-decoration: none;
|
||||
text-align: center;
|
||||
padding: 0;
|
||||
color: #fff;
|
||||
font-style: normal;
|
||||
font-size: 35px;
|
||||
font-family: Arial, Baskerville, monospace;
|
||||
line-height: 35px;
|
||||
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
|
||||
border: 0;
|
||||
background: none;
|
||||
outline: none;
|
||||
-webkit-box-shadow: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
.lity-close:active {
|
||||
top: 1px;
|
||||
}
|
||||
/* Image */
|
||||
.lity-image img {
|
||||
max-width: 100%;
|
||||
display: block;
|
||||
line-height: 0;
|
||||
border: 0;
|
||||
}
|
||||
/* iFrame */
|
||||
.lity-iframe .lity-container,
|
||||
.lity-youtube .lity-container,
|
||||
.lity-vimeo .lity-container,
|
||||
.lity-facebookvideo .lity-container,
|
||||
.lity-googlemaps .lity-container {
|
||||
width: 100%;
|
||||
max-width: 964px;
|
||||
}
|
||||
.lity-iframe-container {
|
||||
width: 100%;
|
||||
height: 0;
|
||||
padding-top: 56.25%;
|
||||
overflow: auto;
|
||||
pointer-events: auto;
|
||||
-webkit-transform: translateZ(0);
|
||||
transform: translateZ(0);
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
.lity-iframe-container iframe {
|
||||
position: absolute;
|
||||
display: block;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
-webkit-box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
|
||||
box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
|
||||
background: #000;
|
||||
}
|
||||
.lity-hide {
|
||||
display: none;
|
||||
}
|
638
squelettes/javascript/lity/lity.js
Normal file
638
squelettes/javascript/lity/lity.js
Normal file
@ -0,0 +1,638 @@
|
||||
/*! Lity - v2.4.1 - 2020-04-26
|
||||
* http://sorgalla.com/lity/
|
||||
* Copyright (c) 2015-2020 Jan Sorgalla; Licensed MIT */
|
||||
(function(window, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define(['jquery'], function($) {
|
||||
return factory(window, $);
|
||||
});
|
||||
} else if (typeof module === 'object' && typeof module.exports === 'object') {
|
||||
module.exports = factory(window, require('jquery'));
|
||||
} else {
|
||||
window.lity = factory(window, window.jQuery || window.Zepto);
|
||||
}
|
||||
}(typeof window !== "undefined" ? window : this, function(window, $) {
|
||||
'use strict';
|
||||
|
||||
var document = window.document;
|
||||
|
||||
var _win = $(window);
|
||||
var _deferred = $.Deferred;
|
||||
var _html = $('html');
|
||||
var _instances = [];
|
||||
|
||||
var _attrAriaHidden = 'aria-hidden';
|
||||
var _dataAriaHidden = 'lity-' + _attrAriaHidden;
|
||||
|
||||
var _focusableElementsSelector = 'a[href],area[href],input:not([disabled]),select:not([disabled]),textarea:not([disabled]),button:not([disabled]),iframe,object,embed,[contenteditable],[tabindex]:not([tabindex^="-"])';
|
||||
|
||||
var _defaultOptions = {
|
||||
esc: true,
|
||||
handler: null,
|
||||
handlers: {
|
||||
image: imageHandler,
|
||||
inline: inlineHandler,
|
||||
youtube: youtubeHandler,
|
||||
vimeo: vimeoHandler,
|
||||
googlemaps: googlemapsHandler,
|
||||
facebookvideo: facebookvideoHandler,
|
||||
iframe: iframeHandler
|
||||
},
|
||||
template: '<div class="lity" role="dialog" aria-label="Dialog Window (Press escape to close)" tabindex="-1"><div class="lity-wrap" data-lity-close role="document"><div class="lity-loader" aria-hidden="true">Loading...</div><div class="lity-container"><div class="lity-content"></div><button class="lity-close" type="button" aria-label="Close (Press escape to close)" data-lity-close>×</button></div></div></div>'
|
||||
};
|
||||
|
||||
var _imageRegexp = /(^data:image\/)|(\.(png|jpe?g|gif|svg|webp|bmp|ico|tiff?)(\?\S*)?$)/i;
|
||||
var _youtubeRegex = /(youtube(-nocookie)?\.com|youtu\.be)\/(watch\?v=|v\/|u\/|embed\/?)?([\w-]{11})(.*)?/i;
|
||||
var _vimeoRegex = /(vimeo(pro)?.com)\/(?:[^\d]+)?(\d+)\??(.*)?$/;
|
||||
var _googlemapsRegex = /((maps|www)\.)?google\.([^\/\?]+)\/?((maps\/?)?\?)(.*)/i;
|
||||
var _facebookvideoRegex = /(facebook\.com)\/([a-z0-9_-]*)\/videos\/([0-9]*)(.*)?$/i;
|
||||
|
||||
var _transitionEndEvent = (function() {
|
||||
var el = document.createElement('div');
|
||||
|
||||
var transEndEventNames = {
|
||||
WebkitTransition: 'webkitTransitionEnd',
|
||||
MozTransition: 'transitionend',
|
||||
OTransition: 'oTransitionEnd otransitionend',
|
||||
transition: 'transitionend'
|
||||
};
|
||||
|
||||
for (var name in transEndEventNames) {
|
||||
if (el.style[name] !== undefined) {
|
||||
return transEndEventNames[name];
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
})();
|
||||
|
||||
function transitionEnd(element) {
|
||||
var deferred = _deferred();
|
||||
|
||||
if (!_transitionEndEvent || !element.length) {
|
||||
deferred.resolve();
|
||||
} else {
|
||||
element.one(_transitionEndEvent, deferred.resolve);
|
||||
setTimeout(deferred.resolve, 500);
|
||||
}
|
||||
|
||||
return deferred.promise();
|
||||
}
|
||||
|
||||
function settings(currSettings, key, value) {
|
||||
if (arguments.length === 1) {
|
||||
return $.extend({}, currSettings);
|
||||
}
|
||||
|
||||
if (typeof key === 'string') {
|
||||
if (typeof value === 'undefined') {
|
||||
return typeof currSettings[key] === 'undefined'
|
||||
? null
|
||||
: currSettings[key];
|
||||
}
|
||||
|
||||
currSettings[key] = value;
|
||||
} else {
|
||||
$.extend(currSettings, key);
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
function parseQueryParams(params) {
|
||||
var pairs = decodeURI(params.split('#')[0]).split('&');
|
||||
var obj = {}, p;
|
||||
|
||||
for (var i = 0, n = pairs.length; i < n; i++) {
|
||||
if (!pairs[i]) {
|
||||
continue;
|
||||
}
|
||||
|
||||
p = pairs[i].split('=');
|
||||
obj[p[0]] = p[1];
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
function appendQueryParams(url, params) {
|
||||
return url + (url.indexOf('?') > -1 ? '&' : '?') + $.param(params);
|
||||
}
|
||||
|
||||
function transferHash(originalUrl, newUrl) {
|
||||
var pos = originalUrl.indexOf('#');
|
||||
|
||||
if (-1 === pos) {
|
||||
return newUrl;
|
||||
}
|
||||
|
||||
if (pos > 0) {
|
||||
originalUrl = originalUrl.substr(pos);
|
||||
}
|
||||
|
||||
return newUrl + originalUrl;
|
||||
}
|
||||
|
||||
function error(msg) {
|
||||
return $('<span class="lity-error"></span>').append(msg);
|
||||
}
|
||||
|
||||
function imageHandler(target, instance) {
|
||||
var desc = (instance.opener() && instance.opener().data('lity-desc')) || 'Image with no description';
|
||||
var img = $('<img src="' + target + '" alt="' + desc + '"/>');
|
||||
var deferred = _deferred();
|
||||
var failed = function() {
|
||||
deferred.reject(error('Failed loading image'));
|
||||
};
|
||||
|
||||
img
|
||||
.on('load', function() {
|
||||
if (this.naturalWidth === 0) {
|
||||
return failed();
|
||||
}
|
||||
|
||||
deferred.resolve(img);
|
||||
})
|
||||
.on('error', failed)
|
||||
;
|
||||
|
||||
return deferred.promise();
|
||||
}
|
||||
|
||||
imageHandler.test = function(target) {
|
||||
return _imageRegexp.test(target);
|
||||
};
|
||||
|
||||
function inlineHandler(target, instance) {
|
||||
var el, placeholder, hasHideClass;
|
||||
|
||||
try {
|
||||
el = $(target);
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!el.length) {
|
||||
return false;
|
||||
}
|
||||
|
||||
placeholder = $('<i style="display:none !important"></i>');
|
||||
hasHideClass = el.hasClass('lity-hide');
|
||||
|
||||
instance
|
||||
.element()
|
||||
.one('lity:remove', function() {
|
||||
placeholder
|
||||
.before(el)
|
||||
.remove()
|
||||
;
|
||||
|
||||
if (hasHideClass && !el.closest('.lity-content').length) {
|
||||
el.addClass('lity-hide');
|
||||
}
|
||||
})
|
||||
;
|
||||
|
||||
return el
|
||||
.removeClass('lity-hide')
|
||||
.after(placeholder)
|
||||
;
|
||||
}
|
||||
|
||||
function youtubeHandler(target) {
|
||||
var matches = _youtubeRegex.exec(target);
|
||||
|
||||
if (!matches) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return iframeHandler(
|
||||
transferHash(
|
||||
target,
|
||||
appendQueryParams(
|
||||
'https://www.youtube' + (matches[2] || '') + '.com/embed/' + matches[4],
|
||||
$.extend(
|
||||
{
|
||||
autoplay: 1
|
||||
},
|
||||
parseQueryParams(matches[5] || '')
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
function vimeoHandler(target) {
|
||||
var matches = _vimeoRegex.exec(target);
|
||||
|
||||
if (!matches) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return iframeHandler(
|
||||
transferHash(
|
||||
target,
|
||||
appendQueryParams(
|
||||
'https://player.vimeo.com/video/' + matches[3],
|
||||
$.extend(
|
||||
{
|
||||
autoplay: 1
|
||||
},
|
||||
parseQueryParams(matches[4] || '')
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
function facebookvideoHandler(target) {
|
||||
var matches = _facebookvideoRegex.exec(target);
|
||||
|
||||
if (!matches) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (0 !== target.indexOf('http')) {
|
||||
target = 'https:' + target;
|
||||
}
|
||||
|
||||
return iframeHandler(
|
||||
transferHash(
|
||||
target,
|
||||
appendQueryParams(
|
||||
'https://www.facebook.com/plugins/video.php?href=' + target,
|
||||
$.extend(
|
||||
{
|
||||
autoplay: 1
|
||||
},
|
||||
parseQueryParams(matches[4] || '')
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
function googlemapsHandler(target) {
|
||||
var matches = _googlemapsRegex.exec(target);
|
||||
|
||||
if (!matches) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return iframeHandler(
|
||||
transferHash(
|
||||
target,
|
||||
appendQueryParams(
|
||||
'https://www.google.' + matches[3] + '/maps?' + matches[6],
|
||||
{
|
||||
output: matches[6].indexOf('layer=c') > 0 ? 'svembed' : 'embed'
|
||||
}
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
function iframeHandler(target) {
|
||||
return '<div class="lity-iframe-container"><iframe frameborder="0" allowfullscreen allow="autoplay; fullscreen" src="' + target + '"/></div>';
|
||||
}
|
||||
|
||||
function winHeight() {
|
||||
return document.documentElement.clientHeight
|
||||
? document.documentElement.clientHeight
|
||||
: Math.round(_win.height());
|
||||
}
|
||||
|
||||
function keydown(e) {
|
||||
var current = currentInstance();
|
||||
|
||||
if (!current) {
|
||||
return;
|
||||
}
|
||||
|
||||
// ESC key
|
||||
if (e.keyCode === 27 && !!current.options('esc')) {
|
||||
current.close();
|
||||
}
|
||||
|
||||
// TAB key
|
||||
if (e.keyCode === 9) {
|
||||
handleTabKey(e, current);
|
||||
}
|
||||
}
|
||||
|
||||
function handleTabKey(e, instance) {
|
||||
var focusableElements = instance.element().find(_focusableElementsSelector);
|
||||
var focusedIndex = focusableElements.index(document.activeElement);
|
||||
|
||||
if (e.shiftKey && focusedIndex <= 0) {
|
||||
focusableElements.get(focusableElements.length - 1).focus();
|
||||
e.preventDefault();
|
||||
} else if (!e.shiftKey && focusedIndex === focusableElements.length - 1) {
|
||||
focusableElements.get(0).focus();
|
||||
e.preventDefault();
|
||||
}
|
||||
}
|
||||
|
||||
function resize() {
|
||||
$.each(_instances, function(i, instance) {
|
||||
instance.resize();
|
||||
});
|
||||
}
|
||||
|
||||
function registerInstance(instanceToRegister) {
|
||||
if (1 === _instances.unshift(instanceToRegister)) {
|
||||
_html.addClass('lity-active');
|
||||
|
||||
_win
|
||||
.on({
|
||||
resize: resize,
|
||||
keydown: keydown
|
||||
})
|
||||
;
|
||||
}
|
||||
|
||||
$('body > *').not(instanceToRegister.element())
|
||||
.addClass('lity-hidden')
|
||||
.each(function() {
|
||||
var el = $(this);
|
||||
|
||||
if (undefined !== el.data(_dataAriaHidden)) {
|
||||
return;
|
||||
}
|
||||
|
||||
el.data(_dataAriaHidden, el.attr(_attrAriaHidden) || null);
|
||||
})
|
||||
.attr(_attrAriaHidden, 'true')
|
||||
;
|
||||
}
|
||||
|
||||
function removeInstance(instanceToRemove) {
|
||||
var show;
|
||||
|
||||
instanceToRemove
|
||||
.element()
|
||||
.attr(_attrAriaHidden, 'true')
|
||||
;
|
||||
|
||||
if (1 === _instances.length) {
|
||||
_html.removeClass('lity-active');
|
||||
|
||||
_win
|
||||
.off({
|
||||
resize: resize,
|
||||
keydown: keydown
|
||||
})
|
||||
;
|
||||
}
|
||||
|
||||
_instances = $.grep(_instances, function(instance) {
|
||||
return instanceToRemove !== instance;
|
||||
});
|
||||
|
||||
if (!!_instances.length) {
|
||||
show = _instances[0].element();
|
||||
} else {
|
||||
show = $('.lity-hidden');
|
||||
}
|
||||
|
||||
show
|
||||
.removeClass('lity-hidden')
|
||||
.each(function() {
|
||||
var el = $(this), oldAttr = el.data(_dataAriaHidden);
|
||||
|
||||
if (!oldAttr) {
|
||||
el.removeAttr(_attrAriaHidden);
|
||||
} else {
|
||||
el.attr(_attrAriaHidden, oldAttr);
|
||||
}
|
||||
|
||||
el.removeData(_dataAriaHidden);
|
||||
})
|
||||
;
|
||||
}
|
||||
|
||||
function currentInstance() {
|
||||
if (0 === _instances.length) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return _instances[0];
|
||||
}
|
||||
|
||||
function factory(target, instance, handlers, preferredHandler) {
|
||||
var handler = 'inline', content;
|
||||
|
||||
var currentHandlers = $.extend({}, handlers);
|
||||
|
||||
if (preferredHandler && currentHandlers[preferredHandler]) {
|
||||
content = currentHandlers[preferredHandler](target, instance);
|
||||
handler = preferredHandler;
|
||||
} else {
|
||||
// Run inline and iframe handlers after all other handlers
|
||||
$.each(['inline', 'iframe'], function(i, name) {
|
||||
delete currentHandlers[name];
|
||||
|
||||
currentHandlers[name] = handlers[name];
|
||||
});
|
||||
|
||||
$.each(currentHandlers, function(name, currentHandler) {
|
||||
// Handler might be "removed" by setting callback to null
|
||||
if (!currentHandler) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (
|
||||
currentHandler.test &&
|
||||
!currentHandler.test(target, instance)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
content = currentHandler(target, instance);
|
||||
|
||||
if (false !== content) {
|
||||
handler = name;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return {handler: handler, content: content || ''};
|
||||
}
|
||||
|
||||
function Lity(target, options, opener, activeElement) {
|
||||
var self = this;
|
||||
var result;
|
||||
var isReady = false;
|
||||
var isClosed = false;
|
||||
var element;
|
||||
var content;
|
||||
|
||||
options = $.extend(
|
||||
{},
|
||||
_defaultOptions,
|
||||
options
|
||||
);
|
||||
|
||||
element = $(options.template);
|
||||
|
||||
// -- API --
|
||||
|
||||
self.element = function() {
|
||||
return element;
|
||||
};
|
||||
|
||||
self.opener = function() {
|
||||
return opener;
|
||||
};
|
||||
|
||||
self.options = $.proxy(settings, self, options);
|
||||
self.handlers = $.proxy(settings, self, options.handlers);
|
||||
|
||||
self.resize = function() {
|
||||
if (!isReady || isClosed) {
|
||||
return;
|
||||
}
|
||||
|
||||
content
|
||||
.css('max-height', winHeight() + 'px')
|
||||
.trigger('lity:resize', [self])
|
||||
;
|
||||
};
|
||||
|
||||
self.close = function() {
|
||||
if (!isReady || isClosed) {
|
||||
return;
|
||||
}
|
||||
|
||||
isClosed = true;
|
||||
|
||||
removeInstance(self);
|
||||
|
||||
var deferred = _deferred();
|
||||
|
||||
// We return focus only if the current focus is inside this instance
|
||||
if (
|
||||
activeElement &&
|
||||
(
|
||||
document.activeElement === element[0] ||
|
||||
$.contains(element[0], document.activeElement)
|
||||
)
|
||||
) {
|
||||
try {
|
||||
activeElement.focus();
|
||||
} catch (e) {
|
||||
// Ignore exceptions, eg. for SVG elements which can't be
|
||||
// focused in IE11
|
||||
}
|
||||
}
|
||||
|
||||
content.trigger('lity:close', [self]);
|
||||
|
||||
element
|
||||
.removeClass('lity-opened')
|
||||
.addClass('lity-closed')
|
||||
;
|
||||
|
||||
transitionEnd(content.add(element))
|
||||
.always(function() {
|
||||
content.trigger('lity:remove', [self]);
|
||||
element.remove();
|
||||
element = undefined;
|
||||
deferred.resolve();
|
||||
})
|
||||
;
|
||||
|
||||
return deferred.promise();
|
||||
};
|
||||
|
||||
// -- Initialization --
|
||||
|
||||
result = factory(target, self, options.handlers, options.handler);
|
||||
|
||||
element
|
||||
.attr(_attrAriaHidden, 'false')
|
||||
.addClass('lity-loading lity-opened lity-' + result.handler)
|
||||
.appendTo('body')
|
||||
.focus()
|
||||
.on('click', '[data-lity-close]', function(e) {
|
||||
if ($(e.target).is('[data-lity-close]')) {
|
||||
self.close();
|
||||
}
|
||||
})
|
||||
.trigger('lity:open', [self])
|
||||
;
|
||||
|
||||
registerInstance(self);
|
||||
|
||||
$.when(result.content)
|
||||
.always(ready)
|
||||
;
|
||||
|
||||
function ready(result) {
|
||||
content = $(result)
|
||||
.css('max-height', winHeight() + 'px')
|
||||
;
|
||||
|
||||
element
|
||||
.find('.lity-loader')
|
||||
.each(function() {
|
||||
var loader = $(this);
|
||||
|
||||
transitionEnd(loader)
|
||||
.always(function() {
|
||||
loader.remove();
|
||||
})
|
||||
;
|
||||
})
|
||||
;
|
||||
|
||||
element
|
||||
.removeClass('lity-loading')
|
||||
.find('.lity-content')
|
||||
.empty()
|
||||
.append(content)
|
||||
;
|
||||
|
||||
isReady = true;
|
||||
|
||||
content
|
||||
.trigger('lity:ready', [self])
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
function lity(target, options, opener) {
|
||||
if (!target.preventDefault) {
|
||||
opener = $(opener);
|
||||
} else {
|
||||
target.preventDefault();
|
||||
opener = $(this);
|
||||
target = opener.data('lity-target') || opener.attr('href') || opener.attr('src');
|
||||
}
|
||||
|
||||
var instance = new Lity(
|
||||
target,
|
||||
$.extend(
|
||||
{},
|
||||
opener.data('lity-options') || opener.data('lity'),
|
||||
options
|
||||
),
|
||||
opener,
|
||||
document.activeElement
|
||||
);
|
||||
|
||||
if (!target.preventDefault) {
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
|
||||
lity.version = '2.4.1';
|
||||
lity.options = $.proxy(settings, lity, _defaultOptions);
|
||||
lity.handlers = $.proxy(settings, lity, _defaultOptions.handlers);
|
||||
lity.current = currentInstance;
|
||||
|
||||
$(document).on('click.lity', '[data-lity]', lity);
|
||||
|
||||
return lity;
|
||||
}));
|
246
squelettes/javascript/scrutarijs/Scrutari.Lav.js
Normal file
246
squelettes/javascript/scrutarijs/Scrutari.Lav.js
Normal file
@ -0,0 +1,246 @@
|
||||
/* global Scrutari */
|
||||
|
||||
/**
|
||||
* Surcharge et complément du client ScrutariJs pour le site librevous.org
|
||||
*/
|
||||
|
||||
Scrutari.Lav = {};
|
||||
|
||||
/**
|
||||
* Adresse du serveur Scrutari
|
||||
*/
|
||||
Scrutari.Lav.SCRUTARI_URL = "https://sct2.scrutari.net/sct/april_libreavous/";
|
||||
/**
|
||||
* Nombre de fiches dans une pagination
|
||||
*/
|
||||
Scrutari.Lav.PAGINATION_LENGTH = 20;
|
||||
/**
|
||||
* Tableau des différentes paginations, la première est la pagination sur la totalité des sites, les autres sont les paginations par site
|
||||
*/
|
||||
Scrutari.Lav.PAGINATION_ARRAY = ["", "libreavous", "librealire"];
|
||||
/**
|
||||
* Indication s'il s'agit de la version de développement
|
||||
*/
|
||||
Scrutari.Lav.DEV = false;
|
||||
|
||||
/**
|
||||
* Fonction utilitaire de formatage de la séquence de recherche pour l'affichage
|
||||
*/
|
||||
Scrutari.Lav.formatSearchSequence = function (client, scrutariResult) {
|
||||
var q = scrutariResult.getQ();
|
||||
q = q.replace(/\&\&/g, '@%et%@');
|
||||
q = q.replace(/\|\|/g, '@%ou%@');
|
||||
q = q.replace(/\*/g, '@%*%@');
|
||||
q = Scrutari.escape(q);
|
||||
q = q.replace(/@%/g, '<span class="scrutari-lav-Operateur">');
|
||||
q = q.replace(/%@/g, '</span>');
|
||||
return q;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Fonction principale d'initialisation du client. Remplace Scrutari.DefaultUi.init
|
||||
*/
|
||||
Scrutari.Lav.init = function (client) {
|
||||
var scrutariMeta = client.scrutariMeta;
|
||||
client.lav = {}; //propriété lav pour conserver des données propres à ce client
|
||||
_initLav();
|
||||
if (Scrutari.Lav.DEV) { //Code propre à la version de développement, en production la structure est en dur dans le squelette Spip
|
||||
$("#" + client.clientId).html(client.compileStructure("main"));
|
||||
$("#zone").html(client.compileStructure("main", {
|
||||
noLoc: true,
|
||||
withIndent: true,
|
||||
withPath: true
|
||||
}));
|
||||
}
|
||||
client.initForms();
|
||||
client.initButtons(Scrutari.Lav.actionHandler);
|
||||
client.initChangeListeners(Scrutari.Lav.changeHandler);
|
||||
client.checkInitialQuery();
|
||||
|
||||
function _initLav() {
|
||||
let paginationArray = new Array();
|
||||
for(let name of Scrutari.Lav.PAGINATION_ARRAY) {
|
||||
let active = false;
|
||||
let suffix = "-" + name;
|
||||
let radio = name;
|
||||
if (!name) { // valeurs particulières pour « tous »
|
||||
active = true;
|
||||
suffix = "";
|
||||
radio = "tous";
|
||||
}
|
||||
paginationArray.push({
|
||||
name: name,
|
||||
active: active,
|
||||
suffix: suffix,
|
||||
radio: radio
|
||||
});
|
||||
}
|
||||
client.lav.paginationArray = paginationArray;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Fonction d'enrichissement du processus d'affichage des résultats.
|
||||
* la méthode addPaginisations de la classe Scrutari.Process est remplacée pour que trois paginations
|
||||
* soient créés : celle, normale, de toutes les fiches et une par site
|
||||
* Remplace Scrutari.DefaultUi.newResultProcess
|
||||
*/
|
||||
Scrutari.Lav.newResultProcess = function (client, scrutariResult, searchOrigin) {
|
||||
var resultProcess = new Scrutari.Process(client, scrutariResult, searchOrigin);
|
||||
resultProcess.addPaginations = function ($paginationBlock) {
|
||||
_addPaginations($paginationBlock);
|
||||
};
|
||||
var libreavousArray = new Array();
|
||||
var librealireArray = new Array();
|
||||
var length = scrutariResult.ficheGroupArray.length;
|
||||
if (length > 0) {
|
||||
for(let fiche of scrutariResult.ficheGroupArray[0].ficheArray) {
|
||||
if (fiche.codecorpus === 1222) {
|
||||
libreavousArray.push(fiche);
|
||||
} else {
|
||||
librealireArray.push(fiche);
|
||||
}
|
||||
}
|
||||
}
|
||||
var arrays = {
|
||||
libreavous: libreavousArray,
|
||||
librealire: librealireArray
|
||||
};
|
||||
return resultProcess;
|
||||
|
||||
function _addPaginations($paginationBlock) {
|
||||
$paginationBlock.html(client.render("pagination_lav", {array: client.lav.paginationArray}));
|
||||
client.$count("total-tous", 'update', scrutariResult.getFicheCount());
|
||||
for(let config of client.lav.paginationArray) {
|
||||
let pagination = new Scrutari.Pagination(client, config.name);
|
||||
if (config.name) {
|
||||
client.$count("total-" + config.name, 'update', arrays[config.name].length);
|
||||
pagination.getPaginationFicheArray = function (scrutariResult, paginationNumber) {
|
||||
return _getPaginationFicheArray(config.name, pagination.paginationLength, paginationNumber);
|
||||
};
|
||||
}
|
||||
client.putPagination(config.name, pagination);
|
||||
pagination.change(1);
|
||||
}
|
||||
}
|
||||
|
||||
function _getPaginationFicheArray(name, paginationLength, paginationNumber) {
|
||||
let array = arrays[name];
|
||||
return Scrutari.Utils.extractFicheArray(array, paginationLength, paginationNumber);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Personnalisation des actions sur les boutons, passée à client.initButtons()
|
||||
*/
|
||||
Scrutari.Lav.actionHandler = function (client, button, action, target) {
|
||||
switch(action) {
|
||||
case 'copyPermalink':
|
||||
navigator.clipboard.writeText($(button).attr("href"));
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
/**
|
||||
* Personnalisation des écouteurs actions sur les boutons, passée à client.initButtons()
|
||||
*/
|
||||
Scrutari.Lav.changeHandler = function (client, element, name) {
|
||||
switch(name) {
|
||||
case 'lav-site':
|
||||
if (element.checked) {
|
||||
_setSiteFilter(element.value);
|
||||
}
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
function _setSiteFilter (value) {
|
||||
let suffix = "";
|
||||
for(let pagination of client.lav.paginationArray) {
|
||||
if (value === pagination.radio) {
|
||||
pagination.active = true;
|
||||
suffix = pagination.suffix;
|
||||
} else {
|
||||
pagination.active = false;
|
||||
}
|
||||
}
|
||||
let activeBlockName = "ficheGroup" + suffix;
|
||||
client.$block("ficheGroup", "*").each(function (index, element) {
|
||||
if (element.dataset.scrutariBlock === activeBlockName) {
|
||||
client.show(element);
|
||||
} else {
|
||||
client.hide(element);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Objet définissant les points d'entrée (hook) particuliers, transmis à la configuration
|
||||
*/
|
||||
Scrutari.Lav.HOOKS = {
|
||||
completeFiche : function (scrutariResult, fiche, categoryName) { //Extrait le numéro du titre
|
||||
let start = fiche.mtitre[0];
|
||||
let numero = "";
|
||||
if (start.startsWith("#")) {
|
||||
let idx = start.indexOf("-");
|
||||
if (idx > 0) {
|
||||
numero = start.substring(0, idx).trim();
|
||||
fiche.mtitre[0] = start.substring(idx + 1);
|
||||
}
|
||||
}
|
||||
fiche._numero = numero;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Objet centralisant les fonctions surchargées du client
|
||||
*/
|
||||
Scrutari.Lav.FUNCTIONS = {
|
||||
uiInit: function (client) {
|
||||
Scrutari.Lav.init(client);
|
||||
},
|
||||
ignoreElement: null,
|
||||
isFilterEnable: null,
|
||||
mainsearchResultCallback: function (client, scrutariResult) {
|
||||
$("#scrutari_lav_sequence").html(Scrutari.Lav.formatSearchSequence(client, scrutariResult));
|
||||
},
|
||||
mainsearchErrorCallback: null,
|
||||
subsearchResultCallback: null,
|
||||
subsearchErrorCallback: null,
|
||||
initFilterByQuery: null,
|
||||
newResultProcess: function (client, scrutariResult, searchOrigin) {
|
||||
return Scrutari.Lav.newResultProcess(client, scrutariResult, searchOrigin);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Initialisation du client
|
||||
*/
|
||||
$(function () {
|
||||
var scrutariConfig = new Scrutari.Config("libreavous", Scrutari.Lav.SCRUTARI_URL, "fr", "site", {
|
||||
paginationLength: Scrutari.Lav.PAGINATION_LENGTH,
|
||||
limit: -1
|
||||
});
|
||||
Scrutari.Client.init(scrutariConfig, "scrutari_client", {
|
||||
withCorpus: false,
|
||||
ficheTarget: "_blank",
|
||||
ficheBodyList: "fiche_mtitre,fiche_msoustitre,libreavous_start_ul,fiche_primaryattributearray,fiche_mcomplementarray,fiche_secondaryattributearray,fiche_motclearray,fiche_bythesaurusarray,libreavous_end_ul", //Ajout de libreavous_start_ul et libreavous_end_ul, retrait de fiche_year
|
||||
initialQuery: "",
|
||||
initialQId: "",
|
||||
ignoreList: "area-title,area-stats,modal-*", //Utilisé en mode développement
|
||||
permalinkPattern: "https://www.libreavous.org/spip.php?page=scrutarijs&qid=$QID",
|
||||
hooks: Scrutari.Lav.HOOKS,
|
||||
functions: Scrutari.Lav.FUNCTIONS
|
||||
|
||||
}, function (client) {
|
||||
|
||||
});
|
||||
});
|
52
squelettes/javascript/scrutarijs/frameworks/_default.js
Normal file
52
squelettes/javascript/scrutarijs/frameworks/_default.js
Normal file
@ -0,0 +1,52 @@
|
||||
var SCRUTARI_HTML = {
|
||||
_name:'_default',
|
||||
structure:{
|
||||
'area-input':'<div data-scrutari-area="input"> <input type="text" class="scrutari-input-Text" size="40" name="q" value=""> <button type="submit">_ button_submit</button> <button type="button" data-scrutari-button="parametersDisplay" class="scrutari-Hidden" data-scrutari-state="off"> _ button_parameters </button> </div>',
|
||||
'area-parameters':'<div data-scrutari-area="parameters" class="scrutari-area-Parameters scrutari-Hidden"> {{panel-options}} {{panel-corpus}} {{panel-base}} {{panel-lang}} {{panel-category}} <div class="scrutari-area-Resubmit"> <button type="submit">_ button_resubmit</button> </div> </div>',
|
||||
'area-result':'<div data-scrutari-area="result" class="scrutari-area-Result"> <div data-scrutari-block="paginationBlock"></div> <div class="scrutari-Hidden" data-scrutari-hidden="empty"> {{result-links}} </div> {{result-history}} <div class="scrutari-Hidden" data-scrutari-hidden="threshold"> {{result-subsearch}} </div> <div class="scrutari-Hidden" data-scrutari-hidden="empty"> {{result-poweredby}} </div> </div>',
|
||||
'area-stats':'<div data-scrutari-area="stats" class="scrutari-area-Stats"> {{stats-table}} </div> ',
|
||||
'area-title':'<div data-scrutari-area="title" class="scrutari-area-Title"> <p class="scrutari-title-Main" data-scrutari-title="main"></p> </div> ',
|
||||
'main-form':'<form data-scrutari-form="mainsearch"> {{area-input}} {{area-parameters}} </form>',
|
||||
'main':'{{area-title}} {{main-form}} {{area-stats}} {{area-result}} {{modal-*}}',
|
||||
'modal-help_mode':'<section class="scrutari-Hidden" data-scrutari-modal="help_mode" aria-hidden="true"> <header> _ mode_help </header> <div> _ help_mode.html </div> </section>',
|
||||
'modal-help_periode':'<section class="scrutari-Hidden" data-scrutari-modal="help_periode" aria-hidden="true"> <header> _ periode_help </header> <div> _ help_periode.html </div> </section>',
|
||||
'modal-help_ponderation':'<section class="scrutari-Hidden" data-scrutari-modal="help_ponderation" aria-hidden="true"> <header> _ ponderation_help </header> <div> _ help_ponderation.html </div> </section>',
|
||||
'modal-loading':'<section class="scrutari-Hidden" data-scrutari-modal="loading" aria-hidden="true"> <div> <span class="scrutari-icon-Loader"></span> _ loading_search </div> </section>',
|
||||
'panel-base':'<section class="scrutari-Hidden" data-scrutari-panel="base"> <header> <h1 data-scrutari-button="toggleBlock" data-scrutari-state="off" data-scrutari-target="basePanelBody"> _ title_filter_base <span data-scrutari-label="baseFilter" class="scrutari-panel-State scrutari-Disabled" data-scrutari-alternate="_ filter_on">_ filter_off</span> </h1> </header> <div class="scrutari-Hidden" data-scrutari-block="basePanelBody"> <div> <span> <button type="button" data-scrutari-button="enablePanel" data-scrutari-target="base" data-scrutari-state="off"> <span data-scrutari-alternate="_ button_filter_off">_ button_filter_on</span> </button> </span> <span> <button type="button" data-scrutari-button="checkAll" data-scrutari-target="base" disabled>_ button_check_all</button> <button type="button" data-scrutari-button="uncheckAll" data-scrutari-target="base" disabled>_ button_uncheck_all</button> </span> </div> <div> <div class="scrutari-panel-ColumnDisabled" data-scrutari-group="baseColumns"></div> <div class="scrutari-panel-ColumnDisabled" data-scrutari-group="baseColumns"></div> <div class="scrutari-panel-ColumnDisabled" data-scrutari-group="baseColumns"></div> <div class="scrutari-panel-ColumnDisabled" data-scrutari-group="baseColumns"></div> </div> </div> </section>',
|
||||
'panel-category':'<section class="scrutari-Hidden" data-scrutari-panel="category"> <header> <h1 data-scrutari-button="toggleBlock" data-scrutari-state="off" data-scrutari-target="categoryPanelBody"> _ title_filter_category <span data-scrutari-label="categoryFilter" class="scrutari-panel-State scrutari-Disabled" data-scrutari-alternate="_ filter_on">_ filter_off</span> </h1> </header> <div class="scrutari-Hidden" data-scrutari-block="categoryPanelBody"> <div> <span> <button type="button" data-scrutari-button="enablePanel" data-scrutari-target="category" data-scrutari-state="off"> <span data-scrutari-alternate="_ button_filter_off">_ button_filter_on</span> </button> </span> <span> <button type="button" data-scrutari-button="checkAll" data-scrutari-target="category" disabled>_ button_check_all</button> <button type="button" data-scrutari-button="uncheckAll" data-scrutari-target="category" disabled>_ button_uncheck_all</button> </span> </div> <div > <div class="scrutari-panel-ColumnDisabled" data-scrutari-group="categoryColumns"></div> <div class="scrutari-panel-ColumnDisabled" data-scrutari-group="categoryColumns"></div> <div class="scrutari-panel-ColumnDisabled" data-scrutari-group="categoryColumns"></div> <div class="scrutari-panel-ColumnDisabled" data-scrutari-group="categoryColumns"></div> </div> </div> </section>',
|
||||
'panel-corpus':'<section class="scrutari-Hidden" data-scrutari-panel="corpus"> <header> <h1 data-scrutari-button="toggleBlock" data-scrutari-state="off" data-scrutari-target="corpusPanelBody"> _ title_filter_corpus <span data-scrutari-label="corpusFilter" class="scrutari-panel-State scrutari-Disabled" data-scrutari-alternate="_ filter_on">_ filter_off</span> </h1> </header> <div class="scrutari-Hidden" data-scrutari-block="corpusPanelBody"> <div> <span> <button type="button" data-scrutari-button="enablePanel" data-scrutari-target="corpus" data-scrutari-state="off"> <span data-scrutari-alternate="_ button_filter_off">_ button_filter_on</span> </button> </span> <span> <button type="button" data-scrutari-button="checkAll" data-scrutari-target="corpus" disabled>_ button_check_all</button> <button type="button" data-scrutari-button="uncheckAll" data-scrutari-target="corpus" disabled>_ button_uncheck_all</button> </span> </div> <div> <div class="scrutari-panel-ColumnDisabled" data-scrutari-group="corpusColumns"></div> <div class="scrutari-panel-ColumnDisabled" data-scrutari-group="corpusColumns"></div> <div class="scrutari-panel-ColumnDisabled" data-scrutari-group="corpusColumns"></div> <div class="scrutari-panel-ColumnDisabled" data-scrutari-group="corpusColumns"></div> </div> </div> </section>',
|
||||
'panel-lang':'<section class="scrutari-Hidden" data-scrutari-panel="lang"> <header> <h1 data-scrutari-button="toggleBlock" data-scrutari-state="off" data-scrutari-target="langPanelBody"> _ title_filter_lang <span data-scrutari-label="langFilter" class="scrutari-panel-State scrutari-Disabled" data-scrutari-alternate="_ filter_on">_ filter_off</span> </h1> </header> <div class="scrutari-Hidden" data-scrutari-block="langPanelBody"> <div> <span> <button type="button" data-scrutari-button="enablePanel" data-scrutari-target="lang" data-scrutari-state="off"> <span data-scrutari-alternate="_ button_filter_off">_ button_filter_on</span> </button> </span> <span> <button type="button" data-scrutari-button="checkAll" data-scrutari-target="lang" disabled>_ button_check_all</button> <button type="button" data-scrutari-button="uncheckAll" data-scrutari-target="lang" disabled>_ button_uncheck_all</button> </span> </div> <div> <div class="scrutari-panel-ColumnDisabled" data-scrutari-group="langColumns"></div> <div class="scrutari-panel-ColumnDisabled" data-scrutari-group="langColumns"></div> <div class="scrutari-panel-ColumnDisabled" data-scrutari-group="langColumns"></div> <div class="scrutari-panel-ColumnDisabled" data-scrutari-group="langColumns"></div> </div> </div> </section>',
|
||||
'panel-options':'<section data-scrutari-panel="options"> <header> <h1 data-scrutari-button="toggleBlock" data-scrutari-state="off" data-scrutari-target="optionsPanelBody"> _ title_options </h1> </header> <div class="scrutari-Hidden" data-scrutari-block="optionsPanelBody"> <div> <div> <p><span>_ mode_title</span><button data-scrutari-button="showModal" data-scrutari-target="help_mode" type="button" title="_ mode_help">?</button></p> <p><label class="scrutari-Label"><input type="radio" name="q-mode" value="intersection" checked> _ mode_intersection</label></p> <p><label class="scrutari-Label"><input type="radio" name="q-mode" value="union"> _ mode_union</label></p> <p><label class="scrutari-Label"><input type="radio" name="q-mode" value="operation"> _ mode_operation</label></p> <p><label class="scrutari-Label"><input type="checkbox" name="wildchar" value="end" checked> _ wildchar_end</label></p> </div> <div> <p><span>_ ponderation_title</span><button data-scrutari-button="showModal" data-scrutari-target="help_ponderation" type="button" title="_ ponderation_help">?</button></p> <p><label class="scrutari-Label"><input type="radio" name="ponderation" value="pertinence" checked> _ ponderation_pertinence</label></p> <p><label class="scrutari-Label"><input type="radio" name="ponderation" value="date"> _ ponderation_date</label></p> </div> <div> <p><span>_ periode_title</span><button data-scrutari-button="showModal" data-scrutari-target="help_periode" type="button" title="_ periode_help">?</button></p> <p><input type="text" class="scrutari-input-Text" name="periode" value="" size="20"></p> </div> </div> </div> </section>',
|
||||
'result-history':'<div class="scrutari-Hidden" data-scrutari-hidden="start"> <p class="scrutari-links-Title">_ title_history</p> <div data-scrutari-block="historyList"> </div> </div>',
|
||||
'result-links':'<p class="scrutari-links-Title">_ title_share</p> <p class="scrutari-links-Permalink"> <a href="#" data-scrutari-link="permalink" target="_blank" title="_ link_permalink" > <span data-scrutari-label="permalinkValue"></span> </a> </p> <p class="scrutari-links-Title">_ title_download</p> <p> <a href="#" data-scrutari-link="ods" target="_blank" title="_ link_ods" class="scrutari-links-ButtonLike">ods</a> <a href="#" data-scrutari-link="csv" target="_blank" title="_ link_csv" class="scrutari-links-ButtonLike">csv</a> </p> <p class="scrutari-links-Title">_ title_feed</p> <p> <a href="#" data-scrutari-link="atom" target="_blank" title="_ link_atom" class="scrutari-links-ButtonLike">atom</a> </p>',
|
||||
'result-poweredby':'<p class="scrutari-links-Poweredby"><a href="http://www.scrutari.net" target="_blank"><span class="scrutari-icon-Logo"></span> _ link_poweredby</a></p>',
|
||||
'result-subsearch':'<form data-scrutari-form="subsearch"> <p class="scrutari-subsearch-Title">_ title_subsearch</p> <input type="text" class="scrutari-input-Text" size="40" name="q"> <button type="submit">_ button_subsearch</button> </form>',
|
||||
'stats-filter':'<tr class="scrutari-Hidden" data-scrutari-hidden="filter" data-scrutari-count="stats-filter"> <td class="scrutari-stats-Cell"><abbr class="scrutari-stats-Abbr" title="_ stats_filter_title">_ stats_filter_short</abbr></td> <td class="scrutari-stats-Cell scrutari-stats-Number"><span class="scrutari-stats-Count" data-scrutari-component="value"></span></td> <td class="scrutari-stats-Cell scrutari-stats-Titles"><span data-scrutari-component="titles"></span></td> </tr>',
|
||||
'stats-global':'<tr class="scrutari-Hidden" data-scrutari-hidden="init" data-scrutari-count="stats-global"> <td class="scrutari-stats-Cell"><abbr class="scrutari-stats-Abbr" title="_ stats_global_title">_ stats_global_short</abbr></td> <td class="scrutari-stats-Cell scrutari-stats-Number"><span class="scrutari-stats-Count" data-scrutari-component="value"></span></td> </tr>',
|
||||
'stats-result':'<tr class="scrutari-Hidden" data-scrutari-hidden="start" data-scrutari-count="stats-result"> <td class="scrutari-stats-Cell"><abbr class="scrutari-stats-Abbr" title="_ stats_result_title">_ stats_result_short</abbr></td> <td class="scrutari-stats-Cell scrutari-stats-Number"><span class="scrutari-stats-Count" data-scrutari-component="value"></span></td> </tr>',
|
||||
'stats-table':'<table class="scrutari-stats-Table"> {{stats-global}} {{stats-filter}} {{stats-result}} </table> '
|
||||
},
|
||||
templates:{
|
||||
'base':' <p> <label class="scrutari-Label" {{if phraseMap.longtitle}}title="{{> phraseMap.longtitle}}"{{/if}}><input type="checkbox" name="base" value="{{:codebase}}" data-scrutari-title="{{> title}}"> {{if baseicon}} <img src="{{:baseicon}}" alt="" class="scrutari-panel-Icon"> {{/if}} <span data-scrutari-component="stat-text">{{> title}} <small>(<span data-scrutari-stat-type="base" data-scrutari-stat-key="{{:codebase}}" data-scrutari-stat-default="{{:stats.fiche}}"></span>{{:~scrutari_format(stats.fiche)}})</small></span> </label> </p>',
|
||||
'category':' <p> <label class="scrutari-Label" {{if phraseMap.description}}title="{{> phraseMap.description}}"{{/if}}> <input type="checkbox" name="category" value="{{:name}}" data-scrutari-title="{{> title}}"> <span data-scrutari-component="stat-text">{{> title}} <small>(<span data-scrutari-stat-type="category" data-scrutari-stat-key="{{:name}}" data-scrutari-stat-default="{{:stats.fiche}}"></span>{{:~scrutari_format(stats.fiche)}})</small></span> </label> </p>',
|
||||
'corpus':' <p> <label class="scrutari-Label"><input type="checkbox" name="corpus" value="{{:codecorpus}}" data-scrutari-title="{{> title}}"> <span data-scrutari-component="stat-text">{{> title}} <small>(<span data-scrutari-stat-type="corpus" data-scrutari-stat-key="{{:codecorpus}}" data-scrutari-stat-default="{{:stats.fiche}}"></span>{{:~scrutari_format(stats.fiche)}})</small></span> </label> </p>',
|
||||
'fiche':' <div class="scrutari-fiche-Block" data-scrutari-block="fiche-{{:codefiche}}"> {{include tmpl="fiche_icon" /}} <div class="scrutari-fiche-Body {{if _thumbnail}}scrutari-fiche-ThumbnailBody{{/if}}"> {{for _bodyTemplateArray ~fiche=#data}} {{include ~fiche tmpl=~scrutari_client.getTemplate(#data) /}} {{/for}} </div> </div> ',
|
||||
'fiche_attribute':'{{if type!=="block"}} <p class="scrutari-fiche-Attribute"> <span class="scrutari-label-Attribute">{{>title}}{{>~scrutari_loc("_ colon")}}</span> {{for valueArray ~len=valueArray.length}} {{:~scrutari_mark(#data)}}{{if #index != (~len -1)}}, {{/if}} {{/for}} </p> {{else}} <div class="scrutari-fiche-AttributeBlock"> <p class="scrutari-fiche-AttributeTitle"> <span class="scrutari-label-Attribute">{{>title}}{{>~scrutari_loc("_ colon")}}</span> </p> <div class="scrutari-fiche-AttributeValues"> {{for valueArray ~len=valueArray.length}} <p class="scrutari-fiche-AttributeValue"> {{:~scrutari_mark(#data)}} </p> {{/for}} </div> </div> {{/if}}',
|
||||
'fiche_bythesaurusarray':'{{if _bythesaurusArray}} {{for _bythesaurusArray}} <p class="scrutari-fiche-Motcle"> <span class="scrutari-label-Motcle"> {{> thesaurus.title}}{{>~scrutari_loc("_ colon")}} </span> {{for motcleArray ~len=motcleArray.length}} {{if mlabelArray}}{{for mlabelArray}}{{if #index > 0}}/{{/if}}{{:~scrutari_mark(mvalue)}}{{/for}}{{/if}}{{if #index != (~len -1)}}, {{/if}} {{/for}} </p> {{/for}} {{/if}} ',
|
||||
'fiche_icon':'{{if _thumbnail}} <div class="scrutari-fiche-Thumbnail"> <img class="scrutari-fiche-ThumbnailImg" alt="" src="{{:_thumbnail}}"/> {{if _icon}} <img class="scrutari-fiche-ThumbnailIcon" alt="" src="{{:_icon}}"/> {{/if}} </div> {{else _icon}} <div class="scrutari-fiche-Icon"><img alt="" src="{{:_icon}}"/></div> {{/if}} ',
|
||||
'fiche_mcomplementarray':'{{if mcomplementArray}} {{for mcomplementArray}} <p class="scrutari-fiche-Complement"> <span class="scrutari-label-Complement"> {{>title}}{{>~scrutari_loc("_ colon")}} </span> {{:~scrutari_mark(mvalue)}} </p> {{/for}} {{/if}} ',
|
||||
'fiche_motclearray':'{{if _motcleArray}} <p class="scrutari-fiche-Motcle"> <span class="scrutari-label-Motcle"> {{if _motcleArray.length == 1}} {{>~scrutari_loc("_ fiche_motscles_one")}} {{else}} {{>~scrutari_loc("_ fiche_motscles_many")}} {{/if}} </span> {{for _motcleArray ~len=_motcleArray.length}} {{if mlabelArray}}{{for mlabelArray}}{{if #index > 0}}/{{/if}}{{:~scrutari_mark(mvalue)}}{{/for}}{{/if}}{{if #index != (~len -1)}}, {{/if}} {{/for}} </p> {{/if}} ',
|
||||
'fiche_msoustitre':'{{if msoustitre}} <p class="scrutari-fiche-Soustitre"> {{:~scrutari_mark(msoustitre)}} </p> {{/if}} ',
|
||||
'fiche_mtitre':'<p class="scrutari-fiche-Titre"> <a href="{{:href}}" class="scrutari-fiche-Link" data-scrutari-link="fiche_{{:codefiche}}" {{if _target}} target="{{:_target}}"{{/if}}> {{if mtitre}} {{:~scrutari_mark(mtitre)}} {{else}} {{:href}} {{/if}} </a> </p> ',
|
||||
'fiche_primaryattributearray':'{{if _primaryAttributeArray}} {{for _primaryAttributeArray tmpl="fiche_attribute" /}} {{/if}} ',
|
||||
'fiche_secondaryattributearray':'{{if _secondaryAttributeArray}} {{for _secondaryAttributeArray tmpl="fiche_attribute" /}} {{/if}} ',
|
||||
'fiche_year':'{{if year}} <p class="scrutari-fiche-Year"> {{:year}} </p> {{/if}} ',
|
||||
'history':'<div data-scrutari-block="{{:name}}" class="scrutari-history-Block scrutari-history-Active"> <div class="scrutari-history-Search"> <button data-scrutari-button="loadHistory" data-scrutari-target="{{:name}}" class="scrutari-history-Load" {{if fichestat == 0}}disabled="disabled"{{/if}}> {{>sequence}} ({{:fichestat}}) </button> <button data-scrutari-button="removeHistory" data-scrutari-target="{{:name}}" class="scrutari-history-Remove" title="{{>~scrutari_loc(\'_ button_remove\')}}"><span aria-hidden="true">×</span></button> </div> <div class="scrutari-history-Subsearch" data-scrutari-component="subsearch"></div> </div>',
|
||||
'lang':' <p> <label class="scrutari-Label"><input type="checkbox" name="lang" value="{{:lang}}" data-scrutari-title="{{:lang}}"> <span data-scrutari-component="stat-text">{{> title}} [{{:lang}}] <small>(<span data-scrutari-stat-type="lang" data-scrutari-stat-key="{{:lang}}" data-scrutari-stat-default="{{:fiche}}"></span>{{:~scrutari_format(fiche)}})</small></span> </label> </p>',
|
||||
'loading':'<span class="scrutari-icon-Loader"></span> {{>~scrutari_loc(\'_ loading_pagination\')}}',
|
||||
'pagination_empty':'<p><em>{{>~scrutari_loc("_ result_none")}}</em></p> {{if withFilter}} <p><em>{{>~scrutari_loc("_ result_fitlerwarning")}}</em></p> {{else scrutariResult.searchMeta.reportArray.length > 0}} <p>Analyse des termes de la recherche{{>~scrutari_loc("_ colon")}}</p> <dl> {{for scrutariResult.searchMeta.reportArray}} <dt>{{> text}}</dt> <dl> {{if canonicalArray.length > 0}} <p>Correspondances trouvées (entre parenthèses, le nombre d\'occurrences par langue): </p> <ul> {{for canonicalArray}} <li> {{> canonical}} ({{for langreportArray}}{{if #index > 0}}, {{/if}}{{:lang}}={{:ficheCount}}{{/for}}) </li> {{/for}} </ul> {{/if}} {{if neighbourArray.length > 0}} <p>Pas de correspondances trouvées. Termes se rapprochant (entre parenthèses, le code des langues concernées) : </p> <ul> {{for neighbourArray}} <li> {{> neighbour}} <small>({{for langArray}}{{if #index > 0}}, {{/if}}{{:#data}}{{/for}})</small> </li> {{/for}} </ul> {{/if}} {{if canonicalArray.length == 0 && neighbourArray.length == 0}} <p>Aucune correspondance ou terme voisin trouvé</p> {{/if}} </dl> {{/for}} </dl> {{/if}}',
|
||||
'pagination_groups':'<div class="scrutari-group-List" role="tablist"> {{for array}} <span role="tab" class="scrutari-group-Tab {{if active}}scrutari-On{{/if}}" data-scrutari-button="ficheGroupTab" {{if description}}title="{{>description}}"{{/if}} data-scrutari-target="{{:name}}"> {{>title}} ({{:fichestat}}) </span> {{/for}} </div> {{for array}} <div class="scrutari-group-Content {{if !active}}scrutari-Hidden{{/if}}" data-scrutari-block="ficheGroup-{{:name}}" data-scrutari-name="{{:name}}"> <div data-scrutari-block="topTabs-{{:name}}"></div> <div data-scrutari-block="ficheList-{{:name}}"></div> <div data-scrutari-block="bottomTabs-{{:name}}"></div> </div> {{/for}}',
|
||||
'pagination_unique':'<div data-scrutari-block="topTabs"></div> <div data-scrutari-block="ficheList"></div> <div data-scrutari-block="bottomTabs"></div>',
|
||||
'tabs':'<div class="scrutari-pagination-TabList"> {{for tabArray}} {{if state===\'active\'}} <span class="scrutari-pagination-Current">{{>title}}</span> {{else state===\'disabled\'}} <span class="scrutari-pagination-Disabled scrutari-Disabled">{{>title}}</span> {{else}} <span class="scrutari-pagination-Tab" data-scrutari-button="paginationTab" data-scrutari-type="{{:~root.type}}" data-scrutari-position="{{:~root.position}}" data-scrutari-number="{{:number}}" {{if ~root.ficheGroupName}} data-scrutari-fiche-group-name="{{:~root.ficheGroupName}}"{{/if}}>{{>title}}</span> {{/if}} {{/for}} </div>'
|
||||
}
|
||||
};
|
@ -1,118 +1,9 @@
|
||||
/*****************************************************
|
||||
* .none-input
|
||||
******************************************************/
|
||||
|
||||
.none-input-Container {
|
||||
}
|
||||
|
||||
.none-input-Parameters {
|
||||
}
|
||||
|
||||
.none-input-Search {
|
||||
}
|
||||
|
||||
.none-input-Submit {
|
||||
}
|
||||
|
||||
/**
|
||||
* pour Libre à vous
|
||||
*/
|
||||
|
||||
/*****************************************************
|
||||
* .none-option
|
||||
******************************************************/
|
||||
|
||||
.none-option-Help {
|
||||
}
|
||||
|
||||
.none-option-Legend {
|
||||
}
|
||||
|
||||
.none-option-Title {
|
||||
}
|
||||
|
||||
/*****************************************************
|
||||
* .none-overlay
|
||||
******************************************************/
|
||||
|
||||
.none-overlay-Blocker {
|
||||
background-color: rgba(0,0,0, 0.75);
|
||||
}
|
||||
|
||||
.none-overlay-Close {
|
||||
background-color: #000;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.none-overlay-Close:hover {
|
||||
background-color: #ddd;
|
||||
}
|
||||
|
||||
.none-overlay-Content {
|
||||
}
|
||||
|
||||
.none-overlay-Dialog {
|
||||
background-color: #fff;
|
||||
box-shadow: 0 0 10px #000;
|
||||
}
|
||||
|
||||
.none-overlay-Footer {
|
||||
}
|
||||
|
||||
.none-overlay-Header {
|
||||
border-bottom-color: #ddd;
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
.none-overlay-Waiting {
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************
|
||||
* .none-panel
|
||||
******************************************************/
|
||||
|
||||
.none-panel-ButtonGroup {
|
||||
}
|
||||
|
||||
.none-panel-Columns {
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.none-panel-Header {
|
||||
border-bottom-color: #ddd;
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
.none-panel-ListBody {
|
||||
}
|
||||
|
||||
.none-panel-Section {
|
||||
border-color: #ddd;
|
||||
}
|
||||
|
||||
.texte_content h1.none-panel-Title {
|
||||
font-size: 1.0rem;
|
||||
padding: 3px;
|
||||
}
|
||||
|
||||
.none-panel-Toolbar {
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************
|
||||
* .none-result
|
||||
******************************************************/
|
||||
|
||||
.none-result-Container {
|
||||
}
|
||||
|
||||
.none-result-FicheDisplay {
|
||||
}
|
||||
|
||||
.none-result-Sidebar {
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************
|
||||
* .scrutari
|
||||
* .scrutari- : Surcharge de classes Scrutari par défaut
|
||||
******************************************************/
|
||||
|
||||
.scrutari-Mark {
|
||||
@ -124,11 +15,11 @@
|
||||
}
|
||||
|
||||
.scrutari-fiche-Titre {
|
||||
font-size: 1.3rem;
|
||||
font-size: 1.15rem;
|
||||
}
|
||||
|
||||
.scrutari-fiche-Titre .num_emission {
|
||||
font-size: 1.4rem;
|
||||
font-size: 1.3rem;
|
||||
margin-right: 0.5rem;
|
||||
padding: 0.2rem;
|
||||
width: inherit;
|
||||
@ -138,6 +29,10 @@
|
||||
background-color: #ffe9e0;
|
||||
}
|
||||
|
||||
.scrutari-history-Block {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.scrutari-history-Load {
|
||||
background-color: #ffe9e0;
|
||||
font-family: 'Lato',sans-serif;
|
||||
@ -146,3 +41,58 @@
|
||||
color: #005184;
|
||||
text-rendering: geometricPrecision;
|
||||
}
|
||||
|
||||
.scrutari-input-Text {
|
||||
background-color: #edf1f5;
|
||||
color: #005184;
|
||||
}
|
||||
|
||||
.scrutari-pagination-Current {
|
||||
background-color: #648bab;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.scrutari-pagination-TabList {
|
||||
text-align: center;
|
||||
font-size: 1.1em;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************
|
||||
* .scrutari-lav- : Classes spécifiques à la version
|
||||
* pour Libre à vous
|
||||
******************************************************/
|
||||
|
||||
.scrutari-lav-Filtre {
|
||||
display: inline-block;
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
.scrutari-lav-Operateur {
|
||||
color: #acd0f9;
|
||||
}
|
||||
|
||||
.scrutari-lav-Sequence {
|
||||
font-size: 2.5em;
|
||||
}
|
||||
|
||||
.scrutari-lav-Total {
|
||||
font-size: 0.85em;
|
||||
}
|
||||
|
||||
.scrutari-lav-history-Container {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
}
|
||||
|
||||
.scrutari-lav-history-List {
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
.scrutari-lav-history-Label {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.scrutari-lav-history-Clear {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
@ -49,18 +49,18 @@ text-align: right;
|
||||
* .scrutari-category
|
||||
******************************************************/
|
||||
|
||||
.scrutari-category-Tab {
|
||||
.scrutari-group-Tab {
|
||||
display: inline-block;
|
||||
padding-left: 4px;
|
||||
padding-right: 4px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.scrutari-category-Tab:hover {
|
||||
.scrutari-group-Tab:hover {
|
||||
background-color: #e9e9e9;
|
||||
}
|
||||
|
||||
.scrutari-category-Tab.scrutari-On {
|
||||
.scrutari-group-Tab.scrutari-On {
|
||||
cursor: auto;
|
||||
background-color: #e9e9e9;
|
||||
}
|
||||
@ -332,7 +332,7 @@ font-weight: bold;
|
||||
* .scrutari-pagination
|
||||
******************************************************/
|
||||
|
||||
.scrutari-pagination-List {
|
||||
.scrutari-pagination-TabList {
|
||||
margin-top: 15px;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user