Skip to content
Snippets Groups Projects
Commit 4907ead7 authored by PavelBegunkov's avatar PavelBegunkov
Browse files

errors: latent threat

parent bb55f808
Branches
Tags
No related merge requests found
...@@ -14,7 +14,9 @@ $(document).ready(function() { ...@@ -14,7 +14,9 @@ $(document).ready(function() {
} }
}); });
function dialogMyMessagesBtn()
$('.dialogMyMessagesBtn').click(function()
{ {
if(!checkMessages) if(!checkMessages)
{ {
...@@ -42,47 +44,49 @@ $(document).ready(function() { ...@@ -42,47 +44,49 @@ $(document).ready(function() {
$('.dialogMyMessages').animate({height: "0px"}, 500).html(''); $('.dialogMyMessages').animate({height: "0px"}, 500).html('');
checkMessages = false; checkMessages = false;
} }
} });
$('#errButton').click(function() $('#dialogSendButton').click(function()
{ {
$('#errDialog').dialog("open"); var mesTitle = $('#messageTitle').val();
$('.dialogMyMessagesBtn').click(dialogMyMessagesBtn); var mesText = $('#message').val();
$('#dialogSendButton').click(function dialogSendButton() if(mesTitle.length == 0)
EventInspector_ShowMsg('Вы не ввели тему сообщения', 'error');
else if(mesText.length == 0)
EventInspector_ShowMsg('Вы не ввели сообщение', 'error');
else
{ {
var mesTitle = $('#messageTitle').val(); var thisObj = $(this);
var mesText = $('#message').val(); $(this).attr("disabled", true);
if(mesTitle.length == 0)
EventInspector_ShowMsg('Вы не ввели тему сообщения', 'error'); $.ajax({
else if(mesText.length == 0) type: "POST",
EventInspector_ShowMsg('Вы не ввели сообщение', 'error'); url: URLdir + "handler/ErrMessages/createRequest",
else data: { title: mesTitle,
{ text: mesText
var thisObj = $(this); },
$(this).attr("disabled", true); success: function(data){
data = $.parseJSON(data);
$.ajax({ $('#messageTitle').val('');
type: "POST", $('#message').val('');
url: URLdir + "handler/ErrMessages/createRequest",
data: { title: mesTitle, if(data.success === true)
text: mesText EventInspector_ShowMsg('Сообщение успешно отправлено!', 'success');
}, else
success: function(data){ EventInspector_ShowMsg('Сообщение не отправлено', 'error');
data = $.parseJSON(data); thisObj.removeAttr('disabled');
$('#messageTitle').val(''); }
$('#message').val(''); });
}
if(data.success === true) });
EventInspector_ShowMsg('Сообщение успешно отправлено!', 'success');
else
EventInspector_ShowMsg('Сообщение не отправлено', 'error');
thisObj.removeAttr('disabled'); $('#errButton').click(function()
} {
}); $('#errDialog').dialog("open");
}
});
}); });
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment