mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 09:53:15 +00:00
PHRAS-2301_thesaurus_concept_path_port_41
This commit is contained in:
@@ -12,10 +12,11 @@
|
|||||||
</div>
|
</div>
|
||||||
dans index {{ results.getIndexes() }}
|
dans index {{ results.getIndexes() }}
|
||||||
{% if not(esquery is null) %}
|
{% if not(esquery is null) %}
|
||||||
<div>
|
|
||||||
<a href="#" id="esqueryCopy">{{ 'copyClipboardLabel' | trans }}</a>
|
|
||||||
</div>
|
|
||||||
<div class="esqueryDataDiv">
|
<div class="esqueryDataDiv">
|
||||||
|
<textarea id="esqueryDataPaths" placeholder="{{ 'No thesaurus concept query' | trans }}"></textarea>
|
||||||
|
<div style="overflow: hidden;">
|
||||||
|
<a href="#" id="esqueryCopy">{{ 'copyClipboardLabel' | trans }}</a>
|
||||||
|
</div>
|
||||||
<textarea id="esqueryData">{{ esquery }}</textarea>
|
<textarea id="esqueryData">{{ esquery }}</textarea>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -23,6 +24,27 @@
|
|||||||
|
|
||||||
<script language="javascript">
|
<script language="javascript">
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
|
var esQuery = JSON.parse($('#esqueryData').text());
|
||||||
|
var pathField = $('#esqueryDataPaths');
|
||||||
|
|
||||||
|
// Loop the top level
|
||||||
|
$.each(esQuery, testQuery);
|
||||||
|
|
||||||
|
function testQuery(key, value) {
|
||||||
|
if (value !== null && typeof value === "object") {
|
||||||
|
if(key === 'multi_match') {
|
||||||
|
var testValue = value.fields[0];
|
||||||
|
if(testValue.startsWith('concept_path')) {
|
||||||
|
pathField.append(path + '\n');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// Recurse into children
|
||||||
|
$.each(value, testQuery);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var copyElContentClipboard = function (elId) {
|
var copyElContentClipboard = function (elId) {
|
||||||
var copyEl = document.getElementById(elId);
|
var copyEl = document.getElementById(elId);
|
||||||
copyEl.select();
|
copyEl.select();
|
||||||
|
Reference in New Issue
Block a user