porting PHRAS-511 to 4.1

This commit is contained in:
Mike Ng
2018-01-04 13:16:28 +04:00
parent 0d7c2bd52d
commit 2a8af901f3

View File

@@ -39,6 +39,14 @@
self.location.replace("thesaurus.php?piv={{ piv }}&bid={{ bid }}") ; 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) function test(div)
{ {
t = document.getElementById(div).innerHTML; t = document.getElementById(div).innerHTML;
@@ -262,7 +270,7 @@
<tr> <tr>
<td style="text-align:right; width:80px;"><span class="label"></span> :&nbsp;</td> <td style="text-align:right; width:80px;"><span class="label"></span> :&nbsp;</td>
<td></td> <td></td>
<td><input type="text" style="width:250px;" name="term"></td> <td><input type="text" style="width:250px;" name="term" onkeyup="inputChanged();return(false);"></td>
</tr> </tr>
<tr> <tr>
<td style="text-align:right">{{ 'thesaurus:: contexte' | trans }} : </td> <td style="text-align:right">{{ 'thesaurus:: contexte' | trans }} : </td>
@@ -976,6 +984,10 @@
var myObj = { "win":window }; var myObj = { "win":window };
var t = zdialog.find("[name=term]").val(); 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(); var k = zdialog.find("[name=context]").val();
if(k != "") { if(k != "") {
t += " (" + k + ")"; t += " (" + k + ")";