some cleanup

some cleanup

--- lib/compiler.coffee
+++ lib/compiler.coffee
@@ -68,16 +68,15 @@
                 @literalInitializationFunction = @module.getOrInsertFunction "_ejs_module_init_string_literals_#{@filename}", types.void, []

                 # initialize the scope stack with the global (empty) scope
-                @scope_stack = new Stack
-                @scope_stack.push Object.create null
+                @scope_stack = new Stack Object.create null

                 entry_bb = new llvm.BasicBlock "entry", @literalInitializationFunction
                 return_bb = new llvm.BasicBlock "return", @literalInitializationFunction

-                @doInsideBlock entry_bb, =>
+                @doInsideBBlock entry_bb, =>
                         ir.createBr return_bb

-                @doInsideBlock return_bb, =>
+                @doInsideBBlock return_bb, =>
                         ir.createRetVoid()

                 @literalInitializationBB = entry_bb
@@ -88,7 +87,12 @@
         beginCatch: (result) -> ir.createCall @ejs_runtime.begin_catch, [(ir.createPointerCast result, types.int8Pointer, "")], "catchval"
         endCatch:            -> ir.createCall @ejs_runtime.end_catch, [], "endcatch"

-        doInsideBlock: (b, f) ->
+        doInsideExitableScope: (scope, f) ->
+                scope.enter()
+                f()
+                scope.leave()
+
+        doInsideBBlock: (b, f) ->
                 saved = ir.getInsertBlock()
                 ir.setInsertPoint b
                 f()
@@ -103,7 +107,6 @@
                         boolval = (consts.int64_lowhi 0xfff98000, if n then 0x00000001 else 0x000000000)
                 else
                         boolval = @createLoad (if n then @ejs_runtime['true'] else @ejs_runtime['false']), "load_bool"
-                        boolval.is_constant = true
                         boolval.constant_val = n
                 boolval

@@ -112,7 +115,6 @@
                         nullval = (consts.int64_lowhi 0xfffb8000, 0x00000000)
                 else
                         nullval = @createLoad @ejs_runtime['null'], "load_null"
-                        nullval.is_constant = true
                         nullval.constant_val = null
                 nullval

@@ -121,7 +123,6 @@
                         undef = (consts.int64_lowhi 0xfff90000, 0x00000000)
                 else
                         undef = @createLoad @ejs_runtime.undefined, "load_undefined"
-                        undef.is_constant = true
                         undef.constant_val = undefined
                 undef

@@ -292,49 +293,45 @@

                 case_checks.push dest_check: if defaultCase? then defaultCase.bb else merge_bb

-                scope = new SwitchExitableScope merge_bb
-                scope.enter()
-
-                # insert all the code for the tests
-                ir.createBr case_checks[0].dest_check
-                ir.setInsertPoint case_checks[0].dest_check
-                for casenum in [0...case_checks.length-1]
-                        test = @visit case_checks[casenum].test
-                        eqop = @ejs_runtime["binop==="]
-                        discTest = @createCall eqop, [discr, test], "test", !eqop.doesNotThrow
-
-                        if discTest._ejs_returns_ejsval_bool
-                                disc_cmp = ir.createICmpEq discTest, (@loadBoolEjsValue false), "disc_result"
-                        else
-                                disc_truthy = @createCall @ejs_runtime.truthy, [exp_value], "disc_truthy"
-                                disc_cmp = ir.createICmpEq cond_truthy, consts.false(), "disccmpresult"
-                        ir.createCondBr disc_cmp, case_checks[casenum+1].dest_check, case_checks[casenum].body
-                        ir.setInsertPoint case_checks[casenum+1].dest_check
-
-
-                case_bodies = []
-
-                # now insert all the code for the case consequents
-                for _case in n.cases
-                        case_bodies.push bb:_case.bb, consequent:_case.consequent
-
-                case_bodies.push bb:merge_bb
-
-                for casenum in [0...case_bodies.length-1]
-                        ir.setInsertPoint case_bodies[casenum].bb
-                        for c of case_bodies[casenum].consequent
-                                @visit case_bodies[casenum].consequent[c]
-                        ir.createBr case_bodies[casenum+1].bb
-
-                ir.setInsertPoint merge_bb
-
-                scope.leave()
+                @doInsideExitableScope (new SwitchExitableScope merge_bb), =>
+
+                        # insert all the code for the tests
+                        ir.createBr case_checks[0].dest_check
+                        ir.setInsertPoint case_checks[0].dest_check
+                        for casenum in [0...case_checks.length-1]
+                                test = @visit case_checks[casenum].test
+                                eqop = @ejs_runtime["binop==="]
+                                discTest = @createCall eqop, [discr, test], "test", !eqop.doesNotThrow
+
+                                if discTest._ejs_returns_ejsval_bool
+                                        disc_cmp = ir.createICmpEq discTest, (@loadBoolEjsValue false), "disc_result"
+                                else
+                                        disc_truthy = @createCall @ejs_runtime.truthy, [exp_value], "disc_truthy"
+                                        disc_cmp = ir.createICmpEq cond_truthy, consts.false(), "disccmpresult"
+                                ir.createCondBr disc_cmp, case_checks[casenum+1].dest_check, case_checks[casenum].body
+                                ir.setInsertPoint case_checks[casenum+1].dest_check
+
+
+                        case_bodies = []
+
+                        # now insert all the code for the case consequents
+                        for _case in n.cases
+                                case_bodies.push bb:_case.bb, consequent:_case.consequent
+
+                        case_bodies.push bb:merge_bb
+
+                        for casenum in [0...case_bodies.length-1]
+                                ir.setInsertPoint case_bodies[casenum].bb
+                                for c of case_bodies[casenum].consequent
+                                        @visit case_bodies[casenum].consequent[c]
+                                ir.createBr case_bodies[casenum+1].bb
+
+                        ir.setInsertPoint merge_bb

                 merge_bb

         visitCase: (n) ->
                 throw "we shouldn't get here, case statements are handled in visitSwitch"
-

         visitLabeledStatement: (n) ->
                 n.body.label = n.label.name
@@ -360,36 +357,32 @@
                 insertBlock = ir.getInsertBlock()
                 insertFunc = insertBlock.parent

-                init_bb = new llvm.BasicBlock "for_init", insertFunc
-                test_bb = new llvm.BasicBlock "for_test", insertFunc
-                body_bb = new llvm.BasicBlock "for_body", insertFunc
+                init_bb   = new llvm.BasicBlock "for_init",   insertFunc
+                test_bb   = new llvm.BasicBlock "for_test",   insertFunc
+                body_bb   = new llvm.BasicBlock "for_body",   insertFunc
                 update_bb = new llvm.BasicBlock "for_update", insertFunc
-                merge_bb = new llvm.BasicBlock "for_merge", insertFunc
+                merge_bb  = new llvm.BasicBlock "for_merge",  insertFunc

                 ir.createBr init_bb

-                @doInsideBlock init_bb, =>
+                @doInsideBBlock init_bb, =>
                         @visit n.init
                         ir.createBr test_bb

-                @doInsideBlock test_bb, =>
+                @doInsideBBlock test_bb, =>
                         if n.test
                                 @generateCondBr n.test, body_bb, merge_bb
                         else
                                 ir.createBr body_bb

-                scope = new LoopExitableScope n.label, update_bb, merge_bb
-                scope.enter()
-
-                @doInsideBlock body_bb, =>
-                        @visit n.body
-                        ir.createBr update_bb
-
-                @doInsideBlock update_bb, =>
-                        @visit n.update
-                        ir.createBr test_bb
-
-                scope.leave()
+                @doInsideExitableScope (new LoopExitableScope n.label, update_bb, merge_bb), =>
+                        @doInsideBBlock body_bb, =>
+                                @visit n.body
+                                ir.createBr update_bb
+
+                        @doInsideBBlock update_bb, =>
+                                @visit n.update
+                                ir.createBr test_bb

                 ir.setInsertPoint merge_bb
                 merge_bb
@@ -403,14 +396,10 @@

                 ir.createBr body_bb

-                scope = new LoopExitableScope n.label, body_bb, merge_bb
-                scope.enter()
-
-                @doInsideBlock body_bb, =>
-                        @visit n.body
-                        @generateCondBr n.test, body_bb, merge_bb
-
-                scope.leave()
+                @doInsideExitableScope (new LoopExitableScope n.label, body_bb, merge_bb), =>
+                        @doInsideBBlock body_bb, =>
+                                @visit n.body
+                                @generateCondBr n.test, body_bb, merge_bb

                 ir.setInsertPoint merge_bb
                 merge_bb
@@ -426,17 +415,13 @@

                 ir.createBr while_bb

-                @doInsideBlock while_bb, =>
+                @doInsideBBlock while_bb, =>
                         @generateCondBr n.test, body_bb, merge_bb

-                scope = new LoopExitableScope n.label, while_bb, merge_bb
-                scope.enter()
-
-                @doInsideBlock body_bb, =>
-                        @visit n.body
-                        ir.createBr while_bb
-
-                scope.leave()
+                @doInsideExitableScope (new LoopExitableScope n.label, while_bb, merge_bb), =>
+                        @doInsideBBlock body_bb, =>
+                                @visit n.body
+                                ir.createBr while_bb

                 ir.setInsertPoint merge_bb
                 merge_bb
@@ -460,22 +445,32 @@

                 ir.createBr forin_bb

-                scope = new LoopExitableScope n.label, forin_bb, merge_bb
-                scope.enter()
-
-                @doInsideBlock forin_bb, =>
-                        moreleft = @createCall @ejs_runtime.prop_iterator_next, [iterator, consts.true()], "moreleft"
-                        cmp = ir.createICmpEq moreleft, consts.false(), "cmpmoreleft"
-                        ir.createCondBr cmp, merge_bb, body_bb
-
-                @doInsideBlock body_bb, =>
-                        current = @createCall @ejs_runtime.prop_iterator_current, [iterator], "iterator_current"
-                        @storeValueInDest current, lhs
-                        @visit n.body
-                        ir.createBr forin_bb
-
-                scope.leave()
-
+                @doInsideExitableScope (new LoopExitableScope n.label, forin_bb, merge_bb), =>
+                        # forin_bb:
+                        #     moreleft = prop_iterator_next (iterator, true)
+                        #     if moreleft === false
+                        #         goto merge_bb
+                        #     else
+                        #         goto body_bb
+                        #
+                        @doInsideBBlock forin_bb, =>
+                                moreleft = @createCall @ejs_runtime.prop_iterator_next, [iterator, consts.true()], "moreleft"
+                                cmp = ir.createICmpEq moreleft, consts.false(), "cmpmoreleft"
+                                ir.createCondBr cmp, merge_bb, body_bb
+
+                        # body_bb:
+                        #     current = prop_iteratorcurrent (iterator)
+                        #     *lhs = current
+                        #      <body>
+                        #     goto forin_bb
+                        @doInsideBBlock body_bb, =>
+                                current = @createCall @ejs_runtime.prop_iterator_current, [iterator], "iterator_current"
+                                @storeValueInDest current, lhs
+                                @visit n.body
+                                ir.createBr forin_bb
+
+                # merge_bb:
+                #
                 ir.setInsertPoint merge_bb
                 merge_bb

@@ -526,13 +521,13 @@

                 @generateCondBr n.test, then_bb, (if else_bb? then else_bb else merge_bb)

-                @doInsideBlock then_bb, =>
+                @doInsideBBlock then_bb, =>
                         then_val = @visit n.consequent
                         ir.createStore then_val, cond_val if load_result
                         ir.createBr merge_bb

                 if n.alternate?
-                        @doInsideBlock else_bb, =>
+                        @doInsideBBlock else_bb, =>
                                 else_val = @visit n.alternate
                                 ir.createStore else_val, cond_val if load_result
                                 ir.createBr merge_bb
@@ -842,21 +837,19 @@
                 callee = @ejs_runtime[builtin]

                 if n.operator is "delete"
-                        if n.argument.type is syntax.MemberExpression
-                                fake_literal =
-                                        type: syntax.Literal
-                                        value: n.argument.property.name
-                                        raw: "'#{n.argument.property.name}'"
-                                return @createCall callee, [(@visitOrNull n.argument.object), (@visit fake_literal)], "result"
-                        else
-                                throw "unhandled delete syntax"
+                        throw "unhandled delete syntax" if n.argument.type isnt syntax.MemberExpression
+
+                        fake_literal =
+                                type: syntax.Literal
+                                value: n.argument.property.name
+                                raw: "'#{n.argument.property.name}'"
+                        return @createCall callee, [(@visitOrNull n.argument.object), (@visit fake_literal)], "result"
+
                 else if n.operator is "!"
                         arg_value =  @visitOrNull n.argument
                         if opencode_intrinsics and @options.target_pointer_size is 64 and arg_value._ejs_returns_ejsval_bool
                                 cmp = ir.createICmpEq arg_value, (@loadBoolEjsValue true), "cmpresult"
-                                t = @loadBoolEjsValue true
-                                f = @loadBoolEjsValue false
-                                rv = ir.createSelect cmp, f, t, "sel"
+                                rv = ir.createSelect cmp, (@loadBoolEjsValue false), (@loadBoolEjsValue true), "sel"
                                 rv._ejs_returns_ejsval_bool = true
                                 rv
                         else
@@ -886,9 +879,6 @@
                 right_alloca = @createAlloca @currentFunction, types.EjsValue, "binop_right"
                 right_visited = @visit n.right
                 ir.createStore right_visited, right_alloca
-
-                if n.left.is_constant? and n.right.is_constant?
-                        console.warn "we could totally evaluate this at compile time, yo"

                 if @options.record_types
                         @createCall @ejs_runtime.record_binop, [(consts.int32 @genRecordId()), (consts.string ir, n.operator), (@createLoad left_alloca, "binop_left_load"), (@createLoad right_alloca, "binop_right_load")], ""
@@ -910,7 +900,7 @@
                 # we invert the test here - check if the condition is false/0
                 left_visited = @generateCondBr n.left, left_bb, right_bb

-                @doInsideBlock left_bb, =>
+                @doInsideBBlock left_bb, =>
                         # inside the else branch, left was truthy
                         if n.operator is "||"
                                 # for || we short circuit out here
@@ -922,7 +912,7 @@
                                 throw "Internal error 99.1"
                         ir.createBr merge_bb

-                @doInsideBlock right_bb, =>
+                @doInsideBBlock right_bb, =>
                         # inside the then branch, left was falsy
                         if n.operator is "||"
                                 # for || we evaluate the second and store it
@@ -1163,7 +1153,7 @@
                                 num_alloca = @currentFunction.literalAllocas[literal_key]
                         else
                                 # only create 1 instance of num literals used in a function, and allocate them in the entry block
-                                @doInsideBlock @currentFunction.entry_bb, =>
+                                @doInsideBBlock @currentFunction.entry_bb, =>
                                         num_alloca = ir.createAlloca types.EjsValue, "num-alloca-#{n.value}"
                                         c = llvm.ConstantFP.getDouble n.value
                                         if opencode_intrinsics and @options.target_pointer_size is 64
@@ -1234,17 +1224,14 @@
                         branch_target = merge_block

                 scope = new TryExitableScope @currentFunction.cleanup_reason, branch_target, (-> new llvm.BasicBlock "exception", insertFunc), finally_block?
-                scope.enter()
-
-                @visit n.block
-
-                if n.finalizer?
-                        @finallyStack.shift()
-
-                # at the end of the try block branch to our branch_target (either the finally block or the merge block after the try{}) with REASON_FALLOFF
-                scope.exitAft false
-
-                scope.leave()
+                @doInsideExitableScope scope, =>
+                        @visit n.block
+
+                        if n.finalizer?
+                                @finallyStack.shift()
+
+                        # at the end of the try block branch to our branch_target (either the finally block or the merge block after the try{}) with REASON_FALLOFF
+                        scope.exitAft false

                 if scope.landing_pad_block? and n.handlers.length > 0
                         catch_block = new llvm.BasicBlock "catch_bb", insertFunc
@@ -1254,7 +1241,7 @@
                         # the scope's landingpad block is created if needed by @createCall (using that function we pass in as the last argument to TryExitableScope's ctor.)
                         # if a try block includes no calls, there's no need for an landing pad block as nothing can throw, and we don't bother generating any code for the
                         # catch clause.
-                        @doInsideBlock scope.landing_pad_block, =>
+                        @doInsideBBlock scope.landing_pad_block, =>

                                 landing_pad_type = llvm.StructType.create "", [types.int8Pointer, types.int32]
                                 # XXX is it an error to have multiple catch handlers, as JS doesn't allow you to filter by type?
@@ -1276,7 +1263,7 @@

                                 # if we have a catch clause, create catch_bb
                                 if n.handlers.length > 0
-                                        @doInsideBlock catch_block, =>
+                                        @doInsideBBlock catch_block, =>
                                                 # call _ejs_begin_catch to return the actual exception
                                                 catchval = @beginCatch exception

@@ -1300,20 +1287,20 @@
                                 ###
                                 # Unwind Resume Block (calls _Unwind_Resume)
                                 unwind_resume_block = new llvm.BasicBlock "unwind_resume", insertFunc
-                                @doInsideBlock unwind_resume_block, =>
+                                @doInsideBBlock unwind_resume_block, =>
                                         ir.createResume caught_result
                                 ###

                 # Finally Block
                 if n.finalizer?
-                        @doInsideBlock finally_block, =>
+                        @doInsideBBlock finally_block, =>
                                 @visit n.finalizer

                                 cleanup_reason = @createLoad @currentFunction.cleanup_reason, "cleanup_reason_load"

                                 if @returnValueAlloca?
                                         return_tramp = new llvm.BasicBlock "return_tramp", insertFunc
-                                        @doInsideBlock return_tramp, =>
+                                        @doInsideBBlock return_tramp, =>

                                                 if @finallyStack.length > 0
                                                         ir.createStore (consts.int32 ExitableScope.REASON_RETURN), @currentFunction.cleanup_reason
@@ -1327,14 +1314,14 @@
                                         switch_stmt.addCase (consts.int32 ExitableScope.REASON_RETURN), return_tramp

                                 falloff_tramp = new llvm.BasicBlock "falloff_tramp", insertFunc
-                                @doInsideBlock falloff_tramp, =>
+                                @doInsideBBlock falloff_tramp, =>
                                         ir.createBr merge_block
                                 switch_stmt.addCase (consts.int32 TryExitableScope.REASON_FALLOFF_TRY), falloff_tramp

                                 for s in [0...scope.destinations.length]
                                         dest_tramp = new llvm.BasicBlock "dest_tramp", insertFunc
                                         dest = scope.destinations[s]
-                                        @doInsideBlock dest_tramp, =>
+                                        @doInsideBBlock dest_tramp, =>
                                                 if dest.reason == TryExitableScope.REASON_BREAK
                                                         dest.scope.exitAft true
                                                 else if dest.reason == TryExitableScope.REASON_CONTINUE
@@ -1480,12 +1467,12 @@
                         cmp = ir.createICmpUGt candidate, (consts.int64_lowhi 0xfffbffff, 0xffffffff), "cmpresult"
                         ir.createCondBr cmp, candidate_is_object_bb, object_isnt_function_bb

-                        @doInsideBlock object_isnt_function_bb, =>
+                        @doInsideBBlock object_isnt_function_bb, =>
                                 # we have something other than a function, throw.
                                 @emitThrowNativeError 5, "object is not a function" # this '5' should be 'EJS_TYPE_ERROR'
                                 # unreachable

-                        @doInsideBlock candidate_is_object_bb, =>
+                        @doInsideBBlock candidate_is_object_bb, =>
                                 closure = @emitEjsvalTo argv[0], types.EjsObject.pointerTo(), "closure"

                                 specops_load = @emitLoadSpecops closure
@@ -1493,7 +1480,7 @@
                                 cmp = ir.createICmpEq specops_load, @ejs_runtime.function_specops, "function_specops_cmp"
                                 ir.createCondBr cmp, check_if_function_is_bound_bb, object_isnt_function_bb

-                                @doInsideBlock check_if_function_is_bound_bb, =>
+                                @doInsideBBlock check_if_function_is_bound_bb, =>

                                         # we know we have a function.  now we need to
                                         # check if it's bound.  if it's bound we defer
@@ -1506,13 +1493,13 @@
                                         cmp = ir.createICmpEq load_isbound, (consts.int32 0), "notbound?"
                                         ir.createCondBr cmp, direct_invoke_bb, runtime_invoke_bb

-                                        @doInsideBlock runtime_invoke_bb, =>
+                                        @doInsideBBlock runtime_invoke_bb, =>
                                                 calltmp = @createCall @ejs_runtime.invoke_closure, argv, "calltmp", true
                                                 ir.createStore calltmp, call_result
                                                 ir.createBr invoke_merge_bb

                                         # in the successful case we modify our argv with the responses and directly invoke the closure func
-                                        @doInsideBlock direct_invoke_bb, =>
+                                        @doInsideBBlock direct_invoke_bb, =>
                                                 func_load = @emitLoadEjsFunctionClosureFunc closure
                                                 env_load = @emitLoadEjsFunctionClosureEnv closure

@@ -1624,17 +1611,17 @@
                         cmp = ir.createICmpUGt candidate, (consts.int64_lowhi 0xfffbffff, 0xffffffff), "cmpresult"
                         ir.createCondBr cmp, is_object_bb, failure_bb

-                        @doInsideBlock is_object_bb, =>
+                        @doInsideBBlock is_object_bb, =>
                                 obj = @emitEjsvalTo candidate, types.EjsObject.pointerTo(), "obj"
                                 specops_load = @emitLoadSpecops obj
                                 cmp = ir.createICmpEq specops_load, @ejs_runtime.function_specops, "function_specops_cmp"
                                 ir.createCondBr cmp, success_bb, failure_bb

-                        @doInsideBlock success_bb, =>
+                        @doInsideBBlock success_bb, =>
                                 ir.createStore (@loadBoolEjsValue true), typeofIsFunction_alloca, "store_typeof"
                                 ir.createBr merge_bb

-                        @doInsideBlock failure_bb, =>
+                        @doInsideBBlock failure_bb, =>
                                 ir.createStore (@loadBoolEjsValue false), typeofIsFunction_alloca, "store_typeof"
                                 ir.createBr merge_bb

@@ -1662,17 +1649,17 @@
                         cmp = ir.createICmpUGt candidate, (consts.int64_lowhi 0xfffbffff, 0xffffffff), "cmpresult"
                         ir.createCondBr cmp, is_object_bb, failure_bb

-                        @doInsideBlock is_object_bb, =>
+                        @doInsideBBlock is_object_bb, =>
                                 obj = @emitEjsvalTo candidate, types.EjsObject.pointerTo(), "obj"
                                 specops_load = @emitLoadSpecops obj
                                 cmp = ir.createICmpEq specops_load, @ejs_runtime.symbol_specops, "symbol_specops_cmp"
                                 ir.createCondBr cmp, success_bb, failure_bb

-                        @doInsideBlock success_bb, =>
+                        @doInsideBBlock success_bb, =>
                                 ir.createStore (@loadBoolEjsValue true), typeofIsSymbol_alloca, "store_typeof"
                                 ir.createBr merge_bb

-                        @doInsideBlock failure_bb, =>
+                        @doInsideBBlock failure_bb, =>
                                 ir.createStore (@loadBoolEjsValue false), typeofIsSymbol_alloca, "store_typeof"
                                 ir.createBr merge_bb


fix missing variable

fix missing variable

--- colibri-imx6.coffee
+++ colibri-imx6.coffee
@@ -18,7 +18,7 @@
 	state: 'experimental'

 	stateInstructions:
-		postProvisioning:
+		postProvisioning: postProvisioningInstructions

 	instructions: [
 		instructions.WINDOWS_ETCHER_SD


Ensuring buttons still work after reset to default

--- sli/admin-tools/admin-rails/app/assets/javascripts/custom_roles.js.coffee
+++ sli/admin-tools/admin-rails/app/assets/javascripts/custom_roles.js.coffee
@@ -4,12 +4,6 @@

 jQuery ->
   populateTable(roles)
-
-  $("#custom_roles tr:gt(0)").mouseenter -> rowMouseEnter($(@))
-
-  $("#custom_roles tr").mouseleave ->
-    if (editRowIndex < 0)
-      $(".rowEditTool").hide()

   $(".rowEditTool").mouseenter ->
     $(".rowEditTool").show()
@@ -250,3 +244,10 @@
     for right in role.rights
       newRow.find("td:eq(2)").append(createLabel('right', right))
       newRow.find("td:eq(2)").append(" ")
+
+  $("#custom_roles tr:gt(0)").mouseenter -> rowMouseEnter($(@))
+
+  $("#custom_roles tr").mouseleave ->
+    if (editRowIndex < 0)
+      $(".rowEditTool").hide()
+


Fixed behat3 execution by removing --ansi parameter

--- lib/grammars.coffee
+++ lib/grammars.coffee
@@ -16,10 +16,10 @@
   'Behat Feature':
     "File Based":
       command: "behat"
-      args: (context) -> ['--ansi', context.filepath]
+      args: (context) -> [context.filepath]
     "Line Number Based":
       command: "behat"
-      args: (context) -> ['--ansi', context.fileColonLine()]
+      args: (context) -> [context.fileColonLine()]

   Batch:
     "File Based":


referral: fixed config object reference

referral: fixed config object reference

--- workers/social/lib/social/models/referrableemail.coffee
+++ workers/social/lib/social/models/referrableemail.coffee
@@ -54,7 +54,7 @@
     shareUrl  = "https://koding.com/R/#{@username}"
     email     = new JMail
       from    : 'hello@koding.com'
-      email   : KD.config.emailWorker.forcedRecipient or @email
+      email   : KONFIG.emailWorker.forcedRecipient or @email
       replyto : 'hello@koding.com'
       subject : "#{firstName} #{lastName} has invited you to try Koding!"
       content : """


Add a credit for AHRC funding

Add a credit for AHRC funding

--- content/about.coffee
+++ content/about.coffee
@@ -13,5 +13,7 @@

The ConSciCom project is investigating the role of naturalists and ‘amature’ science enthusiasts in the making and communication of science in both the Victorian period and today. Historians at the Universities of Leicester and Oxford are investigating the particular roles of the periodical press in the nineteenth century as an arena in which citizen scientists of the past participated in scientific research. Periodicals and books of the Victorian era were heavily illustrated, but little is know about who made the illustrations and how they ended up in print. The data you create by tagging illustrations and adding artist and engraver information will have a direct impact on the research of historians who are trying to figure out why, how often, and who made images depicting a whole range of natural sciences in the Victorian period.

Better understanding the range of individuals who made science through their images will help us ascertain what constituted a nineteenth century scientist and citizen scientist. This is the first Zooniverse project where citizen scientists are both the researchers and the subject of the research. Citizen scientists of today can have a direct impact on how we understand historical and modern notions of what it means to do science.

+
+
‘Science Gossip’ is funded by the Arts and Humanities Research Council (Science in Culture theme), as part of Constructing Scientific Communities.

       '''


WorkspaceModel: Use traits/slugifiable.

WorkspaceModel: Use traits/slugifiable.

--- workers/social/lib/social/models/workspace.coffee
+++ workers/social/lib/social/models/workspace.coffee
@@ -1,9 +1,9 @@
-{Inflector}  = require 'bongo'
-{Module}     = require 'jraphical'
+{Module} = require 'jraphical'

 module.exports = class JWorkspace extends Module

   KodingError  = require '../error'
+  {slugify}    = require '../traits/slugifiable'
   {signature, secure, ObjectId} = require 'bongo'

   @share()
@@ -30,7 +30,7 @@

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

     {name, slug, machineUId, rootPath, owner, layout, machineLabel} = data


Set an encoding to test in windows

Set an encoding to test in windows

--- lib/provider.coffee
+++ lib/provider.coffee
@@ -39,6 +39,7 @@
     proc = exec.spawn 'php', [__dirname + '/php/' + phpEx]
     proc.stdout.pipe process.stdout

+    proc.stdin.setEncoding('utf8')
     proc.stdin.write(editor.getText())
     proc.stdin.end()


Export ApiError

Export ApiError

Change-type: patch
Signed-off-by: Cameron Diver <1d572acbfa68c7c6e541c7b840d6b622e5c0dc91@balena.io>

--- lib/register.coffee
+++ lib/register.coffee
@@ -102,6 +102,6 @@
 		# Allow promise based and callback based styles
 		.asCallback(callback)

-class ApiError extends TypedError
+module.exports.ApiError = class ApiError extends TypedError
 	constructor: (message = 'Error with API request', @response) ->
 		super(@message)


remove cursor-line previous commit actually removed all cursors, no bueno.

--- lib/renderer.coffee
+++ lib/renderer.coffee
@@ -116,7 +116,8 @@
     preElement.remove()

     editor = editorElement.getModel()
-    editor.getCursor().destroy()
+    # remove the default selection of a line in each editor
+    editor.getDecorations(class: 'cursor-line', type: 'line')[0].destroy()
     editor.setText(codeBlock.textContent.trim())
     if grammar = atom.grammars.grammarForScopeName(scopeForFenceName(fenceName))
       editor.setGrammar(grammar)


Guard against null grammar

Guard against null grammar

Some pane items might have this method but always return a non-null value

Closes atom/atom#3602

--- lib/reporter.coffee
+++ lib/reporter.coffee
@@ -48,7 +48,7 @@
       params =
         t: 'appview'
         cd: @viewNameForPaneItem(item)
-        dt: item.getGrammar?().name
+        dt: item.getGrammar?()?.name
       @send(params)

     @send: (params) ->


Fix dragging on formatted authors. Fix #245

--- lib/sanitize.coffee
+++ lib/sanitize.coffee
@@ -6,6 +6,9 @@
 sanitizeHtml.defaults.allowedAttributes['*'] = [
   'style', 'class', 'title', 'aria-*'
 ]
+
+## For author links + drag support
+sanitizeHtml.defaults.allowedAttributes.a.push 'data-username'

 sanitizeHtml.defaults.allowedTags.push 'img'
 sanitizeHtml.defaults.allowedAttributes.img.push 'alt', 'width', 'height'


Check .viewmodel args

Check .viewmodel args

--- lib/template.coffee
+++ lib/template.coffee
@@ -21,6 +21,7 @@
 Blaze.Template.prototype.viewmodel = (initial) ->
   template = this
   ViewModel.check 'T#viewmodel', initial, template
+  ViewModel.check 'T#viewmodelArgs', template, arguments
   template.viewmodelInitial = initial
   template.onCreated ViewModel.onCreated(template)
   template.onRendered ViewModel.onRendered(initial)


get resetting the connection working

get resetting the connection working

--- lib/terminal.coffee
+++ lib/terminal.coffee
@@ -40,8 +40,11 @@
     protocol = if @port == 443 then 'wss' else 'ws'
     "#{protocol}://#{@host}:#{@port}/#{@path}?token=#{@token}"

+  reset: ->
+    @socket.connect()
+
   send: (data) ->
-    @waitForSocket.then =>
+    if @socket
       @socket.send(data)

   updateToken: (token) ->


Add Terminal Panel menu

Add Terminal Panel menu

--- menus/main.cson
+++ menus/main.cson
@@ -51,12 +51,13 @@
       }
       {'type': 'separator'}
       {
-        'label': 'Terminal'
-        'command': 'platformio-ide:maintenance.open-terminal'
-      }
-      {
-        'label': 'Toggle Terminal'
-        'command': 'platformio-ide-terminal:toggle'
+        'label': 'Terminal Panel'
+        'submenu': [
+          { 'label': 'New', 'command': 'platformio-ide:maintenance.open-terminal' }
+          { 'label': 'Toggle', 'command': 'platformio-ide-terminal:toggle' }
+          { 'label': 'Prev', 'command': 'platformio-ide-terminal:prev' }
+          { 'label': 'Next', 'command': 'platformio-ide-terminal:next' }
+        ]
       }
       {'type': 'separator'}
       {


debug fileupload img with jcrop

debug fileupload img with jcrop

--- vendor/assets/javascripts/rails_admin/themes/glyph/src/glyph-theme.coffee
+++ vendor/assets/javascripts/rails_admin/themes/glyph/src/glyph-theme.coffee
@@ -15,8 +15,7 @@
     """

   constructor: (@$el) ->
-    $uploadedFile = @$el.parent().find('a, img').addClass('uploaded-file').remove()
-    $uploadedHint = @$el.parent().parent().find('.help-block').remove()
+    $uploadedFile = @$el.parent().find('a').addClass('uploaded-file').remove()

     unless @$el.data("file-upload")
       $container = @$el.parent().parent().find('.toggle').html(@template)
@@ -24,7 +23,6 @@
       $container.find(".btn-file").append(@$el)
       # Add preview link if existing
       $container.prepend($uploadedFile) if $uploadedFile.length
-      $container.append($uploadedHint)
       # Store object in "file-upload" data key on dom element
       @$el.data("file-upload", this)


Fix bookings embedded in member

Fix bookings embedded in member

--- src/member/javascripts/services/bookings.js.coffee
+++ src/member/javascripts/services/bookings.js.coffee
@@ -1,6 +1,5 @@
-'use strict';
-
-angular.module('BB.Services').factory "MemberBookingService", ($q, $window, SpaceCollections, $rootScope, MemberService, BBModel) ->
+angular.module('BB.Services').factory "MemberBookingService", ($q,
+    SpaceCollections, $rootScope, MemberService, BBModel) ->

   query: (member, params) ->
     deferred = $q.defer()
@@ -8,8 +7,7 @@
       deferred.reject("member does not have bookings")
     else
       member.$get('bookings', params).then (bookings) =>
-        if $window.typeIsArray bookings
-          # bookings were embedded in member
+        if angular.isArray bookings
           bookings = for booking in bookings
             new BBModel.Member.Booking(booking)
           deferred.resolve(bookings)


Register: little refactor / code styling

--- client/Login/Views/registerform.coffee
+++ client/Login/Views/registerform.coffee
@@ -83,14 +83,14 @@
     return if event?.which is 9
     return if input.getValue().length < 4

-    clearTimeout usernameCheckTimer
+    KD.utils.killWait usernameCheckTimer
     input.setValidationResult "usernameCheck", null
     name = input.getValue()

     if input.valid
-      usernameCheckTimer = setTimeout =>
+      usernameCheckTimer = KD.utils.wait delay, =>
         @username.loader.show()
-        KD.remote.api.JUser.usernameAvailable name, (err, response)=>
+        KD.remote.api.JUser.usernameAvailable name, (err, response) =>
           @username.loader.hide()
           {kodingUser, forbidden} = response
           if err
@@ -103,7 +103,6 @@
               input.setValidationResult "usernameCheck", "Sorry, \"#{name}\" is already taken!"
             else
               input.setValidationResult "usernameCheck", null
-      , delay

   viewAppended:->


Social: prevent from duplicate subscriptions bindings

--- client/Main/socialapicontroller.coffee
+++ client/Main/socialapicontroller.coffee
@@ -1,6 +1,7 @@
 class SocialApiController extends KDController

   constructor: (options = {}, data) ->
+    @openedChannels = {}
     super options, data

   mapActivity = (data)->
@@ -106,22 +107,11 @@
       data.isParticipant = channel.isParticipant
       data.participantCount = channel.participantCount
       data.participantsPreview = channel.participantsPreview
-
       c = new SocialChannel data
-      # until we create message id's
-      # programmatically
-      # inorder to make realtime updates work
-      # we need `channel-` here
-      c._id = "channel-#{c.id}"
-
-      # bind all events
-      registerAndOpenChannel c
-
-      c.on "*", -> console.log arguments
-      c.on "MessageAdded", -> console.log arguments, "messageadded"
       # push channel into stack
       revivedChannels.push c
-
+    # bind all events
+    registerAndOpenChannels revivedChannels
     return revivedChannels

   forwardMessageEvents = (source, target,  events)->
@@ -130,21 +120,27 @@
         message = mapActivity message
         target.emit event, message, rest...

-  registerAndOpenChannel = (socialApiChannel)->
+  registerAndOpenChannels = (socialApiChannels)->
     getCurrentGroup (group)->
-      subscriptionData =
-        serviceType: 'socialapi'
-        group      : group.slug
-        channelType: socialApiChannel.typeConstant
-        channelName: socialApiChannel.name
-        isExclusive: yes
+      for socialApiChannel in socialApiChannels
+        # lock
+        name = "socialapi.#{socialApiChannel.groupName}-#{socialApiChannel.typeConstant}-#{socialApiChannel.name}"
+        continue  if KD.singletons.socialapi.openedChannels[name]
+        KD.singletons.socialapi.openedChannels[name] = {}

-      name = "socialapi.#{socialApiChannel.groupName}-#{socialApiChannel.typeConstant}-#{socialApiChannel.name}"
-      brokerChannel = KD.remote.subscribe name, subscriptionData
-      forwardMessageEvents brokerChannel, socialApiChannel, [
-        "MessageAdded",
-        "MessageRemoved"
-      ]
+        subscriptionData =
+          serviceType: 'socialapi'
+          group      : group.slug
+          channelType: socialApiChannel.typeConstant
+          channelName: socialApiChannel.name
+          isExclusive: yes
+
+        KD.remote.subscribe name, subscriptionData, (brokerChannel)->
+          KD.singletons.socialapi.openedChannels[brokerChannel.name] = brokerChannel
+          forwardMessageEvents brokerChannel, socialApiChannel, [
+            "MessageAdded",
+            "MessageRemoved"
+          ]

   message:
     edit   :(rest...)-> messageApiMessageResFunc 'edit', rest...


 Merge branch 'master.activity.mapperfn' into 'master.activity'

socialapi: set `identity` function as default response mapper function

--- client/Main/socialapicontroller.coffee
+++ client/Main/socialapicontroller.coffee
@@ -204,7 +204,7 @@
     (options, callback)->
       {fnName, validate, mapperFn, defaults, apiType} = req
       # set default mapperFn
-      mapperFn or= ->
+      mapperFn or= (value) -> return value
       if validate?.length > 0
         errs = []
         for property in validate


Add comment

Add comment

--- client/app/MainApp/fs/fswatcher.coffee
+++ client/app/MainApp/fs/fswatcher.coffee
@@ -9,6 +9,7 @@
     (watcher.stop() for path, watcher of @watchers)
     @watchers = {}

+  # /parentPath/also/stops/childrenPaths
   @stopWatching:(pathToStop)->
     for path, watcher of @watchers  when (path.indexOf pathToStop) is 0
       watcher.stop()


Client: Implement /data command

Client: Implement /data command

--- client/app/js/concerns/commands.coffee
+++ client/app/js/concerns/commands.coffee
@@ -58,23 +58,53 @@
   for array in pokemon
     continue  if array.length == 0
     [speciesName, formeName] = array
-    if formeName == 'default'
-      pokemonName = speciesName
-    else
-      pokemonName = speciesName
-      pokemonName += ' '
-      pokemonName += formeName.split('-')
-        .map((n) -> n[0].toUpperCase() + n[1...])
-        .join('-')
     pbv = PokeBattle.PBV.determinePBV(window.Generations.XY,
       name: speciesName, forme: formeName)
     total += pbv
-    messages.push("#{pokemonName}: #{pbv}")
+    messages.push("#{formatName(speciesName, formeName)}: #{pbv}")
   if messages.length == 0
     PokeBattle.chatView.updateChat("PBV error: Enter valid Pokemon.")
   else
     messages.push("Total: #{total}")  if messages.length > 1
     PokeBattle.chatView.updateChat("PBV: #{messages.join(' | ')}")
+
+makeCommand "data", "dex", (pokemon) ->
+  pokemon = findPokemon(pokemon)
+  if pokemon.length == 0
+    PokeBattle.chatView.updateChat("Data error: Enter a valid Pokemon.")
+    return
+
+  [speciesName, formeName] = pokemon
+  [speciesSlug, formeSlug] = [slugify(speciesName), slugify(formeName)]
+  forme = window.Generations.XY.FormeData[speciesName][formeName]
+  {types, abilities, hiddenAbility, stats} = forme
+
+  # Format abilities
+  abilities.push(hiddenAbility)  if hiddenAbility?
+  abilities = _(abilities).map (a) ->
+    "#{a}"
+  abilities = abilities.join('/')
+  abilities += " (H)"  if hiddenAbility?
+
+  # Format types, stats, and icon
+  types = _(types).map (t) ->
+    ""
+  stats = [ stats.hp, stats.attack, stats.defense,
+            stats.specialAttack, stats.specialDefense, stats.speed ]
+  style = window.PokemonIconBackground(speciesName, formeName)
+
+  # Build data
+  message = """

+
+      #{formatName(speciesName, formeName)}: #{types.join('')} |
+      #{abilities} | #{stats.join('/')} |
+      #{_(stats).reduce((a, b) -> a + b)} BST |
+      See dex entry »
+
"""
+  PokeBattle.chatView.updateChat(message)

 # Finds the most lenient match possible.
 findPokemon = (pokemonName) ->
@@ -87,3 +117,17 @@
       return [speciesName, formeName]  if pokemonName == name
   # Return blank match
   []
+
+slugify = (str) ->
+  str.toLowerCase().replace(/[^a-z0-9]/g, '-').replace(/\-{2,}/g, '-')
+
+formatName = (speciesName, formeName) ->
+  if formeName == 'default'
+    pokemonName = speciesName
+  else
+    pokemonName = speciesName
+    pokemonName += ' '
+    pokemonName += formeName.split('-')
+      .map((n) -> n[0].toUpperCase() + n[1...])
+      .join('-')
+  return pokemonName


EDSC-446: Handle datasets and granules with no spatial

--- app/assets/javascripts/modules/map/leaflet-plugins/granule_layer.js.coffee
+++ app/assets/javascripts/modules/map/leaflet-plugins/granule_layer.js.coffee
@@ -433,7 +433,7 @@
         if @layer.options.endpoint == 'geo' && @_granuleFocusLayer?
           bounds = @_granuleFocusLayer.getBounds()
           # Avoid zooming and panning tiny amounts
-          unless @_map.getBounds().contains(bounds)
+          if bounds && !@_map.getBounds().contains(bounds)
             @_map.fitBounds(bounds.pad(0.2))

       @_loadResults(@_results)
@@ -502,7 +502,7 @@
       marker = L.marker([0, 0], clickable: false, icon: icon)

       firstShape = layer.getLayers()[0]
-      firstShape = firstShape._interiors if firstShape._interiors?
+      firstShape = firstShape._interiors if firstShape?._interiors?

       firstShape?.on 'add', (e) ->
         map = @_map


changed selector to options while getting results over Relationship

--- client/landing/app/Applications/Members.kdapplication/AppController.coffee
+++ client/landing/app/Applications/Members.kdapplication/AppController.coffee
@@ -42,12 +42,11 @@
             else
               group = KD.getSingleton('groupsController').getCurrentGroup()
               if group?
-                options = {
-                  options
-                  targetOptions: {selector}
+                relationshipOptions = {
+                  targetOptions: {options}
                 }
                 selector = {}
-                group.fetchMembers selector, options, callback
+                group.fetchMembers selector, relationshipOptions, callback
               else
                 JAccount.someWithRelationship selector, options, callback
               @setCurrentViewNumber 'all'


models: invitation: f*ck cyclomatic complexity

--- workers/social/lib/social/models/invitation.coffee
+++ workers/social/lib/social/models/invitation.coffee
@@ -207,8 +207,17 @@
       createInviteInstance invitationData, fin

     , (invite, fin) ->
-      [fin, invite] = [invite, fin]  unless fin
-      inviteInfo = { email, code: invite.code }  if invite
+      unless fin
+        [fin, invite] = [invite, fin]
+        # this is here bc of fucking cyclomatic complexity error of linter
+        # if you put one more if statement here tests will fail
+        # this technically correct but readability suffers
+        # it should be as below - SY
+        #
+        #   [fin, invite] = [invite, fin]  unless fin
+        #   inviteInfo = { email, code: invite.code }  if invite
+        #
+        inviteInfo = { email, code: invite.code }

       return fin()  if noEmail or not invite
       JInvitation.sendInvitationEmail client, invite, fin


SocialWorker: lower case login username input

--- workers/social/lib/social/models/user/index.coffee
+++ workers/social/lib/social/models/user/index.coffee
@@ -457,7 +457,7 @@
       =>
         @normalizeLoginId loginId, (err, username_) ->
           return callback err  if err
-          username = username_
+          username = username_.toLowerCase()
           queue.next()

       ->


JUser::createGuestUsernam: use 'hat' instead counters in mongo

--- workers/social/lib/social/models/user/index.coffee
+++ workers/social/lib/social/models/user/index.coffee
@@ -570,14 +570,9 @@
       else
         callback null

+
   @createGuestUsername = (callback) ->
-    ((require 'koding-counter') {
-      db          : @getClient()
-      counterName : 'guest'
-      offset      : 0
-    }).next (err, guestId) ->
-      return callback err  if err?
-      callback null, "guest-#{guestId}"
+    callback null, "guest-#{(require 'hat')(64)}"

   @fetchGuestUser = (callback)->


Set analytics identification traits in registration

--- workers/social/lib/social/models/user/index.coffee
+++ workers/social/lib/social/models/user/index.coffee
@@ -22,6 +22,7 @@
   JLog                 = require '../log'
   ComputeProvider      = require '../computeproviders/computeprovider'
   Tracker              = require '../tracker'
+  Payment              = require '../payment'

   @bannedUserList = ['abrt', 'amykhailov', 'apache', 'about', 'visa', 'shared-',
                      'cthorn', 'daemon', 'dbus', 'dyasar', 'ec2-user', 'http',
@@ -162,7 +163,10 @@
           type      : String
           # enum      : ['invalid status',['online','offline','away','busy']]

-      sshKeys       : [Object]
+      sshKeys       :
+        type        : Object
+        default     : []
+
       foreignAuth            :
         github               :
           foreignId          : String
@@ -1552,6 +1556,7 @@
     newToken         = null
     invitation       = null
     foreignAuthType  = null
+    subscription     = null

     queue = [

@@ -1596,9 +1601,51 @@
           queue.next()

       ->
+        date = new Date 0
+        subscription =
+          accountId          : account.getId()
+          planTitle          : 'free'
+          planInterval       : 'month'
+          state              : 'active'
+          provider           : 'koding'
+          expiredAt          : date
+          canceledAt         : date
+          currentPeriodStart : date
+          currentPeriodEnd   : date
+
+        queue.next()
+
+      ->
         jwtToken = JUser.createJWT { username }

-        Tracker.identify username, { jwtToken, email, pin }
+        { status, lastLoginDate } = user
+        { createdAt } = account.meta
+
+        sshKeysCount = user.sshKeys.length
+
+        emailFrequency =
+          global       : user.emailFrequency.global
+          marketing    : user.emailFrequency.marketing
+
+        traits = {
+          email
+          createdAt
+          lastLoginDate
+          status
+
+          firstName
+          lastName
+
+          subscription
+          sshKeysCount
+          emailFrequency
+
+          pin
+          jwtToken
+        }
+
+        Tracker.identify username, traits
+
         queue.next()

       ->


filterable: escape non-word constituents after trimming seed

--- workers/social/lib/social/traits/filterable.coffee
+++ workers/social/lib/social/traits/filterable.coffee
@@ -11,7 +11,7 @@
     limit     ?= 10
     blacklist or= []
     blacklist = blacklist.map(ObjectId)
-    cleanSeed = seed.replace(/[^\w\s-]/).replace(/(\W)/g, "\\$1").trim() #TODO: this is wrong for international charsets
+    cleanSeed = seed.replace(/[^\w\s-]/).trim().replace(/(\W)/g, "\\$1") #TODO: this is wrong for international charsets
     startsWithSeedTest = RegExp '^'+cleanSeed, "i"
     startsWithOptions = {limit, blacklist, skip}
     @findSuggestions client, startsWithSeedTest, startsWithOptions, (err, suggestions)=>


Updated atom-quickstart configuration: /usr/lib/atom-quickstart/.git/ / CLOSE_WRITE,CLOSE FETCH_HEAD

--- config/config.cson
+++ config/config.cson
@@ -58,7 +58,7 @@
   "linter-ui-default":
     showPanel: true
   "tool-bar":
-    iconSize: "16px"
+    iconSize: "12px"
     position: "Right"
   welcome:
     showOnStartup: false


fixed check save

fixed check save

--- manager/app/assets/javascripts/monitoring/views/add_command_opts.js.coffee
+++ manager/app/assets/javascripts/monitoring/views/add_command_opts.js.coffee
@@ -8,7 +8,7 @@
       $("#submit_check").on "click", null, (e) ->
         # create the commands
         checks = []
-        _.each view.commands, (cmd) ->
+        _.each view.opts, (cmd) ->
           check = new Bixby.model.Check()
           check.host = cmd.host
           check.set { command_id: cmd.id, host_id: cmd.host.id }


Another bugfix for name/data-name property on MultiFields

--- app/assets/javascripts/application/multi_field.js.coffee
+++ app/assets/javascripts/application/multi_field.js.coffee
@@ -174,8 +174,10 @@
       new_key = key_field.val() || locale
       if new_key?.length > 0
         value_field.attr 'name', "#{this.name()}[#{new_key}]"
+        value_field.attr 'data-name', "#{this.name()}[#{new_key}]"
       else
         value_field.removeAttr 'name'
+        value_field.removeAttr 'data-name'
     key_field.keyup refreshName
     key_field.change refreshName
     key_field.on 'typeahead:change', (evt, locale) =>


Add global commit request object

Add global commit request object

--- app/assets/javascripts/backbone/water_backbone.js.coffee
+++ app/assets/javascripts/backbone/water_backbone.js.coffee
@@ -20,6 +20,7 @@
     template: JST['backbone/views/breadcrumb_template']
   )
   controller = window.tcl = new Water.TreesController(fetcher: fetcher, breadcrumbs: breadcrumb_set)
+  window.Water.commit_request = new Water.CommitRequest()

   Backbone.history.start()


Start chat with first submit

Start chat with first submit

--- app/assets/javascripts/interaction_web_tools/chat.coffee
+++ app/assets/javascripts/interaction_web_tools/chat.coffee
@@ -8,13 +8,14 @@
     @started = false

   init: ->
-    @started = true
-    @pollMessages()
+    @onChatDialogInit()

   stop: ->
     @started = false
     $(@constructor.CHAT_BODY).hide()
     $(@constructor.CHAT_CLOSE).hide()
+
+  onChatDialogInit: ->

   pollMessages: ->
     $.get Chat.EVENTS_PATH, (data) ->
@@ -29,13 +30,15 @@
         setTimeout InteractionWebTools.chat.pollMessages, 1000

   sendMessage: (message) ->
+    unless @started
+      @pollMessages()
+      @started = true
     return false unless message
     that = @
     $.post @constructor.EVENTS_PATH, { event: { content: message } }, (data) ->
       that.renderMessages data.events

   renderMessages: (messages) ->
-    return false unless @started
     $(@constructor.CHAT_BODY).show()
     $(@constructor.CHAT_CLOSE).show()
     messages = $.grep messages, (el) -> el.type == 'text'


Add messages polling

Add messages polling

--- app/assets/javascripts/interaction_web_tools/chat.coffee
+++ app/assets/javascripts/interaction_web_tools/chat.coffee
@@ -5,9 +5,9 @@
   constructor: ->

   receiveMessages: ->
-    that = @
-    $.get @constructor.EVENTS_PATH, (data) ->
-      that.renderMessages data.events
+    $.get Chat.EVENTS_PATH, (data) ->
+      InteractionWebTools.chat.renderMessages data.events
+      setTimeout InteractionWebTools.chat.receiveMessages, 1000

   sendMessage: (message) ->
     that = @


Use auto-gravity for tooltips

Use auto-gravity for tooltips

--- app/assets/javascripts/peek/views/performance_bar.coffee
+++ app/assets/javascripts/peek/views/performance_bar.coffee
@@ -100,7 +100,7 @@
       width: "#{width}px"
       left:  "#{left}px"
       background: color
-    bar.tipsy gravity: 'n'
+    bar.tipsy gravity: $.fn.tipsy.autoNS
     @el.append bar

   # Map a time offset value to a horizontal pixel offset.
@@ -116,7 +116,7 @@

   span = $('<span>', {'class': 'peek-tooltip', title: 'Total navigation time for this page.'})
     .text(PerformanceBar.formatTime(bar.total()))
-  span.tipsy({ gravity: 'n' })
+  span.tipsy gravity: $.fn.tipsy.autoNS
   updateStatus span

@@ -154,7 +154,7 @@

     span = $('<span>', {'class': 'peek-tooltip', title: "#{tech} navigation time"})
       .text(PerformanceBar.formatTime(total))
-    span.tipsy({ gravity: 'n' })
+    span.tipsy gravity: $.fn.tipsy.autoNS
     updateStatus span

     ajaxStart = null


MacroList tightenup

MacroList tightenup

--- app/coffee/modules/main/dashboard/views/macroList.coffee
+++ app/coffee/modules/main/dashboard/views/macroList.coffee
@@ -94,7 +94,8 @@

     # Initializes Sortable container
     Sortable.create @el,
-      animation:    100
+      # animation:    50
+      animation:    0
       handle:       '.key'
       ghostClass:   'ghost'  # Class name for the drop placeholder
       chosenClass:  'chosen'  # Class name for the chosen item


update mewbot.coffee

update mewbot.coffee

--- core/mewbot.coffee
+++ core/mewbot.coffee
@@ -35,6 +35,10 @@
                         @port=process.env.MEWBOT_PORT
                     else
                         @port=port
+
+                if process.env.MEWBOT_NAME
+                    @name = process.env.MEWBOT_NAME
+
                 tmpFolder = @getTmpFile()
                 Fs.exists tmpFolder,(exists)=>
                     if exists is false


Only show available flash players

Only show available flash players

--- lib/flash-loader.coffee
+++ lib/flash-loader.coffee
@@ -79,9 +79,9 @@

 class FlashPlayerVersions
   constructor: (builtInFlashPath, chromeFlashPath, systemFlashPath) ->
-    @builtin = getFlashVersion builtInFlashPath
-    @chrome = getFlashVersion chromeFlashPath
-    @system = getFlashVersion systemFlashPath
+    @builtin = getFlashVersion builtInFlashPath if builtInFlashPath?
+    @chrome = getFlashVersion chromeFlashPath if chromeFlashPath?
+    @system = getFlashVersion systemFlashPath if systemFlashPath?

 getAllVersions = ->
   new FlashPlayerVersions builtInPath, findChromeFlashPath(), findSystemFlashPath()


dismiss Artist CTA modal with esc key

dismiss Artist CTA modal with esc key

--- components/artist_page_cta/view.coffee
+++ components/artist_page_cta/view.coffee
@@ -18,6 +18,7 @@
     'click': 'fullScreenOverlay'
     'submit .artist-page-cta-overlay__register': 'submit'
     'click .auth-toggle': 'triggerLoginModal'
+    'keydown': 'keyAction'

   initialize: ({ artist }) ->
     @artist = artist
@@ -55,6 +56,10 @@
     @$('.artist-page-cta-overlay__close').on 'click', @closeOverlay
     analyticsHooks.trigger 'artist_page:cta:shown'
     setTimeout (=> @disableScroll()), 400
+
+  keyAction: (e) =>
+    if e.keyCode == 27 || e.which == 27
+      @closeOverlay(e)

   disableScroll: ->
     @$body.addClass('is-scrolling-disabled')


refactoring current hole

refactoring current hole

--- lib/hole/manager.coffee
+++ lib/hole/manager.coffee
@@ -90,6 +90,19 @@

     @agda.restoreCursor()

+
+  currentHole: (callback) ->
+    cursor = @agda.editor.getCursorBufferPosition()
+    goals = @holes.filter (hole) =>
+      hole.getRange().containsPoint cursor
+
+    # in certain hole
+    if goals.length is 1
+      callback goals[0]
+    else
+      @agda.panelView.setStatus 'Info'
+      @agda.panelView.setContent ['For this command, please place the cursor in a goal']
+
   #
   # agda-mode: next-goal
   #
@@ -141,13 +154,8 @@
   # agda-mode: give
   #
   giveCommand: ->
-    cursor = @agda.editor.getCursorBufferPosition()
-    goals = @holes.filter (hole) =>
-      hole.getRange().containsPoint cursor

-    # in certain hole
-    if goals.length is 1
-      goal = goals[0]
+    @currentHole (goal) =>
       goalIndex = goal.index
       start = goal.getStart()
       startIndex = goal.toIndex start
@@ -156,7 +164,6 @@
       text = goal.getText()
       content = text.substring(2, text.length - 2)  # remove "{!!}"

-      #
       # empty = content.replace(/\s/g, '').length is 0
       # if empty then @agda.panelView.queryExpression()
       command = "IOTCM \"#{@agda.filepath}\" NonInteractive Indirect \
@@ -166,9 +173,6 @@
           #{end.column + 1})]) \"#{content}\" )\n"
       @agda.executable.process.stdin.write command

-    else
-      @agda.panelView.setStatus 'Info'
-      @agda.panelView.setContent ['For this command, please place the cursor in a goal']

   giveHandler: (index) ->
     hole = @findHole index
@@ -178,42 +182,18 @@

   goalTypeCommand: (index) ->
-
-    cursor = @agda.editor.getCursorBufferPosition()
-    goals = @holes.filter (hole) =>
-      hole.getRange().containsPoint cursor
-
-    # in certain hole
-    if goals.length is 1
-
-      goal = goals[0]
+    @currentHole (goal) =>
       goalIndex = goal.index
       command = "IOTCM \"/Users/banacorn/github/agda-mode/test/Banana.agda\" NonInteractive Indirect ( Cmd_goal_type Simplified #{goalIndex} noRange \"\" )\n"
       @agda.executable.process.stdin.write command

-    else
-      @agda.panelView.setStatus 'Info'
-      @agda.panelView.setContent ['For this command, please place the cursor in a goal']
-
-
   contextCommand: (index) ->

-    cursor = @agda.editor.getCursorBufferPosition()
-    goals = @holes.filter (hole) =>
-      hole.getRange().containsPoint cursor
-
-    # in certain hole
-    if goals.length is 1
-
-      goal = goals[0]
+    @currentHole (goal) =>
       goalIndex = goal.index
       command = "IOTCM \"/Users/banacorn/github/agda-mode/test/Banana.agda\" NonInteractive Indirect ( Cmd_context Simplified #{goalIndex} noRange \"\" )\n"
       @agda.executable.process.stdin.write command

-    else
-      @agda.panelView.setStatus 'Info'
-      @agda.panelView.setContent ['For this command, please place the cursor in a goal']
-

 module.exports = HoleManager


JApp: Simplfy fetcher methods, add some_ helper for listing all apps even they are not approved

--- workers/social/lib/social/models/app.coffee
+++ workers/social/lib/social/models/app.coffee
@@ -41,7 +41,7 @@
         'fetchRelativeReviews', 'review', 'delete'
       ]
       static            : [
-        'create', 'someWithRelationship', 'one', 'some', 'each'
+        'create', 'one', 'some', 'each', 'some_'
       ]

     permissions         :
@@ -250,8 +250,13 @@
     ]
     return selector

-  @some$ = @someWithRelationship
-  @someWithRelationship: permit 'list apps',
+  @some_: permit 'list all apps',
+
+    success: (client, selector, options, callback)->
+
+      @some selector, options, callback
+
+  @some$: permit 'list apps',

     success: (client, selector, options, callback)->


fixed cannot create same topic in different groups

--- workers/social/lib/social/models/tag.coffee
+++ workers/social/lib/social/models/tag.coffee
@@ -149,8 +149,7 @@
           tagRefs.forEach (tagRef, i)->
             if tagRef?.$suggest?
               {group} = client.context
-              newTag = {title: tagRef.$suggest.trim()}
-              newTag.group = group if group isnt 'koding'
+              newTag = {title: tagRef.$suggest.trim(), group}
               JTag.one newTag, (err, tag)->
                 if err
                   callbackForEach err


Moderation: Deleted/Child tags are hidden for all users except super-admin

--- workers/social/lib/social/models/tag.coffee
+++ workers/social/lib/social/models/tag.coffee
@@ -523,5 +523,5 @@

   setSelectorStatus = (client, selector) ->
     {connection:{delegate}} = client
-    # selector.status = $nin: ['deleted','synonym'] unless delegate.checkFlag 'super-admin'
-
+    selector.status = $nin: ['deleted','synonym'] unless delegate.checkFlag 'super-admin'
+


add a comment to thin progress component

--- client/app/components/thin_progress.coffee
+++ client/app/components/thin_progress.coffee
@@ -1,5 +1,7 @@
 {div} = React.DOM

+
+# Small components used to display loading progression of a mailbox.
 module.exports = ThinProgress = React.createClass
     displayName: 'ThinProgress'


flux/payment: export actions

flux/payment: export actions

--- client/app/lib/flux/payment/actions.coffee
+++ client/app/lib/flux/payment/actions.coffee
@@ -49,3 +49,9 @@
         resolve { token }

+module.exports = {
+  loadStripeClient
+  createStripeToken
+}
+
+


espace backslash

espace backslash

--- lib/input-method.coffee
+++ lib/input-method.coffee
@@ -14,19 +14,18 @@

   activate: ->

-    cursorPos = @agda.editor.getCursorBufferPosition()
-    # insert '\' to the buffer
-    @agda.editor.getBuffer().insert cursorPos, '\\'
-
     if not @activated

       @activated = true

       # range & marker
-      start = cursorPos
+      start = @agda.editor.getCursorBufferPosition()
       end = start.translate new Point 0, 1
       range = new Range start, end
       @marker = @agda.editor.markBufferRange range
+
+      # insert '\' to the buffer
+      @agda.editor.getBuffer().insert start, '\\'

       # kick off
       @decorator.resize range
@@ -61,7 +60,9 @@
             lastInput = content.substr -1
             refill = symbol[0] + lastInput
             @agda.editor.getBuffer().setTextInRange range, refill
+    else

+      @deactivate()

   deactivate: ->


KDTabHandleView: Showed clicked pane after drag finished.

--- components/tabs/KDTabHandleView.coffee
+++ components/tabs/KDTabHandleView.coffee
@@ -25,6 +25,7 @@

     @on "DragFinished", (event) =>
       @handleDragFinished event
+      @getDelegate().showPaneByIndex @index

   setDomElement:(cssClass="")->
     {hidden, closable, tagName, title} = @getOptions()


Trying to fix the Windows bug #16

Trying to fix the Windows bug #16

--- lib/linter-julia.coffee
+++ lib/linter-julia.coffee
@@ -53,11 +53,22 @@
                     is used, meaning column end is 80. To get back to the
                     previous behavior change the column end to 1"
       order: 1
+    julia:
+      title: 'Julia executable location'
+      type: 'string'
+      default: 'julia'
+      description: "Insert here the path to the julia.exe, which one you want
+        to use. For example:
+        C:\\Users\\Julia\\AppData\\Local\\Julia-0.5.0\\bin\\julia.exe"
+      order: 2
+
   activate: ->
     global.named_pipe = tmp.tmpNameSync({ prefix:'lintserver',postfix: 'sock'})
     jcode = "using Lint; lintserver(\"#{named_pipe}\")"
+    if process.platform == 'win32'
+      jcode = jcode.replace(/\\/g,"\\\\")
     console.log jcode
-    jserver = spawn 'julia', ['-e', jcode]
+    jserver = spawn atom.config.get('linter-julia.julia'), ['-e', jcode]
     jserver.stdout.on 'data', (data) -> console.log data.toString().trim()
     jserver.stderr.on 'data', (data) -> console.log data.toString().trim()


:art: Call classifyMessagesByLine automatically in classifyMessages

--- lib/linter-views.coffee
+++ lib/linter-views.coffee
@@ -38,7 +38,7 @@
       @renderPanelMessages()

   render: (messages) ->
-    @messages = @classifyMessagesByLine(@classifyMessages(messages))
+    @messages = @classifyMessages(messages)
     if @ignoredMessageTypes.length
       @messages = @messages.filter (message) => @ignoredMessageTypes.indexOf(message.type) is -1
     @renderPanelMessages()
@@ -60,7 +60,7 @@
       if message.currentFile = (filePath and message.filePath is filePath)
         @count.File++
       @count.Project++
-    return messages
+    return @classifyMessagesByLine(messages)

   classifyMessagesByLine: (messages) ->
     row = atom.workspace.getActiveTextEditor()?.getCursorBufferPosition().row


confusing to show team at top now

confusing to show team at top now

--- nodeko.coffee
+++ nodeko.coffee
@@ -133,12 +133,7 @@
 get '/teams', ->
   Team.all { validDeploy: true }, (error, teams) =>
     @teams = _.shuffle teams
-    if @currentPerson?
-      Team.all { 'members._id': @currentPerson._id }, (error, yourTeams) =>
-        @yourTeams = yourTeams
-        @render 'teams/index.html.haml'
-    else
-      @render 'teams/index.html.haml'
+    @render 'teams/index.html.haml'

 # new team
 get '/teams/new', ->


regex pattern name was not correct

regex pattern name was not correct

--- lib/mark-manager.coffee
+++ lib/mark-manager.coffee
@@ -1,4 +1,4 @@
-REGISTERS = /// ^ (
+MARKS = /// ^ (
   ?: [a-z]
    | [`.^(){}]
 ) ///
@@ -11,7 +11,7 @@
     @marks = {}

   isValid: (name) ->
-    REGISTERS.test(name)
+    MARKS.test(name)

   get: (name) ->
     return unless @isValid(name)


Updated link should point to release notes.

--- content_scripts/vimium_frontend.coffee
+++ content_scripts/vimium_frontend.coffee
@@ -1007,7 +1007,7 @@
   showUpgradeNotification: (version) ->
     HUD.upgradeNotificationElement().innerHTML = "Vimium has been updated to

+      href='https://github.com/philc/vimium#release-notes'>
       #{version}.×"
     links = HUD.upgradeNotificationElement().getElementsByTagName("a")
     links[0].addEventListener("click", HUD.onUpdateLinkClicked, false)


Only modify find mode regexps if it's a flag we want to match

--- content_scripts/vimium_frontend.coffee
+++ content_scripts/vimium_frontend.coffee
@@ -719,19 +719,15 @@
   findModeQuery.isRegex = settings.get 'regexFindMode'
   hasNoIgnoreCaseFlag = false
   findModeQuery.parsedQuery = findModeQuery.rawQuery.replace /(\\{1,2})([rRI]?)/g, (match, slashes, flag) ->
-    return match if flag == ""
-    if slashes.length == 2
-      # The escape code is double-escaped (ie. \\r rather than \r). Strip the extra slash.
-      "\\#{flag}"
-    else
-      switch (match)
-        when "\\r"
-          findModeQuery.isRegex = true
-        when "\\R"
-          findModeQuery.isRegex = false
-        when "\\I"
-          hasNoIgnoreCaseFlag = true
-      ""
+    return match if flag == "" or slashes.length != 1
+    switch (flag)
+      when "r"
+        findModeQuery.isRegex = true
+      when "R"
+        findModeQuery.isRegex = false
+      when "I"
+        hasNoIgnoreCaseFlag = true
+    ""

   # default to 'smartcase' mode, unless noIgnoreCase is explicitly specified
   findModeQuery.ignoreCase = !hasNoIgnoreCaseFlag && !Utils.hasUpperCase(findModeQuery.parsedQuery)


Move key-only code from FindMode.exit to its keydown handler

--- content_scripts/vimium_frontend.coffee
+++ content_scripts/vimium_frontend.coffee
@@ -747,9 +747,11 @@
         if event.keyCode == keyCodes.backspace || event.keyCode == keyCodes.deleteKey
           HUD.hide()
           @exit()
+          new PostFindMode if findModeQueryHasResults
         else if event.keyCode == keyCodes.enter
           handleEnterForFindMode()
           @exit()
+          new PostFindMode if findModeQueryHasResults
         else if event.keyCode == keyCodes.upArrow
           if rawQuery = FindModeHistory.getQuery @historyIndex + 1
             @historyIndex += 1
@@ -760,14 +762,13 @@
           rawQuery = if 0 <= @historyIndex then FindModeHistory.getQuery @historyIndex else @partialQuery
           HUD.showFindMode rawQuery
         else if KeyboardUtils.isEscape event
-          @exit event
+          @exit()
+          handleEscapeForFindMode()
+          new PostFindMode if findModeQueryHasResults

   exit: (event) ->
     super()
-    handleEscapeForFindMode() if event?.type == "keydown" and KeyboardUtils.isEscape event
-    handleEscapeForFindMode() if event?.type == "click"
-    if findModeQueryHasResults and event?.type != "click"
-      new PostFindMode
+    handleEscapeForFindMode() if event

 window.performFindInPlace = ->
   # Restore the selection.  That way, we're always searching forward from the same place, so we find the right


Use cursor: none and pointer-events: none to hide the cursor on scroll

--- content_scripts/vimium_frontend.coffee
+++ content_scripts/vimium_frontend.coffee
@@ -1072,23 +1072,15 @@
   #
   # Hides the cursor when the browser scrolls, and prevent mouse from hovering while invisible
   #
-  cursorHidden: false
-  hoverBlockElement: undefined
-
+  cursorHideStyle: null
+  cursorHideTimeout: 5000
+
+  showCursor: -> @cursorHideStyle.remove()
   hideCursor: ->
-    unless @cursorHidden
-      @hoverBlockElement.style.display =  "block"
-      @cursorHidden = true
-
-  showCursor: ->
-    if @cursorHidden
-      @hoverBlockElement.style.display = "none"
-      @cursorHidden = false
-
-  onMouseMove: (event) ->
-    CursorHider.showCursor()
-
-  onScroll: ->
+    document.head.appendChild @cursorHideStyle unless @cursorHideStyle.parentElement
+
+  onMouseMove: (event) -> CursorHider.showCursor()
+  onScroll: (event) ->
     CursorHider.hideCursor()

     # Ignore next mousemove, caused by the scrolling, so the mouse doesn't re-show straight away.
@@ -1098,21 +1090,11 @@
       window.removeEventListener "mousemove", arguments.callee

   init: ->
-    # cover the <body> element entirely by a div with cursor: none
-    @hoverBlockElement = document.createElement("div")
-    @hoverBlockElement.style.position = "fixed"
-    @hoverBlockElement.style.width = "104%"
-    @hoverBlockElement.style.height = "104%"
-    @hoverBlockElement.style.zIndex = "2147483647" # Maximum value of z-index
-    @hoverBlockElement.style.left = "0px"
-    @hoverBlockElement.style.top =  "0px"
-    @hoverBlockElement.style.opacity = "0.0"
-    @hoverBlockElement.style.display = "none"
-    @hoverBlockElement.style.cursor = "none"
-    @hoverBlockElement.style.border = "none"
-    @hoverBlockElement.style.margin = "-2% -2% -2% -2%"
-    document.body.appendChild(@hoverBlockElement)
-
+    @cursorHideStyle = document.createElement("style")
+    @cursorHideStyle.innerHTML = """
+      body * {pointer-events: none !important; cursor: none !important;}
+      body {cursor: none !important;}
+    """
     window.addEventListener "mousemove", @onMouseMove
     window.addEventListener "scroll", @onScroll


Change message for when editor not selected

"Please select your Text Editor view to render a
preview of your code"

See discussion at
https://github.com/Glavin001/atom-preview/issues/41#issuecomment-112132634

--- lib/preview-view.coffee
+++ lib/preview-view.coffee
@@ -46,7 +46,6 @@
     @editorContents = $(@textEditor)

     # Add Text Editor
-    # Placeholder = Please type in a Text Editor to render preview
     @appendChild(@textEditor)

     # Create container for Previewing Rendered HTML
@@ -223,7 +222,7 @@
       cEditor = @lastEditor
     if not cEditor?
       # cEditor not defined
-      @showError({message:"Please type a Text Editor to render preview"})
+      @showError({message:"Please select your Text Editor view to render a preview of your code"})
     else
       # Source Code text
       text = cEditor.getText()


Oops, we moved up a directory

Oops, we moved up a directory

--- core/app/backbone/factlink.backbone.coffee
+++ core/app/backbone/factlink.backbone.coffee
@@ -8,7 +8,7 @@
 #= require twipsy

 #= require hogan
-#= require_tree ../../templates
+#= require_tree ../templates

 this.HoganTemplates || (this.HoganTemplates = {});


fix danger alert

fix danger alert

--- core/static/script/base/ErrorHandle.coffee
+++ core/static/script/base/ErrorHandle.coffee
@@ -4,7 +4,7 @@
 			$('#page-alert').append "<p>#{error}</p>"

 		clearError: ->
-			$('#page-alert').find('button').nextAll().remove()
+			$('#page-alert').empty()

 		showError: ->
 			$('#page-alert').show()


Calling bind handler on instantiation

Calling bind handler on instantiation

--- app/assets/javascripts/handle_aria_event.js.coffee
+++ app/assets/javascripts/handle_aria_event.js.coffee
@@ -1,5 +1,5 @@
 keyCodes = ->
-  # Define values for keycodes
+  # Define values for keycodes
   @backspace = 8
   @tab = 9
   @enter = 13
@@ -15,49 +15,49 @@
   @down = 40
   @insert = 45
   @del = 46
-  @f2 = 113
+  @f2 = 113

 AriaEvent = (element, max_row) ->
   @main_element = $(element)
   $(element).attr('tab-index', 0)
-  @maxrow = max_row
-  @keys = keyCodes
-  console.log "In Left and right key are in progress"
+  @maxrow = max_row
+  @keys = keyCodes
+  this.bindhandler()

 AriaEvent.prototype.bindhandler = ()->
   thisObj = this
-  $row_event = $(this).main_element().find('.row[role="row"]')
+  $row_event = $(this).find('.row[role="row"]')
   $row_event.bind 'keyup', (e)->
     thisObj.bind_grid_cell(object, e)
-
+
   $row_event.bind 'keypress', (e)->
     thisObj.bind_grid_cell(object, e)
-
+
   $row_event.bind 'keypress', (e)->
-    thisObj.bind_grid_cell(object, e)
-
+    thisObj.bind_grid_cell(object, e)
+
 AriaEvent.prototype.bind_grid_cell = (id, e)->
-  $curCell = $(id) #Store the current cell object to prevent repeated DOM traversals
-  if e.ctrlKey == true || e.altKey == true || e.shiftKey == true || this.editMode == true
-    return true
-
+  $curCell = $(id) #Store the current cell object to prevent repeated DOM traversals
+  if e.ctrlKey == true || e.altKey == true || e.shiftKey == true || this.editMode == true
+    return true
+  alert e.keyCode
   switch e.keyCode
     when @keys.enter, @keys.f2
-
-      # enter the edit mode for the cell
+
+      # enter the edit mode for the cell
       @enterEditMode $curCell
       e.stopPropagation
       return false
       break
     when @keys.left
       $newCell = $curCell.prev()
-
-      $newCell = $newCell.prev()
-      $newCell.attr("tabindex", "0").focus()
+
+      $newCell = $newCell.prev()
+      $newCell.attr("tabindex", "0").focus()
       e.stopPropagation
       return false
       break
-
+
 $(document).ready ->
   app = new AriaEvent('#game-levels', $("#game-levels .row[role='row']").size())
-
+


remove unnecessary console log"

remove unnecessary console log"

--- app/assets/javascripts/modules/search/model.coffee
+++ app/assets/javascripts/modules/search/model.coffee
@@ -21,7 +21,6 @@
       .value()

   personal_query: ->
-    console.log @page
     if @isPersonal()
       new Clarat.Search.PersonalQuery(
         @geolocation, @query, @category, @facet_filters, @page


ItemViewCtrl fetches item from api using provided id.

--- app/assets/javascripts/pages/controllers.js.coffee
+++ app/assets/javascripts/pages/controllers.js.coffee
@@ -1,3 +1,11 @@
 @raCrudDemo.controller 'HomeCtrl', ['$scope', ($scope) ->

+]
+@raCrudDemo.controller 'ItemViewCtrl', ['$scope', '$routeParams', '$location', '$http',
+  ($scope, $routeParams, $location, $http) ->
+
+    $scope.item = null
+    $http.get('/api/v1/items/'+$routeParams.item_id+'.json').success((data) ->
+      $scope.item = data.item
+    )
 ]


Min-width improvements

Min-width improvements

--- app/classifier/drawing-tools/column-rectangle.cjsx
+++ app/classifier/drawing-tools/column-rectangle.cjsx
@@ -4,7 +4,6 @@
 Draggable = require '../../lib/draggable'
 DeleteButton = require './delete-button'

-MINIMUM_SIZE = 5
 DELETE_BUTTON_DISTANCE = 9 / 10
 DEFAULT_WIDTH = 25
 MINIMUM_WIDTH = 25
@@ -40,24 +39,24 @@
       _inProgress: false

     initValid: (mark) ->
-      mark.width > MINIMUM_SIZE
+      mark.width >= MINIMUM_WIDTH

   initCoords: null

   render: ->
     {x, y, width} = @props.mark
-
+    allowedWidth = if @props.mark.width < MINIMUM_WIDTH then MINIMUM_WIDTH else width
     <DrawingToolRoot tool={this}>
       <Draggable onDrag={@handleMainDrag} disabled={@props.disabled}>
-        <rect ref="rect" x={x} y={y} width={width if @props.mark.width >= MINIMUM_WIDTH} height={@props.containerRect.height / @props.scale.vertical} />
+        <rect ref="rect" x={x} y={y} width={allowedWidth} height={@props.containerRect.height / @props.scale.vertical} />
       </Draggable>

       {if @props.selected
         <g>
-          <DeleteButton tool={this} x={x + width + 15} y={y + 10} />
+          <DeleteButton tool={this} x={x + allowedWidth + 20} y={y + 15} />

           <DragHandle x={x} y={(@props.containerRect.height / @props.scale.vertical) / 2} scale={@props.scale} onDrag={@handleLeftDrag} onEnd={@normalizeMark} />
-          <DragHandle x={x + width} y={(@props.containerRect.height / @props.scale.vertical) / 2} scale={@props.scale} onDrag={@handleRightDrag} onEnd={@normalizeMark} />
+          <DragHandle x={x + allowedWidth} y={(@props.containerRect.height / @props.scale.vertical) / 2} scale={@props.scale} onDrag={@handleRightDrag} onEnd={@normalizeMark} />
         </g>}
     </DrawingToolRoot>

@@ -70,22 +69,20 @@
     @props.mark.x += d.x / @props.scale.horizontal if @props.mark.width >= MINIMUM_WIDTH
     # @props.mark.y += d.y / @props.scale.vertical
     @props.mark.width -= d.x / @props.scale.horizontal
-    @props.mark.height -= d.y / @props.scale.vertical
+    # @props.mark.height -= d.y / @props.scale.vertical
     @props.onChange @props.mark if @props.mark.width >= MINIMUM_WIDTH

   handleRightDrag: (e, d) ->
     # @props.mark.y += d.y / @props.scale.vertical
     @props.mark.width += d.x / @props.scale.horizontal
-    @props.mark.height -= d.y / @props.scale.vertical
-    @props.onChange @props.mark if @props.mark.width >= MINIMUM_WIDTH
+    # @props.mark.height -= d.y / @props.scale.vertical
+    @props.onChange @props.mark

   normalizeMark: ->
-    if @props.mark.width < 0
-      @props.mark.x += @props.mark.width
-      @props.mark.width *= -1
+    if @props.mark.width < MINIMUM_WIDTH
+      @props.mark.x += @props.mark.width if @props.mark.width >= MINIMUM_WIDTH
+      # @props.mark.width *= -1
+      @props.mark.width is MINIMUM_WIDTH

-    # if @props.mark.height < 0
-    #   @props.mark.y += @props.mark.height
-    #   @props.mark.height *= -1

     @props.onChange @props.mark if @props.mark.width >= MINIMUM_WIDTH


Update browsers popularity

Update browsers popularity


Use _.without, not _.difference

Use _.without, not _.difference

--- data/bw/moves.coffee
+++ data/bw/moves.coffee
@@ -390,7 +390,7 @@
 extendMove 'conversion', ->
   @use = (battle, user, target) ->
     {types, moves} = target
-    moves = _.difference(moves, battle.getMove(@name))
+    moves = _.without(moves, battle.getMove(@name))
     # The original type of the move is used, not its generated type.
     moveTypes = moves.map((move) -> move.type)
     types = _.difference(moveTypes, types)


:art: DRY

:art: DRY

--- lib/text-objects.coffee
+++ lib/text-objects.coffee
@@ -2,9 +2,6 @@
 _    = require 'underscore-plus'
 Base = require './base'

-AllWhitespace = /^\s$/
-WholeWordRegex = /\S+/
-
 class TextObject extends Base
   @extend()
   complete: true
@@ -17,46 +14,41 @@

 # Word
 # -------------------------
-class SelectInsideWord extends TextObject
-  @extend()
-  select: ->
-    @editor.selectWordsContainingCursors()
-    [true]
-
-class SelectAWord extends TextObject
-  @extend()
-  select: ->
-    for selection in @editor.getSelections()
-      selection.selectWord()
-      loop
-        endPoint = selection.getBufferRange().end
-        char = @editor.getTextInRange(Range.fromPointWithDelta(endPoint, 0, 1))
-        break unless AllWhitespace.test(char)
-        selection.selectRight()
-      true
-
-# WholeWord
-# -------------------------
-class SelectInsideWholeWord extends TextObject
-  @extend()
-  select: ->
-    for selection in @editor.getSelections()
-      range = selection.cursor.getCurrentWordBufferRange({wordRegex: WholeWordRegex})
-      selection.setBufferRange(range)
-      true
-
-class SelectAWholeWord extends TextObject
-  @extend()
-  select: ->
-    for selection in @editor.getSelections()
-      range = selection.cursor.getCurrentWordBufferRange({wordRegex: WholeWordRegex})
-      selection.setBufferRange(range)
-      loop
-        endPoint = selection.getBufferRange().end
-        char = @editor.getTextInRange(Range.fromPointWithDelta(endPoint, 0, 1))
-        break unless AllWhitespace.test(char)
-        selection.selectRight()
-      true
+class SelectWord extends TextObject
+  select: ->
+    for selection in @editor.getSelections()
+      wordRegex = @wordRegExp ? selection.cursor.wordRegExp()
+      @selectExclusive(selection, wordRegex)
+      @selectInclusive(selection) if @inclusive
+      not selection.isEmpty()
+
+  selectExclusive: (selection, wordRegex) ->
+    range = selection.cursor.getCurrentWordBufferRange({wordRegex})
+    selection.setBufferRange(range)
+
+  selectInclusive: (selection) ->
+    scanRange = selection.cursor.getCurrentLineBufferRange()
+    headPoint = selection.getHeadBufferPosition()
+    scanRange.start = headPoint
+    @editor.scanInBufferRange /\s+/, scanRange, ({range, stop}) ->
+      if headPoint.isEqual(range.start)
+        selection.selectToBufferPosition range.end
+        stop()
+
+class SelectInsideWord extends SelectWord
+  @extend()
+
+class SelectAWord extends SelectInsideWord
+  @extend()
+  inclusive: true
+
+class SelectInsideWholeWord extends SelectWord
+  @extend()
+  wordRegExp: /\S+/
+
+class SelectAWholeWord extends SelectInsideWholeWord
+  @extend()
+  inclusive: true

 # SelectInsideQuotes and the next class defined (SelectInsideBrackets) are
 # almost-but-not-quite-repeated code. They are different because of the depth


Use PluginError instead of console.log

Use PluginError instead of console.log

--- coffee/index.coffee
+++ coffee/index.coffee
@@ -1,6 +1,7 @@
-spawn = require('spawn-cmd').spawn
-through  = require 'through2'
-gutil = require 'gulp-util'
+spawn       = require('spawn-cmd').spawn
+through     = require 'through2'
+gutil       = require 'gulp-util'
+PluginError = gutil.PluginError

 PLUGIN_NAME = 'gulp-slim'

@@ -34,12 +35,10 @@
   through.obj (file, encoding, callback) ->

     if file.isNull()
-      @push file
-      return callback()
+      return callback null, file

     if file.isStream()
-      @emit 'error', new gutil.PluginError PLUGIN_NAME, 'Streaming not supported'
-      return callback()
+      return callback new PluginError PLUGIN_NAME, 'Streaming not supported'

     # relace the extension
     original_file_path = file.path
@@ -53,26 +52,26 @@
     eb = new Buffer 0

     # add data to buffer
-    program.stdout.on 'readable', =>
+    program.stdout.on 'readable', ->
       while chunk = program.stdout.read()
         b = Buffer.concat [b, chunk], b.length + chunk.length

     # return data
-    program.stdout.on 'end', =>
+    program.stdout.on 'end', ->
       file.contents = b
-      @push file
-      callback()
+      callback null, file

-    # Handle errors
-    program.stderr.on 'readable', =>
+    # handle errors
+    program.stderr.on 'readable', ->
       while chunk = program.stderr.read()
         eb = Buffer.concat [eb, chunk], eb.length + chunk.length

-    program.stderr.on 'end', =>
+    program.stderr.on 'end', ->
       if eb.length > 0
-        console.log("Slim error in file (" + original_file_path + "):\n" + eb)
-        process.exit(1)
+        err = eb.toString()
+        msg = "Slim error in file (#{original_file_path}):\n#{err}"
+        return callback new PluginError PLUGIN_NAME, msg

     # pass data to standard input
-    program.stdin.write file.contents, =>
+    program.stdin.write file.contents, ->
       program.stdin.end()


Add keys pageup/pagedown

Add keys pageup/pagedown

--- coffee/ruban.coffee
+++ coffee/ruban.coffee
@@ -28,8 +28,8 @@
     @bindHashChange()

   bindKeys: ->
-    key('right, down, space, return, j, l', @next)
-    key('left, up, backspace, k, h', @prev)
+    key('right, down, space, return, j, l, pagedown', @next)
+    key('left, up, backspace, k, h, pageup', @prev)

   bindGestures: ->
     Hammer(document, {


Tag are now open by default

Tag are now open by default

--- ZONE-watcher/app/assets/javascripts/items.js.coffee
+++ ZONE-watcher/app/assets/javascripts/items.js.coffee
@@ -26,8 +26,8 @@
   $(".row-favorite").hide()
   $(".row-list").hide()

-  $(".hideTag").hide();
-  $(".btn-toolbar").hide();
+  $(".showTag").hide();
+  #$(".btn-toolbar").hide();

   #action to show the tag on click
   $(".showTag").on "click", ->


Changed the ajax for the tooltip

Changed the ajax for the tooltip

--- ZONE-watcher/app/assets/javascripts/items.js.coffee
+++ ZONE-watcher/app/assets/javascripts/items.js.coffee
@@ -29,39 +29,22 @@

   #Generation of the popover of the tag
   $(".label-tag").each ->
-    btnOptionnal = "<button type='button' class='btn btn-info span12 btnTag' onclick='addTag(\"opt\",\"" + $(this).html() + "\",\"" + $(this).attr('filter-uri') + "\");closePop()'>"+ $("#titleOr").html() + "</button>
"
-    btnMust = "<button type='button' class='btn btn-success span12 btnTag paddingMust' onclick='addTag(\"must\",\"" + $(this).html() + "\",\"" + $(this).attr('filter-uri') + "\");closePop()'>"+ $("#titleAnd").html() + "</button>
"
-    btnBan = "<button type='button' class='btn btn-danger span12 btnTag' onclick='addTag(\"no\",\"" + $(this).html() + "\",\"" + $(this).attr('filter-uri') + "\");closePop()'>"+ $("#titleWithout").html() + "</button>"
-
-    name= $(this).html()
-    titleTag = ""+name + ""
-
-    tagContent = "

"+$("#titlePopover").html()+"

"+  btnOptionnal + "

" + btnMust + "

" + btnBan + "

"
+    $(this).popover
+        title: getPopoverTitle($(this).html())
+        content: getPopoverButton($(this).html())
+        placement: "bottom"
+        trigger: "manual"
+
+  $('.label-tag').click ->
     if ($(this).attr("data-uri").indexOf("/search_filters?uri=http%3A%2F%2Fwww.dbpedia.org") is 0)
       item = $(this)
       $.ajax
         url: item.attr("data-uri")
         timeout: 5000
         success: (data) ->
-          item.popover
-            title: titleTag
-            content: data + tagContent
-            placement: "bottom"
-            trigger: "manual"
+          $('.popover-content').html(data+getPopoverButton(item.html()))
         error: ->
-          item.popover
-            title: titleTag
-            content: tagContent
-            placement: "bottom"
-            trigger: "manual"
-    else
-       $(this).popover
-            title: titleTag
-            content: tagContent
-            placement: "bottom"
-            trigger: "manual"
-
-
+          $('.popover-content').html(getPopoverButton(item.html()))

   #Disable the default action onclick on the tag
   $(".label-tag").on "click", ->
@@ -78,3 +61,17 @@
   ), ->
     $(this).hide()
     $(this).prev(".showFavorite").fadeIn()
+
+getPopoverButton = (tagHtml) ->
+  btnOptionnal = "<button type='button' class='btn btn-info span12 btnTag' onclick='addTag(\"opt\",\"" + tagHtml + "\",\"" + $(this).attr('filter-uri') + "\");closePop()'>"+ $("#titleOr").html() + "</button>
"
+  btnMust = "<button type='button' class='btn btn-success span12 btnTag paddingMust' onclick='addTag(\"must\",\"" + tagHtml + "\",\"" + $(this).attr('filter-uri') + "\");closePop()'>"+ $("#titleAnd").html() + "</button>
"
+  btnBan = "<button type='button' class='btn btn-danger span12 btnTag' onclick='addTag(\"no\",\"" + tagHtml + "\",\"" + $(this).attr('filter-uri') + "\");closePop()'>"+ $("#titleWithout").html() + "</button>"
+
+  tagContent = "

"+$("#titlePopover").html()+"

"+  btnOptionnal + "

" + btnMust + "

" + btnBan + "

"
+
+  tagContent
+
+getPopoverTitle = (tagHtml) ->
+  titleTag = ""+tagHtml + ""
+
+  titleTag


show moar nice names

show moar nice names

--- src/coffee/content/mentions.coffee
+++ src/coffee/content/mentions.coffee
@@ -58,7 +58,7 @@
             doForEach player, true, 'anomaly', (anomaly) ->
                     $ '<img>'
                         .attr 'src', module.extension.getURL 'img/anomalies/' + anomaly + '.png'
-                        .attr 'alt', anomaly
+                        .attr 'alt', anomaly.replace(/_/g, ' ').capitalize true
                         .attr 'title', anomaly.replace(/_/g, ' ').capitalize true
                         .addClass 'iidentity-anomaly'
                 , (anomalyList) ->
@@ -174,8 +174,8 @@
             doForEach player, true, 'anomaly', (anomaly) ->
                     $ '<img>'
                         .attr 'src', module.extension.getURL 'img/anomalies/' + anomaly + '.png'
-                        .attr 'alt', anomaly
-                        .attr 'title', anomaly.capitalize true
+                        .attr 'alt', anomaly.replace(/_/g, ' ').capitalize true
+                        .attr 'title', anomaly.replace(/_/g, ' ').capitalize true
                         .addClass 'iidentity-anomaly'
                 , (anomalyList) ->
                     $wrapper.append(


Fixed issue with spinner not hiding on diff changes

--- app/assets/javascripts/merge_request_tabs.js.coffee
+++ app/assets/javascripts/merge_request_tabs.js.coffee
@@ -183,9 +183,10 @@
       else
         $diffLine = $('td', $diffLine)

-      $diffLine.addClass 'hll'
-      diffLineTop = $diffLine.offset().top
-      navBarHeight = $('.navbar-gitlab').outerHeight()
+      if $diffLine.length
+        $diffLine.addClass 'hll'
+        diffLineTop = $diffLine.offset().top
+        navBarHeight = $('.navbar-gitlab').outerHeight()

   loadBuilds: (source) ->
     return if @buildsLoaded


Correct a type on 'registerSource' name

Correct a type on 'registerSource' name

--- app/assets/javascripts/mixingpanel/source.js.coffee
+++ app/assets/javascripts/mixingpanel/source.js.coffee
@@ -61,13 +61,13 @@
   append: ->
     value = @getValue()
     @writeReferenceTouch(value)
-    if @registerSouce()
+    if @registerSource()
       @writeFirstTouch(value)
       @writeLastTouch(value)
       @writeSource(value)
       value

-  registerSouce: ->
+  registerSource: ->
     @utm.medium? or !@properties.isInternal()

   firstTouchIsExpired: ()->


loader widoczny przy kazdym ajaxie

loader widoczny przy kazdym ajaxie

--- app/assets/javascripts/oz-edit-modal-request.coffee
+++ app/assets/javascripts/oz-edit-modal-request.coffee
@@ -33,3 +33,12 @@
       return confirm("Jeśli wyjdziesz zmiany nie zostaną zapisane. Kontynuować?")

   return true
+$(document).ready ->
+  jQuery ($) ->
+    $(document).ajaxStop ->
+      $('#fancybox_loader_container').hide()
+      return
+    $(document).ajaxStart ->
+      $('#fancybox_loader_container').show()
+      return
+    return


remove the ajax stup

remove the ajax stup

--- app/assets/javascripts/simple_cms/simple_cms.coffee
+++ app/assets/javascripts/simple_cms/simple_cms.coffee
@@ -1,14 +1,6 @@
 //= require ckeditor/init_ckeditor
 //= require frontend_editor/frontend_editor
 //= require twitter/bootstrap
-#Send the csrf token before an ajax send for rails
-$.ajaxSetup
-  beforeSend: (xhr, settings) ->
-    csrf_token = $('meta[name="csrf-token"]').attr('content')
-    return if settings.crossDomain
-    return if settings.type == "GET"
-    if csrf_token
-      xhr.setRequestHeader('X-CSRF-Token', csrf_token)

 #Init the backbone application when jQuery is ready
 $(document).ready ->


omit empty attributes from rendering, and ensure .className is always on nodes

--- dom.coffee
+++ dom.coffee
@@ -96,7 +96,7 @@
 		@nodeType = type
 		@ownerDocument = ownerDocument
 		@childNodes = []
-		@attributes = {}
+		@attributes = { }
 		@listeners =
 			true: {}
 			false: {}
@@ -243,7 +243,8 @@
 			when Node.ELEMENT_NODE
 				Element::toString.call @, pretty, deep, indentLevel
 			when Node.ATTRIBUTE_NODE
-				"#{indent}#{@nodeName}=\"#{@nodeValue}\""
+				if @nodeValue isnt ""
+					"#{indent}#{@nodeName}=\"#{@nodeValue}\""
 			when Node.CDATA_SECTION_NODE
 				"#{indent}<![CDATA[#{@nodeValue}]]>" + newline
 			when Node.COMMENT_NODE
@@ -280,7 +281,7 @@
 		if o
 			@ownerDocument._private.idMap[value] = @
 		@attributes.id = value
-Node::__defineGetter__ 'className', () -> @attributes['class']
+Node::__defineGetter__ 'className', () -> @attributes['class'] or ""
 Node::__defineSetter__ 'className', (value) ->
 	if value in [null, undefined, "undefined"]
 		delete @attributes.class
@@ -373,11 +374,11 @@
 		else
 			indent = ""
 			newline = ""
-		attrs = (" #{a}=\"#{@attributes[a]}\"" for a of @attributes).join('')
+		attrs = ((" #{a}=\"#{@attributes[a]}\"" if @attributes[a] isnt "") for a of @attributes).join('')
 		len = @childNodes.length
-		end = ""
-		if len is 0
-			end = "/"
+		end = switch len
+			when 0 then "/"
+			else ""
 		ret = [indent + "<#{name}#{attrs}#{end}>" + newline]
 		r = 1
 		if deep


feat(funnel): fix github username regex

feat(funnel): fix github username regex

add "unassigned" to issues regex

--- scripts/gitter-activity-notifier.coffee
+++ scripts/gitter-activity-notifier.coffee
@@ -49,16 +49,16 @@
         message = ''
         #console.log('reposting', text)

-        comment = /\[Github\] (\w+) commented in (.+?\/.+?) on issue: (.*?) http.*?\/(\d+)#.*/
+        comment = /\[Github\] (\w[\w-]+) commented in (.+?\/.+?) on issue: (.*?) http.*?\/(\d+)#.*/
         # name:1; reponame:2; issuename:3; issueid:4

-        issue = /\[Github\] (\w+) (closed|opened|reopened|assigned|labeled) an issue in (.+?\/.+?): (.*?) http.*?\/(\d+)/
+        issue = /\[Github\] (\w[\w-]+) (closed|opened|reopened|assigned|unassigned|labeled) an issue in (.+?\/.+?): (.*?) http.*?\/(\d+)/
         # name:1; action:2; reponame:3; issuename:4; issueid:5

-        pr = /\[Github\] (\w+) (opened|closed|reopened|synchronize) a Pull Request to (.+?\/.+?): (.*?) http.*?\/(\d+)/
+        pr = /\[Github\] (\w[\w-]+) (opened|closed|reopened|synchronize) a Pull Request to (.+?\/.+?): (.*?) http.*?\/(\d+)/
         # name:1; action:2; reponame:3; prname:4; prid: 5;

-        commit = /\[Github\] (\w+) pushed (\d+) commit\(s\) to (.+?\/.+?) (http.*)/
+        commit = /\[Github\] (\w[\w-]+) pushed (\d+) commit\(s\) to (.+?\/.+?) (http.*)/
         # name:1; commits:2; reponame:3; compare:4;

         primg = '![](https://cdn0.iconfinder.com/data/icons/octicons/1024/git-pull-request-16.png)  '


Newly created modules should be loaded

Newly created modules should be loaded

--- scripts/views/workspace/menu/add.coffee
+++ scripts/views/workspace/menu/add.coffee
@@ -20,6 +20,7 @@
       e.preventDefault()

       model = new (@model.get('modelType'))()
+      model.loaded = true
       content.add(model)

       # Begin editing an item as soon as it is added.


Fix when adding a table with unassigned machine

--- admin/static/coffee/namespaces/index.coffee
+++ admin/static/coffee/namespaces/index.coffee
@@ -360,7 +360,8 @@
                 datacenter.set 'num_machines', 0

             for machine in machines.models
-                datacenters.get(machine.get('datacenter_uuid')).set 'num_machines',datacenter.get('num_machines')+1
+                if machine.get('datacenter_uuid')?
+                    datacenters.get(machine.get('datacenter_uuid')).set 'num_machines',datacenter.get('num_machines')+1

             ordered_datacenters = _.map(datacenters.models, (datacenter) ->
                 id: datacenter.get('id')