diff --git a/frontend/src/Metamaps/Cable.js b/frontend/src/Metamaps/Cable.js index 15d01554..a5809df5 100644 --- a/frontend/src/Metamaps/Cable.js +++ b/frontend/src/Metamaps/Cable.js @@ -1,5 +1,7 @@ /* global $, ActionCable */ +import { indexOf } from 'lodash' + import Active from './Active' import Control from './Control' import DataModel from './DataModel' @@ -43,7 +45,7 @@ const Cable = { // refactor the heck outta this, its adding wicked wait time var topic1, topic2, node1, node2, synapse, mapping, cancel, mapper - function waitThenRenderSynapse() { + const waitThenRenderSynapse = () => { if (synapse && mapping && mapper) { topic1 = synapse.getTopic1() node1 = topic1.get('node') @@ -130,7 +132,7 @@ const Cable = { // refactor the heck outta this, its adding wicked wait time var topic, mapping, mapper, cancel - function waitThenRenderTopic() { + const waitThenRenderTopic = () => { if (topic && mapping && mapper) { Topic.renderTopic(mapping, topic, false, false) } else if (!cancel) { diff --git a/frontend/src/Metamaps/Control.js b/frontend/src/Metamaps/Control.js index b4dd67f2..4699a6d5 100644 --- a/frontend/src/Metamaps/Control.js +++ b/frontend/src/Metamaps/Control.js @@ -1,5 +1,3 @@ -/* global $ */ - import _ from 'lodash' import outdent from 'outdent' @@ -7,7 +5,6 @@ import Active from './Active' import DataModel from './DataModel' import Filter from './Filter' import GlobalUI from './GlobalUI' -import JIT from './JIT' import Mouse from './Mouse' import Selected from './Selected' import Settings from './Settings' @@ -98,7 +95,6 @@ const Control = { var permToDelete = Active.Mapper.id === topic.get('user_id') || Active.Mapper.get('admin') if (permToDelete) { - var mappableid = topic.id var mapping = node.getData('mapping') topic.destroy() DataModel.Mappings.remove(mapping) @@ -148,7 +144,6 @@ const Control = { } var topic = node.getData('topic') - var mappableid = topic.id var mapping = node.getData('mapping') mapping.destroy() DataModel.Topics.remove(topic) @@ -267,7 +262,6 @@ const Control = { if (edge.getData('synapses').length - 1 === 0) { Control.hideEdge(edge) } - var mappableid = synapse.id synapse.destroy() // the server will destroy the mapping, we just need to remove it here @@ -318,7 +312,6 @@ const Control = { var synapse = edge.getData('synapses')[index] var mapping = edge.getData('mappings')[index] - var mappableid = synapse.id mapping.destroy() DataModel.Synapses.remove(synapse) diff --git a/frontend/src/Metamaps/DataModel/Map.js b/frontend/src/Metamaps/DataModel/Map.js index 7777c223..76c5eff3 100644 --- a/frontend/src/Metamaps/DataModel/Map.js +++ b/frontend/src/Metamaps/DataModel/Map.js @@ -7,7 +7,6 @@ try { Backbone.$ = window.$ } catch (err) {} import Active from '../Active' import InfoBox from '../Map/InfoBox' import Mapper from '../Mapper' -import Realtime from '../Realtime' const Map = Backbone.Model.extend({ urlRoot: '/maps', diff --git a/frontend/src/Metamaps/DataModel/Synapse.js b/frontend/src/Metamaps/DataModel/Synapse.js index dd229c6f..e5cb0ae8 100644 --- a/frontend/src/Metamaps/DataModel/Synapse.js +++ b/frontend/src/Metamaps/DataModel/Synapse.js @@ -1,5 +1,3 @@ -/* global $ */ - import _ from 'lodash' import outdent from 'outdent' import Backbone from 'backbone' @@ -7,8 +5,6 @@ try { Backbone.$ = window.$ } catch (err) {} import Active from '../Active' import Filter from '../Filter' -import JIT from '../JIT' -import Realtime from '../Realtime' import SynapseCard from '../SynapseCard' import Visualize from '../Visualize' diff --git a/frontend/src/Metamaps/DataModel/Topic.js b/frontend/src/Metamaps/DataModel/Topic.js index f9c07678..a9e53b5d 100644 --- a/frontend/src/Metamaps/DataModel/Topic.js +++ b/frontend/src/Metamaps/DataModel/Topic.js @@ -1,13 +1,9 @@ -/* global $ */ - import _ from 'lodash' import Backbone from 'backbone' try { Backbone.$ = window.$ } catch (err) {} import Active from '../Active' import Filter from '../Filter' -import JIT from '../JIT' -import Realtime from '../Realtime' import TopicCard from '../TopicCard' import Visualize from '../Visualize' diff --git a/frontend/src/Metamaps/PasteInput.js b/frontend/src/Metamaps/PasteInput.js index 6227b23b..b72ae545 100644 --- a/frontend/src/Metamaps/PasteInput.js +++ b/frontend/src/Metamaps/PasteInput.js @@ -6,6 +6,7 @@ import Visualize from './Visualize' const PasteInput = { // thanks to https://github.com/kevva/url-regex + // eslint-disable-next-line no-useless-escape URL_REGEX: new RegExp('^(?:(?:(?:[a-z]+:)?//)|www\.)(?:\S+(?::\S*)?@)?(?:localhost|(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])(?:\.(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])){3}|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,}))\.?)(?::\d{2,5})?(?:[/?#][^\s"]*)?$'), init: function() { diff --git a/frontend/src/Metamaps/Realtime/index.js b/frontend/src/Metamaps/Realtime/index.js index a52532c5..b73cf52c 100644 --- a/frontend/src/Metamaps/Realtime/index.js +++ b/frontend/src/Metamaps/Realtime/index.js @@ -8,8 +8,7 @@ import Cable from '../Cable' import DataModel from '../DataModel' import JIT from '../JIT' import Util from '../Util' -import Views from '../Views' -import { ChatView } from '../Views' +import Views, { ChatView } from '../Views' import Visualize from '../Visualize' import { diff --git a/frontend/src/Metamaps/Realtime/receivable.js b/frontend/src/Metamaps/Realtime/receivable.js index cabc21d5..dd37fd99 100644 --- a/frontend/src/Metamaps/Realtime/receivable.js +++ b/frontend/src/Metamaps/Realtime/receivable.js @@ -4,18 +4,12 @@ everthing in this file happens as a result of websocket events */ -import { indexOf } from 'lodash' - import { JUNTO_UPDATED } from './events' import Active from '../Active' import { ChatView } from '../Views' import DataModel from '../DataModel' import GlobalUI from '../GlobalUI' -import Control from '../Control' -import Mapper from '../Mapper' -import Topic from '../Topic' -import Synapse from '../Synapse' import Util from '../Util' import Visualize from '../Visualize' diff --git a/frontend/src/Metamaps/Synapse.js b/frontend/src/Metamaps/Synapse.js index f4091659..48791637 100644 --- a/frontend/src/Metamaps/Synapse.js +++ b/frontend/src/Metamaps/Synapse.js @@ -4,7 +4,6 @@ import Active from './Active' import Control from './Control' import Create from './Create' import DataModel from './DataModel' -import JIT from './JIT' import Map from './Map' import Selected from './Selected' import Settings from './Settings' diff --git a/frontend/src/Metamaps/Views/Room.js b/frontend/src/Metamaps/Views/Room.js index 3dc43708..f7ffbb8f 100644 --- a/frontend/src/Metamaps/Views/Room.js +++ b/frontend/src/Metamaps/Views/Room.js @@ -1,13 +1,7 @@ /* global $ */ -import Backbone from 'backbone' import attachMediaStream from 'attachmediastream' -// TODO is this line good or bad -// Backbone.$ = window.$ - -import Active from '../Active' -import DataModel from '../DataModel' import Realtime from '../Realtime' import VideoView from './VideoView' diff --git a/frontend/src/components/MapChat/Message.js b/frontend/src/components/MapChat/Message.js index ae3507ce..7cfe9ff2 100644 --- a/frontend/src/components/MapChat/Message.js +++ b/frontend/src/components/MapChat/Message.js @@ -11,25 +11,25 @@ function addZero(i) { return i } -function formatDate(created_at) { - let date = new Date(created_at) +function formatDate(createdAt) { + let date = new Date(createdAt) let formatted = (date.getMonth() + 1) + '/' + date.getDate() formatted += ' ' + addZero(date.getHours()) + ':' + addZero(date.getMinutes()) return formatted } const Message = props => { - const { user_image, user_name, message, created_at, heading } = props + const { user_image: userImage, user_name: userName, message, created_at: createdAt, heading } = props const messageHtml = {__html: linker.link(Util.addEmoji(message, { emoticons: false }))} return (
- {heading && } + {heading && }
{heading &&
- {user_name}  - {formatDate(created_at)} + {userName}  + {formatDate(createdAt)}
}
diff --git a/frontend/src/components/MapChat/Participant.js b/frontend/src/components/MapChat/Participant.js index 340c92a4..0fede6aa 100644 --- a/frontend/src/components/MapChat/Participant.js +++ b/frontend/src/components/MapChat/Participant.js @@ -2,28 +2,28 @@ import React, { PropTypes, Component } from 'react' class Participant extends Component { render() { - const { conversationLive, mapperIsLive, isParticipating, isPending, id, self, image, username, selfName, color } = this.props + const { conversationLive, mapperIsLive, isParticipating, isPending, id, self, image, username, color } = this.props return ( -
-
- -
-
- {username} {self ? '(me)' : ''} -
- {!self && !conversationLive &&
+
+
+ +
+
+ {username} {self ? '(me)' : ''} +
+ {!self && !conversationLive &&
) } }