libreavous/squelettes/javascript/scrutarijs/frameworks/default.js

52 lines
21 KiB
JavaScript

var SCRUTARI_HTML = {
_name:'default',
structure:{
'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-action="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-action="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-action="checkAll" data-scrutari-target="base" disabled>_ button_check_all</button>\n <button type="button" data-scrutari-action="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-action="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-action="checkAll" data-scrutari-target="category" disabled>_ button_check_all</button>\n <button type="button" data-scrutari-action="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-action="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-action="checkAll" data-scrutari-target="corpus" disabled>_ button_check_all</button>\n <button type="button" data-scrutari-action="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-action="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-action="checkAll" data-scrutari-target="lang" disabled>_ button_check_all</button>\n <button type="button" data-scrutari-action="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-action="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-action="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-action="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>\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-action="loadHistory" data-scrutari-target="{{:name}}" class="scrutari-history-Load" {{if fichestat == 0}}disabled="disabled"{{/if}}>\n {{>sequence}} ({{:fichestat}})\n </button>\n <button data-scrutari-action="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>\n{{if withFilter}}\n<p><em>{{>~scrutari_loc("_ result_fitlerwarning")}}</em></p>\n{{/if}}\n{{if searchUnit.notfoundArray.length > 0}}\n<p>{{>~scrutari_loc("_ result_notfound")}}{{>~scrutari_loc("_ colon")}}</p>\n<ul>\n {{for searchUnit.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-action="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-action="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>'
}
};