eslint stuff

This commit is contained in:
Devin Howard 2016-10-21 15:02:53 +08:00
parent 5471c2a350
commit 1d801f036f
11 changed files with 23 additions and 29 deletions

View file

@ -1,4 +1,5 @@
/* globals $ */ /* global $ */
/* /*
everthing in this file happens as a result of websocket events everthing in this file happens as a result of websocket events
*/ */
@ -17,7 +18,7 @@ import Visualize from '../Visualize'
export const juntoUpdated = self => state => { export const juntoUpdated = self => state => {
self.juntoState = state self.juntoState = state
$(document).trigger(JUNTO_UPDATED) $(document).trigger(JUNTO_UPDATED)
} }
export const synapseRemoved = self => data => { export const synapseRemoved = self => data => {

View file

@ -159,7 +159,7 @@ var Private = {
var date = (m.timestamp.getMonth() + 1) + '/' + m.timestamp.getDate() var date = (m.timestamp.getMonth() + 1) + '/' + m.timestamp.getDate()
date += ' ' + addZero(m.timestamp.getHours()) + ':' + addZero(m.timestamp.getMinutes()) date += ' ' + addZero(m.timestamp.getHours()) + ':' + addZero(m.timestamp.getMinutes())
m.timestamp = date m.timestamp = date
m.image = m.user_image m.image = m.user_image
m.message = linker.link(m.message) m.message = linker.link(m.message)
var $html = $(this.messageTemplate(m)) var $html = $(this.messageTemplate(m))
this.$messages.append($html) this.$messages.append($html)

View file

@ -3,7 +3,6 @@
import React from 'react' import React from 'react'
import ReactDOM from 'react-dom' // TODO ensure this isn't a double import import ReactDOM from 'react-dom' // TODO ensure this isn't a double import
import { JUNTO_UPDATED } from '../Realtime/events'
import Active from '../Active' import Active from '../Active'
import Realtime from '../Realtime' import Realtime from '../Realtime'
import Maps from '../../components/Maps' import Maps from '../../components/Maps'
@ -40,7 +39,7 @@ const ExploreMaps = {
currentUser: Active.Mapper, currentUser: Active.Mapper,
section: self.collection.id, section: self.collection.id,
maps: self.collection, maps: self.collection,
juntoState: Realtime.juntoState, juntoState: Realtime.juntoState,
moreToLoad: self.collection.page != 'loadedAll', moreToLoad: self.collection.page != 'loadedAll',
user: mapperObj, user: mapperObj,
loadMore: self.loadMore loadMore: self.loadMore

View file

@ -1,3 +1,5 @@
/* global $ */
import ExploreMaps from './ExploreMaps' import ExploreMaps from './ExploreMaps'
import ChatView from './ChatView' import ChatView from './ChatView'
import VideoView from './VideoView' import VideoView from './VideoView'

View file

@ -1,5 +1,4 @@
const {
import {
// server sendable, client receivable // server sendable, client receivable
TOPIC_UPDATED, TOPIC_UPDATED,
TOPIC_DELETED, TOPIC_DELETED,
@ -18,11 +17,9 @@ import {
UPDATE_SYNAPSE, UPDATE_SYNAPSE,
DELETE_SYNAPSE, DELETE_SYNAPSE,
UPDATE_MAP UPDATE_MAP
} from '../frontend/src/Metamaps/Realtime/events' } = require('../frontend/src/Metamaps/Realtime/events')
module.exports = function (io, store) { module.exports = function (io, store) {
store.subscribe(() => { store.subscribe(() => {
console.log(store.getState()) console.log(store.getState())
io.sockets.emit(JUNTO_UPDATED, store.getState()) io.sockets.emit(JUNTO_UPDATED, store.getState())
@ -32,7 +29,7 @@ module.exports = function (io, store) {
io.sockets.emit(JUNTO_UPDATED, store.getState()) io.sockets.emit(JUNTO_UPDATED, store.getState())
socket.on(JOIN_MAP, data => store.dispatch({ type: JOIN_MAP, payload: data})) socket.on(JOIN_MAP, data => store.dispatch({ type: JOIN_MAP, payload: data }))
socket.on(LEAVE_MAP, () => store.dispatch({ type: LEAVE_MAP, payload: socket })) socket.on(LEAVE_MAP, () => store.dispatch({ type: LEAVE_MAP, payload: socket }))
socket.on(JOIN_CALL, data => store.dispatch({ type: JOIN_CALL, payload: data })) socket.on(JOIN_CALL, data => store.dispatch({ type: JOIN_CALL, payload: data }))
socket.on(LEAVE_CALL, () => store.dispatch({ type: LEAVE_CALL, payload: socket })) socket.on(LEAVE_CALL, () => store.dispatch({ type: LEAVE_CALL, payload: socket }))

View file

@ -1,4 +1,4 @@
import { const {
INVITED_TO_CALL, INVITED_TO_CALL,
INVITED_TO_JOIN, INVITED_TO_JOIN,
CALL_ACCEPTED, CALL_ACCEPTED,
@ -17,7 +17,7 @@ import {
INVITE_A_CALL, INVITE_A_CALL,
JOIN_CALL, JOIN_CALL,
LEAVE_CALL LEAVE_CALL
} from '../frontend/src/Metamaps/Realtime/events' } = require('../frontend/src/Metamaps/Realtime/events')
const { mapRoom, userMapRoom } = require('./rooms') const { mapRoom, userMapRoom } = require('./rooms')
@ -65,4 +65,3 @@ module.exports = function (io, store) {
}) })
}) })
} }

View file

@ -1,5 +1,4 @@
const {
import {
MAPPER_LIST_UPDATED, MAPPER_LIST_UPDATED,
NEW_MAPPER, NEW_MAPPER,
LOST_MAPPER, LOST_MAPPER,
@ -21,7 +20,7 @@ import {
REMOVE_TOPIC, REMOVE_TOPIC,
CREATE_SYNAPSE, CREATE_SYNAPSE,
REMOVE_SYNAPSE REMOVE_SYNAPSE
} from '../frontend/src/Metamaps/Realtime/events' } = require('../frontend/src/Metamaps/Realtime/events')
const { mapRoom, userMapRoom } = require('./rooms') const { mapRoom, userMapRoom } = require('./rooms')

View file

@ -6,8 +6,8 @@ map = require('./map'),
global = require('./global'), global = require('./global'),
stunservers = [{"url": "stun:stun.l.google.com:19302"}] stunservers = [{"url": "stun:stun.l.google.com:19302"}]
import { createStore } from 'redux' const { createStore } = require('redux')
import { reducer } from './reducer' const { reducer } = require('./reducer')
let store = createStore(reducer) let store = createStore(reducer)
@ -15,5 +15,5 @@ global(io, store)
signalling(io, stunservers, store) signalling(io, stunservers, store)
junto(io, store) junto(io, store)
map(io, store) map(io, store)
io.listen(5001)
io.listen(5001)

View file

@ -1,18 +1,17 @@
const { omit, omitBy, isNil, mapValues } = require('lodash')
import { omit, omitBy, isNil, mapValues } from 'lodash' const {
import {
JOIN_MAP, JOIN_MAP,
LEAVE_MAP, LEAVE_MAP,
JOIN_CALL, JOIN_CALL,
LEAVE_CALL LEAVE_CALL
} from '../frontend/src/Metamaps/Realtime/events' } = require('../frontend/src/Metamaps/Realtime/events')
const NOT_IN_CONVERSATION = 0 const NOT_IN_CONVERSATION = 0
const IN_CONVERSATION = 1 const IN_CONVERSATION = 1
const addMapperToMap = (map, userId) => { return { ...map, [userId]: NOT_IN_CONVERSATION }} const addMapperToMap = (map, userId) => { return { ...map, [userId]: NOT_IN_CONVERSATION }}
export const reducer = (state = { connectedPeople: {}, liveMaps: {} }, action) => { module.exports = { reducer: (state = { connectedPeople: {}, liveMaps: {} }, action) => {
const { type, payload } = action const { type, payload } = action
const { connectedPeople, liveMaps } = state const { connectedPeople, liveMaps } = state
const map = payload && liveMaps[payload.mapid] const map = payload && liveMaps[payload.mapid]
@ -85,4 +84,4 @@ export const reducer = (state = { connectedPeople: {}, liveMaps: {} }, action) =
default: default:
return state return state
} }
} } }

View file

@ -1,4 +1,3 @@
module.exports = { module.exports = {
mapRoom: mapId => `maps/${mapId}`, mapRoom: mapId => `maps/${mapId}`,
userMapRoom: (mapperId, mapId) => `mappers/${mapperId}/maps/${mapId}`, userMapRoom: (mapperId, mapId) => `mappers/${mapperId}/maps/${mapId}`,

View file

@ -1,4 +1,4 @@
var uuid = require('node-uuid') const uuid = require('node-uuid')
// based off of https://github.com/andyet/signalmaster // based off of https://github.com/andyet/signalmaster
// since it was updated to socket.io 1.3.7 // since it was updated to socket.io 1.3.7
@ -12,7 +12,6 @@ function safeCb(cb) {
} }
module.exports = function(io, stunservers, state) { module.exports = function(io, stunservers, state) {
io.on('connection', function (socket) { io.on('connection', function (socket) {
socket.resources = { socket.resources = {
screen: false, screen: false,