Skip to content

Commit b6062ea

Browse files
authored
Merge pull request #5 from Recherche-Data-Gouv/US897_remove_inputTooShort
Us897 remove input too short
2 parents 5b09673 + 8804eab commit b6062ea

1 file changed

Lines changed: 11 additions & 7 deletions

File tree

scripts/ontoportal.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ jQuery(document).ready(function ($) {
88
const translations = {
99
en: {
1010
selectTitle: "Open in new tab to view Term page",
11-
selectTerm: "Select a term",
12-
searchBy: "Search by preferred or alternate label...",
11+
placeholder: "Type one or more words",
12+
searching: "Searching...",
1313
freeTextPrefix: "Free text: ",
1414
expandFields: "Expand all fields",
1515
shrinkFields: "Shrink all fields",
1616
},
1717
fr: {
1818
selectTitle: "Ouvre la page du mot-clé dans un nouvel onglet",
19-
selectTerm: "Tapez le mot-clé",
20-
searchBy: "Recherchez par mot-clé exact ou synonyme",
19+
placeholder: "Taper un ou plusieurs mots",
20+
searching: "Recherche en cours...",
2121
freeTextPrefix: "Saisie libre: ",
2222
expandFields: "Développer tous les champs",
2323
shrinkFields: "Réduire tous les champs",
@@ -176,7 +176,7 @@ jQuery(document).ready(function ($) {
176176
let vocabUriSelector = `input[data-cvoc-managed-field="${managedFields["vocabularyUri"]}"]`;
177177
let termSelector = `input[data-cvoc-managed-field="${managedFields["termName"]}"]`;
178178

179-
let placeholder = input.hasAttribute("data-cvoc-placeholder") ? $(input).attr("data-cvoc-placeholder") : getLocalizedText("selectTerm");
179+
let placeholder = input.hasAttribute("data-cvoc-placeholder") ? $(input).attr("data-cvoc-placeholder") : getLocalizedText("placeholder");
180180
let termParentUri = $(input).data("cvoc-filter");
181181
// <select> identifier
182182
let selectId = "ontoportalAddSelect_" + num;
@@ -264,8 +264,12 @@ jQuery(document).ready(function ($) {
264264
language: {
265265
searching: function (params) {
266266
// Change this to be appropriate for your application
267-
return getLocalizedText("searchBy");
268-
}
267+
return getLocalizedText("searching");
268+
},
269+
inputTooShort: function(args) {
270+
//return "Please enter " + (e.minimum - e.input.length) + " or more characters";
271+
return '';
272+
},
269273
},
270274
placeholder: placeholder,
271275
// Some vocabs are very slow and/or fail with a 500 error when searching for only 2 letters

0 commit comments

Comments
 (0)