Fixe le comportement du chat
This commit is contained in:
@ -46,11 +46,16 @@
|
|||||||
<script src="~/api/signalr/hubs"></script>
|
<script src="~/api/signalr/hubs"></script>
|
||||||
<!--SignalR script to update the chat page and send messages.-->
|
<!--SignalR script to update the chat page and send messages.-->
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
$(function () {
|
|
||||||
var pvuis;
|
var pvuis;
|
||||||
|
|
||||||
var audio = new Audio('/sounds/bell.mp3');
|
var audio = new Audio('/sounds/bell.mp3');
|
||||||
|
|
||||||
|
// This optional function html-encodes messages for display in the page.
|
||||||
|
function htmlEncode(value) {
|
||||||
|
var encodedValue = $('<div />').text(value).html();
|
||||||
|
return encodedValue;
|
||||||
|
}
|
||||||
|
|
||||||
var setPrivate = function (li) {
|
var setPrivate = function (li) {
|
||||||
console.log("here I am");
|
console.log("here I am");
|
||||||
$("#sendmessagebox").addClass("hidden");
|
$("#sendmessagebox").addClass("hidden");
|
||||||
@ -95,6 +100,7 @@
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$(document).ready(function(){
|
||||||
// Reference the auto-generated proxy for the hub.
|
// Reference the auto-generated proxy for the hub.
|
||||||
var chat = $.connection.chatHub;
|
var chat = $.connection.chatHub;
|
||||||
// Create a function that the hub can call back to display messages.
|
// Create a function that the hub can call back to display messages.
|
||||||
@ -216,15 +222,7 @@
|
|||||||
}, 3000); // Re-start connection after 3 seconds
|
}, 3000); // Re-start connection after 3 seconds
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$(window).unload(function () { chat.server.abort(); });
|
|
||||||
});
|
});
|
||||||
// This optional function html-encodes messages for display in the page.
|
|
||||||
|
|
||||||
function htmlEncode(value) {
|
|
||||||
var encodedValue = $('<div />').text(value).html();
|
|
||||||
return encodedValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user