simple eslint fixes

This commit is contained in:
Devin Howard 2016-09-26 13:37:42 +08:00
parent 0e17ec11ec
commit ebaae084ae
7 changed files with 24 additions and 22 deletions

View file

@ -1,4 +1,4 @@
/* global Metamaps, $ */ /* global Metamaps, $, Hogan, Bloodhound */
import Mouse from './Mouse' import Mouse from './Mouse'
import Selected from './Selected' import Selected from './Selected'
@ -54,7 +54,7 @@ const Create = {
}, },
updateMetacodeSet: function (set, index, custom) { updateMetacodeSet: function (set, index, custom) {
if (custom && Create.newSelectedMetacodes.length == 0) { if (custom && Create.newSelectedMetacodes.length == 0) {
alert('Please select at least one metacode to use!') window.alert('Please select at least one metacode to use!')
return false return false
} }

View file

@ -1,3 +1,4 @@
/* global Metamaps, $, Hogan, Bloodhound */
import Active from './Active' import Active from './Active'
import Create from './Create' import Create from './Create'
import Filter from './Filter' import Filter from './Filter'
@ -585,7 +586,6 @@ GlobalUI.Search = {
if (["topic", "map", "mapper"].indexOf(datum.rtype) !== -1) { if (["topic", "map", "mapper"].indexOf(datum.rtype) !== -1) {
self.close(0, true); self.close(0, true);
var win;
if (datum.rtype == "topic") { if (datum.rtype == "topic") {
Router.topics(datum.id); Router.topics(datum.id);
} else if (datum.rtype == "map") { } else if (datum.rtype == "map") {

View file

@ -1,4 +1,4 @@
/* global Metamaps, $jit */ /* global Metamaps, $, Image, CanvasLoader */
import _ from 'lodash' import _ from 'lodash'
@ -79,7 +79,6 @@ const JIT = {
var jitReady = [] var jitReady = []
var synapsesToRemove = [] var synapsesToRemove = []
var topic
var mapping var mapping
var node var node
var nodes = {} var nodes = {}
@ -183,8 +182,6 @@ const JIT = {
if (!synapse) return // this means there are no corresponding synapses for if (!synapse) return // this means there are no corresponding synapses for
// this edge, don't render it // this edge, don't render it
var directionCat = synapse.get('category')
// label placement on edges // label placement on edges
if (canvas.denySelected) { if (canvas.denySelected) {
var color = Settings.colors.synapses.normal var color = Settings.colors.synapses.normal
@ -282,8 +279,8 @@ const JIT = {
if (synapseNum > 1) { if (synapseNum > 1) {
var ctx = canvas.getCtx() var ctx = canvas.getCtx()
var x = (pos.x + posChild.x) / 2 const x = (pos.x + posChild.x) / 2
var y = (pos.y + posChild.y) / 2 const y = (pos.y + posChild.y) / 2
drawSynapseCount(ctx, x, y, synapseNum) drawSynapseCount(ctx, x, y, synapseNum)
} }
} }
@ -847,8 +844,8 @@ const JIT = {
// set the draw synapse start positions // set the draw synapse start positions
var l = Selected.Nodes.length var l = Selected.Nodes.length
if (l > 0) { if (l > 0) {
for (var i = l - 1; i >= 0; i -= 1) { for (let i = l - 1; i >= 0; i -= 1) {
var n = Selected.Nodes[i] const n = Selected.Nodes[i]
Mouse.synapseStartCoordinates.push({ Mouse.synapseStartCoordinates.push({
x: n.pos.getc().x, x: n.pos.getc().x,
y: n.pos.getc().y y: n.pos.getc().y
@ -1541,8 +1538,6 @@ const JIT = {
if (adj.getData('alpha') === 0) return; // don't do anything if the edge is filtered if (adj.getData('alpha') === 0) return; // don't do anything if the edge is filtered
var authorized
e.preventDefault() e.preventDefault()
e.stopPropagation() e.stopPropagation()
@ -1827,10 +1822,11 @@ const JIT = {
width = canvas.getSize().width, width = canvas.getSize().width,
maxX, minX, maxY, minY, counter = 0 maxX, minX, maxY, minY, counter = 0
let nodes
if (!denySelected && Selected.Nodes.length > 0) { if (!denySelected && Selected.Nodes.length > 0) {
var nodes = Selected.Nodes nodes = Selected.Nodes
} else { } else {
var nodes = _.values(Visualize.mGraph.graph.nodes) nodes = _.values(Visualize.mGraph.graph.nodes)
} }
if (nodes.length > 1) { if (nodes.length > 1) {

View file

@ -1,4 +1,4 @@
/* global Metamaps, $ */ /* global Metamaps, $, Hogan, Bloodhound, Countable */
import Active from '../Active' import Active from '../Active'
import GlobalUI from '../GlobalUI' import GlobalUI from '../GlobalUI'
@ -349,7 +349,7 @@ const InfoBox = {
var confirmString = 'Are you sure you want to delete this map? ' var confirmString = 'Are you sure you want to delete this map? '
confirmString += 'This action is irreversible. It will not delete the topics and synapses on the map.' confirmString += 'This action is irreversible. It will not delete the topics and synapses on the map.'
var doIt = confirm(confirmString) var doIt = window.confirm(confirmString)
var map = Active.Map var map = Active.Map
var mapper = Active.Mapper var mapper = Active.Mapper
var authorized = map.authorizePermissionChange(mapper) var authorized = map.authorizePermissionChange(mapper)

View file

@ -1,4 +1,4 @@
/* global Metamaps, $ */ /* global Metamaps, $, SocketIoConnection, SimpleWebRTC */
import _ from 'lodash' import _ from 'lodash'
@ -1106,7 +1106,7 @@ const Realtime = {
} }
}, },
newSynapse: function (data) { newSynapse: function (data) {
var topic1, topic2, node1, node2, synapse, mapping, cancel var topic1, topic2, node1, node2, synapse, mapping, cancel, mapper
var self = Realtime var self = Realtime
var socket = self.socket var socket = self.socket

View file

@ -1,7 +1,13 @@
/* global $ */ /* global Metamaps, $, Howl */
/*
* Dependencies:
* Metamaps.Erb
*/
import Backbone from 'backbone' import Backbone from 'backbone'
import Autolinker from 'autolinker' import Autolinker from 'autolinker'
import _ from 'lodash'
// TODO is this line good or bad // TODO is this line good or bad
// Backbone.$ = window.$ // Backbone.$ = window.$

View file

@ -1,4 +1,4 @@
/* global $ */ /* global Metamaps */
import Account from './Account' import Account from './Account'
import Active from './Active' import Active from './Active'