diff --git a/package-lock.json b/package-lock.json index f571dd4b3f..9edc113379 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3841,9 +3841,9 @@ "dev": true }, "compare-func": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/compare-func/-/compare-func-1.3.2.tgz", - "integrity": "sha1-md0LpFfh+bxyKxLAjsM+6rMfpkg=", + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/compare-func/-/compare-func-1.3.4.tgz", + "integrity": "sha512-sq2sWtrqKPkEXAC8tEJA1+BqAH9GbFkGBtUOqrUX57VSfwp8xyktctk+uLoRy5eccTdxzDcVIztlYDpKs3Jv1Q==", "dev": true, "requires": { "array-ify": "^1.0.0", @@ -8213,9 +8213,9 @@ "dev": true }, "uglify-js": { - "version": "3.9.2", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.9.2.tgz", - "integrity": "sha512-zGVwKslUAD/EeqOrD1nQaBmXIHl1Vw371we8cvS8I6mYK9rmgX5tv8AAeJdfsQ3Kk5mGax2SVV/AizxdNGhl7Q==", + "version": "3.9.4", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.9.4.tgz", + "integrity": "sha512-8RZBJq5smLOa7KslsNsVcSH+KOXf1uDU8yqLeNuVKwmT0T3FA0ZoXlinQfRad7SDcbZZRZE4ov+2v71EnxNyCA==", "dev": true, "optional": true, "requires": { @@ -11072,9 +11072,9 @@ } }, "moment": { - "version": "2.25.3", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.25.3.tgz", - "integrity": "sha512-PuYv0PHxZvzc15Sp8ybUCoQ+xpyPWvjOuK72a5ovzp2LI32rJXOiIfyoFoYvG3s6EwwrdkMyWuRiEHSZRLJNdg==", + "version": "2.26.0", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.26.0.tgz", + "integrity": "sha512-oIixUO+OamkUkwjhAVE18rAMfRJNsNe/Stid/gwHSOfHrOtw9EhAY2AHvdKZ/k/MggcYELFCJz/Sn2pL8b8JMw==", "dev": true }, "morphdom": { diff --git a/src/lib/remixd.js b/src/lib/remixd.js index db789fc994..d688fd52e9 100644 --- a/src/lib/remixd.js +++ b/src/lib/remixd.js @@ -1,145 +1,145 @@ -'use strict' -var EventManager = require('../lib/events') -var modalDialog = require('../app/ui/modaldialog') -var yo = require('yo-yo') +// 'use strict' +// var EventManager = require('../lib/events') +// var modalDialog = require('../app/ui/modaldialog') +// var yo = require('yo-yo') -class Remixd { - constructor (port) { - this.event = new EventManager() - this.port = port - this.callbacks = {} - this.callid = 0 - this.socket = null - this.connected = false - this.receiveResponse() - } +// class Remixd { +// constructor (port) { +// this.event = new EventManager() +// this.port = port +// this.callbacks = {} +// this.callid = 0 +// this.socket = null +// this.connected = false +// this.receiveResponse() +// } - online () { - return this.socket !== null - } +// online () { +// return this.socket !== null +// } - close () { - if (this.socket) { - this.socket.close() - this.socket = null - } - } +// close () { +// if (this.socket) { +// this.socket.close() +// this.socket = null +// } +// } - start (cb) { - if (this.socket) { - try { - this.socket.close() - } catch (e) {} - } - this.event.trigger('connecting', []) - this.socket = new WebSocket('ws://localhost:' + this.port, 'echo-protocol') // eslint-disable-line +// start (cb) { +// if (this.socket) { +// try { +// this.socket.close() +// } catch (e) {} +// } +// this.event.trigger('connecting', []) +// this.socket = new WebSocket('ws://localhost:' + this.port, 'echo-protocol') // eslint-disable-line - this.socket.addEventListener('open', (event) => { - this.connected = true - this.event.trigger('connected', [event]) - cb() - }) +// this.socket.addEventListener('open', (event) => { +// this.connected = true +// this.event.trigger('connected', [event]) +// cb() +// }) - this.socket.addEventListener('message', (event) => { - var data = JSON.parse(event.data) - if (data.type === 'reply') { - if (this.callbacks[data.id]) { - this.callbacks[data.id](data.error, data.result) - delete this.callbacks[data.id] - } - this.event.trigger('replied', [data]) - } else if (data.type === 'notification') { - this.event.trigger('notified', [data]) - } else if (data.type === 'system') { - if (data.error) { - this.event.trigger('system', [{ - error: data.error - }]) - } - } - }) +// this.socket.addEventListener('message', (event) => { +// var data = JSON.parse(event.data) +// if (data.type === 'reply') { +// if (this.callbacks[data.id]) { +// this.callbacks[data.id](data.error, data.result) +// delete this.callbacks[data.id] +// } +// this.event.trigger('replied', [data]) +// } else if (data.type === 'notification') { +// this.event.trigger('notified', [data]) +// } else if (data.type === 'system') { +// if (data.error) { +// this.event.trigger('system', [{ +// error: data.error +// }]) +// } +// } +// }) - this.socket.addEventListener('error', (event) => { - this.errored(event) - cb(event) - }) +// this.socket.addEventListener('error', (event) => { +// this.errored(event) +// cb(event) +// }) - this.socket.addEventListener('close', (event) => { - if (event.wasClean) { - this.connected = false - this.event.trigger('closed', [event]) - } else { - this.errored(event) - } - this.socket = null - }) - } +// this.socket.addEventListener('close', (event) => { +// if (event.wasClean) { +// this.connected = false +// this.event.trigger('closed', [event]) +// } else { +// this.errored(event) +// } +// this.socket = null +// }) +// } - async receiveResponse (requestId) { - return new Promise((resolve, reject) => { - this.event.register('replied', (data) => { - if (data.id === requestId) { - if (data.error) reject(data.error) - else resolve(data.result) - } - }) - }) - } +// async receiveResponse (requestId) { +// return new Promise((resolve, reject) => { +// this.event.register('replied', (data) => { +// if (data.id === requestId) { +// if (data.error) reject(data.error) +// else resolve(data.result) +// } +// }) +// }) +// } - errored (event) { - function remixdDialog () { - return yo`