Nouveau client opérationnel

This commit is contained in:
Vincent Calame 2023-07-07 21:13:11 +02:00 committed by root
parent 410ca05205
commit 4e353d8729
9 changed files with 648 additions and 518 deletions

View File

@ -1,3 +1,21 @@
[===============================================================(#REM)
Configuration du client Scrutari
]
<script>
$(function () {
var configOptions = Scrutari.Lav.getConfigOptions();
var scrutariConfig = new Scrutari.Config("libreavous", Scrutari.Lav.SCRUTARI_URL, "fr", "site", configOptions);
var initOptions = Object.assign(Scrutari.Lav.getInitOptions(), {
initialQuery: "[(#ENV*{q}|scrutari_escape_query)]",
initialQId: "[(#ENV*{qid}|scrutari_escape_query)]",
permalinkPattern: "https://www.libreavous.org/spip.php?page=scrutarijs&qid=$QID"
});
Scrutari.Client.init(scrutariConfig, "scrutari_client", initOptions, null);
});
</script>
</script>
[===============================================================(#REM) [===============================================================(#REM)
Déclaration du bloc destiné à recevoir le client Déclaration du bloc destiné à recevoir le client
] ]
@ -24,39 +42,42 @@ Structure du client
<!-- main.main-form --> <!-- main.main-form -->
<form data-scrutari-form="mainsearch"> <form data-scrutari-form="mainsearch">
<!-- main.main-form.area-input --> <!-- main.main-form.area-input -->
<div data-scrutari-area="input"> <div data-scrutari-area="input" class="scrutari-lav-Input">
<input type="search" class="scrutari-input-Text" size="40" name="q" value="" placeholder="Chercher un sujet, un-e intervenant-e…"> <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> <button type="submit" class="btn scrutari-lav-Submit">Rechercher</button>
</div> </div>
<!-- /main.main-form.area-input --> <!-- /main.main-form.area-input -->
<!-- main.main-form.area-parameters --> <!-- main.main-form.area-parameters -->
<details data-scrutari-area="parameters"> <details data-scrutari-area="parameters" class="scrutari-lav-details-Container">
<summary>Option de recherche avancée</summary> <summary class="scrutari-lav-details-Summary">Option de recherche avancée</summary>
<div> <div class="scrutari-lav-details-Body">
<p> <p>
<a href="#aide" data-lity type="button" title="Aide sur les relations"> <button data-scrutari-button="showModal" data-scrutari-target="help_relation" type="button" title="Aide sur les relations">
?<i class="fas fa-question"></i> <i class="fas fa-question-circle"></i>
</a> </button>
<span>Relations :</span> <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="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="union"> Ou</label>
<label class="scrutari-Label"><input type="radio" name="q-mode" value="operation"> Avancée</label> <label class="scrutari-Label"><input type="radio" name="q-mode" value="operation"> Avancée</label>
</p> </p>
<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 data-scrutari-button="showModal" data-scrutari-target="help_ponderation" type="button" title="Aide sur la priorité">
<i class="fas fa-question-circle"></i>
</button> </button>
<span>Priorité :</span> <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="pertinence" checked> Pertinence</label>
<label class="scrutari-Label"><input type="radio" name="ponderation" value="date"> Date</label> <label class="scrutari-Label"><input type="radio" name="ponderation" value="date"> Date</label>
</p> </p>
<p> <p>
<button data-scrutari-button="showModal" data-scrutari-target="help_periode" type="button" title="Aide sur la période">?</button> <button data-scrutari-button="showModal" data-scrutari-target="help_periode" type="button" title="Aide sur la période">
<i class="fas fa-question-circle"></i>
</button>
<span>Période :</span> <span>Période :</span>
<input type="text" class="scrutari-input-Text" name="periode" value="" size="20"> <input type="text" class="scrutari-input-Text" name="periode" value="" size="20">
</p> </p>
<p> <p>
<button data-scrutari-button="showModal" data-scrutari-target="help_periode" type="button" title="Aide sur « élargir »"> <button data-scrutari-button="showModal" data-scrutari-target="help_elargir" type="button" title="Aide sur « élargir »">
<i class="fa-solid fa-circle-question"></i> <i class="fas fa-question-circle"></i>
</button> </button>
<span>Élargir :</span> <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="end" checked> Oui*</label>
@ -70,16 +91,16 @@ Structure du client
<!-- main.area-result --> <!-- main.area-result -->
<div data-scrutari-area="result" class="scrutari-area-Result"> <div data-scrutari-area="result" class="scrutari-area-Result">
<div class="scrutari-Hidden" data-scrutari-hidden="empty"> <div class="scrutari-Hidden" data-scrutari-hidden="empty">
<h2>Votre recherche</h2> <h3>Votre recherche :</h3>
<p id="scrutari_lav_sequence" class="scrutari-lav-Sequence"></p> <p id="scrutari_lav_sequence" class="scrutari-lav-Sequence"></p>
</div> </div>
<div class="scrutari-Hidden" data-scrutari-hidden="empty"> <div class="scrutari-Hidden scrutari-lav-Filtre" data-scrutari-hidden="empty">
<p>Filtrer les résultats : <p>Filtrer les résultats :
<label class="scrutari-lav-Filtre"><input type="radio" name="lav-site" value="tous" checked> Tous</label> <label class="scrutari-lav-FiltreLabel"><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> <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> <label class="scrutari-lav-FiltreLabel"><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> <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> <label class="scrutari-lav-FiltreLabel"><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> <span data-scrutari-count="total-librealire" class="scrutari-lav-Total">(<span data-scrutari-component="value"></span>)</span>
</p> </p>
</div> </div>
@ -89,7 +110,7 @@ Structure du client
<div data-scrutari-block="historyList" class="scrutari-lav-history-List"> <div data-scrutari-block="historyList" class="scrutari-lav-history-List">
</div> </div>
<span> <span>
<button class="scrutari-lav-history-Clear" data-scrutari-button="clearHistory" title="Vider lhistorique"><i class="fa-solid fa-delete-left"></i></button> <button class="scrutari-lav-history-Clear" data-scrutari-button="clearHistory" title="Vider lhistorique"><i class="fas fa-trash"></i></button>
</span> </span>
</div> </div>
<!-- /main.area-result.result-history --> <!-- /main.area-result.result-history -->
@ -103,8 +124,8 @@ Structure du client
</p> </p>
</div> </div>
<!-- /main.area-result.result-links --> <!-- /main.area-result.result-links -->
<div class="scrutari-Hidden" data-scrutari-hidden="empty"> <div class="scrutari-Hidden scrutari-lav-TitreResultats" data-scrutari-hidden="empty">
<h2>Vos résultats</h2> <h3>Vos résultats</h3>
</div> </div>
<div data-scrutari-block="paginationBlock"></div> <div data-scrutari-block="paginationBlock"></div>
<div class="scrutari-Hidden" data-scrutari-hidden="empty"> <div class="scrutari-Hidden" data-scrutari-hidden="empty">
@ -117,6 +138,7 @@ Structure du client
<!-- /main --> <!-- /main -->
</div> </div>
</article> </article>
@ -178,3 +200,18 @@ voir https://framagit.org/Scrutari/scrutarijs/-/wikis/adaptation#reformuler-un-%
</div> </div>
{{/for}} {{/for}}
</script> </script>
[===============================================================(#REM)
Fenêtres
]
<BOUCLE_fenetres(ARTICLES){id_rubrique=12}>
<aside data-scrutari-modal="help_#SURTITRE" class="scrutari-Hidden" aria-hidden="true">
<header>
#TITRE
</header>
<div>
#TEXTE
</div>
</aside>
</BOUCLE_fenetres>

View File

@ -1,5 +1,3 @@
[(#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] [(#REM) Version 1.0.7 de JsRender]
@ -17,6 +15,6 @@
[(#REM) Structure et gabarits par défaut] [(#REM) Structure et gabarits par défaut]
[<script src="(#CHEMIN{javascript/scrutarijs/frameworks/_default.js}|timestamp)"></script>] [<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/scrutarijs.css})" type="text/css" />]
[<link rel="stylesheet" href="(#CSS{javascript/scrutarijs/perso.css})" type="text/css" />] [<link rel="stylesheet" href="(#CSS{javascript/scrutarijs/perso.css})" type="text/css" />]

View File

@ -48,7 +48,7 @@ Scrutari.Lav.init = function (client) {
if (Scrutari.Lav.DEV) { //Code propre à la version de développement, en production la structure est en dur dans le squelette Spip 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")); $("#" + client.clientId).html(client.compileStructure("main"));
$("#zone").html(client.compileStructure("main", { $("#zone").html(client.compileStructure("main", {
noLoc: true, noLoc: false,
withIndent: true, withIndent: true,
withPath: true withPath: true
})); }));
@ -218,29 +218,25 @@ Scrutari.Lav.FUNCTIONS = {
initFilterByQuery: null, initFilterByQuery: null,
newResultProcess: function (client, scrutariResult, searchOrigin) { newResultProcess: function (client, scrutariResult, searchOrigin) {
return Scrutari.Lav.newResultProcess(client, scrutariResult, searchOrigin); return Scrutari.Lav.newResultProcess(client, scrutariResult, searchOrigin);
} },
startLoading: null,
endLoading: null
}; };
/** Scrutari.Lav.getConfigOptions = function () {
* Initialisation du client return {
*/ paginationLength: Scrutari.Lav.PAGINATION_LENGTH,
$(function () { limit: -1
var scrutariConfig = new Scrutari.Config("libreavous", Scrutari.Lav.SCRUTARI_URL, "fr", "site", { };
paginationLength: Scrutari.Lav.PAGINATION_LENGTH, };
limit: -1
}); Scrutari.Lav.getInitOptions = function () {
Scrutari.Client.init(scrutariConfig, "scrutari_client", { return {
withCorpus: false, withCorpus: false,
ficheTarget: "_blank", 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 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 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, hooks: Scrutari.Lav.HOOKS,
functions: Scrutari.Lav.FUNCTIONS functions: Scrutari.Lav.FUNCTIONS
};
}, function (client) { };
});
});

View File

@ -8,10 +8,10 @@ structure:{
'area-title':'<div data-scrutari-area="title" class="scrutari-area-Title"> <p class="scrutari-title-Main" data-scrutari-title="main"></p> </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-form':'<form data-scrutari-form="mainsearch"> {{area-input}} {{area-parameters}} </form>',
'main':'{{area-title}} {{main-form}} {{area-stats}} {{area-result}} {{modal-*}}', '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_mode':'<aside class="scrutari-Hidden" data-scrutari-modal="help_mode" aria-hidden="true"> <header> _ mode_help </header> <div> _ help_mode.html </div> </aside>',
'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_periode':'<aside class="scrutari-Hidden" data-scrutari-modal="help_periode" aria-hidden="true"> <header> _ periode_help </header> <div> _ help_periode.html </div> </aside>',
'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-help_ponderation':'<aside class="scrutari-Hidden" data-scrutari-modal="help_ponderation" aria-hidden="true"> <header> _ ponderation_help </header> <div> _ help_ponderation.html </div> </aside>',
'modal-loading':'<section class="scrutari-Hidden" data-scrutari-modal="loading" aria-hidden="true"> <div> <span class="scrutari-icon-Loader"></span> _ loading_search </div> </section>', 'modal-loading':'<aside class="scrutari-Hidden" data-scrutari-modal="loading" aria-hidden="true"> <div> <span class="scrutari-icon-Loader"></span> _ loading_search </div> </aside>',
'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-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-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-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>',

View File

@ -1,169 +0,0 @@
/*****************************************************
* .none-input
******************************************************/
.none-input-Container {
margin-bottom: 5px;
}
.none-input-Search {
display: inline-block;
}
.none-input-Submit {
display: inline-block;
}
@media (min-width: 768px) {
.none-input-Container {
display: flex;
align-items: center;
}
.none-input-Search {
display: block;
flex-grow: 9;
}
.none-input-Search > input {
width: 100%;
}
.none-input-Submit {
display: block;
flex-grow: 1;
padding-left: 10px;
padding-right: 10px;
}
.none-input-Parameters {
flex-basis: 34%;
width: 34%;
}
.none-input-Parameters > button {
width: 100%;
}
}
/*****************************************************
* .none-overlay
******************************************************/
.none-overlay-Blocker {
position: fixed;
top: 0; right: 0; bottom: 0; left: 0;
width: 100%; height: 100%;
overflow: hidden;
z-index: 10000;
box-sizing: border-box;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
padding: 20px;
}
.none-overlay-Close {
position: absolute;
top: -12.5px;
right: -12.5px;
display: block;
width: 30px;
height: 30px;
border-radius: 15px;
border: none;
font-size: 20px;
}
.none-overlay-Content {
min-width: 20vw;
max-width: 90vw;
max-height: 70vh;
overflow: auto;
padding: 10px 20px;
font-size: 0.9rem;
}
.none-overlay-Dialog {
position: relative;
box-sizing: border-box;
max-width: 700px;
}
.none-overlay-Footer {
padding: 0 0 8px 0;
}
.none-overlay-Header {
border-bottom-width: 1px;
border-bottom-style: solid;
padding: 20px 10px;
}
.none-overlay-Waiting {
cursor: wait;
}
/*****************************************************
* .none-panel
******************************************************/
.none-panel-Columns {
display: flex;
}
.none-panel-Columns > div {
width: 25%;
}
.none-panel-Columns p {
margin: 0;
}
.none-panel-Header {
padding-top : 5px;
padding-bottom: 5px;
border-bottom-width: 1px;
border-bottom-style: solid;
}
.none-panel-ListBody {
padding-top : 3px;
}
.none-panel-Section {
margin-bottom: 0;
border-width: 1px;
border-style: solid;
}
.none-panel-Title {
margin: 0;
font-size: 1.0em;
line-height: 1.1;
cursor: pointer;
font-weight: normal;
}
/*****************************************************
* .none-result
******************************************************/
@media (min-width: 768px) {
.none-result-Container {
display: flex;
}
.none-result-FicheDisplay {
width: 66%;
}
.none-result-Sidebar {
width: 34%;
}
}

View File

@ -1,279 +0,0 @@
var SCRUTARI_HTML = {
_name:'none',
structure:{
'area-input':'<div data-scrutari-area="input"> <div class="none-input-Container"> <div class="none-input-Search"> <input type="text" class="scrutari-input-Text" size="40" name="q" value=""> </div> <div class="none-input-Submit"> <button type="submit">_ button_submit</button> </div> <div class="none-input-Parameters"> <button type="button" data-scrutari-button="parametersDisplay" class="scrutari-Hidden" data-scrutari-state="off"> _ button_parameters </button> </div> </div> </div>',
'area-result':'<div data-scrutari-area="result" class="scrutari-area-Result"> <div class="none-result-Container"> <div class="none-result-FicheDisplay" data-scrutari-block="ficheDisplay"> </div> <div class="none-result-Sidebar"> <div class="scrutari-Hidden" data-scrutari-hidden="empty"> {{result-links}} </div> {{result-history}} </div> </div> <div class="scrutari-Hidden" data-scrutari-hidden="threshold"> {{result-subsearch}} </div> <div class="scrutari-Hidden" data-scrutari-hidden="empty"> {{result-poweredby}} </div> </div>',
'panel-base':'<section class="none-panel-Section scrutari-Hidden" data-scrutari-panel="base"> <header class="none-panel-Header"> <h1 class="none-panel-Title" 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="none-panel-ListBody scrutari-Hidden" data-scrutari-block="basePanelBody"> <div class="none-panel-Toolbar"> <span class="none-panel-ButtonGroup"> <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 class="none-panel-ButtonGroup"> <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 class="none-panel-Columns"> <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="none-panel-Section scrutari-Hidden" data-scrutari-panel="category"> <header class="none-panel-Header"> <h1 class="none-panel-Title" 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="none-panel-ListBody scrutari-Hidden" data-scrutari-block="categoryPanelBody"> <div class="none-panel-Toolbar"> <span class="none-panel-ButtonGroup"> <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 class="none-panel-ButtonGroup"> <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 class="none-panel-Columns"> <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="none-panel-Section scrutari-Hidden" data-scrutari-panel="corpus"> <header class="none-panel-Header"> <h1 class="none-panel-Title" 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="none-panel-ListBody scrutari-Hidden" data-scrutari-block="corpusPanelBody"> <div class="none-panel-Toolbar"> <span class="none-panel-ButtonGroup"> <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 class="none-panel-ButtonGroup"> <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 class="none-panel-Columns"> <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="none-panel-Section scrutari-Hidden" data-scrutari-panel="lang"> <header class="none-panel-Header"> <h1 class="none-panel-Title" 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="none-panel-ListBody scrutari-Hidden" data-scrutari-block="langPanelBody"> <div class="none-panel-Toolbar"> <span class="none-panel-ButtonGroup"> <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 class="none-panel-ButtonGroup"> <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 class="none-panel-Columns"> <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 class="none-panel-Section" data-scrutari-panel="options"> <header class="none-panel-Header"> <h1 class="none-panel-Title" 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 class="none-panel-Columns"> <div> <p class="none-option-Legend"><span class="none-option-Title">_ mode_title</span><button class="none-option-Help" 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 class="none-option-Legend"><span class="none-option-Title">_ ponderation_title</span><button class="none-option-Help" 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 class="none-option-Legend"><span class="none-option-Title">_ periode_title</span><button class="none-option-Help" 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>',
'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-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>',
'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" ></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-role="value"></span></td> <td class="scrutari-stats-Cell scrutari-stats-Titles"><span data-scrutari-role="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-role="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-role="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-role="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-role="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>',
'categoryfichedisplay':'<div class="scrutari-category-List" role="tablist"> {{for array}} <span role="tab" class="scrutari-category-Tab {{if active}}scrutari-On{{/if}}" data-scrutari-role="category-tab" data-scrutari-button="categoryTab" {{if category.phraseMap.description}}title="{{>category.phraseMap.description}}"{{/if}} data-scrutari-category="{{:category.name}}"> {{>category.title}} ({{:fichestat}}) </span> {{/for}} </div> {{for array}} <div class="scrutari-category-Content {{if !active}}scrutari-Hidden{{/if}}" data-scrutari-role="category-content" data-scrutari-category="{{:category.name}}"> <div data-scrutari-block="topPagination_{{:category.name}}"></div> <div data-scrutari-block="fiches_{{:category.name}}"></div> <div data-scrutari-block="bottomPagination_{{:category.name}}"></div> </div> {{/for}}',
'corpus':' <p> <label class="scrutari-Label"><input type="checkbox" name="corpus" value="{{: codecorpus}}" data-scrutari-title="{{> title}}"> <span data-scrutari-role="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>',
'emptyfichedisplay':'<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}}',
'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}} ',
'ficheloading':'<span class="scrutari-icon-Loader"></span> {{>~scrutari_loc(\'_ loading_pagination\')}}',
'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-role="remove" data-scrutari-button="removeHistory" data-scrutari-target="{{:name}}" class="scrutari-history-Remove scrutari-Hidden" title="{{>~scrutari_loc(\'_ button_remove\')}}"><span aria-hidden="true">&times;</span></button> </div> <div class="scrutari-history-Subsearch" data-scrutari-role="subsearch"></div> </div>',
'lang':' <p> <label class="scrutari-Label"><input type="checkbox" name="lang" value="{{: lang}}" data-scrutari-title="{{: lang}}"> <span data-scrutari-role="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>',
'tabs':'<div class="scrutari-pagination-List"> {{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="ficheTab" data-scrutari-type="{{:~root.type}}" data-scrutari-position="{{:~root.position}}" data-scrutari-number="{{:number}}" {{if ~root.category}} data-scrutari-category="{{:~root.category}}"{{/if}}>{{>title}}</span> {{/if}} {{/for}} </div>',
'uniquefichedisplay':'<div data-scrutari-block="topPagination"></div> <div data-scrutari-block="fiches"></div> <div data-scrutari-block="bottomPagination"></div> '
}
};
/* global Scrutari */
function SCRUTARI_FRAMEWORKINIT (scrutariClient) {
scrutariClient.functions.modalAction = function ($modal, action) {
switch(action) {
case 'show':
if (!$modal.data("overlayId")) {
var overlayId = Scrutari.Overlay.start({
header: $modal.children("header").html(),
content: $modal.children("div").html(),
footer: $modal.children("footer").html(),
closeTooltip: scrutariClient.loc("_ button_close"),
afterEnd: function () {
$modal.data("overlayId", null);
}
});
$modal.data("overlayId", overlayId);
}
break;
case 'hide':
Scrutari.Overlay.end($modal);
break;
}
};
}
Scrutari.Overlay = {};
Scrutari.Overlay.idNumber = 1;
Scrutari.Overlay.activeInfoArray = new Array();
$(document).on('keydown.overlay', function(event) {
if (event.which === 27) {
var length = Scrutari.Overlay.activeInfoArray.length;
if (length > 0) {
var overlayInfo = Scrutari.Overlay.activeInfoArray[length - 1];
if (overlayInfo.escapeClose) {
Scrutari.Overlay.end(overlayInfo.overlayId);
}
}
}
});
Scrutari.Overlay.Info = function (overlayId, escapeClose) {
this.overlayId = overlayId;
this.escapeClose = escapeClose;
};
Scrutari.Overlay.start = function (settings) {
var closeTooltip = "Close";
if (settings.closeTooltip) {
closeTooltip = settings.closeTooltip;
}
var overlayIdNumber = Scrutari.Overlay.idNumber;
Scrutari.Overlay.idNumber++;
var overlayId = "none-overlay_" + overlayIdNumber;
Scrutari.Overlay.activeInfoArray.push(new Scrutari.Overlay.Info(overlayId, _checkSetting("escapeClose")));
var $overlayBlocker = $("<div/>").attr("id", overlayId).attr("class", _getClass("Blocker")).attr("data-role", "overlay");
var $overlayDialog = $("<div/>").attr("class", _getClass("Dialog")).appendTo($overlayBlocker);
$overlayDialog.data("overlayId", overlayId);
$("body")
.append($overlayBlocker)
.css('overflow','hidden');
var overlayBody = _getDiv("Header") + _getDiv("Content") + _getDiv("Footer");
var includeForm = false;
if (settings.formAttrs || settings.ajaxForm || settings.formSubmit) {
includeForm = true;
var $form = $("<form/>");
if (settings.formAttrs) {
for(var prop in settings.formAttrs) {
$form.attr(prop, settings.formAttrs[prop]);
}
}
if (settings.ajaxForm) {
var initialBeforeSubmit = settings.ajaxForm.beforeSubmit;
settings.ajaxForm.beforeSubmit = function (arr, $form, options) {
if ((initialBeforeSubmit) && (initialBeforeSubmit(arr, $form, options) === false)) {
return false;
}
_startWaiting();
};
var initialSuccess = settings.ajaxForm.success;
settings.ajaxForm.success = function (data, textStatus, jqXHR, $form) {
_endWaiting();
initialSuccess(data, textStatus, jqXHR, $form);
};
$form.ajaxForm(settings.ajaxForm);
} else if (settings.formSubmit) {
$form.submit(function () {
return settings.formSubmit($(this));
});
}
$overlayDialog.append($form.html(overlayBody));
$form.data("overlayId", overlayId);
} else {
$overlayDialog.html(overlayBody);
}
_setContent("Header", settings.header);
_setContent("Content", settings.content);
_setContent("Footer", settings.footer);
var clickClose = _checkSetting("clickClose");
var showClose = _checkSetting("showClose");
$overlayBlocker
.click(function() {
if (clickClose) {
Scrutari.Overlay.end(overlayId);
}
})
.data("beforeEnd", settings.beforeEnd)
.data("afterEnd", settings.afterEnd)
.css("z-index", 10000 + overlayIdNumber);
if (showClose) {
$overlayDialog
.append("<button data-role='close' class='" + _getClass("Close") + " title='" + closeTooltip + "'>&times</button>")
.on("click.overlay", "[data-role='close']", function () {
Scrutari.Overlay.end(overlayId);
});
}
$overlayDialog
.click(function (event) {
event.stopPropagation();
});
if (settings.isWaiting) {
_startWaiting();
}
$overlayBlocker.fadeIn(function () {
$overlayDialog.show();
if (settings.afterStart) {
settings.afterStart($overlayDialog);
} else if (includeForm) {
$overlayDialog.find(":input").filter("[type!='hidden']").first().trigger("focus");
}
});
return overlayId;
function _checkSetting(propName) {
if (settings.hasOwnProperty(propName)) {
return settings[propName];
}
return true;
}
function _setContent (name, content) {
let $element = $("#" + _getId(name));
if (!content) {
$element.empty();
} else if (content.jquery) {
$element.empty().append(content);
} else {
$element.empty().html(content);
}
}
function _startWaiting() {
$overlayBlocker.find("[type='submit']").prop("disabled", true);
$overlayBlocker.addClass(_getClass("Waiting"));
}
function _endWaiting() {
$overlayBlocker.find("[type='submit']").prop("disabled", false);
$overlayBlocker.removeClass(_getClass("Waiting"));
}
function _getDiv(name) {
return "<div id='" + _getId(name) + "' class='" + _getClass(name) + "'></div>";
}
function _getId(name) {
return overlayId + "_" + name;
}
function _getClass(suffix) {
let prefix = "none-overlay-";
if (settings.classPrefix) {
prefix = settings.classPrefix;
}
return prefix + suffix;
}
};
Scrutari.Overlay.end = function (overlayId, callback) {
if (overlayId.jquery) {
overlayId = overlayId.data("overlayId");
}
if (!overlayId) {
return;
}
var $overlayBlocker = $("#" + overlayId);
var beforeEnd = $overlayBlocker.data("beforeEnd");
if (beforeEnd) {
var result = beforeEnd($overlayBlocker.children("div"));
if (result === false) {
return;
}
}
_pop();
$overlayBlocker.empty();
var afterEnd = $overlayBlocker.data("afterEnd");
$overlayBlocker.fadeOut(function() {
$("#" + overlayId).remove();
if ($("body").children("[data-role='overlay']").length === 0) {
$("body").css('overflow','');
}
if (afterEnd) {
afterEnd();
}
if (callback) {
callback();
}
});
function _pop() {
for(var i = 0, len = Scrutari.Overlay.activeInfoArray.length; i < len; i++) {
var overlayInfo = Scrutari.Overlay.activeInfoArray[i];
if (overlayInfo.overlayId === overlayId) {
Scrutari.Overlay.activeInfoArray.splice(i, 1);
break;
}
}
}
};

View File

@ -2,6 +2,18 @@
* pour Libre à vous * pour Libre à vous
*/ */
kbd {
background: #fff;
border-radius: 0;
border: 1px solid #BDDDFE;
box-shadow: inherit;
display: inline-block;
font-size: 14px;
}
/***************************************************** /*****************************************************
* .scrutari- : Surcharge de classes Scrutari par défaut * .scrutari- : Surcharge de classes Scrutari par défaut
******************************************************/ ******************************************************/
@ -10,6 +22,16 @@
background-color: #ffe9e0; background-color: #ffe9e0;
} }
/*****************************************************
* .scrutari-fiche : Surcharge de classes Scrutari par défaut
******************************************************/
.scrutari-fiche-Block {
border-bottom: solid 1px #eaeef3;
margin-top: 25px;
}
.scrutari-fiche-Link { .scrutari-fiche-Link {
border: 0; border: 0;
} }
@ -25,16 +47,21 @@
width: inherit; width: inherit;
} }
.scrutari-history-Active {
background-color: #ffe9e0; /*****************************************************
* .scrutari-history : Surcharge de classes Scrutari par défaut
******************************************************/
.scrutari-history-Block, .scrutari-history-Block.scrutari-history-Active {
background-color: #e6ebf0;
} }
.scrutari-history-Block { .scrutari-history-Block {
display: inline-block; display: inline-block;
} }
.scrutari-history-Load { .scrutari-history-Load, .scrutari-history-Remove {
background-color: #ffe9e0; background-color: transparent;
font-family: 'Lato',sans-serif; font-family: 'Lato',sans-serif;
font-weight: 400; font-weight: 400;
line-height: 1.6; line-height: 1.6;
@ -42,11 +69,73 @@
text-rendering: geometricPrecision; text-rendering: geometricPrecision;
} }
/*****************************************************
* .scrutari-input : Surcharge de classes Scrutari par défaut
******************************************************/
.scrutari-input-Text { .scrutari-input-Text {
background-color: #edf1f5; background-color: #edf1f5;
color: #005184; color: #005184;
} }
/*****************************************************
* .scrutari-overlay : Surcharge de classes Scrutari par défaut
******************************************************/
.scrutari-overlay-Component_header {
border: none;
background-color: rgb(0, 81, 132);
color: #fff;
padding: 1rem 2rem;
font-size: 18px;
}
.scrutari-overlay-Component_content {
padding: 2rem 3rem;
}
.scrutari-overlay-Component_content p {
font-size: 16px;
}
.scrutari-overlay-Component_dialog {
max-width: 800px;
}
.scrutari-overlay-button-Close {
margin-right: 1.5rem;
margin-top: 1.5rem;
border-radius: 00;
font-size: inherit;
color:#BDDDFE;
background-color: rgb(0, 81, 132);
border:1px solid #BDDDFE;
}
.scrutari-overlay-button-Close:hover {
background-color: #E45817;
border:1px solid #FFF;
color:#FFF;
}
@media screen and (max-width: 500px) {
.scrutari-overlay-Component_content {
padding:1rem;
}
.scrutari-overlay-Component_header {
padding: 1rem;
}
}
/*****************************************************
* .scrutari-pagination : Surcharge de classes Scrutari par défaut
******************************************************/
.scrutari-pagination-Current { .scrutari-pagination-Current {
background-color: #648bab; background-color: #648bab;
color: #fff; color: #fff;
@ -64,25 +153,107 @@
******************************************************/ ******************************************************/
.scrutari-lav-Filtre { .scrutari-lav-Filtre {
padding-bottom: 5px;
border-bottom: solid 1px #eaeef3;
}
.scrutari-lav-FiltreLabel {
display: inline-block; display: inline-block;
margin-left: 5px; margin-left: 5px;
} }
.scrutari-lav-Input {
display: grid;
grid-template-columns: 1fr max-content;
column-gap: 30px;
}
.scrutari-lav-Operateur { .scrutari-lav-Operateur {
color: #acd0f9; color: #acd0f9;
} }
.scrutari-lav-Sequence { .scrutari-lav-Sequence {
font-size: 2.5em; font-size: 2.5em;
margin-bottom: 15px;
}
.scrutari-lav-Submit {
background: #f7651a;
color: #FFF !important;
}
.scrutari-lav-TitreResultats {
margin-bottom: 25px;
margin-top: 50px;
} }
.scrutari-lav-Total { .scrutari-lav-Total {
font-size: 0.85em; font-size: 0.85em;
} }
/*****************************************************
* .scrutari-lav-details- : Options de recherche
******************************************************/
.scrutari-lav-details-Container {
border-bottom: solid 1px #eaeef3;
margin-top: 10px;
padding-bottom: 10px;
margin-bottom: 35px;
}
.scrutari-lav-details-Body {
padding-left: 15px;
margin-top: 10px;
display: grid;
grid-template-columns: max-content;
}
.scrutari-lav-details-Body p {
border-bottom: solid 1px #eaeef3;
margin: 0;
padding-top: 4px;
padding-bottom: 4px;
}
.scrutari-lav-details-Body button {
background: transparent;
padding: 0;
margin: 0;
border: none;
}
.scrutari-lav-details-Body .fas {
color: #acd0f9;
}
.scrutari-lav-details-Body .fas:hover {
color: #00c4f5;
}
.scrutari-lav-details-Body p:last-child {
border-bottom: none;
}
.scrutari-lav-details-Summary {
cursor: pointer;
font-family: 'Metropolis',sans-serif;
font-weight: 700;
}
/*****************************************************
* .scrutari-lav-history- : Historique
******************************************************/
.scrutari-lav-history-Container { .scrutari-lav-history-Container {
display: flex; display: flex;
align-items: baseline; align-items: baseline;
padding-top: 5px;
padding-bottom: 5px;
border-bottom: solid 1px #eaeef3;
margin-bottom: 5px;
} }
.scrutari-lav-history-List { .scrutari-lav-history-List {
@ -95,4 +266,17 @@
.scrutari-lav-history-Clear { .scrutari-lav-history-Clear {
flex-shrink: 0; flex-shrink: 0;
background-color: transparent;
} }
.scrutari-lav-history-Clear .fas {
color: #acd0f9;
}
.scrutari-lav-history-Clear .fas:hover {
color: #00c4f5;
}

View File

@ -374,6 +374,92 @@ vertical-align: baseline;
} }
/*******************************************************************************
* .scrutari-overlay- v 0.4.2
*******************************************************************************/
.scrutari-overlay-Component_blocker {
position: fixed;
top: 0; right: 0; bottom: 0; left: 0;
width: 100%; height: 100%;
overflow: hidden;
z-index: 10000;
padding: 20px;
box-sizing: border-box;
background-color: rgba(0,0,0, 0.75);
text-align: center;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.scrutari-overlay-Component_content {
padding: 10px 20px;
text-align: left;
font-size: 90%;
min-width: 20vw;
max-width: 90vw;
max-height: 70vh;
overflow: auto;
background-color: #fff;
}
.scrutari-overlay-Component_dialog {
position: relative;
box-sizing: border-box;
background: #fff;
box-shadow: 0 0 10px #000;
text-align: left;
}
.scrutari-overlay-Component_footer {
clear: both;
padding-bottom: 8px;
padding-top: 8px;
padding-left: 10px;
padding-right: 10px;
text-align: right;
}
.scrutari-overlay-Component_header {
text-align: left;
font-size: large;
min-height: 10px;
padding-top: 20px;
padding-bottom: 20px;
padding-left: 10px;
padding-right: 10px;
}
.scrutari-overlay-Waiting {
cursor: wait;
}
/*******************************************************************************
* .overlay-button-
*******************************************************************************/
.scrutari-overlay-button-Close {
position: absolute;
top: -12.5px;
right: -12.5px;
display: block;
width: 30px;
height: 30px;
border-radius: 15px;
border: none;
font-size: 20px;
background-color: #000;
color: #fff;
}
.scrutari-overlay-button-Close:hover {
background-color: #ddd;
}
/***************************************************** /*****************************************************
* .scrutari-stats * .scrutari-stats
******************************************************/ ******************************************************/

View File

@ -1,4 +1,4 @@
/* version: r4191 */ /* version: 4195 */
var Scrutari = {}; var Scrutari = {};
Scrutari.log = function (msg) { Scrutari.log = function (msg) {
if ((console) && (console.log)) { if ((console) && (console.log)) {
@ -1590,6 +1590,244 @@ Scrutari.Loc.prototype.escape = function (locKey, ...values) {
} }
return Scrutari.escape(this.loc(locKey, values)); return Scrutari.escape(this.loc(locKey, values));
}; };
Scrutari.Overlay = {};
Scrutari.Overlay.idNumber = 1;
Scrutari.Overlay.overlayInfoStack = new Array();
Scrutari.Overlay.closeTooltip = "Close";
Scrutari.Overlay.classPrefix = "scrutari-overlay";
Scrutari.Overlay.Info = function (overlayId, escapeClose, otherCloseKey) {
this.overlayId = overlayId;
this.escapeClose = escapeClose;
this.otherCloseKey = otherCloseKey;
this.afterEnd = null;
this.beforeEnd = null;
};
Scrutari.Overlay.addEscapeKeyHandler = function (target) {
$(target).on('keydown.overlay', function (event) {
var lastOverlayInfo = Scrutari.Overlay.getLastOverlayInfo();
if (lastOverlayInfo) {
let closeEvent = false;
if (lastOverlayInfo.escapeClose) {
if (event.key === "Escape") {
closeEvent = true;
}
}
if ((!closeEvent) && (lastOverlayInfo.otherCloseKey)) {
if (event.key === lastOverlayInfo.otherCloseKey) {
closeEvent = true;
}
}
if (closeEvent) {
event.preventDefault();
event.stopPropagation();
Scrutari.Overlay.end(lastOverlayInfo.overlayId);
}
}
});
};
Scrutari.Overlay.removeEscapeKeyHandler = function (target) {
$(target).off('keydown.overlay');
};
Scrutari.Overlay.getLastOverlayInfo = function () {
var length = Scrutari.Overlay.overlayInfoStack.length;
if (length > 0) {
return Scrutari.Overlay.overlayInfoStack[length - 1];
} else {
return null;
}
};
Scrutari.Overlay.getOverlayInfo = function (overlayId) {
for(let overlayInfo of Scrutari.Overlay.overlayInfoStack) {
if (overlayInfo.overlayId === overlayId) {
return overlayInfo;
}
}
return null;
};
Scrutari.Overlay.removeOverlayInfo = function (overlayId) {
for(let i = 0, len = Scrutari.Overlay.overlayInfoStack.length; i < len; i++) {
let overlayInfo = Scrutari.Overlay.overlayInfoStack[i];
if (overlayInfo.overlayId === overlayId) {
Scrutari.Overlay.overlayInfoStack.splice(i, 1);
break;
}
}
if (Scrutari.Overlay.overlayInfoStack.length === 0) {
Scrutari.Overlay.removeEscapeKeyHandler(document);
}
};
Scrutari.Overlay.addOverlayInfo = function (overlayInfo) {
if (Scrutari.Overlay.overlayInfoStack.length === 0) {
Scrutari.Overlay.addEscapeKeyHandler(document);
}
Scrutari.Overlay.overlayInfoStack.push(overlayInfo);
};
Scrutari.Overlay.start = function (settings) {
var closeTooltip = Scrutari.Overlay.closeTooltip;
if (settings.closeTooltip) {
closeTooltip = settings.closeTooltip;
}
var overlayIdNumber = Scrutari.Overlay.idNumber;
Scrutari.Overlay.idNumber++;
var overlayId = "overlay_" + overlayIdNumber;
var overlayInfo = new Scrutari.Overlay.Info(overlayId, _checkSetting("escapeClose", true));
Scrutari.Overlay.addOverlayInfo(overlayInfo);
var $overlayBlocker = $(_getDiv("blocker")).attr("data-overlay-role", "blocker").attr("tabindex", "-1");
var $overlayDialog = $(_getDiv("dialog")).appendTo($overlayBlocker);
$("body")
.append($overlayBlocker)
.css('overflow','hidden');
var overlayBody = _getDiv("header") + _getDiv("content") + _getDiv("footer");
var includeForm = false;
if (settings.formAttrs || settings.ajaxForm || settings.formSubmit) {
includeForm = true;
var $form = $("<form/>");
if (settings.formAttrs) {
for(var prop in settings.formAttrs) {
$form.attr(prop, settings.formAttrs[prop]);
}
}
if (settings.ajaxForm) {
var initialBeforeSubmit = settings.ajaxForm.beforeSubmit;
settings.ajaxForm.beforeSubmit = function (arr, $form, options) {
if ((initialBeforeSubmit) && (initialBeforeSubmit(arr, $form, options) === false)) {
return false;
}
_startWaiting();
};
var initialSuccess = settings.ajaxForm.success;
settings.ajaxForm.success = function (data, textStatus, jqXHR, $form) {
_endWaiting();
initialSuccess(data, textStatus, jqXHR, $form);
};
$form.ajaxForm(settings.ajaxForm);
} else if (settings.formSubmit) {
$form.submit(function () {
return settings.formSubmit($(this));
});
}
$overlayDialog.append($form.html(overlayBody));
$form.data("overlayId", overlayId);
} else {
$overlayDialog.html(overlayBody);
}
_setContent("header", settings.header);
_setContent("content", settings.content);
_setContent("footer", settings.footer);
var clickClose = _checkSetting("clickClose", true);
var showClose = _checkSetting("showClose", true);
$overlayBlocker
.click(function() {
if (clickClose) {
Scrutari.Overlay.end(overlayId);
}
})
.css("z-index", 10000 + overlayIdNumber);
overlayInfo.beforeEnd = settings.beforeEnd;
overlayInfo.afterEnd = settings.afterEnd;
if (showClose) {
$overlayDialog
.append("<button data-overlay-role='close' class='" + Scrutari.Overlay.classPrefix + "-button-Close' title='" + closeTooltip + " (Esc)'>&times</button>")
.on("click.overlay", "[data-overlay-role='close']", function () {
Scrutari.Overlay.end(overlayId);
});
}
$overlayDialog
.click(function (event) {
event.stopPropagation();
});
if (settings.isWaiting) {
_startWaiting();
}
$overlayBlocker.fadeIn(function () {
$overlayDialog.show();
if (settings.afterStart) {
settings.afterStart(overlayId, _endWaiting);
} else if (includeForm) {
$overlayDialog.find(":input").filter("[type!='hidden']").first().trigger("focus");
}
setTimeout(function () {
overlayInfo.otherCloseKey = _checkSetting("closeKey", null);
}, 300);
});
return overlayId;
function _checkSetting(propName, defaultValue) {
if (settings.hasOwnProperty(propName)) {
return settings[propName];
}
return defaultValue;
}
function _setContent (name, content) {
let $element = $("#" + _getId(name));
if (!content) {
$element.remove();
} else if (content.jquery) {
$element.empty().append(content);
} else {
$element.empty().html(content);
}
}
function _startWaiting() {
$overlayBlocker.find("[type='submit']").prop("disabled", true);
$overlayBlocker.addClass(Scrutari.Overlay.classPrefix + "-Waiting");
}
function _endWaiting() {
$overlayBlocker.find("[type='submit']").prop("disabled", false);
$overlayBlocker.removeClass(Scrutari.Overlay.classPrefix + "-Waiting");
}
function _getDiv(name) {
return "<div id='" + _getId(name) + "' class='" + _getClass(name) + "'></div>";
}
function _getId(name) {
return overlayId + "_" + name;
}
function _getClass(suffix) {
if ((settings.classes) && (settings.classes.hasOwnProperty(suffix))) {
return settings.classes[suffix];
}
let prefix = Scrutari.Overlay.classPrefix + "-Component_";
if (settings.classPrefix) {
prefix = settings.classPrefix;
}
if ((settings.supplementaryClasses) && (settings.supplementaryClasses.hasOwnProperty(suffix))) {
return prefix + suffix + " " + settings.supplementaryClasses[suffix];
} else {
return prefix + suffix;
}
}
};
Scrutari.Overlay.end = function (overlayId, callback) {
if ((overlayId) && (overlayId.jquery)) {
overlayId = overlayId.data("overlayId");
}
if (!overlayId) {
return;
}
var overlayInfo = Scrutari.Overlay.getOverlayInfo(overlayId);
if (!overlayInfo) {
return;
}
if (overlayInfo.beforeEnd) {
var result = overlayInfo.beforeEnd(overlayId);
if (result === false) {
return;
}
}
var afterEnd = overlayInfo.afterEnd;
Scrutari.Overlay.removeOverlayInfo(overlayId);
$("#" + overlayId + "_blocker").empty().fadeOut(function() {
$("#" + overlayId + "_blocker").remove();
if ($("body").children("[data-overlay-role='blocker']").length === 0) {
$("body").css('overflow','');
}
if (afterEnd) {
afterEnd();
}
if (callback) {
callback();
}
});
};
Scrutari.FilterState = function () { Scrutari.FilterState = function () {
this.empty = true; this.empty = true;
this.langOnly = true; this.langOnly = true;
@ -1834,8 +2072,10 @@ Scrutari.Client = function (scrutariConfig, clientId) {
subsearchErrorCallback: null, subsearchErrorCallback: null,
initFilterByQuery: Scrutari.DefaultUi.initFilterByQuery, initFilterByQuery: Scrutari.DefaultUi.initFilterByQuery,
displayError: Scrutari.DefaultUi.displayError, displayError: Scrutari.DefaultUi.displayError,
modalAction: null, modalAction: Scrutari.DefaultUi.modalAction,
newResultProcess: Scrutari.DefaultUi.newResultProcess newResultProcess: Scrutari.DefaultUi.newResultProcess,
startLoading: Scrutari.DefaultUi.startLoading,
endLoading: Scrutari.DefaultUi.endLoading
}; };
this.cssClasses = { this.cssClasses = {
disabled: "scrutari-Disabled", disabled: "scrutari-Disabled",
@ -1870,9 +2110,6 @@ Scrutari.Client = function (scrutariConfig, clientId) {
if (typeof SCRUTARI_HTML !== 'undefined') { if (typeof SCRUTARI_HTML !== 'undefined') {
this._htmlObject = SCRUTARI_HTML; this._htmlObject = SCRUTARI_HTML;
} }
if (typeof SCRUTARI_FRAMEWORKINIT === 'function') {
SCRUTARI_FRAMEWORKINIT(this);
}
}; };
Scrutari.Client.prototype.loc = function (locKey) { Scrutari.Client.prototype.loc = function (locKey) {
return this._locInstance.loc(locKey); return this._locInstance.loc(locKey);
@ -2046,12 +2283,8 @@ Scrutari.Client.prototype.$label = function (name) {
Scrutari.Client.prototype.$link = function (name) { Scrutari.Client.prototype.$link = function (name) {
return this.$({scrutariLink: name}); return this.$({scrutariLink: name});
}; };
Scrutari.Client.prototype.$modal = function (name, action) { Scrutari.Client.prototype.$modal = function (name) {
var $modal = this.$({scrutariModal: name}); return Scrutari.$({scrutariModal: name});
if ((action) && (this.functions.modalAction)) {
this.functions.modalAction($modal, action);
}
return $modal;
}; };
Scrutari.Client.prototype.$panel = function (name, action) { Scrutari.Client.prototype.$panel = function (name, action) {
var $panel = this.$({scrutariPanel: name}); var $panel = this.$({scrutariPanel: name});
@ -2169,7 +2402,7 @@ Scrutari.Client.prototype.initForms = function () {
let requestParameters = client.buildRequestParameters(); let requestParameters = client.buildRequestParameters();
requestParameters["log"] = "all"; requestParameters["log"] = "all";
requestParameters["q"] = q; requestParameters["q"] = q;
client.$modal("loading", 'show'); client.startLoading();
client.hook("newSearch", requestParameters, "mainsearch"); client.hook("newSearch", requestParameters, "mainsearch");
Scrutari.Result.newSearch(client.scrutariConfig, requestParameters, function (scrutariResult) {client.mainsearchResultCallback(scrutariResult);}, function (error) {client.mainsearchErrorCallback(error);}); Scrutari.Result.newSearch(client.scrutariConfig, requestParameters, function (scrutariResult) {client.mainsearchResultCallback(scrutariResult);}, function (error) {client.mainsearchErrorCallback(error);});
} }
@ -2181,7 +2414,7 @@ Scrutari.Client.prototype.initForms = function () {
let requestParameters = client.buildRequestParameters(); let requestParameters = client.buildRequestParameters();
requestParameters["q"] = q; requestParameters["q"] = q;
requestParameters["flt-qid"] = client.history.mainCurrentScrutariResult.getQId(); requestParameters["flt-qid"] = client.history.mainCurrentScrutariResult.getQId();
client.$modal("loading", 'show'); client.startLoading();
client.hook("newSearch", requestParameters, "subsearch"); client.hook("newSearch", requestParameters, "subsearch");
Scrutari.Result.newSearch(client.scrutariConfig, requestParameters, function (scrutariResult) {client.subsearchResultCallback(scrutariResult);}, function (error) {client.subsearchErrorCallback(error);}); Scrutari.Result.newSearch(client.scrutariConfig, requestParameters, function (scrutariResult) {client.subsearchResultCallback(scrutariResult);}, function (error) {client.subsearchErrorCallback(error);});
} }
@ -2201,7 +2434,9 @@ Scrutari.Client.prototype.initButtons = function (actionHandler) {
if (!done) { if (!done) {
switch(action) { switch(action) {
case 'showModal': case 'showModal':
client.$modal(target, 'show'); if (client.functions.modalAction) {
client.functions.modalAction(client, target, 'show');
}
break; break;
case 'removeHistory': case 'removeHistory':
client.history.removeHistory(target); client.history.removeHistory(target);
@ -2295,7 +2530,7 @@ Scrutari.Client.prototype.initChangeListeners = function (changeHandler) {
Scrutari.Client.prototype.mainsearchResultCallback = function (scrutariResult) { Scrutari.Client.prototype.mainsearchResultCallback = function (scrutariResult) {
var client = this; var client = this;
client.processResult(scrutariResult, "mainsearch"); client.processResult(scrutariResult, "mainsearch");
client.$modal("loading", 'hide'); client.endLoading();
if (client.functions.mainsearchResultCallback) { if (client.functions.mainsearchResultCallback) {
client.functions.mainsearchResultCallback(client, scrutariResult); client.functions.mainsearchResultCallback(client, scrutariResult);
} }
@ -2305,7 +2540,7 @@ Scrutari.Client.prototype.mainsearchErrorCallback = function (error) {
if (client.functions.displayError) { if (client.functions.displayError) {
client.functions.displayError(client, error, "mainsearch"); client.functions.displayError(client, error, "mainsearch");
} }
client.$modal("loading", 'hide'); client.endLoading();
if (client.functions.mainsearchErrorCallback) { if (client.functions.mainsearchErrorCallback) {
client.functions.mainsearchErrorCallback(client, error); client.functions.mainsearchErrorCallback(client, error);
} }
@ -2313,7 +2548,7 @@ Scrutari.Client.prototype.mainsearchErrorCallback = function (error) {
Scrutari.Client.prototype.subsearchResultCallback = function (scrutariResult) { Scrutari.Client.prototype.subsearchResultCallback = function (scrutariResult) {
var client = this; var client = this;
client.processResult(scrutariResult, "subsearch"); client.processResult(scrutariResult, "subsearch");
client.$modal("loading", 'hide'); client.endLoading();
if (client.functions.subsearchResultCallback) { if (client.functions.subsearchResultCallback) {
client.functions.subsearchResultCallback(client, scrutariResult); client.functions.subsearchResultCallback(client, scrutariResult);
} }
@ -2323,7 +2558,7 @@ Scrutari.Client.prototype.subsearchErrorCallback = function (error) {
if (client.functions.displayError) { if (client.functions.displayError) {
client.functions.displayError(client, error, "subsearch"); client.functions.displayError(client, error, "subsearch");
} }
client.$modal("loading", 'hide'); client.endLoading();
if (client.functions.subsearchErrorCallback) { if (client.functions.subsearchErrorCallback) {
client.functions.subsearchErrorCallback(client, error); client.functions.subsearchErrorCallback(client, error);
} }
@ -2341,7 +2576,7 @@ Scrutari.Client.prototype.checkInitialQuery = function () {
} else if (initialQId) { } else if (initialQId) {
var requestParameters = client.buildRequestParameters(); var requestParameters = client.buildRequestParameters();
requestParameters["qid"] = initialQId; requestParameters["qid"] = initialQId;
client.$modal("loading", 'show'); client.startLoading();
client.hook("newSearch", requestParameters, "qidsearch"); client.hook("newSearch", requestParameters, "qidsearch");
Scrutari.Result.newSearch(client.scrutariConfig, requestParameters, function (scrutariResult) { Scrutari.Result.newSearch(client.scrutariConfig, requestParameters, function (scrutariResult) {
var $mainSearchForm = client.$form('mainsearch'); var $mainSearchForm = client.$form('mainsearch');
@ -2481,6 +2716,16 @@ Scrutari.Client.prototype.processResult = function (scrutariResult, searchOrigin
} }
resultProcess.run(); resultProcess.run();
}; };
Scrutari.Client.prototype.startLoading = function () {
if (this.functions.startLoading) {
this.functions.startLoading(this);
}
};
Scrutari.Client.prototype.endLoading = function () {
if (this.functions.endLoading) {
this.functions.endLoading(this);
}
};
Scrutari.Client.init = function (scrutariConfig, clientId, options, callback) { Scrutari.Client.init = function (scrutariConfig, clientId, options, callback) {
if (!$.templates) { if (!$.templates) {
throw new Error("JsRender is not installed"); throw new Error("JsRender is not installed");
@ -2953,6 +3198,38 @@ Scrutari.DefaultUi.displayError = function (client, error, searchOrigin) {
Scrutari.logError(error); Scrutari.logError(error);
} }
}; };
Scrutari.DefaultUi.modalAction = function (client, name, action) {
var $modal = client.$modal(name);
if ($modal.length === 0) {
Scrutari.log("Unknown modal: " + name);
return;
}
switch(action) {
case 'show':
if (!$modal.data("overlayId")) {
var overlayId = Scrutari.Overlay.start({
header: $modal.children("header").html(),
content: $modal.children("div").html(),
footer: $modal.children("footer").html(),
closeTooltip: client.loc("_ button_close"),
afterEnd: function () {
$modal.data("overlayId", null);
}
});
$modal.data("overlayId", overlayId);
}
break;
case 'hide':
Scrutari.Overlay.end($modal.data("overlayId"));
break;
}
};
Scrutari.DefaultUi.startLoading = function (client) {
Scrutari.DefaultUi.modalAction(client, 'loading', 'show');
};
Scrutari.DefaultUi.endLoading = function (client) {
Scrutari.DefaultUi.modalAction(client, 'loading', 'hide');
};
Scrutari.DefaultUi.newResultProcess = function (client, scrutariResult, searchOrigin) { Scrutari.DefaultUi.newResultProcess = function (client, scrutariResult, searchOrigin) {
return new Scrutari.Process(client, scrutariResult, searchOrigin); return new Scrutari.Process(client, scrutariResult, searchOrigin);
}; };