set up papertrail logging

set up papertrail logging

--- lib/logger.coffee
+++ lib/logger.coffee
@@ -1,13 +1,27 @@
 winston = require 'winston'
 expressWinston = require 'express-winston'
+require('winston-papertrail').Papertrail

-logger = new winston.Logger(transports: [
-  new winston.transports.Console(
-    json: false
-    colorize: true
-    handleExceptions: true
-  )
-])
+# console logging transport
+logToConsole =  new winston.transports.Console(
+                  json: false
+                  colorize: true
+                  handleExceptions: true
+                )
+
+# papertrail app logging transport
+logToPapertrail = new winston.transports.Papertrail(
+                    host: process.env.PAPERTRAIL_URL
+                    port: process.env.PAPERTRAIL_PORT
+                  )
+
+transports = [logToConsole]
+
+# only log to papertrail in production
+if process.env.NODE_ENV == 'production'
+  transports.push logToPapertrail
+
+logger = new winston.Logger(transports: transports)

 module.exports.http = expressWinston.logger(
   winstonInstance: logger


fix forceMinimize default setting

fix forceMinimize default setting

--- index.cjsx
+++ index.cjsx
@@ -23,7 +23,7 @@
     window.akashicRecordsWindow.destroy()
     initialAkashicRecordsWindow()

-if config.get('plugin.Akashic.enable', true)
+if config.get('plugin.Akashic.enable', false)
   initialAkashicRecordsWindow()
   # setInterval checkAkashicRecordsCrashed, 2000


Modify plugin version

Modify plugin version

--- index.cjsx
+++ index.cjsx
@@ -3,7 +3,7 @@
 path = require 'path'
 async = Promise.coroutine
 fs = Promise.promisifyAll require 'fs-extra'
-PLUGIN_VERSION = '0.0.1'
+PLUGIN_VERSION = '0.1.0'
 webview = $('kan-game webview')
 shipgraph = {}
 voiceMap = {}


fix typo

fix typo

--- lib/motion.coffee
+++ lib/motion.coffee
@@ -119,7 +119,7 @@
       @moveWithSaveJump(selection.cursor)
     return @moveSucceeded ? not selection.isEmpty()

-  setCursorBuffeRow: (cursor, row, options) ->
+  setCursorBufferRow: (cursor, row, options) ->
     if @verticalMotion and @getConfig('moveToFirstCharacterOnVerticalMotion')
       cursor.setBufferPosition(@getFirstCharacterPositionForBufferRow(row), options)
     else
@@ -691,7 +691,7 @@
   verticalMotion: true

   moveCursor: (cursor) ->
-    @setCursorBuffeRow(cursor, getValidVimBufferRow(@editor, @getRow()))
+    @setCursorBufferRow(cursor, getValidVimBufferRow(@editor, @getRow()))
     cursor.autoscroll(center: true)

   getRow: ->
@@ -736,7 +736,7 @@

   moveCursor: (cursor) ->
     bufferRow = @editor.bufferRowForScreenRow(@getScreenRow())
-    @setCursorBuffeRow(cursor, bufferRow)
+    @setCursorBufferRow(cursor, bufferRow)

   getScrolloff: ->
     if @isAsTargetExceptSelect()
@@ -816,7 +816,7 @@

   moveCursor: (cursor) ->
     bufferRow = @getBufferRow(cursor)
-    @setCursorBuffeRow(cursor, @getBufferRow(cursor), autoscroll: false)
+    @setCursorBufferRow(cursor, @getBufferRow(cursor), autoscroll: false)

     if cursor.isLastCursor()
       if @isSmoothScrollEnabled()


highlight currentRow + rows in find directions, don't return promise from this.execute()

--- lib/motion.coffee
+++ lib/motion.coffee
@@ -933,7 +933,10 @@
     super
     decorationType = "post-confirm"
     decorationType += "-long" if @isAsTargetExceptSelect()
-    @highlightTextInCursorRows(@input, decorationType)
+    @editor.component.getNextUpdatePromise().then =>
+      @highlightTextInCursorRows(@input, decorationType)
+
+    return # Don't return Promise here. OperationStack treat Promise differently.

   getPoint: (fromPoint) ->
     {start, end} = @editor.bufferRangeForBufferRow(fromPoint.row)
@@ -963,11 +966,11 @@
     if @getConfig("findAcrossLines")
       {start, end} = @vimState.utils.getVisibleBufferRange(@editor)
       if @isBackwards()
-        bottomCursor = @editor.getCursorsOrderedByBufferPosition().pop()
-        scanRanges = [[start, bottomCursor.getBufferPosition()]]
+        row = @editor.getCursorsOrderedByBufferPosition().pop().getBufferRow()
+        scanRanges = [[start, [row, Infinity]]]
       else
-        topCursor = @editor.getCursorsOrderedByBufferPosition().shift()
-        scanRanges = [[topCursor.getBufferPosition(), end]]
+        row = @editor.getCursorsOrderedByBufferPosition().shift().getBufferRow()
+        scanRanges = [[[row, 0], end]]
     else
       scanRanges = @editor.getCursors().map((cursor) -> cursor.getCurrentLineBufferRange())


Pass partials to the template renderer.

Pass partials to the template renderer.

--- lib/plugin.coffee
+++ lib/plugin.coffee
@@ -22,7 +22,7 @@
         kelvin = new Kelvin isProd, @contentsDir, @buildDir, locals.cdn
         _.extend locals, kelvin.parse(locals.assets)
       try
-        rendered = @tpl.render(locals)
+        rendered = @tpl.render(locals, partials)
         if isProd
           rendered = minify rendered, {
             collapseWhitespace: true


Bug fix for lower-case letters

Bug fix for lower-case letters

--- lib/search.coffee
+++ lib/search.coffee
@@ -64,7 +64,7 @@
         continue unless token
       regex = escapeRegExp token
       ## Outside regex mode, lower-case letters are case-insensitive
-      .replace /[a-z]/, (char) -> "[#{char}#{char.toUpperCase()}]"
+      .replace /[a-z]/g, (char) -> "[#{char}#{char.toUpperCase()}]"
       regex = regex.replace /\*/g, '\\S*'
       regex = "\\b#{regex}" unless starStart
       regex = "#{regex}\\b" unless starEnd


Avoid getting more documents if the queue already has twice the number of working jobs

--- lib/server.coffee
+++ lib/server.coffee
@@ -55,6 +55,9 @@
 			workque = []
 			maxquelen = 1000
 			jumpon = 0
+			lastcount =
+				working: 0
+				queue: 0
 			findinque = (id)->
 				for obj,ix in workque
 					return workque[ix] if obj._id is id
@@ -186,6 +189,11 @@
 						console.log "Resync of Queue", status_c.onqueue, s_wk._zmq.pending
 						resyncQueue()
 					updatingStatus = false
+
+					# Updating global status
+					lastcount =
+						working : if status_c.working then status_c.working else 0
+						queue : if status_c.onqueue then status_c.onqueue else 0
 			statusTimer = setInterval updateStatus, 500
 			datalog =
 				gauge: ->
@@ -451,7 +459,7 @@
 				return
 			), 1)
 			getDocsCargo = async.cargo(((couch_toprocess, callback) ->
-				if !r.ready or os.freemem() < config.minMem * 1048576
+				if !r.ready or os.freemem() < config.minMem * 1048576 or lastcount.queue > (lastcount.working * 2)
 					setImmediate ->
 						getDocsCargo.push couch_toprocess
 						callback()
@@ -480,7 +488,7 @@
 									if workque[index]._status is "fetching"
 										workque[index] = doc
 									else
-										#it was a gosth job
+										#it was a ghost job
 										console.log "updating info for ghost job", doc._id
 										doc._status = workque[index]._status
 										doc._takenby = workque[index]._takenby if workque[index]._takenby?


Tests for "createRoute()"

Tests for "createRoute()"

--- spec/simrou.coffee
+++ spec/simrou.coffee
@@ -184,6 +184,18 @@
             expect(router.resolve('/')).toBeTruthy()

+    describe 'createRoute()', ->
+        it 'returns a route instance from a string that is not bound to the router', ->
+            router = new Simrou()
+            route = router.createRoute('foo')
+            expect(router.resolve('foo')).toBeFalsy()
+
+        it 'returns the identical route instance if one is passed as argument', ->
+            router = new Simrou()
+            route = router.addRoute('foo')
+            expect(router.createRoute(route)).toBe(route)
+
+
     describe 'navigate()', ->
         router = null
         spy = jasmine.createSpy('actionHandler')
@@ -237,4 +249,4 @@
             expect(router.resolve('foo')).toBeFalsy()

-# start() / stop()
+# To do: start() / stop()


api/doc: line breaks distort markdown parsing

--- src/smc-util/message.coffee
+++ src/smc-util/message.coffee
@@ -75,16 +75,13 @@
 ### Additional References

 - The CoCalc PostgreSQL schema definition
-[src/smc-util/db-schema.coffee]
-(https://github.com/sagemathinc/cocalc/blob/master/src/smc-util/db-schema.coffee)
+[src/smc-util/db-schema.coffee](https://github.com/sagemathinc/cocalc/blob/master/src/smc-util/db-schema.coffee)
 has information on tables and fields used with the API `query` request.
 - The API test suite
-[src/smc-hub/test/api/]
-(https://github.com/sagemathinc/cocalc/tree/master/src/smc-hub/test/api)
+[src/smc-hub/test/api/](https://github.com/sagemathinc/cocalc/tree/master/src/smc-hub/test/api)
 contains mocha unit tests for the API messages.
 - The CoCalc message definition file
-[src/smc-util/message.coffee]
-(https://github.com/sagemathinc/cocalc/blob/master/src/smc-util/message.coffee)
+[src/smc-util/message.coffee](https://github.com/sagemathinc/cocalc/blob/master/src/smc-util/message.coffee)
 contains the source for this guide.

 ### API Message Reference


Escape pdf and textiles in case they have spaces

--- lib/viewer.coffee
+++ lib/viewer.coffee
@@ -36,7 +36,7 @@

     if forward_sync
       skim_cmd = '/Applications/Skim.app/Contents/SharedSupport/displayline'
-      command = skim_cmd + " #{skim_args} #{row} #{pdffile} #{texfile}"
+      command = skim_cmd + " #{skim_args} #{row} \"#{pdffile}\" \"#{texfile}\""
     else
       displayfile_cmd = path.join(atom.packages.resolvePackagePath("latextools"), "lib/support/displayfile")
       command = "sh " + displayfile_cmd + " #{skim_args} #{pdffile}"


fix(test/vk): `done "..."` -> `done new Error "..."`

--- test/vk.coffee
+++ test/vk.coffee
@@ -217,10 +217,10 @@

     it "should try to get access token first and only login if no luck", ( done ) ->
       vk.getAuthUrl = ->
-        done "tried to log in!"
+        done new Error "tried to log in!"

       sinon.stub window, "open", ->
-        done "tried to open a window!"
+        done new Error "tried to open a window!"

       vk.getAccessToken = ->
         Promise.resolve "fake-token"
@@ -273,7 +273,7 @@
         done()

       , ( error ) ->
-        done "rejected!"
+        done new Error "rejected!"

     it "should default to {} when no params specified", ( done ) ->
@@ -295,7 +295,7 @@
         done()

       , ( error ) ->
-        done "rejected!"
+        done new Error "rejected!"

     it "should reject promise when data.error exists", ( done ) ->
@@ -304,7 +304,7 @@

       vk.method fakeMethod, foo: "bar"
       .then ( response ) ->
-        done "resolved!"
+        done new Error "resolved!"

       , ( error ) ->
         expect( error ).to.equal "exists"
@@ -332,7 +332,7 @@

       , ( error ) ->
         clock.restore()
-        done "rejected!"
+        done new Error "rejected!"

   describe "request", ->


improve http-driver test

improve http-driver test

--- test/drivers/http-test.coffee
+++ test/drivers/http-test.coffee
@@ -47,6 +47,9 @@
         id: 1
         url: 'http://example.com'
       ,
+        # null (should be ignored)
+        null
+      ,
         id: 2
         url: 'http://example.com'
       ]
@@ -63,7 +66,7 @@
         assert request is @requests[0]
         assert response is @response
         { request, response } = response2
-        assert request is @requests[2]
+        assert request is @requests[3]
         assert response is @response
         done()
       , done


indentation

indentation

--- app/templates/gulpfile.coffee
+++ app/templates/gulpfile.coffee
@@ -1,39 +1,38 @@
 # Gulp
-gulp         = require "gulp"
-cache         = require "gulp-cache"
-coffee       = require "gulp-coffee"
-concat       = require "gulp-concat"
-exec         = require "gulp-exec"
-imagemin     = require "gulp-imagemin"
-minifyCSS     = require "gulp-minify-css"
-plumber       = require "gulp-plumber"
-remember     = require "gulp-remember"
-rename       = require "gulp-rename"
-replace       = require 'gulp-replace'
-rev           = require 'gulp-rev'
-sass         = require "gulp-sass"
-sourcemaps   = require "gulp-sourcemaps"
-shell         = require "gulp-shell"
-uglifyJs     = require "gulp-uglify"
-gutil         = require "gulp-util"
-watch         = require "gulp-watch"
+gulp       = require "gulp"
+cache      = require "gulp-cache"
+coffee     = require "gulp-coffee"
+concat     = require "gulp-concat"
+exec       = require "gulp-exec"
+imagemin   = require "gulp-imagemin"
+minifyCSS  = require "gulp-minify-css"
+plumber    = require "gulp-plumber"
+remember   = require "gulp-remember"
+rename     = require "gulp-rename"
+replace    = require 'gulp-replace'
+rev        = require 'gulp-rev'
+sass       = require "gulp-sass"
+sourcemaps = require "gulp-sourcemaps"
+shell      = require "gulp-shell"
+uglifyJs   = require "gulp-uglify"
+gutil      = require "gulp-util"
+watch      = require "gulp-watch"

 browserSync  = require "browser-sync"
 cp           = require "child_process"
+extend       = require "extend"
 moment       = require "moment"
 pngquant     = require "imagemin-pngquant"
 reload       = browserSync.reload
 rsyncwrapper = require "rsyncwrapper"
-rsync         = rsyncwrapper.rsync
-spawn         = cp.spawn
-
-# Extra
-extend = require "extend"
-
-pkg     = require "./package.json"
-conf   = require "./gulpconfig.json"
+rsync        = rsyncwrapper.rsync
+spawn        = cp.spawn
+
+pkg  = require "./package.json"
+conf = require "./gulpconfig.json"
+
 try
-  scrt= require "./secrets.json"
+  scrt = require "./secrets.json"
 catch err
   console.log err


Modified in browser at pixie.strd6.com

Modified in browser at pixie.strd6.com

--- test/number_extensions.coffee
+++ test/number_extensions.coffee
@@ -105,7 +105,7 @@
   equals 1.rotation, Math.TAU
   equals 0.5.rotations, Math.TAU / 2

-test "#rotations", ->
+test "#turns", ->
   equals 1.rotation, Math.TAU
   equals 0.5.rotations, Math.TAU / 2


Update science text

Update science text

- Closes #108

--- app/translations/en_us.coffee
+++ app/translations/en_us.coffee
@@ -387,6 +387,9 @@

           Knowing where Chicago’s urban wildlife is located will help us to better conserve it. This knowledge will pave the way for future studies on the behavior and ecology of specific urban species, helping stakeholders to better manage wildlife conflict.
+

+

+          Keep an eye out for the black pouches that are often attached to trees in most of the photos. They contain a scented lure that increases the probability of photographing the wildlife community at a site.


Stop overwriting the user field

Stop overwriting the user field

--- server/modfetch/creator.coffee
+++ server/modfetch/creator.coffee
@@ -52,7 +52,6 @@
     fetch = _.pick fetch, _.keys defaultFetch
     fetch.status = 0
     fetch.error = "You have not performed the initial fetch after the update."
-    fetch.user = @userId
     fetch._id = id
     clearExistingRepo id
     modfetch.update {_id: id}, fetch


Add tooltips to results

Add tooltips to results

--- app/assets/javascripts/rglossa/react/components/centre/results/cwb_results_table.jsx.coffee
+++ app/assets/javascripts/rglossa/react/components/centre/results/cwb_results_table.jsx.coffee
@@ -6,6 +6,14 @@
     corpus: React.PropTypes.object.isRequired
     rowNoShowingPlayer: React.PropTypes.number

+  componentDidUpdate: (prevProps) ->
+    # Create tooltips after a new result page is displayed
+    if @props.resultPage and @props.resultPage[0] isnt prevProps.resultPage?[0]
+      $('[data-ot]', @getDOMNode()).forEach (token, index) ->
+        new Opentip token, $(token).data('ot'),
+          style: 'dark'
+          fixed: true
+          removeElementsOnHide: true

   parseResults: (resultPage) ->
     labels = @props.corpus.langs[0].displayAttrs or corpus.displayAttrs or []


Created array in array literal notation

Created array in array literal notation

--- src/ui-message-queue.coffee
+++ src/ui-message-queue.coffee
@@ -1,18 +1,20 @@
 ###
 ui-message-queue - a User Message Queue Javascript implementation
 (c) 2012 Robert Murray
+@see https://github.com/rob-murray/ui-message-queue
 UiMessageQueue may be freely distributed under the MIT license
 ###

 # Create class in window namespace
-# TODO: best practice here??
 class window.UiMessageQueue
+
+  "use strict"

   #vars
   messageBoxDivEl : null
-  messagesArr : new Array()
+  messagesArr : []
   messagesCount : 0
   useMessageBox : true

@@ -45,6 +47,7 @@

       # Test and assign timeout
       if attrs.timeout_val
+
         #test if timeout_val is numeric
         if isFinite attrs.timeout_val

@@ -133,5 +136,4 @@
       ), self.timeOut, this

-
 # End


Fix errors in IrcMessageGenerator.coffee

--- lib/IrcMessageGenerator.coffee
+++ lib/IrcMessageGenerator.coffee
@@ -15,17 +15,17 @@
       return "MODE #{nickname} #{mode}"
     return "MODE #{nickname}"
   service: (nickname, distribution, type, info) ->
-    return "SERVICE #{nickname} * #{distribution} #{type} * #{info}"
+    return "SERVICE #{nickname} * #{distribution} #{type} * :#{info}"
   quit: (quitmessage) ->
     if quitmessage
       return "QUIT :#{quitmessage}"
     return "QUIT"
   squit: (server, comment) ->
-    return "SQUIT #{server} #{comment}"
+    return "SQUIT #{server} :#{comment}"

   # Section 3.2 - Channel operations
   join: (channel, key) ->
-    if keys
+    if key
       return "JOIN #{channel} #{key}"
     return "JOIN #{channel}"
   part: (channel, reason) ->
@@ -56,10 +56,10 @@
     return "LIST"
   invite: (nickname, channel) ->
     return "INVITE #{nickname} #{channel}"
-  kick: (nickname, channel, comment) ->
-    if comment
-      return "KICK #{nickname} #{channel} :#{comment}"
-    return "KICK #{nickname} #{channel}"
+  kick: (channel, nickname, reason) ->
+    if reason
+      return "KICK #{channel} #{nickname} :#{reason}"
+    return "KICK #{channel} #{nickname}"

   # 3.3 - Sending messages
   privmsg: (msgtarget, text) ->
@@ -89,7 +89,7 @@
       return "STATS #{query}"
     return "STATS"
   links: (servermask, remoteserver) ->
-    if target
+    if remoteserver
       return "LINKS #{remoteserver} #{servermask}"
     if servermask
       return "LINKS #{servermask}"
@@ -143,7 +143,7 @@

   # 3.7 - Miscellaneous messages
   kill: (nickname, comment) ->
-    return "KILL #{nickname} #{comment}"
+    return "KILL #{nickname} :#{comment}"
   ping: (server1, server2) ->
     if server2
       return "PING #{server1} #{server2}"
@@ -151,6 +151,6 @@
   pong: (server1, server2) ->
     if server2
       return "PONG #{server1} #{server2}"
-    return "PONG #{server2}"
+    return "PONG #{server1}"
   error: (errormessage) ->
-    return "ERROR #{errormessage}"
+    return "ERROR :#{errormessage}"


Clear the timeout in progress bar. Related to #56

--- admin/static/coffee/ui_components/progressbar.coffee
+++ admin/static/coffee/ui_components/progressbar.coffee
@@ -15,6 +15,7 @@
                 @template = template
             else
                 template = Handlebars.compile $('#progressbar-template').html()
+            @timeout = null

         # The render function takes a number of arguments:
         #   - current_value: current value of the operation or status being monitored
@@ -25,13 +26,29 @@
         #       * got_response: flag indicating that the goals have been set
         #         and we're ready to start processing
         render: (current_value, max_value, additional_info) =>
+            if current_value isnt max_value and @timeout?
+                # We are in a finished state, but current_value != max_value,
+                # so the server sent us an update and we start processing again
+                clearTimeout @timeout
+                @timeout = null
+                @stage = 'processing'
+
             # State machine
             if @stage is 'none' and additional_info.new_value?
                 @stage = 'starting'
+                if @timeout? # If there is a timeout, we have to clear it, we are not done yet
+                    clearTimeout @timeout
+                    @timeout = null
             if @stage is 'starting' and additional_info.got_response?
                 @stage = 'processing'
+                if @timeout? # If there is a timeout, we have to clear it, we are not done yet
+                    clearTimeout @timeout
+                    @timeout = null
             if @stage is 'processing' and current_value is max_value
                 @stage = 'finished'
+                if @timeout? # If there is a timeout, we have to clear it, we are not done yet
+                    clearTimeout @timeout
+                    @timeout = null

             data = _.extend additional_info,
                 current_value: current_value
@@ -59,11 +76,12 @@
                     finished: true
                     percent_complete: 100

-
-                setTimeout =>
-                    @stage = 'none'
-                    @render current_value, max_value, {}
-                , 2000
+                if not @timeout? # If there is already a timeout, no need to add another one
+                    @timeout = setTimeout =>
+                        @stage = 'none'
+                        @render current_value, max_value, {}
+                        @timeout = null
+                    , 2000

             @.$el.html @template data

@@ -71,5 +89,8 @@

         skip_to_processing: =>
             @stage = 'processing'
+            if @timeout? # If there is a timeout, we have to clear it, we are not done yet
+                clearTimeout @timeout
+                @timeout = null
         set_none_state: =>
             @stage = 'none'


Many small updates

Many small updates

--- lib/Binding.coffee
+++ lib/Binding.coffee
@@ -2,6 +2,7 @@
 Promise = require "bluebird"
 Match = require "mtr-match"
 requestAsync = Promise.promisify(require "request")
+errors = require "../helper/errors"

 module.exports = class Binding
   constructor: (options) ->
@@ -14,3 +15,11 @@
   request: (options) -> @requestAsync(options)

   setCredential: (credential) -> @credential = credential
+
+  checkStatusCode: (response, body) ->
+    if response.statusCode >= 400
+      throw new errors.RuntimeError
+        response: response.toJSON()
+        body: body
+    [response, body]
+


Prevent CoffeeScript to create unnecessary array

--- lib/autoprefixer/binary.coffee
+++ lib/autoprefixer/binary.coffee
@@ -233,6 +233,7 @@
           continue

         @compileCSS(css, file)
+      false

   # Execute command selected by arguments
   run: (done) ->


Improved webadmin loading icon to dissappear correctly even on errors, and to only appear for requests greater than 1000ms. Closes #172

--- community/server/src/main/coffeescript/neo4j/webadmin/modules/loading/GlobalLoadingIndicator.coffee
+++ community/server/src/main/coffeescript/neo4j/webadmin/modules/loading/GlobalLoadingIndicator.coffee
@@ -25,18 +25,30 @@
     class GlobalLoadingIndicator

       constructor : (@target="#global-loading-indicator") ->
-
+        @runningRequests = 0

       init : ->
-        $(window).ajaxStart () =>
-          @timeout = setTimeout @show, 400
-        $(window).ajaxStop @hide
+        $(window).ajaxSend @onAjaxSend
+        $(window).ajaxComplete @onAjaxComplete
+
+      onAjaxSend : =>
+        @runningRequests++
+        console.log "Increased", @runningRequests
+        if @runningRequests is 1
+          @timeout = setTimeout @show, 1000
+
+      onAjaxComplete : =>
+        @runningRequests--
+        console.log "Decreased", @runningRequests
+        if @runningRequests <= 0
+          @runningRequests = 0
+          clearTimeout @timeout
+          @hide()

       show : =>
         $(@target).show()

       hide : =>
-        clearTimeout @timeout
         $(@target).hide()

 )


remove log

remove log

--- app/assets/javascripts/adminpanel/sortable.js.coffee
+++ app/assets/javascripts/adminpanel/sortable.js.coffee
@@ -1,7 +1,6 @@
 ready = ->
   $('tbody#sortable').sortable
     update: (event, ui) ->
-      console.log ui.item
       position = 1
       $(@).children('tr').each ->


fixing issue where current user was not being correctly updated on user login

Former-commit-id: 217fe456dc1629f0abe06a77189cd2d2fbc63847 [formerly 995207d7c92a2a5489096f92dc7fdb62b3edfe8d] [formerly cd0c01779ef53ac8f5268515209260122469c4e7 [formerly cd0c01779ef53ac8f5268515209260122469c4e7 [formerly 306d52c131b06baa98e552452e9a599b64ede29b]]]
Former-commit-id: 0463bab2567dd5484be4ccdf8c91eeec623e02fd [formerly d7dcb3d8d7a7d0919a47ff5ebee957bbabd9580f]
Former-commit-id: 435c0d361753f76f9bdc42c70130456e800a145f
Former-commit-id: 4fe8ccfb97fde4f83ac018dfe1246dab184c60e9

--- app/assets/javascripts/backbone/entities/user.coffee
+++ app/assets/javascripts/backbone/entities/user.coffee
@@ -248,10 +248,17 @@
       @fixed_user

     set_current_user : (user_id) ->
-      @current_user = App.request 'user', user_id
+      existing_user = App.request 'user', user_id
+      if !(existing_user instanceof Entities.OperatingUser)
+        _.extend existing_user, Entities.OperatingUser.prototype
+
+      # This is hacky. Updating both prior references to current user while also upgrading old. Could lead to some probs.
       if !(@current_user instanceof Entities.OperatingUser)
-        _.extend @current_user, Entities.OperatingUser.prototype
-
+        _.extend @current_user, Entities.OperatingUser.prototype if @current_user
+      @current_user.set existing_user.attributes if @current_user
+      ######
+
+      @current_user = existing_user
       @current_user

     set_fixed_user : (user_data) ->
@@ -276,10 +283,11 @@
     update_current_user : (user_data) ->
       user_id = user_data.user.id

-      AUTH_API.set_current_user user_id if @current_user.id != user_id
-
-      current_user = @current_user
-
+      if @current_user.id != user_id
+        current_user = AUTH_API.set_current_user user_id
+      else
+        current_user = @current_user
+
       current_user.set user_data.user

       current_user.setFollows user_data.follows if 'follows' of user_data


handleExporting for csv button too

handleExporting for csv button too

--- app/assets/javascripts/incidents/batch_export.coffee
+++ app/assets/javascripts/incidents/batch_export.coffee
@@ -60,5 +60,6 @@
 $(document).on 'turbolinks:load', ->
   $('.batch-hastus-export #main-button').click enableSelectMode
   $('.batch-hastus-export #xml-button').click handleExporting
+  $('.batch-hastus-export #csv-button').click handleExporting
   $('.batch-hastus-export input').change handleIncidentSelected
   $('.batch-hastus-export #select-all').click selectAllIncidents


fixed some logic around previewing when the interface is initialized hidden.

--- app/assets/javascripts/mercury/page_editor.js.coffee
+++ app/assets/javascripts/mercury/page_editor.js.coffee
@@ -30,6 +30,7 @@
     @iframe.on 'load', => @initializeFrame()
     @iframe.one 'load', => @bindEvents()
     @loadIframeSrc(null)
+

   initializeFrame: ->
     try
@@ -142,15 +143,17 @@

   toggleInterface: ->
     if @visible
-      Mercury.trigger('mode', {mode: 'preview'}) if @previewing
       @visible = false
       @toolbar.hide()
       @statusbar.hide()
+      Mercury.trigger('mode', {mode: 'preview'}) unless @previewing
+      @previewing = true
     else
       @visible = true
       @toolbar.show()
       @statusbar.show()
-    Mercury.trigger('mode', {mode: 'preview'})
+      Mercury.trigger('mode', {mode: 'preview'})
+      @previewing = false
     @resize()

@@ -182,12 +185,14 @@
     else
       return url

+
   loadIframeSrc: (url)->
     # clear any existing events if we are loading a new iframe to replace the existing one
     @document.off() if @document

     @iframe.data('loaded', false)
     @iframe.get(0).contentWindow.document.location.href = @iframeSrc(url, true)
+

   hijackLinksAndForms: ->
     for element in jQuery('a, form', @document)


Get the value of the checked radio instead of the first one

--- app/assets/javascripts/store/spree_conekta.js.coffee
+++ app/assets/javascripts/store/spree_conekta.js.coffee
@@ -7,7 +7,7 @@
     currentMethod: null

     constructor: (@form)->
-      @methods       = @form.find 'input[name="order[payments_attributes][][payment_method_id]"]'
+      @methods       = @form.find 'input[name="order[payments_attributes][][payment_method_id]"]:checked'
       @currentMethod = @methods.val()
       @listenMethodChange()
       @listenSubmit()


TL-438: [IE] User can not edit the Syllabus content

--- app/coffeescripts/behaviors/SyllabusBehaviors.coffee
+++ app/coffeescripts/behaviors/SyllabusBehaviors.coffee
@@ -182,7 +182,10 @@
       $course_syllabus.hide()
       $course_syllabus_details.hide()
       $course_syllabus_body.editorBox()
-      $course_syllabus_body.editorBox 'set_code', $course_syllabus.data('syllabus_body')
+      setTimeout (=>
+        $course_syllabus_body.editorBox 'set_code', $course_syllabus.data('syllabus_body')
+        $course_syllabus_body.editorBox 'focus', true
+      ), 100
       if wikiSidebar
         wikiSidebar.attachToEditor $course_syllabus_body
         wikiSidebar.show()


client: rsync landing static files to website dir

--- build-client.coffee
+++ build-client.coffee
@@ -134,7 +134,7 @@
           queue.next()
       ,
       ->
-        exec "cp -Rf #{__dirname}/client/landing/static/a/out #{__dirname}/website/a/out", (err, stdout, stderr)->
+        exec "rsync -av #{__dirname}/client/landing/static/a/out/ #{__dirname}/website/a/out/", (err, stdout, stderr)->
           if err
           then console.error err
           else console.log "# LANDING PAGE EXPORTED"


simplify gulp file

simplify gulp file

--- gulpfile.coffee
+++ gulpfile.coffee
@@ -11,7 +11,7 @@
     .pipe gulp.dest './lib/'

 gulp.task 'test', ['coffee'], ->
-  gulp.src ['lib/**/*.js', 'lib/tourney-time.js']
+  gulp.src ['lib/**/*.js']
     .pipe(istanbul()) # Covering files
     .on 'finish', ->
       gulp.src(['test/**/*.spec.coffee'])


remove `gulp`

remove `gulp`

--- gulpfile.coffee
+++ gulpfile.coffee
@@ -149,8 +149,6 @@
   ], done
   null

-gulp.task 'default', ['clean', 'build']
-
 gulp.task 'deploy', ['build'], ->
   borage './dist/**/*',
     root: './dist'


Debugging heroku

Debugging heroku

--- gulpfile.coffee
+++ gulpfile.coffee
@@ -12,7 +12,7 @@

 src =
   coffee: ['**/*.coffee', '!./node_modules/**']
-  coffee_index: ['private/coffee/index.coffee']
+  coffee_index: 'private/coffee/index.coffee'
   stylus: 'private/stylus/**/*.styl'
   stylus_index: 'private/stylus/index.styl'


Add missing replacement in gulpfile.

Add missing replacement in gulpfile.

--- gulpfile.coffee
+++ gulpfile.coffee
@@ -33,6 +33,7 @@
   .pipe $.replace(noDevStrings[0], devStrings[0])
   .pipe $.replace(noDevStrings[1], devStrings[1])
   .pipe $.replace(noDevStrings[2], devStrings[2])
+  .pipe $.replace(noDevStrings[3], devStrings[3])
   .pipe gulp.dest(homePath)
   .pipe $.shell([
     [pluginInstall, pluginClean, pluginUpdate].join('; ')
@@ -43,6 +44,7 @@
   .pipe $.replace(devStrings[0], noDevStrings[0])
   .pipe $.replace(devStrings[1], noDevStrings[1])
   .pipe $.replace(devStrings[2], noDevStrings[2])
+  .pipe $.replace(devStrings[3], noDevStrings[3])
   .pipe gulp.dest(homePath)
   .pipe $.shell([
     [pluginInit, pluginInstall, pluginInit, pluginClean, pluginUpdate].join('; ')


Refactoring gulpfile

Refactoring gulpfile

--- gulpfile.coffee
+++ gulpfile.coffee
@@ -1,16 +1,16 @@
-autoprefixer = require 'gulp-autoprefixer'
-coffee = require 'gulp-coffee'
-coffeelint = require 'gulp-coffeelint'
-concat = require 'gulp-concat'
-gulp = require 'gulp'
-gulpsync = require('gulp-sync')(gulp)
-gutil = require 'gulp-util'
-minifyCSS = require 'gulp-minify-css'
-notify = require 'gulp-notify'
-plumber = require 'gulp-plumber'
-uglify = require 'gulp-uglify'
-nodemon = require 'gulp-nodemon'
-livereload = require 'gulp-livereload'
+autoprefixer  = require 'gulp-autoprefixer'
+coffee        = require 'gulp-coffee'
+coffeelint    = require 'gulp-coffeelint'
+concat        = require 'gulp-concat'
+gulp          = require 'gulp'
+gulpsync      = require('gulp-sync')(gulp)
+gutil         = require 'gulp-util'
+livereload    = require 'gulp-livereload'
+minifyCSS     = require 'gulp-minify-css'
+nodemon       = require 'gulp-nodemon'
+notify        = require 'gulp-notify'
+plumber       = require 'gulp-plumber'
+uglify        = require 'gulp-uglify'

 gulp.task 'lint', ->
   gulp.src ['*.coffee', 'client/*.coffee']
@@ -25,7 +25,6 @@
     .on 'error', (error) ->
       gutil.beep()
       gutil.log "Coffee compile error: #{error.name} (#{error.message})"
-
   gulp.src 'client/*.coffee'
     .pipe plumber()
     .pipe coffeeStream
@@ -50,7 +49,10 @@

 gulp.task 'watch', ->
   livereload.listen()
-  nodemon(script: 'server.node.coffee', ext: 'node.coffee')
+  gulp.watch 'client/*.coffee', gulpsync.sync ['recompile', 'reload']
+  gulp.watch 'css/main.css', gulpsync.sync ['css', 'reload']
+  gulp.watch 'views/*', ['reload']
+  nodemon script: 'server.node.coffee', ext: 'node.coffee', tasks: ['lint']
     .on 'restart', ->
       setTimeout (->
         gulp.src 'server.node.coffee'
@@ -58,9 +60,5 @@
           .pipe notify message: 'SERVER reloaded'
         ), 1000

-  gulp.watch 'client/*.coffee', gulpsync.sync ['recompile', 'reload']
-  gulp.watch 'css/main.css', gulpsync.sync ['css', 'reload']
-  gulp.watch 'views/*', ['reload']
-
 gulp.task 'recompile', gulpsync.sync [ ['lint', 'coffee'], 'js']
 gulp.task 'default', ['recompile', 'css', 'watch']


testing figutive

testing figutive

--- gulpfile.coffee
+++ gulpfile.coffee
@@ -13,6 +13,6 @@

 gulp.task 'test', ->
-	console.log("hello world")
+  console.log("hello world")

 gulp.task 'default', ['test']


Fix cannot compile using command: gulp compile

--- gulpfile.coffee
+++ gulpfile.coffee
@@ -45,42 +45,36 @@
   compileLangHandler(thisLang, getSourcePath(thisLang), destDir, options)

 compileJS = (destDir, options) ->
-  bundledStreamList = []
   thisLang = lang.js

   fs.mkdirsSync(path.join(destDir, thisLang.dest))

-  globby(getSourcePath(thisLang), (err, entries) ->
-    if err
-      console.log(err)
-      return false
-
-    bundledStreamList = entries.map((entry) ->
-      b = browserify(
-        entries: entry
-        debug: true
-        transform: ['babelify']
-      )
-
-      genBundle = () ->
-        bundledStream = b.bundle()
-          .pipe(vinylSource(entry))
-
-        if options.watch
-          return bundledStream
-            .pipe(gulp.dest(destDir))
-        else
-          uglifyStream = plugins.streamify(plugins.uglify())
-          return bundledStream
-            .pipe(uglifyStream)
-            .pipe(gulp.dest(destDir))
-
-      if options.watch
-        b = watchify(b)
-          .on('update', genBundle)
-
-      return genBundle()
+  entries = globby.sync(getSourcePath(thisLang))
+
+  bundledStreamList = entries.map((entry) ->
+    b = browserify(
+      entries: entry
+      debug: true
+      transform: ['babelify']
     )
+
+    genBundle = () ->
+      bundledStream = b.bundle()
+        .pipe(vinylSource(entry))
+
+      if !options.watch
+        uglifyStream = plugins.streamify(plugins.uglify())
+        bundledStream
+          .pipe(uglifyStream)
+
+      return bundledStream
+        .pipe(gulp.dest(destDir))
+
+    if options.watch
+      b = watchify(b)
+        .on('update', genBundle)
+
+    return genBundle()
   )

   return es.concat.apply(null, bundledStreamList)
@@ -157,10 +151,16 @@
   initDir(compilePath)
 )

-gulp.task('compile-main', ['compile-init'], ->
+gulp.task('compile-css', ['compile-init'], ->
   compileLang('css', compilePath, compress: true)
+)
+
+gulp.task('compile-html', ['compile-init'], ->
   compileLang('html', compilePath)
-  compileLang('js', compilePath, transform: ['babelify'])
+)
+
+gulp.task('compile-js', ['compile-init'], ->
+  compileJS(compilePath, watch: false)
 )

 gulp.task('compile-others', ['compile-init'], ->
@@ -173,7 +173,7 @@
   )
 )

-gulp.task('compile-zip', ['compile-main', 'compile-others'], ->
+gulp.task('compile-zip', ['compile-css', 'compile-html', 'compile-js', 'compile-others'], ->
   gulp.src(path.join(compilePath, '**'))
     .pipe(plugins.zip(argv.version + '.zip'))
     .pipe(gulp.dest('.'))


Added missing step to download selenium jar to grunt test:faster & test:faster:firefox targets

--- Gruntfile.coffee
+++ Gruntfile.coffee
@@ -38,8 +38,8 @@

   grunt.registerTask 'test:__buildjasmineconf__', 'Internal task to build and alter the jasmine conf', ['jasmine:apps:build', 'replace:jasmine']
   grunt.registerTask 'test:fast', 'Just configs and runs the tests. Does not do any compiling. grunt && grunt watch should be running.', ['test:__buildjasmineconf__', 'express:inline', 'curl-dir:downloadfiles', 'webdriver_jasmine_runner:chrome']
-  grunt.registerTask 'test:faster', 'Run jasmine test in parallel', ['express:inline', 'parallel_spec_runner:appsp:chrome']
-  grunt.registerTask 'test:faster:firefox', 'Run jasmine test in parallel', ['express:inline', 'parallel_spec_runner:appsp:firefox']
+  grunt.registerTask 'test:faster', 'Run jasmine test in parallel', ['express:inline', 'curl-dir:downloadfiles', 'parallel_spec_runner:appsp:chrome']
+  grunt.registerTask 'test:faster:firefox', 'Run jasmine test in parallel', ['express:inline', 'curl-dir:downloadfiles', 'parallel_spec_runner:appsp:firefox']

   grunt.registerTask 'test:fast:firefox', 'Just configs and runs the tests in firefox. Does not do any compiling. grunt && grunt watch should be running.', ['test:__buildjasmineconf__', 'express:inline', 'curl-dir:downloadfiles', 'webdriver_jasmine_runner:firefox']
   grunt.registerTask 'test:conf', 'Fetches the deps, compiles coffee and css files, runs jshint and builds the jasmine test config', ['nexus:deps', 'clean:test', 'coffee', 'css', 'test:__buildjasmineconf__']


Create dev config.

Create dev config.

--- Gruntfile.coffee
+++ Gruntfile.coffee
@@ -29,6 +29,7 @@
     app: "./app"
     test: "./test"
     dist: "./dist"
+    dev: "./tmp"

   grunt.initConfig
     appConfig: appConfig
@@ -51,8 +52,8 @@
         files: [
           # TODO use **/*
           "<%= appConfig.app %>/{,*/}{,*/}*.html"
-          "{.tmp,<%= appConfig.app %>}/styles/{,*/}*.css"
-          "{.tmp,<%= appConfig.app %>}/scripts/{,*/}*.js"
+          "{<%= appConfig.dev %>,<%= appConfig.app %>}/styles/{,*/}*.css"
+          "{<%= appConfig.dev %>,<%= appConfig.app %>}/scripts/{,*/}*.js"
           "<%= appConfig.app %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}"
         ]
         tasks: ["livereload"]
@@ -67,7 +68,7 @@
           expand: true
           cwd: "<%= appConfig.app %>/scripts"
           src: "**/*.coffee"
-          dest: ".tmp/scripts"
+          dest: "<%= appConfig.dev %>/scripts"
           ext: ".js"
         ]

@@ -76,22 +77,22 @@
           expand: true
           cwd: "<%= appConfig.test %>"
           src: "**/*.coffee"
-          dest: ".tmp/test"
+          dest: "<%= appConfig.dev %>/test"
           ext: ".js"
         ]

     sass:
       dist:
         files:
-          ".tmp/styles/style.css": "<%= appConfig.app %>/styles/style.scss"
+          "<%= appConfig.dev %>/styles/style.css": "<%= appConfig.app %>/styles/style.scss"

     concat:
       dist:
         files:
-          ".tmp/scripts/scripts.js": [
-            ".tmp/scripts/**/*.js"
-            "!.tmp/scripts/templates.js" # do not include complited templates
-            "!.tmp/scripts/application_test.js" # do not include test application module
+          "<%= appConfig.dev %>/scripts/scripts.js": [
+            "<%= appConfig.dev %>/scripts/**/*.js"
+            "!<%= appConfig.dev %>/scripts/templates.js" # do not include complited templates
+            "!<%= appConfig.dev %>/scripts/application_test.js" # do not include test application module
             "<%= appConfig.app %>/scripts/**/*.js"
           ]

@@ -144,7 +145,7 @@
           expand: true
           dot: true
           cwd: "<%= appConfig.app %>"
-          dest: ".tmp"
+          dest: "<%= appConfig.dev %>"
           src: [
             "*.{ico,txt}"
             "**/*.html"
@@ -159,7 +160,7 @@
       html:
         options: context: E2E: false
         src: "<%= appConfig.app %>/index.html"
-        dest: ".tmp/index.html"
+        dest: "<%= appConfig.dev %>/index.html"

       dist:
         options: context: E2E: false
@@ -169,7 +170,7 @@
       e2e:
         options: context: E2E: true
         src: "<%= appConfig.app %>/index.html"
-        dest: ".tmp/index.html"
+        dest: "<%= appConfig.dev %>/index.html"

     coffeelint:
       options:
@@ -185,18 +186,18 @@
         base: "app"
       main:
         src: ["<%= appConfig.app %>/templates/**/*.tpl.html"]
-        dest: ".tmp/scripts/templates.js"
+        dest: "<%= appConfig.dev %>/scripts/templates.js"

     bower:
       install:
         options:
-          targetDir: ".tmp/components"
+          targetDir: "<%= appConfig.dev %>/components"
           install: false

     karma:
       options:
         configFile: "<%= appConfig.test %>/karma.conf.coffee"
-        basePath: "../.tmp"
+        basePath: "../<%= appConfig.dev %>"
         browsers: parseBrowsers(defaultBrowser: "PhantomJS")
         colors: true
         # test results reporter to use
@@ -224,20 +225,20 @@
         autoWatch: true

     casperjs:
-      files: [".tmp/test/casperjs/**/*.js"]
+      files: ["<%= appConfig.dev %>/test/casperjs/**/*.js"]

     clean:
       dist:
         files: [
           dot: true
           src: [
-            ".tmp"
+            "<%= appConfig.dev %>"
             "<%= appConfig.dist %>/*"
             "!<%= appConfig.dist %>/.git*"
           ]
         ]

-      server: ".tmp"
+      server: "<%= appConfig.dev %>"

     connect:
       options:
@@ -247,7 +248,7 @@
         options:
           port: 9001
           middleware: (connect) ->
-            [mountFolder(connect, ".tmp")]
+            [mountFolder(connect, "<%= appConfig.dev %>")]

       livereload:
         options:
@@ -255,7 +256,7 @@
           middleware: (connect) ->
             [
               livereloadSnippet
-              mountFolder(connect, ".tmp")
+              mountFolder(connect, "<%= appConfig.dev %>")
             ]

   grunt.renameTask "regarde", "watch"
@@ -324,6 +325,7 @@
     "casperjs"
   ]

+  # TODO this task is broken
   grunt.registerTask "test:watch", [
     "build"
     "coffee:test"


Transpile specs to work with PhantomJS

Transpile specs to work with PhantomJS

--- Gruntfile.coffee
+++ Gruntfile.coffee
@@ -32,6 +32,8 @@
       spec:
         options:
           bare: true
+          transpile:
+            presets: ['es2015']
         expand: true
         cwd: 'spec'
         src: ['**.coffee']


Change grunt to add images

Change grunt to add images

--- Gruntfile.coffee
+++ Gruntfile.coffee
@@ -12,6 +12,7 @@
                     'index.html'
                     'slides/{,*/}*.{md,html}'
                     'js/*.js'
+                    'images/**'
                 ]

             index:
@@ -29,7 +30,7 @@
             jshint:
                 files: ['js/*.js']
                 tasks: ['jshint']
-
+
         connect:

             livereload:
@@ -68,6 +69,7 @@
                         'slides/**'
                         'bower_components/**'
                         'js/**'
+                        'images/**'
                     ]
                     dest: 'dist/'
                 },{
@@ -77,7 +79,7 @@
                     filter: 'isFile'
                 }]

-
+
         buildcontrol:

             options:
@@ -89,7 +91,7 @@
                 options:
                     remote: 'git@github.com:ukmadlz/cloudant-template.git'
                     branch: 'gh-pages'
-
+

     # Load all grunt tasks.
@@ -131,13 +133,13 @@
             'copy'
         ]

-
+
     grunt.registerTask 'deploy',
         'Deploy to Github Pages', [
             'dist'
             'buildcontrol'
         ]
-
+

     # Define default task.
     grunt.registerTask 'default', [


[TASK] grunt default command now builds the release

--- Gruntfile.coffee
+++ Gruntfile.coffee
@@ -33,5 +33,5 @@
     jshint:
       all: ['<%= pkg.name %>.js']

-  # Release task to run tests then minify js and css
-  grunt.registerTask 'release', ['jshint', 'uglify', 'docco']
+  # Release task to check code, minify js and create the documentation
+  grunt.registerTask 'default', ['jshint', 'uglify', 'docco']


Oddly, this no longer seems to be true.

Oddly, this no longer seems to be true.

--- Gruntfile.coffee
+++ Gruntfile.coffee
@@ -43,18 +43,17 @@
           "client/vendor/js/*.js"
         ]
     watch:
-      # Note: These actually take subdirectories into account.
       templates:
-        files: ['client/views/*.jade']
+        files: ['client/views/**/*.jade']
         tasks: 'jade'
       css:
-        files: ['client/*.styl']
+        files: ['client/**/*.styl']
         tasks: 'stylus'
       js:
-        files: ['client/app/*.coffee', 'shared/*.coffee']
+        files: ['client/app/**/*.coffee', 'shared/**/*.coffee']
         tasks: 'coffee'
       vendor:
-        files: ['client/vendor/*.js']
+        files: ['client/vendor/**/*.js']
         tasks: 'concat'
     nodemon:
       development:


Reanabled clean before dist

Reanabled clean before dist

--- Gruntfile.coffee
+++ Gruntfile.coffee
@@ -94,7 +94,7 @@
   grunt.registerTask 'dist', ->
     grunt.config "forDist", true
     grunt.task.run [
-      # "clean:dist"
+      "clean:dist"
       "sass"
       "coffee"
       "uglify"


Re-add more platforms

Re-add more platforms

--- Gruntfile.coffee
+++ Gruntfile.coffee
@@ -12,9 +12,9 @@
   #browsers.push browser for browser in ({browserName: "android", version: "#{vers}"} for vers in ["4.0"])
   #browsers.push browser for browser in ({browserName: "safari", version: "#{vers}"} for vers in [5..7])
   #browsers.push browser for browser in ({platform: "XP", browserName: "opera", version: "#{vers}"} for vers in [11..12])
-  #browsers.push browser for browser in ({platform: "XP", browserName: "googlechrome", version: "#{vers}"} for vers in [26..31])
-  #browsers.push browser for browser in ({browserName: "firefox", version: "#{vers}"} for vers in [4..26] by 3)
-  browsers.push browser for browser in ({browserName: "internet explorer", version: "#{vers}"} for vers in [7])
+  browsers.push browser for browser in ({platform: "XP", browserName: "googlechrome", version: "#{vers}"} for vers in [26..31])
+  browsers.push browser for browser in ({browserName: "firefox", version: "#{vers}"} for vers in [4..26] by 3)
+  browsers.push browser for browser in ({browserName: "internet explorer", version: "#{vers}"} for vers in [6..11])

   grunt.initConfig


Add spec for .calculateDistance helper

Add spec for .calculateDistance helper

--- Gruntfile.coffee
+++ Gruntfile.coffee
@@ -105,7 +105,7 @@
       options:
         vendor: 'src/js/lib/*'
         specs : 'test/**/*.js'
-
+

   @loadNpmTasks 'grunt-contrib-copy'
   @loadNpmTasks 'grunt-contrib-clean'


Adjust travis test suite for browser compatibility

--- Gruntfile.coffee
+++ Gruntfile.coffee
@@ -276,6 +276,7 @@
                 throttled: 5
                 recordVideo: false
                 videoUploadOnPass: false
+                # jQuery 1.9     dropped supports IE 6..?
                 # jQuery UI 1.9  supports IE 6+ and ?
                 browsers: [
                   { browserName: "internet explorer", version: "6", platform: "Windows XP" }
@@ -288,6 +289,7 @@
                 throttled: 5
                 recordVideo: false
                 videoUploadOnPass: false
+                # jQuery 1.10    dropped support for IE 6
                 # jQuery UI 1.10 supports IE 7+ and ?
                 browsers: [
                   { browserName: "internet explorer", version: "7", platform: "Windows XP" }
@@ -295,6 +297,8 @@
                 ]
         ui_111:
             options:
+                testname: "Fancytree qunit tests (jQuery 1.11, jQuery UI 1.11)"
+                urls: ["http://localhost:9999/test/unit/test-jQuery111-ui111.html"]
                 build: process.env.TRAVIS_JOB_ID
                 throttled: 5
                 recordVideo: false


remove jshint from file that does not exists

--- Gruntfile.coffee
+++ Gruntfile.coffee
@@ -2,7 +2,6 @@
   grunt.initConfig
     jshint:
       all: [
-        'Gruntfile.js'
         'tasks/*.js'
         '<%= nodeunit.tests %>'
       ]


feat(Gruntfile.coffee): #897 - associate watcher with new S3 src dir

--- Gruntfile.coffee
+++ Gruntfile.coffee
@@ -580,7 +580,7 @@
                 interrupt: true
                 debounceDelay: 250
             js:
-                files: ['./client/js/*.js']
+                files: ['./client/js/*.js', './client/js/s3/*.js']
                 tasks: [
                     'build'
                     'copy:test'


Revert "Add edge test"

Revert "Add edge test"

This reverts commit 2edaf7cf5609759ca3289d27cbbcb23afabf4d3b.

--- Gruntfile.coffee
+++ Gruntfile.coffee
@@ -15,7 +15,6 @@
   browsers.push browser for browser in ({platform: "XP", browserName: "googlechrome", version: "#{vers}"} for vers in [26..46] by 3)
   browsers.push browser for browser in ({platform: "linux", browserName: "firefox", version: "#{vers}"} for vers in [4..42] by 5)
   browsers.push browser for browser in ({browserName: "internet explorer", version: "#{vers}"} for vers in [6..11])
-  browsers.push browser for browser in ({browserName: "edge", version: "#{vers}"} for vers in [20])

   grunt.initConfig


theme name config

theme name config

--- Gruntfile.coffee
+++ Gruntfile.coffee
@@ -18,6 +18,10 @@
   # context instead of it
   readCoffee = (file) -> eval coffee.compile(grunt.file.read(file),{bare:1})

+  # TODO again, I'd like to use grunt params but I'm not sure
+  #      how to get that working with a custom task with deps
+  theme = process.env.THEME or "default"
+
   # version suffix
   suffix = (if process.env.IS_DEPLOY_TARGET is "true" then "-" + verOfficial else "")
   names =
@@ -31,9 +35,6 @@
   themeFile = outputPath(names.theme)

-  # TODO again, I'd like to use grunt params but I'm not sure
-  #      how to get that working with a custom task with deps
-  theme = process.env.THEME or "default"

   # Project configuration.
   grunt.config.init
@@ -124,7 +125,7 @@
       themeFile: themeFile
       require:
         all:
-          cssIn: "css/themes/default/umobi.css"
+          cssIn: "css/themes/" + theme + "/umobi.css"
           optimizeCss: "standard.keepComments.keepLines"
           baseUrl: "."
           out: rootFile + ".compiled.css"


Closes #53: Re-add unminified cart-rivets.js.

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

     clean:
       build:
-        src: ['dist/rivets-cart.js']
+        src: []

     terraform:
       docs:


gruntfile

gruntfile

--- Gruntfile.coffee
+++ Gruntfile.coffee
@@ -6,28 +6,12 @@
     copy:
       all:
         expand: true
-        src: ['server/**', 'node_modules/**', 'test/**', 'public/**', '!**/*.coffee']
-        dest: '_build'
-      node_modules:
-        expand: true
-        src: ['node_modules/**', '!**/*.coffee']
-        dest: '_build'
-      server:
-        expand: true
-        src: ['server/**', '!**/*.coffee']
-        dest: '_build'
-      test:
-        expand: true
-        src: ['server/**', 'test/**', '!**/*.coffee']
-        dest: '_build'
-      pub:
-        expand: true
-        src: ['public/**', '!**/*.coffee']
+        src: ['**/*', '!_build', '!_build/**/*', '!**/*.coffee']
         dest: '_build'

     watch:
       coffee:
-        files: ['server/**/*.coffee', 'node_modules/**/*.coffee', 'test/**/*.coffee', '!node_modules/eco/**/*']
+        files: ['**/*.coffee', '!_build/**/*', '!node_modules/**/*']
         tasks: ['coffee:map']
         options:
           nospawn: true
@@ -37,7 +21,7 @@
         options:
           sourceMap: true
         expand: true
-        src: ['server/**/*.coffee', 'node_modules/**/*.coffee', 'test/**/*.coffee', '!node_modules/eco/**/*']
+        src: ['**/*.coffee', '!_build/**/*', '!node_modules/**/*']
         dest: '_build'
         ext: '.js'


Revert "Compile nu.nl javascript and css"

This reverts commit d2981bc8056793de66dc02638bccff4fad44afc5.

--- Gruntfile.coffee
+++ Gruntfile.coffee
@@ -69,14 +69,10 @@
           'build/js/loader/loader_bookmarklet.js'
         ]
         dest: 'build/factlink_loader_bookmarklet.js'
-      publisher:
-        src:  'build/js/publisher_poc/nu.js'
-        dest: 'build/nu.js'
     less:
       build:
         files:
           'build/css/basic.css': 'app/css/basic.less'
-          'build/css/publisher_poc/nu.nl.css': 'app/css/publisher_poc/nu.nl.less'
     cssmin:
       build:
         options:


improve doc gen

improve doc gen

--- Gruntfile.coffee
+++ Gruntfile.coffee
@@ -6,13 +6,13 @@
 ## file 'LICENSE.txt', which is part of this source code package.
 ##

-fs = require('fs')
+fs = require('fs-extra')
 path = require('path')
 glob = require("glob")
 jade = require('jade')
+htmlmin = require("html-minifier")
 marked = require("marked")
-htmlmin = require("html-minifier")
-
+marked.setOptions({'sanitize':false})

 module.exports = (grunt) ->

@@ -85,6 +85,8 @@
   grunt.registerTask(
     'doc', 'Generate documentation', ->
       fs.mkdir('doc')
+      fs.copySync('site/static', 'doc/static')
+      fs.copySync('coolforms.js', 'doc/static/coolforms.js')
       tmpl = jade.compile(fs.readFileSync('site/template.jade'), {'pretty':true})
       mds = glob.sync('site/*.md')
       mds.map (f) ->


made the moment object of sunrise be on the correct date

--- js/schedule.coffee
+++ js/schedule.coffee
@@ -14,11 +14,12 @@
   $(".#{day} .yishtabach").html('')
   $(".#{day} .amidah").html('')

-get_sunrise = (hebrew_date, dst) ->
+get_sunrise = (hebrew_date, day_iterator) ->
+  dst = moment(day_iterator).hour(12).isDST()
   this_year_sunrises = window.sunrises["#{hebrew_date.year}"]
   doy = hebrew_date.day_of_year()
   doy += this_year_sunrises.length if doy < 0
-  moment(this_year_sunrises[doy], 'h:mm:ss').add('hours', if dst then 1 else  0)
+  moment(this_year_sunrises[doy], 'h:mm:ss').add('hours', if dst then 1 else  0).year(day_iterator.year()).month(day_iterator.month()).date(day_iterator.date())

 write_schedule = (day_iterator) ->
   unless $('.ereb-9-ab').hasClass('hidden')
@@ -35,7 +36,7 @@
     if hebrew_date.isYomKippur() || hebrew_date.isRoshHashana()
       shaharit_is_fixed_at(day, 7, 0)
     else if hebrew_date.is1stDayOfShabuot()
-      sunrise = get_sunrise(hebrew_date, moment(day_iterator).hour(12).isDST())
+      sunrise = get_sunrise(hebrew_date, day_iterator)
       $(".#{day} .amidah").html(time_format(sunrise))
       $(".#{day} .yishtabach").html(time_format(sunrise.subtract('minutes', 15)))
       $(".#{day} .hodu").html(time_format(sunrise.subtract('minutes', 25)))
@@ -43,7 +44,7 @@
     else if hebrew_date.isYomTov() || hebrew_date.isShabbat()
       shaharit_is_fixed_at(day, 7, 45)
     else
-      sunrise = get_sunrise(hebrew_date, moment(day_iterator).hour(12).isDST())
+      sunrise = get_sunrise(hebrew_date, day_iterator)
       $(".#{day} .amidah").html(time_format(sunrise))
       $(".#{day} .yishtabach").html(time_format(sunrise.subtract('minutes', 8)))
       $(".#{day} .hodu").html(time_format(sunrise.subtract('minutes', if hebrew_date.isMoed() then 12 else 11)))


adding heading to popup biodiversity map

--- applications/biodiversity.coffee
+++ applications/biodiversity.coffee
@@ -135,7 +135,7 @@
                     else
                         maptitle += "#{clazz.capped()} #{groupLevel} '#{groupName.capped()}'"

-                    if year isnt '1990'
+                    if year isnt 'current'
                         maptitle += " in #{year} at emission level #{scenario}"

                     $("""


Try a shorter heartbeat

Try a shorter heartbeat

--- backend/remote/watcher.coffee
+++ backend/remote/watcher.coffee
@@ -83,6 +83,7 @@
                     retry: true
                     since: seq
                     include_docs: true
+                    heartbeat: 9500
                 @changes
                     .on 'change', (change) =>
                         @errors = 0


Open everything in dev-mode

Open everything in dev-mode

Getting really sick of that full-width status-bar.

--- user/projects.cson
+++ user/projects.cson
@@ -24,16 +24,19 @@
 	]
 "language-maxscript":
 	title: "language-maxscript"
+	devMode: true
 	paths: [
 		"/Users/johngardner/Labs/language-maxscript"
 	]
 Tables:
 	title: "Tables"
+	devMode: true
 	paths: [
 		"/Users/johngardner/Labs/Tables"
 	]
 "language-apl":
 	title: "language-apl"
+	devMode: true
 	paths: [
 		"/Users/johngardner/Labs/language-apl"
 	]


added support for multiple space-separated thumbnails

using the first thumbnail image at this point
TODO: cycle between all thumbnails in the list

--- client/index.coffee
+++ client/index.coffee
@@ -28,8 +28,10 @@

 		for project in projects
 			continue unless project.thumbnail
+			thumbnails = project.thumbnail.split ' '
+
 			$project = $('<a>').addClass('project all').addClass(project.type)
-			$img = $('<img>').attr('src', project.thumbnail).addClass 'img-rounded img-responsive'
+			$img = $('<img>').attr('src', thumbnails[0]).addClass 'img-rounded img-responsive'
 			$project.append $img
 			$img.hide()


Allow to override sign in and sign out callbacks on routes

--- assets/scripts/app/routes.coffee
+++ assets/scripts/app/routes.coffee
@@ -50,10 +50,16 @@
 Ember.Route.reopen
   events:
     afterSignIn: (path) ->
-      @routeTo(path)
+      @afterSignIn(path)

     afterSignOut: ->
-      @routeTo('/')
+      @afterSignOut()
+
+  afterSignIn: (path) ->
+    @routeTo(path)
+
+  afterSignOut: ->
+    @routeTo('/')

   routeTo: (path) ->
     return unless path


Fix auto-submit when HIT has been already completed

--- client/login.coffee
+++ client/login.coffee
@@ -23,7 +23,7 @@
 loginCallback = (err) ->
   return unless err
   console.log err
-  if err.message is ErrMsg.alreadyCompleted
+  if err.reason is ErrMsg.alreadyCompleted
     # submit the HIT
     TurkServer.submitHIT()
   else


Execute commands via atom.commands.dispatch + Layout fix

--- emulation/atom-emulator.coffee
+++ emulation/atom-emulator.coffee
@@ -66,11 +66,11 @@
     selStartIx = switch
                    when selStartIx <= rangeStartIx then selStartIx
                    when selStartIx < rangeEndIx    then rangeStartIx
-                   else selStartIx - rangeLength
+                   else                                 selStartIx - rangeLength
     selEndIx   = switch
                    when selEndIx <= rangeStartIx then selEndIx
                    when selEndIx < rangeEndIx    then rangeStartIx
-                   else selEndIx - rangeLength
+                   else                               selEndIx - rangeLength
     @setTextInRange range, ''
     @$textArea.get(0).selectionStart = selStartIx
     @$textArea.get(0).selectionEnd   = selEndIx
@@ -197,45 +197,28 @@
     $textArea.keydown @keyHandler.bind this
     setTimeout ( ->
       atom.notifications.addSuccess 'Atom emulator initialized'
-    ), 300
-    # Small delay to see it appear after page has loaded
+    ), 300 # Small delay to see it appear after page has loaded

   keyHandler: (event) ->
-    # console.log(event.charCode);
-    # console.log(event.keyCode);
-    # console.log(event.altKey);
-    # console.log(event.metaKey);
-    # console.log(event.ctrlKey);
-    if event.ctrlKey and event.charCode == 115
-      # CTRL-S, just for testing
-      @listSelect()
-      return false
     if event.altKey and !event.shiftKey and event.metaKey and !event.ctrlKey or event.ctrlKey and !event.metaKey
       switch event.keyCode
         when 83
-          @listSelect()
+          atom.commands.dispatch(null, 'list-edit:select')
         when 88
-          @listCut()
+          atom.commands.dispatch(null, 'list-edit:cut')
         when 67
-          @listCopy()
+          atom.commands.dispatch(null, 'list-edit:copy')
         when 86
-          @listPaste()
+          atom.commands.dispatch(null, 'list-edit:paste')
         else
           return true
       return false # disable event propagation after execution of list-edit command

-  listSelect: ->
-    console.log 'list-select'
-    ListEdit.selectCmd()
-
-  listCut: ->
-    console.log 'list-cut'
-    ListEdit.cutCmd()
-
-  listCopy: ->
-    console.log 'list-copy'
-    ListEdit.copyCmd()
-
-  listPaste: ->
-    console.log 'list-paste'
-    ListEdit.pasteCmd()
+  commands:
+    dispatch: (editorView, cmd) -> # editorView is ignored
+      switch cmd
+        when 'list-edit:select' then ListEdit.selectCmd()
+        when 'list-edit:cut'    then ListEdit.cutCmd()
+        when 'list-edit:copy'   then ListEdit.copyCmd()
+        when 'list-edit:paste'  then ListEdit.pasteCmd()
+        else                         console.error 'Unknown command: ' + cmd


Include all tests.

Include all tests.

--- test/conf/karma-conf.coffee
+++ test/conf/karma-conf.coffee
@@ -10,6 +10,9 @@
       'node_modules/babel-polyfill/dist/polyfill.js'
     ]

+    # The proxies map the file paths to the karma root url /base.
+    # Each directory referenced by a test file must be mapped as
+    # a proxy.
     proxies:
       '/src/': '/base/src/'
       '/test/': '/base/test/'
@@ -25,11 +28,20 @@
     #   ./node_modules/karam/bin/karma start
     #plugins: ['karma-jspm', 'karma-mocha', 'karma-chai', 'karma-phantomjs-launcher']

-    # The karma-jspm option specifying the files to dynamically
-    # load via SystemJS.
+    # The jspm option specifis the files that karma-jspm loads
+    # dynamically via SystemJS. loadFiles are loaded unconditionally
+    # on start-up, and constitute the test suites. serveFiles are
+    # loaded on demand when referenced.
+    #
+    # Note: the loadFiles is set to src/../test/... rather than test/...
+    # to work around the following test framework bug:
+    # * karma/jspm cannot find a loadFile unless it starts at the
+    #   app base directory.
+    # TODO - revisit this in 2017 and isolate and file a bug if
+    #   necessary.
     jspm:
       config: 'jspm.config.js'
-      loadFiles: ['src/../test/unit/common/roman.service.spec.coffee']
+      loadFiles: ['src/../test/unit/**/*.spec.*']
       serveFiles: ['src/**/*.*', 'tsconfig.json', 'typings/**/*.d.ts']

     # Print messages.
@@ -41,23 +53,24 @@
     #   '**/*.spec.coffee': 'coffee'
     #   '**/*.spec.ts': 'typescript'

-    # The files to load is empty since karma-jspm assumes that responsibility.
+    # The files to load consist solely of the polyfill since karma-jspm
+    # is responsible for loading the test and app files.
     files: [
       'node_modules/babel-polyfill/dist/polyfill.js'
     ]

     # The test results reporter.
     # Possible values: 'dots', 'progress', 'junit', 'growl', 'coverage'
-    # and (thanks to karma-spec-reporter") 'spec'.
+    # and (thanks to karma-spec-reporter) 'spec'.
     reporters: ['spec']

     # Flag indicating whether to display colors in the reporter and log output.
     colors: true

     # The logging level. Possible values:
-    # config.LOG_DISABLE, config.LOG_ERROR, config.LOG_WARN, config.LOG_INFO, config.LOG_DEBUG
+    # config.LOG_DISABLE .LOG_ERROR .LOG_WARN .LOG_INFO .LOG_DEBUG
     # The log level is set in the Grunt karma task.
-    # logLevel :   config.LOG_DEBUG
+    # logLevel : config.LOG_DEBUG

     # Flag indicating whether to execute the tests whenever any file changes.
     autoWatch: false
@@ -73,21 +86,38 @@
     # - PhantomJS
     # - IE (Windows only; requires karma-ie-launcher)
     #
-    # The Grunt karma task overrides this setting to Chrome in order to debug a
-    # test case. See the Developer Guide for details.
+    # The Grunt karma task overrides this setting to Chrome in order to debug
+    # a test case. See the Developer Guide for details.
     browsers: ['PhantomJS']

-		preprocessors:
-			'src/*.js': ['babel', 'sourcemap']
+    # The test suite language pre-processors.
+    # CoffeeScript is supported out of the box.
+    preprocessors:
+      'src/*.js': ['babel', 'sourcemap']

-		babelPreprocessor:
-			options:
-				sourceMap: 'inline'
-			sourceFileName: (file) ->
-				file.originalPath
+    # The babel ec6-to-ec5 transpiler options.
+    # karma-sourcemap-loader generates the source maps.
+    # The filename function is used for messages.
+    # The sourceFileName function specifies the
+    # transpiled file to use as the source map key.
+    babelPreprocessor:
+      options:
+        # This preset option might be unnecessary, since it is also specified
+        # in .babelrc.
+        # TODO - Confirm this.
+        presets: ['es2015']
+        sourceMap: 'inline'
+        filename: (file) ->
+          file.originalPath.replace(/\.js$/, '.es5.js')
+        sourceFileName: (file) ->
+          file.originalPath

-    # If the browser does not capture output in the given number of milliseconds,
-    # then kill it.
+    # If the browser does not capture output in the given number of
+    # milliseconds, then kill it.
+    # Note: timeout doesn't necessarily mean the test fails, but guards
+    # against hanging test cases. Chances are if it takes more than 2
+    # seconds to run the test, the test either hangs or needs to be
+    # refactored.
     captureTimeout: 2000

     # Allowing empty test suites is useful when commenting out tests. The


Modified in browser at pixie.strd6.com

Modified in browser at pixie.strd6.com

--- test/engine_selector.coffee
+++ test/engine_selector.coffee
@@ -22,7 +22,7 @@

   engine.each (obj, index) ->
     if index is 0
-      equal
+      equal obj, obj1

 test "#find", ->
   engine = Engine()


Modified in browser at pixie.strd6.com

Modified in browser at pixie.strd6.com

--- test/engine_selector.coffee
+++ test/engine_selector.coffee
@@ -8,7 +8,7 @@
     x: 0
     y: 50

-  engine.find('.findable')
+  equals engine.find('.findable')

 module()


Modified in browser at pixie.strd6.com

Modified in browser at pixie.strd6.com

--- test/engine_selector.coffee
+++ test/engine_selector.coffee
@@ -27,6 +27,7 @@

   equals engine.first('.type=testObj'), obj1, "should find obj1"

-  obj2 = engine.
+  obj2 = engine.add
+    type

 module()


run everywhere

run everywhere

--- test/files/1_other_fds.iced
+++ test/files/1_other_fds.iced
@@ -1,4 +1,5 @@
 {set_default_quiet,ExecEngine,set_default_engine,SpawnEngine,BufferOutStream,BufferInStream,run} = require '../../lib/main'
+path = require 'path'

 exports.init = (T,cb) ->
   set_default_engine SpawnEngine
@@ -10,7 +11,8 @@
   other_fds = {}
   ns = "" + n
   other_fds[ns] = new BufferOutStream()
-  await run { name : 'write_to_fd_n.js', other_fds , args : [ ns, msg ] }, defer err
+  name = path.join __dirname, "write_to_fd_n.js"
+  await run { name, other_fds , args : [ ns, msg ] }, defer err
   T.no_error err, "it worked without an error"
   T.equal other_fds[ns].data().toString('utf8'), msg, "got back the right data"
   cb()


Disable tracking of a few high frequency events.

--- services/web/public/coffee/ide.coffee
+++ services/web/public/coffee/ide.coffee
@@ -71,7 +71,8 @@

 		# Tracking code.
 		$scope.$watch "ui.view", (newView, oldView) ->
-			event_tracking.sendCountly "ide-open-view-#{ newView }" if newView?
+			if newView? and newView != "editor" and newView != "pdf"
+				event_tracking.sendCountly "ide-open-view-#{ newView }"

 		$scope.$watch "ui.chatOpen", (isOpen) ->
 			event_tracking.sendCountly "ide-open-chat" if isOpen


improve the wording of the log in box creation

--- server/code/model/box.coffee
+++ server/code/model/box.coffee
@@ -78,7 +78,7 @@
     unless @uid?
       @uid = Box.generateUid()
     super (err) =>
-      console.log "err: ", @uid, err?.code, err
+      console.log "Saving box", @name, "uid", @uid, "errors:", err?.code, err
       if err? and err.code is 11000
         if @duplicateErrorCount <3
           @uid = Box.generateUid()


Close repl if no builder selected

Close repl if no builder selected

Closes #29

--- lib/ide-haskell-repl-view.coffee
+++ lib/ide-haskell-repl-view.coffee
@@ -67,7 +67,7 @@

     setImmediate =>
       if typeof builder?.then is 'function'
-        builder.then => @runREPL(builder?.name)
+        @destroy()
       else
         @runREPL(builder?.name)


undo a line wrapping, because this change the logic in common schema.

--- server/schemas/common.coffee
+++ server/schemas/common.coffee
@@ -17,8 +17,7 @@
 # should just be string (Mongo ID), but sometimes mongoose turns them into objects representing those, so we are lenient
 me.objectId = (ext) -> schema = combine({type: ['object', 'string'] }, ext)

-PointSchema = me.object
-  title: "Point", description: "An {x, y} coordinate point.", format: "point2d", required: ["x", "y"]
+PointSchema = me.object {title: "Point", description: "An {x, y} coordinate point.", format: "point2d", required: ["x", "y"]},
   x: {title: "x", description: "The x coordinate.", type: "number", "default": 15}
   y: {title: "y", description: "The y coordinate.", type: "number", "default": 20}


Use editor.fontFamily config in <code> elements

--- lib/markdown-preview-view.coffee
+++ lib/markdown-preview-view.coffee
@@ -155,6 +155,10 @@

   tokenizeCodeBlocks: (html) =>
     html = $(html)
+
+    if fontFamily = atom.config.get('editor.fontFamily')
+      $(html).find('code').css('font-family', fontFamily)
+
     for preElement in html.filter("pre")
       $(preElement).addClass("editor-colors")
       codeBlock = $(preElement.firstChild)


disabled updating storagebuckets state

disabled updating storagebuckets state

--- server/storageBuckets.coffee
+++ server/storageBuckets.coffee
@@ -4,4 +4,4 @@
   StorageBuckets.remove {name: $nin: _.pluck(buckets, 'name')}

-Meteor.setInterval updateStorageBuckets, 1000
+# Meteor.setInterval updateStorageBuckets, 1000


Re-corrected ordering of plunks

Re-corrected ordering of plunks

--- lib/plunker/stores/memory.coffee
+++ lib/plunker/stores/memory.coffee
@@ -42,7 +42,7 @@
         self._add(plunk) for id, plunk of JSON.parse(data)
         console.log "Restore completed"

-        self.queue = _.sortBy self.queue, (id) -> -new cromag(self.plunks[id].created_at).valueOf()
+        self.queue = _.sortBy self.queue, (id) -> new cromag(self.plunks[id].created_at).valueOf()

     setInterval @backup, 1000 * 30 # Every 30s


fix lint issue

fix lint issue

--- lib/motions/find-motion.coffee
+++ lib/motions/find-motion.coffee
@@ -61,7 +61,7 @@
   moveSelectionInclusively: (selection, count, options) ->
     super
     if selection.isEmpty() and @selectAtLeastOne
-      selection.modifySelection =>
+      selection.modifySelection ->
         selection.cursor.moveRight()

 module.exports = {Find, Till}


peillis/helpapp#3455 more controller tests

--- test/test_controller.coffee
+++ test/test_controller.coffee
@@ -103,6 +103,12 @@

   context 'search method ' , ->

+    beforeEach ()->
+      client_mock =
+        search: ()->
+        hit: ()->
+        hashid: mock.request.hashid
+
     it 'df:search is triggered', (done) ->
       controller = new doofinder.Controller client_mock, [widget_mock]
       controller.bind 'df:search', (ev, params) ->
@@ -115,34 +121,47 @@
         query.should.be.equal 'silla'
         params.should.have.keys 'query_counter', 'query', 'filters', 'page'
         done()
-
+
       controller = new doofinder.Controller client_mock, [widget_mock]
       controller.search 'silla'

-    it 'when adding or removing terms filters, filters params change', (done) ->
+    it 'when adding terms filters, filters params change', (done) ->
+      # we need to make a search first in order to "refresh" it with
+      # applied filters
+      controller = new doofinder.Controller client_mock, [widget_mock]
+      # make 1 search to refresh later
+      controller.search 'silla'
+      # prepare for refresh
       client_mock.search = (query, params, cb) ->
         params.filters.color.should.be.eql ['Azul', 'Rojo']
         params.filters.brand.should.be.eql ['Nike']
-        # now we remove one filter
-        controller.removeFilter 'color', 'Rojo'
-        # prepare callback to test it
-        client_mock.search = (query, params, cb) ->
-          params.filters.should.have.keys 'color', 'brand'
-          params.filters.color.should.be.eql ['Azul']
-          # ane yet again, remove
-          controller.removeFilter 'color', 'Azul'
-          controller.removeFilter 'brand', 'Nike'
-          client_mock.search = (query, params, cb) ->
-            params.filters.color.should.be.empty
-            params.filters.brand.should.be.empty
-            done()
-          controller.search 'silla' # search wigh color: [], brand: []
-
-        controller.search 'silla' # search with color: ['Rojo'], brand: ['Nike']
-
-      controller = new doofinder.Controller client_mock, [widget_mock]
+        done()
+
       controller.addFilter 'color', 'Azul'
       controller.addFilter 'brand', 'Nike'
-      controller.addFilter 'color', 'Rojo'
-      controller.search 'silla' # search wigh color: ['Azul', 'Rojo'] and brand: ['Nike']
+      controller.addFilter 'color', 'Rojo'

+      controller.refresh() # search wigh color: ['Azul', 'Rojo'] and brand: ['Nike']
+
+
+    it 'when removing terms filters, filters params change', (done) ->
+      controller = new doofinder.Controller client_mock, [widget_mock]
+      # make 1 search to refresh later
+      controller.search 'silla'
+      # add some filters
+      controller.addFilter 'color', 'Azul'
+      controller.addFilter 'brand', 'Nike'
+      controller.addFilter 'color', 'Rojo'
+      # refresh. we're not testing anything yet
+      controller.refresh()
+      # now remove some
+      controller.removeFilter 'color', 'Azul'
+      controller.removeFilter 'brand', 'Nike'
+      # those filters should be removed
+      client_mock.search = (query, params, cb) ->
+        params.filters.should.have.keys 'color', 'brand'
+        params.filters.color.should.be.eql ['Rojo']
+        params.filters.brand.should.be.empty
+        done()
+      # go!
+      controller.refresh()


Added test for color not changing when using modifier functions

--- test/tests/ColorTest.coffee
+++ test/tests/ColorTest.coffee
@@ -55,6 +55,17 @@
 		mix.r.should.equal 255
 		mix.g.should.equal 255
 		mix.b.should.equal 255
+
+	describe "when changing the color", ->
+		testModifyFunction = (f) ->
+			it "with #{f}, it should not change the instance it is applied to", ->
+				color = new Color(10, 20, 30, 1)
+				first = color[f](10)
+				second = color[f](10)
+				first.isEqual(second).should.be.true
+
+		for f in ['lighten','brighten','darken','desaturate','saturate','grayscale']
+			testModifyFunction(f)

 	it "should brighten color", ->


Remove duplicate close.

Remove duplicate close.

--- lib/script-options-view.coffee
+++ lib/script-options-view.coffee
@@ -49,9 +49,6 @@
     #atom.emit 'script:update-options', run_options: @run_options

   close: ->
-    if @hasParent() then @detach()
-
-  close: ->
     atom.workspaceView.trigger "script:close-options"
   run: ->
     atom.workspaceView.trigger "script:save-options"


minor change in owners groundwork

minor change in owners groundwork

--- library/exposure/pinpoint.coffee
+++ library/exposure/pinpoint.coffee
@@ -101,8 +101,8 @@
             assert _.isArray(moved = summary.reparented), na
             return unless (try moved.length or null) > 0
             try logger.info pe, moved.length, this.service
-            $(nod).data owners: go(nod) for nod in moved
-            go(n).push @ for n in moved unless @ in go(n)
+            $(node).data owners: go(node) for node in moved
+            go(n).push this for n in moved unless @ in go(n)
             @emit "pp-parented", selector, renderer, moved
             _.each moved, (n) => renderer.call @, n, go n

@@ -124,8 +124,8 @@
             assert _.isArray(moved = summary.removed), na
             return unless (try moved.length or null) > 0
             try logger.info pe, moved.length, this.service
-            $(nod).data owners: go(nod) for nod in moved
-            go(n).push @ for n in moved unless @ in go(n)
+            $(node).data owners: go(node) for node in moved
+            go(n).push this for n in moved unless @ in go(n)
             @emit "pp-vanished", selector, renderer, moved
             _.each moved, (n) => renderer.call @, n, go n

@@ -147,7 +147,7 @@
             assert _.isArray(added = summary.added), na
             return unless (try added.length or null) > 0
             try logger.info pe, added.length, this.service
-            $(nod).data owners: go(nod) for nod in added
-            go(n).push @ for n in added unless @ in go(n)
+            $(node).data owners: go(node) for node in added
+            go(n).push this for n in added unless @ in go(n)
             @emit "pp-pinpoint", selector, renderer, added
             _.each added, (n) => renderer.call @, n, go n


Adding operators

Adding operators


fixed username bug - now all things are fixed - finally

--- lib/serverTransformManager.coffee
+++ lib/serverTransformManager.coffee
@@ -37,8 +37,9 @@
       tmpClients = []
       for c in @clients
         tmpClients.push
-          id:     c.id
-          color:  c.color
+          id:         c.id
+          username:   c.username
+          color:      c.color
           cursor:
             pos:  c.cursor.pos
       @state.add client.id


Add support for "\#" comments to existing patterns


Updating language.

Updating language.


Fixed bug #4

Fixed bug #4

--- src/UI/main.coffee
+++ src/UI/main.coffee
@@ -162,8 +162,10 @@
     win_position = JSON.parse win_position
     ewin.setPosition win_position[0], win_position[1]

+hidden_window = false
 show_window_timeout = null
 hide_window = (break_time=0)->
+    hidden_window = true
     break_time = break_time or settings.auto_show_window_timeout
     ewin.hide()
     console.log "Set timeout to show window in #{format_time break_time}."
@@ -173,6 +175,7 @@

 show_window_time = 0
 show_window = (alarm)->
+    hidden_window = false
     show_window_time = Date.now()
     ewin.setAlwaysOnTop true
     clearTimeout show_window_timeout
@@ -193,7 +196,8 @@
 set_inactivity_check = ->
     clearInterval last_check_inactivity_interval
     check_inactivity = ->
-        time = (Date.now() - log.last_activity_change.date)
+        if hidden_window
+            return
         set_dialog 0
         log.new_entry {active:false, date:show_window_time}
         ui_alarm()


activity: introduce `appendMessageDeferred` callback method [#78432058]

--- client/Social/Activity/views/messagepane.coffee
+++ client/Social/Activity/views/messagepane.coffee
@@ -295,9 +295,12 @@
       return KD.showError err  if err

       @listController.hideLazyLoader()
-      items.forEach (item) => KD.utils.defer => @appendMessage item
+      items.forEach @bound 'appendMessageDeferred'

       KD.utils.defer @bound 'focus'
+
+
+  appendMessageDeferred: (item) -> KD.utils.defer @lazyBound 'appendMessage', item

   fetch: (options = {}, callback)->
@@ -351,4 +354,3 @@
     @listController.removeAllItems()
     @listController.showLazyLoader()
     @populate()
-


reactivity: chat input: formatting fix

reactivity: chat input: formatting fix

--- client/activity/lib/flux/chatinput/index.coffee
+++ client/activity/lib/flux/chatinput/index.coffee
@@ -2,7 +2,7 @@
   getters : require './getters'

   actions :
-  	emoji : require './actions/emoji'
+    emoji : require './actions/emoji'

   stores  : [
     require './stores/emoji/emojisstore'


add parks

add parks

--- source/javascripts/grid.coffee
+++ source/javascripts/grid.coffee
@@ -21,6 +21,7 @@
     neighborhoods = topojson.feature pdx, pdx.objects.neighborhoods
     blockgroups   = topojson.feature pdx, pdx.objects.pdx
     water         = topojson.feature pdx, pdx.objects.water
+    parks       = topojson.feature pdx, pdx.objects.parks

     projection.scale(1).translate([0, 0])
     b = path.bounds(blockgroups)
@@ -63,7 +64,13 @@
       # Draw the bodies of water
       context.beginPath()
       path(water)
-      context.fillStyle = '#010101'
+      context.fillStyle = '#151515'
+      context.fill()
+
+      # Draw the bodies of water
+      context.beginPath()
+      path(parks)
+      context.fillStyle = '#151515'
       context.fill()

 # Fix for blurry canvas elements on Retina MBP


edit calculator content

edit calculator content

--- app/lib/en-us.coffee
+++ app/lib/en-us.coffee
@@ -578,8 +578,7 @@
         header         : 'The Planet Hunters Calculator'
         content        :
           '''
-
Been hunting for exo-planets? Found a transit in a light curve? Use the calculators below to find out what the exo-planet might be like.

-
+
The following exo-planet has been found by volunteers on this Planet Hunters website, you can see more through this collection.

The following four exo-planet candidates have been found by volunteers on the Planet Hunters website. We refer to these as 'candidates' and not 'planets' as follow up observations need to be made to confirm their existence, but let's just say, so far it's looking good!

@@ -590,33 +589,13 @@
                   Temperature of Star (K)

-                  SPH10125117
-                  KIC 10905746
-                  0.548 R⊙
-                  13.0
+                  APH00003T7
+                  5794240
+                  0.552 R⊙
+                  15.979
                   4240

-

-                  SPH10100751
-                  KIC 6185331
-                  1.27 R⊙
-                  15.64
-                  5619
-

-

-                  SPH10119459
-                  KIC 4552729
-                  0.977 R⊙
-                  14.98
-                  4620
-

-

-                  SPH10098510
-                  KIC 10005758
-                  0.766 R⊙
-                  13.9
-                  6015
-

+

Star

@@ -649,7 +628,7 @@

Exo-planet

-
If you'd like to calculate the size of the exo-planet candidates, you will need to measure the drop in brightness that occurs when the exo-planet travels in front of it's star. You can do this on the Planet Hunters website, simply click on the Planet Hunters ID in the table above for the exo-planet you'd like to measure.

+
If you'd like to calculate the size of the exo-planet, you will need to measure the drop in brightness that occurs when the exo-planet travels in front of it's star. You can do this on the Planet Hunters website. Simply click on the Planet Hunters ID in the table above. When you move your cursor over the y-axis of the graph a red line should appear to guide your measurement.

Measuring the period of the exo-planet will allow you calculate the distance from the star to the exo-planet. You don't need this if you'd just like to measure the radius of the exo-planet.


Update el.coffee

Update el.coffee

typographic and grammatical errors fix

--- app/locale/el.coffee
+++ app/locale/el.coffee
@@ -1,12 +1,12 @@
-module.exports = nativeDescription: "ελληνικά", englishDescription: "Greek", translation:
+module.exports = nativeDescription: "Ελληνικά", englishDescription: "Greek", translation:
   common:
     loading: "Φορτώνει..."
-    saving: "Γίνεται αποθήκευση"
-    sending: "Αποστολή ..."
-#    send: "Send"
+    saving: "Αποθήκευση..."
+    sending: "Αποστολή..."
+    send: "Στείλε"
     cancel: "Ακύρωση"
     save: "Αποθήκευση"
-    publish: "Δημοσιοποίηση"
+    publish: "Δημοσίευση"
     create: "Δημιουργία"
     delay_1_sec: "1 δευτερόλεπτο"
     delay_3_sec: "3 δευτερόλεπτα"
@@ -44,22 +44,22 @@

   nav:
     play: "Επίπεδα"
-#    community: "Community"
-#    editor: "Editor"
+    community: "Κοινότητα"
+    editor: "Συγγραφέας"
     blog: "Μπλόγκ"
     forum: "Φόρουμ"
     account: "Λογαριασμός"
-#    profile: "Profile"
-#    stats: "Stats"
-#    code: "Code"
+    profile: "Προφίλ"
+    stats: "Στατιστικά"
+    code: "Κώδικας"
     admin: "Διαχειριστής"
     home: "Αρχική"
-    contribute: "Συμβάλλω"
-    legal: "Νόμιμο"
+    contribute: "Συνεισφέρω"
+    legal: "Νόμικά"
     about: "Σχετικά με"
-    contact: "Επικοίνωνω"
-    twitter_follow: "Follow"
-#    employers: "Employers"
+    contact: "Επικοινωνία"
+    twitter_follow: "Ακολούθησε"
+    employers: "Εργοδότες"

 #  versions:
 #    save_version_title: "Save New Version"