chore(rest): removed change to restful client

--- vue/src/shared/record_store/restful_client.coffee
+++ vue/src/shared/record_store/restful_client.coffee
@@ -96,7 +96,6 @@
       data = new FormData();
       data.append(options.fileField     || 'file',     file)
       data.append(options.filenameField || 'filename', file.name.replace(/[^a-z0-9_\-\.]/gi, '_'))
-      data.append('kind', options.kind) if options.kind

       @currentUpload = new XMLHttpRequest()
       @currentUpload.open('POST', @buildUrl(path), true)


JWorkspace: fix alignment

JWorkspace: fix alignment

--- workers/social/lib/social/models/workspace.coffee
+++ workers/social/lib/social/models/workspace.coffee
@@ -12,36 +12,36 @@

   @set

-    indexes        :
-      originId     : 'sparse'
-      slug         : 'sparse'
-
-    schema         :
-      name         : String
-      slug         : String
-      isDefault    :
-        type       : Boolean
-        default    : no
-      channelId    : String
-      machineUId   : String
-      machineLabel : String
-      rootPath     : String
-      originId     : ObjectId
-      layout       : Object
-
-    sharedMethods  :
-      static       :
-        create     : signature Object, Function
-        deleteById : signature String, Function
-        deleteByUid: signature String, Function
-        update     : signature String, Object, Function
-        fetchByMachines: signature Function
-        createDefault  : signature String, Function
-      instance     :
-        delete     : signature Function
-    sharedEvents   :
-      static       : []
-      instance     : []
+    indexes             :
+      originId          : 'sparse'
+      slug              : 'sparse'
+
+    schema              :
+      name              : String
+      slug              : String
+      isDefault         :
+        type            : Boolean
+        default         : no
+      channelId         : String
+      machineUId        : String
+      machineLabel      : String
+      rootPath          : String
+      originId          : ObjectId
+      layout            : Object
+
+    sharedMethods       :
+      static            :
+        create          : signature Object, Function
+        deleteById      : signature String, Function
+        deleteByUid     : signature String, Function
+        update          : signature String, Object, Function
+        fetchByMachines : signature Function
+        createDefault   : signature String, Function
+      instance          :
+        delete          : signature Function
+    sharedEvents        :
+      static            : []
+      instance          : []

   @create$ = secure (client, data, callback) ->


move createHistory to method so it can be stubbed

--- src/stores/location.coffee
+++ src/stores/location.coffee
@@ -25,6 +25,9 @@
 class Location

   constructor: ->
+    @_createHistory()
+
+  _createHistory: ->
     @history = history.createHistory()

   startListening: (cb) ->


Delete button on OP deletes topic

Delete button on OP deletes topic

--- app/assets/javascripts/discourse/views/post_menu_view.js.coffee
+++ app/assets/javascripts/discourse/views/post_menu_view.js.coffee
@@ -50,12 +50,18 @@
   # Delete button
   renderDelete: (post, buffer) ->

+    if post.get('post_number') == 1 and @get('controller.content.can_delete')
+      buffer.push("<button title=\"#{Em.String.i18n("topic.actions.delete")}\" data-action=\"deleteTopic\"></button>")
+      return
+
+    # Show the correct button
     if post.get('deleted_at')
       if post.get('can_recover')
         buffer.push("<button title=\"#{Em.String.i18n("post.controls.undelete")}\" data-action=\"recover\"></button>")
     else if post.get('can_delete')
       buffer.push("<button title=\"#{Em.String.i18n("post.controls.delete")}\" data-action=\"delete\"></button>")

+  clickDeleteTopic: -> @get('controller').deleteTopic()
   clickRecover: -> @get('controller').recoverPost(@get('post'))
   clickDelete: -> @get('controller').deletePost(@get('post'))


Fix a bug that could cause the client to enter a loop of feed refreshes every second.

When a feed refresh is requested from the server, the timestamp of the last refresh is set to the current time, unconditionally. This is done directly instead of passing through the reset_timer() function; the reason is that the function does not modify the timestamp if its more than 90 seconds in the past. This is intended so that refreshes are not delayed when the user e.g. opens entries if the last refresh was too far in the past; but this behavior is not desirable when a feed refresh actually happens, in this case the timestamp must be updated unconditionally.

--- app/assets/javascripts/ng-services/ng-FeedsFoldersSvc.js.coffee
+++ app/assets/javascripts/ng-services/ng-FeedsFoldersSvc.js.coffee
@@ -24,7 +24,7 @@
     feedsPaginationSvc.set_busy true

     # Reset the 1-minute timer until the next feeds refresh
-    reset_timer()
+    $rootScope.last_feed_refresh = Date.now()

     page += 1
     $http.get("/api/feeds.json?include_read=#{$rootScope.show_read}&page=#{page}")


Fire event after translation engine is ready

--- app/assets/javascripts/translation_engine/screenshots.js.coffee
+++ app/assets/javascripts/translation_engine/screenshots.js.coffee
@@ -191,3 +191,4 @@
   $(window).bind 'ajaxComplete', ->
     window.TranslationEngine.lookupDom()

+  $(document).trigger 'translation_engine:ready'


Fix date showing for students without last activity

fixes VICE-2212
flag=none

Test Plan:
 - Create a new course
 - Add a new enrollment to the course
 - View Users page
 > Should see an empty last activity field for the new user

Change-Id: I22695e28a49c0c518837b68b5f13d3290e75a610
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277050
Tested-by: Service Cloud Jenkins <9144042a601061f88f1e1d7a1753ea3e2972119d@instructure.com>
Reviewed-by: Caleb Guanzon <54fa1f30d451e4f3c341a8f3c47c9215fd0be9c6@instructure.com>
QA-Review: Caleb Guanzon <54fa1f30d451e4f3c341a8f3c47c9215fd0be9c6@instructure.com>
Product-Review: Caleb Guanzon <54fa1f30d451e4f3c341a8f3c47c9215fd0be9c6@instructure.com>

--- ui/shared/handlebars-helpers/index.coffee
+++ ui/shared/handlebars-helpers/index.coffee
@@ -198,10 +198,11 @@

   # convert an event date and time to a string using the given date and time format specifiers
   tEventToString : (date = '', i18n_date_format = 'short', i18n_time_format = 'tiny') ->
-    I18nObj.t 'time.event',
-      defaultValue: '%{date} at %{time}',
-      date: I18nObj.l "date.formats.#{i18n_date_format}", date
-      time: I18nObj.l "time.formats.#{i18n_time_format}", date
+    if (date)
+      I18nObj.t 'time.event',
+        defaultValue: '%{date} at %{time}',
+        date: I18nObj.l "date.formats.#{i18n_date_format}", date
+        time: I18nObj.l "time.formats.#{i18n_time_format}", date

   # formats a date as a string, using the given i18n format string
   strftime : (date = '', fmtstr) ->


Force process shutdown if Ruby isn't setup

Otherwise, the test fails, but `cake test` doesn't exit.

--- test/test_process.coffee
+++ test/test_process.coffee
@@ -41,6 +41,7 @@
   test.expect 2

   process = createProcess 'web', "bundle exec thin start -p $PORT", cwd: "#{__dirname}/fixtures/app"
+  process.timeout = 3000
   process.spawn()
   test.ok process.port


retry when failed

retry when failed

--- routes/lib/speaker.coffee
+++ routes/lib/speaker.coffee
@@ -5,18 +5,26 @@

 slack = new Slack(webhookToken, domain);

-module.exports = (message) ->
-  console.log message
+speaker = (message) ->
+  # console.log message
   if this.body?
     channel = this.body.channel_name;
   else
     channel = "announcement"
+
+  thebody = this.body
   option =
     channel: "#" + channel,
     username: "PeoplyBot",
     text: message

   respon = (err, response) ->
-    console.log(response);
+    if err?
+      setTimeout ()->
+        this.body = thebody
+        speaker(message)
+      , 1000

   slack.webhook(option, respon);
+
+module.exports = speaker


Remove blanks from empty lines.

Remove blanks from empty lines.

--- test/unit/tnmSpec.coffee
+++ test/unit/tnmSpec.coffee
@@ -1,5 +1,5 @@
 define ['ngmocks', 'tnm', 'helpers'], (tnm) ->
-  describe 'Unit Testing TNM Service', ->
+  describe 'Unit Testing the TNM Service', ->
     # The qiprofile TNM factory.
     TNM = null
     # The ObjectHelper factory.
@@ -15,7 +15,7 @@
         TNM = _TNM_
         ObjectHelper = _ObjectHelper_
       ]
-
+
     describe 'Size', ->
       it 'formats the tumor size', ->
         expected = [
@@ -27,7 +27,7 @@
           [null, 1, false, 'b', '1b']
           ['p', 2, false, 'a', 'p2a']
         ]
-
+
         for [px, ts, ist, sx, expectedValue] in expected
           size =
             prefix: px
@@ -41,7 +41,7 @@

     describe 'Breast', ->
       tumorType = 'Breast'
-
+
       describe 'grade', ->
         # @param the grade composite object
         # @returns the expected summary grade
@@ -54,8 +54,8 @@
             2
           else
             3
-
-
+
+
         it 'should calcuate the summary grade', ->
           for tf in [1..3]
             for np in [1..3]
@@ -71,7 +71,7 @@
                 expect(actual, "The summary grade #{ ObjectHelper.prettyPrint(tnm.grade) }" +
                                " is incorrect")
                   .to.equal(expected)
-
+
       describe 'stage', ->
         # The (t, n) -> expected stage map.
         expected =
@@ -100,7 +100,7 @@
             1: 'IIIB'
             2: 'IIIB'
             3: 'IIIC'
-
+
         it 'should calculate the stage', ->
           for [t, [n, expectedStage]] in expected
             actual = TNM.stage(tumorType, t, n, 0)
@@ -110,7 +110,7 @@

     describe 'Sarcoma', ->
       tumorType = 'Sarcoma'
-
+
       describe 'grade', ->
         # @param the grade composite object
         # @returns the expected summary grade
@@ -123,7 +123,7 @@
             2
           else
             3
-
+
         it 'should calculate the summary grade', ->
           for df in [1..3]
             for mc in [1..3]
@@ -140,7 +140,7 @@
                                " #{ ObjectHelper.prettyPrint(tnm.grade) }" +
                                " is incorrect")
                   .to.equal(expected)
-
+
       describe 'stage', ->
         # The (t, n) -> expected stage map.
         expected =
@@ -162,7 +162,7 @@
               1: 'III'
               2: 'III'
               3: 'III'
-
+
         it 'should calculate the stage', ->
           for [t,  nMap] in expected
             for [n, expectedStage] in nMap


library export needs quotes

library export needs quotes

--- chrome/content/zotero-better-bibtex/zotero-better-bibtex.coffee
+++ chrome/content/zotero-better-bibtex/zotero-better-bibtex.coffee
@@ -560,7 +560,7 @@
         collection.addItem(item.id)

     collections = Zotero.BetterBibTeX.withParentCollections(collections) if collections.length != 0
-    collections.push('library')
+    collections.push("'library'")
     Zotero.DB.query("update betterbibtex.autoexport set status = 'pending' where collection in #{Zotero.BetterBibTeX.SQLSet(collections)}")
     Zotero.BetterBibTeX.auto.process('collectionChanged')
     return
@@ -597,7 +597,7 @@

   collections = Zotero.Collections.getCollectionsContainingItems(ids, true)
   collections = Zotero.BetterBibTeX.withParentCollections(collections) unless collections.length == 0
-  collections.push('library')
+  collections.push("'library'")
   Zotero.DB.query("update betterbibtex.autoexport set status = 'pending' where collection in #{Zotero.BetterBibTeX.SQLSet(collections)}")
   Zotero.BetterBibTeX.auto.process('itemChanged')


Account Settings: Credentials: Don't emit "LazyLoadThresholdReached" event when any filter option is selected.

--- client/account/lib/views/accountcredentiallistcontroller.coffee
+++ client/account/lib/views/accountcredentiallistcontroller.coffee
@@ -93,7 +93,7 @@
     @filterStates.skip = 0

     @removeAllItems()
-    @showLazyLoader()
+    @showLazyLoader no

     @filterStates.query = query


support %julia syntax highlighting.

support %julia syntax highlighting.

--- salvus/page/editor.coffee
+++ salvus/page/editor.coffee
@@ -192,6 +192,7 @@
     ['sage'        , 'python'],
     ['script'      , 'shell'],
     ['sh'          , 'shell'],
+    ['julia'       , 'text/x-julia']
 ]

 exports.define_codemirror_sagews_mode = () ->


Calculate total believes/disbelieves

Calculate total believes/disbelieves

--- core/app/backbone/views/facts/react_fact_opinionate_area.coffee
+++ core/app/backbone/views/facts/react_fact_opinionate_area.coffee
@@ -53,6 +53,7 @@

   render: ->
     is_opinion = @model().opinion_for_current_user() == @props.opinion_type
+
     _div ["fact-opinionate-button"],
       _button [
             "button button-opinion-#{@props.opinion_type}"
@@ -63,6 +64,7 @@
          _i ["icon-thumbs-#{@props.opinion_type}"]
          _span [''],
           'interesting'
+
         ReactSigninPopover
           ref: 'signinPopover'

@@ -75,12 +77,14 @@
     _.defaults opinionTally,
       believes: 0,
       disbelieves: 0
+    opinionTallyTotal = opinionTally.believes + opinionTally.disbelieves

     _div ["fact-opinionators-table"],
       _table ["fact-opinionators-table-table"],
         _tr [],
           _td ["fact-opinionators-table-believes"], opinionTally.believes
           _td ["fact-opinionators-table-disbelieves"], opinionTally.disbelieves
+          _td ["fact-opinionators-table-disbelieves"], opinionTallyTotal

 window.ReactOpinionateArea = React.createBackboneClass
   displayName: 'ReactOpinionateArea'


Quick fix.

Quick fix.

--- tests/query_utils.coffee
+++ tests/query_utils.coffee
@@ -30,10 +30,10 @@
 	unless _conn?
 		_conn = anyDB.createConnection(config.DATABASE_URL_TEST)
 		mg.migrate.sync mg, _conn
-		_conn.query.sync _conn, 'CREATE TABLE test_table (id INT, data TEXT)'
-		_conn.query.sync _conn, "INSERT INTO test_table (id, data) VALUES (1, 'first')"
-		_conn.query.sync _conn, "INSERT INTO test_table (id, data) VALUES (2, 'second')"
 	conn = transaction(_conn)
+	conn.query.sync conn, 'CREATE TABLE test_table (id INT, data TEXT)'
+	conn.query.sync conn, "INSERT INTO test_table (id, data) VALUES (1, 'first')"
+	conn.query.sync conn, "INSERT INTO test_table (id, data) VALUES (2, 'second')"
 	query = queryUtils.getFor conn
 ).async()


Add debouce to increase performance

Add debouce to increase performance

--- app/assets/javascripts/wallpapers.js.coffee
+++ app/assets/javascripts/wallpapers.js.coffee
@@ -11,18 +11,18 @@
         width = $stage.width()
         if (width / ratio) > height
           $img
-          .addClass 'auto-width'
-          .removeClass 'auto-height'
+            .addClass 'auto-width'
+            .removeClass 'auto-height'
         else
           $img
-          .addClass 'auto-height'
-          .removeClass 'auto-width'
+            .addClass 'auto-height'
+            .removeClass 'auto-width'

       # Initial
       onResizeHandler()
       $img.removeClass 'hide'

-      $(window).on 'resize', onResizeHandler
+      $(window).on 'resize', _.debounce(onResizeHandler, 100)
     )()

     # Handle high resolution image load


fixed popover top and left viewport overflow problem

--- app/coffee/drm-popovers/drm-popovers.coffee
+++ app/coffee/drm-popovers/drm-popovers.coffee
@@ -5,26 +5,40 @@
 ( ($) ->

 	drmPopover = {
-
+		holders: $ '.popover-holder'
+
+		init: ->
+			buttons = @.holders.find 'button'
+			popovers = @.holders.find '.drm-popover'
+
+			buttons.on 'click', @.togglePopover
+
+			$('html').click ->
+				popovers.hide()
+
+		togglePopover: (e) ->
+			popoverId = $(@).data 'popover'
+			popover = $("##{popoverId}")
+
+			popover.toggle()
+			e.stopPropagation()
+
+			drmPopover.checkPosition.call popover
+
+		checkPosition: ->
+			that = $ @
+			positionLeft = that.position().left
+			offsetLeft = that.offset().left
+			positionTop = that.position().top
+			offsetTop = that.offset().top
+			popoverHeight = that.height()
+
+			if offsetLeft < 0
+				that.css('left': (Math.abs(offsetLeft) + 10) + positionLeft)
+			else if offsetTop < 0
+				that.css('bottom': (Math.abs(positionTop) - popoverHeight) - Math.abs(offsetTop))
 	}
-
-	holders = $ '.popover-holder'
-	buttons = holders.find 'button'
-	popovers = holders.find '.drm-popover'
-	html = $ 'html'

-	buttons.on 'click', (e) ->
-		popoverId = $(@).data 'popover'
-		popover = $("##{popoverId}")
-
-		popover.toggle()
-		e.stopPropagation()
-
-		if popover.offset().left < 0
-			position = popover.position().left
-			popover.css('left': (Math.abs(popover.offset().left) + 10) + position)
-
-	html.click ->
-		popovers.hide()
+	drmPopover.init()

 ) jQuery


Updated command

Updated command

--- ice_tutorial/static/js/terminal.coffee
+++ ice_tutorial/static/js/terminal.coffee
@@ -75,7 +75,7 @@
     else if command is 'cd'
       bash(term, inputs)

-    else if command is "docker"
+    else if command is "ice"
       Docker(term, inputs)

     else if command is "help"


fix error handling

fix error handling

--- src/tex-writer-call.coffee
+++ src/tex-writer-call.coffee
@@ -80,9 +80,7 @@
         alert '98987', "with arguments #{rpr P}"
         alert '98987', "an error occurred:"
         alert '98987', error.message
-        throw error if throw_all_errors
-        send [ '.', 'warning', error.message, ( copy meta ), ]
-        return send.done()
+        throw error
       #.....................................................................................................
       for line in lines
         if CND.isa_text line


darkened foreground color

darkened foreground color

--- src/js/bokeh.coffee
+++ src/js/bokeh.coffee
@@ -176,7 +176,7 @@

 _.extend(Plot::display_defaults, {
   'background-color' : "#fff",
-  'foreground-color' : "#aaa"
+  'foreground-color' : "#333"
 })

 class PlotView extends BokehView


When a window is destroyed, call the 'dispose' method of there is one.

--- src/views/ui/window.coffee
+++ src/views/ui/window.coffee
@@ -12,8 +12,8 @@
     else
       styles.view

-  # events:
-  #   close: 'destroy'
+  events:
+    close: 'destroy'

   layout: (options, callback) =>

@@ -44,8 +44,8 @@

     @view.close options

-  # destroy: ->
-    # @trigger 'destroy'
+  destroy: ->
+    @dispose?()

   _bindControllerEvents: =>
     @controller?.context ?= @


Re-added triggering factlinkAdded event

Re-added triggering factlinkAdded event

--- js-library/app/js/jail_iframe/util/annotated_site_receiver.coffee
+++ js-library/app/js/jail_iframe/util/annotated_site_receiver.coffee
@@ -17,6 +17,7 @@

   highlightNewFactlink: (displaystring, id) ->
     FactlinkJailRoot.highlightFact(displaystring, id)
+    FactlinkJailRoot.trigger 'factlinkAdded'
     FactlinkJailRoot.showCoreHighlight id

   highlightExistingFactlink: (id) ->


current topics performance title

current topics performance title

--- src/components/task-plan/reading-stats.cjsx
+++ src/components/task-plan/reading-stats.cjsx
@@ -140,7 +140,10 @@
     practice = _.map(plan.stats.course.spaced_pages, @renderPracticeBars)

     unless _.isEmpty(chapters)
-      chapters =
{chapters}

+      chapters =

+        Current Topics Performance
+        {chapters}
+

     unless _.isEmpty(practice)
       practice =


default items is empty array

default items is empty array

--- lib/dashing-contrib/assets/widgets/nagios_list/nagios_list.coffee
+++ lib/dashing-contrib/assets/widgets/nagios_list/nagios_list.coffee
@@ -23,6 +23,7 @@

   _groupBy: (items) ->
     maps = {}
+    items = items || []
     for item, index in items
       item.last_check = @_parseTime(item.last_check)
       if !maps[item.host]


.csv() now accepts "true" which returns the raw data

--- src/viz/methods/csv.coffee
+++ src/viz/methods/csv.coffee
@@ -3,7 +3,7 @@
 stringStrip = require "../../string/strip.js"

 module.exports =
-  accepted:  [undefined, Array, String]
+  accepted:  [undefined, true, Array, String]
   chainable: false
   data:      []
   process:   (value, vars) ->
@@ -29,29 +29,41 @@
     else
       title = "D3plus Visualization Data"

-    unless columns
-      columns = [vars.id.value]
-      columns.push vars.time.value if vars.time.value
-      columns.push vars.size.value if vars.size.value
-      columns.push vars.text.value if vars.text.value
+    if value is true
+      columns = d3.keys vars.data.keys
+      csv_to_return.push columns
+      for d in vars.data.value
+        row = []
+        for c in columns
+          val = d[c]
+          val = '"'+val+'"' if vars.data.keys[c] is "string"
+          row.push val
+        csv_to_return.push row
+    else
+      unless columns
+        columns = [vars.id.value]
+        columns.push vars.time.value if vars.time.value
+        columns.push vars.size.value if vars.size.value
+        columns.push vars.text.value if vars.text.value

-    for c in columns
-      titles.push vars.format.value(c)
+      for c in columns
+        titles.push vars.format.value(c)

-    csv_to_return.push titles
-    for node in vars.returned.nodes
-      console.log(node.values)
-      if node.values? and node.values instanceof Array
-        for val in node.values
+      csv_to_return.push titles
+      for node in vars.returned.nodes
+        if node.values? and node.values instanceof Array
+          for val in node.values
+            row = []
+            for col in columns
+              val = fetchValue(vars, val, col)
+              val = '"'+val+'"' if typeof val is "string"
+              row.push val
+            csv_to_return.push row
+        else
           row = []
           for col in columns
-            row.push fetchValue(vars, val, col)
+            row.push fetchValue(vars, node, col)
           csv_to_return.push row
-      else
-        row = []
-        for col in columns
-          row.push fetchValue(vars, node, col)
-        csv_to_return.push row

     csv_data = "data:text/csv;charset=utf-8,"
     for c, i in csv_to_return
@@ -70,4 +82,5 @@

     @data = csv_to_return
     columns
+
   value: undefined


fix silly error :)

fix silly error :)

--- lib/autocomplete/clang-provider.coffee
+++ lib/autocomplete/clang-provider.coffee
@@ -39,7 +39,7 @@
     command = 'clang'
     args = @buildClangArgs(editor, row, column, language)
     options =
-      cwd: utils.getRoot atom.workspace.getActiveTextEditor().getPath()
+      cwd: utils.findRoot atom.workspace.getActiveTextEditor().getPath()
       input: editor.getText()
     new Promise (resolve) =>
       allOutput = []


make load assets

make load assets

--- src/main/coffeescript/nz/SceneBattle.coffee
+++ src/main/coffeescript/nz/SceneBattle.coffee
@@ -56,32 +56,35 @@
     return

   loadMap: ->
-    _loaded = ->
+    json = {}
+    json[@mapName] = "data/#{@mapName}.json"
+    @loadAsset {json:json}, ->
       @mapSprite = nz.SpriteBattleMap(@mapName).addChildTo(@)
       @mapSprite.x = (SCREEN_W - @mapSprite.width ) - 32
       @mapSprite.y = (SCREEN_H - @mapSprite.height) / 2
       @loadCharacter()
-    unless phina.asset.AssetManager.get('json',@mapName)
-      json = {}
-      json[@mapName] = "data/#{@mapName}.json"
-      @loadAsset {json:json}, _loaded.bind @
+    return
+
+  loadCharacter: ->
+    assets = json:{}
+    assets.json['character_001'] = "data/character_001.json"
+    @loadAsset assets, ->
+      console.log 'end'
+    return
+
+  loadAsset: (assets,cb) ->
+    for type,data of assets
+      for key,val of data
+        if phina.asset.AssetManager.get(type,key)
+          delete data[key]
+      if Object.keys(data).length == 0
+        delete assets[type]
+    if Object.keys(assets).length == 0
+      @one 'enterframe', cb
     else
-      _loaded.call(@)
-    return
-
-  loadCharacter: ->
-    unless phina.asset.AssetManager.get('json','character_001')
-      assets = json:{}
-      assets.json['character_001'] = "data/character_001.json"
-      @loadAsset assets, ->
-        console.log 'end'
-    return
-
-  loadAsset: (assets,cb) ->
-    if cb?
       @one 'resume', cb
-    @one 'enterframe', ->
-      @app.pushScene phina.game.LoadingScene assets: assets
+      @one 'enterframe', -> @app.pushScene phina.game.LoadingScene assets: assets
+

   load: ->
     loaded = true


这个参数已经被删除

这个参数已经被删除

--- lib/emulator/run-on-server-view.coffee
+++ lib/emulator/run-on-server-view.coffee
@@ -112,7 +112,7 @@

     #TODO: validation

-    @trigger 'createServer', [rootPath, destPath, httpPort, pushState, apiScript]
+    @trigger 'createServer', [rootPath, destPath, httpPort, pushState]

     @destroy()


Fix error on going from chat to other page

--- static/scripts/main.coffee
+++ static/scripts/main.coffee
@@ -191,26 +191,28 @@
         messages: []

     componentWillMount: ->
+        @selfUnmount = false
+
         peerIdForFounder = getSegments()[1]
         isFounder = not peerIdForFounder?

-        peer = new Peer(key: PEER_KEY)
+        @peer = new Peer(key: PEER_KEY)

         @connections = []

-        peer.on "error", (error) =>
+        @peer.on "error", (error) =>
             console.log error

             @props.addAlert type: "danger", "Something went terribly wrong! See console."

-        peer.on "open", (peerId) =>
-            @peerId = peer.id
+        @peer.on "open", (peerId) =>
+            @peerId = @peer.id

             if isFounder
-                peerIdForFounder = peer.id
+                peerIdForFounder = @peer.id
                 @setState peerIdForFounder: peerIdForFounder

-                peer.on "connection", (connection) =>
+                @peer.on "connection", (connection) =>
                     connection.on "open", =>
                         if @connections.length
                             peerIds = _.map @connections, (connection) -> connection.peer
@@ -224,7 +226,7 @@
             if not isFounder
                 @setState peerIdForFounder: peerIdForFounder

-                connection = peer.connect peerIdForFounder
+                connection = @peer.connect peerIdForFounder

                 connection.on "open", =>
                     @connections.push connection
@@ -233,7 +235,7 @@
                     connection.on "data", (data) =>
                         if data.type == "newConnection"
                             _.forEach data.peerIds, (peerId) =>
-                                connection = peer.connect peerId
+                                connection = @peer.connect peerId

                                 do (connection) =>
                                     connection.on "open", =>
@@ -241,14 +243,22 @@
                                         @listenForMessage connection

                 connection.on "close", =>
+                    if @selfUnmount
+                        return
+
                     @props.addAlert type: "warning", "Founder left the channel!"

-                peer.on "connection", (connection) =>
+                @peer.on "connection", (connection) =>
                     connection.on "open", =>
                         @connections.push connection
                         @listenForMessage connection

                         @showAlertAboutNewConnection()
+
+    componentWillUnmount: ->
+        @selfUnmount = true
+
+        @peer.destroy()

     render: ->
         (Dom.div null,


Finished yank loss fix

Finished yank loss fix

--- lib/operators/general-operators.coffee
+++ lib/operators/general-operators.coffee
@@ -1,6 +1,7 @@
 _ = require 'underscore-plus'
 {$$, Point, Range} = require 'atom'
 {ViewModel} = require '../view-models/view-model'
+Utils = require '../utils'

 class OperatorError
   constructor: (@message) ->
@@ -59,7 +60,7 @@
       if text[-1..] isnt '\n'
         text += '\n'
     else
-      type = 'character'
+      type = Utils.copyType(text)
     @vimState.setRegister(register, {text, type})

 # Public: Generic class for an operator that requires extra input


add change tag image function

add change tag image function

--- imports/ui/components/settingsTags/settingsTags.coffee
+++ imports/ui/components/settingsTags/settingsTags.coffee
@@ -29,9 +29,21 @@
 		value = $(e.target).closest('a').attr('img')

 		if value == 'none'
-			Meteor.call 'updateProjectItem', projectId, 'tags', tagId, 'img', null, handleError
+			Projects.methods.main.updateArray.call
+				projectId: projectId,
+				array: 'tags'
+				arrayId: tagId
+				field: 'img'
+				value: null
+			, Dialogs.handleSuccess
 		else
-			Meteor.call 'updateProjectItem', projectId, 'tags', tagId, 'img', value, handleError
+			Projects.methods.main.updateArray.call
+				projectId: projectId,
+				array: 'tags'
+				arrayId: tagId
+				field: 'img'
+				value: value
+			, Dialogs.handleSuccess

 	'click #showTemplate': (e) ->
 		e.preventDefault()


Scripts: user-updater clean up

Scripts: user-updater clean up

--- scripts/user-updater/main.coffee
+++ scripts/user-updater/main.coffee
@@ -72,9 +72,9 @@

   migrateAppStorages = (account, index, callback) ->

-    { _id } = account
+    console.log "Starting migrate app storages, Index: #{index}, AccountId: #{account._id}"

-    fetchAccount _id, (err, { account }) ->
+    fetchAccount account._id, (err, { account }) ->
       return callback err  if err
       return callback new KodingError 'no account'  unless account

@@ -96,20 +96,6 @@
           return callback err

-    # fetchAppStorageRelationship appStorage, (err, rel) ->
-    #   return callback err  if err
-    #
-    #   if not rel
-    #     console.log "No relationship found for appStorage with id #{_id}"
-    #     JAppStorage.remove { _id }, (err) ->
-    #       return callback err
-    #
-    #   else
-    #     options = { accountId : rel.sourceId, appId, version, data : bucket }
-    #     JAccount.migrateOldAppStorageIfExists options, (err) ->
-    #       callback err
-
-
   # Main updater
   # ------------


JWorkspace: set ::update to client side only, cosmetic.

We need to convert these static methods into instance ones soon.

--- workers/social/lib/social/models/workspace.coffee
+++ workers/social/lib/social/models/workspace.coffee
@@ -178,7 +178,7 @@
     @remove callback

-  @update: secure (client, id, options, callback) ->
+  @update$ = secure (client, id, options, callback) ->

     selector   =
       originId : client.connection.delegate._id
@@ -191,7 +191,7 @@
       ws.update options, callback

-  @createDefault: secure (client, machineUId, callback) ->
+  @createDefault = secure (client, machineUId, callback) ->

     JMachine.one$ client, machineUId, (err, machine) =>


Add . after build command

Add . after build command

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

     shell:
       rebuild:
-        command: 'npm build'
+        command: 'npm build .'
         options:
           stdout: true
           stderr: true


Grunt: Make sure no old microflo-linux running before starting

--- Gruntfile.coffee
+++ Gruntfile.coffee
@@ -88,7 +88,7 @@
       portallights_linux_gen: microflo_gen 'PortalLights'
       portallights_linux_comp: microflo_compile 'PortalLights'
       portallights_run: './spec/microflo-linux.sh PortalLights 5555 & sleep 5'
-
+      kill_microflo_linux: 'kill $(pgrep microflo-linux)'

   # Grunt plugins used for building
   @loadNpmTasks 'grunt-exec'
@@ -105,6 +105,7 @@
     'exec:portallights_linux_gen', 'exec:portallights_linux_comp',
   ]
   @registerTask 'run-microflo-linux', [
+    'exec:kill_microflo_linux'
     'exec:tablelights_run'
     'exec:portallights_run'
   ]


fix(gruntfile): Updated path to istanbul

--- Gruntfile.coffee
+++ Gruntfile.coffee
@@ -68,7 +68,7 @@
         stderr: true
         failOnError: true
       coverage:
-        command: './node_modules/.bin/istanbul cover jasmine-node --captureExceptions test && cat ./coverage/lcov.info | ./node_modules/.bin/coveralls && rm -rf ./coverage'
+        command: 'istanbul cover jasmine-node --captureExceptions test && cat ./coverage/lcov.info | ./node_modules/.bin/coveralls && rm -rf ./coverage'
       jasmine:
         command: './node_modules/.bin/jasmine-node --captureExceptions test'
       publish:


Fix to sass task in Gruntfile

Fix to sass task in Gruntfile

Now puts compiled css file in right dir

--- Gruntfile.coffee
+++ Gruntfile.coffee
@@ -56,7 +56,7 @@
         sourceMap: true
       dist:
         files:
-          'dist/css/styles.css': 'src/scss/styles.scss'
+          'dist/css/styles.css': 'scss/styles.scss'

     # mochaTest:
     #   test:
@@ -110,10 +110,10 @@
         command: 'cd dist && npm install --production && cd -'

     nodewebkit:
-        options:
-            platforms: ['osx']
-            buildDir: './builds'
-        src: ['dist/**/*']
+      options:
+        platforms: ['osx']
+        buildDir: './builds'
+      src: ['dist/**/*']

   # tasks.
   grunt.registerTask 'compile', [


images not getting picked up

images not getting picked up

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

             index:
@@ -70,6 +71,7 @@
                         'bower_components/**'
                         'js/**'
                         'css/**'
+                        'images/**'
                     ]
                     dest: 'dist/'
                 },{


Clarify disabled task work-around.

Clarify disabled task work-around.

--- Gruntfile.coffee
+++ Gruntfile.coffee
@@ -167,10 +167,14 @@
         configFile: 'karma-conf.coffee'

     exec:
-      # # Delete the qirest Anaconda environment.
-      # # Note: conda env remove hangs when executed from a script.
-      # # It does not run when executed from a script in background.
-      # # There is no known mechanism to make this work.
+      # Delete the qirest Anaconda environment.
+      #
+      # Note: conda env remove hangs when executed from a script.
+      # It does not run when executed from a script in background.
+      # There is no known mechanism to make this work.
+      # The work-around is to execute the conda env remove
+      # command below manually.
+      #
       # cleanqirest:
       #   command:
       #     '(source deactivate 2>/dev/null);' +


Note when obsolete files should be removed.

--- Gruntfile.coffee
+++ Gruntfile.coffee
@@ -133,8 +133,8 @@
         files:
           'build/factlink.start_annotating.min.js':   ['build/factlink.start_annotating.js']
           'build/factlink.stop_annotating.min.js':    ['build/factlink.stop_annotating.js']
-          'build/factlink.start_highlighting.min.js': ['build/factlink.start_highlighting.js'] #Obsolete!
-          'build/factlink.stop_highlighting.min.js':  ['build/factlink.stop_highlighting.js'] #Obsolete!
+          'build/factlink.start_highlighting.min.js': ['build/factlink.start_highlighting.js'] #Obsolete; remove 2014-04-01
+          'build/factlink.stop_highlighting.min.js':  ['build/factlink.stop_highlighting.js'] #Obsolete; remove 2014-04-01
           'build/factlink_loader_basic.min.js':       ['build/factlink_loader_basic.js']
           'build/factlink_loader_publishers.min.js':  ['build/factlink_loader_publishers.js']
           'build/factlink_loader_bookmarklet.min.js': ['build/factlink_loader_bookmarklet.js']


fix coffee paths in gruntfile

fix coffee paths in gruntfile

--- Gruntfile.coffee
+++ Gruntfile.coffee
@@ -19,15 +19,15 @@
         join: true
       compile:
         files:
-          'lib/sabisu/public/js/sabisu.js': ["lib/sabisu/public/coffee/sabisu.coffee", "lib/sabisu/public/coffee/*.coffee"]
+          'lib/sabisu/public/js/sabisu.js': ["lib/sabisu/public/coffee/sabisu.coffee", "lib/sabisu/public/coffee/**/*.coffee"]

     watch:
       coffee:
-        files: ["lib/sabisu/public/coffee/sabisu.coffee", "lib/sabisu/public/coffee/*.coffee"]
+        files: ["lib/sabisu/public/coffee/sabisu.coffee", "lib/sabisu/public/coffee/**/*.coffee"]
         tasks: ["coffee"]

     coffeelint:
-      sabisu: ["lib/sabisu/public/coffee/*.coffee"]
+      sabisu: ["lib/sabisu/public/coffee/**/*.coffee"]
       options:
         no_trailing_whitespace:
           level: 'error'


aint nobody got time for extra libs

aint nobody got time for extra libs

--- Gruntfile.coffee
+++ Gruntfile.coffee
@@ -129,9 +129,6 @@
           ],
           paths:
             'angular': 'empty:'
-            'lodash': 'empty:'
-            'tweenlite': 'empty:'
-            'tweenlite-css': 'empty:'
     uglify:
       prod:
         files:
@@ -140,15 +137,6 @@
           ]
           'build/assets/vendor/angular/angular.js': [
             'assets/vendor/angular/angular.js'
-          ]
-          'build/assets/vendor/greensock-js/src/uncompressed/TweenLite.js': [
-            'assets/vendor/greensock-js/src/uncompressed/TweenLite.js'
-          ]
-          'build/assets/vendor/greensock-js/src/uncompressed/plugins/CSSPlugin.js': [
-            'assets/vendor/greensock-js/src/uncompressed/plugins/CSSPlugin.js'
-          ]
-          'build/assets/vendor/lodash/lodash.js': [
-            'assets/vendor/lodash/lodash.js'
           ]
     watch:
       coffee:


added fbo to grunt task

added fbo to grunt task

--- Gruntfile.coffee
+++ Gruntfile.coffee
@@ -19,7 +19,7 @@
             separator: '/* ---- */\n',
          dev:
             files:
-               'public/dist/view/main.js': ['public/javascript/helper.js', 'public/javascript/webgl.js', 'public/javascript/shader.js', 'public/javascript/camera.js', 'public/javascript/mesh.js', 'public/javascript/themesh.js', 'public/javascript/normalsvisor.js', 'public/javascript/mesh-draw.js', 'public/javascript/loading-draw.js', 'public/javascript/main-view.js']
+               'public/dist/view/main.js': ['public/javascript/helper.js', 'public/javascript/webgl.js', 'public/javascript/fbo.js', 'public/javascript/shader.js', 'public/javascript/camera.js', 'public/javascript/mesh.js', 'public/javascript/themesh.js', 'public/javascript/normalsvisor.js', 'public/javascript/mesh-draw.js', 'public/javascript/loading-draw.js', 'public/javascript/main-view.js']
                # 'public/dist/slave/main.js': []

       watch:


:lipstick:

:lipstick:

--- Gruntfile.coffee
+++ Gruntfile.coffee
@@ -16,7 +16,6 @@
     coffee:
       options:
         sourceMap: true
-
       glob_to_multiple:
         expand: true
         src: [
@@ -61,7 +60,6 @@
           level: 'error'
         max_line_length:
           level: 'ignore'
-
       src: [
         'dot-atom/**/*.coffee'
         'src/**/*.coffee'


fix lcov reporter

fix lcov reporter

--- Gruntfile.coffee
+++ Gruntfile.coffee
@@ -38,7 +38,7 @@
 			options:
 				force: true
 			main:
-				src: 'reports/lcov/lcov.json'
+				src: 'reports/lcov/lcov.info'

 		html2js:
 			main:


attempted to fix src mapping issue by adding a coffee:copy task... Looking forward to this merge: https://github.com/gruntjs/grunt-contrib-coffee/pull/119... In the mean time, we can use canaries built in src mapping system if need be...

--- Gruntfile.coffee
+++ Gruntfile.coffee
@@ -29,7 +29,7 @@
     watch:
       coffee:
         files: ["<%= yeoman.app %>/scripts/{,*/}*.{coffee,litcoffee,coffee.md}"]
-        tasks: ["coffee:dist"]
+        tasks: ["copy:coffee", "coffee:dist"]

       coffeeTest:
         files: ["test/spec/{,*/}*.{coffee,litcoffee,coffee.md}"]
@@ -109,14 +109,16 @@

     # Compiles CoffeeScript to JavaScript
     coffee:
-        dist:
-            options:
-                bare: true
-                sourceMap: true
-            files:
-              ".tmp/scripts/alchemy.js": ["<%= yeoman.app %>/scripts/alchemy/defaultConf.coffee",
-                                          "<%= yeoman.app %>/scripts/alchemy/init.coffee",
-                                          "<%= yeoman.app %>/scripts/alchemy/{,*/}*.{coffee,litcoffee,coffee.md}"]
+      dist:
+        options:
+          bare: true
+          sourceMap: true
+        files: ".tmp/scripts/alchemy.js": [".tmp/scripts/alchemy/defaultConf.coffee",
+                                             ".tmp/scripts/alchemy/init.coffee",
+                                             ".tmp/scripts/alchemy/errors.coffee",
+                                             ".tmp/scripts/alchemy/startGraph.coffee",
+                                             ".tmp/scripts/alchemy/update.coffee",
+                                             ".tmp/scripts/alchemy/{,*/}*.{coffee,litcoffee,coffee.md}"]

       test:
         files: [
@@ -267,6 +269,15 @@

     # Copies remaining files to places other tasks can use
     copy:
+      coffee:
+        files: [
+          expand: true,
+          dot: true,
+          cwd: '<%= yeoman.app %>/scripts',
+          dest: '.tmp/scripts',
+          src: '**/*.coffee'
+        ]
+
       dist:
         files: [
           expand: true
@@ -286,9 +297,9 @@

     # Run some tasks in parallel to speed up build process
     concurrent:
-      server: ["compass:server", "coffee:dist", "copy:styles"]
-      test: ["coffee", "copy:styles"]
-      dist: ["coffee", "compass", "copy:styles", "imagemin", "svgmin"]
+      server: ["compass:server", "copy:coffee", "coffee:dist", "copy:styles"]
+      test: ["copy:coffee", "coffee", "copy:styles"]
+      dist: ["copy:coffee", "coffee", "compass", "copy:styles", "imagemin", "svgmin"]

   grunt.registerTask "serve", (target) ->
     return grunt.task.run(["build", "connect:dist:keepalive"])  if target is "dist"


Filter paths while recursing

Filter paths while recursing

--- Gruntfile.coffee
+++ Gruntfile.coffee
@@ -9,9 +9,10 @@
 INSTALL_DIR = path.join('/Applications', APP_NAME)

 module.exports = (grunt) ->
-  cp = (source, destination) ->
+  cp = (source, destination, {filter}={}) ->
     if grunt.file.isDir(source)
       grunt.file.recurse source, (sourcePath, rootDirectory, subDirectory='', filename) ->
+        return if filter?.test(sourcePath)
         destinationPath = path.join(destination, subDirectory, filename)
         grunt.file.copy(sourcePath, destinationPath)
         if grunt.file.exists(destinationPath)


Don't run db tests by default

Don't run db tests by default

--- Gruntfile.coffee
+++ Gruntfile.coffee
@@ -36,7 +36,7 @@
   grunt.loadNpmTasks 'grunt-contrib-watch'

   # Default task.
-  grunt.registerTask 'default', ['coffee', 'mocha']
+  grunt.registerTask 'default', ['coffee', 'mocha:default']

   # Task for running Mocha tests with coffee.
   grunt.registerMultiTask 'mocha', 'Run mocha unit tests.', ->


Remove browserify from Gruntfile.

Remove browserify from Gruntfile.

--- Gruntfile.coffee
+++ Gruntfile.coffee
@@ -127,13 +127,6 @@
         src: ['index.jade', 'partials/**/*.jade', '!**/include/**']
         dest: '_public/'

-    browserify:
-      ndarray:
-        src: []
-        dest: '_build/commonjs/ndarray.js'
-        options:
-          require: ['ndarray']
-
     karma:
       options:
         singleRun: not grunt.option('debug')
@@ -289,7 +282,7 @@
   grunt.registerTask 'amdify', ['browserify', 'exec:convert']

   # Collect the vendor libraries.
-  grunt.registerTask 'vendor:app', ['amdify', 'copy:app', 'concat:app']
+  grunt.registerTask 'vendor:app', ['copy:app', 'concat:app']

   # Compile the app javascript.
   grunt.registerTask 'compile:js', ['coffee:compile', 'preprocess']


Updated Gruntfile to get correct paths for images generated by Compass

--- Gruntfile.coffee
+++ Gruntfile.coffee
@@ -86,9 +86,9 @@
                     javascriptsDir: '<%= pkg.devPath %>assets/js',
                     fontsDir: '<%= pkg.devPath %>assets/fonts',
                     importPath: '<%= pkg.path %>coffee/libs',
-                    #httpImagesPath: '/images',
-                    #httpGeneratedImagesPath: '/images/generated',
-                    #relativeAssets: false
+                    httpImagesPath: '<%= pkg.devPath %>assets/img',
+                    httpGeneratedImagesPath: '<%= pkg.devPath %>assets/img',
+                    relativeAssets: true

             prod:
                 options:
@@ -99,9 +99,9 @@
                     javascriptsDir: '<%= pkg.prodPath %>assets/js',
                     fontsDir: '<%= pkg.prodPath %>assets/fonts',
                     importPath: '<%= pkg.path %>coffee/libs',
-                    #httpImagesPath: '/images',
-                    #httpGeneratedImagesPath: '/images/generated',
-                    #relativeAssets: false
+                    httpImagesPath: '<%= pkg.prodPath %>assets/img',
+                    httpGeneratedImagesPath: '<%= pkg.prodPath %>assets/img',
+                    relativeAssets: true

         htmlmin:
             dev:


wip(grunt): sourcemap sucks

wip(grunt): sourcemap sucks

--- Gruntfile.coffee
+++ Gruntfile.coffee
@@ -97,6 +97,7 @@
           strictMath: true
           sourceMap: true
           outputSourceFiles: true
+          dumpLineNumbers: "comments"

         files: [
           expand: true
@@ -113,7 +114,8 @@
       serve:
         src: "<%= config.assets %>/css/*.css"
         options:
-          map: true
+          map:
+            inline: false
           processors: [
             require("autoprefixer-core")(browsers: "last 1 versions")
           ]


Add comment to weird-ish grunt task

Add comment to weird-ish grunt task

--- Gruntfile.coffee
+++ Gruntfile.coffee
@@ -26,6 +26,7 @@
       options:
         banner: '<%= meta.banner %>'

+      # This seemingly-useless concatenation is used to prepend the banner
       dist:
         src  : 'lib/kissmetrics.js'
         dest : 'lib/kissmetrics.js'


added missing Core file

added missing Core file

--- Gruntfile.coffee
+++ Gruntfile.coffee
@@ -49,6 +49,7 @@
             "src/Util.coffee",
             "src/Mediator.coffee"
             "src/Sandbox.coffee"
+            "src/Core.coffee"
             "src/scaleApp.coffee"
             "plugins/src/*.coffee" ]
       plugins:


Ensure window is active on CI so focus and blur events are natively dispatched

This is the right fix for b4745a816d1f508e6055e439fa9fcd96ae476645, reverted in c2e82c4f086fdfdfd3ad1484380fd17cab287669

--- test/src/test_helpers/test_helpers.coffee
+++ test/src/test_helpers/test_helpers.coffee
@@ -21,6 +21,9 @@
       callback = options

     beforeEach = ->
+      # Ensure window is active on CI so focus and blur events are natively dispatched
+      window.focus()
+
       ready = (callback) ->
         if template?
           addEventListener "trix-initialize", handler = ({target}) ->


Use d3 v3.5.0 for jasmine

Use d3 v3.5.0 for jasmine

--- Gruntfile.coffee
+++ Gruntfile.coffee
@@ -90,7 +90,7 @@
               specs: 'spec/*-spec.js'
               helpers: 'spec/*-helper.js'
               styles: 'c3.css'
-              vendor: 'http://d3js.org/d3.v3.min.js'
+              vendor: 'https://raw.githubusercontent.com/mbostock/d3/v3.5.0/d3.min.js'

         uglify:
           c3:


Apostrophes.

Apostrophes.

--- js/main.coffee
+++ js/main.coffee
@@ -96,15 +96,15 @@
     [
       "Equivalent to a single partial",
       "A small handful of views",
-      "It's everywhere, like the plague",
+      "Itʼs everywhere, like the plague",
     ]
     [
-      "Nothing - it's straight forward",
-      "I understand what it's doing, but I'm not 100% sure about parts",
-      "It's freaking greek",
+      "Nothing - itʼs straight forward",
+      "I understand what itʼs doing, but Iʼm not 100% sure about parts",
+      "Itʼs freaking greek",
     ]
     [
-      "C'mon - it's a copy change",
+      "Cʼmon - itʼs a copy change",
       "I could see some potential for problems, but they seem unlikely to have humongous impact",
       "I can imagine about 400 ways this blows up",
     ]


Implementation of ledger wallet attestation procedure

--- app/src/wallet/hardware_wallet.coffee
+++ app/src/wallet/hardware_wallet.coffee
@@ -178,6 +178,31 @@

   getExtendedPublicKeys: () -> @_xpubs

+  isDongleCertified: (callback) ->
+    randomValues = new Uint32Array(2)
+    crypto.getRandomValues(randomValues)
+    random = _.str.lpad(randomValues[0].toString(16), 8, '0') + _.str.lpad(randomValues[1].toString(16), 8, '0')
+    adpu = 'E0C2000008' + random
+    p = @sendAdpu new ByteString(adpu, HEX), [0x9000]
+    p.then (result) =>
+      attestation = result.toString(HEX)
+      @attestation =
+        raw: attestation
+        keyBatchId: attestation.substring(0, 8)
+        keyDerivationId: attestation.substring(8, 16)
+        supportedOperationBitFlag: attestation.substring(16, 18)
+        firmwareMajor: attestation.substring(18, 22)
+        firmwareMinor: attestation.substring(22, 24)
+        firmarePatch: attestation.substring(24, 26)
+        loaderIdMajor: attestation.substring(26, 28)
+        loaderIdMinor: attestation.substring(28, 30)
+        signature: attestation.substring(30)
+      l @attestation, random
+    p.fail (result) =>
+      e result
+
+  sendAdpu: (cla, ins, p1, p2, opt1, opt2, opt3, wrapScript) -> @_lwCard.dongle.card.sendApdu_async(cla, ins, p1, p2, opt1, opt2, opt3, wrapScript)
+
   _setState: (newState) ->
     @_state = newState
     switch newState


Fixes #4067 - Javascript error undefined multiple while opening core workflow with tree selects.

--- app/assets/javascripts/app/controllers/_ui_element/tree_select_search.coffee
+++ app/assets/javascripts/app/controllers/_ui_element/tree_select_search.coffee
@@ -1,9 +1,7 @@
 # coffeelint: disable=camel_case_classes
 class App.UiElement.tree_select_search extends App.UiElement.ApplicationUiElement
-  @render: (localAttribute, params) ->
-
-    # clone original attribute
-    attribute = clone(localAttribute)
+  @render: (attributeConfig, params) ->
+    attribute = $.extend({}, attributeConfig)

     # set multiple option
     if attribute.multiple


fix for preview tool

fix for preview tool

--- src/scripts/modules/media/tabs/tools/tools.coffee
+++ src/scripts/modules/media/tabs/tools/tools.coffee
@@ -6,6 +6,7 @@
   BaseView = require('cs!helpers/backbone/views/base')
   template = require('hbs!./tools-template')
   require('less!./tools')
+  _ = require('underscore')

   return class ToolsView extends BaseView
     template: template
@@ -13,7 +14,7 @@
       authenticated: session.get('id')
       encodedTitle: encodeURI(@model.get('title'))
       derivable: @model.canEdit()
-      isEditable: @model.isEditable()
+      isEditable: @isEditable
     }

     events:
@@ -37,3 +38,7 @@
       .done () ->
         url = linksHelper.getPath('contents', {model: page})
         router.navigate(url, {trigger: true})
+
+    isEditable: () =>
+      if _.indexOf(@model.get('permissions'), 'edit') >= 0
+        return true


do not override `previewUrlCallback`

do not override `previewUrlCallback`

--- app/assets/javascripts/uploadcare/settings.coffee
+++ app/assets/javascripts/uploadcare/settings.coffee
@@ -219,7 +219,8 @@
     if settings.validators
       settings.validators = settings.validators.slice()

-    settings.previewUrlCallback = defaultPreviewUrlCallback
+    if settings.previewProxy and not settings.previewUrlCallback
+      settings.previewUrlCallback = defaultPreviewUrlCallback

     settings


activity feed: update bucket activity createdAt array after live update

--- client/app/Applications/Activity.kdapplication/activitylistcontroller.coffee
+++ client/app/Applications/Activity.kdapplication/activitylistcontroller.coffee
@@ -145,6 +145,7 @@

     return unless activity.snapshot?

+    activityCreatedAt = activity.createdAt or (new Date()).toString()
     activity.snapshot = activity.snapshot.replace /"/g, '"'
     KD.remote.reviveFromSnapshots [activity], (err, [bucket])=>
       for item in @itemsOrdered
@@ -153,6 +154,7 @@
           if data.count > 3
             data.anchors.pop()
           data.anchors.unshift bucket.anchor
+          data.createdAtTimestamps.push activityCreatedAt
           data.count++
           item.slideOut =>
             @removeItem item, data


Make popup shorter, and bombing easier

Make popup shorter, and bombing easier

--- app/scripts/lazerscripts/stage1/stage1boss.coffee
+++ app/scripts/lazerscripts/stage1/stage1boss.coffee
@@ -438,7 +438,7 @@
     )

   execute: ->
-    @bindSequence 'Hit', @leaveScreen, => @entity.health < 255000
+    @bindSequence 'Hit', @leaveScreen, => @entity.health < 258000
     @inventoryAdd 'item', 'xp', ->
       Crafty.e('PowerUp').powerUp(contains: 'xp', marking: 'X')

@@ -609,7 +609,7 @@
       @sequence(
         @animate('blink', -1)
         @moveTo(y: .3 + (Math.random() * .6))
-        @wait(150)
+        @wait(200)
         @onKilled()
       )
     else


Update startup.coffee

Update startup.coffee

--- packages/rocketchat-lib/settings/server/startup.coffee
+++ packages/rocketchat-lib/settings/server/startup.coffee
@@ -35,8 +35,8 @@
 RocketChat.settings.add 'Accounts_OAuth_Twitter_id', '', { type: 'string', group: 'Accounts', section: 'Twitter' }
 RocketChat.settings.add 'Accounts_OAuth_Twitter_secret', '', { type: 'string', group: 'Accounts', section: 'Twitter' }

-RocketChat.settings.add 'Accounts_AllowUserProfileChange', false, { type: 'boolean', group: 'Accounts', section: 'General', public: true }
-RocketChat.settings.add 'Accounts_AllowUserAvatarChange', false, { type: 'boolean', group: 'Accounts', section: 'General', public: true }
+RocketChat.settings.add 'Accounts_AllowUserProfileChange', true, { type: 'boolean', group: 'Accounts', section: 'General', public: true }
+RocketChat.settings.add 'Accounts_AllowUserAvatarChange', true, { type: 'boolean', group: 'Accounts', section: 'General', public: true }
 RocketChat.settings.add 'Accounts_AllowUsernameChange', true, { type: 'boolean', group: 'Accounts', section: 'General', public: true }
 RocketChat.settings.add 'Accounts_AllowPasswordChange', true, { type: 'boolean', group: 'Accounts', section: 'General', public: true }


Copy examples from scripting.md

Copy examples from scripting.md

--- generators/app/templates/scripts/examples.coffee
+++ generators/app/templates/scripts/examples.coffee
@@ -1,33 +1,99 @@
 # Description:
-#   Example scripts for you to try out
-#
-# Commands:
-#   hubot fake event <event> - Triggers the <event> event for debugging reasons
-#
-# URLS:
-#   /hubot/version
-#   /hubot/ping
-#   /hubot/time
-#   /hubot/info
-#   /hubot/ip
-#
-# Events:
-#   debug - {user: <user object to send message to>}
-
-util = require 'util'
+#   Example scripts for you to examine and try out

 module.exports = (robot) ->

-  robot.respond /FAKE EVENT (.*)/i, (msg) ->
-    msg.send "fake event '#{msg.match[1]}' triggered"
-    robot.emit msg.match[1], {user: msg.message.user}
-
-  robot.on 'debug', (event) ->
-    robot.send event.user, util.inspect event
-
-  robot.router.get "/hubot/time", (req, res) ->
-    res.end "Server time is: #{new Date()}"
-
-  robot.router.get "/hubot/ip", (req, res) ->
-    robot.http('http://ifconfig.me/ip').get() (err, r, body) ->
-      res.end body
+  # robot.hear /badger/i, (msg) ->
+  #   msg.send "Badgers? BADGERS? WE DON'T NEED NO STINKIN BADGERS"
+  #
+  # robot.respond /open the (.*) doors/i, (msg) ->
+  #   doorType = msg.match[1]
+  #   if doorType is "pod bay"
+  #     msg.reply "I'm afraid I can't let you do that."
+  #   else
+  #     msg.reply "Opening #{doorType} doors"
+  #
+  # robot.hear /I like pie/i, (msg) ->
+  #   msg.emote "makes a freshly baked pie"
+  #
+  # lulz = ['lol', 'rofl', 'lmao']
+  #
+  # robot.respond /lulz/i, (msg) ->
+  #   msg.send msg.random lulz
+  #
+  # robot.topic (msg) ->
+  #   msg.send "#{msg.message.text}? That's a Paddlin'"
+  #
+  #
+  # enterReplies = ['Hi', 'Target Acquired', 'Firing', 'Hello friend.', 'Gotcha', 'I see you']
+  # leaveReplies = ['Are you still there?', 'Target lost', 'Searching']
+  #
+  # robot.enter (msg) ->
+  #   msg.send msg.random enterReplies
+  # robot.leave (msg) ->
+  #   msg.send msg.random leaveReplies
+  #
+  # answer = process.env.HUBOT_ANSWER_TO_THE_ULTIMATE_QUESTION_OF_LIFE_THE_UNIVERSE_AND_EVERYTHING
+  #
+  # robot.respond /what is the answer to the ultimate question of life/, (msg)
+  #   unless answer?
+  #     msg.send "Missing HUBOT_ANSWER_TO_THE_ULTIMATE_QUESTION_OF_LIFE_THE_UNIVERSE_AND_EVERYTHING in environment: please set and try again"
+  #     return
+  #   msg.send "#{answer}, but what is the question?"
+  #
+  # robot.respond /you are a little slow/, (msg)
+  #   setTimeout () ->
+  #     msg.send "Who you calling 'slow'?"
+  #   , 60 * 1000
+  #
+  # annoyIntervalId = null
+  #
+  # robot.respond /annoy me/, (msg)
+  #   if annoyIntervalId
+  #     msg.send "AAAAAAAAAAAEEEEEEEEEEEEEEEEEEEEEEEEIIIIIIIIHHHHHHHHHH"
+  #     return
+  #
+  #   msg.send "Hey, want to hear the most annoying sound in the world?"
+  #   annoyIntervalId = setInterval () ->
+  #     msg.send "AAAAAAAAAAAEEEEEEEEEEEEEEEEEEEEEEEEIIIIIIIIHHHHHHHHHH"
+  #   , 1000
+  #
+  # robot.respond /unannoy me/, (msg)
+  #   if annoyIntervalId
+  #     msg.send "GUYS, GUYS, GUYS!"
+  #     clearInterval(annoyIntervalId)
+  #     annoyIntervalId = null
+  #   else
+  #     msg.send "Not annoying you right now, am I?"
+  #
+  #
+  # robot.router.post '/hubot/chatsecrets/:room', (req, res) ->
+  #   room   = req.params.room
+  #   data   = JSON.parse req.body.payload
+  #   secret = data.secret
+  #
+  #   robot.messageRoom room, "I have a secret: #{secret}"
+  #
+  #   res.send 'OK'
+  #
+  # robot.error (err, msg) ->
+  #   robot.logger.error "DOES NOT COMPUTE"
+  #
+  #   if msg?
+  #     msg.reply "DOES NOT COMPUTE"
+  #
+  # robot.respond /have a soda/i, (msg) ->
+  #   # Get number of sodas had (coerced to a number).
+  #   beersHad = robot.brain.get('totalSodas') * 1 or 0
+  #
+  #   if beersHad > 4
+  #     msg.reply "I'm too fizzy.."
+  #
+  #   else
+  #     msg.reply 'Sure!'
+  #
+  #     robot.brain.set 'totalSodas', beersHad+1
+  #
+  # robot.respond /sleep it off/i, (msg) ->
+  #   robot.brain.set 'totalSodas', 0
+  #   robot.respond 'zzzzz'


adding negation checks to containers , adding title filed to containers  removing Rule

--- app/assets/javascripts/builder/container.js.coffee
+++ app/assets/javascripts/builder/container.js.coffee
@@ -1,23 +1,4 @@
-@queryStructure = @queryStructure || {}
-
-
-queryStructure.createContainer= (parent, json) ->
-  _ret = null
-  _children = []
-  if(json["and"])
-    _ret =  new queryStructure.And(parent,[])
-    _children = json["and"]
-  else if(json["or"])
-    _ret =   new queryStructure.Or(parent,[])
-    _children = json["or"]
-  else if(json["not"])
-    _ret =   new queryStructure.Not(parent,[])
-    _children = json["not"]
-
-  for item in _children
-     _ret.add(queryStructure.createContainer(_ret,item))
-
-  _ret
+@queryStructure ||= {}

 class queryStructure.Query
@@ -45,7 +26,7 @@
         return new queryStructure[ruleType](@element['category'], @element['title'], @element['field'], @element['value'])
     else
       container = this.getContainerType(@element)
-      newContainer = new queryStructure[container](@parent, null, @element.name || null)
+      newContainer = new queryStructure[container](@parent, [], @element.name, @element.title, @element.negate)
       for child in @element[container.toLowerCase()]
         newContainer.add(this.buildFromJson(newContainer, child))
       return newContainer
@@ -81,7 +62,7 @@
 ##############

 class queryStructure.Container
-  constructor: (@parent, @children = [], @name, @negate = false) ->
+  constructor: (@parent, @children = [], @name, @title, @negate = false) ->
     @children ||= []

   add: (element, after) ->
@@ -138,53 +119,49 @@

   clear: ->
     children = []
+
+  childrenToJson: ->
+     childJson = [];
+     for child in @children
+       childJson.push(child.toJson())
+     return childJson
+

 class queryStructure.Or extends queryStructure.Container
   toJson: ->
-    childJson = [];
-    for child in @children
-      childJson.push(child.toJson())
-    return { "or" : childJson }
+    childJson = this.childrenToJson()
+    return { "name" : @name, "or" : childJson, "negate" : @negate, "title" : @title }

   test: (patient) ->
     if (@children.length == 0)
       return true;
+    retval = false
     for child in @children
       if (child.test(patient))
-        return true;
-    return false;
+        retval true
+        break
+    return if @negate then !retval else retval;

 class queryStructure.And extends queryStructure.Container
   toJson: ->
-    childJson = [];
-    for child in @children
-      childJson.push(child.toJson())
-    if @name?
-      return { "name" : @name, "and" : childJson }
-    else
-      return { "and" : childJson }
+    childJson = this.childrenToJson()
+    return { "name" : @name, "and" : childJson, "negate" : @negate, "title" : @title }
+

   test: (patient) ->
+    if (@children.length == 0)
+      return true;
+    retval = true
     for child in @children
       if (!child.test(patient))
-        return false;
-    return true;
-
-
-
-class queryStructure.Not extends queryStructure.Container
-  toJson: ->
-    childJson = [];
-    for child in @children
-      childJson.push(child.toJson())
-    return { "not" : childJson }
-
-    test: (patient) ->
-      for child in @children
-        if (child.test(patient))
-          return true;
-      return false;
+        retval =  false
+        break
+
+    return if @negate then !retval else retval
+
+
+

 class queryStructure.CountN extends queryStructure.Container


Fixed JS issue with diff image loading

Fixed JS issue with diff image loading

--- app/assets/javascripts/commit/image-file.js.coffee
+++ app/assets/javascripts/commit/image-file.js.coffee
@@ -119,8 +119,9 @@

   requestImageInfo: (img, callback) ->
     domImg = img.get(0)
-    if domImg.complete
-      callback.call(this, domImg.naturalWidth, domImg.naturalHeight)
-    else
-      img.on 'load', =>
+    if domImg
+      if domImg.complete
         callback.call(this, domImg.naturalWidth, domImg.naturalHeight)
+      else
+        img.on 'load', =>
+          callback.call(this, domImg.naturalWidth, domImg.naturalHeight)


Create @wrapper in adapter constructor

Create @wrapper in adapter constructor

--- app/assets/javascripts/embeditor/adapter.js.coffee
+++ app/assets/javascripts/embeditor/adapter.js.coffee
@@ -12,13 +12,14 @@
         @dataOptions    = @_extractData()
         @queryParams    = @_buildParams(@dataOptions, options)

+        @wrapper        = $("<div />", class: @options.wrapperClass)
+

     swap: ->
         return

     embed: (html) ->
-        @wrapper = $("<div />", class: @options.wrapperClass)
         @wrapper.html(html)
         @element.after @wrapper


don't allow users to create a mark smaller the min-width

--- app/classifier/drawing-tools/column-rectangle.cjsx
+++ app/classifier/drawing-tools/column-rectangle.cjsx
@@ -45,12 +45,11 @@
   initCoords: null

   render: ->
-    console.log('props', @props)
     {x, y, width} = @props.mark

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

       {if @props.selected
@@ -68,25 +67,25 @@
     @props.onChange @props.mark

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

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

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

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

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


Accessibility: Alert message added for message delete

Fixes: CNVS-12802

An alert message was needed to inform screen readers
that the message was deleted. I decided to go with
both audio and visual alert, but this can be easily
changed to just audio if it's decided that the
visual notification in unnecessary.

Test-Plan:
Using a screenreader
1.) Navigate to conversations
2.) Delete a message
3.) Verify that an audible and visual alert exists

Change-Id: I68a54074df7eff2b9d04f3d99d6617a77208488c
Reviewed-on: https://gerrit.instructure.com/35883
Reviewed-by: Aaron Cannon <25919c673621c006b735dcd5a28df63325948e2b@instructure.com>
Tested-by: Jenkins <d95b56ce41a2e1ac4cecdd398defd7414407cc08@instructure.com>
QA-Review: Steven Shepherd <e794458448443812fb2685675aab3bbd1a3891bc@instructure.com>
Product-Review: Jayce Higgins <8f0644d105785a923e938c7b131e3ab930cb6139@instructure.com>
Reviewed-by: Drew Bowman <43bd25f9469d5056946537962fe98ec04e66c401@instructure.com>

--- app/coffeescripts/bundles/conversations_new.coffee
+++ app/coffeescripts/bundles/conversations_new.coffee
@@ -26,6 +26,7 @@

     messages:
       confirmDelete: I18n.t('confirm.delete_conversation', 'Are you sure you want to delete your copy of this conversation? This action cannot be undone.')
+      messageDeleted: I18n.t('message_deleted', 'Message Deleted!')

     sendingCount: 0

@@ -126,6 +127,7 @@
       delete @detail.model
       @list.collection.remove(messages)
       @header.updateUi(null)
+      $.flashMessage(@messages.messageDeleted)
       @detail.render()

     onCompose: (e) =>


pan map to selected poi

pan map to selected poi

--- app/assets/javascripts/lib/maps/lodging_map.coffee
+++ app/assets/javascripts/lib/maps/lodging_map.coffee
@@ -122,9 +122,11 @@
       for id, marker of @markers
         if id == poi_id
           marker.setIcon(@markerImageFor(marker.category, 'large'))
+          @map.panTo(marker.getPosition())
         else
           marker.setIcon(@markerImageFor(marker.category))

     resetPOIs: ->
       marker.setIcon(@markerImageFor(marker.category)) for id, marker of @markers
-
+      @map.panTo( new google.maps.LatLng(@args.latitude, @args.longitude))
+#


Drag walls to place them continuously.

Drag walls to place them continuously.

--- app/views/editor/level/thangs/ThangsTabView.coffee
+++ app/views/editor/level/thangs/ThangsTabView.coffee
@@ -39,6 +39,7 @@
     'sprite:mouse-up': 'onSpriteMouseUp'
     'sprite:mouse-down': 'onSpriteMouseDown'
     'sprite:double-clicked': 'onSpriteDoubleClicked'
+    'surface:stage-mouse-down': 'onStageMouseDown'
     'surface:stage-mouse-up': 'onStageMouseUp'
     'editor:random-terrain-generated': 'onRandomTerrainGenerated'

@@ -225,8 +226,18 @@
     # if e.originalEvent.nativeEvent.button == 2
     #   @onSpriteContextMenu e

+  onStageMouseDown: (e) ->
+    return unless @addThangSprite?.thangType.get('kind') is 'Wall'
+    @surface.camera.dragDisabled = true
+    @paintingWalls = true
+
   onStageMouseUp: (e) ->
-    if @addThangSprite
+    if @paintingWalls
+      # We need to stop painting walls, but we may also stop in onExtantThangSelected.
+      _.defer =>
+        @paintingWalls = false
+        @surface.camera.dragDisabled = false
+    else if @addThangSprite
       @surface.camera.lock()
       # If we click on the background, we need to add @addThangSprite, but not if onSpriteMouseUp will fire.
       @backgroundAddClickTimeout = _.defer => @onExtantThangSelected {}
@@ -295,7 +306,10 @@
     @selectedExtantSprite?.setNameLabel? null unless @selectedExtantSprite is e.sprite
     @selectedExtantThang = e.thang
     @selectedExtantSprite = e.sprite
-    if e.thang and (key.alt or key.meta)
+    if @paintingWalls
+      @paintingWalls = false
+      @surface.camera.dragDisabled = false
+    else if e.thang and (key.alt or key.meta)
       # We alt-clicked, so create a clone addThang
       @selectAddThangType e.thang.spriteName, @selectedExtantThang
     else if @justAdded()
@@ -389,6 +403,15 @@
     wop = @surface.camera.screenToWorld x: e.x, y: e.y
     wop.z = 0.5
     @adjustThangPos @addThangSprite, @addThangSprite.thang, wop
+    if @paintingWalls
+      unless _.find @surface.spriteBoss.spriteArray, ((sprite) =>
+        sprite.thangType.get('kind') is 'Wall' and
+        Math.abs(sprite.thang.pos.x - @addThangSprite.thang.pos.x) < 2 and
+        Math.abs(sprite.thang.pos.y - @addThangSprite.thang.pos.y) < 2 and
+        sprite isnt @addThangSprite
+      )
+        @addThang @addThangType, @addThangSprite.thang.pos
+        @lastAddTime = new Date()
     null

   onSurfaceMouseOver: (e) ->


Fix experience/gems not showing in HeroVictoryModal

--- app/views/play/level/modal/HeroVictoryModal.coffee
+++ app/views/play/level/modal/HeroVictoryModal.coffee
@@ -212,7 +212,7 @@

   afterRender: ->
     super()
-    @$el.toggleClass 'show-achievements', @level.get('type', true) is 'hero'
+    @$el.toggleClass 'with-achievements', @level.get('type', true) is 'hero'
     return unless @supermodel.finished()
     @playSelectionSound hero, true for original, hero of @thangTypes  # Preload them
     @updateSavingProgressStatus()


This should fix the build.

This should fix the build.

--- spec/conflict-marker-spec.coffee
+++ spec/conflict-marker-spec.coffee
@@ -32,7 +32,7 @@
     expect(editorView.hasClass 'conflicted').toBe(true)

   it 'removes any old classes', ->
-    line = editorView.renderedLines.eq(2)
+    line = editorView.find('.line').eq(2)
     line.addClass "ours"
     m.remark()
     expect(line.hasClass 'ours').toBe(false)


cleanup spec

cleanup spec

--- spec/quick-highlight-spec.coffee
+++ spec/quick-highlight-spec.coffee
@@ -11,9 +11,6 @@
       decorations.push(decoration)
   decorations

-setConfig = (name, value) ->
-  atom.config.set("quick-highlight.#{name}", value)
-
 ensureDecorations = (editor, options) ->
   decorations = getDecorations(editor)
   groupedDecoration = _.groupBy decorations, (decoration) ->
@@ -30,15 +27,14 @@
 # Main
 # -------------------------
 describe "quick-highlight", ->
-  [editor, editorContent, editorElement, main, workspaceElement, pathSample1, pathSample2] = []
+  [editor, editorContent, editorElement, main] = []

   dispatchCommand = (command, {element}={}) ->
     element ?= editorElement
     atom.commands.dispatch(element, command)

   beforeEach ->
-    workspaceElement = atom.views.getView(atom.workspace)
-    jasmine.attachToDOM(workspaceElement)
+    jasmine.attachToDOM(atom.views.getView(atom.workspace))

     editorContent = """
       orange
@@ -140,7 +136,7 @@
       expect(getDecorations(editor)).toHaveLength(0)

     it "won't highlight selectedText length is less than highlightSelectionMinimumLength", ->
-      setConfig('highlightSelectionMinimumLength', 3)
+      atom.config.set("quick-highlight.highlightSelectionMinimumLength", 3)
       dispatchCommand('core:select-right')
       advanceClock(150)
       expect(editor.getSelectedText()).toBe "o"
@@ -169,7 +165,7 @@
       expect(getDecorations(editor)).toHaveLength 0

     it "won't highlight when highlightSelection is disabled", ->
-      setConfig('highlightSelection', false)
+      atom.config.set('quick-highlight.highlightSelection', false)
       dispatchCommand('editor:select-word')
       advanceClock(150)
       expect(editor.getSelectedText()).toBe "orange"
@@ -177,7 +173,7 @@

     describe "highlightSelectionExcludeScopes", ->
       beforeEach ->
-        setConfig('highlightSelectionExcludeScopes', [
+        atom.config.set('quick-highlight.highlightSelectionExcludeScopes', [
             'foo.bar',
             'hoge',
           ])
@@ -198,7 +194,7 @@

     describe "highlightSelectionDelay", ->
       beforeEach ->
-        setConfig('highlightSelectionDelay', 300)
+        atom.config.set('quick-highlight.highlightSelectionDelay', 300)

       it "highlight selection after specified delay", ->
         dispatchCommand('editor:select-word')
@@ -225,7 +221,7 @@
         waitsFor -> main.statusBarManager.tile?

         runs ->
-          container = workspaceElement.querySelector('#status-bar-quick-highlight')
+          container = atom.views.getView(atom.workspace).querySelector('#status-bar-quick-highlight')
           span = container.querySelector('span')

       it 'display latest highlighted count on statusbar', ->


Enable layered errorInterceptor spec

Enable layered errorInterceptor spec

--- spec/storage-manager-spec.coffee
+++ spec/storage-manager-spec.coffee
@@ -680,7 +680,7 @@
         server.respond()
         expect(customHandler).toHaveBeenCalled()

-      xit "should also get called any amount of layers deep", ->
+      it "should also get called any amount of layers deep", ->
         errorHandler = jasmine.createSpy('errorHandler')
         successHandler = jasmine.createSpy('successHandler')
         taskOne = buildTask(id: 10, sub_task_ids: [12])


new(LandingExplain): add Louise and Marten to Team

--- src/components/LandingExplain.coffee
+++ src/components/LandingExplain.coffee
@@ -99,26 +99,32 @@
           div className: "circle yellow",
             img className: "teamImage", src: require "../img/team/Thao.jpg"
           div className: "team-member-name", "Thao Tran"
-          div null, "Theaterstudentin"
-          div null, "Brand Management"
+          div null, "Lebensgefühl von morgen"
         div className: "teamMember",
           div className: "circle pink",
             a href:"http://www.ideenhochdrei.org/de/verein/kennenlernen/menschen/helmut-wolmann/",
               img className: "teamImage", src: require "../img/team/Helmut.jpg"
           div className: "team-member-name", "Helmut Wolman"
-          div null, "Vorstand von Ideen³ e.V."
-          div null, "Network & Development"
+          div null, "Vorstand Ideen³ e.V."
+          div null, "Projektentwicklung"
+        div className: "teamMember",
+          div className: "circle berry",
+            img className: "teamImage", src: require "../img/team/David.jpg"
+          div className: "team-member-name", "David Ziegler"
+          div null, "Softwaredevelopment"
         div className: "teamMember",
           div className: "circle green",
             img className: "teamImage", src: require "../img/team/Lisa.jpg"
           div className: "team-member-name", "Lisa Stehr"
-          div null, "Promoviert in Psychologie"
-          div null, "Funding & Strategy"
-         div className: "teamMember",
-          div className: "circle berry",
-            img className: "teamImage", src: require "../img/team/David.jpg"
-          div className: "team-member-name", "David Ziegler"
-          div null, "Softwaredevelopment"
+          div null, "Politikwissenschaftlerin"
+          div null, "Strategie und Wirkung "
+        div className: "teamMember",
+          div className: "circle green",
+           a href:"http://martenroebel.de/",
+             img className: "teamImage", src: require "../img/team/Marten.jpg"
+          div className: "team-member-name", "Marten Röbel"
+          div null, "Achtsamkeit und "
+          div null, "Change-Psychologie"
         div className: "teamMember",
           div className: "circle green",
            a href:"https://slowtec.de/team.html#",
@@ -130,13 +136,25 @@
           div className: "circle pink",
             img className: "teamImage", src: require "../img/team/placeholder_1.png"
           div className: "team-member-name", "Florian Jostock"
-          div null, "Software Development"
+          div null, "Beratung Webentwicklung"
+        div className: "teamMember",
+          div className: "circle blue",
+            img className: "teamImage", src: require "../img/team/Louisa.JPG"
+          div className: "team-member-name", "Louisa Pieper"
+          div null, "PR und Marketing"
+          div null, "Regionalpilotin Köln"
         div className: "teamMember",
           div className: "circle blue",
             img className: "teamImage", src: require "../img/team/Anja.jpg"
           div className: "team-member-name", "Anja Dannemann"
           div null, "Designerin"
           div null, "Graphic Design"
+        div className: "teamMember",
+          div className: "circle berry",
+            img className: "teamImage", src: require "../img/team/Xueqian.jpg"
+          div className: "team-member-name", "Xueqian Chen"
+          div null, "Unternehmensberaterin"
+          div null, "PR & Marketing"
         div className: "teamMember",
           div className: "circle blue",
             img className: "teamImage", src: require "../img/team/Ben.jpg"
@@ -149,12 +167,6 @@
           div className: "team-member-name", "Frederik Schütz"
           div null, "Netzwerk-Ass"
           div null, "Business & Finance"
-        div className: "teamMember",
-          div className: "circle berry",
-            img className: "teamImage", src: require "../img/team/Xueqian.jpg"
-          div className: "team-member-name", "Xueqian Chen"
-          div null, "Unternehmensberaterin"
-          div null, "PR & Marketing"
         div className: "teamMember",
           div className: "circle blue",
             img className: "teamImage", src: require "../img/team/placeholder_4.png"


twipsy changes to add custom classes

twipsy changes to add custom classes

--- core/utils.coffee
+++ core/utils.coffee
@@ -192,8 +192,6 @@
       minLength : l
       maxLength : l + Math.floor(l/10)
       suffix    : ' '
-
-

     text = if text.length > shortenedText.length
       morePart  = "<span class='collapsedtext hide'>"


KD.utils: helper to get object from array with given key

--- core/utils.coffee
+++ core/utils.coffee
@@ -461,6 +461,11 @@
       option.title ?= key
       option.key    = key
       option
+
+  arrayToObject: (list, key) ->
+    dict = {}
+    dict[obj[key]] = obj for obj in list when obj[key]?
+    dict

   # The partition function takes a list and predicate fn and returns the pair of lists
   # of elements which do and do not satisfy the predicate, respectively.


closure-compile

closure-compile

--- core/utils.coffee
+++ core/utils.coffee
@@ -297,7 +297,7 @@
   generatePassword: do ->

     letter = /[a-zA-Z]$/;
-    vowel = /[aeiouAEIOU]$/;
+    vowel = /[aeiouAEIOU]$      /;
     consonant = /[bcdfghjklmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ]$/;

     (length = 10, memorable = yes, pattern = /\w/, prefix = '')->
@@ -306,15 +306,15 @@

       if memorable
         pattern = if consonant.test(prefix) then vowel else consonant
-
-      n    = (Math.floor(Math.random() * 100) % 94) + 33
-      char = String.fromCharCode(n)
-      char = char.toLowerCase() if memorable
-
-      unless pattern.test char
+
+      n   = (Math.floor(Math.random() * 100) % 94) + 33
+      chr = String.fromCharCode(n)
+      chr = chr.toLowerCase() if memorable
+
+      unless pattern.test chr
         return __utils.generatePassword length, memorable, pattern, prefix

-      return __utils.generatePassword length, memorable, pattern, "" + prefix + char
+      return __utils.generatePassword length, memorable, pattern, "" + prefix + chr

   ###


Fix migration again :/

Fix migration again :/

--- migrations/20140702051422826_password_to_password_digest.coffee
+++ migrations/20140702051422826_password_to_password_digest.coffee
@@ -11,14 +11,16 @@
       # Batch ops to set passwordDigest
       ops = []
       for user, i in users
-        if {password} = user.toObject()
-          next('Already migrated') if user.passwordDigest
-          user.passwordDigest = bcrypt.hashSync(password, bcrypt.genSaltSync())
+        {password} = user.toObject()
+        if user.passwordDigest or not password?
+          console.log('Already migrated')
+          return done()

-          ops.push (next) ->
-            user.save next
-        else
-          next('Couldn’t get the user’s password.')
+        user.passwordDigest = bcrypt.hashSync(password, bcrypt.genSaltSync())
+
+        ops.push (next) ->
+          user.save next
+

       async.parallel ops, (err) ->
         throw err if err


more coffee-scripty

more coffee-scripty

--- controllers/websocket.coffee
+++ controllers/websocket.coffee
@@ -1,12 +1,9 @@
 app = require '../config/app'

 app.ws?.sockets.on 'connection', (client) ->
-  client
-    .on('message', (data) ->
-      data = JSON.parse(data)
-      data.id = client.id
-      client.broadcast.send(JSON.stringify(data))
-    ).on('disconnect', ->
-      client.broadcast.send(
-        JSON.stringify(id: client.id, disconnect: true))
-    )
+  client.on 'message', (data) ->
+    data = JSON.parse(data)
+    data.id = client.id
+    client.broadcast.send JSON.stringify(data)
+  client.on 'disconnect', ->
+    client.broadcast.send JSON.stringify(id: client.id, disconnect: true)


Fix timing issue in test

Fix timing issue in test

--- test/auth_keysecret.coffee
+++ test/auth_keysecret.coffee
@@ -79,7 +79,7 @@
       early = (new Date).getTime()
       req = auth.authorize(builder.buildRequest('GET', '/'))
       req.headers['X-Buttercoin-Date'].should.be.type 'number'
-      req.headers['X-Buttercoin-Date'].should.equal early # TODO - should strictly be >=
+      req.headers['X-Buttercoin-Date'].should.be.greaterThan (early - 1)

     it 'should not add signing headers to an unauthenticated request', ->
       req = auth.authorize({_auth: false})


removed dependency on the name of the app in the definition of the app

--- core/app/backbone/app.coffee
+++ core/app/backbone/app.coffee
@@ -1,10 +1,10 @@
 class FactlinkAppClass extends Backbone.Marionette.Application
   startAsSite: ->
     @startSiteRegions()
-    FactlinkApp.addInitializer @automaticLogoutInitializer
-    FactlinkApp.addInitializer FactlinkApp.notificationsInitializer
+    @addInitializer @automaticLogoutInitializer
+    @addInitializer @notificationsInitializer

-    FactlinkApp.addInitializer (options)->
+    @addInitializer (options)->
       new ProfileRouter controller: new ProfileController # first, as then it doesn't match index pages such as "/m" using "/:username"
       new ChannelsRouter controller: new ChannelsController
       new ConversationsRouter controller: new ConversationsController
@@ -14,14 +14,14 @@
     @start()

   startAsTour: ->
-    FactlinkApp.addInitializer (options)->
+    @addInitializer (options)->
       new TourRouter controller: new TourController

     @start()

   startAsClient: ->
     @startClientRegions()
-    FactlinkApp.addInitializer (options)->
+    @addInitializer (options)->
       new ClientRouter controller: new ClientController

     @start()


tests

tests

--- vendor/assets/javascripts/planning_view.js.coffee
+++ vendor/assets/javascripts/planning_view.js.coffee
@@ -5,6 +5,16 @@

   #do stuff only on planning views
   if $('#planning-view__container').length
+
+
+    #START GLOBAL VARIABLES
+    #
+    #
+    window.pa_planning_y_limit = 0         #vertical scroll position for the floating header
+    window.pa_planning_ctrl_locker = false #keydown status to prevent from repeating control key
+    #
+    #
+    #END GLOBAL VARIABLES

     #START BUDGETS SPECIFIC FILTERS
     #
@@ -83,121 +93,112 @@
     #
     #
     #END INITIALIZATION
-
-    #START GLOBAL VARIABLES
-    #
-    #
-    window.pa_planning_y_limit = 0         #vertical scroll position for the floating header
-    window.pa_planning_ctrl_locker = false #keydown status to prevent from repeating control key
-    #
-    #
-    #END GLOBAL VARIABLES
-
-    #START UTILITY FUNCTION
-    #
-    #
-    #  update header's position
-    pa_planning_update_header = (e) ->
-      y = $(window).scrollTop()
-      if y > window.pa_planning_y_limit
-        if !$('.planning-view__header').hasClass 'planning-view__header--fixed'
-          $('.planning-view__header').addClass 'planning-view__header--fixed'
-          $('.planning-view__body').addClass 'planning-view__body--alone'
-      else
-        if $('.planning-view__header').hasClass 'planning-view__header--fixed'
-          $('.planning-view__header').removeClass 'planning-view__header--fixed'
-          $('.planning-view__body').removeClass 'planning-view__body--alone'
-
-    #  manage keyboard shortcuts
-    pa_planning_shortcuts = (e) ->
-      unless window.pa_planning_ctrl_locker
-        if e.keyCode == 37
-          #move left
-          window.pa_planning_ctrl_locker = true
-          pa_planning_horizontal_move 10
-        else if e.keyCode == 39
-          #move right
-          window.pa_planning_ctrl_locker = true
-          pa_planning_horizontal_move -10
-
-    #  unlock keyboard shortcuts
-    pa_planning_shortcuts_unlock = () ->
-      window.pa_planning_ctrl_locker = false
-
-    #  access properties of the wrapper's css rule
-    window.CCSStylesheetRuleStyle2 = (stylesheet, selector, style, value = undefined) ->
-      property = undefined
-      for i in document.styleSheets
-        if i.title && i.title.indexOf stylesheet != -1
-          rules = i[if document.all then 'rules' else 'cssRules']
-          for j in rules
-            if j.selectorText == selector
-              property = j.style
-              break
+#
+#
+#END DOCUMENT READY
+
+
+#START UTILITY FUNCTION
+#
+#
+#  update header's position
+pa_planning_update_header = (e) ->
+  y = $(window).scrollTop()
+  if y > window.pa_planning_y_limit
+    if !$('.planning-view__header').hasClass 'planning-view__header--fixed'
+      $('.planning-view__header').addClass 'planning-view__header--fixed'
+      $('.planning-view__body').addClass 'planning-view__body--alone'
+  else
+    if $('.planning-view__header').hasClass 'planning-view__header--fixed'
+      $('.planning-view__header').removeClass 'planning-view__header--fixed'
+      $('.planning-view__body').removeClass 'planning-view__body--alone'
+
+#  manage keyboard shortcuts
+pa_planning_shortcuts = (e) ->
+  unless window.pa_planning_ctrl_locker
+    if e.keyCode == 37
+      #move left
+      window.pa_planning_ctrl_locker = true
+      pa_planning_horizontal_move 10
+    else if e.keyCode == 39
+      #move right
+      window.pa_planning_ctrl_locker = true
+      pa_planning_horizontal_move -10
+
+#  unlock keyboard shortcuts
+pa_planning_shortcuts_unlock = () ->
+  window.pa_planning_ctrl_locker = false
+
+#  access properties of the wrapper's css rule
+window.CCSStylesheetRuleStyle2 = (stylesheet, selector, style, value = undefined) ->
+  property = undefined
+  for i in document.styleSheets
+    if i.title && i.title.indexOf stylesheet != -1
+      rules = i[if document.all then 'rules' else 'cssRules']
+      for j in rules
+        if j.selectorText == selector
+          property = j.style
           break
-      if property == undefined
-        css = "#planning-view__container .planning-view__row-wrapper { #{property}: #{value} }"
-        console.log css
-        head = document.head || document.getElementsByTagName('head')[0]
-        style = document.createElement 'style'
-        style.type = 'text/css'
-        style.title = 'pa-planning-cssRules'
-        if style.styleSheet
-          style.styleSheet.cssText = css;
-        else
-          style.appendChild(document.createTextNode css)
-        head.appendChild(style)
-      else
-        console.log "YES"
-        if value == undefined
-          return property[style]
-        else
-          return property[style] = value
-
-
-    pa_planning_wrapper_property = (property, value = undefined) ->
-      return CCSStylesheetRuleStyle2 'pa-planning-cssRules', '#planning-view__container .planning-view__row-wrapper', property, value
-
-    #  move left or right the wrappers
-    pa_planning_horizontal_move = (delta) ->
-      unless delta == 0
-        width = parseInt(pa_planning_wrapper_property 'width')
-        margin_left = parseFloat(pa_planning_wrapper_property 'margin-left') + delta;
-        min_margin_left = (width) * -1 + 90;
-        if margin_left >= 10
-          margin_left = 10
-          $('.planning-view__ctrl-move-left').hide()
-        else
-          $('.planning-view__ctrl-move-left').show()
-        if margin_left <= min_margin_left
-          margin_left = min_margin_left
-          $('.planning-view__ctrl-move-right').hide()
-        else
-          $('.planning-view__ctrl-move-right').show()
-        pa_planning_wrapper_property 'margin-left', margin_left + '%'
-
-    # zoom control
-    pa_planning_zoom = (zoom) ->
-      dropdown = $('.planning-view__header--control-zoom')
-      el = dropdown.find('a[data-zoom=' + zoom + ']')
-      dropdown.find('li').removeClass('active')
-      dropdown.find('a[data-toggle=dropdown] span').html(el.html())
-      el.parent().addClass('active')
-      old_width = parseFloat(pa_planning_wrapper_property 'width')
-      new_width = parseFloat(el.data 'zoom')
-      if old_width != new_width
-        old_margin_left = parseFloat(pa_planning_wrapper_property 'margin-left')
-        new_margin_left = ((old_margin_left + ((old_width - 100.0) / 2.0)) * new_width / old_width) - ((new_width - 100.0) / 2.0)
-        pa_planning_wrapper_property 'width', new_width + '%'
-        pa_planning_horizontal_move -(old_margin_left - new_margin_left)
-        if parseInt(el.data('nb-of-months')) > 30
-          $('.planning-view__header--month').addClass('vertical');
-        else
-          $('.planning-view__header--month').removeClass('vertical');
-    #
-    #
-    #END UTILITY FUNCTIONS
-
-#
-#
-#END DOCUMENT READY
+      break
+  if property == undefined
+    css = "#planning-view__container .planning-view__row-wrapper { #{property}: #{value} }"
+    console.log css
+    head = document.head || document.getElementsByTagName('head')[0]
+    style = document.createElement 'style'
+    style.type = 'text/css'
+    style.title = 'pa-planning-cssRules'
+    if style.styleSheet
+      style.styleSheet.cssText = css;
+    else
+      style.appendChild(document.createTextNode css)
+    head.appendChild(style)
+  else
+    console.log "YES"
+    if value == undefined
+      return property[style]
+    else
+      return property[style] = value
+
+
+pa_planning_wrapper_property = (property, value = undefined) ->
+  return CCSStylesheetRuleStyle2 'pa-planning-cssRules', '#planning-view__container .planning-view__row-wrapper', property, value
+
+#  move left or right the wrappers
+pa_planning_horizontal_move = (delta) ->
+  unless delta == 0
+    width = parseInt(pa_planning_wrapper_property 'width')
+    margin_left = parseFloat(pa_planning_wrapper_property 'margin-left') + delta;
+    min_margin_left = (width) * -1 + 90;
+    if margin_left >= 10
+      margin_left = 10
+      $('.planning-view__ctrl-move-left').hide()
+    else
+      $('.planning-view__ctrl-move-left').show()
+    if margin_left <= min_margin_left
+      margin_left = min_margin_left
+      $('.planning-view__ctrl-move-right').hide()
+    else
+      $('.planning-view__ctrl-move-right').show()
+    pa_planning_wrapper_property 'margin-left', margin_left + '%'
+
+# zoom control
+pa_planning_zoom = (zoom) ->
+  dropdown = $('.planning-view__header--control-zoom')
+  el = dropdown.find('a[data-zoom=' + zoom + ']')
+  dropdown.find('li').removeClass('active')
+  dropdown.find('a[data-toggle=dropdown] span').html(el.html())
+  el.parent().addClass('active')
+  old_width = parseFloat(pa_planning_wrapper_property 'width')
+  new_width = parseFloat(el.data 'zoom')
+  if old_width != new_width
+    old_margin_left = parseFloat(pa_planning_wrapper_property 'margin-left')
+    new_margin_left = ((old_margin_left + ((old_width - 100.0) / 2.0)) * new_width / old_width) - ((new_width - 100.0) / 2.0)
+    pa_planning_wrapper_property 'width', new_width + '%'
+    pa_planning_horizontal_move -(old_margin_left - new_margin_left)
+    if parseInt(el.data('nb-of-months')) > 30
+      $('.planning-view__header--month').addClass('vertical');
+    else
+      $('.planning-view__header--month').removeClass('vertical');
+#
+#
+#END UTILITY FUNCTIONS


Log : added spaces before and after operators

--- workers/social/lib/social/models/log/index.coffee
+++ workers/social/lib/social/models/log/index.coffee
@@ -55,7 +55,7 @@
       return callback true

     # if first results' createdAt lt 5 min return false
-    resultTimestamp = results[TRY_LIMIT_FOR_BLOCKING-1].createdAt.getTime()+TIME_LIMIT_IN_MS
+    resultTimestamp = results[TRY_LIMIT_FOR_BLOCKING - 1].createdAt.getTime() + TIME_LIMIT_IN_MS
     currentTimestamp = Date.now()

     if resultTimestamp > currentTimestamp


Enable dragging on the new path at the correct time

--- src/pen-tool.coffee
+++ src/pen-tool.coffee
@@ -20,7 +20,9 @@

   activate: ->
     @objectEditor.activate()
-    @subscriptions = @objectEditor.editors.Path.on('mousedown:node', @onMouseDownNode.bind(this))
+    @subscriptions = new CompositeDisposable
+    @subscriptions.add @objectEditor.editors.Path.on('mousedown:node', @onMouseDownNode.bind(this))
+    @subscriptions.add @selectionModel.on('change:selected', @onChangedSelectedObject.bind(this))
     svg = @svgDocument.getSVGRoot()
     svg.on 'mousedown', @onMouseDown
     svg.on 'mousemove', @onMouseMove
@@ -30,11 +32,15 @@
   deactivate: ->
     @objectEditor.deactivate()
     @subscriptions?.dispose()
+    @_unsetCurrentObject()
     svg = @svgDocument.getSVGRoot()
     svg.off 'mousedown', @onMouseDown
     svg.off 'mousemove', @onMouseMove
     svg.off 'mouseup', @onMouseUp
     @active = false
+
+  onChangedSelectedObject: ({object, old}) =>
+    old.disableDragging() if old?

   onMouseDownNode: (event) ->
     {node} = event
@@ -71,6 +77,7 @@

   _unsetCurrentObject: ->
     @currentObjectSubscriptions?.dispose()
+    @currentObject?.enableDragging()
     @currentObject = null

   _unsetCurrentNode: ->


Add support for sending cross-origin requests with credentials

--- src/coffee/cilantro/setup.coffee
+++ src/coffee/cilantro/setup.coffee
@@ -8,3 +8,9 @@
        if $.hasPendingRequest()
            return "Wow, you're quick! Your data is being saved. " +
                 "It will only take a moment."
+
+    # Support cross domain requests with credentials (i.e. cookies)
+    # See http://www.html5rocks.com/en/tutorials/cors/
+    $.ajaxPrefilter (settings, origSettings, xhr) ->
+        settings.crossDomain = true
+        xhr.withCredentials = true


Fix ajax pre-filter to define the xhrFields for CORS support

This is the official (per the jQuery docs) and correct way to ensure cookies
are sent with cross-domain requests.

--- src/coffee/cilantro/setup.coffee
+++ src/coffee/cilantro/setup.coffee
@@ -13,4 +13,5 @@
     # See http://www.html5rocks.com/en/tutorials/cors/
     $.ajaxPrefilter (settings, origSettings, xhr) ->
         settings.crossDomain = true
-        xhr.withCredentials = true
+        settings.xhrFields =
+            withCredentials: true


Add more console.logs to get down to the problem.

--- src/coffee/stockxmlimport.coffee
+++ src/coffee/stockxmlimport.coffee
@@ -8,7 +8,9 @@
     super(options)

   elasticio: (msg, cfg, cb, snapshot) ->
+    console.log 'elasticio'
     if msg.attachments
+      console.log 'elasticio - attachments'
       for attachment of msg.attachments
         continue if not attachment.match /xml$/i
         content = msg.attachments[attachment].content
@@ -16,13 +18,17 @@
         xmlString = new Buffer(content, 'base64').toString()
         @run xmlString, cb
     else if msg.body
+      console.log 'elasticio - body'
       # TODO: As we get only one entry here, we should query for the existing one and not
       # get the whole inventory
       @initMatcher().then () =>
+        console.log 'elasticio - initMatcher'
         @createOrUpdate([@createInventoryEntry(msg.body.SKU, msg.body.QUANTITY)], cb)
       .fail (msg) =>
+        console.log 'elasticio - initMatcher - fail'
         @returnResult false, msg, cb
     else
+      console.log 'elasticio - nothing'
       @returnResult false, 'No data found in elastic.io msg.', cb

   run: (xmlString, callback) ->
@@ -43,6 +49,7 @@
           @returnResult false, msg, callback

   mapStock: (xmljs, channelId) ->
+    console.log 'mapStock'
     stocks = []
     for k,row of xmljs.row
       sku = xmlHelpers.xmlVal row, 'code'
@@ -51,6 +58,7 @@
       if expectedQuantity
         d = @createInventoryEntry(sku, expectedQuantity, xmlHelpers.xmlVal(row, 'deliverydate'), channelId)
         stocks.push d
+    console.log 'mapStock: %j', stocks
     stocks

 module.exports = StockXmlImport


it works with AES too

it works with AES too

--- src/openpgp/ocfb.iced
+++ src/openpgp/ocfb.iced
@@ -44,6 +44,8 @@

 {WordArray} = require 'triplesec'
 {SlicerBuffer} = require './buffer'
+triplesec = require 'triplesec'
+{AES} = triplesec.ciphers

 #===============================================================================

@@ -246,8 +248,11 @@

   constructor : ->
     @blockSize = 16
+    key = WordArray.from_buffer(new Buffer [0...32])
+    @aes = new AES key

   encryptBlock : (words) ->
+    @aes.encryptBlock words, 0
     #for w, i in words
     #  words[i] = w ^ 0x11223344
     #t = words[0]


Modified in browser at pixie.strd6.com

Modified in browser at pixie.strd6.com

--- src/oscillator.coffee
+++ src/oscillator.coffee
@@ -5,6 +5,7 @@
 @constructor
 @param {Number} amplitude How much to scale the oscillator function value
 @param {Number} period How fast the osciallator function repeats
+@param {Number}
 ###
 Oscillator = (options={}) ->
   {amplitude, period, offset} = options