make watch task rebuild testConf files

make watch task rebuild testConf files

--- Gruntfile.coffee
+++ Gruntfile.coffee
@@ -24,7 +24,7 @@
     watch:
       coffee:
         files: ["app/scripts/{,*/,*/*/}*.{coffee,litcoffee,coffee.md}"]
-        tasks: ["copy:coffee", "coffee:dist"]
+        tasks: ["copy:coffee", "coffee:dist", "coffee:dev"]

       coffeeTest:
         files: ["test/spec/{,*/}*.{coffee,litcoffee,coffee.md}"]


ups, fast compilation should be false

ups, fast compilation should be false

--- Gruntfile.coffee
+++ Gruntfile.coffee
@@ -92,7 +92,7 @@
         compilerPath: 'bower_components/closure-compiler/compiler.jar'
         root: clientDirs
         # needs Java 1.7+, see http://goo.gl/iS3o6
-        fastCompilation: true
+        fastCompilation: false
         depsPath: clientDepsPath
         compilerFlags: if grunt.option('stage') == 'debug' then [
           '--output_wrapper="(function(){%output%})();"'


removed bad sass load-path

removed bad sass load-path

--- Gruntfile.coffee
+++ Gruntfile.coffee
@@ -20,7 +20,6 @@
     sass:
       options:
         loadPath: [
-          "bower_components"
           APP_DIR + "/styles/partials"
           ]
         style: "compressed"


Fix glob patterns in watch tasks.

Fix glob patterns in watch tasks.

--- Gruntfile.coffee
+++ Gruntfile.coffee
@@ -29,7 +29,7 @@

     # Automated recompilation and testing when developing
     watch:
-      files: ['spec/*.coffee', 'grammar/*.peg', 'lib/compiler.js']
+      files: ['spec/**/*.coffee', 'src/**/*.{coffee,peg}']
       tasks: ['test']

     # BDD tests on Node.js


update gruntfile

update gruntfile

--- Gruntfile.coffee
+++ Gruntfile.coffee
@@ -20,11 +20,13 @@
           'src/export.js'
           'src/hammer.suffix']
         dest: 'hammer.js'
-      test:
+
+      test: # special test build that exposes everything so it's testable
         src: [
           'src/hammer.js'
           'src/*.js'
-          'src/**/*.js']
+          'src/**/*.js'
+          'src/export.js']
         dest: 'tests/build.js'

     uglify:
@@ -50,10 +52,10 @@
       options:
         jshintrc: true
       build:
-        src: ['hammer.js', 'plugins/*.js']
+        src: ['hammer.js']

     jscs:
-      src: ['src/**/*.js', 'plugins/**/*.js']
+      src: ['src/**/*.js']
       options:
         force: true


Added livereload to grunt

Added livereload to grunt

--- Gruntfile.coffee
+++ Gruntfile.coffee
@@ -134,6 +134,7 @@
 				options:
 					spawn: false
 					interrupt: true
+					livereload: true

 			scss:
 				files: [
@@ -144,6 +145,7 @@
 				options:
 					spawn: false
 					interrupt: true
+					livereload: true

 			leafs:
 				files: 'leafs/*/*'
@@ -151,6 +153,7 @@
 				options:
 					spawn: false
 					interrupt: true
+					livereload: true

 			tracking:
 				files: 'tracking/*'
@@ -158,6 +161,7 @@
 				options:
 					spawn: false
 					interrupt: true
+					livereload: true

 		concurrent:
 			main: ['js', 'css', 'leafs', 'tracking']


'v0.1.9'

--- Gruntfile.coffee
+++ Gruntfile.coffee
@@ -65,10 +65,11 @@
   grunt.registerTask 'test', 'Runs Jasmine tests', ->
     exec = require('child_process').exec
     done = this.async()
-    child = exec 'bash node_modules/.bin/jasmine-node --verbose lib',(error, stdout, stderr) ->
-      console.log(stdout)
-      console.log('Error running tests: ' + error) if error?
-      done(!error?)
+    child = exec 'bash node_modules/.bin/mocha -R spec --compilers coffee:coffee-script/register test',
+        (error, stdout, stderr) ->
+          console.log(stdout)
+          console.log('Error running tests: ' + error) if error?
+          done(!error?)

   # Task to tag a version in git
   grunt.registerTask 'git-tag', 'Tags a release in git', ->


chore(grunt): Updated grunt tasks to compile jquery ui and update version number Changed embedtemplate task name to replace

--- Gruntfile.coffee
+++ Gruntfile.coffee
@@ -9,9 +9,7 @@
 finalBuildPath = "lib/"
 componentFile  = "bower.json"

-appFiles = [
-  "tmp/app/main.js"
-  # jQuery UI js
+jqueryui = [
   "vendor/bower/jquery.ui/ui/jquery.ui.core.js"
   "vendor/bower/jquery.ui/ui/jquery.ui.widget.js"
   "vendor/bower/jquery.ui/ui/jquery.ui.mouse.js"
@@ -19,6 +17,10 @@
   "vendor/bower/jquery.ui/ui/jquery.ui.datepicker.js"
   "vendor/bower/jquery.ui/ui/jquery.ui.resizable.js"
   "vendor/bower/jquery.ui/ui/jquery.ui.sortable.js"
+]
+appFiles = [
+  "tmp/app/main.js"
+  "tmp/jqueryui.js"
   "vendor/bower/underscore.string/lib/underscore.string.js"
   "vendor/bower/jquery-file-upload/js/jquery.fileupload.js"
   "tmp/app/**/*.js"
@@ -36,7 +38,8 @@
     grunt.util.spawn options, done

   grunt.initConfig
-    pkg: grunt.file.readJSON "package.json"
+    pkg:      grunt.file.readJSON "package.json"
+    jqueryUI: grunt.file.readJSON "vendor/bower/jquery.ui/package.json"

     #
     # Coffeescript section
@@ -54,12 +57,18 @@

     #
     # Concat section
-    # vendorJs  - compile all the vendor codes from bower
-    # appJs     - concat all the application code into MacGyver.js
-    # vendorCss - compile all vendor css from bower
-    # appCss    - concat application css into MacGyver.css
+    # jqueryui    - compile required jquery ui files
+    # vendorJs    - compile all the vendor codes from bower
+    # appJs       - concat all the application code into MacGyver.js
+    # deployAppJs - concat all app code for deployment
+    # vendorCss   - compile all vendor css from bower
+    # appCss      - concat application css into MacGyver.css
     #
     concat:
+      jqueryui:
+        dest: "tmp/jqueryui.js"
+        src:  jqueryui
+
       vendorJs:
         dest: "example/js/vendor.js"
         src: [
@@ -171,7 +180,7 @@
         options: interrupt: true
       jade:
         files: ["src/**/*.jade"]
-        tasks: ["jade", "embedtemplate:docs"]
+        tasks: ["jade", "replace:docs"]
         options: interrupt: true

     #
@@ -203,11 +212,10 @@
         ]

     #
-    # embed template section
-    # Embed template into directives and also component documents into
-    # main documentation
-    #
-    embedtemplate:
+    # replace section
+    # Replace placeholder with contents
+    #
+    replace:
       src:
         options:
           pattern: /templateUrl: "([^"]+)"/g
@@ -229,6 +237,14 @@
           src:     "*.html"
           dest:    "example/"
         ]
+      jqueryui:
+        options:
+          pattern: /@VERSION/g
+          replace: "<%= jqueryUI.version %>"
+        files: [
+          src:  "tmp/jqueryui.js"
+          dest: "tmp/jqueryui.js"
+        ]

     marked:
       docs:
@@ -242,7 +258,7 @@
         ]

   # Replace templateUrl with actual html
-  grunt.registerMultiTask "embedtemplate", "Replace templateUrl with actual html", ->
+  grunt.registerMultiTask "replace", "Replace placeholder with contents", ->
     options = @options
       separator: ""
       replace:   ""
@@ -272,7 +288,7 @@
       .join grunt.util.normalizelf(options.separator)

       grunt.file.write file.dest, src
-      grunt.log.writeln("Embeded template into '#{file.dest}' successfully")
+      grunt.log.writeln("Replace placeholder with contents in '#{file.dest}' successfully")

   grunt.registerMultiTask "marked", "Convert markdown to html", ->
     options = @options
@@ -319,13 +335,19 @@
       "coffee"
       "stylus"
       "jade"
-      "concat"
+      "concat:jqueryui"
+      "replace:jqueryui"
+      "concat:vendorJs"
+      "concat:appJs"
+      "concat:deployAppJs"
+      "concat:vendorCss"
+      "concat:appCss"
       "clean"
       "copy"
-      "embedtemplate:src"
+      "replace:src"
       "chalkboard"
       "marked"
-      "embedtemplate:docs"
+      "replace:docs"
       "update:component"
       "uglify"
     ]
@@ -334,6 +356,8 @@
     "coffee"
     "stylus"
     "jade"
+    "concat:jqueryui"
+    "replace:jqueryui"
     "concat:vendorJs"
     "concat:appJs"
     "concat:vendorCss"
@@ -341,7 +365,7 @@
     "clean"
     "chalkboard"
     "marked"
-    "embedtemplate:docs"
+    "replace:docs"
   ]

   grunt.registerTask "run", "Watch src and run test server", ->


OnboardingView: Try to decrease the cyclomatic complexity

--- client/stacks/lib/views/stacks/onboarding/onboardingview.coffee
+++ client/stacks/lib/views/stacks/onboarding/onboardingview.coffee
@@ -59,27 +59,7 @@
       page.on 'HiliteTemplate', (type, keyword) =>
         kd.utils.wait 737, => @hiliteTemplate type, keyword

-    @on 'PageNavigationRequested', (direction) =>
-      pageIndex  = @pages.indexOf @currentPage
-      nextIndex  = if direction is 'next' then ++pageIndex else --pageIndex
-      targetPage = @pages[nextIndex]
-
-      return @emit 'ShowInitialView'  if pageIndex is 0 and direction is 'prev'
-
-      # Temporary solution ~ GG
-      selectedProvider  = @providerSelectionView.selected?.getOption 'provider'
-
-      if direction is 'next' and selectedProvider is 'vagrant'
-        @onboardingCompleted()
-      else if targetPage
-        @currentPage.hide()
-        targetPage.show()
-        @setClass 'get-started'  if targetPage is @getStartedView
-        @currentPage = targetPage
-        @emit 'ScrollTo', 'top'
-      else
-        @onboardingCompleted()
-
+    @on 'PageNavigationRequested', @bound 'handlePageNavigationRequested'

     @getStartedView.on 'NextPageRequested', =>
       @unsetClass 'get-started'
@@ -90,26 +70,57 @@

     @getStartedView.emit 'NextPageRequested'  if @getOption 'skipOnboarding'

-    @providerSelectionView.on 'UpdateStackTemplate', (isSelected) =>
-      if isSelected
-        @nextButton.enable()
-        @stackPreview.show()
-        @emit 'ScrollTo', 'bottom'
-      else
-        @nextButton.disable()
-        @stackPreview.hide()
+    @providerSelectionView.on 'UpdateStackTemplate', @bound 'handleUpdateStackTemplate'

     @configurationView.tabView.on 'PaneAdded', => @codeSetupView.addPane()

     @configurationView.tabView.on 'PaneRemoved', =>
       @codeSetupView.tabView.removePane @codeSetupView.tabView.panes.last

-    @configurationView.on 'InstanceTypeChanged', (type) =>
-      for pane, index in @configurationView.tabView.panes
-        label = @codeSetupView.tabView.panes[index]?.instanceTypeLabel
-        label.updatePartial pane.instanceTypeSelectBox.getValue()  if label
-
-        @hiliteTemplate 'line', type
+    @configurationView.on 'InstanceTypeChanged', @bound 'handleInstanceTypeChanged'
+
+
+  handlePageNavigationRequested: (direction) ->
+
+    pageIndex  = @pages.indexOf @currentPage
+    nextIndex  = if direction is 'next' then ++pageIndex else --pageIndex
+    targetPage = @pages[nextIndex]
+
+    return @emit 'ShowInitialView'  if pageIndex is 0 and direction is 'prev'
+
+    # Temporary solution ~ GG
+    selectedProvider  = @providerSelectionView.selected?.getOption 'provider'
+
+    if direction is 'next' and selectedProvider is 'vagrant'
+      @onboardingCompleted()
+    else if targetPage
+      @currentPage.hide()
+      targetPage.show()
+      @setClass 'get-started'  if targetPage is @getStartedView
+      @currentPage = targetPage
+      @emit 'ScrollTo', 'top'
+    else
+      @onboardingCompleted()
+
+
+  handleUpdateStackTemplate: (isSelected) ->
+
+    if isSelected
+      @nextButton.enable()
+      @stackPreview.show()
+      @emit 'ScrollTo', 'bottom'
+    else
+      @nextButton.disable()
+      @stackPreview.hide()
+
+
+  handleInstanceTypeChanged: (type) ->
+
+    for pane, index in @configurationView.tabView.panes
+      label = @codeSetupView.tabView.panes[index]?.instanceTypeLabel
+      label.updatePartial pane.instanceTypeSelectBox.getValue()  if label
+
+      @hiliteTemplate 'line', type

   createFooter: ->


error was raw buffer

error was raw buffer

--- src/docco.coffee
+++ src/docco.coffee
@@ -85,9 +85,9 @@
 highlight = (source, sections, callback) ->
   language = get_language source
   pygments = spawn 'pygmentize', ['-l', language.name, '-f', 'html', '-O', 'encoding=utf-8']
-  output   = ''
+  output = ''
   pygments.stderr.addListener 'data',  (error)  ->
-    console.error error if error
+    console.error error.toString() if error
   pygments.stdout.addListener 'data', (result) ->
     output += result if result
   pygments.addListener 'exit', ->


Delete table column with amount of believes/ disbelieves

--- core/app/backbone/views/facts/react_fact_opinionate_area.coffee
+++ core/app/backbone/views/facts/react_fact_opinionate_area.coffee
@@ -82,8 +82,6 @@
     _div ["fact-opinionators-table"],
       _table ["fact-opinionators-table-table"],
         _tr [],
-          _td ["fact-opinionators-table-believes"], opinionTally.believes
-          _td ["fact-opinionators-table-disbelieves"], opinionTally.disbelieves
           _td ["fact-opinionators-table-disbelieves"], opinionTallyTotal

 window.ReactOpinionateArea = React.createBackboneClass


fixing compound assignments to global variables. oof.

--- nodes.coffee
+++ nodes.coffee
@@ -1119,7 +1119,8 @@
   compileConditional: (o) ->
     [left, right] = @variable.cacheReference o
     # Disallow conditional assignment of undefined variables.
-    if left.base instanceof Literal and left.base.value != "this" and not o.scope.check left.base.value
+    if not left.properties.length and left.base instanceof Literal and
+           left.base.value != "this" and not o.scope.check left.base.value
       throw new Error "the variable \"#{left.base.value}\" can't be assigned with #{@context} because it has not been defined."
     if "?" in @context then o.isExistentialEquals = true
     new Op(@context[...-1], left, new Assign(right, @value, '=') ).compile o


Fix from code inspect: Use "not" instead of "!".

--- nodes.coffee
+++ nodes.coffee
@@ -49,7 +49,7 @@
 # Validates that `fragments` is an array of CodeFragment objects.
 # If PARANOID is false, then this does nothing.
 checkFragments = (fragments, node=null) ->
-  if !PARANOID then return fragments
+  if not PARANOID then return fragments

   nodeName = if node then " from #{node.constructor.name}" else ""
   if !fragments


removing accidentally-committed `console.log`

--- nodes.coffee
+++ nodes.coffee
@@ -932,7 +932,6 @@
         o.scope.add name, 'var'
       else
         o.scope.find name
-    console.log @variable.constructor.name, name
     if @value instanceof Code and match = METHOD_DEF.exec name
       @value.klass = match[1] if match[1]
       @value.name  = match[2] ? match[3] ? match[4]


adding an extra pair of braces to the code produced by object comprehensions, so as to squeak by in JSLint's good graces

--- nodes.coffee
+++ nodes.coffee
@@ -934,11 +934,12 @@
       body:         Expressions.wrap([new IfNode(@filter, body)])
     if @object
       o.scope.assign('__hasProp', 'Object.prototype.hasOwnProperty', true)
-      for_part: ivar + ' in ' + svar + ') if (__hasProp.call(' + svar + ', ' + ivar + ')'
+      for_part: ivar + ' in ' + svar + ') { if (__hasProp.call(' + svar + ', ' + ivar + ')'
     return_result:  '\n' + @idt() + return_result + ';' unless top_level
     body:           body.compile(merge(o, {indent: body_dent, top: true}))
     vars:           if range then name else name + ', ' + ivar
-    set_result + source_part + 'for (' + for_part + ') {\n' + var_part + body + '\n' + @idt() + '}\n' + @idt() + return_result
+    close:          if @object then '}}\n' else '}\n'
+    set_result + source_part + 'for (' + for_part + ') {\n' + var_part + body + '\n' + @idt() + close + @idt() + return_result

 }


nodes: refactored to reduce parens

nodes: refactored to reduce parens

--- nodes.coffee
+++ nodes.coffee
@@ -52,7 +52,7 @@
   # object with their parent closure, to preserve the expected lexical scope.
   compileClosure: (o) ->
     o.sharedScope = o.scope
-    throw new Error 'cannot include a pure statement in an expression.' if @containsPureStatement()
+    throw SyntaxError 'cannot include a pure statement in an expression.' if @containsPureStatement()
     Closure.wrap(this).compile o

   # If the code generation wishes to use the result of a complex expression
@@ -115,6 +115,7 @@
     for attr in @children when this[attr]
       for child in flatten [this[attr]]
         return if func(child) is false
+    this

   collectChildren: ->
     nodes = []
@@ -151,7 +152,8 @@
 # `if`, `switch`, or `try`, and so on...
 exports.Expressions = class Expressions extends Base

-  children:     ['expressions']
+  children: ['expressions']
+
   isStatement:  YES

   constructor: (nodes) ->
@@ -212,7 +214,7 @@
     if o.scope.hasAssignments this
       code = "#{@tab}var #{ o.scope.compiledAssignments().replace /\n/g, '$&' + @tab };\n#{code}"
     if not o.globals and o.scope.hasDeclarations this
-      code = "#{@tab}var #{o.scope.compiledDeclarations()};\n#{code}"
+      code = "#{@tab}var #{ o.scope.compiledDeclarations() };\n#{code}"
     code

   # Compiles a single expression within the expressions body. If we need to
@@ -257,9 +259,9 @@
   assigns: (name) -> name is @value

   compileNode: (o) ->
-    idt = if @isStatement(o) then @idt() else ''
-    end = if @isStatement(o) then ';' else ''
-    val = if @isReserved()   then "\"#{@value}\"" else @value
+    idt = if @isStatement o then @idt()          else ''
+    end = if @isStatement o then ';'             else ''
+    val = if @isReserved()  then "\"#{@value}\"" else @value
     idt + val + end

   toString: -> ' "' + @value + '"'
@@ -270,9 +272,10 @@
 # make sense.
 exports.Return = class Return extends Base

-  isStatement:      YES
-  isPureStatement:  YES
-  children:         ['expression']
+  children: ['expression']
+
+  isStatement    : YES
+  isPureStatement: YES

   constructor: (@expression) ->
     super()
@@ -281,7 +284,7 @@

   compile: (o) ->
     expr = @expression?.makeReturn()
-    return expr.compile o if expr and (expr not instanceof Return)
+    return expr.compile o if expr and expr not instanceof Return
     super o

   compileNode: (o) ->
@@ -300,9 +303,9 @@
   children: ['base', 'properties']

   # A **Value** has a base and a list of property accesses.
-  constructor: (@base, @properties, tag) ->
-    super()
-    @properties or= []
+  constructor: (@base, props, tag) ->
+    super()
+    @properties = props or []
     @tags[tag] = yes if tag

   # Add a property access to the list.
@@ -332,7 +335,6 @@

   makeReturn: ->
     if @properties.length then super() else @base.makeReturn()
-

   # The value can be unwrapped as its inner node, if there are no attached
   # properties.
@@ -429,7 +431,7 @@
     @isNew    = false
     @isSuper  = variable is 'super'
     @variable = if @isSuper then null else variable
-    @args     or= []
+    @args   or= []

   compileSplatArguments: (o) ->
     Splat.compileSplattedArray @args, o
@@ -445,9 +447,9 @@
   # Grab the reference to the superclass' implementation of the current method.
   superReference: (o) ->
     {method} = o.scope
-    throw Error "cannot call super outside of a function." unless method
+    throw SyntaxError 'cannot call super outside of a function.' unless method
     {name} = method
-    throw Error "cannot call super on an anonymous function." unless name
+    throw SyntaxError 'cannot call super on an anonymous function.' unless name
     if method.klass
       "#{method.klass}.__super__.#{name}"
     else
@@ -542,8 +544,7 @@

   # Hooks one constructor into another's prototype chain.
   compileNode: (o) ->
-    ref =  new Value new Literal utility 'extends'
-    (new Call ref, [@child, @parent]).compile o
+    new Call(new Value(new Literal utility 'extends'), [@child, @parent]).compile o

 #### Accessor

@@ -556,12 +557,11 @@
   constructor: (@name, tag) ->
     super()
     @prototype = if tag is 'prototype' then '.prototype' else ''
-    @soakNode = tag is 'soak'
+    @soakNode  = tag is 'soak'

   compileNode: (o) ->
     name = @name.compile o
-    namePart = if name.match(IS_STRING) then "[#{name}]" else ".#{name}"
-    @prototype + namePart
+    @prototype + if IS_STRING.test(name) then "[#{name}]" else ".#{name}"

   isComplex: NO

@@ -576,9 +576,7 @@
     super()

   compileNode: (o) ->
-    idx = @index.compile o
-    prefix = if @proto then '.prototype' else ''
-    "#{prefix}[#{idx}]"
+    "#{ if @proto then '.prototype' else '' }[#{ @index.compile o }]"

   isComplex: -> @index.isComplex()

@@ -716,9 +714,9 @@

   children: ['objects']

-  constructor: (@objects) ->
-    super()
-    @objects or= []
+  constructor: (objs) ->
+    super()
+    @objects = objs or []

   compileSplatLiteral: (o) ->
     Splat.compileSplattedArray @objects, o
@@ -752,15 +750,16 @@
 # The CoffeeScript class definition.
 exports.Class = class Class extends Base

-  children:     ['variable', 'parent', 'properties']
+  children: ['variable', 'parent', 'properties']
+
   isStatement:  YES

   # Initialize a **Class** with its name, an optional superclass, and a
   # list of prototype property assignments.
-  constructor: (variable, @parent, @properties) ->
-    super()
-    @variable = if variable is '__temp__' then new Literal variable else variable
-    @properties or= []
+  constructor: (variable, @parent, props) ->
+    super()
+    @variable   = if variable is '__temp__' then new Literal variable else variable
+    @properties = props or []
     @returns    = false

   makeReturn: ->
@@ -782,9 +781,9 @@

     if @parent
       applied = new Value @parent, [new Accessor new Literal 'apply']
-      constructor = new Code([], new Expressions([
+      constructor = new Code [], new Expressions [
         new Call applied, [new Literal('this'), new Literal('arguments')]
-      ]))
+      ]
     else
       constructor = new Code [], new Expressions [new Return new Literal 'this']

@@ -794,9 +793,10 @@
         if func not instanceof Code
           [func, ref] = func.compileReference o
           props.push func if func isnt ref
-          apply = new Call(new Value(ref, [new Accessor new Literal 'apply']), [new Literal('this'), new Literal('arguments')])
+          apply = new Call new Value(ref, [new Accessor new Literal 'apply']),
+                           [new Literal('this'), new Literal('arguments')]
           func  = new Code [], new Expressions([apply])
-        throw new Error "cannot define a constructor as a bound function." if func.bound
+        throw SyntaxError 'cannot define a constructor as a bound function.' if func.bound
         func.name = className
         func.body.push new Return new Literal 'this'
         variable = new Value variable
@@ -809,18 +809,18 @@
           func.context = className
         else
           func.bound = false
-          constScope or= new Scope(o.scope, constructor.body, constructor)
+          constScope or= new Scope o.scope, constructor.body, constructor
           me or= constScope.freeVariable 'this'
-          pname = pvar.compile(o)
+          pname = pvar.compile o
           constructor.body.push    new Return new Literal 'this' if constructor.body.empty()
           constructor.body.unshift new Literal "this.#{pname} = function(){ return #{className}.prototype.#{pname}.apply(#{me}, arguments); }"
       if pvar
         access = if prop.context is 'this' then pvar.base.properties[0] else new Accessor(pvar, 'prototype')
         val    = new Value variable, [access]
-        prop   = new Assign(val, func)
+        prop   = new Assign val, func
       props.push prop

-    constructor.className = className.match /[\w\d\$_]+$/
+    constructor.className = className.match /[$\w]+$/
     constructor.body.unshift new Literal "#{me} = this" if me
     construct = @idt() + new Assign(variable, constructor).compile(merge o, sharedScope: constScope) + ';'
     props     = if !props.empty() then '\n' + props.compile(o)                    else ''
@@ -841,10 +841,10 @@

   children: ['variable', 'value']

+  topSensitive: YES
+
   constructor: (@variable, @value, @context) ->
     super()
-
-  topSensitive: YES

   # Compile an assignment, delegating to `compilePatternMatch` or
   # `compileSplice` if appropriate. Keep track of the name of the base object
@@ -911,7 +911,7 @@
           # A shorthand `{a, b, @c} = val` pattern-match.
           idx = if obj.tags.this then obj.properties[0].name else obj
       unless obj instanceof Value or obj instanceof Splat
-        throw new Error 'pattern matching must use only identifiers on the left-hand side.'
+        throw SyntaxError 'pattern matching must use only identifiers on the left-hand side.'
       accessClass = if isObject and IDENTIFIER.test(idx.value) then Accessor else Index
       if not splat and obj instanceof Splat
         val   = new Literal obj.compileValue o, valVar, i, olength - i - 1
@@ -972,7 +972,7 @@
     top         = del o, 'top'
     o.scope     = sharedScope or new Scope(o.scope, @body, this)
     o.top       = true
-    o.indent    = @idt(1)
+    o.indent    = @idt 1
     empty       = @body.expressions.length is 0
     delete o.bare
     delete o.globals
@@ -998,9 +998,9 @@
         else
           params.push param
     o.scope.startLevel()
-    params = (param.compile(o) for param in params)
+    params = param.compile(o) for param in params
     @body.makeReturn() unless empty or @noReturn
-    (o.scope.parameter(param)) for param in params
+    o.scope.parameter param for param in params
     comm  = if @comment then @comment.compile(o) + '\n' else ''
     o.indent = @idt 2 if @className
     code  = if @body.expressions.length then "\n#{ @body.compileWithDeclarations(o) }\n" else ''
@@ -1052,12 +1052,12 @@
   assigns: (name) -> @name.assigns name

   compileNode: (o) ->
-    if @index? then @compileParam(o) else @name.compile(o)
+    if @index? then @compileParam o else @name.compile o

   # Compiling a parameter splat means recovering the parameters that succeed
   # the splat in the parameter list, by slicing the arguments object.
   compileParam: (o) ->
-    name = @name.compile(o)
+    name = @name.compile o
     o.scope.find name
     end = ''
     if @trailings.length
@@ -1107,8 +1107,10 @@
 # flexibility or more speed than a comprehension can provide.
 exports.While = class While extends Base

-  children:     ['condition', 'guard', 'body']
-  isStatement: YES
+  children: ['condition', 'guard', 'body']
+
+  topSensitive: YES
+  isStatement : YES

   constructor: (condition, opts) ->
     super()
@@ -1122,8 +1124,6 @@
   makeReturn: ->
     @returns = true
     this
-
-  topSensitive: YES

   # The main difference from a JavaScript *while* is that the CoffeeScript
   # *while* can be used as a part of a larger expression -- while loops may
@@ -1140,9 +1140,9 @@
       set   = "#{@tab}#{rvar} = [];\n"
       @body = Push.wrap(rvar, @body) if @body
     pre     = "#{set}#{@tab}while (#{cond})"
-    @body   = Expressions.wrap([new If(@guard, @body)]) if @guard
+    @body   = Expressions.wrap [new If @guard, @body] if @guard
     if @returns
-      post = '\n' + new Return(new Literal rvar).compile(merge(o, indent: @idt()))
+      post = '\n' + new Return(new Literal rvar).compile merge o, indent: @idt()
     else
       post = ''
     "#{pre} {\n#{ @body.compile(o) }\n#{@tab}}#{post}"
@@ -1182,21 +1182,22 @@
       first = new Parens first   if first instanceof Code and first.bound
     super()
     @operator = @CONVERSIONS[op] or op
-    (@first  = first ).tags.operation = yes
-    (@second = second).tags.operation = yes if second
+    (@first   = first ).tags.operation = yes
+    (@second  = second).tags.operation = yes if second
     @flip     = !!flip

   isUnary: ->
     not @second

-  isComplex: -> @operator isnt '!' or @first.isComplex()
+  isComplex: ->
+    @operator isnt '!' or @first.isComplex()

   isChainable: ->
     @operator in @CHAINABLE

   invert: ->
-    if @operator in ['===', '!==']
-      @operator = @INVERSIONS[@operator]
+    if op = @INVERSIONS[@operator]
+      @operator = op
       this
     else if @second
       new Parens(this).invert()
@@ -1204,7 +1205,7 @@
       super()

   toString: (idt) ->
-    super(idt, @constructor.name + ' ' + @operator)
+    super idt, @constructor.name + ' ' + @operator

   compileNode: (o) ->
     if @isUnary()
@@ -1221,10 +1222,8 @@
   #     bin/coffee -e "puts 50 < 65 > 10"
   #     true
   compileChain: (o) ->
-    shared = @first.unwrap().second
-    [@first.second, shared] = shared.compileReference o
-    [first, second, shared] = [@first.compile(o), @second.compile(o), shared.compile(o)]
-    "(#{first}) && (#{shared} #{@operator} #{second})"
+    [@first.second, shared] = @first.unwrap().second.compileReference o
+    "#{ @first.compile o } && #{ shared.compile o } #{@operator} #{ @second.compile o }"

   compileExistence: (o) ->
     if @first.isComplex()
@@ -1253,13 +1252,13 @@
     @array instanceof Value and @array.isArray()

   compileNode: (o) ->
-    if @isArray() then @compileOrTest(o) else @compileLoopTest(o)
+    if @isArray() then @compileOrTest o else @compileLoopTest o

   compileOrTest: (o) ->
     [obj1, obj2] = @object.compileReference o, precompile: yes
     tests = for item, i in @array.base.objects
-      "#{if i then obj2 else obj1} === #{item.compile(o)}"
-    "(#{tests.join(' || ')})"
+      "#{ if i then obj2 else obj1 } === #{ item.compile o }"
+    "(#{ tests.join ' || ' })"

   compileLoopTest: (o) ->
     [obj1, obj2] = @object.compileReference merge(o, top: yes), precompile: yes
@@ -1272,14 +1271,15 @@
 # A classic *try/catch/finally* block.
 exports.Try = class Try extends Base

-  children:     ['attempt', 'recovery', 'ensure']
+  children: ['attempt', 'recovery', 'ensure']
+
   isStatement: YES

   constructor: (@attempt, @error, @recovery, @ensure) ->
     super()

   makeReturn: ->
-    @attempt  = @attempt.makeReturn() if @attempt
+    @attempt  = @attempt .makeReturn() if @attempt
     @recovery = @recovery.makeReturn() if @recovery
     this

@@ -1289,11 +1289,11 @@
     o.indent    = @idt 1
     o.top       = true
     attemptPart = @attempt.compile(o)
-    errorPart   = if @error then " (#{ @error.compile(o) }) " else ' '
+    errorPart   = if @error then " (#{ @error.compile o }) " else ' '
     catchPart   = if @recovery
-      " catch#{errorPart}{\n#{ @recovery.compile(o) }\n#{@tab}}"
+      " catch#{errorPart}{\n#{ @recovery.compile o }\n#{@tab}}"
     else unless @ensure or @recovery then ' catch (_e) {}' else ''
-    finallyPart = (@ensure or '') and ' finally {\n' + @ensure.compile(merge(o)) + "\n#{@tab}}"
+    finallyPart = (@ensure or '') and ' finally {\n' + @ensure.compile(merge o) + "\n#{@tab}}"
     "#{@tab}try {\n#{attemptPart}\n#{@tab}}#{catchPart}#{finallyPart}"

 #### Throw
@@ -1301,7 +1301,8 @@
 # Simple node to throw an exception.
 exports.Throw = class Throw extends Base

-  children:     ['expression']
+  children: ['expression']
+
   isStatement: YES

   constructor: (@expression) ->
@@ -1311,7 +1312,7 @@
   makeReturn: THIS

   compileNode: (o) ->
-    "#{@tab}throw #{@expression.compile(o)};"
+    "#{@tab}throw #{ @expression.compile o };"

 #### Existence

@@ -1344,23 +1345,23 @@

   children: ['expression']

+  topSensitive: YES
+
   constructor: (@expression) ->
     super()

   isStatement: (o) ->
-    @expression.isStatement(o)
+    @expression.isStatement o
   isComplex: ->
     @expression.isComplex()

-  topSensitive: YES
-
   makeReturn: ->
     @expression.makeReturn()

   compileNode: (o) ->
     top  = del o, 'top'
     @expression.parenthetical = true
-    code = @expression.compile(o)
+    code = @expression.compile o
     return code if top and @expression.isPureStatement o
     if @parenthetical or @isStatement o
       return if top then @tab + code + ';' else code
@@ -1377,8 +1378,10 @@
 # you can map and filter in a single pass.
 exports.For = class For extends Base

-  children:     ['body', 'source', 'guard']
-  isStatement: YES
+  children: ['body', 'source', 'guard']
+
+  topSensitive: YES
+  isStatement : YES

   constructor: (@body, source, @name, @index) ->
     super()
@@ -1386,18 +1389,16 @@
     @raw    = !!source.raw
     @object = !!source.object
     [@name, @index] = [@index, @name] if @object
+    throw SyntaxError 'index cannot be a pattern matching expression' if @index instanceof Value
     @pattern = @name instanceof Value
-    throw new Error('index cannot be a pattern matching expression') if @index instanceof Value
     @returns = false
-
-  topSensitive: YES

   makeReturn: ->
     @returns = true
     this

   compileReturnValue: (val, o) ->
-    return '\n' + new Return(new Literal val).compile(o) if @returns
+    return '\n' + new Return(new Literal val).compile o if @returns
     return '\n' + val if val
     ''

@@ -1422,7 +1423,7 @@
     varPart       = ''
     guardPart     = ''
     unstepPart    = ''
-    body          = Expressions.wrap([@body])
+    body          = Expressions.wrap [@body]
     idt1          = @idt 1
     if range
       forPart = source.compile merge o, {index: ivar, @step}
@@ -1442,10 +1443,10 @@
         stepPart  = if @step then "#{ivar} += #{ @step.compile(o) }" else "#{ivar}++"
         forPart   = "#{ivar} = 0, #{lvar} = #{sourcePart}.length; #{ivar} < #{lvar}; #{stepPart}"
     resultPart    = if rvar then "#{@tab}#{rvar} = [];\n" else ''
-    returnResult  = @compileReturnValue(rvar, o)
-    body          = Push.wrap(rvar, body) unless topLevel
+    returnResult  = @compileReturnValue rvar, o
+    body          = Push.wrap rvar, body unless topLevel
     if @guard
-      body        = Expressions.wrap([new If(@guard, body)])
+      body        = Expressions.wrap [new If @guard, body]
     if codeInBody
       body.unshift  new Literal "var #{name} = #{ivar}" if range
       body.unshift  new Literal "var #{namePart}" if namePart
@@ -1485,8 +1486,6 @@

   constructor: (@subject, @cases, @otherwise) ->
     super()
-    @tags.subjectless = !@subject
-    @subject or= new Literal 'true'

   makeReturn: ->
     pair[1].makeReturn() for pair in @cases
@@ -1494,19 +1493,18 @@
     this

   compileNode: (o) ->
-    idt = o.indent = @idt 2
+    idt1  = @idt 1
+    idt2  = o.indent = @idt 2
     o.top = yes
-    code = "#{ @tab }switch (#{ @subject.compile o }) {"
-    for pair in @cases
-      [conditions, block] = pair
-      exprs = block.expressions
+    code  = "#{ @tab }switch (#{ @subject?.compile(o) or true }) {"
+    for [conditions, block] in @cases
       for condition in flatten [conditions]
-        condition = new Op '!!', new Parens condition if @tags.subjectless
-        code += "\n#{ @idt(1) }case #{ condition.compile o }:"
+        condition = condition.invert().invert() unless @subject
+        code += "\n#{ idt1 }case #{ condition.compile o }:"
       code += "\n#{ block.compile o }"
-      code += "\n#{ idt }break;" unless last(exprs) instanceof Return
+      code += "\n#{ idt2 }break;" unless last(block.expressions) instanceof Return
     if @otherwise
-      code += "\n#{ @idt(1) }default:\n#{ @otherwise.compile o }"
+      code += "\n#{ idt1 }default:\n#{ @otherwise.compile o }"
     code += "\n#{ @tab }}"
     code

@@ -1556,8 +1554,8 @@

   makeReturn: ->
     if @isStatement()
-      @body     and= @ensureExpressions(@body.makeReturn())
-      @elseBody and= @ensureExpressions(@elseBody.makeReturn())
+      @body     and= @ensureExpressions @body.makeReturn()
+      @elseBody and= @ensureExpressions @elseBody.makeReturn()
       this
     else
       new Return this
@@ -1687,7 +1685,7 @@
 TRAILING_WHITESPACE = /[ \t]+$/gm

 IDENTIFIER = /^[$A-Za-z_][$\w]*$/
-NUMBER     = /^0x[\da-f]+|^(?:\d+(\.\d+)?|\.\d+)(?:e[+-]?\d+)?$/i
+NUMBER     = /^0x[\da-f]+$|^(?:\d+(\.\d+)?|\.\d+)(?:e[+-]?\d+)?$/i
 SIMPLENUM  = /^[+-]?\d+$/

 # Is a literal value a string?


fixed a regression where destructuring `for` miscompiles

--- nodes.coffee
+++ nodes.coffee
@@ -1425,6 +1425,7 @@
     varPart       = ''
     guardPart     = ''
     body          = Expressions.wrap([@body])
+    idt1          = @idt 1
     if range
       sourcePart  = source.compileVariables(o)
       forPart     = source.compile merge o, index: ivar, step: @step
@@ -1436,10 +1437,10 @@
         ref = scope.freeVariable 'ref'
         sourcePart = "#{ref} = #{svar};"
         svar = ref
-      if @pattern
-        namePart  = new AssignNode(@name, literal("#{svar}[#{ivar}]")).compile(merge o, {indent: @idt(1), top: true, keepLevel: yes}) + '\n'
-      else
-        namePart  = "#{name} = #{svar}[#{ivar}]" if name
+      namePart = if @pattern
+        new AssignNode(@name, literal "#{svar}[#{ivar}]").compile merge o, top: on
+      else if name
+        "#{name} = #{svar}[#{ivar}]"
       unless @object
         lvar      = scope.freeVariable 'len'
         stepPart  = if @step then "#{ivar} += #{ @step.compile(o) }" else "#{ivar}++"
@@ -1447,7 +1448,6 @@
     sourcePart    = (if rvar then "#{rvar} = []; " else '') + sourcePart
     sourcePart    = if sourcePart then "#{@tab}#{sourcePart}\n#{@tab}" else @tab
     returnResult  = @compileReturnValue(rvar, o)
-
     body          = PushNode.wrap(rvar, body) unless topLevel
     if @guard
       body        = Expressions.wrap([new IfNode(@guard, body)])
@@ -1457,13 +1457,17 @@
       body.unshift  literal "var #{index} = #{ivar}" if index
       body        = ClosureNode.wrap(body, true)
     else
-      varPart     = (namePart or '') and (if @pattern then namePart else "#{@idt(1)}#{namePart};\n")
+      varPart     = "#{idt1}#{namePart};\n" if namePart
     if @object
       forPart     = "#{ivar} in #{svar}"
-      guardPart   = "\n#{@idt(1)}if (!#{utility('hasProp')}.call(#{svar}, #{ivar})) continue;" unless @raw
-    body          = body.compile(merge(o, {indent: @idt(1), top: true}))
+      guardPart   = "\n#{idt1}if (!#{utility('hasProp')}.call(#{svar}, #{ivar})) continue;" unless @raw
+    body          = body.compile merge o, indent: idt1, top: true
     vars          = if range then name else "#{name}, #{ivar}"
-    "#{sourcePart}for (#{forPart}) {#{guardPart}\n#{varPart}#{body}\n#{@tab}}#{returnResult}"
+    """
+    #{sourcePart}for (#{forPart}) {#{guardPart}
+    #{varPart}#{body}
+    #{@tab}}#{returnResult}
+    """

 #### SwitchNode


Only allow one query to run at a time

Only allow one query to run at a time

--- background_scripts/completion.coffee
+++ background_scripts/completion.coffee
@@ -183,6 +183,12 @@
   refresh: -> completer.refresh() for completer in @completers when completer.refresh

   filter: (queryTerms, onComplete) ->
+    # Only allow one query to run at a time.
+    if @filterInProgress
+      @mostRecentQuery = { queryTerms: queryTerms, onComplete: onComplete }
+      return
+    @mostRecentQuery = null
+    @filterInProgress = true
     suggestions = []
     completersFinished = 0
     for completer in @completers
@@ -194,6 +200,8 @@
           results = @sortSuggestions(suggestions)[0...@maxResults]
           result.generateHtml() for result in results
           onComplete(results)
+          @filterInProgress = false
+          @filter(@mostRecentQuery.queryTerms, @mostRecentQuery.onComplete) if @mostRecentQuery

   sortSuggestions: (suggestions) ->
     for suggestion in suggestions


Support console without 'debug' or 'warn'

--- src/index.coffee
+++ src/index.coffee
@@ -28,8 +28,8 @@
 		if id is 8 then msg += "Group \"#{group}\" with event \"#{event}\" does not exists"
 		if id is 9 then msg += "Event \"#{event}\" does not exist in group \"#{group}\""

-		# Log the message to the console
-		console.warn msg
+		# Log the message to the console (as a warning if available)
+		if console.warn then console.warn msg else console.log msg

 		# Return this/self to allow chaining
 		self
@@ -206,7 +206,13 @@
 		return error this, 'emit', 4, event if not list = @events[event]

 		# If tabs is defined by the user it will receive all emited event trough that function
-		console.debug "MiniEventEmitter ~ trace ~ #{event}" if @settings.trace
+		if @settings.trace
+
+			# The trace message
+			msg = "MiniEventEmitter ~ trace ~ #{event}"
+
+			# Log the message to the console (as a debug if available)
+			if console.debug then console.debug msg else console.log msg

 		# Loop over all functions/actions within a group
 		action.apply action, args for action in list
@@ -232,5 +238,6 @@
 	else if window
 		window.MiniEventEmitter = MiniEventEmitter
 	else
-		console.warn "Cannot expose MiniEventEmitter"
+		msg = "Cannot expose MiniEventEmitter"
+		if console.warn then console.warn msg else console.log msg
 )()


Log for log level

Log for log level

--- src/index.coffee
+++ src/index.coffee
@@ -13,6 +13,8 @@
 	winston.error 'Uncaught exception:', err.stack
 	(require 'q').delay(100).then -> process.exit 1

+winston.info "Using log level #{argv.log ? 'info'}"
+
 game = require './game'

 game.initialize require './io/tty'


compatibility with react 0.12

compatibility with react 0.12

two warnings fixed

--- src/index.coffee
+++ src/index.coffee
@@ -16,7 +16,7 @@
   (i.naturalWidth + i.naturalHeight is 0) or (i.width + i.height is 0)

-ImageLoaderImg = React.createClass
+ImageLoaderImg = React.createFactory React.createClass
   displayName: 'ImageLoaderImage'
   getInitialState: ->
     # We don't want to render the image on the server, because that will result
@@ -60,7 +60,7 @@
       # (https://github.com/facebook/react/issues/1252) that causes noscript to
       # cause invariant violations when rendered on the server. So, we render it
       # as a string and set the inner HTML of a wrapper span.
-      html = React.renderComponentToStaticMarkup (noscript null, @renderImg())
+      html = React.renderToStaticMarkup(noscript null, @renderImg())
       (span
         style:
           display: 'none'


Removed valueToString

Removed valueToString

--- src/index.coffee
+++ src/index.coffee
@@ -163,9 +163,6 @@
         throw new Error("Object must be a string in order to invoke '#{methodName}'")
       resolved[methodName].apply(resolved, args)

-  def 'valueToString', (resolved) ->
-    resolved.toString()
-
   def 'log', (resolved, shallow) ->
     if shallow
       if Array.isArray(resolved)


added check for cassandra version 4

added check for cassandra version 4

--- src/index.coffee
+++ src/index.coffee
@@ -127,11 +127,11 @@
       d.reject(new Error("Could not determine the version of Cassandra!"))
     else
       logDebug "Cassandra version: #{cassandraVersion}"
-      isVersion3 = _.startsWith cassandraVersion, "3."
-
-      schemaKeyspace = if isVersion3 then "system_schema" else "system"
-      tablesTable = if isVersion3 then "tables" else "schema_columnfamilies"
-      tableNameColumn = if isVersion3 then "table_name" else "columnfamily_name"
+      isVersion3orAbove = _.startsWith(cassandraVersion, "3.") || _.startsWith(cassandraVersion, "4.")
+
+      schemaKeyspace = if isVersion3orAbove then "system_schema" else "system"
+      tablesTable = if isVersion3orAbove then "tables" else "schema_columnfamilies"
+      tableNameColumn = if isVersion3orAbove then "table_name" else "columnfamily_name"

       logDebug "schemaKeyspace: #{schemaKeyspace}"
       logDebug "tablesTable: #{tablesTable}"


Store app as instance variable

Store app as instance variable

--- src/index.coffee
+++ src/index.coffee
@@ -26,14 +26,14 @@
     @run()

   run: ->
-    app = connect()
-    app.use connect.directory(if typeof @root == "object" then @root[0] else @root)
+    @app = connect()
+    @app.use connect.directory(if typeof @root == "object" then @root[0] else @root)

     @handlers().forEach (middleware) ->
       if typeof (middleware) is "object"
-        app.use middleware[0], middleware[1]
+        @app.use middleware[0], middleware[1]
       else
-        app.use middleware
+        @app.use middleware

     if @https
       @server = https.createServer
@@ -41,9 +41,9 @@
         cert: @https.cert || fs.readFileSync __dirname + '/certs/server.crt'
         ca: @https.ca || fs.readFileSync __dirname + '/certs/ca.crt'
         passphrase: @https.passphrase || 'gulp'
-        app
+        @app
     else
-      @server = http.createServer app
+      @server = http.createServer @app

     @server.listen @port, (err) =>
       if err


Update index.coffee

Update index.coffee

--- src/index.coffee
+++ src/index.coffee
@@ -131,7 +131,7 @@
         return t(bb)
     if options.allowHtml
       if interpolate
-        $elem.html($elem.html().trans.replace /{{([^{}]*)}}/g, (aa, bb) ->
+        $elem.html($elem.html().replace /{{([^{}]*)}}/g, (aa, bb) ->
           return t(bb))
       else
         $elem.html(trans)


If value not present you gain new ObjectID

--- src/index.coffee
+++ src/index.coffee
@@ -131,6 +131,9 @@
   return

 objectId = (value) ->
+  if not value
+    return new mongodb.ObjectID()
+
   if utils.is.str(value)
     value = new mongodb.ObjectID value


Initial fix for touch events with multiple plots (#4430)

only tested on desktop with dual touch mouse

--- bokehjs/src/coffee/common/ui_events.coffee
+++ bokehjs/src/coffee/common/ui_events.coffee
@@ -108,8 +108,8 @@
       x = e.srcEvent.pageX
       y = e.srcEvent.pageY
     else
-      x = e.center.x
-      y = e.center.y
+      x = e.pointers[0].pageX
+      y = e.pointers[0].pageY
     offset = $(e.target).offset()
     left = offset.left ? 0
     top = offset.top ? 0


Export View from widget/textinput

Export View from widget/textinput

--- bokehjs/src/coffee/widget/textinput.coffee
+++ bokehjs/src/coffee/widget/textinput.coffee
@@ -47,6 +47,7 @@
     model : TextInput

   return {
-    Model : TextInput
-    Collection : new TextInputs()
+    View: TextInputView
+    Model: TextInput
+    Collection: new TextInputs()
   }


Remove unnecessary code

Remove unnecessary code

--- lib/Util.coffee
+++ lib/Util.coffee
@@ -8,7 +8,6 @@
   if isHexColor(color) then chalk.hex(color) else chalk[color]

 colorize = (colors, value) ->
-  stylize = getColor
   (stylize = getColor color) for color in colors
   stylize value


More localStorage updates

More localStorage updates

--- sync.coffee
+++ sync.coffee
@@ -611,6 +611,7 @@
 		change = @_make_change id
 		if change?
 			s_data['change'] = change
+			@_save_entity id
 			@_queue_change change
 #		else
 #			@_remove_entity id
@@ -699,6 +700,7 @@
 			if 'sendfull' of s_data
 				change['d'] = @jd.deepCopy c_object
 				delete s_data['sendfull']
+				@_save_entity id
 			else
 				change['v'] = @jd.object_diff s_data['object'], c_object
 				if @jd.entries(change['v']) is 0
@@ -833,6 +835,7 @@
 						orig_object = @jd.deepCopy s_data['object']
 						s_data['object'] = @jd.apply_object_diff s_data['object'], change['v']
 						s_data['version'] = change['ev']
+						@_save_entity id

 						new_object = @jd.deepCopy s_data['object']


fixed issue with hiddenWidth setting

fixed issue with hiddenWidth setting

--- lib/autohide-tree-view.coffee
+++ lib/autohide-tree-view.coffee
@@ -135,9 +135,9 @@
     @applyHiddenWidth()
     @applyDoAnimate()
     width = treeViewEl.querySelector('.tree-view').clientWidth
-    if width > treeViewEl.clientWidth > @getHiddenWidth()
+    if width > treeViewEl.clientWidth > @getSetting 'hiddenWidth'
       noDelay = true
-    transitionDelay = !noDelay * @getShowDelay()
+    transitionDelay = !noDelay * @getSetting 'showDelay'
     treeViewEl.classList.add 'autohide-unfolded'
     treeViewEl.style.transitionDelay = "#{transitionDelay}s"
     treeViewEl.style.width = "#{width}px"
@@ -147,7 +147,7 @@
   hide: (noDelay) ->
     return unless @enabled
     @applyDoAnimate()
-    transitionDelay = !noDelay * @getHideDelay()
+    transitionDelay = !noDelay * @getSetting 'hideDelay'
     treeViewEl.classList.remove 'autohide-unfolded'
     treeViewEl.style.transitionDelay = "#{transitionDelay}s"
     @applyHiddenWidth()
@@ -170,30 +170,25 @@

   applyDoAnimate: (doAnimate) ->
     return unless @enabled
-    doAnimate = doAnimate?.newValue ? @getDoAnimate()
+    doAnimate = doAnimate?.newValue ? @getSetting 'animate'
     treeViewEl.style.transitionDuration = "#{!!doAnimate * .3}s"

   applyHiddenWidth: (width) ->
     return unless @enabled
-    width = @getHiddenWidth() if isNaN parseInt width
+    width = @getSetting 'hiddenWidth' if isNaN parseInt width
     treeViewEl.style.width = "#{width}px"
+    treeViewEl.parentNode.style?.width = "#{width}px" unless @getSetting 'pushEditor'

   applyPushEditor: (pushEditor) ->
     return unless @enabled
     if pushEditor
       treeViewEl.style.position = 'relative'
-      treeViewEl.parentNode.style?.width = 'auto'
+      treeViewEl.parentNode.style?.width = ''
     else
       treeViewEl.style.position = 'absolute'
-      treeViewEl.parentNode.style?.width = "#{atom.config.get 'autohide-tree-view.hiddenWidth'}px"
+      treeViewEl.parentNode.style?.width = "#{@getSetting 'hiddenWidth'}px"

-  getDoAnimate: -> atom.config.get 'autohide-tree-view.animate'
-
-  getShowDelay: -> atom.config.get 'autohide-tree-view.showDelay'
-
-  getHideDelay: -> atom.config.get 'autohide-tree-view.hideDelay'
-
-  getHiddenWidth: -> atom.config.get 'autohide-tree-view.hiddenWidth'
+  getSetting: (setting) -> atom.config.get "autohide-tree-view.#{setting}"

   enableHoverEvents: -> treeViewEl.classList.add 'autohide-hover-events'


Remove or= from variable initialization

Remove or= from variable initialization

The original code created a local variable `head` and assigned
it to either `...getElementsByTagName('head')[0]` or to
`document.documentElement`.

The new code fails to compile, because a variable named `head`
does not exist in scope.

--- src/jsonp.coffee
+++ src/jsonp.coffee
@@ -44,7 +44,7 @@
                 script.onload = script.onreadystatechange = null
                 script.parentNode?.removeChild script
                 script = null
-        head or= window.document.getElementsByTagName('head')[0] or window.document.documentElement
+        head = window.document.getElementsByTagName('head')[0] or window.document.documentElement
         # (see jQuery bugs #2709 and #4378)
         head.insertBefore script, head.firstChild


fixing issue where coffeescript is parsing scope incorrectly

--- src/giphy.coffee
+++ src/giphy.coffee
@@ -148,9 +148,10 @@

   getUriFromResultDataWithMaxSize: (images, size = 0, allowLargerThanMaxSize = false) ->
     if images and size > 0
-      imagesBySize = Object.keys images
-        .map (x) -> images[x]
-        .sort (a, b) -> a.size - b.size
+      imagesBySize = Object
+        .keys(images)
+        .map((x) -> images[x])
+        .sort((a, b) -> a.size - b.size)

       # for whatever reason istanbul is complaining about this missing else block
       ### istanbul ignore else ###


WFGH: get user stats if session data has user account

--- workers/social/lib/social/models/campaigns/wfgh.coffee
+++ workers/social/lib/social/models/campaigns/wfgh.coffee
@@ -61,6 +61,19 @@
     callback message : 'n/a'

+  getUserStats = (username, callback) ->
+
+    JWFGH.one {username}, (err, applied)->
+
+      return callback err  if err
+
+      isApplicant = applied?
+      isApproved  = applied?.approved
+      isWinner    = applied?.winner
+
+      callback null, {isApplicant, isApproved, isWinner}
+
+
   @getStats = (account, callback) ->

     JCampaign.get 'WFGH', (err, campaign) ->
@@ -69,35 +82,27 @@

         return callback message : 'expired'

-      username = account?.profile?.nickname
-
-      unless username
-
-        callback null, {
-          totalApplicants    : 0
-          approvedApplicants : 0
-          isApplicant        : no
-          campaign           : campaign.content
-        }
-
-      JWFGH.one {username}, (err, applied)->
+      JWFGH.count {}, (err, totalApplicants)->

         return callback err  if err

-        isApplicant = applied?
-        isApproved  = applied?.approved
-        isWinner    = applied?.winner
-
-        JWFGH.count {}, (err, totalApplicants)->
+        JWFGH.count approved : yes, (err, approvedApplicants)->

           return callback err  if err

-          JWFGH.count approved : yes, (err, approvedApplicants)->
-
-            return callback err  if err
+          kallback = (err, userStats) ->
+            {isApplicant, isApproved, isWinner} = userStats

             callback err, {
               totalApplicants, approvedApplicants
               isApplicant, isApproved, isWinner
-              campaign : campaign.content
-            }+              campaign: campaign.content
+            }
+
+          if username = account?.profile?.nickname
+          then getUserStats username, kallback
+          else kallback null, {
+            isWinner      : no
+            isApproved    : no
+            isApplication : no
+          }


wider

wider

--- app/assets/javascripts/directives.coffee
+++ app/assets/javascripts/directives.coffee
@@ -196,7 +196,7 @@
       graph = new (joint.dia.Graph)
       paper = new (joint.dia.Paper)(
         el: $el[0]
-        width: 900
+        width: 1500
         height: 2900
         gridSize: 1
         model: graph)


adds more i81n entries to gettext.js.coffee

--- app/assets/javascripts/gettext.js.coffee
+++ app/assets/javascripts/gettext.js.coffee
@@ -1,14 +1,20 @@
 i18n = {
   es: {
     "Comments": "Comentarios",
+    "No comment": "Sin comentarios",
     "Cancel": "Cancelar",
     "Save": "Guardar",
+    "Edit": "Editar",
+    "Delete": "Borrar",
     "Unregistered": "
Necesitas iniciar sesión o registrarte para continuar.
"
   },
   en: {
     "Comments": "Coments",
+    "No comment": "No comment",
     "Cancel": "Cancel",
     "Save": "Save",
+    "Edit": "Edit",
+    "Delete": "Delete",
     "Unregistered": "You need to sign in or sign up to continue."
   }
 }


add example

add example

--- keymaps/vim-mode-plus.cson
+++ keymaps/vim-mode-plus.cson
@@ -73,6 +73,11 @@
   'b': 'vim-mode-plus:move-to-previous-word'
   # 'b':     'vim-mode-plus:move-to-previous-alphanumeric-word'
   'B': 'vim-mode-plus:move-to-previous-whole-word'
+
+  # 'q': 'vim-mode-plus:move-to-next-subword'
+  # 'Q': 'vim-mode-plus:move-to-previous-subword'
+  # 'ctrl-e': 'vim-mode-plus:move-to-end-of-subword'
+
   ')': 'vim-mode-plus:move-to-next-sentence'
   '(': 'vim-mode-plus:move-to-previous-sentence'
   # ')': 'vim-mode-plus:move-to-next-sentence-skip-blank-row'
@@ -543,7 +548,7 @@

   # 'a q': 'vim-mode-plus:a-subword'
   # 'i q': 'vim-mode-plus:inner-subword'
-
+
 # visual
 # -------------------------
 'atom-text-editor.vim-mode-plus.visual-mode':


:ideograph_advantage::book: Updated in browser at strd6.github.io/editor

--- pixie.cson
+++ pixie.cson
@@ -1,4 +1,4 @@
-version: "0.2.2-pre.1"
+version: "0.2.2"
 entryPoint: "haml-jr"
 remoteDependencies: [
   "https://cdnjs.cloudflare.com/ajax/libs/coffee-script/1.6.3/coffee-script.min.js"


:feelsgood::handbag: Updated in browser at strd6.github.io/editor

--- pixie.cson
+++ pixie.cson
@@ -1,4 +1,4 @@
-version: "0.3.2-pre.2"
+version: "0.3.2-pre.3"
 dependencies:
   composition: "distri/model:v0.1.3"
   observable: "distri/observable:v0.3.1"


Passa conta e agencia por parametro para os operadores

--- Agencia/server/operador.coffee
+++ Agencia/server/operador.coffee
@@ -3,10 +3,6 @@
 @chamarOperador = (operador, nome, data) ->
 	operadorInterno = Cluster.discoverConnection("operador-#{operador}")
 	try
-		if Match.test data, Object
-			data.agencia = agencia
-			data.operador = Meteor.userId()
-
 		return operadorInterno.call nome, data
 	catch e
 		throw e
@@ -28,4 +24,10 @@
 	if user.role not in permissoes[operador]
 		throw new Meteor.Error 'Usuário sem acesso'

+	if Match.test data, Object
+		data.agencia = Meteor.user().agencia
+		data.operador = Meteor.user()
+		if Meteor.user().role is 'conta'
+			data.conta = Meteor.user()._id
+
 	return chamarOperador operador, nome, data


Cleanup

Cleanup

--- src/index.coffee
+++ src/index.coffee
@@ -233,10 +233,6 @@
       callback()

-  _executeTasks: (tasks, callback) ->
-
-
-
   _getTasksFromConfigMatchingTheFilename: (filename) ->
     tasks = []
     for config in @_options.configs


Restore the expected wrapper behavior as bunch's config.modules.wrapper is either 'commonjs', 'amd', or false. The value is never true. See https://github.com/brunch/brunch/blob/master/docs/config.md#modules.

Remove unused `fs` import.

--- src/index.coffee
+++ src/index.coffee
@@ -1,5 +1,4 @@
 sysPath     = require 'path'
-fs          = require 'fs'
 compileHBS  = require './ember-handlebars-compiler'

 module.exports = class EmberHandlebarsCompiler
@@ -8,15 +7,15 @@
   extension: 'hbs'
   precompile: off
   root: null
-  modulesPrefix: ''
+  modulesPrefix: 'module.exports = '

   constructor: (@config) ->
     if @config.files.templates.precompile is on
       @precompile = on
     if @config.files.templates.root?
       @root = sysPath.join 'app', @config.files.templates.root, sysPath.sep
-    if @config.modules.wrapper is on
-      @modulesPrefix = 'module.exports = '
+    if @config.modules.wrapper is off
+      @modulesPrefix = ''
     null

   compile: (data, path, callback) ->
@@ -34,4 +33,4 @@
     catch err
       error = err
     finally
-      callback error, result+      callback error, result


* [bug] uppercase cson package name error on case-sensitive os

--- src/index.coffee
+++ src/index.coffee
@@ -1,5 +1,5 @@
 contributors  = require('git-contributors').GitContributors
-CSON          = require('CSON')
+CSON          = require('cson')
 Promise       = require('bluebird')
 inquirer      = require('inquirer')
 _             = require('lodash')


add input for color

add input for color

--- src/index.coffee
+++ src/index.coffee
@@ -8,7 +8,7 @@

 app = new Vue
   data: ->
-    color: '#ff0000'
+    color: '#000000'
     count: 3
     title: 'color-vue!'
   # TODO: props:
@@ -24,6 +24,12 @@

       {{message}}
+

+      color
+      <input
+        type="text"
+        v-model="color"
+        />
       <cv-hex-color color="{{color}}">
       </cv-hex-color>
       <cv-rgb-color color="{{color}}">


Invoke globally registered DomainEventHandlers

--- src/index.coffee
+++ src/index.coffee
@@ -57,13 +57,26 @@
     BoundedContext = @require 'BoundedContext'
     boundedContext = new BoundedContext
     boundedContext.initialize params.name, store
+
+    boundedContext.addDomainEventHandler 'DomainEvent', (domainEvent) =>
+      if !@_domainEventHandlers[params.name]
+        return
+
+      eventName = domainEvent.getAggregateName() + ':' + domainEvent.getName()
+      if !@_domainEventHandlers[params.name][eventName]
+        return
+
+      for eventHandler in @_domainEventHandlers[params.name][eventName]
+        eventHandler domainEvent
+
     boundedContext

   addDomainEventHandler: (boundedContextName, eventName, eventHandler) ->
     if !@_domainEventHandlers[boundedContextName]
-      @_domainEventHandlers[boundedContextName] = []
+      @_domainEventHandlers[boundedContextName] = {}

-    @_domainEventHandlers[boundedContextName].push
-      name: eventName
-      handler: eventHandler
+    if !@_domainEventHandlers[boundedContextName][eventName]
+      @_domainEventHandlers[boundedContextName][eventName] = []
+
+    @_domainEventHandlers[boundedContextName][eventName].push eventHandler


ignore undefined or null value parameter passed to setAttribute

--- src/index.coffee
+++ src/index.coffee
@@ -200,6 +200,7 @@
           Set the named attribute to the given value. The attribute
           value must be kept in a member variable named `_<attributeName>`
           where `<attributeName>` is a place holder for the attribute name.
+          Note, a given undefined or null value is ignored.

           The optional `discrete` parameter can be used to optimize the update
           behaviour of discrete attribute value, i.e., the attribute value is
@@ -210,7 +211,7 @@
           e.g., a switch state. False, otherwise.
         ###
         setAttribute: (attributeName, value, discrete=false) ->
-          if not discrete or device['_' + attributeName] isnt value
+          if value? and not discrete or device['_' + attributeName] isnt value
             device['_' + attributeName] = value
             device.emit attributeName, value


#1046 - Expand all button should use different FA icon

--- jsapp/xlform_model_view/view.surveyApp.templates.coffee
+++ jsapp/xlform_model_view/view.surveyApp.templates.coffee
@@ -26,7 +26,7 @@
             <button class="btn btn--utility survey-editor__action--multiquestion" id="settings"> Form Settings</button>
             <button class="btn btn--utility" id="save"> Save and Exit #{type_name}</button>
             <button class="btn btn--utility" id="xlf-preview"> Preview #{type_name}</button>
-            <button class="btn btn--utility survey-editor__action--multiquestion js-expand-multioptions--all" > Show All Responses</button>
+            <button class="btn btn--utility survey-editor__action--multiquestion js-expand-multioptions--all" > Show All Responses</button>
             <button class="btn btn--utility survey-editor__action--multiquestion btn--group-questions btn--disabled js-group-rows">Group Questions</button>
           <button class="btn btn--utility pull-right survey-editor__action--multiquestion rowselector_toggle-library" id="question-library"> Question Library</button>


Use slug instead of link

Use slug instead of link

--- public/plugin/lokka-archives/assets/script.coffee
+++ public/plugin/lokka-archives/assets/script.coffee
@@ -11,7 +11,7 @@
   render: ->
     `(

-        {this.props.title}
+        {this.props.title}

           {this.props.created_at}
           <Category category={this.props.category} />
@@ -24,7 +24,7 @@
     entries = this.props.entries.map (entry) ->
       uniqueKey = "#{entry.title}-#{entry.created_at}"
       `(
-        <Entry key={uniqueKey} title={entry.title} category={entry.category} link={entry.link} created_at={entry.created_at} />
+        <Entry key={uniqueKey} title={entry.title} category={entry.category} link={entry.slug} created_at={entry.created_at} />
       )`
     title = this.props.monthYear.replace(
       /(\d{4})\-(\d{1,2})/, -> "#{arguments[1]}年#{arguments[2]}月"


Make the "x" button work by going back.

Make the "x" button work by going back.

--- app/assets/asset/view.coffee
+++ app/assets/asset/view.coffee
@@ -3,6 +3,8 @@
 app.controller 'asset/view', [
   '$scope', 'displayService', 'asset',
   ($scope, display, asset) ->
+    $scope.close = ->
+      window.history.back()
     $scope.asset = asset
     display.title = asset.displayName
     $scope.volume = asset.volume


test updated

test updated

--- test.coffee
+++ test.coffee
@@ -29,9 +29,11 @@

 console.log 'Test Arrays'

+n = 10000000
+points = new TDS.Array Point, n
+
 console.time 'arr'
-n = 1000000
-points = new TDS.Array Point, n
+
 p = points.get 0
 p.copyFrom p2
 pl = points.get 0
@@ -41,7 +43,7 @@
  p.next()

  p.setX pl.getX() + i
- p.setY pl.getY()
+ p.setY pl.getY() + 2

  #p.copyFrom pl
  #p.setX p.getX() + i
@@ -55,10 +57,40 @@
  p.next()
 ###

+console.log (points.get 1).get()
 console.log p.get()

 console.timeEnd 'arr'

+
+console.time 'arr2'
+points.setObject 0, x: 1, y: 3
+for i in [1...n]
+ points.setX i, (points.getX i-1) + i
+ points.setY i, (points.getY i-1) + 2
+
+#console.log (points.getX n-1), points.getY n-1
+console.log points.getObject 1
+console.log points.getObject n-1
+
+console.timeEnd 'arr2'
+
+console.time 'ArrayBuffer'
+
+buffer1 = new ArrayBuffer n * 4
+buffer2 = new ArrayBuffer n * 4
+x = new Int32Array buffer1
+y = new Int32Array buffer2
+
+x[0] = 1
+y[0] = 3
+for i in [1...n]
+ x[i] = x[i-1] + i
+ y[i] = y[i-1] + 2
+
+console.log x[1], y[1]
+console.log x[n-1], y[n-1]
+console.timeEnd 'ArrayBuffer'

 console.time 'js'
 x = new Array n
@@ -69,8 +101,9 @@

 for i in [1...n]
  x[i] = x[i-1] + i
- y[i] = y[i-1]
+ y[i] = y[i-1] + 2

+console.log x[1], y[1]
 console.log x[n-1], y[n-1]

 console.timeEnd 'js'


change test db name

change test db name

--- test.coffee
+++ test.coffee
@@ -5,8 +5,8 @@
 config =
   host: 'localhost'
   port: 27017
-  db: 'likeandpay-qa'
-  collection: '_test_dolater'
+  db: '_dolater'
+  collection: '_test'

 mongoPool.connect config, (err, db) ->
   assert.equal err, null


weird service sometimes returns http sometime https

--- test.coffee
+++ test.coffee
@@ -34,7 +34,7 @@

   it 'handles fw.to', (done) ->
     u 'http://fw.to/ixsPPtP', (err, long) ->
-      assert.equal long, 'https://www.theglobeandmail.com/opinion/fifty-years-in-canada-and-now-i-feel-like-a-second-class-citizen/article26691065/'
+      assert.match long, /www.theglobeandmail.com\/opinion\/fifty-years-in-canada-and-now-i-feel-like-a-second-class-citizen\/article26691065\//
       done()

   it 'handles canonical link', (done) ->


Fixed branch filling JS test

Fixed branch filling JS test

--- spec/javascripts/repository/branch_spec.js.coffee
+++ spec/javascripts/repository/branch_spec.js.coffee
@@ -79,42 +79,31 @@

   describe '#fetch', ->
     beforeEach ->
-      @subject.cancel_request = sinon.spy()
+      @subject.cancel_request = sinon.stub()

     context 'with valid address', ->
       beforeEach ->
-        @subject.fill_options = sinon.spy()
-#           @subject.names = {'https://github.com/mezuro/prezento.git': ['master', 'dev']}
+        sinon.stub(@subject, "fill_options")
+
+      afterEach ->
+        @subject.fill_options.restore()

       context 'with new address', ->
         beforeEach ->
           @subject.names = {}
-
           @address = 'https://github.com/mezuro/kalibro_processor.git'

-          @select = sinon.stub()
-          # Stub just the selector and not the whole jQuery object
-          find_stub = sinon.stub($, "find")
-          find_stub.withArgs("#repository_branch").returns(@select)
-          find_stub.withArgs("#repository_scm_type").returns({val: -> "SVN"})
-
-          @server = sinon.fakeServer.create()
-          @server.respondImmediately = true
-
-          address_url_encoded = encodeURI(@address)
-          @server.respondWith('GET', '/repository_branches&url=' + address_url_encoded + '&scm_type=' + 'GIT',
-            [200, { "Content-Type": "application/json" }, JSON.stringify({
-              "branches": ["stable", "dev", "master"]
-            })]
-          )
+          @select = {empty: sinon.stub()}
+          $ = sinon.stub(window, "$")
+          $.withArgs("#repository_branch").returns(@select)
+          $.withArgs("#repository_scm_type").returns({val: -> "GIT"})
+          $.get = sinon.stub().withArgs('/repository_branches', {'url': @address, 'scm_type': 'GIT'}).returns().yields({
+            'branches': ['stable', 'dev', 'master']
+          })

         afterEach ->
-          @server.restore()
-          $.find.restore()
+          $.restore()

         it 'should fetch the branches and fill the options', ->
           @subject.fetch(@address)
-          @server.respond()
-          console.log(@server.requests[0])
-          debugger
-          assert.isTrue(@subject.fill_options.calledWith(['stable', 'dev', 'master'], @select))
+          sinon.assert.calledWith(@subject.fill_options, ['stable', 'dev', 'master'], @select)


enforce a minimum drain rate

enforce a minimum drain rate

--- services/real-time/app/coffee/DrainManager.coffee
+++ services/real-time/app/coffee/DrainManager.coffee
@@ -4,7 +4,7 @@

 	startDrainTimeWindow: (io, minsToDrain)->
 		drainPerMin = io.sockets.clients().length / minsToDrain
-		DrainManager.startDrain(io, drainPerMin / 60)
+		DrainManager.startDrain(io, Math.max(drainPerMin / 60, 4)) # enforce minimum drain rate

 	startDrain: (io, rate) ->
 		# Clear out any old interval


Test the we do not send a X-Requested-With header that a server-side framework might use to detect AJAX requests and be "smart" about its response

--- spec_app/spec/javascripts/up/proxy_spec.js.coffee
+++ spec_app/spec/javascripts/up/proxy_spec.js.coffee
@@ -98,6 +98,14 @@
             expect(response.url).toMatchURL('/url')
             done()

+      it 'does not send a X-Requested-With header that a server-side framework might use to detect AJAX requests and be "smart" about its response', (done) ->
+        up.request('/url')
+
+        u.task =>
+          headers = @lastRequest().requestHeaders
+          expect(headers['X-Requested-With']).toBeMissing()
+          done()
+
       describe 'error handling', ->

         it 'rejects with up.Failed when there was a network error', (done) ->


'Updating for version 0.12.4dev5'

'Updating for version 0.12.4dev5'

--- bokehjs/src/coffee/version.coffee
+++ bokehjs/src/coffee/version.coffee
@@ -1 +1 @@
-export version = '0.12.4dev4'
+export version = '0.12.4dev5'


Try to fix flickering spec

Try to fix flickering spec

--- spec_app/spec/javascripts/up/proxy_spec.js.coffee
+++ spec_app/spec/javascripts/up/proxy_spec.js.coffee
@@ -742,7 +742,7 @@
               'up:proxy:load'
             ])

-          next.after 300, =>
+          next.after 500, =>
             expect(@events).toEqual([
               'up:proxy:load',
               'up:proxy:slow'


try to set content type from the user's uploaded file. May be problematic.

--- lib/assets/javascripts/easiest_ever_ajax_uploads.coffee
+++ lib/assets/javascripts/easiest_ever_ajax_uploads.coffee
@@ -37,7 +37,7 @@
         type: "POST"
         data: fd
         processData: false
-        contentType: false
+        contentType: file.type
         crossDomain: true
         success: (data, textStatus, jqXHR) ->
           EasiestAjaxUploader.uploadSuccess input, form, jqXHR.getResponseHeader("Location"), input.data("preview_url"), EasiestAjaxUploader.uploadStack


change menu label

change menu label

--- client/src/common/states/controller.coffee
+++ client/src/common/states/controller.coffee
@@ -78,7 +78,7 @@
       state: 'tab.edit-sprint'
       params:
         sprintId: $scope.sprint?.id
-      title: 'Settings'
+      title: 'Edit Sprint'
       icon: 'settings'
     ,
     ]


nested selectors

nested selectors

--- lib/csss.coffee
+++ lib/csss.coffee
@@ -368,6 +368,8 @@
     @_error = e if e?
     @_error?.message || @_error || null

+  __levels: {}
+
   css: (cssString = '', o = null, levelBefore = null, selectorBefore = '') ->

     objectToCSS = (o) ->
@@ -381,18 +383,17 @@
       selector = selectorString = section[0]
       level    = Math.floor section[1].length / 2
       values   = objectToCSS(section[2])
-      # console.log selector

       if level >= levelBefore
         if selectorString[0] is '&'
           # we have a reference here, merge together
-          console.log '__', selectorBefore
+          #console.log '__', selectorBefore
           parts = for s in selectorString.substring(1).split(',')
-            selectorBefore.trim()+s.replace(/\s([^a-zA-Z])/,'$1') if s?.trim()
-            # insideParts = for sBefore in selectorBefore.trim().split(',')
-            #   sBefore.replace(/\s([^a-zA-Z])/,'$1') if sBefore?.trim()
-            # insideParts.join(', ').replace(/\,\s$/,'')
-          console.log parts.join(', ').replace(/\,\s$/,'')
+            s = ' '+s
+            insideParts = for _s in selectorBefore.trim().split(',')
+              _s.trim()+s.replace(/\s([^a-zA-Z])/g,'$1').replace(/\s([a-zA-Z]+.+)/g,' $1') if _s?.trim()
+            insideParts.join(', ').replace(/\,\s$/,'')
+            #s = selectorBefore.trim()+s.replace(/\s([^a-zA-Z])/g,'$1').replace(/\s([a-zA-Z]+.+)/g,' $1') if s?.trim()
           selectorString = parts.join(', ').replace(/\,\s$/,'')
         else
           selectorString = selectorBefore + " " + selectorString
@@ -402,6 +403,8 @@
       if level isnt levelBefore
         levelBefore = level
         selectorBefore = selectorString
+        @__levels[level] = selectorString
+    console.log @__levels
     cssString


Ensure customCommand init tasks triggered by inform run after any refreshObject task.

--- lib/cwmp.coffee
+++ lib/cwmp.coffee
@@ -173,7 +173,7 @@
         for k of reference
           continue if k[0] == '_'
           if not actual[k]?._timestamp? or actual[k]._timestamp < lastBootstrap
-            _tasks.push({device: currentRequest.session.deviceId, name : 'refreshObject', objectName : reference[k]._path})
+            _tasks.push({device: currentRequest.session.deviceId, name : 'refreshObject', objectName : reference[k]._path, timestamp : now})
           else
             traverse(reference[k], actual[k])

@@ -186,7 +186,8 @@

         for cmd in customCommands.getDeviceCustomCommandNames(currentRequest.session.deviceId)
           if not (deviceCustomCommands[cmd]?._timestamp < lastBootstrap)
-            _tasks.push({device: currentRequest.session.deviceId, name: 'customCommand', command: "#{cmd} init"})
+            # Increment timestamp by one millisecond to ensure it runs after any refresh task
+            _tasks.push({device: currentRequest.session.deviceId, name: 'customCommand', command: "#{cmd} init", timestamp: new Date(now.getTime() + 1)})
           delete deviceCustomCommands[cmd]

         for cmd of deviceCustomCommands
@@ -210,10 +211,11 @@
         db.devicesCollection.insert({_id : currentRequest.session.deviceId, _registered : now, _deviceId : deviceIdDetails}, (err) ->
           throw err if err
           util.log("#{currentRequest.session.deviceId}: New device registered")
-          _tasks.push({device: currentRequest.session.deviceId, name : 'refreshObject', objectName : ''})
+          _tasks.push({device: currentRequest.session.deviceId, name : 'refreshObject', objectName : '', timestamp : now})

           for cmd in customCommands.getDeviceCustomCommandNames(currentRequest.session.deviceId)
-            _tasks.push({device: currentRequest.session.deviceId, name: 'customCommand', command: "#{cmd} init"})
+            # Increment timestamp by one millisecond to ensure it runs after any refresh task
+            _tasks.push({device: currentRequest.session.deviceId, name: 'customCommand', command: "#{cmd} init", timestamp: new Date(now.getTime() + 1)})

           apiFunctions.insertTasks(_tasks, {}, () ->
             updateAndRespond()


Redo zebra

Redo zebra

--- src/add/connect.coffee
+++ src/add/connect.coffee
@@ -19,10 +19,12 @@
         th x for x in '№ Операция Время Результат'.split ' '
       tbody ->
         for z, i in @
-          tr class: (if i & 1 then 'odd' else 'even'), ->
-            td align: 'right', i+1
-            td z.title
-            td align: 'right'
-            td align: 'center'
+          tr
+            class: if i & 1 then 'odd' else 'even'
+            ->
+              td align: 'right', i+1
+              td z.title
+              td align: 'right'
+              td align: 'center'

 interior.innerHTML = t steps


Remove console.log

Remove console.log

--- app/scripts/contactsAppController.coffee
+++ app/scripts/contactsAppController.coffee
@@ -35,7 +35,6 @@
     phoneCollectionEditor = new PhoneCollectionEditor collection: phoneCollection
     emailCollectionEditor = new EmailCollectionEditor collection: emailCollection

-    console.log @
     editorLayout.on 'edit:cancel', => @showContact contact
     editorLayout.on 'edit:save', =>
       contact.set 'name', contactEditorGeneral.ui.name.val()


WorkspaceModel: Use _id field from client.connection.delegate.

--- workers/social/lib/social/models/workspace.coffee
+++ workers/social/lib/social/models/workspace.coffee
@@ -25,7 +25,7 @@
       instance     : []

   @create = secure (client, data, callback) ->
-    data.owner = client.connection.delegate.profile._id
+    data.owner = client.connection.delegate._id
     data.slug  = Inflector.slugify data.name.toLowerCase()

     {name, slug, machineUId, rootPath, owner, layout} = data
@@ -35,7 +35,7 @@

       if workspace or name is 'My Workspace'
         query   =
-          owner : client.connection.delegate.profile._id
+          owner : client.connection.delegate._id
           slug  : new RegExp slug

         JWorkspace.some query, {}, (err, workspaces) ->
@@ -63,5 +63,5 @@
       return callback null, workspace

   some$: secure (client, query = {}, callback) ->
-    query.owner = client.connection.delegate.profile._id
+    query.owner = client.connection.delegate._id
     JWorkspace.some query, callback


Changed meta tags.

Changed meta tags.

--- workers/social/lib/social/render/graphmeta.coffee
+++ workers/social/lib/social/render/graphmeta.coffee
@@ -4,7 +4,7 @@
 module.exports = (options = {})->
   options.title ?= "A new way for developers to work."
   options.shareUrl ?= "https://koding.com"
-  options.image ?= "https://koding.com/images/kd-fluid-icon512.png"
+  options.image ?= "https://koding.com/images/koding_share.jpg"
   options.body ?= "Koding is a developer community and cloud development environment where developers come together and code in the browser – with a real development server to run their code. Developers can work, collaborate, write and run apps without jumping through hoops and spending unnecessary money."

   """


Remove deprecated async()

Remove deprecated async()

--- lib/Thenable.coffee
+++ lib/Thenable.coffee
@@ -191,9 +191,6 @@
     @changeState State.REJECTED, value
     @

-  async: (fn) ->
-    process.nextTick fn
-
   toDOT: -> @tree.toDOT()

 module.exports = Thenable


Turn off push state for local development

--- SingularityUI/app/application.coffee
+++ SingularityUI/app/application.coffee
@@ -21,7 +21,7 @@
             @router = new Router

             Backbone.history.start
-                pushState: true
+                pushState: location.hostname.substr(0, 'local'.length).toLowerCase() isnt 'local'
                 root: '/singularity/'

             Object.freeze? @


fixed bug where session.user.loggedIn() was always returning false

--- lib/backend/session.coffee
+++ lib/backend/session.coffee
@@ -132,7 +132,7 @@
       "#{key}:user:#{@session.user_id}"

     loggedIn: ->
-      @session.user_id is not null
+      @session.user_id?

     logout: (cb = ->) ->
       SS.users.online.remove(@session.user_id) if SS.config.users.online.enabled


Don't clobber path module by using path as a variable name

--- src/app/text-mate-package.coffee
+++ src/app/text-mate-package.coffee
@@ -58,15 +58,15 @@
       else
         done()

-  loadGrammarAtPath: (path, done) =>
-    TextMateGrammar.load path, (err, grammar) =>
-      return console.log("Error loading grammar at path '#{path}':", err.stack ? err) if err
+  loadGrammarAtPath: (grammarPath, done) =>
+    TextMateGrammar.load grammarPath, (err, grammar) =>
+      return console.log("Error loading grammar at path '#{grammarPath}':", err.stack ? err) if err
       @addGrammar(grammar)
       done()

   loadGrammarsSync: ->
-    for path in fsUtils.list(@getSyntaxesPath(), @legalGrammarExtensions)
-      @addGrammar(TextMateGrammar.loadSync(path))
+    for grammarPath in fsUtils.list(@getSyntaxesPath(), @legalGrammarExtensions)
+      @addGrammar(TextMateGrammar.loadSync(grammarPath))

   addGrammar: (grammar) ->
     @grammars.push(grammar)
@@ -94,8 +94,8 @@
         selector = syntax.cssSelectorFromScopeSelector(grammar.scopeName)
         @scopedProperties.push({selector, properties})

-    for path in fsUtils.list(@getPreferencesPath())
-      {scope, settings} = fsUtils.readObject(path)
+    for preferencePath in fsUtils.list(@getPreferencesPath())
+      {scope, settings} = fsUtils.readObject(preferencePath)
       if properties = @propertiesFromTextMateSettings(settings)
         selector = syntax.cssSelectorFromScopeSelector(scope) if scope?
         @scopedProperties.push({selector, properties})
@@ -135,10 +135,10 @@
           done()
           return

-        loadPreferencesAtPath = (path, done) ->
-          fsUtils.readObjectAsync path, (error, preferences) =>
+        loadPreferencesAtPath = (preferencePath, done) ->
+          fsUtils.readObjectAsync preferencePath, (error, preferences) =>
             if error?
-              console.warn("Failed to parse preference at path '#{path}'", error.stack, error)
+              console.warn("Failed to parse preference at path '#{preferencePath}'", error.stack, error)
             else
               preferenceObjects.push(preferences)
             done()


No quote completion when writing escape sequences

--- lib/bracket-matcher.coffee
+++ lib/bracket-matcher.coffee
@@ -47,14 +47,21 @@
     return true if @editor.hasMultipleCursors()

     cursorBufferPosition = @editor.getCursorBufferPosition()
-    previousCharacter = @editor.getTextInBufferRange([cursorBufferPosition.add([0, -1]), cursorBufferPosition])
+    previousCharacters = @editor.getTextInBufferRange([cursorBufferPosition.add([0, -2]), cursorBufferPosition]).split('')
     nextCharacter = @editor.getTextInBufferRange([cursorBufferPosition, cursorBufferPosition.add([0,1])])
+
+    previousCharacter = ''
+    prepreviousCharacter = ''
+
+    previousCharacter = previousCharacters.pop() if previousCharacters.length > 0
+    prepreviousCharacter = previousCharacters.pop()  if previousCharacters.length > 0

     hasWordAfterCursor = /\w/.test(nextCharacter)
     hasWordBeforeCursor = /\w/.test(previousCharacter)
     hasQuoteBeforeCursor = previousCharacter is text[0]
+    hasEscapeSequenceBeforeCursor = previousCharacter is '\\' or prepreviousCharacter is '\\'

-    autoCompleteOpeningBracket = atom.config.get('bracket-matcher.autocompleteBrackets') and @isOpeningBracket(text) and not hasWordAfterCursor and not (@isQuote(text) and (hasWordBeforeCursor or hasQuoteBeforeCursor))
+    autoCompleteOpeningBracket = atom.config.get('bracket-matcher.autocompleteBrackets') and @isOpeningBracket(text) and not hasWordAfterCursor and not (@isQuote(text) and (hasWordBeforeCursor or hasQuoteBeforeCursor)) and not hasEscapeSequenceBeforeCursor
     skipOverExistingClosingBracket = false
     if @isClosingBracket(text) and nextCharacter == text
       if bracketMarker = _.find(@bracketMarkers, (marker) => marker.isValid() and marker.getBufferRange().end.isEqual(cursorBufferPosition))


Add deprected warnings to old options

Add deprected warnings to old options

--- lib/convert-options.coffee
+++ lib/convert-options.coffee
@@ -1,4 +1,9 @@
 mozilla = require('source-map')
+
+deprected = (from, to) ->
+  console.warn(
+    "Option #{ from } is deprected and will be deleted in PostCSS 1.1.\n" +
+    "Use map: { #{ to } } instead.")

 module.exports = (old) ->
   opts = { }
@@ -10,22 +15,29 @@
       if value == 'inline'
         map.inline = true
       else if typeof(value) == 'string'
+        deprected('map: prevMap', 'prev: prevMap')
         map.prev = value
       else if value instanceof mozilla.SourceMapConsumer
+        deprected('map: prevMap', 'prev: prevMap')
         map.prev = value
       else if value instanceof mozilla.SourceMapGenerator
+        deprected('map: prevMap', 'prev: prevMap')
         map.prev = value
       else if typeof(value) == 'object' and value.mappings?
+        deprected('map: prevMap', 'prev: prevMap')
         map.prev = value
       else if typeof(value) == 'object' or typeof(value) == 'boolean'
         opts.map = value
       else
+        deprected('map: prevMap', 'prev: prevMap')
         map.prev = value

     else if name == 'mapAnnotation'
+      deprected("mapAnnotation", "annotation: #{value}")
       map.annotation = value

     else if name == 'inlineMap'
+      deprected("inlineMap", "inline: #{value}")
       map.inline = value

     else


Added Martin005

Added Martin005

--- app/views/contribute/DiplomatView.coffee
+++ app/views/contribute/DiplomatView.coffee
@@ -113,7 +113,7 @@
     'nl-BE': ['Glen De Cauwsemaecker', 'Ruben Vereecken']        # Nederlands (België), Dutch (Belgium)
     'nl-NL': ['Jasper D\'haene', 'Guido Zuidhof']        # Nederlands (Nederland), Dutch (Netherlands)
     fa: ['Reza Habibi (Rehb)']             # فارسی, Persian
-    cs: ['vanous']             # čeština, Czech
+    cs: ['vanous', 'Martin005']             # čeština, Czech
     sv: ['iamhj']             # Svenska, Swedish
     id: ['mlewisno-oberlin']             # Bahasa Indonesia, Indonesian
     el: ['Stergios']             # ελληνικά, Greek


Removed unnecessary function wrapping

Removed unnecessary function wrapping

I am impressed this even worked.

--- vendor/assets/javascripts/twitter/bootstrap/rails/confirm.coffee
+++ vendor/assets/javascripts/twitter/bootstrap/rails/confirm.coffee
@@ -33,7 +33,7 @@
     .end()

     .find(".modal-footer")
-      .append( ->
+      .append(
         $("<a />", {href: "#", "data-dismiss": "modal"})
           .html(element.data("confirm-cancel") || $.fn.twitter_bootstrap_confirmbox.defaults.cancel)
           .addClass($.fn.twitter_bootstrap_confirmbox.defaults.cancel_class)


:lipstick:

:lipstick:

--- src/atom/buffer.coffee
+++ src/atom/buffer.coffee
@@ -32,8 +32,8 @@
   getLines: ->
     @lines

-  getLine: (n) ->
-    @lines[n]
+  getLine: (row) ->
+    @lines[row]

   change: (preRange, string) ->
     @remove(preRange)


Remove unneeded ?

Remove unneeded ?

--- lib/autosave.coffee
+++ lib/autosave.coffee
@@ -41,7 +41,7 @@
     if pane?
       pane.saveItem(paneItem)
     else
-      paneItem?.save?()
+      paneItem.save?()

   autosaveAllPaneItems: ->
     @autosavePaneItem(paneItem) for paneItem in atom.workspace.getPaneItems()


Fixes #81. Beautify on Save now retains `this` scope when beautifying

Bug created when developing issue #56.

--- lib/beautify.coffee
+++ lib/beautify.coffee
@@ -123,7 +123,7 @@
   PlainMessageView ?= require('atom-message-panel').PlainMessageView
   LoadingView ?= require "./loading-view"
   @messagePanel ?= new MessagePanelView title: 'Atom Beautify'
-  @messagePanel.attach();
+  @messagePanel.attach() ;
   @loadingView ?= new LoadingView()
   @loadingView.show()
   forceEntireFile = atom.config.get("atom-beautify.beautifyEntireFileOnSave")
@@ -232,16 +232,16 @@
     @messagePanel.add(new PlainMessageView({
       message: e.message,
       className: 'text-error'
-    }));
+    } )) ;
   return

-handleSaveEvent = ->
-  atom.workspace.eachEditor (editor) ->
+handleSaveEvent = =>
+  atom.workspace.eachEditor (editor) =>
     buffer = editor.getBuffer()
     plugin.unsubscribe buffer
     if atom.config.get("atom-beautify.beautifyOnSave")
       events = "will-be-saved"
-      plugin.subscribe buffer, events, beautify
+      plugin.subscribe buffer, events, beautify.bind(@)
     return
   return


forgot zscore and zrank for the getters

forgot zscore and zrank for the getters

--- lib/commands.coffee
+++ lib/commands.coffee
@@ -53,7 +53,9 @@
 		'zrange',
 		'zrangebyscore',
 		'zrevrange',
-		'zrevrangebyscore'
+		'zrevrangebyscore',
+		'zscore',
+		'zrank',

 		# Hash
 		'hget',


Add comments to clientside code

Add comments to clientside code

--- app/assets/javascripts/backbone/views/tree_view.js.coffee
+++ app/assets/javascripts/backbone/views/tree_view.js.coffee
@@ -1,14 +1,24 @@
 class Water.TreeView extends Backbone.View
   initialize: () ->
+    # Bind to events in the model
     @model.on("change:data", @render_tree)
     @model.on("start_fetch", @render_loading)
+
+  # Re-renders the tree whenever the data in the model changes
+  render_tree: () =>
+    # Hide the activity indicator
+    $("#indicator").hide()

-  render_tree: () =>
-    $("#indicator").hide()
+    # Hide the tree-view in preparation for fade-in
     @$el.hide()
+
+    # Populate the tree-view with the new data
     @$el.html @model.get("data")
+
+    # Show the tree-view again
     @$el.fadeIn("slow")

+  # Render a loading-indicator during the fetch process
   render_loading: () =>
     loading_indicator = $("<div />").attr("class", "indicator")
     @$el.html(loading_indicator)


Remove gallery representations from artist page

--- apps/artist/client/views/overview.coffee
+++ apps/artist/client/views/overview.coffee
@@ -6,7 +6,6 @@
 Sticky = require '../../../../components/sticky/index.coffee'
 # Sub-header
 RelatedGenesView = require '../../../../components/related_links/types/artist_genes.coffee'
-RelatedRepresentationsGenesView = require '../../../../components/related_links/types/artist_representations.coffee'
 # Main section
 ArtworkFilter = require '../../../../components/artwork_filter/index.coffee'
 # Bottom sections
@@ -22,10 +21,6 @@

   initialize: ({ @user }) ->
     @sticky = new Sticky
-
-  setupSubHeader: ->
-    @setupRelatedGenes()
-    @setupRelatedRepresentations()

   setupArtworkFilter: ->
     filterRouter = ArtworkFilter.init el: @$('#artwork-section'), model: @model
@@ -53,9 +48,6 @@
     subView = new RelatedGenesView(el: @$('.artist-related-genes'), id: @model.id)
     subView.collection.on 'sync', -> mediator.trigger 'related:genes:render'
     @subViews.push subView
-
-  setupRelatedRepresentations: ->
-    @subViews.push new RelatedRepresentationsGenesView(el: @$('.artist-related-representations'), id: @model.id)

   setupRelatedSection: ($el) ->
     $section = @fadeInSection $el
@@ -103,7 +95,7 @@

   postRender: ->
     # Sub-header
-    @setupSubHeader()
+    @setupRelatedGenes()
     # Main section
     @setupArtworkFilter()
     # Bottom sections


Update the order of the label & placeholder in the form validation

--- app/assets/javascripts/lib/forms/form_validator.js.coffee
+++ app/assets/javascripts/lib/forms/form_validator.js.coffee
@@ -37,10 +37,11 @@

     _getLabel: (formField) ->
       $formField = $(formField)
-      if $formField.attr('placeholder')
+      $label = $formField.closest('.js-field').find('.js-field-label').text()
+      if $label
+        return $label
+      else
         return $formField.attr('placeholder')
-      else
-        return $formField.closest('.js-field').find('.js-field-label').text()

     isValid: (triggerErrors, byPassEl) ->
       valid = true


Consistent naming for tag fields

Consistent naming for tag fields

--- app/config.coffee
+++ app/config.coffee
@@ -20,10 +20,10 @@
         required: true
         subtasks: [{
           label: 'Related health issue or hazard'
-          value: 'how'
+          value: 'hazard'
         },{
           label: 'People affected'
-          value: 'who'
+          value: 'people'
         },{
           label: 'The cause of the problem'
           value: 'cause'
@@ -40,14 +40,14 @@
       description: 'The medical officer inspected the health impact of London’s trades and industries. From reporting on the working conditions of homeworkers to the effects of tanneries and factories on their surroundings, they had the power to issue fines for breaking local by-laws and public health laws.'
       tools: [{
         label: 'Type of work'
-        value: 'type'
+        value: 'issue'
         required: true
         subtasks: [{
           label: 'Related health issue or hazard'
-          value: 'issue'
+          value: 'hazard'
         },{
           label: 'People affected'
-          value: 'who'
+          value: 'people'
         },{
           label: 'The cause of the problem'
           value: 'cause'
@@ -88,14 +88,14 @@
       description: 'The medical officer inspected all aspects of the city’s food supply, from food importers and manufacturers to abattoirs, from butchers and bakers shops to street vendors. He was particularly concerned with food adulteration – identifying hidden substances that shouldn’t be there – and incidents of food poisoning.'
       tools: [{
         label: 'Type of food or drink'
-        value: 'food'
+        value: 'issue'
         required: true
         subtasks: [{
           label: 'Related health issue or hazard'
-          value: 'issue'
+          value: 'hazard'
         },{
           label: 'People affected'
-          value: 'who'
+          value: 'people'
         },{
           label: 'The cause of the problem'
           value: 'cause'
@@ -112,14 +112,14 @@
       description: 'Much of the information about housing in the reports is about the living conditions of London’s poor. The medical officers reported on overcrowded slums and the results of poor construction such as leaking sewers, poor ventilation and lack of sunlight due to closely packed houses. They recommended measures such as fumigation after infestations and cleaning after disease outbreaks.'
       tools: [{
         label: 'Housing problem'
-        value: 'type'
+        value: 'issue'
         required: true
         subtasks: [{
           label: 'Related health issue or hazard'
-          value: 'issue'
+          value: 'hazard'
         },{
           label: 'People affected'
-          value: 'who'
+          value: 'people'
         },{
           label: 'The cause of the problem'
           value: 'cause'


Port install API call to conda-js

Port install API call to conda-js

--- conda_ui/static/conda_ui/plan_modal.coffee
+++ conda_ui/static/conda_ui/plan_modal.coffee
@@ -103,10 +103,12 @@

         on_submit: (event) =>
             env = @envs.get_active()
-            api("env/#{env.get('name')}/install", {specs: [@pkg.get('name')]}, @on_install)
+            env.attributes.install({
+                packages: [@pkg.get('name')]
+            }).then @on_install

         on_install: (data) =>
-            if data.ok
+            if data.success? and data.success
                 new Dialog.View({type: "info", message: "#{@pkg.get('name')} was successfully installed"}).show()
             else
                 new Dialog.View({type: "error", message: data.error}).show()


Disable auto scroll in message view

Disable auto scroll in message view

--- client/app/components/message.coffee
+++ client/app/components/message.coffee
@@ -470,8 +470,8 @@
         else
             window.cozyMails.customEvent "MESSAGE_LOADED", @props.messageID

-        if @refs.content? and not @props.composing
-            @refs.content.getDOMNode().scrollIntoView()
+        # if @refs.content? and not @props.composing
+        #     @refs.content.getDOMNode().scrollIntoView()

     componentDidMount: ->


add original format to select

add original format to select

--- MediaAdminBundle/Resources/public/coffee/WysiwygSelectView.coffee
+++ MediaAdminBundle/Resources/public/coffee/WysiwygSelectView.coffee
@@ -19,6 +19,7 @@
       src: @options.thumbnails["original"]
     ))
     @options.domContainer.html @$el
+    $("option", "#media_crop_format").first().val("original")

   changeCropFormat: (event) ->
     format = $(event.currentTarget).val()


Fix data lost just after connection

Fix data lost just after connection

--- src/board/wakayamarbboard.coffee
+++ src/board/wakayamarbboard.coffee
@@ -364,6 +364,9 @@
       return new Promise((resolve, reject) =>
         @_waiter = {token: token, length: length, resolve: resolve, reject: reject}
         @_receiveHandler(null)
+      ).then((ab) =>
+        App.log.verbose("WakayamaRbBoard#found(%o, %i bytes)", ab, ab.byteLength)
+        return ab
       )
     ) # return Promise.resolve().then()...

@@ -400,12 +403,12 @@
     Received data
   ###
   _receiveHandler: (ab) ->
+    @_recvBuffer or= new FifoBuffer()
     if ab?.byteLength > 0
       do (ab) ->
         pro = null
         Object.defineProperty(ab, "ab2str", get: -> pro or= ab2str(ab))
         App.log.verbose("WakayamaRbBoard#_recv(%o, %i bytes)", ab, ab.byteLength)
-      @_recvBuffer or= new FifoBuffer()
       @_recvBuffer.push(ab)
     tlen = @_waiter?.length
     if tlen?


html fix on title

html fix on title

--- lib/eslogger.coffee
+++ lib/eslogger.coffee
@@ -248,18 +248,18 @@
         content += "
#{time} #{escape line._source.nick}: "
         content += "#{@escape line._source.message}
"
       else
-        content += "
#{time} -: "
+        content += "
#{time}  : "
         content += "#{@escape line._source.message}
"
     content += '
'
     content += @foot_html()
     content

-  html_head: (title) ->
+  html_head: (room) ->
     """

       <meta charset="utf-8" />
-      <title>#{title}</title>
+      <title>Irc Logs for #{room}</title>

-
#{title}

+
Irc Logs for #{room}

     """

   foot_html: ->


window title for landing page

window title for landing page

Former-commit-id: 4934a0cac70273b9f0b309d896eca7f3e98ea4c7 [formerly cdf4f8e95ad11929278dc231b3c8a0ca16fde383] [formerly b428bca4e6e6649f13dda9a575bba510fb383cfd [formerly 02a03a0f90bee0068439ed954a98768161e6bf72]] [formerly ee2e0e9e491b090231482821eca93c29f9ed2ef1 [formerly bf24a0d335e95085a0d2f6d503ad78247eb58a3d] [formerly e50ec1fa19240eca5bc7d77d9cd3cf89f2273ec9 [formerly e50ec1fa19240eca5bc7d77d9cd3cf89f2273ec9 [formerly e841b9d89fe122c1192fd851abe97018c88fd247]]]]
Former-commit-id: cd14b520158687dae84746f564dca6fde7a10626 [formerly 88f75c975c7f94b1ae840ab7cab0eeb3214608d2] [formerly e051317cf4a531ad22bfae1c4a610a0fd9c8dda3 [formerly 65002e5a753696d9fbe2f348e13eda3f3ee779eb]]
Former-commit-id: a0dc3cc38d881e2ccdc4bf35f401256cc840fc8e [formerly 49ef7a65e12ec7ec5b169a0e3ff46deccfc0feaf]
Former-commit-id: 1db2fbef5f33bc39aa9c08a782361fa8ea0b540d
Former-commit-id: e3a29610607f3341e5377caa83c67340059cb395

--- @client/saas_landing_page.coffee
+++ @client/saas_landing_page.coffee
@@ -634,7 +634,7 @@
       ". Or we can reach out to you:"

       FORM
-        action: "http://chalkboard.us7.list-manage1.com/subscribe/post?u=9cc354a37a52e695df7b580bd&id=d4b6766b00"
+        action: "//chalkboard.us7.list-manage1.com/subscribe/post?u=9cc354a37a52e695df7b580bd&id=d4b6766b00"
         id: "mc-embedded-subscribe-form"
         method: "post"
         name: "mc-embedded-subscribe-form"
@@ -859,19 +859,19 @@
         A
           style: story_link
           href: 'http://dub.washington.edu/djangosite/media/papers/tmpZ77p1r.pdf'
-          'collaborated together'
+          'collaborate together'
         ' and '
         A
           style: story_link
           href: 'http://www.aaai.org/Papers/ICWSM/2008/ICWSM08-011.pdf'
-          'mediated'
+          'mediate'
         ' '
         A
           style: story_link
           href: 'https://www.cs.ubc.ca/~bestchai/papers/group07.pdf'
           'conflict'

-        '. Travis was feeling ready to channel this knowledge into invention.'
+        '. Travis was ready to channel this knowledge into invention.'

@@ -1310,6 +1310,12 @@
   render: ->
     loc = fetch 'location'
     app = fetch '/application'
+    doc = fetch 'document'
+
+    title = 'Consider.it | Think better together'
+    if doc.title != title
+      doc.title = title
+      save doc

     DIV null,
       BrowserLocation()


minor bug in Function::memoize's local `every` function

--- Source/FunctionalJS.coffee
+++ Source/FunctionalJS.coffee
@@ -195,7 +195,7 @@
 				else [_]
 			every = Array::every or (fn) ->
 				for el, i in @
-					return false unless fn.call @, el, i, iterable
+					return false unless fn.call @, el, i, @
 				true
 			# used to check if arguments/contexts are functionally equivalent
 			equalityCheck = (a, b) ->