A web-based drawing app
git clone git://soophie.de/outline
145
if(that.state.name.length >= 3 && that.state.name.length <= 20) {146
that.state.uuid = that.state.name + '-' + that.util.uuid();147
that.socket.connect();148
that.socket.cursor();148
that.modal.load();149
}150
}151
});
154
if(that.state.name.length >= 3 && that.state.name.length <= 20) {155
that.state.uuid = that.state.name + '-' + that.util.uuid();156
that.socket.connect();157
that.socket.cursor();157
that.modal.load();158
}159
});160
this.modal.get('scaling').action.open.before = function(modal) {
8
},9
connect: function() {10
let that = this;11
this.socket = io('https://server.typable.dev', {11
this.socket = io('https://192.168.2.3', {12
path: '/pipe',13
reconnection: false14
});
16
that.connected = true;17
that.timeout = false;18
that.request();19
that.cursor();20
});21
this.socket.on('disconnect', function() {22
that.connected = false;
24
that.app.modal.open('error');25
that.app.state.client = [];26
that.app.update();26
that._reconnectInterval();27
});28
this.socket.on('connect_error', function() {29
that.connected = false;
31
that.app.modal.open('error');32
that.app.state.client = [];33
that.app.update();34
that._reconnectInterval();34
});35
this.socket.on('load', function(data) {36
let buffer = new Uint8Array(data);
72
that.app.update();73
});74
},76
_reconnectInterval: function() {77
let that = this;78
this.interval = setInterval(function() {79
if(!that.timeout) {80
clearInterval(this.interval);81
}82
else {83
that.reconnect();84
}85
}, 30 * 1000);86
},75
reconnect: function() {76
this.socket.open();77
this.timeout = false;78
},79
_send: function(key, data) {80
if(this.socket) {