auto eslint and add commands for eslint

This commit is contained in:
Devin Howard 2017-01-10 18:11:19 -05:00
parent da94cd0c8b
commit 71bed1a919
9 changed files with 28 additions and 26 deletions

View file

@ -42,14 +42,14 @@ const Cable = {
if (t1.authorizeToShow(m) && t2.authorizeToShow(m) && s.authorizeToShow(m) && !DataModel.Synapses.get(event.synapse.id)) {
// refactor the heck outta this, its adding wicked wait time
var topic1, topic2, node1, node2, synapse, mapping, cancel, mapper
function waitThenRenderSynapse() {
if (synapse && mapping && mapper) {
topic1 = synapse.getTopic1()
node1 = topic1.get('node')
topic2 = synapse.getTopic2()
node2 = topic2.get('node')
Synapse.renderSynapse(mapping, synapse, node1, node2, false)
} else if (!cancel) {
setTimeout(waitThenRenderSynapse, 10)
@ -108,7 +108,7 @@ const Cable = {
if (edge.getData('mappings').length - 1 === 0) {
Control.hideEdge(edge)
}
var index = indexOf(edge.getData('synapses'), synapse)
edge.getData('mappings').splice(index, 1)
edge.getData('synapses').splice(index, 1)
@ -129,7 +129,7 @@ const Cable = {
if (t.authorizeToShow(m) && !DataModel.Topics.get(event.topic.id)) {
// refactor the heck outta this, its adding wicked wait time
var topic, mapping, mapper, cancel
function waitThenRenderTopic() {
if (topic && mapping && mapper) {
Topic.renderTopic(mapping, topic, false, false)
@ -137,7 +137,7 @@ const Cable = {
setTimeout(waitThenRenderTopic, 10)
}
}
mapper = DataModel.Mappers.get(event.topic.user_id)
if (mapper === undefined) {
Mapper.get(event.topic.user_id, function(m) {

View file

@ -291,18 +291,18 @@ const Create = {
},
source: synapseBloodhound
},
{
name: 'existing_synapses',
limit: 50,
display: function(s) { return s.label },
templates: {
suggestion: function(s) {
return Hogan.compile($('#synapseAutocompleteTemplate').html()).render(s)
},
header: '<h3>Existing synapses</h3>'
{
name: 'existing_synapses',
limit: 50,
display: function(s) { return s.label },
templates: {
suggestion: function(s) {
return Hogan.compile($('#synapseAutocompleteTemplate').html()).render(s)
},
source: existingSynapseBloodhound
}]
header: '<h3>Existing synapses</h3>'
},
source: existingSynapseBloodhound
}]
)
$('#synapse_desc').keyup(function(e) {

View file

@ -14,7 +14,7 @@ module.exports = {
SEND_COORDS: 'SEND_COORDS',
DRAG_TOPIC: 'DRAG_TOPIC',
/* EVENTS RECEIVABLE FROM NODE SERVER*/
/* EVENTS RECEIVABLE FROM NODE SERVER */
JUNTO_UPDATED: 'JUNTO_UPDATED',
INVITED_TO_CALL: 'INVITED_TO_CALL',
INVITED_TO_JOIN: 'INVITED_TO_JOIN',
@ -29,5 +29,5 @@ module.exports = {
NEW_MAPPER: 'NEW_MAPPER',
LOST_MAPPER: 'LOST_MAPPER',
TOPIC_DRAGGED: 'TOPIC_DRAGGED',
PEER_COORDS_UPDATED: 'PEER_COORDS_UPDATED',
PEER_COORDS_UPDATED: 'PEER_COORDS_UPDATED'
}

View file

@ -152,7 +152,7 @@ let Realtime = {
config: { DOUBLE_CLICK_TOLERANCE: 200 }
})
self.room.videoAdded(self.handleVideoAdded)
self.startActiveMap()
} // if Active.Mapper
},

View file

@ -210,7 +210,7 @@ export const callInProgress = self => () => {
GlobalUI.notifyUser(notifyText, true)
$('#toast button.yes').click(e => self.joinCall())
$('#toast button.no').click(e => GlobalUI.clearNotify())
ChatView.conversationInProgress()
ChatView.conversationInProgress()
}
export const callStarted = self => () => {

View file

@ -49,7 +49,7 @@ const ChatView = {
$('#' + ChatView.domId).hide()
},
render: () => {
if (!Active.Map) return
if (!Active.Map) return
const self = ChatView
self.mapChat = ReactDOM.render(React.createElement(MapChat, {
conversationLive: self.conversationLive,
@ -111,7 +111,7 @@ const ChatView = {
conversationInProgress: participating => {
ChatView.conversationLive = true
ChatView.isParticipating = participating
ChatView.render()
ChatView.render()
},
conversationEnded: () => {
ChatView.conversationLive = false
@ -144,7 +144,7 @@ const ChatView = {
},
addMessage: (message, isInitial, wasMe) => {
const self = ChatView
if (!isInitial) self.mapChat.newMessage()
if (!isInitial) self.mapChat.newMessage()
if (!wasMe && !isInitial && self.alertSound) self.sound.play('receivechat')
self.messages.add(message)
self.render()

View file

@ -9,7 +9,7 @@ import { JUNTO_UPDATED } from '../Realtime/events'
const Views = {
init: (serverData) => {
$(document).on(JUNTO_UPDATED, () => ExploreMaps.render())
ChatView.init([serverData['sounds/MM_sounds.mp3'],serverData['sounds/MM_sounds.ogg']])
ChatView.init([serverData['sounds/MM_sounds.mp3'], serverData['sounds/MM_sounds.ogg']])
},
ExploreMaps,
ChatView,

View file

@ -41,7 +41,7 @@ class Header extends Component {
linkClass={activeClass('active')}
data-router="true"
text="All Maps"
/>
/>
<MapLink show={signedIn && explore}
href="/explore/mine"
linkClass={activeClass('my')}

View file

@ -5,7 +5,9 @@
"scripts": {
"build": "webpack",
"build:watch": "webpack --watch",
"test": "mocha --compilers js:babel-core/register frontend/test"
"test": "mocha --compilers js:babel-core/register frontend/test",
"eslint": "eslint frontend",
"eslint:fix": "eslint --fix frontend"
},
"repository": {
"type": "git",