mirror of
https://github.com/keymanapp/keyman.git
synced 2026-09-28 10:37:41 +00:00
1. Renamed form UfrmNGrokOptions to UfrmServerOptions 2. Renamed kmdev-server to just plain server 3. Tidied up npm versioning to use VERSION_WITH_TAG This last point should help avoid confusion as now only CI release builds will ever generate a package.json with a.b.c, a.b.c-alpha or a.b.c-beta. Local and test builds will always have the corresponding -test or -local environment appended. This also helps avoid issues if we accidentally publish an incorrect version.
20 lines
591 B
JavaScript
20 lines
591 B
JavaScript
/* Websocket listening for updated resource notifications */
|
|
|
|
WebSockHop.disable.mobile = false;
|
|
if(WebSockHop.isAvailable()) {
|
|
const ws = new WebSockHop((window.location.protocol == 'http:' ? 'ws://' : 'wss://')+window.location.host);
|
|
|
|
ws.formatter = new WebSockHop.StringFormatter();
|
|
ws.formatter.pingMessage = 'ping';
|
|
ws.formatter.handlePong = function (message) {
|
|
return message == 'pong';
|
|
};
|
|
|
|
ws.on('message', (message) => {
|
|
console.log('WebSocket: '+message);
|
|
if(message == 'refresh') {
|
|
checkKeyboardsAndModels(true);
|
|
checkPackages();
|
|
}
|
|
});
|
|
}
|