Added Voiceplan, Admin IVT product matcher and Voicenumber update
updates number in ContractConfig
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
var searchAddressTimer = false;
|
||||
|
||||
$(document).ready(function() {
|
||||
/*
|
||||
* Address search
|
||||
*/
|
||||
|
||||
$("#owner_text").keyup(function() {
|
||||
var search_string = $("#owner_text").val();
|
||||
|
||||
/*
|
||||
* Rate limit search, by waiting 400 ms before really searching
|
||||
* If input is received while waiting, clear timeout and set it anew
|
||||
*/
|
||||
|
||||
// clear timeout if it is set
|
||||
if(searchAddressTimer) {
|
||||
clearTimeout(searchAddressTimer);
|
||||
}
|
||||
// wait for additional input before starting the search
|
||||
searchAddressTimer = setTimeout(searchAddress, 400, "owner", search_string);
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Prevent accidental submit
|
||||
*/
|
||||
|
||||
$('#owner_text').keydown(function() {
|
||||
if(event.keyCode == 13) {
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function searchAddress(type = "owner", search_string) {
|
||||
if(search_string.length < 2) return;
|
||||
console.log("suchen...");
|
||||
|
||||
|
||||
$.get(baseurl + "Address/Api",{
|
||||
do: "findAddress",
|
||||
search: search_string
|
||||
},
|
||||
function(success) {
|
||||
console.log(success);
|
||||
if(success.status != "OK") {
|
||||
return;
|
||||
}
|
||||
showAddressResults(type, success.result);
|
||||
},
|
||||
"json");
|
||||
|
||||
$("#address_results").show();
|
||||
}
|
||||
|
||||
function showAddressResults(type, result) {
|
||||
console.log(type);
|
||||
|
||||
result.addresses.forEach(function(address) {
|
||||
cnosole.log(address);
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user