|
|
@ -66,7 +66,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
function addULI(uname, cxids)
|
|
|
|
function addULI(uname, cxids)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$('<li class="user"><img src="/Avatars/' + uname + '.xs.png"> ' + uname + '</li>')
|
|
|
|
$('<li class="user"><button><img src="/Avatars/' + uname + '.xs.png"> ' + uname + '</button></li>')
|
|
|
|
.data("name", uname)
|
|
|
|
.data("name", uname)
|
|
|
|
.data("cxids", cxids)
|
|
|
|
.data("cxids", cxids)
|
|
|
|
.css('cursor', 'pointer')
|
|
|
|
.css('cursor', 'pointer')
|
|
|
@ -94,13 +94,13 @@
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
function onCx() {
|
|
|
|
function onCx() {
|
|
|
|
setTimeout(function () {
|
|
|
|
setTimeout(function () {
|
|
|
|
getUsers();
|
|
|
|
getUsers();
|
|
|
|
},120),
|
|
|
|
},120),
|
|
|
|
$('#targets').removeClass('disabled')
|
|
|
|
$('#targets').removeClass('disabled')
|
|
|
|
};
|
|
|
|
};
|
|
|
|
function onDisCx () {
|
|
|
|
function onDisCx () {
|
|
|
|
$('#targets').addClass('disabled')
|
|
|
|
$('#targets').addClass('disabled');
|
|
|
|
};
|
|
|
|
};
|
|
|
|
// This optional function html-encodes messages for display in the page.
|
|
|
|
// This optional function html-encodes messages for display in the page.
|
|
|
|
function htmlEncode(value) {
|
|
|
|
function htmlEncode(value) {
|
|
|
@ -186,14 +186,13 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var sendMessage = function () {
|
|
|
|
var sendMessage = function () {
|
|
|
|
chat.server.send($('#displayname').val(), $('#message').val());
|
|
|
|
chat.server.send($('#displayname').val(), $('#message').val());
|
|
|
|
// Clear text box and reset focus for next comment.
|
|
|
|
// Clear text box and reset focus for next comment.
|
|
|
|
$('#message').val('')
|
|
|
|
$('#message').val('')
|
|
|
|
};
|
|
|
|
};
|
|
|
|
var sendPV = function () {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var sendPV = function () {
|
|
|
|
var msg = $('#pv').val();
|
|
|
|
var msg = $('#pv').val();
|
|
|
|
// Call the Send method on the hub.
|
|
|
|
// Call the Send method on the hub.
|
|
|
|
$.each(pvuis.CXs, function () {
|
|
|
|
$.each(pvuis.CXs, function () {
|
|
|
@ -205,11 +204,9 @@
|
|
|
|
$('#pv').val('');
|
|
|
|
$('#pv').val('');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Start the connection.
|
|
|
|
// Start the connection.
|
|
|
|
$.connection.hub.start().done(function () {
|
|
|
|
$.connection.hub.start().done(function () {
|
|
|
|
onCx();
|
|
|
|
onCx();
|
|
|
|
|
|
|
|
|
|
|
|
$('#sendmessage').click(function () {
|
|
|
|
$('#sendmessage').click(function () {
|
|
|
|
// Call the Send method on the hub.
|
|
|
|
// Call the Send method on the hub.
|
|
|
|
sendMessage();
|
|
|
|
sendMessage();
|
|
|
@ -230,7 +227,6 @@
|
|
|
|
sendPV();
|
|
|
|
sendPV();
|
|
|
|
$("#sendpv").focus()
|
|
|
|
$("#sendpv").focus()
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
$.connection.hub.disconnected(function () {
|
|
|
|
$.connection.hub.disconnected(function () {
|
|
|
|