Changeset - 3c997bc6d380
[Not reviewed]
default
0 11 1
Drew Perttula - 7 years ago 2018-05-24 06:54:58
drewp@bigasterisk.com
fix some coffee lint
Ignore-this: 1a988be1598dda76dd2fefca3b499aa0
8 files changed with 163 insertions and 20 deletions:
0 comments (0 inline, 0 general)
coffeelint.json
Show inline comments
 
new file 100644
 
{
 
  "arrow_spacing": {
 
    "level": "ignore"
 
  },
 
  "braces_spacing": {
 
    "level": "ignore",
 
    "spaces": 0,
 
    "empty_object_spaces": 0
 
  },
 
  "camel_case_classes": {
 
    "level": "error"
 
  },
 
  "coffeescript_error": {
 
    "level": "error"
 
  },
 
  "colon_assignment_spacing": {
 
    "level": "ignore",
 
    "spacing": {
 
      "left": 0,
 
      "right": 0
 
    }
 
  },
 
  "cyclomatic_complexity": {
 
    "level": "ignore",
 
    "value": 10
 
  },
 
  "duplicate_key": {
 
    "level": "error"
 
  },
 
  "empty_constructor_needs_parens": {
 
    "level": "ignore"
 
  },
 
  "ensure_comprehensions": {
 
    "level": "warn"
 
  },
 
  "eol_last": {
 
    "level": "ignore"
 
  },
 
  "indentation": {
 
    "value": 2,
 
    "level": "error"
 
  },
 
  "line_endings": {
 
    "level": "ignore",
 
    "value": "unix"
 
  },
 
  "max_line_length": {
 
    "value": 80,
 
    "level": "error",
 
    "limitComments": true
 
  },
 
  "missing_fat_arrows": {
 
    "level": "ignore",
 
    "is_strict": false
 
  },
 
  "newlines_after_classes": {
 
    "value": 3,
 
    "level": "ignore"
 
  },
 
  "no_backticks": {
 
    "level": "warn"
 
  },
 
  "no_debugger": {
 
    "level": "warn",
 
    "console": false
 
  },
 
  "no_empty_functions": {
 
    "level": "ignore"
 
  },
 
  "no_empty_param_list": {
 
    "level": "ignore"
 
  },
 
  "no_implicit_braces": {
 
    "level": "ignore",
 
    "strict": true
 
  },
 
  "no_implicit_parens": {
 
    "level": "ignore",
 
    "strict": true
 
  },
 
  "no_interpolation_in_single_quotes": {
 
    "level": "ignore"
 
  },
 
  "no_nested_string_interpolation": {
 
    "level": "warn"
 
  },
 
  "no_plusplus": {
 
    "level": "ignore"
 
  },
 
  "no_private_function_fat_arrows": {
 
    "level": "warn"
 
  },
 
  "no_stand_alone_at": {
 
    "level": "ignore"
 
  },
 
  "no_tabs": {
 
    "level": "error"
 
  },
 
  "no_this": {
 
    "level": "ignore"
 
  },
 
  "no_throwing_strings": {
 
    "level": "error"
 
  },
 
  "no_trailing_semicolons": {
 
    "level": "error"
 
  },
 
  "no_trailing_whitespace": {
 
    "level": "error",
 
    "allowed_in_comments": false,
 
    "allowed_in_empty_lines": true
 
  },
 
  "no_unnecessary_double_quotes": {
 
    "level": "ignore"
 
  },
 
  "no_unnecessary_fat_arrows": {
 
    "level": "warn"
 
  },
 
  "non_empty_constructor_needs_parens": {
 
    "level": "ignore"
 
  },
 
  "prefer_english_operator": {
 
    "level": "ignore",
 
    "doubleNotLevel": "ignore"
 
  },
 
  "space_operators": {
 
    "level": "ignore"
 
  },
 
  "spacing_after_comma": {
 
    "level": "ignore"
 
  },
 
  "transform_messes_up_line_numbers": {
 
    "level": "warn"
 
  }
 
}
light9/web/graph.coffee
Show inline comments
 
@@ -25,13 +25,15 @@ class Handler
 
  constructor: (@func, @label) ->
 
    @patterns = [] # s,p,o,g quads that should trigger the next run
 
    @innerHandlers = [] # Handlers requested while this one was running
 
  
 
class AutoDependencies
 
  constructor: () ->
 
    @handlers = new Handler(null) # tree of all known Handlers (at least those with non-empty patterns). Top node is not a handler.
 
    # tree of all known Handlers (at least those with non-empty
 
    # patterns). Top node is not a handler.
 
    @handlers = new Handler(null)
 
    @handlerStack = [@handlers] # currently running
 
    
 
  runHandler: (func, label) ->
 
    # what if we have this func already? duplicate is safe?
 

	
 
    if not label?
 
@@ -148,13 +150,13 @@ class window.SyncedGraph
 
    if @graph?
 
      @_applyPatch({addQuads: [], delQuads: @graph.getQuads()})
 

	
 
    # if we had a Store already, this lets N3.Store free all its indices/etc
 
    @graph = N3.Store()
 
    @_addPrefixes(@prefixes)
 
    @cachedFloatValues = new Map();
 
    @cachedFloatValues = new Map()
 

	
 
  _clearGraphOnNewConnection: -> # must not send a patch to the server!
 
    log('graph: clearGraphOnNewConnection')
 
    @clearGraph()
 
    log('graph: clearGraphOnNewConnection done')
 
      
 
@@ -320,17 +322,19 @@ class window.SyncedGraph
 
        
 
      @_autoDeps.askedFor(current, null, null, null) # a little loose
 

	
 
      firsts = @graph.getQuads(current, RDF + 'first', null)
 
      rests = @graph.getQuads(current, RDF + 'rest', null)
 
      if firsts.length != 1
 
        throw new Error("list node #{current} has #{firsts.length} rdf:first edges")
 
        throw new Error(
 
          "list node #{current} has #{firsts.length} rdf:first edges")
 
      out.push(firsts[0].object)
 

	
 
      if rests.length != 1
 
        throw new Error("list node #{current} has #{rests.length} rdf:rest edges")
 
        throw new Error(
 
          "list node #{current} has #{rests.length} rdf:rest edges")
 
      current = rests[0].object
 
    
 
    return out
 

	
 
  contains: (s, p, o) ->
 
    @_autoDeps.askedFor(s, p, o, null)
light9/web/rdfdbclient.coffee
Show inline comments
 
@@ -49,13 +49,14 @@ parseJsonPatch = (jsonPatch, cb) ->
 
                    cb()
 

	
 
  async.parallel([parseAdds, parseDels], ((err) => cb(patch)))
 

	
 
class window.RdfDbClient
 
  # Send and receive patches from rdfdb
 
  constructor: (@patchSenderUrl, @clearGraphOnNewConnection, @applyPatch, @setStatus) ->
 
  constructor: (@patchSenderUrl, @clearGraphOnNewConnection, @applyPatch,
 
                @setStatus) ->
 
    @_patchesToSend = []
 
    @_lastPingMs = -1
 
    @_patchesReceived = 0
 
    @_patchesSent = 0
 

	
 
    @_reconnectionTimeout = null
light9/web/timeline/adjustable.coffee
Show inline comments
 
@@ -107,13 +107,14 @@ class window.AdjustableFloatObject exten
 
    #   getTargetPosForValue(value) -> getTarget result for value
 
    #   getValueForPos
 
    super()
 
    @ctor2()
 
    if not @config.ctx?
 
      throw new Error("missing ctx")
 
    @config.graph.runHandler(@_syncValue.bind(@), "adj sync #{@config.subj.value}")
 
    @config.graph.runHandler(@_syncValue.bind(@),
 
                             "adj sync #{@config.subj.value}")
 

	
 
  _syncValue: () ->
 
    @_currentValue = @config.graph.floatValue(@config.subj, @config.pred)
 
    @_onChange() if @_onChange
 
    
 
  _getValue: () ->
 
@@ -157,13 +158,13 @@ class window.AdjustableFade extends Adju
 
    mid.e(1)
 

	
 
   continueDrag: (pos) ->
 
    # pos is vec2 of pixels relative to the drag start
 
    super(pos)
 
    graph = @note.graph
 
    U = (x) => graph.Uri(x)
 
    U = (x) -> graph.Uri(x)
 

	
 
    goalCenterSec = @note.zoomInX.invert(@initialTarget.e(1) + pos.e(1))
 

	
 
    diamSec = @note.worldPts[@i1].e(1) - @note.worldPts[@i0].e(1)
 
    newSec0 = goalCenterSec - diamSec / 2
 
    newSec1 = goalCenterSec + diamSec / 2
light9/web/timeline/adjusters.coffee
Show inline comments
 
@@ -37,13 +37,14 @@ coffeeElementSetup(class AdjustersCanvas
 
        adj.startDrag()
 

	
 
  onMove: (ev) ->
 
    pos = $V([ev.x, ev.y])
 
    if @currentDrag
 
      @currentDrag.cur = pos
 
      @currentDrag.adj.continueDrag(@currentDrag.cur.subtract(@currentDrag.start))
 
      @currentDrag.adj.continueDrag(
 
        @currentDrag.cur.subtract(@currentDrag.start))
 

	
 
  onUp: (ev) ->
 
    return unless @currentDrag
 
    @currentDrag.adj.endDrag()
 
    @currentDrag = null
 
    
light9/web/timeline/drawing.coffee
Show inline comments
 
@@ -19,17 +19,17 @@ window.Drawing.line = (ctx, p1, p2) ->
 

	
 
# http://stackoverflow.com/a/4959890
 
window.Drawing.roundRect = (ctx, sx,sy,ex,ey,r) ->
 
    d2r = Math.PI/180
 
    r = ( ( ex - sx ) / 2 ) if ( ex - sx ) - ( 2 * r ) < 0 # ensure that the radius isn't too large for x
 
    r = ( ( ey - sy ) / 2 ) if ( ey - sy ) - ( 2 * r ) < 0 # ensure that the radius isn't too large for y
 
    ctx.beginPath();
 
    ctx.moveTo(sx+r,sy);
 
    ctx.lineTo(ex-r,sy);
 
    ctx.arc(ex-r,sy+r,r,d2r*270,d2r*360,false);
 
    ctx.lineTo(ex,ey-r);
 
    ctx.arc(ex-r,ey-r,r,d2r*0,d2r*90,false);
 
    ctx.lineTo(sx+r,ey);
 
    ctx.arc(sx+r,ey-r,r,d2r*90,d2r*180,false);
 
    ctx.lineTo(sx,sy+r);
 
    ctx.arc(sx+r,sy+r,r,d2r*180,d2r*270,false);
 
    ctx.closePath();
 
  ctx.beginPath()
 
  ctx.moveTo(sx+r,sy)
 
  ctx.lineTo(ex-r,sy)
 
  ctx.arc(ex-r,sy+r,r,d2r*270,d2r*360,false)
 
  ctx.lineTo(ex,ey-r)
 
  ctx.arc(ex-r,ey-r,r,d2r*0,d2r*90,false)
 
  ctx.lineTo(sx+r,ey)
 
  ctx.arc(sx+r,ey-r,r,d2r*90,d2r*180,false)
 
  ctx.lineTo(sx,sy+r)
 
  ctx.arc(sx+r,sy+r,r,d2r*180,d2r*270,false)
 
  ctx.closePath()
light9/web/timeline/timeline.coffee
Show inline comments
 
@@ -638,7 +638,7 @@ class Note
 

	
 
    return parseInt(tinycolor.fromRatio({h: hue / 360, s: sat / 100, l: .58}).toHex(), 16)
 

	
 
    #elem = @getOrCreateElem(uri+'/label', 'noteLabels', 'text', {style: "font-size:13px;line-height:125%;font-family:'Verana Sans';text-align:start;text-anchor:start;fill:#000000;"})
 
    #elem.setAttribute('x', curvePts[0].e(1)+20)
 
    #elem.setAttribute('y', curvePts[0].e(2)-10)
 
    #elem.innerHTML = effectLabel;
 
    #elem.innerHTML = effectLabel
package.json
Show inline comments
 
@@ -11,12 +11,13 @@
 
  "dependencies": {
 
    "@webcomponents/shadycss": "^1.1.3",
 
    "@webcomponents/webcomponentsjs": "^1.2.0",
 
    "bower": "^1.8.4",
 
    "browserify": "^16.2.0",
 
    "chai": "^3.5.0",
 
    "coffeelint": "^2.1.0",
 
    "coffeescript": "^2.3.0",
 
    "d3": "^5.1.0",
 
    "mocha": "^2.5.3",
 
    "n3": "^1.0.0-alpha",
 
    "pixi.js": "^4.7.3",
 
    "tinycolor2": "^1.4.1"
0 comments (0 inline, 0 general)