Webclient overhaul (#2735)

Migrate from protobuf.js 5.x to 6.x (remove long.js and bytebuffer.js)
Upgrade jQuery from 1.x to 3.x
Upgrade jQueryUI to 1.12.x
Use minimized version of js libraries
Disable debug messages
Fix default value for Event_RoomSay’s RoomMessageType field
This commit is contained in:
ctrlaltca 2017-05-29 14:12:36 +02:00 committed by GitHub
parent 87060dc5c7
commit f75caa7245
32 changed files with 73 additions and 38313 deletions

View file

@ -3,7 +3,7 @@
<head>
<title>Cockatrice web client</title>
<link rel="shortcut icon" href="imgs/cockatrice.png" />
<link rel="stylesheet" href="js/jquery-ui-1.11.4.css">
<link rel="stylesheet" href="js/jquery-ui-1.12.1.min.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
@ -75,11 +75,9 @@ Loading cockatrice web client...
</div>
<script src="js/jquery-1.11.3.js"></script>
<script src="js/jquery-ui-1.11.4.js"></script>
<script src="js/long.js"></script>
<script src="js/bytebuffer.js"></script>
<script src="js/protobuf.js"></script>
<script src="js/jquery-3.2.1.min.js"></script>
<script src="js/jquery-ui-1.12.1.min.js"></script>
<script src="js/protobuf-6.7.0.min.js"></script>
<script src="webclient.js"></script>
<script>
@ -216,7 +214,7 @@ Loading cockatrice web client...
}
var options = {
"debug": true,
"debug": false,
"autojoinrooms" : true,
"host": host,
"port": port,
@ -284,7 +282,7 @@ Loading cockatrice web client...
switch(key)
{
case 'avatarBmp':
$('#userinfo').prepend("<img id='avatar' src='data:image/JPEG;base64," + value.toBase64() + "' /><br/>");
$('#userinfo').prepend("<img id='avatar' src='data:image/JPEG;base64," + btoa(String.fromCharCode.apply(null, value)) + "' /><br/>");
break;
case 'accountageSecs':
$('#userinfo').append('Registered since: ' + timeAgoToInterval(value) + '<br/>');