Skip to content

Commit cfb4b09

Browse files
committed
Compliance with Javascript Standard Style
1 parent 530be11 commit cfb4b09

File tree

5 files changed

+14
-12
lines changed

5 files changed

+14
-12
lines changed

client/commands.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -128,33 +128,33 @@ function commands (world) {
128128
const records = []
129129
const decoder = new TextDecoder()
130130

131-
let currentIndex = 0;
131+
let currentIndex = 0
132132
while (currentIndex < byteArray.length) {
133133
// Read the header
134134
// First byte contains record type. 1 is STDOUT, 2 is STDERR
135-
const type = byteArray[currentIndex];
135+
const type = byteArray[currentIndex]
136136
// Fifth through eightth bytes contain big-ending integer
137137
// which is the length of the message
138138
const recordLength = (byteArray[currentIndex + 4] << 24) |
139139
(byteArray[currentIndex + 5] << 16) |
140140
(byteArray[currentIndex + 6] << 8) |
141-
byteArray[currentIndex + 7];
141+
byteArray[currentIndex + 7]
142142

143143
if (recordLength > 0) {
144144
// Extract the message
145-
const messageBytes = byteArray.slice(currentIndex + 8, currentIndex + 8 + recordLength);
145+
const messageBytes = byteArray.slice(currentIndex + 8, currentIndex + 8 + recordLength)
146146

147147
const message = decoder.decode(messageBytes)
148148
const newelement = document.createElement('div')
149149
newelement.setAttribute('data-type', type)
150150
newelement.classList.add('logmessage')
151151
newelement.innerText = message
152152
const record = newelement.outerHTML
153-
records.push(record);
153+
records.push(record)
154154
}
155155

156156
// Move to the next record
157-
currentIndex += 8 + recordLength;
157+
currentIndex += 8 + recordLength
158158
}
159159

160160
return records.join('')
@@ -307,7 +307,7 @@ function commands (world) {
307307
function verifynameavailable (name) {
308308
let result = true
309309
if (world.containers.getContainer(name)) {
310-
dialog.postMessage({ message: 'containerexists', data: { name: name } })
310+
dialog.postMessage({ message: 'containerexists', data: { name } })
311311
result = false
312312
}
313313
return result

client/containercollection.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ const Container = function (world, name, dockerdata, startXposition) {
7373
mesh.position.set(containerstartpos[0], CONTAINERORIGIN[1] + CHEIGHT + 0.15, containerendpos[2])
7474

7575
containertitle = game.addItem({
76-
mesh: mesh,
76+
mesh,
7777
size: 3,
7878
height: 1,
7979
blockscreation: true /*, velocity : { x : 0, y : 0, z : 0 } */

client/dialog.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ const ModalDialog = require('voxel-modal-dialog')
66
* @constructor
77
* @param {world} world - The voxel-dockerclient world object
88
*/
9-
function dialog (world) {
9+
function Dialog (world) {
1010
if (!this) {
11-
return new dialog(world)
11+
return new Dialog(world)
1212
}
1313
const self = this
1414
const opts = {}
@@ -141,4 +141,4 @@ function dialog (world) {
141141
this.postMessage = postMessage
142142
}
143143

144-
module.exports = dialog
144+
module.exports = Dialog

client/world.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ const world = function (opts) {
6565
window._typeface_js = { faces: game.THREE.FontUtils.faces, loadFace: game.THREE.FontUtils.loadFace }
6666

6767
// Add plugins
68-
const plugins = require('voxel-plugins')(game, { require: require })
68+
const plugins = require('voxel-plugins')(game, { require })
6969
plugins.add('voxel-keys', {})
7070
plugins.add('voxel-console', {})
7171

public/js/terminaldialog.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* global WebSocket, Terminal, FitAddon */
2+
13
(function terminaldialog () {
24
let sourceWindow
35
let eventOrigin

0 commit comments

Comments
 (0)