Nouvelle version de ScrutariJs

This commit is contained in:
Vincent Calame 2024-05-02 11:31:17 +02:00 committed by root
parent 21eb6ba6d0
commit bffdc7ec05
10 changed files with 275 additions and 219 deletions

View File

@ -3,14 +3,13 @@ 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 scrutariApi = new Scrutari.Api(Scrutari.Lav.getApiSettings());
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);
Scrutari.Client.init(scrutariApi, "scrutari_client", initOptions, null);
});
</script>
</script>

View File

@ -49,8 +49,7 @@ Scrutari.Lav.init = function (client) {
$("#" + client.clientId).html(client.compileStructure("main"));
$("#zone").html(client.compileStructure("main", {
noLoc: false,
withIndent: true,
withPath: true
withComment: true
}));
}
client.initForms();
@ -182,8 +181,12 @@ Scrutari.Lav.changeHandler = function (client, element, name) {
}
};
Scrutari.Lav.getConfigOptions = function () {
Scrutari.Lav.getApiSettings = function () {
return {
name: "libreavous",
engineUrl: Scrutari.Lav.SCRUTARI_URL,
lang: "fr",
origin: "site",
paginationLength: Scrutari.Lav.PAGINATION_LENGTH,
limit: -1
};

View File

@ -1,52 +1,52 @@
var SCRUTARI_HTML = {
_name:'default',
structure:{
'area-input':'<div data-scrutari-area="input" class="scrutari-area-Input"> <div> <input type="search" size="40" name="q" value=""> <button type="submit">_ button_submit</button> </div> <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-poweredby':'<div class="scrutari-area-Poweredby scrutari-Hidden" data-scrutari-hidden="empty"> <p> <a href="http://www.scrutari.net" target="_blank"> <span class="scrutari-icon-Logo"></span> _ link_poweredby </a> </p> </div>',
'area-result':'<div data-scrutari-area="result" class="scrutari-area-Result"> <div data-scrutari-block="paginationBlock"></div> <div> {{result-links}} </div> <div> {{result-history}} </div> <div> {{result-subsearch}} </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> <span data-scrutari-label="mainTitle"></span> </p> </div> ',
'main-form':'<form data-scrutari-form="mainsearch" role="search"> {{area-input}} {{area-parameters}} </form>',
'main':'{{area-title}} {{main-form}} {{area-stats}} {{area-result}} {{area-poweredby}} {{modal-*}}',
'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':'<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':'<aside class="scrutari-Hidden" data-scrutari-modal="help_ponderation" aria-hidden="true"> <header> _ ponderation_help </header> <div> _ help_ponderation.html </div> </aside>',
'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':'<details class="scrutari-Hidden" data-scrutari-panel="base"> <summary> _ title_filter_base <span data-scrutari-label="baseFilter" class="scrutari-panel-State scrutari-Disabled" data-scrutari-alternate="_ filter_on">_ filter_off</span> </summary> <div> <div class="scrutari-panel-Toolbar"> <span class="scrutari-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="scrutari-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="scrutari-panel-Columns scrutari-Disabled" data-scrutari-block="columnsBlock-base"> <div></div> <div></div> <div></div> <div></div> </div> </div> </details>',
'panel-category':'<details class="scrutari-Hidden" data-scrutari-panel="category"> <summary> _ title_filter_category <span data-scrutari-label="categoryFilter" class="scrutari-panel-State scrutari-Disabled" data-scrutari-alternate="_ filter_on">_ filter_off</span> </summary> <div> <div class="scrutari-panel-Toolbar"> <span class="scrutari-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="scrutari-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="scrutari-panel-Columns scrutari-Disabled" data-scrutari-block="columnsBlock-category"> <div></div> <div></div> <div></div> <div></div> </div> </div> </details>',
'panel-corpus':'<details class="scrutari-Hidden" data-scrutari-panel="corpus"> <summary> _ title_filter_corpus <span data-scrutari-label="corpusFilter" class="scrutari-panel-State scrutari-Disabled" data-scrutari-alternate="_ filter_on">_ filter_off</span> </summary> <div> <div class="scrutari-panel-Toolbar"> <span class="scrutari-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="scrutari-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="scrutari-panel-Columns scrutari-Disabled" data-scrutari-block="columnsBlock-corpus"> <div></div> <div></div> <div></div> <div></div> </div> </div> </details>',
'panel-lang':'<details class="scrutari-Hidden" data-scrutari-panel="lang"> <summary> _ title_filter_lang <span data-scrutari-label="langFilter" class="scrutari-panel-State scrutari-Disabled" data-scrutari-alternate="_ filter_on">_ filter_off</span> </summary> <div> <div class="scrutari-panel-Toolbar"> <span class="scrutari-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="scrutari-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="scrutari-panel-Columns scrutari-Disabled" data-scrutari-block="columnsBlock-lang"> <div></div> <div></div> <div></div> <div></div> </div> </div> </details>',
'panel-options':'<details data-scrutari-panel="options"> <summary> _ title_options </summary> <div> <div class="scrutari-panel-Columns"> <div> <p><span>_ mode_title</span><button data-scrutari-button="showModal" data-scrutari-target="help_mode" type="button" title="_ mode_help">?</button></p> <div> <label><input type="radio" name="q-mode" value="intersection" checked> _ mode_intersection</label> <label><input type="radio" name="q-mode" value="union"> _ mode_union</label> <label><input type="radio" name="q-mode" value="operation"> _ mode_operation</label> <label><input type="checkbox" name="wildchar" value="end" checked> _ wildchar_end</label> </div> </div> <div> <p><span>_ ponderation_title</span><button data-scrutari-button="showModal" data-scrutari-target="help_ponderation" type="button" title="_ ponderation_help">?</button></p> <div> <label><input type="radio" name="ponderation" value="pertinence" checked> _ ponderation_pertinence</label> <label><input type="radio" name="ponderation" value="date"> _ ponderation_date</label> </div> </div> <div> <p><span>_ periode_title</span><button data-scrutari-button="showModal" data-scrutari-target="help_periode" type="button" title="_ periode_help">?</button></p> <div> <input type="text" name="periode" value="" size="20"> </div> </div> </div> </div> </details>',
'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':'<div class="scrutari-Hidden" data-scrutari-hidden="empty"> <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> </div>',
'result-subsearch':'<div class="scrutari-Hidden" data-scrutari-hidden="threshold"> <form data-scrutari-form="subsearch" role="search"> <p class="scrutari-subsearch-Title">_ title_subsearch</p> <div class="scrutari-subsearch-Form"> <input type="search" size="40" name="q"> <button type="submit">_ button_subsearch</button> </div> </form> </div>',
'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> '
'area-input':'<div data-scrutari-area="input" class="scrutari-area-Input">\n <div>\n <input type="search" size="40" name="q" value="">\n <button type="submit">_ button_submit</button>\n </div>\n <button type="button" data-scrutari-button="parametersDisplay" class="scrutari-Hidden" data-scrutari-state="off">\n _ button_parameters\n </button>\n</div>',
'area-parameters':'<div data-scrutari-area="parameters" class="scrutari-area-Parameters scrutari-Hidden">\n {{panel-options}}\n {{panel-corpus}}\n {{panel-base}}\n {{panel-lang}}\n {{panel-category}}\n <div class="scrutari-area-Resubmit">\n <button type="submit">_ button_resubmit</button>\n </div>\n</div>',
'area-poweredby':'<div class="scrutari-area-Poweredby scrutari-Hidden" data-scrutari-hidden="empty">\n <p>\n <a href="http://www.scrutari.net" target="_blank">\n <span class="scrutari-icon-Logo"></span> _ link_poweredby\n </a>\n </p>\n</div>',
'area-result':'<div data-scrutari-area="result" class="scrutari-area-Result">\n <div data-scrutari-block="paginationBlock"></div>\n <div>\n {{result-links}}\n </div>\n <div>\n {{result-history}}\n </div>\n <div>\n {{result-subsearch}}\n </div>\n</div>',
'area-stats':'<div data-scrutari-area="stats" class="scrutari-area-Stats">\n {{stats-table}}\n</div>',
'area-title':'<div data-scrutari-area="title" class="scrutari-area-Title">\n <p>\n <span data-scrutari-label="mainTitle"></span>\n </p>\n</div>',
'main-form':'<form data-scrutari-form="mainsearch" role="search">\n {{area-input}}\n {{area-parameters}}\n</form>',
'main':'{{area-title}}\n{{main-form}}\n{{area-stats}}\n{{area-result}}\n{{area-poweredby}}\n{{modal-*}}',
'modal-help_mode':'<aside class="scrutari-Hidden" data-scrutari-modal="help_mode" aria-hidden="true">\n <header>\n _ mode_help\n </header>\n <div>\n _ help_mode.html\n </div>\n</aside>',
'modal-help_periode':'<aside class="scrutari-Hidden" data-scrutari-modal="help_periode" aria-hidden="true">\n <header>\n _ periode_help\n </header>\n <div>\n _ help_periode.html\n </div>\n</aside>',
'modal-help_ponderation':'<aside class="scrutari-Hidden" data-scrutari-modal="help_ponderation" aria-hidden="true">\n <header>\n _ ponderation_help\n </header>\n <div>\n _ help_ponderation.html\n </div>\n</aside>',
'modal-loading':'<aside class="scrutari-Hidden" data-scrutari-modal="loading" aria-hidden="true">\n <div>\n <span class="scrutari-icon-Loader"></span> _ loading_search\n </div>\n</aside>',
'panel-base':'<details class="scrutari-Hidden" data-scrutari-panel="base">\n <summary>\n _ title_filter_base <span data-scrutari-label="baseFilter" class="scrutari-panel-State scrutari-Disabled" data-scrutari-alternate="_ filter_on">_ filter_off</span>\n </summary>\n <div>\n <div class="scrutari-panel-Toolbar">\n <span class="scrutari-panel-ButtonGroup">\n <button type="button" data-scrutari-button="enablePanel" data-scrutari-target="base" data-scrutari-state="off">\n <span data-scrutari-alternate="_ button_filter_off">_ button_filter_on</span>\n </button>\n </span>\n <span class="scrutari-panel-ButtonGroup">\n <button type="button" data-scrutari-button="checkAll" data-scrutari-target="base" disabled>_ button_check_all</button>\n <button type="button" data-scrutari-button="uncheckAll" data-scrutari-target="base" disabled>_ button_uncheck_all</button>\n </span>\n </div>\n <div class="scrutari-panel-Columns scrutari-Disabled" data-scrutari-block="columnsBlock-base">\n <div></div>\n <div></div>\n <div></div>\n <div></div>\n </div>\n </div>\n</details>',
'panel-category':'<details class="scrutari-Hidden" data-scrutari-panel="category">\n <summary>\n _ title_filter_category <span data-scrutari-label="categoryFilter" class="scrutari-panel-State scrutari-Disabled" data-scrutari-alternate="_ filter_on">_ filter_off</span>\n </summary>\n <div>\n <div class="scrutari-panel-Toolbar">\n <span class="scrutari-panel-ButtonGroup">\n <button type="button" data-scrutari-button="enablePanel" data-scrutari-target="category" data-scrutari-state="off">\n <span data-scrutari-alternate="_ button_filter_off">_ button_filter_on</span>\n </button>\n </span>\n <span class="scrutari-panel-ButtonGroup">\n <button type="button" data-scrutari-button="checkAll" data-scrutari-target="category" disabled>_ button_check_all</button>\n <button type="button" data-scrutari-button="uncheckAll" data-scrutari-target="category" disabled>_ button_uncheck_all</button>\n </span>\n </div>\n <div class="scrutari-panel-Columns scrutari-Disabled" data-scrutari-block="columnsBlock-category">\n <div></div>\n <div></div>\n <div></div>\n <div></div> \n </div>\n </div>\n</details>',
'panel-corpus':'<details class="scrutari-Hidden" data-scrutari-panel="corpus">\n <summary>\n _ title_filter_corpus <span data-scrutari-label="corpusFilter" class="scrutari-panel-State scrutari-Disabled" data-scrutari-alternate="_ filter_on">_ filter_off</span>\n </summary>\n <div>\n <div class="scrutari-panel-Toolbar">\n <span class="scrutari-panel-ButtonGroup">\n <button type="button" data-scrutari-button="enablePanel" data-scrutari-target="corpus" data-scrutari-state="off">\n <span data-scrutari-alternate="_ button_filter_off">_ button_filter_on</span>\n </button>\n </span>\n <span class="scrutari-panel-ButtonGroup">\n <button type="button" data-scrutari-button="checkAll" data-scrutari-target="corpus" disabled>_ button_check_all</button>\n <button type="button" data-scrutari-button="uncheckAll" data-scrutari-target="corpus" disabled>_ button_uncheck_all</button>\n </span>\n </div>\n <div class="scrutari-panel-Columns scrutari-Disabled" data-scrutari-block="columnsBlock-corpus">\n <div></div>\n <div></div>\n <div></div>\n <div></div>\n </div>\n </div>\n</details>',
'panel-lang':'<details class="scrutari-Hidden" data-scrutari-panel="lang">\n <summary>\n _ title_filter_lang <span data-scrutari-label="langFilter" class="scrutari-panel-State scrutari-Disabled" data-scrutari-alternate="_ filter_on">_ filter_off</span>\n </summary>\n <div>\n <div class="scrutari-panel-Toolbar">\n <span class="scrutari-panel-ButtonGroup">\n <button type="button" data-scrutari-button="enablePanel" data-scrutari-target="lang" data-scrutari-state="off">\n <span data-scrutari-alternate="_ button_filter_off">_ button_filter_on</span>\n </button>\n </span>\n <span class="scrutari-panel-ButtonGroup">\n <button type="button" data-scrutari-button="checkAll" data-scrutari-target="lang" disabled>_ button_check_all</button>\n <button type="button" data-scrutari-button="uncheckAll" data-scrutari-target="lang" disabled>_ button_uncheck_all</button>\n </span>\n </div>\n <div class="scrutari-panel-Columns scrutari-Disabled" data-scrutari-block="columnsBlock-lang">\n <div></div>\n <div></div>\n <div></div>\n <div></div>\n </div>\n </div>\n</details>',
'panel-options':'<details data-scrutari-panel="options">\n <summary>\n _ title_options\n </summary>\n <div>\n <div class="scrutari-panel-Columns">\n <div>\n <p><span>_ mode_title</span><button data-scrutari-button="showModal" data-scrutari-target="help_mode" type="button" title="_ mode_help">?</button></p>\n <div>\n <label><input type="radio" name="q-mode" value="intersection" checked> _ mode_intersection</label>\n <label><input type="radio" name="q-mode" value="union"> _ mode_union</label>\n <label><input type="radio" name="q-mode" value="operation"> _ mode_operation</label>\n <label><input type="checkbox" name="wildchar" value="end" checked> _ wildchar_end</label>\n </div>\n </div>\n <div>\n <p><span>_ ponderation_title</span><button data-scrutari-button="showModal" data-scrutari-target="help_ponderation" type="button" title="_ ponderation_help">?</button></p>\n <div>\n <label><input type="radio" name="ponderation" value="pertinence" checked> _ ponderation_pertinence</label>\n <label><input type="radio" name="ponderation" value="date"> _ ponderation_date</label>\n </div>\n </div>\n <div>\n <p><span>_ periode_title</span><button data-scrutari-button="showModal" data-scrutari-target="help_periode" type="button" title="_ periode_help">?</button></p>\n <div>\n <input type="text" name="periode" value="" size="20">\n </div>\n </div>\n </div>\n </div>\n</details>',
'result-history':'<div class="scrutari-Hidden" data-scrutari-hidden="start">\n <p class="scrutari-links-Title">_ title_history</p>\n <div data-scrutari-block="historyList">\n </div>\n</div>',
'result-links':'<div class="scrutari-Hidden" data-scrutari-hidden="empty">\n <p class="scrutari-links-Title">_ title_share</p>\n <p class="scrutari-links-Permalink">\n <a href="#" data-scrutari-link="permalink" target="_blank" title="_ link_permalink" >\n <span data-scrutari-label="permalinkValue"></span>\n </a>\n </p>\n <p class="scrutari-links-Title">_ title_download</p>\n <p>\n <a href="#" data-scrutari-link="ods" target="_blank" title="_ link_ods" class="scrutari-links-ButtonLike">ods</a>\n <a href="#" data-scrutari-link="csv" target="_blank" title="_ link_csv" class="scrutari-links-ButtonLike">csv</a>\n </p>\n <p class="scrutari-links-Title">_ title_feed</p>\n <p>\n <a href="#" data-scrutari-link="atom" target="_blank" title="_ link_atom" class="scrutari-links-ButtonLike">atom</a>\n </p>\n</div>',
'result-subsearch':'<div class="scrutari-Hidden" data-scrutari-hidden="threshold">\n <form data-scrutari-form="subsearch" role="search">\n <p class="scrutari-subsearch-Title">_ title_subsearch</p>\n <div class="scrutari-subsearch-Form">\n <input type="search" size="40" name="q">\n <button type="submit">_ button_subsearch</button>\n </div>\n </form>\n</div>',
'stats-filter':'<tr class="scrutari-Hidden" data-scrutari-hidden="filter" data-scrutari-count="stats-filter">\n <td class="scrutari-stats-Cell"><abbr class="scrutari-stats-Abbr" title="_ stats_filter_title">_ stats_filter_short</abbr></td>\n <td class="scrutari-stats-Cell scrutari-stats-Number"><span class="scrutari-stats-Count" data-scrutari-component="value"></span></td>\n <td class="scrutari-stats-Cell scrutari-stats-Titles"><span data-scrutari-component="titles"></span></td>\n</tr>',
'stats-global':'<tr class="scrutari-Hidden" data-scrutari-hidden="init" data-scrutari-count="stats-global">\n <td class="scrutari-stats-Cell"><abbr class="scrutari-stats-Abbr" title="_ stats_global_title">_ stats_global_short</abbr></td>\n <td class="scrutari-stats-Cell scrutari-stats-Number"><span class="scrutari-stats-Count" data-scrutari-component="value"></span></td>\n</tr>',
'stats-result':'<tr class="scrutari-Hidden" data-scrutari-hidden="start" data-scrutari-count="stats-result"> \n <td class="scrutari-stats-Cell"><abbr class="scrutari-stats-Abbr" title="_ stats_result_title">_ stats_result_short</abbr></td>\n <td class="scrutari-stats-Cell scrutari-stats-Number"><span class="scrutari-stats-Count" data-scrutari-component="value"></span></td>\n</tr>',
'stats-table':'<table class="scrutari-stats-Table">\n {{stats-global}}\n {{stats-filter}}\n {{stats-result}}\n </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">&times;</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>',
'base':'<p>\n<label class="scrutari-Label" {{if phraseMap.longtitle}}title="{{> phraseMap.longtitle}}"{{/if}}><input type="checkbox" name="base" value="{{:codebase}}" data-scrutari-title="{{> title}}">\n{{if baseicon}}\n<img src="{{:baseicon}}" alt="" class="scrutari-panel-Icon">\n{{/if}}\n<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>\n</label>\n</p>',
'category':'<p>\n<label class="scrutari-Label" {{if phraseMap.description}}title="{{> phraseMap.description}}"{{/if}}>\n<input type="checkbox" name="category" value="{{:name}}" data-scrutari-title="{{> title}}">\n<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>\n</label>\n</p>',
'corpus':'<p>\n<label class="scrutari-Label"><input type="checkbox" name="corpus" value="{{:codecorpus}}" data-scrutari-title="{{> title}}">\n <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>\n</label>\n</p>',
'fiche':'<div class="scrutari-fiche-Block" data-scrutari-block="fiche-{{:codefiche}}">\n{{include tmpl="fiche_icon" /}}\n<div class="scrutari-fiche-Body {{if _thumbnail}}scrutari-fiche-ThumbnailBody{{/if}}">\n {{for _bodyTemplateArray ~fiche=#data}}\n {{include ~fiche tmpl=~scrutari_client.getTemplate(#data) /}}\n {{/for}}\n</div>\n</div>',
'fiche_attribute':'{{if type!=="block"}}\n<p class="scrutari-fiche-Attribute">\n <span class="scrutari-label-Attribute">{{>title}}{{>~scrutari_loc("_ colon")}}</span>\n {{for valueArray ~len=valueArray.length}}\n {{:~scrutari_mark(#data)}}{{if #index != (~len -1)}}, {{/if}}\n {{/for}}\n</p>\n{{else}}\n<div class="scrutari-fiche-AttributeBlock">\n <p class="scrutari-fiche-AttributeTitle">\n <span class="scrutari-label-Attribute">{{>title}}{{>~scrutari_loc("_ colon")}}</span>\n </p>\n <div class="scrutari-fiche-AttributeValues">\n {{for valueArray ~len=valueArray.length}}\n <p class="scrutari-fiche-AttributeValue">\n {{:~scrutari_mark(#data)}}\n </p>\n {{/for}}\n </div>\n</div>\n{{/if}}',
'fiche_bythesaurusarray':'{{if _bythesaurusArray}}\n {{for _bythesaurusArray}}\n <p class="scrutari-fiche-Motcle">\n <span class="scrutari-label-Motcle">\n {{> thesaurus.title}}{{>~scrutari_loc("_ colon")}}\n </span>\n {{for motcleArray ~len=motcleArray.length}}\n {{if mlabelArray}}{{for mlabelArray}}{{if #index > 0}}/{{/if}}{{:~scrutari_mark(mvalue)}}{{/for}}{{/if}}{{if #index != (~len -1)}}, {{/if}}\n {{/for}}\n </p>\n {{/for}}\n{{/if}}',
'fiche_icon':'{{if _thumbnail}}\n <div class="scrutari-fiche-Thumbnail">\n <img class="scrutari-fiche-ThumbnailImg" alt="" src="{{:_thumbnail}}"/>\n {{if _icon}}\n <img class="scrutari-fiche-ThumbnailIcon" alt="" src="{{:_icon}}"/>\n {{/if}}\n </div>\n{{else _icon}}\n <div class="scrutari-fiche-Icon"><img alt="" src="{{:_icon}}"/></div>\n{{/if}}',
'fiche_mcomplementarray':'{{if mcomplementArray}}\n {{for mcomplementArray}}\n <p class="scrutari-fiche-Complement">\n <span class="scrutari-label-Complement">\n {{>title}}{{>~scrutari_loc("_ colon")}}\n </span>\n {{:~scrutari_mark(mvalue)}}\n </p>\n {{/for}}\n{{/if}}',
'fiche_motclearray':'{{if _motcleArray}}\n <p class="scrutari-fiche-Motcle">\n <span class="scrutari-label-Motcle">\n {{if _motcleArray.length == 1}}\n {{>~scrutari_loc("_ fiche_motscles_one")}}\n {{else}}\n {{>~scrutari_loc("_ fiche_motscles_many")}}\n {{/if}}\n </span>\n {{for _motcleArray ~len=_motcleArray.length}}\n {{if mlabelArray}}{{for mlabelArray}}{{if #index > 0}}/{{/if}}{{:~scrutari_mark(mvalue)}}{{/for}}{{/if}}{{if #index != (~len -1)}}, {{/if}}\n {{/for}}\n </p>\n{{/if}}',
'fiche_msoustitre':'{{if msoustitre}}\n <p class="scrutari-fiche-Soustitre">\n {{:~scrutari_mark(msoustitre)}}\n </p>\n{{/if}}',
'fiche_mtitre':'<p class="scrutari-fiche-Titre">\n <a href="{{:href}}"\n class="scrutari-fiche-Link"\n data-scrutari-link="fiche_{{:codefiche}}"\n {{if _target}} target="{{:_target}}"{{/if}}>\n {{if mtitre}}\n {{:~scrutari_mark(mtitre)}}\n {{else}}\n {{:href}}\n {{/if}}\n </a>\n</p>',
'fiche_primaryattributearray':'{{if _primaryAttributeArray}}\n {{for _primaryAttributeArray tmpl="fiche_attribute" /}}\n{{/if}}',
'fiche_secondaryattributearray':'{{if _secondaryAttributeArray}}\n{{for _secondaryAttributeArray tmpl="fiche_attribute" /}}\n{{/if}}',
'fiche_year':'{{if year}}\n <p class="scrutari-fiche-Year">\n {{:year}}\n </p>\n{{/if}}',
'history':'<div data-scrutari-block="{{:name}}" class="scrutari-history-Block scrutari-history-Active">\n <div class="scrutari-history-Search">\n <button data-scrutari-button="loadHistory" data-scrutari-target="{{:name}}" class="scrutari-history-Load" {{if fichestat == 0}}disabled="disabled"{{/if}}>\n {{>sequence}} ({{:fichestat}})\n </button>\n <button data-scrutari-button="removeHistory" data-scrutari-target="{{:name}}" class="scrutari-history-Remove" title="{{>~scrutari_loc(\'_ button_remove\')}}"><span aria-hidden="true">&times;</span></button>\n </div>\n <div class="scrutari-history-Subsearch" data-scrutari-component="subsearch"></div>\n</div>',
'lang':'<p>\n<label class="scrutari-Label"><input type="checkbox" name="lang" value="{{:lang}}" data-scrutari-title="{{:lang}}">\n <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>\n</label>\n</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> {{/if}} {{if scrutariResult.notfoundArray.length > 0}} <p>{{>~scrutari_loc("_ result_notfound")}}{{>~scrutari_loc("_ colon")}}</p> <ul> {{for scrutariResult.notfoundArray}} <li> {{> text}} {{if neighbourArray.length > 0}} <small>(<em>{{>~scrutari_loc("_ result_neighbourlist")}}{{>~scrutari_loc("_ colon")}}</em> {{for neighbourArray ~len=neighbourArray.length}}{{> neighbour}}{{if #index != (~len -1)}}, {{/if}}{{/for}})</small> {{else}} <small>(<em>{{>~scrutari_loc("_ result_noneighbour")}}</em>)</small> {{/if}} </li> {{/for}} </ul> {{/if}}',
'pagination_groups':'<div class="scrutari-group-List" role="tablist"> {{for array}} <button role="tab" class="scrutari-group-Tab" {{if active}}disabled{{/if}} data-scrutari-button="ficheGroupTab" {{if description}}title="{{>description}}"{{/if}} data-scrutari-target="{{:name}}"> {{>title}} ({{:fichestat}}) </button> {{/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\'}} <button class="scrutari-pagination-Tab" disabled>{{>title}}</button> {{else state===\'etc\'}} <span class="scrutari-pagination-Etc">{{>title}}</span> {{else}} <button class="scrutari-pagination-Tab" role="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}}</button> {{/if}} {{/for}} </div>'
'pagination_empty':'<p><em>{{>~scrutari_loc("_ result_none")}}</em></p>\n{{if withFilter}}\n<p><em>{{>~scrutari_loc("_ result_fitlerwarning")}}</em></p>\n{{/if}}\n{{if scrutariResult.notfoundArray.length > 0}}\n<p>{{>~scrutari_loc("_ result_notfound")}}{{>~scrutari_loc("_ colon")}}</p>\n<ul>\n {{for scrutariResult.notfoundArray}}\n <li>\n {{> text}}\n {{if neighbourArray.length > 0}}\n <small>(<em>{{>~scrutari_loc("_ result_neighbourlist")}}{{>~scrutari_loc("_ colon")}}</em> {{for neighbourArray ~len=neighbourArray.length}}{{> neighbour}}{{if #index != (~len -1)}}, {{/if}}{{/for}})</small>\n {{else}}\n <small>(<em>{{>~scrutari_loc("_ result_noneighbour")}}</em>)</small>\n {{/if}}\n </li>\n {{/for}}\n</ul>\n{{/if}}',
'pagination_groups':'<div class="scrutari-group-List" role="tablist">\n{{for array}}\n <button role="tab" class="scrutari-group-Tab" {{if active}}disabled{{/if}} data-scrutari-button="ficheGroupTab" {{if description}}title="{{>description}}"{{/if}}\n data-scrutari-target="{{:name}}">\n {{>title}} ({{:fichestat}})\n </button>\n{{/for}}\n</div>\n{{for array}}\n<div class="scrutari-group-Content {{if !active}}scrutari-Hidden{{/if}}" data-scrutari-block="ficheGroup-{{:name}}" data-scrutari-name="{{:name}}">\n <div data-scrutari-block="topTabs-{{:name}}"></div>\n <div data-scrutari-block="ficheList-{{:name}}"></div>\n <div data-scrutari-block="bottomTabs-{{:name}}"></div>\n</div>\n{{/for}}',
'pagination_unique':'<div data-scrutari-block="topTabs"></div>\n<div data-scrutari-block="ficheList"></div>\n<div data-scrutari-block="bottomTabs"></div>',
'tabs':'<div class="scrutari-pagination-TabList">\n {{for tabArray}}\n {{if state===\'active\'}}\n <button class="scrutari-pagination-Tab" disabled>{{>title}}</button>\n {{else state===\'etc\'}}\n <span class="scrutari-pagination-Etc">{{>title}}</span>\n {{else}}\n <button\n class="scrutari-pagination-Tab"\n role="tab"\n data-scrutari-button="paginationTab"\n data-scrutari-type="{{:~root.type}}"\n data-scrutari-position="{{:~root.position}}"\n data-scrutari-number="{{:number}}"\n {{if ~root.ficheGroupName}} data-scrutari-fiche-group-name="{{:~root.ficheGroupName}}"{{/if}}>{{>title}}</button>\n {{/if}}\n {{/for}}\n</div>'
}
};

File diff suppressed because one or more lines are too long

View File

@ -8,6 +8,7 @@ lang:'en',
'_ button_filter_on':'Turn filter on',
'_ button_parameters':'Filters and options',
'_ button_remove':'Remove',
'_ button_resubmit':'Relaunching research',
'_ button_submit':'Search',
'_ button_uncheck_all':'Uncheck all',
'_ colon':':',
@ -28,7 +29,16 @@ lang:'en',
'_ fiche_motscles_one':'Keyword:',
'_ filter_off':'[off]',
'_ filter_on':'[on]',
'_ label_base_many':'Bases',
'_ label_base_one':'Base',
'_ label_category_many':'Categories',
'_ label_category_one':'Category',
'_ label_corpus_many':'Corpus',
'_ label_corpus_one':'Corpus',
'_ label_lang_many':'Languages',
'_ label_lang_one':'Language',
'_ link_atom':'ATOM feed',
'_ link_csv':'Table in CSV format',
'_ link_ods':'Table in ODS format',
'_ link_permalink':'Permalink',
'_ link_poweredby':'Search powered by Scrutari',
@ -54,6 +64,7 @@ lang:'en',
'_ stats_result_short':'Result:',
'_ stats_result_title':'Number of references that answer the search criteria',
'_ title_download':'Retrieving all references:',
'_ title_feed':'Subscribe to search',
'_ title_filter_base':'Database filter',
'_ title_filter_category':'Document type filter',
'_ title_filter_corpus':'Corpus filter',
@ -65,6 +76,10 @@ lang:'en',
'_ title_subsearch':'Searching latest results:',
'_ wildchar_end':'“*” is added automatically at the end of the word',
'_ button_subsearch':'Filter',
'_ result_fitlerwarning':'Reminder: a filter is currently active',
'_ result_notfound':'Terms not found',
'_ result_neighbourlist':'Similar terms found',
'_ result_noneighbour':'No similar terms were found',
'_ help_mode.html':'<p> <strong>Simple search (</strong><em><strong>And</strong></em><strong>&nbsp;/ </strong><em><strong>Or</strong></em> <strong>options):</strong> the spaces are delimiters for the search terms; if the option <em>And</em> is selected, a reference has to include all the search terms; if the selected option is <em>Or</em>, a reference has to include at least one of the terms. </p><p> The asterisk <kbd>*</kbd> indicates a truncation: </p><ul> <li> <p> <kbd>gov*</kbd>: all words beginning with &ldquo;gov&rdquo; </p> </li> <li> <p> <kbd>*logy</kbd>: all words ending in &ldquo;logy&rdquo; </p> </li> <li> <p> <kbd>*eco*</kbd>: all words including &ldquo;eco&rdquo; </p> </li> </ul><p> If the option <em>&ldquo;*&rdquo; automatically added to the end of the word</em> is ticked, all the words are considered to have a truncation on the right (unless they are in quotation marks). </p><p>We use straight quotation marks to indicate a sequence of words. It is possible to indicate truncations inside quotation marks:</p><ul> <li> <p> <kbd>"organic farming"</kbd>: ignores the term organic if it is not followed by farming </p> </li> <li> <p> <kbd>"part"</kbd>: only searches for the word &ldquo;part&rdquo; even if the automatic asterisk to the right is activated </p> </li> <li> <p> <kbd>"pub* pol*"</kbd>: search for sequences of a word beginning with &ldquo;pub&rdquo; followed by a word beginning with &ldquo;pol&rdquo; </p> </li> </ul><p>The following rules apply:</p><ul> <li> <p>searches do not take accents and uppercase letters into account</p> </li> <li> <p>characters other than letters and figures are ignored</p> </li> <li> <p>the search engine does not propose corrections for typing errors and spelling mistakes</p> </li> <li> <p>the search engine does not index in the references words with one or two letters, such as common words which are not significant in a given language (&ldquo;les, avec, par&rdquo; will be ignored in French, &ldquo;the&rdquo; is ignored in English but not in French, to include searches on the term &ldquo;th&eacute;&rdquo;)</p> </li> </ul><p> <br> <strong>Advanced search (&ldquo;Advanced&rdquo; option):</strong> the advanced search uses the same principles as the simple search in terms of syntax (asterisk <kbd>*</kbd> for truncations, quotation marks for sequences) but the space is no longer a delimiter; instead, we use three operators: </p><ul> <li> <p> <kbd>&amp;&amp;</kbd>: And </p> </li> <li> <p> <kbd>||</kbd>: Or </p> </li> <li> <p> <kbd>!</kbd>: No </p> </li> </ul><p>We use brackets to form logical groups.</p><p>Examples:</p><ul> <li> <p> <kbd>farming &amp;&amp;~!organic</kbd>: searches for references containing a word beginning with farming and not containing any words beginning with organic </p> </li> <li> <p> <kbd>farming &amp;&amp;~!(organic || country)</kbd>: searches for references containing a word beginning with farming and not containing either words beginning with organic or words beginning with country </p> </li> </ul><p>All syntax errors (including the use of characters other than numbers, unauthorized letters and a space for separating words not in quotation marks) produce an error message.</p><p>It is possible to restrict the search for a word to a given field by prefixing a term. Possible prefixes are:</p><ul> <li> <p> <em>title:</em> = only in titles </p> </li> <li> <p> <em>subtitle:</em> = only in subtitles </p> </li> <li> <p> <em>keyword:</em> = only in keywords </p> </li> <li> <p> <em>additional:</em> = in &ldquo;additional&rdquo; fields (complementary fields and attributes) </p> </li> <li> <p> all attribute names followed by&nbsp;: defined by the search engine (e.g. <em>sct:authors:</em> but it depends on the engine used) </p> </li> </ul><p>Examples:</p><ul> <li> <p> <kbd>title:governance</kbd>: &ldquo;governance&rdquo; only in the title </p> </li> <li> <p> <kbd>sct:authors:"Victor Hugo"</kbd>: search for the author Victor Hugo (if the attribute <em>sct:authors</em> is properly defined by the engine) </p> </li> <li> <p> <kbd>title:pol* &amp;&amp;~!sct:authors:Smith</kbd>: reference with a word beginning with &ldquo;pol&rdquo; in the title and whose author is not Smith </p> </li> </ul><p> See <a href="http://www.scrutari.net/dokuwiki/serveurscrutari:json:qsyntax" hreflang="fr" target="_blank" rel="external">Search syntax</a> on the Scrutari website (in french) </p> ',
'_ help_periode.html':'<p>This field is used to restrict references to those that correspond to a given period. It is possible to specify:</p><ul> <li> <p> a particular year: <kbd>2014</kbd> </p> </li> <li> <p> a period covering several years by using the slash mark <kbd>/</kbd> as a delimiter: <kbd>2000/2011</kbd> </p> </li> <li> <p> a particular month: <kbd>2014-01</kbd> </p> </li> <li> <p> a period beginning and ending with a particular month: <kbd>2013/2014-04</kbd> </p> </li> <li> <p> several different periods, by separating them with two vertical bars <kbd>||</kbd> (&ldquo;OR&rdquo; operator): <kbd>2001/2002||2005||2012-11</kbd> </p> </li> </ul><p>It is worth noting that, frequently, only the year of a given reference is known. This means that in certain configurations, specifying the month will not produce any results.</p> ',
'_ help_ponderation.html':'<p>Configuration of ranking priority will affect the order results are displayed in:</p><ul> <li> <p> <strong>ranking by relevance:</strong> priority is given to references containing the search terms in the main fields (title, subtitle) rather than secondary fields, with a premium when it is also present in the keywords. </p> <p>The date does, however, play a role in deciding on similar ratings by relevance. In addition, when engines search several databases, ranking may be slightly altered to avoid overly long series of references from the same database;</p> </li> <li> <p> <strong>ranking by date:</strong> as explained by the name, this is when the most recent references are positioned first, with relevance as the deciding factor when dates are very similar; references without dates are at the end. </p> </li> </ul> '

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -64,7 +64,7 @@ lang:'it',
'_ stats_result_short':'risultato',
'_ stats_result_title':'numero di risultati corrispondenti ai criteri di ricerca',
'_ title_download':'recupero dellintegralità dei risultati',
'_ title_feed':'Abbonati alla ricerca :',
'_ title_feed':'Abbonati alla ricerca\u00A0:',
'_ title_filter_base':'filtri sulle basi',
'_ title_filter_category':'filtri sulle categorie',
'_ title_filter_corpus':'filtri sul corpo del testo',
@ -77,6 +77,9 @@ lang:'it',
'_ wildchar_end':'«\u00A0*\u00A0» si aggiunge automaticamente alla fine delle parole',
'_ button_subsearch':'Filtrare',
'_ result_fitlerwarning':'Avviso: un filtro è attualmente attivo',
'_ result_notfound':'Termini non trovati',
'_ result_neighbourlist':'Termini correlati',
'_ result_noneighbour':'Non sono stati trovati termini simili',
'_ help_mode.html':'<p> <strong>Ricerca semplice (Opzioni </strong><em><strong>e</strong></em><strong>&nbsp;/ </strong><em><strong>o</strong></em><strong>)&nbsp;:</strong>gli spazi servono a delimitare le parole della ricerca&nbsp;; se si selziona l&rsquo;opzione E il rinvio deve contenere tutte le parole della ricerca&nbsp;; se si seleziona l&rsquo;opzione O il rinvio deve possedere almeno una parola della ricerca. </p><p> L&rsquo;asterisco <kbd>*</kbd>&nbsp;indica una troncatura&nbsp;: </p><ul> <li> <p> <kbd>gov*</kbd>&nbsp;: tutte le parole che cominciano con &laquo;&nbsp;gov&nbsp;&raquo; </p> </li> <li> <p> <kbd>*logia</kbd>&nbsp;: tutte le parole che finiscono con &laquo;&nbsp;logia&nbsp;&raquo; </p> </li> <li> <p> <kbd>*eco*</kbd>&nbsp;: tutte le parole che contengono &laquo;&nbsp;eco&nbsp;&raquo; </p> </li> </ul><p> Se si seleziona l&rsquo;opzione &laquo;&nbsp;*&nbsp;&raquo; <em>aggiunto automaticamente alla fine della parola</em>, tutte le parole saranno da considerarsi con una troncatura a destra (fanno eccezione le parole tra virgolette). </p><p>Per indicare una sequenza di termini si usano le virgolette alte. All&rsquo;interno delle virgolette si possono indicare le troncature &nbsp;:</p><ul> <li> <p> <kbd>"agricoltura biologica"</kbd>&nbsp;: il termine agricoltura viene ignorato se non &egrave; seguito dall&rsquo;aggettivo biologica </p> </li> <li> <p> <kbd>"part"</kbd>: cerca solo la parola &laquo;&nbsp;part&nbsp;&raquo; anche se l&rsquo;opzione automatica asterisco a destra &egrave; attiva </p> </li> <li> <p> <kbd>"pol*pub*"</kbd>: cerca le sequenze che contengono una parola che comincia con &laquo;&nbsp;pol&nbsp;&raquo; seguita da una parola che comincia con &laquo;&nbsp;pub&nbsp;&raquo; </p> </li> </ul><p>Per finire valgono le seguenti regole&nbsp;:</p><ul> <li> <p>la ricerca non considera accenti e maiuscole</p> </li> <li> <p>i soli caratteri presi in considerazione sono le lettere e le cifre</p> </li> <li> <p>il motore non propone correzioni in caso di errori di ortografia</p> </li> <li> <p>il motore non considera le parole di una o due lettere, n&eacute; le parole di uso corrente ma senza significato proprio ( per esempio&nbsp;: gli, con, per )</p> </li> </ul><p> <br> <strong>Ricerca avanzata ( Opzione &laquo;&nbsp;Avanzata&nbsp;&raquo;)&nbsp;:</strong> la ricerca avanzata usa gli stessi principi della ricerca delle parole ( asterisco * per le troncature, virgolette per le sequenze) ma lo spazio non ha pi&ugrave; la funzione di separatore. Al suo posto si usano tre operatori&nbsp;: </p><ul> <li> <p> <kbd>&amp;&amp;</kbd>&nbsp;: E </p> </li> <li> <p> <kbd>||</kbd>&nbsp;: O </p> </li> <li> <p> <kbd>!</kbd>&nbsp;: No </p> </li> </ul><p>Per formare gruppi logici si fa ricorso alle parentesi.</p><p>Esempi&nbsp;:</p><ul> <li> <p> <kbd>agricoltura &amp;&amp; !biologica</kbd>&nbsp;: cerca i risultati che contengono la parola agricoltura non seguita dalla parola biologica </p> </li> <li> <p> <kbd>agricoltura &amp;&amp; !(biologico || paese)</kbd>&nbsp;: cerca i risultati che contengono la parola agricoltura et che non contengano la parola biologica o paese. </p> </li> </ul><p>Gli errori di sintassi (compreso l&rsquo;uso di caratteri non autorizzati che non siano cifre o lettere, e lo spazio per separare parole non virgolettate) provocano un messaggio di errore.</p><p>La ricerca di una parola pu&ograve; essere circoscritta a un campo preciso grazie a un prefisso. I prefissi sono&nbsp;:</p><ul> <li> <p> <em>titolo:</em> = solo tra i titoli </p> </li> <li> <p> <em>sottotitolo:</em> = solo tra i sottotitoli </p> </li> <li> <p> <em>parolachiave:</em> = solo tra le parole chiave </p> </li> <li> <p> <em>supplemento:</em> = tra i campi supplementari (campi complementari e attributi) </p> </li> </ul><p> qualsiasi nome di attributo seguito da&nbsp;<em>:</em> definito dal motore ( per sempio&nbsp;: <em>sct:authors</em>. Questo dipende dal motore che si usa.) </p><p>Esempi&nbsp;:</p><ul> <li> <p> <kbd>titolo:governance</kbd>&nbsp;: &laquo; governance &raquo;nel titolo </p> </li> <li> <p> <kbd>sct:authors:"Victor Hugo"</kbd>&nbsp;: Ricerca su l&rsquo;autore Victor Hugo (se l&rsquo;attributo <em>sct:authors</em> &egrave; definito correttamente dal motore) </p> </li> <li> <p> <kbd>titolo:pol* &amp;&amp; !sct:authors:Dupont</kbd>&nbsp;: risultato con, nel titolo, una parola che comincia con &laquo;&nbsp;pol&nbsp;&raquo; e il cui autore non sia Dupont. </p> </li> </ul><p> Guardare <a href="http://www.scrutari.net/dokuwiki/serveurscrutari:json:qsyntax" hreflang="fr" target="_blank" rel="external">Syntaxe d&rsquo;une recherche</a> sul sito di Scrutari </p> ',
'_ help_periode.html':'<p>Questo campo permette di conservare i risultati corrispondenti a un periodo preciso. Si possono dare come indicazioni&nbsp;:</p><ul> <li> <p> un anno&nbsp;: <kbd>2014</kbd> </p> </li> <li> <p> un periodo di svariati anni servendosi della barra obliqua&nbsp; / per separare le date di inizio e fine&nbsp;: <kbd>2000/2011</kbd> </p> </li> <li> <p> un mese&nbsp;: <kbd>2014-01</kbd> </p> </li> <li> <p> un periodo che cominci o finisca ad un mese a scelta&nbsp;: <kbd>2013/2014-04</kbd> </p> </li> <li> <p> periodi diversi, separati da due due barre verticali <kbd>||</kbd> (operatore &laquo; O &raquo;)&nbsp;: <kbd>2001/2002||2005||2012-11</kbd> </p> </li> </ul><p>Si noti che, spesso, l&rsquo;anno &egrave; la sola indicazione temporale di un risultato ; in alcune configurazioni, l&rsquo;indicazione del mese non ottiene nessun risultato.</p> ',
'_ help_ponderation.html':'<p>La configuarzione della priorit&agrave; nella classifica influisce sull&rsquo;ordine di apparizione dei risultati&nbsp;</p><ul> <li> <p> <strong>Classifica in base alla pertinenza&nbsp;:</strong> si da priorit&agrave; ai risultati che contengono i termini ricercati nei campi principali (titolo, sottotitolo) piuttosto che in quelli secondari. Tra questi hanno priorit&agrave; i risultati che contengono i termini ricercati tra le parole chiave. </p> <p>La data aiuta a classificare le note che hanno eguale pertinenza. Inoltre, nel caso di motori di ricerca con pi&ugrave; basi, la classifica pu&ograve; essere leggermente alterata per evitare una lunga lista di rinvii proveniente da una sola base.</p> </li> <li> <p> <strong>Classifica per ordine cronologico&nbsp;:</strong> i risultati pi&ugrave; recenti occupano i primi posti, quando le date sono troppo ravvicinate si fa ricorso al criterio della pertinenza ; i risultati non datati sono collocati alla fine </p> </li> </ul> '

View File

@ -64,7 +64,7 @@ lang:'pt',
'_ stats_result_short':'Resultado\u00A0:',
'_ stats_result_title':'Número de referências que atendem aos critérios de busca',
'_ title_download':'Recuperação da integralidade das referências',
'_ title_feed':'Assine a busca :',
'_ title_feed':'Assine a busca\u00A0:',
'_ title_filter_base':'Aplicar filtro em bases de dados',
'_ title_filter_category':'Aplicar filtro nas categorias',
'_ title_filter_corpus':'Aplicar filtro nos corpus',
@ -76,5 +76,8 @@ lang:'pt',
'_ title_subsearch':'Pesquisa sobre os resultados da busca atual:',
'_ wildchar_end':'«\u202F*\u202F» acrescentado automaticamente no final das palavras',
'_ button_subsearch':'Filtrar',
'_ result_fitlerwarning':'Lembrar: atualmente há um filtro ativo'
'_ result_fitlerwarning':'Lembrar: atualmente há um filtro ativo',
'_ result_notfound':'Termos não encontrados',
'_ result_neighbourlist':'Termos relacionados',
'_ result_noneighbour':'Não foram encontrados termos semelhantes'
};

View File

@ -1,4 +1,4 @@
/* version: 1.4alpha6 */
/* version: 1.4alpha12 */
var Scrutari = {};
Scrutari.log = function (msg) {
if ((console) && (console.log)) {
@ -73,13 +73,10 @@ Scrutari.hasMarkedAttribute = function (fiche, attributeKey) {
return true;
}
};
Scrutari.Api = function (name, engineUrl, lang, origin, options) {
this.name = name;
this.engineUrl = engineUrl;
this.lang = lang;
this.origin = origin;
this.meta = null;
this.options = {
Scrutari.Api = function (settings) {
var name, engineUrl, lang, origin;
var argumentLength = arguments.length;
var options = {
dataType: "json",
queryVariant: "query",
ficheFields: null,
@ -89,42 +86,59 @@ Scrutari.Api = function (name, engineUrl, lang, origin, options) {
groupSortFunction: _ficheCountSort,
limit: 0
};
if (arguments.length === 1) {
options = arguments[0];
}
if (options) {
for(let key in options) {
let value = options[key];
switch(key) {
case "name":
this.name = value;
break;
case "engineUrl":
this.engineUrl = value;
break;
case "lang":
this.lang = value;
break;
case "origin":
this.origin = value;
break;
default:
this.options[key] = value;
}
if (argumentLength === 1) {
name = settings.name;
engineUrl = settings.engineUrl;
lang = settings.lang;
origin = settings.origin;
if (settings.options) {
_assignOptions(settings.options);
};
_assignOptions(settings);
} else if ((argumentLength === 4) || (argumentLength === 5)) {
name = arguments[0];
engineUrl = arguments[1];
lang = arguments[2];
origin = arguments[3];
if (argumentLength === 5) {
_assignOptions(arguments[4]);
}
} else {
throw new Error("Argument length should be 1, 4 or 5");
}
if (!this.name) {
if (!name) {
throw new Error("name undefined");
}
if (!this.engineUrl) {
if (!engineUrl) {
throw new Error("engineUrl undefined");
}
if (!this.lang) {
if (!lang) {
throw new Error("lang undefined");
}
if (!this.origin) {
if (!origin) {
throw new Error("origin undefined");
}
this.name = name;
this.engineUrl = engineUrl;
this.lang = lang;
this.origin = origin;
this.options = options;
this.meta = null;
function _assignOptions(object) {
for(let key in object) {
let value = object[key];
switch(key) {
case "name":
case "engineUrl":
case "lang":
case "origin":
case "options":
break;
default:
options[key] = value;
}
}
}
function _ficheCountSort(group1, group2) {
let count1 = group1.ficheCount;
let count2 = group2.ficheCount;
@ -229,10 +243,10 @@ Scrutari.Api.prototype.initMeta = function (callback) {
}
});
};
Scrutari.Api.prototype.newSearch = function (argObject) {
Scrutari.Api.prototype.newSearch = function (args) {
var api = this;
var requestParameters = argObject.requestParameters;
var callback = argObject.callback;
var requestParameters = args.requestParameters;
var callback = args.callback;
api.loadFicheSearch({
requestParameters: requestParameters,
callback: function (ficheSearchResult) {
@ -240,50 +254,50 @@ Scrutari.Api.prototype.newSearch = function (argObject) {
callback(new Scrutari.Result(api, ficheSearchResult, requestParameters, api.options.groupSortFunction));
}
},
errorCallback: argObject.errorCallback
errorCallback: args.errorCallback
});
};
Scrutari.Api.prototype.loadBaseArray = function(argObject) {
Scrutari.Ajax.loadBaseArray(this, argObject.requestParameters, argObject.callback);
Scrutari.Api.prototype.loadBaseArray = function(args) {
Scrutari.Ajax.loadBaseArray(this, args.requestParameters, args.callback);
};
Scrutari.Api.prototype.loadCategoryArray = function(argObject) {
Scrutari.Ajax.loadCategoryArray(this, argObject.requestParameters, argObject.callback);
Scrutari.Api.prototype.loadCategoryArray = function(args) {
Scrutari.Ajax.loadCategoryArray(this, args.requestParameters, args.callback);
};
Scrutari.Api.prototype.loadCorpusArray = function(argObject) {
Scrutari.Ajax.loadCorpusArray(this, argObject.requestParameters, argObject.callback);
Scrutari.Api.prototype.loadCorpusArray = function(args) {
Scrutari.Ajax.loadCorpusArray(this, args.requestParameters, args.callback);
};
Scrutari.Api.prototype.loadThesaurusArray = function(argObject) {
Scrutari.Ajax.loadThesaurusArray(this, argObject.requestParameters, argObject.callback);
Scrutari.Api.prototype.loadThesaurusArray = function(args) {
Scrutari.Ajax.loadThesaurusArray(this, args.requestParameters, args.callback);
};
Scrutari.Api.prototype.loadEngineInfo = function(argObject) {
Scrutari.Ajax.loadEngineInfo(this, argObject.requestParameters, argObject.callback);
Scrutari.Api.prototype.loadEngineInfo = function(args) {
Scrutari.Ajax.loadEngineInfo(this, args.requestParameters, args.callback);
};
Scrutari.Api.prototype.loadFicheArray = function(argObject) {
Scrutari.Ajax.loadFicheArray(this, argObject.requestParameters, argObject.callback);
Scrutari.Api.prototype.loadFicheArray = function(args) {
Scrutari.Ajax.loadFicheArray(this, args.requestParameters, args.callback);
};
Scrutari.Api.prototype.loadMotcleArray = function(argObject) {
Scrutari.Ajax.loadMotcleArray(this, argObject.requestParameters, argObject.callback);
Scrutari.Api.prototype.loadMotcleArray = function(args) {
Scrutari.Ajax.loadMotcleArray(this, args.requestParameters, args.callback);
};
Scrutari.Api.prototype.loadGeoJson = function(argObject) {
Scrutari.Ajax.loadGeoJson(this, argObject.requestParameters, argObject.callback, argObject.errorCallback);
Scrutari.Api.prototype.loadGeoJson = function(args) {
Scrutari.Ajax.loadGeoJson(this, args.requestParameters, args.callback, args.errorCallback);
};
Scrutari.Api.prototype.loadFicheSearch = function(argObject) {
var requestParameters = argObject.requestParameters;
if ((!requestParameters) && (argObject.q)) {
Scrutari.Api.prototype.loadFicheSearch = function(args) {
var requestParameters = args.requestParameters;
if ((!requestParameters) && (args.q)) {
requestParameters = {
q: argObject.q
q: args.q
};
}
Scrutari.Ajax.loadFicheSearchResult(this, argObject.requestParameters, argObject.callback, argObject.errorCallback);
Scrutari.Ajax.loadFicheSearchResult(this, args.requestParameters, args.callback, args.errorCallback);
};
Scrutari.Api.prototype.loadExistingFicheSearch = function(argObject) {
var requestParameters = argObject.requestParameters;
if ((!requestParameters) && (argObject.qid)) {
Scrutari.Api.prototype.loadExistingFicheSearch = function(args) {
var requestParameters = args.requestParameters;
if ((!requestParameters) && (args.qid)) {
requestParameters = {
qid: argObject.qid
qid: args.qid
};
}
Scrutari.Ajax.loadExistingFicheSearchResult(this, requestParameters, argObject.callback);
Scrutari.Ajax.loadExistingFicheSearchResult(this, requestParameters, args.callback);
};
Scrutari.Ajax = {};
Scrutari.Ajax.load = function (settings) {
@ -897,73 +911,64 @@ Scrutari.Result.prototype.getFicheGroupType = function () {
return type;
};
Scrutari.Result.prototype.getUniqueFicheArray = function () {
if (this.ficheGroupArray.length === 0) {
var group = this.getFicheGroup();
if (!group) {
return new Array();
}
return this.ficheGroupArray[0].ficheArray;
return group.ficheArray;
};
Scrutari.Result.prototype.isPaginationLoaded = function (paginationLength, paginationNumber, ficheGroupName) {
var ficheArray;
var ficheCount;
if (ficheGroupName) {
let group = this.getFicheGroup(ficheGroupName);
if (!group) {
return true;
}
ficheCount = group.ficheCount;
ficheArray = group.ficheArray;
} else {
if (this.ficheGroupArray.length === 0) {
return true;
}
ficheCount = this.getFicheCount();
ficheArray = this.ficheGroupArray[0].ficheArray;
}
var length = ficheArray.length;
if (length === ficheCount) {
Scrutari.Result.prototype.isLoaded = function (args) {
var ficheGroupName = args.ficheGroupName;
var pagination = args.pagination;
var group = this.getFicheGroup(ficheGroupName);
if (!group) {
return true;
}
var endIndex = (paginationLength * paginationNumber) - 1;
if (endIndex < length) {
if (group.ficheArray.length === group.ficheCount) {
return true;
}
if (!pagination) {
return false;
}
var endIndex = (pagination.length * pagination.number) - 1;
if (endIndex < group.ficheArray.length) {
return true;
}
return false;
};
Scrutari.Result.prototype.loadPagination = function (paginationLength, paginationNumber, ficheGroupName, callback) {
var currentGroup;
var ficheCount;
var isWithGroup;
if (ficheGroupName) {
currentGroup = this.getFicheGroup(ficheGroupName);
if (!currentGroup) {
return true;
}
ficheCount = currentGroup.ficheCount;
isWithGroup = true;
} else {
if (this.ficheGroupArray.length === 0) {
return true;
}
currentGroup = this.ficheGroupArray[0];
ficheCount = this.getFicheCount();
isWithGroup = false;
Scrutari.Result.prototype.loadFiches = function (args) {
var ficheGroupName = args.ficheGroupName;
var pagination = args.pagination;
var ficheCount, length, limit;
var currentGroup = this.getFicheGroup(ficheGroupName);
if (!currentGroup) {
return true;
}
var length = currentGroup.ficheArray.length;
ficheCount = currentGroup.ficheCount;
length = currentGroup.ficheArray.length;
if (length === ficheCount) {
return;
}
if (pagination) {
limit = (pagination.length * (pagination.number + 2)) - length;
if (limit < 1) {
return;
}
} else {
limit = -1;
}
var requestParameters = {
qid: this.getQId(),
start: length +1,
limit: (paginationLength * (paginationNumber + 2)) - length
limit: limit
};
if (isWithGroup) {
if (ficheGroupName) {
requestParameters.starttype = "in:" + ficheGroupName;
}
this.api.loadExistingFicheSearch({
requestParameters: requestParameters,
callback: function (ficheSearchResult) {
if (isWithGroup) {
if (ficheGroupName) {
for(let newGroup of ficheSearchResult.ficheGroupArray) {
if (newGroup.category.name === currentGroup.category.name) {
currentGroup.ficheArray = currentGroup.ficheArray.concat(newGroup.ficheArray);
@ -974,29 +979,28 @@ Scrutari.Result.prototype.loadPagination = function (paginationLength, paginatio
currentGroup.ficheArray = currentGroup.ficheArray.concat(ficheSearchResult.ficheGroupArray[0].ficheArray);
}
}
if (callback) {
callback();
if (args.callback) {
args.callback();
}
}
});
};
Scrutari.Result.prototype.extractFicheArray = function (paginationLength, paginationNumber, ficheGroupName) {
var ficheArray;
if (ficheGroupName) {
let group = this.getFicheGroup(ficheGroupName);
if (!group) {
return new Array();
}
ficheArray = group.ficheArray;
} else {
if (this.ficheGroupArray.length === 0) {
return new Array();
}
ficheArray = this.ficheGroupArray[0].ficheArray;
Scrutari.Result.prototype.extractFicheArray = function (args) {
var ficheGroupName = args.ficheGroupName;
var pagination = args.pagination;
let group = this.getFicheGroup(ficheGroupName);
if (!group) {
return new Array();
}
return Scrutari.Utils.extractFicheArray(ficheArray, paginationLength, paginationNumber);
return Scrutari.Utils.extractFicheArray(group.ficheArray, pagination.length, pagination.number);
};
Scrutari.Result.prototype.getFicheGroup = function (ficheGroupName) {
if (!ficheGroupName) {
if (this.ficheGroupArray.length === 0) {
return null;
}
return this.ficheGroupArray[0];
}
for(let ficheGroup of this.ficheGroupArray) {
if ((ficheGroup.category) && (ficheGroup.category.name === ficheGroupName)) {
return ficheGroup;
@ -2468,24 +2472,21 @@ Scrutari.Client.prototype.compileStructure = function (name, options) {
var client = this;
var includedTexts = new Map();
var noLoc = false;
var withIndent = false;
var withPath = false;
var withComment = false;
if (options) {
noLoc = options.noLoc;
withIndent = options.withIndent;
withPath = options.withPath;
withComment = options.withComment;
}
var html = _getText(name, "", "");
var html = _getText(name, "", "/");
if (!noLoc) {
html = html.replace(/_ [-_\.a-z0-9]+/g, function(match) {
return client.loc(match);
});
}
return html;
function _getText(name, path, indent) {
let currentPath = (path)?path + "." + name:name;
function _getText(name, indent, parent) {
if (name.endsWith('*')) {
return _getTextByPrefix(name.substring(0, name.length - 1), currentPath, indent);
return _getTextByPrefix(name.substring(0, name.length - 1), indent, parent);
}
if (includedTexts.has(name)) {
Scrutari.log("Already included: " + name);
@ -2494,39 +2495,42 @@ Scrutari.Client.prototype.compileStructure = function (name, options) {
return "";
}
includedTexts.set(name, true);
var text = client.getStructureHtml(name);
text = text.replace(/([ \t]*){{([-a-zA-z0-9_]+\*?)}}[\n]?/g, function (match, p1, p2) {
return _getText(p2, currentPath, p1);
});
if ((text.length > 0) && (!text.endsWith("\n"))) {
text = text + "\n";
let result = "";
if (withComment) {
result += indent + "<!-- {{" + name + "}}" + " (" + parent + ")" + " -->\n";
}
if (withPath) {
text = "<!-- " + currentPath + " -->\n" + text + "<!-- /" + currentPath + " -->\n";
}
if (withIndent) {
let lines = text.split(/\n/);
let newText = "";
let next = false;
let text = client.getStructureHtml(name);
if (text.length > 0) {
let lines = text.split("\n");
for(let line of lines) {
if (next) {
newText += "\n";
} else {
next = true;
if (line.trim().length === 0) {
continue;
}
if (line.length > 0) {
newText = newText + indent + line;
let idx = line.indexOf("{{");
if (idx !== -1) {
let includedText = line.replace(/([ \t]*){{([-a-zA-z0-9_]+\*?)}}/g, function (match, p1, p2) {
let includeIndent = indent + p1;
return _getText(p2, includeIndent, parent + name + "/");
});
result += includedText;
if ((includedText.length > 0) && (!includedText.endsWith("\n"))) {
result += "\n";
}
} else {
result += indent + line + "\n";
}
}
text = newText;
}
return text;
if (withComment) {
result += indent + "<!-- {{/" + name + "}} -->\n";
}
return result;
}
function _getTextByPrefix(namePrefix, path, indent) {
function _getTextByPrefix(namePrefix, indent, parent) {
let result = "";
for(let name of client.getStructureNameArray()) {
if (name.startsWith(namePrefix)) {
result = result + _getText(name, path, indent);
result = result + _getText(name, indent, parent);
}
}
return result;
@ -2749,7 +2753,7 @@ Scrutari.Client.prototype.buildSearchRequestParameters = function (customParamet
if (ponderation === 'date') {
requestParameters.ponderation = '10,80,5,5';
}
var periode = $.trim(client.$input("periode").val());
var periode = client.$input("periode").val().trim();
if (periode) {
requestParameters["flt-date"] = periode;
}
@ -2768,7 +2772,7 @@ Scrutari.Client.prototype.buildSearchRequestParameters = function (customParamet
if ((client.functions.isFilterEnable) && (client.functions.isFilterEnable(client, target))) {
var $inputs = client.$input_checked(target);
var value = "";
for(var i = 0; i < $inputs.length; i++) {
for(let i = 0; i < $inputs.length; i++) {
if (i > 0) {
value += ",";
}
@ -3047,21 +3051,28 @@ Scrutari.Pagination.prototype.change = function (paginationNumber) {
Scrutari.Pagination.prototype.getPaginationFicheArray = function (scrutariResult, paginationNumber) {
var pagination = this;
var client = this.client;
var paginationLength = this.paginationLength;
var paginationArg = {
length: pagination.paginationLength,
number: paginationNumber
};
var ficheGroupName = this.ficheGroupName;
if (!scrutariResult.isPaginationLoaded(paginationLength, paginationNumber, ficheGroupName)) {
if (!scrutariResult.isLoaded({pagination: paginationArg, ficheGroupName: ficheGroupName})) {
if (client.isWaiting) {
return;
}
client.$block("ficheList", ficheGroupName).html(client.render("loading", {scrutariResult: scrutariResult}));
client.isWaiting = true;
scrutariResult.loadPagination(paginationLength, paginationNumber, ficheGroupName, function () {
client.isWaiting = false;
pagination.change(paginationNumber);
scrutariResult.loadFiches({
pagination: paginationArg,
ficheGroupName: ficheGroupName,
callback:function () {
client.isWaiting = false;
pagination.change(paginationNumber);
}
});
return false;
}
return scrutariResult.extractFicheArray(paginationLength, paginationNumber, ficheGroupName);
return scrutariResult.extractFicheArray({pagination: paginationArg, ficheGroupName: ficheGroupName});
};
Scrutari.Pagination.prototype.getFicheCount = function (scrutariResult) {
return scrutariResult.getFicheCount(this.ficheGroupName);