2016-08-17 12:31:29 +00:00
|
|
|
function addConversation() {
|
|
|
|
var json = JSON.stringify({ "action": "add" });
|
|
|
|
$.ajax({
|
|
|
|
url: "/conversations", data: json, method: "POST", success: function (result) {
|
|
|
|
document.getElementById("conversations").innerHTML += result;
|
2016-08-18 20:35:23 +00:00
|
|
|
showAddUserToConv();
|
2016-08-17 12:31:29 +00:00
|
|
|
}, error: function (result) {
|
|
|
|
showError(result.responseText);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
return false;
|
2016-08-18 20:35:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function showAddUserToConv() {
|
|
|
|
var json = JSON.stringify({ "action": "adduserdialog" });
|
|
|
|
$.ajax({
|
|
|
|
url: "/conversations", data: json, method: "POST", success: function (result) {
|
|
|
|
document.getElementById("hoverdialog").innerHTML = result;
|
|
|
|
document.getElementById("hoverdialogcont").style.display = "table";
|
|
|
|
}, error: function (result) {
|
|
|
|
showError(result.responseText);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function addUserToConv() {
|
|
|
|
var liste = document.getElementById("searchuserlist");
|
|
|
|
var json = JSON.stringify({ "action": "adduser", "userid": liste.options[liste.selectedIndex].value });
|
|
|
|
$.ajax({
|
|
|
|
url: "/conversations", data: json, method: "POST", success: function (result) {
|
|
|
|
document.getElementById("hoverdialogcont").style.display = "none";
|
|
|
|
}, error: function (result) {
|
|
|
|
showError(result.responseText);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|