removes console log output

removes console log output

--- app/assets/javascripts/worldmap.coffee
+++ app/assets/javascripts/worldmap.coffee
@@ -67,7 +67,6 @@
     # d.properties contains the attributes (e.g. d.properties.name, d.properties.population)

     clickedCity = (d, i) ->
-      console.log("clicked city")
       if d.available & !isActiveCity(d) # only active and available cities do something on click
         d3.event.stopPropagation() # to prevent clickedWorldMap from triggering
         link = window.location.href.replace(options.current_region, d.regionkey)
@@ -77,7 +76,6 @@

     clickedWorldMap = (d, i) ->
       # hide all tooltips if world map clicked
-      console.log("worldmap clicked")
       d3.selectAll('.d3-tip').style
         opacity: 0
         'pointer-events': 'none'


make logger immutable

make logger immutable

--- src/sirius.coffee
+++ src/sirius.coffee
@@ -629,7 +629,13 @@
     if @mix_logger_into_controller
       if @controller_wrapper['logger']
         throw new Error("Logger method already in `controller_wrapper`")
-      @controller_wrapper['logger'] = @logger
+      l = @logger
+      @controller_wrapper['logger'] = {
+        info  : l.info
+        debug : l.debug
+        warn  : l.warn
+        error : l.error
+      }


Remove console logs.

Remove console logs.

--- app/coffee/modules/backlog/main.coffee
+++ app/coffee/modules/backlog/main.coffee
@@ -107,8 +107,6 @@
             resortAndSave()

         onAddItem = (event) ->
-            console.log "BacklogDirective:onAdd", event
-
             item = angular.element(event.item)
             itemScope = item.scope()
             itemIndex = item.index()
@@ -129,7 +127,6 @@

             ids = _.map($scope.userstories, "id")
             index = ids.indexOf(itemScope.us.id)
-            console.log "BacklogDirective:onRemove:0:", itemScope.us.id, index

             if index != -1
                 userstories = $scope.userstories
@@ -137,12 +134,10 @@

             item.off()
             itemScope.$destroy()
-            console.log "BacklogDirective:onRemove:1:", ids
-            console.log "BacklogDirective:onRemove:2:", _.map($scope.userstories, "id")

         dom = $el.find(".backlog-table-body")
         sortable = new Sortable(dom[0], {
-            group: "Kaka",
+            group: "backlog",
             selector: ".us-item-row",
             onUpdate: onUpdateItem
             onAdd: onAddItem
@@ -159,14 +154,13 @@
 BacklogSprintDirective = ($repo) ->
     link = ($scope, $el, $attrs) ->
         $ctrl = $el.closest("div.wrapper").controller()
-        console.log $ctrl

         sprint = $scope.$eval($attrs.tgBacklogSprint)
         if $scope.$first
             $el.addClass("sprint-current")

-        # if sprint.closed
-        #     $el.addClass("sprint-closed")
+        if sprint.closed
+            $el.addClass("sprint-closed")

         # Event Handlers
         $el.on "click", ".sprint-summary > a", (event) ->
@@ -189,8 +183,6 @@
                 console.log "FINISHED", arguments

         onUpdateItem = (event) ->
-            console.log "onUpdate", event
-
             item = angular.element(event.item)
             itemScope = item.scope()

@@ -202,8 +194,6 @@
             resortAndSave()

         onAddItem = (event) ->
-            console.log "onAdd", event
-
             item = angular.element(event.item)
             itemScope = item.scope()
             itemIndex = item.index()
@@ -219,15 +209,11 @@
             resortAndSave()

         onRemoveItem = (event) ->
-            console.log "BacklogSprintDirective:onRemove", event
-
             item = angular.element(event.item)
             itemScope = item.scope()

             ids = _.map($scope.sprint.user_stories, "id")
             index = ids.indexOf(itemScope.us.id)
-
-            console.log "BacklogSprintDirective:onRemove:0:", itemScope.us.id, index

             if index != -1
                 userstories = $scope.sprint.user_stories
@@ -235,12 +221,10 @@

             item.off()
             itemScope.$destroy()
-            console.log "BacklogSprintDirective:onRemove:1", ids
-            console.log "BacklogSprintDirective:onRemove:2", _.map($scope.sprint.user_stories, "id")

         dom = $el.find(".sprint-table")
         sortable = new Sortable(dom[0], {
-            group: "Kaka",
+            group: "backlog",
             selector: ".milestone-us-item-row",
             onUpdate: onUpdateItem,
             onAdd: onAddItem,


extended triggers handling

extended triggers handling

--- lib/assets/javascripts/websocket_rails/websocket_rails.js.coffee
+++ lib/assets/javascripts/websocket_rails/websocket_rails.js.coffee
@@ -70,8 +70,13 @@
     for socket_message in data
       event = new WebSocketRails.Event( socket_message )
       if event.is_result()
-        q = if @queue[event.name]?[event.id]? then @queue[event.name][event.id] else @queue[event.id]
-        q?.run_callbacks(event.success, event.data)
+        qu = if @queue[event.name]?[event.id]? then @queue[event.name][event.id] else @queue[event.id]
+        if qu?
+          if qu.length?
+            for q in qu
+              q?.run_callbacks(event.success, event.data)
+          else
+            qu?.run_callbacks(event.success, event.data)
         delete @queue[event.name][event.id] if @queue[event.name]?[event.id]?
         delete @queue[event.name] if @queue[event.name]? and Object.keys(@queue[event.name]).length == 0
         delete @queue[event.id] if @queue[event.id]?


Bind mouseup and mousemove to the window

--- src/controller.coffee
+++ src/controller.coffee
@@ -178,8 +178,11 @@

       # ## Tracker Events
       # We allow binding to the tracker element.
-      for eventName in ['mousedown', 'mouseup', 'mousemove'] then do (eventName) =>
-        @iceElement.addEventListener eventName, (event) =>
+      for eventName, element of {
+          mousedown: @iceElement
+          mouseup: window
+          mousemove: window } then do (eventName, element) =>
+        element.addEventListener eventName, (event) =>
           trackPoint = @getPointRelativeToTracker event

           # We keep a state object so that handlers
@@ -402,10 +405,20 @@
   Editor::trackerOffset = (el) ->
     x = y = 0

+    subtractIceElementOffset = =>
+      el = @iceElement
+      until el is null
+        x -= el.offsetLeft - el.scrollLeft
+        y -= el.offsetTop - el.scrollTop
+        el = el.offsetParent
+
     until el is @iceElement
+      if el is null
+        # if outside iceElement, then subtract iceElement's offset.
+        do subtractIceElementOffset
+        break
       x += el.offsetLeft - el.scrollLeft
       y += el.offsetTop - el.scrollTop
-
       el = el.offsetParent

     return new draw.Point x, y


Only squash mousedown events, not other mouse events.

--- src/controller.coffee
+++ src/controller.coffee
@@ -254,15 +254,16 @@
         for handler in editorBindings[event.type]
           handler.call this, trackPoint, event, state

-        # Stop event propagation so that
+        # Stop mousedown event propagation so that
         # we don't get bad selections
-        event.stopPropagation?()
-        event.preventDefault?()
-
-        event.cancelBubble = true
-        event.returnValue = false
-
-        return false
+        if event.type is 'mousedown'
+          event.stopPropagation?()
+          event.preventDefault?()
+
+          event.cancelBubble = true
+          event.returnValue = false
+
+          return false

       dispatchKeyEvent = (event) =>
         # We keep a state object so that handlers


Fix bug creating multiline sockets

Fix bug creating multiline sockets

--- src/controller.coffee
+++ src/controller.coffee
@@ -2176,7 +2176,7 @@

     first = last = new model.TextToken lines[0]
     for line, i in lines when i > 0
-      last = helper.connect new model.NewlineToken(), last
+      last = helper.connect last, new model.NewlineToken()
       last = helper.connect last, new model.TextToken line

     @spliceIn (new model.List(first, last)), socket.start


:bug: Fix broken test cases

:bug: Fix broken test cases

These test cases were not running due to indentation errors.
The tests for commands 'dj' and 'dk' now correctly fail.

--- spec/operators-spec.coffee
+++ spec/operators-spec.coffee
@@ -278,55 +278,61 @@

     describe "when followed by an j", ->
       beforeEach ->
-        originalText = "12345\nabcde\nABCDE"
-        editor.setText(originalText)
-
-        describe "on the beginning of the file", ->
+        @originalText = "12345\nabcde\nABCDE"
+        editor.setText(@originalText)
+
+      describe "on the beginning of the file", ->
+        beforeEach ->
           editor.setCursorScreenPosition([0, 0])
-          it "deletes the next two lines", ->
-            keydown('d')
-            keydown('j')
-            expect(editor.getText()).toBe("ABCDE")
-
-        describe "on the end of the file", ->
-          editor.setCursorScreenPosition([4,2])
-          it "deletes nothing", ->
-            keydown('d')
-            keydown('j')
-            expect(editor.getText()).toBe(originalText)
-
-        describe "on the middle of second line", ->
-          editor.setCursorScreenPosition([2,1])
-          it "deletes the last two lines", ->
-            keydown('d')
-            keydown('j')
-            expect(editor.getText()).toBe("12345")
+        it "deletes the next two lines", ->
+          keydown('d')
+          keydown('j')
+          expect(editor.getText()).toBe("ABCDE")
+
+      describe "on the end of the file", ->
+        beforeEach ->
+          editor.setCursorScreenPosition([2, 4])
+        it "deletes nothing", ->
+          keydown('d')
+          keydown('j')
+          expect(editor.getText()).toBe(@originalText)
+
+      describe "on the middle of second line", ->
+        beforeEach ->
+          editor.setCursorScreenPosition([1,2])
+        it "deletes the last two lines", ->
+          keydown('d')
+          keydown('j')
+          expect(editor.getText()).toBe("12345")

     describe "when followed by an k", ->
       beforeEach ->
-        originalText = "12345\nabcde\nABCDE"
-        editor.setText(originalText)
-
-        describe "on the end of the file", ->
-          editor.setCursorScreenPosition([4, 2])
-          it "deletes the bottom two lines", ->
-            keydown('d')
-            keydown('k')
-            expect(editor.getText()).toBe("ABCDE")
-
-        describe "on the beginning of the file", ->
+        @originalText = "12345\nabcde\nABCDE"
+        editor.setText(@originalText)
+
+      describe "on the end of the file", ->
+        beforeEach ->
+          editor.setCursorScreenPosition([2,4])
+        it "deletes the bottom two lines", ->
+          keydown('d')
+          keydown('k')
+          expect(editor.getText()).toBe("ABCDE")
+
+      describe "on the beginning of the file", ->
+        beforeEach ->
           editor.setCursorScreenPosition([0,0])
-          it "deletes nothing", ->
-            keydown('d')
-            keydown('k')
-            expect(editor.getText()).toBe(originalText)
-
-        describe "when on the middle of second line", ->
-          editor.setCursorScreenPosition([2,1])
-          it "deletes the first two lines", ->
-            keydown('d')
-            keydown('k')
-            expect(editor.getText()).toBe("12345")
+        it "deletes nothing", ->
+          keydown('d')
+          keydown('k')
+          expect(editor.getText()).toBe(@originalText)
+
+      describe "when on the middle of second line", ->
+        beforeEach ->
+          editor.setCursorScreenPosition([1,2])
+        it "deletes the first two lines", ->
+          keydown('d')
+          keydown('k')
+          expect(editor.getText()).toBe("12345")

   describe "the D keybinding", ->
@@ -479,11 +485,11 @@
         keydown('y')
         keydown('h')

-        it "saves the left letter to the default register", ->
-          expect(vimState.getRegister('"').text).toBe " "
-
-        it "moves the cursor position to the left", ->
-          expect(editor.getCursorScreenPosition()).toEqual [0, 3]
+      it "saves the left letter to the default register", ->
+        expect(vimState.getRegister('"').text).toBe " "
+
+      it "moves the cursor position to the left", ->
+        expect(editor.getCursorScreenPosition()).toEqual [0, 3]

     describe "with a down motion", ->
       beforeEach ->


add test spec for fix of issue #255

add test spec for fix of issue #255

--- spec/operators-spec.coffee
+++ spec/operators-spec.coffee
@@ -23,8 +23,8 @@
     opts.raw = true
     keydown(key, opts)

-  describe "cancel operation", ->
-    it "cannot cancel operation if no operator pending", ->
+  describe "cancel operation is robust", ->
+    it "can call cancel operation, even if no operator pending", ->
       expect(-> vimState.pushOperations(new Input(''))).toThrow()

       # make sure commandModeInputView is created


Remove commented code from `pattern_tokenizer.coffee` because it is unused

--- lib/twitter_cldr/js/mustache/tokenizers/pattern_tokenizer.coffee
+++ lib/twitter_cldr/js/mustache/tokenizers/pattern_tokenizer.coffee
@@ -8,13 +8,6 @@
     @tokenizer.tokenize(@expand(pattern))

   expand : (pattern) ->
-    # if typeof(pattern) is "string"
-    #   path = (pattern + "").split(".")
-    #   data = (if @data_reader? then @data_reader.pattern_at_path(path) else null)
-    #   next_pattern = (if data["pattern"]? then data["pattern"] else data)
-    #   expand_pattern(next_pattern)
-    # else
-    # TODO - figure thsi out.
     if pattern instanceof Object
       result = {}
       for key, value of pattern


Just inherit stdio if we're logging.

Just inherit stdio if we're logging.

--- build/tasks/spec-task.coffee
+++ build/tasks/spec-task.coffee
@@ -109,6 +109,9 @@
             ATOM_INTEGRATION_TESTS_ENABLED: true
           )

+    if logOutput
+      options.opts.stdio = 'inherit'
+
     grunt.log.ok "Launching core specs."
     spawn options, (error, results, code) ->
       if process.platform is 'win32'


Re-enable flake8 package

Re-enable flake8 package

It seems to be working again.

--- atom/config.cson
+++ atom/config.cson
@@ -51,7 +51,6 @@
       "teletype"
       "spell-check"
       "linter-shellcheck"
-      "linter-flake8"
       "github"
     ]
     followSymlinks: false


Add Elixir configuration to Atom

Add Elixir configuration to Atom

--- atom/config.cson
+++ atom/config.cson
@@ -86,15 +86,64 @@
     showErrorPanel: false
     statusIconPosition: "Right"
     lintOnFly: false
-".basic.html.text":
+".elixir.html.text":
   editor:
     preferredLineLength: 100
 ".erb.html.text":
   editor:
     preferredLineLength: 100
-".elixir.html.text":
+".basic.html.text":
   editor:
     preferredLineLength: 100
+".source.yaml":
+  editor:
+    preferredLineLength: 100
+".elixir.source":
+  editor:
+    preferredLineLength: 100
+".elixir.text":
+  editor:
+    preferredLineLength: 100
+".ruby.source":
+  editor:
+    preferredLineLength: 100
+".pyjade.source":
+  editor:
+    preferredLineLength: 100
+".jade.source":
+  editor:
+    preferredLineLength: 100
+".haml.text":
+  "wrap-guide":
+    enabled: false
+  editor:
+    preferredLineLength: 100
+".hamlc.text":
+  editor:
+    preferredLineLength: 100
+".asciidoc.source":
+  "wrap-guide":
+    enabled: false
+  editor:
+    softWrap: true
+".python.source":
+  editor:
+    tabLength: 4
+".json.source":
+  "wrap-guide":
+    enabled: false
+".c.source":
+  editor:
+    tabLength: 4
+".shell.source":
+  editor:
+    tabLength: 4
+".git-commit.text":
+  editor:
+    preferredLineLength: 72
+".java.source":
+  editor:
+    tabLength: 4
 ".gfm.source":
   editor:
     showInvisibles: false
@@ -103,52 +152,3 @@
     preferredLineLength: 100
   "wrap-guide":
     enabled: false
-".java.source":
-  editor:
-    tabLength: 4
-".git-commit.text":
-  editor:
-    preferredLineLength: 72
-".shell.source":
-  editor:
-    tabLength: 4
-".c.source":
-  editor:
-    tabLength: 4
-".json.source":
-  "wrap-guide":
-    enabled: false
-".python.source":
-  editor:
-    tabLength: 4
-".asciidoc.source":
-  "wrap-guide":
-    enabled: false
-  editor:
-    softWrap: true
-".hamlc.text":
-  editor:
-    preferredLineLength: 100
-".haml.text":
-  "wrap-guide":
-    enabled: false
-  editor:
-    preferredLineLength: 100
-".jade.source":
-  editor:
-    preferredLineLength: 100
-".pyjade.source":
-  editor:
-    preferredLineLength: 100
-".ruby.source":
-  editor:
-    preferredLineLength: 100
-".elixir.text":
-  editor:
-    preferredLineLength: 100
-".elixir.source":
-  editor:
-    preferredLineLength: 100
-".source.yaml":
-  editor:
-    preferredLineLength: 100


Atom - Prettier configs

Atom - Prettier configs

--- atom/config.cson
+++ atom/config.cson
@@ -21,6 +21,11 @@
     showPanel: true
   "markdown-writer":
     fileExtension: ".md"
+  "prettier-atom":
+    formatOnSaveOptions:
+      enabled: true
+    prettierOptions:
+      singleQuote: true
 ".shell.source":
   editor:
     scrollPastEnd: true


Taille de police par défaut passe à 13

Taille de police par défaut passe à 13

--- atom/config.cson
+++ atom/config.cson
@@ -9,6 +9,7 @@
   editor:
     autoIndentOnPaste: false
     fontFamily: "Source Code Pro, Source Code Pro for Powerline"
+    fontSize: 13
     invisibles: {}
     preferredLineLength: 120
     showIndentGuide: true


DRY up a bit

DRY up a bit

--- services/real-time/app/coffee/WebsocketController.coffee
+++ services/real-time/app/coffee/WebsocketController.coffee
@@ -91,38 +91,28 @@
 				return callback(error) if error?
 				DocumentUpdaterManager.getDocument project_id, doc_id, fromVersion, (error, lines, version, ranges, ops) ->
 					return callback(error) if error?
+
 					# Encode any binary bits of data so it can go via WebSockets
 					# See http://ecmanaut.blogspot.co.uk/2006/07/encoding-decoding-utf8-in-javascript.html
+					encodeForWebsockets = (text) -> unescape(encodeURIComponent(text))
 					escapedLines = []
 					for line in lines
 						try
-							line = unescape(encodeURIComponent(line))
+							line = encodeForWebsockets(line)
 						catch err
 							logger.err {err, project_id, doc_id, fromVersion, line, client_id: client.id}, "error encoding line uri component"
 							return callback(err)
 						escapedLines.push line
 					if options.encodeRanges
-						if ranges.comments
-							escapedComments = []
-							for comment in ranges.comments
-								try
-									comment.op.c = unescape(encodeURIComponent(comment.op.c))
-								catch err
-									logger.err {err, project_id, doc_id, fromVersion, comment, client_id: client.id}, "error encoding comment uri component"
-									return callback(err)
-								escapedComments.push comment
-							ranges.comments = escapedComments
-						if ranges.changes
-							escapedChanges = []
-							for change in ranges.changes
-								try
-									change.op.i = unescape(encodeURIComponent(change.op.i)) if change.op.i
-									change.op.d = unescape(encodeURIComponent(change.op.d)) if change.op.d
-								catch err
-									logger.err {err, project_id, doc_id, fromVersion, change, client_id: client.id}, "error encoding change uri component"
-									return callback(err)
-								escapedChanges.push change
-							ranges.changes = escapedChanges
+						try
+							for comment in ranges?.comments or []
+								comment.op.c = encodeForWebsockets(comment.op.c)
+							for change in ranges?.changes or []
+								change.op.i = encodeForWebsockets(comment.op.i) if change.op.i
+								change.op.d = encodeForWebsockets(comment.op.d) if change.op.d
+						catch err
+							logger.err {err, project_id, doc_id, fromVersion, ranges, client_id: client.id}, "error encoding range uri component"
+							return callback(err)

 					AuthorizationManager.addAccessToDoc client, doc_id
 					client.join(doc_id)


fixes for filepaths handling

fixes for filepaths handling

--- server/import-api.coffee
+++ server/import-api.coffee
@@ -130,13 +130,13 @@
             if property.path?

                 #create destination filename and path
-                dest_fname = fileid + "_" + property.name.replace(/.*\//,"") #TODO: check how sometimes name has also path information
-                dest_path  = "#{PUBLIC}/#{dest_dir}/#{dest_fname}" #absolute path (assumes files are stored under public folder)
+                dest_fname = fileid + "_" + property.name.replace(/.*\//,"") #sometimes name has also path information
+                dest_path  = "#{dest_dir}/#{dest_fname}"
                 #console.log "moving file: " + property.path + " to: " + dest_path #debug

                 # copy files
                 src_stream = fs.createReadStream property.path
-                dst_stream = fs.createWriteStream dest_path
+                dst_stream = fs.createWriteStream "#{PUBLIC}/#{dest_path}" #absolute path (assumes files are stored under public folder)
                 util.pump src_stream,dst_stream, (err) ->
                     return cb err if err?

@@ -144,9 +144,9 @@
                     property_tmp = _.clone property
                     stored_files[fileid] =
                         name: dest_fname
-                        path: dest_dir
+                        path: dest_path
                         type: property_tmp.type
-                        origname: property_tmp.name.replace(/.*\//,"") #TODO: check how sometimes name has also path information
+                        origname: property_tmp.name.replace(/.*\//,"") #sometimes name has also path information
                     cb null

     # run file move operations
@@ -206,7 +206,7 @@
                 fields["stack-trace"] = stackdata

                 #parse rich-core
-                rcoreparser.parse_rich_core files["rich-core"], (err, rcoredata) ->
+                rcoreparser.parse_rich_core files["rich-core"].path, (err, rcoredata) ->
                     if err?
                         res.send {"ok":"0","errors":err}
                         return remove_files files #cleanup


PlayerView: changed how subviews are constructed.

The previous construct was silly. this is much cleaner.

--- coffee/src/views/player_view.coffee
+++ coffee/src/views/player_view.coffee
@@ -18,15 +18,20 @@
     @eventhub.on 'show:splash', => @content @splashView()
     @eventhub.on 'show:content', => @content @contentView()

-  # retrieves (and may initialize and render) subviews
-  subview: (name, cls, options) =>
-    options ?= {}
-    key = "_#{name}"
-    if not @[key]
-      @[key] = new cls _.extend {eventhub: @, model: @model}, options
-      @[key].render()
-    @[key]
+  contentView: =>
+    @_contentView ?= new acorn.player.ContentView
+      eventhub: @eventhub
+      model: @model
+    @_contentView

-  contentView: (opts) => @subview 'contentView', player.ContentView, opts
-  splashView: (opts) => @subview 'splashView', player.SplashView, opts
-  editView: (opts) => @subview 'editView', player.EditView, opts
+  splashView: =>
+    @_splashView ?= new acorn.player.SplashView
+      eventhub: @eventhub
+      model: @model.acornModel
+    @_splashView
+
+  editView: =>
+    @_editView ?= new acorn.player.EditView
+      eventhub: @eventhub
+      model: @model
+    @_editView


Added comment.

Added comment.

--- server/lib/worker.coffee
+++ server/lib/worker.coffee
@@ -76,6 +76,7 @@
           catch error
             job.fail EJSON.toJSONValue error.stack or error.toString?() or error
             continue
+          # TODO: Mark as ready all resolved dependent jobs
           job.done EJSON.toJSONValue result
         catch error
           Log.error "Error running a job queue: #{ error.stack or error.toString?() or error }"


Add mandatory transaction date to spec data

--- spec/coffeescripts/models/transactions/month_spec.coffee
+++ spec/coffeescripts/models/transactions/month_spec.coffee
@@ -2,7 +2,7 @@
   it 'populates transactions attribute as transactions collection', ->
     month = new LedgerWeb.Models.Transactions.Month
       month: '2013/12'
-      transactions: [payee: 'my payee']
+      transactions: [payee: 'my payee', date: '2013/12/01']
     (expect month.get('transactions') instanceof LedgerWeb.Collections.Transactions).toBeTruthy()

   it 'parses the date strings into javascript dates', ->


WIP organizing classes

WIP organizing classes

--- app/static/coffee/gbrowse/Hello.coffee
+++ app/static/coffee/gbrowse/Hello.coffee
@@ -1,11 +1,29 @@
+
+class App
+    constructor: () ->
+        @data = new Data()
+        #@pageNumber = new PageNumber(pages = 10, currentPage = 1)
+        #@pageNumber2 = new PageNumber(pages = 20, currentPage = 5)
+        @table = new Table(@data)
+        #@filter = new Filter()
+    view: ->
+        [
+            #try m("div", ["object1" ,@pageNumber.view()])
+            #try m("div", ["object2" ,@pageNumber2.view()])
+            #try m("div", ["object1" ,@pageNumber.view()])
+            try header.view()
+            try @filter.view()
+            try @table.view()
+
+        ]

 class Data
+    #model
     resp = {}
     meta=(response)->
         resp.headers = response.head.vars
         resp.genomes = response.results.bindings
         return
-    #controller
     constructor: () ->
         m.request(
             method: "POST",
@@ -13,23 +31,12 @@
             data: {}
             datatype: 'json'
             type: meta)
-    data: () ->
+    #controller
+    response: () ->
         return resp
-
-class PageNumber
-    constructor: (pages = 1, currentPage = 1) ->
-        @pages = pages
-        @currentPage= m.prop(currentPage)
-    next: ->
-        @currentPage() * 1 + 1
-    view: -> [
-        [
-            m('button',{onclick: m.withAttr("value", @currentPage), "value": x},[x])
-            #if x % 10 == 0
-            #    m("br")
-        ] for x in [1 .. @pages]
-        m('text',[@currentPage()])
-    ]
+    #view
+    view: () ->
+        return JSON.stringify(resp)

 class Table
     ###
@@ -46,7 +53,7 @@
     constructor: (data) ->
         @data = data
     view: () ->
-        data = @data.data()
+        data = @data.response()
         pageY = state.pageY
         begin = pageY / 46 | 0
         end = begin + (state.pageHeight /46 | 0 + 2)
@@ -73,25 +80,8 @@
         ])

-class App
-    constructor: () ->
-        @data = new Data()
-        #@pageNumber = new PageNumber(pages = 10, currentPage = 1)
-        #@pageNumber2 = new PageNumber(pages = 20, currentPage = 5)
-        @table = new Table(@data)
-        @filter = new Filter()
-    view: ->
-        [
-            try @v.view.text
-            try m("div", ["object1" ,@pageNumber.view()])
-            try m("div", ["object2" ,@pageNumber2.view()])
-            try m("div", ["object1" ,@pageNumber.view()])
-            try header.view()
-            try @filter.view()
-            try @table.view()
-
-        ]

+###
 class Filter
     constructor: (data) ->
         @data = data
@@ -107,4 +97,22 @@
         m('text',[@input_text()])
         m 'br'
         m('text',[@search_term()])
-    ]+    ]
+###
+
+###
+class PageNumber
+    constructor: (pages = 1, currentPage = 1) ->
+        @pages = pages
+        @currentPage= m.prop(currentPage)
+    next: ->
+        @currentPage() * 1 + 1
+    view: -> [
+        [
+            m('button',{onclick: m.withAttr("value", @currentPage), "value": x},[x])
+            #if x % 10 == 0
+            #    m("br")
+        ] for x in [1 .. @pages]
+        m('text',[@currentPage()])
+    ]
+###


Modified in browser at pixie.strd6.com

Modified in browser at pixie.strd6.com

--- src/sprite.coffee
+++ src/sprite.coffee
@@ -56,6 +56,7 @@
     @param {Number} x Position on the x axis to draw the sprite
     @param {Number} y Position on the y axis to draw the sprite
     @param {Number} width
+    @param {Number} height
     ###
     fill: (canvas, x, y, width, height, repeat="repeat") ->
       pattern = canvas.createPattern(image, repeat)


converted instance methods to class methods for KDTooltip

--- components/tooltip/KDTooltip.coffee
+++ components/tooltip/KDTooltip.coffee
@@ -114,8 +114,7 @@

   display:(o = @getOptions())->

-    # converts NESW-Values to topbottomleftright and retains them in
-    # @getOptions
+    # converts NESW-Values to topbottomleftright and retains them in @getOptions
     o = @translateCompassDirections o if o.gravity
     o.gravity = null

@@ -136,80 +135,15 @@
         height  : selector.height()
         width   : selector.width()

-    # get default coordinates for tooltip placement
-    getCoordsFromPositionValues = (placement,direction)=>
-
-      c = # coordinates
-        top  : d.selector.offset.top
-        left : d.selector.offset.left
-
-      cDiff = (dimensions,type,center=no)->
-        (dimensions.selector[type]-dimensions.container[type])/(1+center)
-        # if center then diff/2 else diff
-
-      getCoordsFromPlacement = (coordinates,dimensions,placement,direction)->
-        [staticAxis,dynamicAxis,staticC,dynamicC,exclusion] =
-          if /o/.test placement then ['height','width','top','left','right']
-          else ['width','height','left','top','bottom']
-        coordinates[staticC]+= unless placement.length<5
-            (dimensions.selector[staticAxis]+10)
-          else -(dimensions.container[staticAxis]+10)
-        unless direction is exclusion
-          coordinates[dynamicC]+=cDiff(dimensions,dynamicAxis,direction is 'center')
-        return coordinates
-
-      return getCoordsFromPlacement c,d,placement,direction
-
-      # return c
-
-      # switch placement
-      #   when 'top'
-      #     c.top       -= d.container.height+10
-      #     unless direction is 'right'
-      #       c.left += cDiff(d,'width',direction is 'center')
-      #   when 'bottom'
-      #     c.top       += d.selector.height+10
-      #     unless direction is 'right'
-      #       c.left  += cDiff(d,'width',direction is 'center')
-      #   when 'right'
-      #     c.left      += d.selector.width+10
-      #     unless direction is 'bottom'
-      #       c.top   += cDiff(d,'height',direction is 'center')
-      #   when 'left'
-      #     c.left      -= d.container.width+10
-      #     unless direction is 'bottom'
-      #       c.top   += cDiff(d,'height',direction is 'center')
-
-          # switch direction
-          #   when 'left'
-          #     c.left  += cDiff(d,'width')
-          #   when 'center'
-          #     c.left  += cDiff(d,'width',yes)
-          # switch direction
-          #   when 'left'
-          #     c.left  += cDiff(d,'width')
-          #   when 'center'
-          #     c.left  += cDiff(d,'width',yes)
-          # switch direction
-          #   when 'top'
-          #     c.top   += cDiff(d,'height')
-          #   when 'center'
-          #     c.top   += cDiff(d,'height',yes)
-          # switch direction
-          #   when 'top'
-          #     c.top   += cDiff(d,'height')
-          #   when 'center'
-          #     c.top   += cDiff(d,'height',yes)
-      # return c
-
     {placement,direction} = positionValues

     # check the default values for overlapping boundaries, then
     # recalculate if there are overlaps

-    violations = boundaryViolations getCoordsFromPositionValues(placement, direction), d.container.width, d.container.height
-
-    if Object.keys(violations).length > 0
+    violations = boundaryViolations getCoordsFromPlacement(d, placement, direction),\
+    d.container.width, d.container.height
+
+    if Object.keys(violations).length > 0 # check for possible alternatives
       variants = [
         ['top','right']
         ['right','top']
@@ -226,12 +160,13 @@
       ]

       for variant in variants
-        if Object.keys(boundaryViolations(getCoordsFromPositionValues(variant[0],variant[1]), d.container.width, d.container.height)).length is 0
+        if Object.keys(boundaryViolations(getCoordsFromPlacement(d,variant[0],variant[1]),\
+        d.container.width, d.container.height)).length is 0
           [placement,direction] = variant
           break

     correctValues =
-      coords : getCoordsFromPositionValues placement, direction
+      coords : getCoordsFromPlacement d, placement, direction
       placement : placement
       direction : direction

@@ -326,7 +261,7 @@
     left    : "left"
     right   : "right"

-# will return an object with the amount of clipped pixels
+  # will return an object with the amount of clipped pixels
   boundaryViolations = (coordinates,width,height)=>
     violations = {}
     if coordinates.left < 0
@@ -338,3 +273,21 @@
     if coordinates.top+height > window.innerHeight
       violations.bottom = coordinates.top+height-window.innerHeight
     violations
+
+  getCoordsDiff = (dimensions,type,center=no)->
+    diff = dimensions.selector[type]-dimensions.container[type]
+    if center then diff/2 else diff
+
+  getCoordsFromPlacement = (dimensions,placement,direction)->
+    coordinates =
+      top  : dimensions.selector.offset.top
+      left : dimensions.selector.offset.left
+    [staticAxis,dynamicAxis,staticC,dynamicC,exclusion] =
+      if /o/.test placement then ['height','width','top','left','right']
+      else ['width','height','left','top','bottom']
+    coordinates[staticC]+= unless placement.length<5
+        (dimensions.selector[staticAxis]+10)
+      else -(dimensions.container[staticAxis]+10)
+    unless direction is exclusion
+      coordinates[dynamicC]+=getCoordsDiff(dimensions,dynamicAxis,direction is 'center')
+    return coordinates


add null checks and defaults for the cached smoke test results

--- services/clsi/app.coffee
+++ services/clsi/app.coffee
@@ -45,14 +45,19 @@
 	contentType:(@setContentType)->
 	send:(@code, @body)->

+	#default the server to be down
+	code:500
+	body:{}
+	setContentType:"application/json"
+
 do runSmokeTest = ->
 	logger.log("running smoke tests")
 	smokeTest.run(require.resolve(__dirname + "/test/smoke/js/SmokeTests.js"))({}, resCacher)
 	setTimeout(runSmokeTest, 20 * 1000)

 app.get "/health_check", (req, res)->
-	res.contentType(resCacher.setContentType)
-	res.send resCacher.code, resCacher.body
+	res.contentType(resCacher?.setContentType)
+	res.send resCacher?.code, resCacher?.body

 app.use (error, req, res, next) ->
 	logger.error err: error, "server error"


Fix adjusting for whitespace in playercode

--- app/views/play/level/tome/Spell.coffee
+++ app/views/play/level/tome/Spell.coffee
@@ -76,7 +76,7 @@
       # Pull apart the structural wrapper code and the player code, remember the wrapper code, and strip indentation on player code.
       playerCode = @originalSource.match(/<playercode>\n([\s\S]*)\n *<\/playercode>/)[1]
       playerCodeLines = playerCode.split('\n')
-      indentation = playerCodeLines[0].length - playerCodeLines[0].trim().length
+      indentation = _.min(_.filter(playerCodeLines.map (line) -> line.match(/^\s*/)?[0]?.length))
       playerCode = (line.substr(indentation) for line in playerCodeLines).join('\n')
       @wrapperCode = @originalSource.replace /<playercode>[\s\S]*<\/playercode>/, '☃'  # ☃ serves as placeholder for constructHTML
       @originalSource = playerCode


only query if both params exists

only query if both params exists

--- client/ride2go.coffee
+++ client/ride2go.coffee
@@ -113,6 +113,7 @@
     App.socket.emit "debug", msg

 sendquery = ->
+    return unless App.from.geoobject and App.to.geoobject
     console.log("send query to server")
     #send App.from
     #send App.to.geoobject


fixed history prev/next

fixed history prev/next

--- client/session.coffee
+++ client/session.coffee
@@ -3,9 +3,9 @@
   # keep track of which lines have been modified and preserve the original content
   mod = {} # line number -> original content

-  hist = [null]
+  hist = ['']
   histIndex = 0
-  histAdd = (lines) -> hist = [null].concat lines, hist[1..]
+  histAdd = (lines) -> hist[0] = ''; hist[1...1] = lines; histIndex = 0; return
   histMove = (d) ->
     i = histIndex + d
     if i < 0 then $.alert 'There is no next line', 'Dyalog APL Error'
@@ -40,15 +40,10 @@
   exec = (trace) ->
     a = [] # pairs of [lineNumber, contentToExecute]
     for l, s of mod # l: line number, s: original content
-      l = +l
-      cm.removeLineClass l, 'background', 'modified'
-      a.push [l, (e = cm.getLine l)]
+      l = +l; cm.removeLineClass l, 'background', 'modified'; a.push [l, (e = cm.getLine l)]
       cm.replaceRange s, {line: l, ch: 0}, {line: l, ch: e.length}, 'D'
     if !a.length then a = [[(l = cm.getCursor().line), cm.getLine l]]
-    a.sort (x, y) -> x[0] - y[0]
-    opts.exec? (es = for [l, e] in a then e), trace
-    histAdd es
-    mod = {}
+    a.sort((x, y) -> x[0] - y[0]); es = (for [_, e] in a when e then e); opts.exec? es, trace; mod = {}; histAdd es; return

   cm.on 'beforeChange', (_, c) ->
     if c.origin != 'D'


Remove typo

Remove typo

--- index.coffee
+++ index.coffee
@@ -122,7 +122,7 @@

   track_strategy(context, 'ask_for_feed')
   feed = parseInt context.text.replace(/[\+|\s|\-|\D|\,]/g, '')
-  if _.isNumber(feed)m and hammurabi.is_valid_feed(context)
+  if _.isNumber(feed) and hammurabi.is_valid_feed(context)
     context.game_responses.feed = feed

   return context.send _.sample(game_questions.feed)


Creative mode sets inventory to infinite piles of all items

--- index.coffee
+++ index.coffee
@@ -127,6 +127,10 @@

   game.mode = 'survival'

+  playerInventory = new Inventory(10)
+  toolbar = createToolbar {el: '#tools'}
+  inventoryToolbar = plugins.load 'inventory-toolbar', {toolbar:toolbar, inventory:playerInventory, registry:registry}
+
   haveMouseInteract = false
   game.interact.on 'attain', () => haveMouseInteract = true
   game.interact.on 'release', () => haveMouseInteract = false
@@ -148,6 +152,13 @@
         game.mode = 'creative'
         game.plugins.enable 'fly'
         mine.instaMine = true
+
+        # set inventory to infinite everything
+        inventoryToolbar.inventory.array = []
+        for props in registry.blockProps
+          inventoryToolbar.inventory.array.push(new ItemPile(props.name, Infinity)) if props.name?
+        inventoryToolbar.refresh()
+
         console.log 'creative mode'
       else
         game.mode = 'survival'
@@ -160,10 +171,6 @@
     event.preventDefault()
     return false

-  playerInventory = new Inventory(10)
-  toolbar = createToolbar {el: '#tools'}
-  inventoryToolbar = plugins.load 'inventory-toolbar', {toolbar:toolbar, inventory:playerInventory, registry:registry}
-
   # right-click to place block
   reach.on 'interact', (target) =>
     if not target


Ass webengage

Ass webengage

--- _assets/javascripts/app.js.coffee
+++ _assets/javascripts/app.js.coffee
@@ -4,7 +4,7 @@
   document.getElementById("wrapper").classList.toggle "active"
 ), false

-document.getElementById("show-disqus-comments").addEventListener "click", ((event) ->
+try document.getElementById("show-disqus-comments").addEventListener "click", ((event) ->
   @innerText = "Loading..."
   script = document.createElement("script")
   script.type = "text/javascript"
@@ -25,3 +25,16 @@

 goSquared window, document, "script", "_gs"
 _gs "GSN-764389-Z"
+
+window._weq = window._weq or {}
+window._weq['webengage.licenseCode'] = 'd3a49a6b'
+window._weq['webengage.widgetVersion'] = "4.0"
+
+webengage = (d) ->
+  _we = d.createElement 'script'
+  _we.type = 'text/javascript'
+  _we.async = true
+  _we.src = "//cdn.widgets.webengage.com/js/widget/webengage-min-v-4.0.js"
+  d.body.appendChild _we
+
+webengage document


Cancel when saving

Cancel when saving

--- lib/autocomplete-view.coffee
+++ lib/autocomplete-view.coffee
@@ -310,6 +310,7 @@
     @buildWordList()
     @currentBuffer.on "saved", =>
       @buildWordList()
+      @cancel()

     if atom.config.get('autocomplete-plus.liveCompletion')
       @currentBuffer.on "changed", (e) =>


add err output

add err output

--- lib/console/console.coffee
+++ lib/console/console.coffee
@@ -41,6 +41,13 @@
         @view.addItem @view.fadeIn @view.outView s
       @divider()

+    err: (s) ->
+      if @isInput
+        @view.slideIn @view.addBeforeInput @view.errView s
+      else
+        @view.addItem @view.fadeIn @view.errView s
+      @divider()
+
     divider: ->
       @view.divider @isInput


Remove useless explanation, reindent

Remove useless explanation, reindent

--- assets/javascripts/readlet-mini.coffee
+++ assets/javascripts/readlet-mini.coffee
@@ -9,15 +9,16 @@
 #= require backbone-min
 #= require tres

-## Require all scripts from the screens directory
+#= require models/wikipedia
+#= require_tree ./models
 #= require_tree ./screens

 $ ->
   App = new Tres.App

   App.on
-    ''                    : new HomeScreen
-    'search?query=:query' : new ResultsScreen
-    'article?name=:name'  : new ArticleScreen
+    ''                     : new HomeScreen
+    'search?query=:query'  : new ResultsScreen(collection: new SearchResults)
+    'article?title=:title' : new ArticleScreen(model: new Article)

   App.boot()


Added array key elements, and fixed child deletion parent data propagation.

--- src/treema.coffee
+++ src/treema.coffee
@@ -68,6 +68,11 @@
     @setUpEvents() unless @isChild
     @$el

+  rebuild: ->
+    wasSelected = @selected
+    @$el.replaceWith if @parent then @parent.createChildNode(@) else @build()
+    @toggleSelect() if wasSelected
+
   # Event handling ------------------------------------------------------------
   setUpEvents: ->
     @$el.dblclick (e) => $(e.target).closest('.treema-node').data('instance')?.onDoubleClick(e)
@@ -138,23 +143,6 @@
       nextTreema.toggleEdit 'treema-edit'
     nextTreema

-  getNextTreema: (direction, wrap=false) ->
-    siblings = @$el.siblings()
-    nextChild = @$el[direction]()
-    console.log "Getting next treemas out of", nextChild?.siblings?()
-    while true
-      if nextChild.length > 0
-        instance = nextChild.data('instance')
-        return null unless instance  # Probably found the .treema-add-child node stub
-        return instance unless instance.collection or instance.skipTab
-        nextChild = nextChild[direction]()
-      else if nextChild[0] is @$el[0]  # wrapped around and found nothing
-        return null
-      else if wrap
-        nextChild = siblings[if direction is 'next' then 0 else siblings.length - 1]
-      else
-        return null
-
   # Editing values ------------------------------------------------------------
   toggleEdit: (toClass) ->
     return unless @editable
@@ -183,9 +171,9 @@
   # Adding elemements to collections ------------------------------------------
   addNewChild: ->
     if @ordered # array
-      new_index = Object.keys(@childrenTreemas).length
+      newIndex = Object.keys(@childrenTreemas).length
       schema = @getChildSchema()
-      newTreema = @addChildTreema(new_index, undefined, schema)
+      newTreema = @addChildTreema(newIndex, undefined, schema)
       childNode = @createChildNode(newTreema)
       @getMyAddButton().before(childNode)
       newTreema.toggleEdit('treema-edit')
@@ -231,8 +219,12 @@

   # Removing nodes ------------------------------------------------------------
   removeSelectedNodes: ->
+    # Grab all the Treemas before removing any, because original elements are replaced.
+    toRemove = []
     @$el.find('.treema-selected').each (i, elem) =>
-      $(elem).data('instance')?.remove()
+      treema = $(elem).data('instance')
+      toRemove.push treema if treema
+    treema.remove() for treema in toRemove

   remove: ->
     @$el.remove()
@@ -241,6 +233,7 @@
     delete @parent.data[@keyForParent]
     @parent.sortFromUI() if @parent.ordered
     @parent.refreshErrors()
+    @parent.propagateData()

   # Opening/closing collections -----------------------------------------------
   toggleOpen: ->
@@ -271,6 +264,7 @@
       treema.keyForParent = index
       @childrenTreemas[index] = treema
       @data[index] = treema.data
+      treema.rebuild()
       index += 1

   close: ->
@@ -285,7 +279,8 @@
     # For now, we'll let selections be independent, so that when we go to delete,
     # we'll be able to drag/delete multiple. Later we should rely on shift for that,
     # defaulting to either one or zero selections at a time with normal clicks.
-    @$el.toggleClass('treema-selected')
+    @selected = not @selected
+    @$el.toggleClass('treema-selected', @selected)

   # Child node utilities ------------------------------------------------------
   addChildTreema: (key, value, schema) ->
@@ -297,7 +292,7 @@

   createChildNode: (treema) ->
     childNode = treema.build()
-    if @keyed
+    if @collection
       name = treema.schema.title or treema.keyForParent
       keyEl = $(@keyTemplate).text(name + ' : ')
       keyEl.attr('title', treema.schema.description) if treema.schema.description
@@ -436,15 +431,6 @@
     for prop in ['collection', 'ordered', 'keyed', 'getChildSchema', 'getChildren', 'getChildSchema', 'setValueForReading']
       @[prop] = @helper[prop]

-  rebuild: ->
-    oldEl = @$el
-    if @parent
-      newNode = @parent.createChildNode(@)
-    else
-      newNode = @build()
-
-    oldEl.replaceWith(newNode)
-

 TreemaNodeMap =
   'array': ArrayTreemaNode


Update fr.coffee

Update fr.coffee

grammar and typo fix

--- client/app/locales/fr.coffee
+++ client/app/locales/fr.coffee
@@ -9,7 +9,7 @@
     "edit event"                        : "Modification d'un évènement"
     "edit"                              : "Enregistrer"
     "create"                            : "Enregistrer"
-    "creation"                          : "Creation"
+    "creation"                          : "Création"
     "invite"                            : "Inviter"
     "close"                             : "Fermer"
     "delete"                            : "Supprimer"
@@ -26,10 +26,10 @@
     "Calendar"                          : "Calendrier"
     "calendar"                          : "Calendrier"
     "Sync"                              : "Sync"
-    "ie: 9:00 important meeting"        : "exemple: 9:00 appeler Jacque"
+    "ie: 9:00 important meeting"        : "exemple: 9:00 appeler Jacques"
     "Month"                             : "Mois"
     "Popup"                             : "Popup"
-    "Switch to List"                    : "Basculer en mode List"
+    "Switch to List"                    : "Basculer en mode Liste"
     "Switch to Calendar"                : "Basculer en mode Calendrier"
     "time"                              : "Heure"
     "Today"                             : "Aujourd'hui"
@@ -41,10 +41,10 @@
     "cancel"                            : "Annuler"
     "Create"                            : "Créer"
     "Alarms to import"                  : "Alarmes à importer"
-    "Events to import"                  : "Evenements à importer"
+    "Events to import"                  : "Évènements à importer"
     "Create Event"                      : "Créer un évènement"
     "From hours:minutes"                : "De heures:minutes"
-    "To hours:minutes+days"             : "A heures:minutes+jours"
+    "To hours:minutes+days"             : "À heures:minutes+jours"
     "Description"                       : "Description"
     "days after"                        : "jours plus tard"
     "days later"                        : "jours plus tard"
@@ -55,15 +55,15 @@
     "EMAIL"                             : "E-mail"
     "BOTH"                              : "E-mail & Notification"
     "display previous events"           : "Montrer les évènements précédents"
-    "are you sure"                      : "Etes-vous sur ?"
+    "are you sure"                      : "Êtes-vous sûr(e) ?"
     "advanced"                          : "Détails"
-    "enter email"                       : "Entrer l'addresse email"
+    "enter email"                       : "Entrer l'adresse email"
     "ON"                                : "activée"
     "OFF"                               : "désactivée"

 # RRULE related
-    "recurrence"                        : "Recurrence"
-    "recurrence rule"                   : "Règle de recurrence"
+    "recurrence"                        : "Récurrence"
+    "recurrence rule"                   : "Règle de récurrence"
     "make reccurent"                    : "Rendre réccurent"
     "repeat every"                      : "Répéter tous les"
     "no recurrence"                     : "Pas de répétition"
@@ -131,10 +131,10 @@
     "download a copy of your calendar"  : "Pour télécharger une copie de votre calendrier sur votre ordinateur comme un fichier iCal, cliquez sur ce bouton :"
     "icalendar export"                  : "Export ICalendar"
     "icalendar import"                  : "Import ICalendar"
-    "to sync your cal with"             : "Pour synchronisez votre calendrier avec votre mobile vous devez :"
+    "to sync your cal with"             : "Pour synchroniser votre calendrier avec votre mobile vous devez :"
     "install the webdav module"         : "Installer le module WebDAV depuis l'applithèque."
-    "connect to it and follow"          : "Vous connectez et suivre les instructions relatives à CalDAV."
-    "some event fail to save"           : "La sauvegarde d'un événement a échouée."
+    "connect to it and follow"          : "Vous connecter et suivre les instructions relatives à CalDAV."
+    "some event fail to save"           : "La sauvegarde d'un événement a échoué."

     "January"                           : "Janvier"
     "February"                          : "Février"


sort gene charts, putting affinity genes last

--- demo.coffee
+++ demo.coffee
@@ -155,7 +155,18 @@
         vtitle:    'Age (ticks)'
         collector: statCollector titleize(type), (d) -> u.tick - d.tick
         rows:      []
-      for gene, v of u.urThing(type).genes
+      geneSorter = (a, b) ->   # sort affinity genes last, otherwise alphabetically
+        return 0 if a == b
+        affA = /affinity/i.test a
+        affB = /affinity/i.test b
+        if affA || affB
+          if affA && affB
+            if a < b then -1 else 1
+          else
+            if affA then 1 else -1
+        else
+          if a < b then -1 else 1
+      for gene in ( g for g of u.urThing(type).genes ).sort geneSorter
         id = chartDiv tab, "#{type}-#{gene}"
         charts[gene] = geneChartSpec type, gene, id
 evoData =


filter tags

filter tags

--- client/helpers/router.coffee
+++ client/helpers/router.coffee
@@ -16,6 +16,23 @@
       backgrounds: Backgrounds.find()
     waitOn: ->
       Meteor.subscribe 'needs', Session.get('query')
+      Meteor.subscribe('offers')
+      Meteor.subscribe('backgrounds')
+    onBeforeAction: ->
+      if (Meteor.loggingIn())
+        @render 'loading'
+      if (Meteor.user() && !Meteor.user().username)
+        return @redirect('profile')
+      else
+        @render 'needs'
+  @route 'tag',
+    path: '/:query'
+    template: 'needs'
+    data: ->
+      needs: Needs.find({}, {sort: {score: -1}})
+      backgrounds: Backgrounds.find()
+    waitOn: ->
+      Meteor.subscribe 'needs', @params.query
       Meteor.subscribe('offers')
       Meteor.subscribe('backgrounds')
     onBeforeAction: ->


nothing changed.. i dont know why i am commiting

--- dechat.cjsx
+++ dechat.cjsx
@@ -1,168 +1,105 @@
 React = require('react')
 ChatAPI = require('./icecomm_wrapper.coffee')

-
 DeChat = React.createClass
+  componentWillMount: () ->
+    ChatAPI.createName("Joe")
+    ChatAPI.createChatRoom()
   render: () ->
     return

-

-

-

-
Chatrooms

-
FB

-
AP

-
AB

-
SP

-
FB

-
AP

-
AB

-
SP

-

-

-
Users

-

-

-

-
Shuo

-

-

-

-

-

-
Ilan

-

-

-

-

-

-
Anton

-

-

-

-

-

-
Feifan

-

-

-

-

-
Video

-

-

-

-
<video></video>

-

-

-

-

-
<video></video>

-

-

-

-

-
<video></video>

-

-

-

-

-
<video></video>

-

-

-

-

-
<video></video>

-

-

-

-

-
<video></video>

-

-

-

-

-
<video></video>

-

-

-

-

-
<video></video>

-

-

-

-

-
<video></video>

-

-

-

-

-

+

+

+

+
Chatrooms

+
FB

+
AP

+
AB

+
SP

+
FB

+
AP

+
AB

+
SP

+

+

+
Users

+

+

+

+
Shuo

-

-

-
Conversation

-                  <button className="camera">Video</button>
-

-

-

-
Ilan

-

-                      Today this is a great day and I had so much fun coding
-

-

-

-
Ilan

-

-                      Today this is a great day and I had so much fun coding
-

-

-

-
Ilan

-

-                      Today this is a great day and I had so much fun coding
-

-

-

-
Ilan

-

-                      Today this is a great day and I had so much fun coding
-

-

-

-
Ilan

-

-                      Today this is a great day and I had so much fun coding
-

-

-

-
Ilan

-

-                      Today this is a great day and I had so much fun coding
-

-

-

-
Ilan

-

-                      Today this is a great day and I had so much fun coding
-

-

-

-
Ilan

-

-                      Today this is a great day and I had so much fun coding
-

-

-

-
Ilan

-

-                      Today this is a great day and I had so much fun coding
-

-

-

-

-                    <input className="newMessage" placeholder="chat here"></input>
-                    <button type="submit" className="send btn btn-primary">Send</button>
-

-

+

+

+

+
Ilan

+

+

+

+

+

+
Anton

+

+

+

+

+

+
Feifan

+

+

+

+

+
Video

+            <VideoContainer users={ChatAPI.rooms[ChatAPI.currentRoomID].users} />
+

+

+

+

+

+
Conversation

+          <button className="camera">Video</button>
+

+        <MessageContainer messages={ChatAPI.rooms[ChatAPI.currentRoomID].channels[@state.currentChannel].messages} />
+        <MessageSender currentChannel={@state.currentChannel} />
+

+

+
+VideoContainer = React.createClass
+  videos = @props.users.map (elem) ->
+    return

+

+
<video src={elem.stream}></video>

+

+

+  render: () ->
+    return

+      {videos}
+

+
+MessageContainer = React.createClass
+  render: () ->
+    messages = @props.messages.map (elem) ->
+      name = ChatAPI.rooms[ChatAPI.currentRoomID].users[elem.callerID]
+      isme = "isme" if elem.callerID == ChatAPI.userID else ""
+      return

+
{name}

+

+          {elem.text}
+

+

+    return

+      {messages}
+

+
+MessageSender = React.createClass
+  sendMessage: () ->
+    ChatAPI.createMessage(@state.value, @props.currentChannel)
+    @setState({value: ''})
+  handleChange: (ev) ->
+    @setState({value: ev.target.value})
+  render: () ->
+    return

+      <input className="newMessage" placeholder="chat here" value={@state.value} onChange={@handleChange}></input>
+      <button type="submit" className="send btn btn-primary" onClick={@sendMessage}>Send</button>
+

 module.exports = DeChat


reorg callout

reorg callout

--- @client/customizations.coffee
+++ @client/customizations.coffee
@@ -1564,7 +1564,7 @@
             fontStyle: 'italic'
             marginTop: 20

-          """The rest of the questions ask for your input on principles related to MHA."""
+          """The rest of the questions ask for your input on principles related to Mandatory Housing Affordability."""

         DIV
@@ -1577,7 +1577,7 @@
         DIV
           style: hala_section_description

-          "What do you think of the following MHA principles?"
+          "What do you think of the following principles?"

@@ -1607,7 +1607,7 @@
           DIV
             style: marginTop: 10

-            "What do you think of the following MHA principles?"
+            "What do you think of the following principles?"

   "cluster/Urban Design Quality" :
@@ -1634,7 +1634,7 @@
           DIV
             style: marginTop: 10

-            "What do you think of the following MHA principles?"
+            "What do you think of the following principles?"

   auth:
@@ -3581,6 +3581,30 @@
                   "#dao_consider_it"
                 ' on The Dao\'s Slack.'

+              DIV
+                style:
+                  backgroundColor: 'white'
+                  marginTop: 20
+                  marginBottom: 20
+                  padding: 8
+                  fontSize: 18
+                  color: 'black'
+                  opacity: .5
+                  display: 'inline-block'
+
+                "Proposed "
+
+                A
+                  href: '/organization_of_dao_considerit'
+                  target: '_blank'
+                  style:
+                    #textDecoration: 'underline'
+                    color: '#EC4246'
+                    fontWeight: 600
+
+                  " reorganization of dao.consider.it"
+                '. Feedback requested!'
+

         ProfileMenu()


Close .md content if not editing, then launch Edit command

--- lib/advanced-web-editor.coffee
+++ lib/advanced-web-editor.coffee
@@ -162,6 +162,7 @@
           @statusCheck()

         if !@lifeCycle.canOpenTextEditors()
+          @lifeCycle.closeAllEditors()
           @commandStartEditing()
         else
           @editorModifyHandle = editor.onDidStopChanging () =>


remove console.log

remove console.log

--- lib/getEntitiesByType.coffee
+++ lib/getEntitiesByType.coffee
@@ -21,8 +21,7 @@
             .map (item)->
                 Object.assign({}, item, {path: f.path, file: f})
     catch e
-        console.log("KURWA", e)
-    console.log "GET ENTITIES BY TYPE", f, type, "=>", item
+        console.log("Error", e)
     return item

 module.exports = getEntitiesByType


Version 0.7.3

Version 0.7.3

--- lib/minifier/css/csso.coffee
+++ lib/minifier/css/csso.coffee
@@ -1,4 +1,6 @@
 {BaseMinifier} = require('./../BaseMinifier.coffee')
+{allowUnsafeEval, allowUnsafeNewFunction} = require 'loophole'
+

 module.exports =
 class CssoMinifier extends BaseMinifier
@@ -19,7 +21,8 @@

         try
             structureMinimizationOff  = @options.minifierOptions.restructureOff
-            minified = csso.justDoIt(css, structureMinimizationOff)
+            allowUnsafeNewFunction () =>
+                minified = csso.justDoIt(css, structureMinimizationOff)
         catch e
             error = e.message


Catch errors when commiting

Catch errors when commiting

--- lib/models/git-commit.coffee
+++ lib/models/git-commit.coffee
@@ -74,6 +74,7 @@
   init = ->
     getStagedFiles(repo)
     .then (status) -> prepFile status, filePath
+    .catch (msg) -> notifier.addError msg
   startCommit = ->
     showFile filePath
     .then (textEditor) ->


Show active file in tree-view on open

Show active file in tree-view on open

--- lib/nsync/atom-helper.coffee
+++ lib/nsync/atom-helper.coffee
@@ -36,6 +36,7 @@

   open: (path) ->
     atom.workspace.open(path)
+    @treeView()?.revealActiveFile()

   updateProject: (path, directoryExpansionStates) ->
     @loadingNotification?.dismiss()


Fixed binding commands.

Fixed binding commands.

--- lib/rubinius-terminal.coffee
+++ lib/rubinius-terminal.coffee
@@ -87,22 +87,18 @@
   activate: (state) ->
     @subscriptions = new CompositeDisposable

-    @subscriptions.add atom.commands.add 'atom-workspace', 'atom-rubinius-terminal:open': => @newTerminal.bind(this)
-    @subscriptions.add atom.commands.add 'atom-workspace', 'atom-rubinius-terminal:pipe-path': => @pipeTerminal.bind(this, 'path')
+    @subscriptions.add atom.commands.add 'atom-workspace',
+      'atom-rubinius-terminal:open': =>
+        @newTerminal()
+
+    @subscriptions.add atom.commands.add 'atom-workspace',
+      'atom-rubinius-terminal:pipe-path': =>
+        @pipeTerminal 'path'

     ['left', 'right', 'up', 'down'].forEach (direction) =>
-      @subscriptions.add atom.commands.add 'atom-workspace', "atom-rubinius-terminal:split-#{direction}", @splitTerminal.bind(this, direction)
-
-    ###
-    TODO: update to current CommandRegistry
-    https://atom.io/docs/api/v0.176.0/CommandRegistry
-    ['up', 'right', 'down', 'left'].forEach (direction)=>
-      atom.workspaceView.command "rubinius-terminal:open-split-#{direction}", @splitTerm.bind(this, direction)
-
-    atom.workspaceView.command "rubinius-terminal:open", @newTerm.bind(this)
-    atom.workspaceView.command "rubinius-terminal:pipe-path", @pipeTerm.bind(this, 'path')
-    atom.workspaceView.command "rubinius-terminal:pipe-selection", @pipeTerm.bind(this, 'selection')
-    ###
+      @subscriptions.add atom.commands.add 'atom-workspace',
+        "atom-rubinius-terminal:split-#{direction}",
+          @splitTerminal.bind this, direction

   getColors: ->
     {colors: {
@@ -157,13 +153,9 @@
       splitter()

   newTerminal: ->
-    console.log "newTerminal"
     terminalView = @createTerminalView()
-    console.log "newTerminal created"
     pane = atom.workspace.getActivePane()
-    console.log "newTerminal getActivePane"
     item = pane.addItem terminalView
-    console.log "newTerminal addItem"
     pane.activateItem item

   pipeTerminal: (action) ->
@@ -188,7 +180,7 @@
     @terminalViews.splice @terminalViews.indexOf(terminalView), 1

   deactivate: ->
-    @terminalViews.forEach (view)-> view.deactivate()
+    @terminalViews.forEach (view) -> view.deactivate()
     @subscriptions.dispose()

   serialize: ->