2017-05-18 20:08:54 +00:00
|
|
|
"use strict";
|
|
|
|
|
|
|
|
const $ = require("jquery");
|
|
|
|
const socket = require("../socket");
|
|
|
|
const render = require("../render");
|
|
|
|
const sidebar = $("#sidebar");
|
|
|
|
|
|
|
|
socket.on("network", function(data) {
|
2017-08-28 20:06:28 +00:00
|
|
|
render.renderNetworks(data, true);
|
2017-05-18 20:08:54 +00:00
|
|
|
|
|
|
|
sidebar.find(".chan")
|
|
|
|
.last()
|
|
|
|
.trigger("click");
|
|
|
|
|
|
|
|
$("#connect")
|
|
|
|
.find(".btn")
|
2017-09-12 12:52:16 +00:00
|
|
|
.prop("disabled", false);
|
2017-05-18 20:08:54 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
socket.on("network_changed", function(data) {
|
|
|
|
sidebar.find("#network-" + data.network).data("options", data.serverOptions);
|
|
|
|
});
|
2018-02-19 11:12:01 +00:00
|
|
|
|
|
|
|
socket.on("network:status", function(data) {
|
|
|
|
sidebar
|
|
|
|
.find("#network-" + data.network)
|
|
|
|
.toggleClass("not-connected", !data.connected)
|
|
|
|
.toggleClass("not-secure", !data.secure);
|
|
|
|
});
|