From 2a8af901f3d78b7933bf82365a9cad5cbefa1bd2 Mon Sep 17 00:00:00 2001 From: Mike Ng Date: Thu, 4 Jan 2018 13:16:28 +0400 Subject: [PATCH] porting PHRAS-511 to 4.1 --- templates/web/thesaurus/thesaurus.html.twig | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/templates/web/thesaurus/thesaurus.html.twig b/templates/web/thesaurus/thesaurus.html.twig index 48b4492a0b..3a950ea27e 100644 --- a/templates/web/thesaurus/thesaurus.html.twig +++ b/templates/web/thesaurus/thesaurus.html.twig @@ -39,6 +39,14 @@ self.location.replace("thesaurus.php?piv={{ piv }}&bid={{ bid }}") ; } + function inputChanged() { + if ($("[name=term]").val().length > 0) { + $("[name=term]").css('border-color', ''); + } else { + $("[name=term]").css('border-color', '#F00'); + } + } + function test(div) { t = document.getElementById(div).innerHTML; @@ -262,7 +270,7 @@ :  - + {{ 'thesaurus:: contexte' | trans }} : @@ -976,6 +984,10 @@ var myObj = { "win":window }; var t = zdialog.find("[name=term]").val(); + if (t.length == 0) { + zdialog.find("[name=term]").css('border-color', '#F00'); + return; + } var k = zdialog.find("[name=context]").val(); if(k != "") { t += " (" + k + ")";