diff --git a/Phraseanet-production-client/config/config.js b/Phraseanet-production-client/config/config.js index 800b5ed110..8832f52663 100644 --- a/Phraseanet-production-client/config/config.js +++ b/Phraseanet-production-client/config/config.js @@ -13,5 +13,5 @@ module.exports = { setupDir: _root + 'tests/setup/node.js', karmaConf: _root + 'config/karma.conf.js', // change this version when you change JS file for lazy loading - assetFileVersion: 99 + assetFileVersion: 100 }; diff --git a/Phraseanet-production-client/dist/authenticate.js b/Phraseanet-production-client/dist/authenticate.js index 9af3d447ab..982d59fc52 100644 --- a/Phraseanet-production-client/dist/authenticate.js +++ b/Phraseanet-production-client/dist/authenticate.js @@ -96,7 +96,7 @@ return /******/ (function(modules) { // webpackBootstrap /******/ if (__webpack_require__.nc) { /******/ script.setAttribute("nonce", __webpack_require__.nc); /******/ } -/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".js?v=99"; +/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".js?v=100"; /******/ var timeout = setTimeout(onScriptComplete, 120000); /******/ script.onerror = script.onload = onScriptComplete; /******/ function onScriptComplete() { diff --git a/Phraseanet-production-client/dist/authenticate.min.js b/Phraseanet-production-client/dist/authenticate.min.js index f637b4573d..dcb5cee768 100644 --- a/Phraseanet-production-client/dist/authenticate.min.js +++ b/Phraseanet-production-client/dist/authenticate.min.js @@ -96,7 +96,7 @@ return /******/ (function(modules) { // webpackBootstrap /******/ if (__webpack_require__.nc) { /******/ script.setAttribute("nonce", __webpack_require__.nc); /******/ } -/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".min.js?v=99"; +/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".min.js?v=100"; /******/ var timeout = setTimeout(onScriptComplete, 120000); /******/ script.onerror = script.onload = onScriptComplete; /******/ function onScriptComplete() { diff --git a/Phraseanet-production-client/dist/commons.js b/Phraseanet-production-client/dist/commons.js index 6f47f550a5..02277abae6 100644 --- a/Phraseanet-production-client/dist/commons.js +++ b/Phraseanet-production-client/dist/commons.js @@ -91,7 +91,7 @@ /******/ if (__webpack_require__.nc) { /******/ script.setAttribute("nonce", __webpack_require__.nc); /******/ } -/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".js?v=99"; +/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".js?v=100"; /******/ var timeout = setTimeout(onScriptComplete, 120000); /******/ script.onerror = script.onload = onScriptComplete; /******/ function onScriptComplete() { diff --git a/Phraseanet-production-client/dist/commons.min.js b/Phraseanet-production-client/dist/commons.min.js index 6dc990d61c..3f7cc651c0 100644 --- a/Phraseanet-production-client/dist/commons.min.js +++ b/Phraseanet-production-client/dist/commons.min.js @@ -91,7 +91,7 @@ /******/ if (__webpack_require__.nc) { /******/ script.setAttribute("nonce", __webpack_require__.nc); /******/ } -/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".min.js?v=99"; +/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".min.js?v=100"; /******/ var timeout = setTimeout(onScriptComplete, 120000); /******/ script.onerror = script.onload = onScriptComplete; /******/ function onScriptComplete() { diff --git a/Phraseanet-production-client/dist/production.js b/Phraseanet-production-client/dist/production.js index f62d0b0b12..92d005b50d 100644 --- a/Phraseanet-production-client/dist/production.js +++ b/Phraseanet-production-client/dist/production.js @@ -22280,6 +22280,7 @@ var recordEditorService = function recordEditorService(services) { var $editTimeArea = void 0; var $editMonoValTextArea = void 0; var $editMultiValTextArea = void 0; + var $searchThesaurus = void 0; var $toolsTabs = void 0; var $idExplain = void 0; var $dateFormat = /^\d{4}\/\d{2}\/\d{2} \d{2}:\d{2}:\d{2}$|^\d{4}\/\d{2}\/\d{2}$|^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$|^\d{4}-\d{2}-\d{2}$/; @@ -22307,6 +22308,7 @@ var recordEditorService = function recordEditorService(services) { $editMultiValTextArea = (0, _jquery2.default)('#EditTextMultiValued', options.$container); $toolsTabs = (0, _jquery2.default)('#EDIT_MID_R .tabs', options.$container); $idExplain = (0, _jquery2.default)('#idExplain', options.$container); + $searchThesaurus = (0, _jquery2.default)('.editor-thesaurus-search', options.$container); $toolsTabs.tabs({ activate: function activate(event, ui) { @@ -22441,6 +22443,10 @@ var recordEditorService = function recordEditorService(services) { $editTimeArea.hide(); $editDateArea.css('width', 210); } + }).on('mouseup mousedown keyup keydown', '.editor-thesaurus-search', function (event) { + var currentField = options.fieldCollection.getActiveField(); + + onUserInputComplete(event, $searchThesaurus.val(), currentField); }); }; @@ -22686,6 +22692,8 @@ var recordEditorService = function recordEditorService(services) { function onSelectField(evt, fieldIndex) { $editTextArea.blur(); $editMultiValTextArea.blur(); + $searchThesaurus.blur(); + (0, _jquery2.default)('.editDiaButtons', options.$container).hide(); (0, _jquery2.default)($editTextArea, $editMultiValTextArea).unbind('keyup.maxLength'); @@ -22802,6 +22810,8 @@ var recordEditorService = function recordEditorService(services) { if (field.type === 'date') { $editTextArea.hide(); $editDateArea.show(); + $searchThesaurus.hide(); + (0, _jquery2.default)('#idEditDateZone', options.$container).show(); $editDateArea.val(field._value); @@ -22830,6 +22840,7 @@ var recordEditorService = function recordEditorService(services) { (0, _jquery2.default)('#idEditDateZone', options.$container).hide(); $editTextArea.show(); $editTextArea.css('height', '100%'); + $searchThesaurus.show(); if (field.input_disable) { $editTextArea.prop('disabled', true); @@ -22906,6 +22917,8 @@ var recordEditorService = function recordEditorService(services) { return $editMultiValTextArea.focus(); }, 50); + $searchThesaurus.show(); + // reveal_mval(); } } @@ -23033,6 +23046,9 @@ var recordEditorService = function recordEditorService(services) { $editTextArea.blur(); $editMultiValTextArea.blur(); + $searchThesaurus.blur(); + + $searchThesaurus.hide(); (0, _jquery2.default)('#idFieldNameEdit', options.$container).html('[STATUS]'); $idExplain.html(' '); diff --git a/Phraseanet-production-client/dist/production.min.js b/Phraseanet-production-client/dist/production.min.js index f62d0b0b12..92d005b50d 100644 --- a/Phraseanet-production-client/dist/production.min.js +++ b/Phraseanet-production-client/dist/production.min.js @@ -22280,6 +22280,7 @@ var recordEditorService = function recordEditorService(services) { var $editTimeArea = void 0; var $editMonoValTextArea = void 0; var $editMultiValTextArea = void 0; + var $searchThesaurus = void 0; var $toolsTabs = void 0; var $idExplain = void 0; var $dateFormat = /^\d{4}\/\d{2}\/\d{2} \d{2}:\d{2}:\d{2}$|^\d{4}\/\d{2}\/\d{2}$|^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$|^\d{4}-\d{2}-\d{2}$/; @@ -22307,6 +22308,7 @@ var recordEditorService = function recordEditorService(services) { $editMultiValTextArea = (0, _jquery2.default)('#EditTextMultiValued', options.$container); $toolsTabs = (0, _jquery2.default)('#EDIT_MID_R .tabs', options.$container); $idExplain = (0, _jquery2.default)('#idExplain', options.$container); + $searchThesaurus = (0, _jquery2.default)('.editor-thesaurus-search', options.$container); $toolsTabs.tabs({ activate: function activate(event, ui) { @@ -22441,6 +22443,10 @@ var recordEditorService = function recordEditorService(services) { $editTimeArea.hide(); $editDateArea.css('width', 210); } + }).on('mouseup mousedown keyup keydown', '.editor-thesaurus-search', function (event) { + var currentField = options.fieldCollection.getActiveField(); + + onUserInputComplete(event, $searchThesaurus.val(), currentField); }); }; @@ -22686,6 +22692,8 @@ var recordEditorService = function recordEditorService(services) { function onSelectField(evt, fieldIndex) { $editTextArea.blur(); $editMultiValTextArea.blur(); + $searchThesaurus.blur(); + (0, _jquery2.default)('.editDiaButtons', options.$container).hide(); (0, _jquery2.default)($editTextArea, $editMultiValTextArea).unbind('keyup.maxLength'); @@ -22802,6 +22810,8 @@ var recordEditorService = function recordEditorService(services) { if (field.type === 'date') { $editTextArea.hide(); $editDateArea.show(); + $searchThesaurus.hide(); + (0, _jquery2.default)('#idEditDateZone', options.$container).show(); $editDateArea.val(field._value); @@ -22830,6 +22840,7 @@ var recordEditorService = function recordEditorService(services) { (0, _jquery2.default)('#idEditDateZone', options.$container).hide(); $editTextArea.show(); $editTextArea.css('height', '100%'); + $searchThesaurus.show(); if (field.input_disable) { $editTextArea.prop('disabled', true); @@ -22906,6 +22917,8 @@ var recordEditorService = function recordEditorService(services) { return $editMultiValTextArea.focus(); }, 50); + $searchThesaurus.show(); + // reveal_mval(); } } @@ -23033,6 +23046,9 @@ var recordEditorService = function recordEditorService(services) { $editTextArea.blur(); $editMultiValTextArea.blur(); + $searchThesaurus.blur(); + + $searchThesaurus.hide(); (0, _jquery2.default)('#idFieldNameEdit', options.$container).html('[STATUS]'); $idExplain.html(' '); diff --git a/Phraseanet-production-client/src/components/record/recordEditor/index.js b/Phraseanet-production-client/src/components/record/recordEditor/index.js index eaa105c32c..ff3cea3406 100644 --- a/Phraseanet-production-client/src/components/record/recordEditor/index.js +++ b/Phraseanet-production-client/src/components/record/recordEditor/index.js @@ -34,6 +34,7 @@ const recordEditorService = services => { let $editTimeArea; let $editMonoValTextArea; let $editMultiValTextArea; + let $searchThesaurus; let $toolsTabs; let $idExplain; let $dateFormat = /^\d{4}\/\d{2}\/\d{2} \d{2}:\d{2}:\d{2}$|^\d{4}\/\d{2}\/\d{2}$|^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$|^\d{4}-\d{2}-\d{2}$/; @@ -59,6 +60,7 @@ const recordEditorService = services => { $editMultiValTextArea = $('#EditTextMultiValued', options.$container); $toolsTabs = $('#EDIT_MID_R .tabs', options.$container); $idExplain = $('#idExplain', options.$container); + $searchThesaurus = $('.editor-thesaurus-search', options.$container); $toolsTabs.tabs({ activate: function (event, ui) { @@ -213,6 +215,11 @@ const recordEditorService = services => { $editDateArea.css('width',210); } }) + .on('mouseup mousedown keyup keydown', '.editor-thesaurus-search', (event) => { + let currentField = options.fieldCollection.getActiveField(); + + onUserInputComplete(event, $searchThesaurus.val(), currentField); + }) ; }; @@ -476,6 +483,8 @@ const recordEditorService = services => { function onSelectField(evt, fieldIndex) { $editTextArea.blur(); $editMultiValTextArea.blur(); + $searchThesaurus.blur(); + $('.editDiaButtons', options.$container).hide(); $($editTextArea, $editMultiValTextArea).unbind('keyup.maxLength'); @@ -607,6 +616,8 @@ const recordEditorService = services => { if (field.type === 'date') { $editTextArea.hide(); $editDateArea.show(); + $searchThesaurus.hide(); + $('#idEditDateZone', options.$container).show(); $editDateArea.val(field._value); @@ -635,6 +646,7 @@ const recordEditorService = services => { $('#idEditDateZone', options.$container).hide(); $editTextArea.show(); $editTextArea.css('height', '100%'); + $searchThesaurus.show(); if (field.input_disable) { $editTextArea.prop('disabled', true); @@ -718,6 +730,8 @@ const recordEditorService = services => { self.setTimeout(() => $editMultiValTextArea.focus(), 50); + $searchThesaurus.show(); + // reveal_mval(); } } @@ -867,6 +881,9 @@ const recordEditorService = services => { $editTextArea.blur(); $editMultiValTextArea.blur(); + $searchThesaurus.blur(); + + $searchThesaurus.hide(); $('#idFieldNameEdit', options.$container).html('[STATUS]'); $idExplain.html(' '); diff --git a/lib/Alchemy/Phrasea/Twig/PhraseanetExtension.php b/lib/Alchemy/Phrasea/Twig/PhraseanetExtension.php index a5a7d7a045..8e8b24fe0d 100644 --- a/lib/Alchemy/Phrasea/Twig/PhraseanetExtension.php +++ b/lib/Alchemy/Phrasea/Twig/PhraseanetExtension.php @@ -62,7 +62,7 @@ public function getGlobals() { return [ // change this version when you change JS file to force the navigation to reload js file - 'assetFileVersion' => 99 + 'assetFileVersion' => 100 ]; } diff --git a/templates/web/prod/actions/edit_default.html.twig b/templates/web/prod/actions/edit_default.html.twig index 14b84c93ea..0d6629e1d2 100644 --- a/templates/web/prod/actions/edit_default.html.twig +++ b/templates/web/prod/actions/edit_default.html.twig @@ -271,6 +271,7 @@ {% if thesaurus %}
+

+{{ databox.get_label(app['locale']) }}