Fixed typo.

Fixed typo.

--- app/assets/javascripts/app/controllers/ticket_zoom.coffee
+++ app/assets/javascripts/app/controllers/ticket_zoom.coffee
@@ -109,7 +109,7 @@

         # if ticket is already loaded, ignore status "0" - network issues e. g. temp. not connection
         if @ticketUpdatedAtLastCall && status is 0
-          console.log('network issues e. g. temp. not connection', status, statusText, detail)
+          console.log('network issues e. g. temp. no connection', status, statusText, detail)
           return

         # show error message


Extended the change in commit 779c8f5253aabe6cff88e36e9c2a410ffb30b92e to all uses of the $filter angularjs service.

There were still some places in which  the $filter service was being used in such a way that it actually checked for substring matching instead of id equality to find an object in a list. This meant that in some cases the wrong object was "found" and returned, as explained in the above commit.

This should fix some hard-to-trace errors.

--- app/assets/javascripts/ng-services/ng-FindSvc.js.coffee
+++ app/assets/javascripts/ng-services/ng-FindSvc.js.coffee
@@ -9,7 +9,8 @@
   # Find a feed given its id
   #---------------------------------------------
   find_feed: (id)->
-    feeds = $filter('filter') $rootScope.feeds, {id: id}
+    feeds = $filter('filter') $rootScope.feeds, (feed)->
+      return feed.id == id
     return feeds[0]

   #---------------------------------------------
@@ -21,7 +22,8 @@
     else if id == "all"
       return {id: "all"}
     else
-      folders = $filter('filter') $rootScope.folders, {id: id}
+      folders = $filter('filter') $rootScope.folders, (folder)->
+        return folder.id == id
       return folders[0]

   #---------------------------------------------


PivotChart: Rotate and limit x labels count, fix padding

--- app/assets/javascripts/notebook/magic/pivotChart.coffee
+++ app/assets/javascripts/notebook/magic/pivotChart.coffee
@@ -51,13 +51,26 @@
         save_pivot_state(extract_pivot_state(options))

       rendererOptions = {
-                          c3: {
-                            size: {
-                              height: h,
-                              width: $(container).width()
-                            }
-                          }
-                        }
+        c3: {
+          size: {
+            height: h,
+            width: $(container).width()
+          },
+          padding: {
+            # make sure x labels fit
+            right: 50
+          },
+          axis: {
+            x: {
+              tick: {
+                culling: { max: 25 },
+                rotate: 75,
+                multiline: false
+              }
+            }
+          }
+        }
+      }
       window.c3 = c3

       pivotOptions = get_saved_pivot_state()


Added Product.isAvailable()

Added Product.isAvailable()

--- app/assets/javascripts/sprangular/models/product.coffee
+++ app/assets/javascripts/sprangular/models/product.coffee
@@ -56,3 +56,9 @@

   findVariant: (variant_id) ->
     _.find @variants, (variant) -> variant.id == variant_id
+
+  isAvailable: ->
+    if @master
+      @master.isAvailable()
+    else
+      _.any @variants, (variant) -> variant.isAvailable()


Improve the Recipe page relationships

Improve the Recipe page relationships

--- model/Recipe/Bitly/BitlyExportGoogleSpreadsheet.coffee
+++ model/Recipe/Bitly/BitlyExportGoogleSpreadsheet.coffee
@@ -27,6 +27,7 @@
     ,
       $setOnInsert:
         cls: "BitlyExportGoogleSpreadsheet"
+        isAutorun: true
       $set:
         position: position++
     )


Bug introduced from wrong branch

Bug introduced from wrong branch

--- packages/shrub-user/index.coffee
+++ packages/shrub-user/index.coffee
@@ -98,9 +98,6 @@
 			delete self.salt
 			delete self.passwordHash
 			delete self.resetPasswordToken
-
-			self.permissions.push.apply self.permissions, self._permissions
-			delete self._permissions

 			Promise.resolve().then ->
 				return unless self.email?


Fixing day and month validation

Fixing day and month validation

--- app/assets/javascripts/frontend/form-validation.js.coffee
+++ app/assets/javascripts/frontend/form-validation.js.coffee
@@ -429,7 +429,7 @@

     questionDay = parseInt(question.find(".innovation-day").val())
     questionMonth = parseInt(question.find(".innovation-month").val())
-    questionDate = "#{questionDay}/#{questionMonth}"
+    questionDate = "#{questionDay}/#{questionMonth}/#{moment().format('Y')}"

     if not @toDate(questionDate).isValid()
       @logThis(question, "validateMaxDate", "Not a valid date")


Rails 4.1.6 is not identifying the token as used to before

See rails/rails#17108 and rails/rails#15683

--- app/assets/javascripts/initializers/authentication.coffee
+++ app/assets/javascripts/initializers/authentication.coffee
@@ -28,7 +28,7 @@
   authorize: (jqXHR, requestOptions) ->
     accessToken = @get('session.access_token')
     if @get('session.isAuthenticated') and not Ember.isEmpty(accessToken)
-      jqXHR.setRequestHeader 'Authorization', 'Token ' + accessToken
+      jqXHR.setRequestHeader 'Authorization', 'Token token=' + accessToken

 Ember.Application.initializer
   name: 'authentication'


Added "AsyncCollector" class

Added "AsyncCollector" class

--- index.coffee
+++ index.coffee
@@ -305,5 +305,31 @@
 @asyncForOf = asyncForOf

-
-
+###
+  @class AsyncCollector
+  @purpose Asynchronous counter and data collector
+###
+
+class AsyncCollector
+
+  constructor: (@totalToCollect)->
+    @count = 0
+    @collection = {}
+
+  collect: (key = null, value = null)->
+    unless @totalToCollect is @count
+      if key
+        @collection[key] = value
+      @count += 1
+
+    if @totalToCollect is @count
+      _setImmediate @finallyFn, @collection if @finallyFn
+      @finallyFn = null
+
+  finally: (@finallyFn)->
+    return @
+
+@AsyncCollector = AsyncCollector
+
+
+


Removing redundant comment

Removing redundant comment

--- index.coffee
+++ index.coffee
@@ -78,8 +78,7 @@
 	inserted: (el, binding) -> addListeners el, binding

 	# If the value changed, re-init scrollbar since scrollMonitor doesn't provide
-	# an API to update the offsets.  Doing JSON.stringify to compare as a quick
-	# way to deep compare objects
+	# an API to update the offsets.
 	componentUpdated: (el, binding) ->
 		return if objIsSame binding.value, binding.oldValue
 		removeListeners el


Minor cleanup

Minor cleanup

--- index.coffee
+++ index.coffee
@@ -129,14 +129,11 @@

   # the game view element itself
   game = plugins.get('voxel-engine')
-  container = document.body
   window.game = window.g = game # for debugging
-  game.appendTo container
+  game.appendTo document.body
   return game if game.notCapable()

-
   avatar = plugins.get('voxel-player')
-  avatar.pov('first');
   avatar.possess()
   home(avatar)

@@ -145,22 +142,10 @@
   game.materials.load registry.getBlockPropsAll 'texture'
   global.InventoryWindow_defaultGetTexture = (itemPile) => registry.getItemPileTexture(itemPile) # TODO: cleanup

-  #playerInventory = game.plugins.get('voxel-carry').inventory
-  #playerInventory.give new ItemPile('pickaxeDiamond', 1)
-  #playerInventory.give new ItemPile('stick', 32)
-  #playerInventory.give new ItemPile('logOak', 10)
-  #playerInventory.give new ItemPile('plankOak', 10)
-  #playerInventory.give new ItemPile('logBirch', 5)
-  #playerInventory.give new ItemPile('workbench', 1)
-  #playerInventory.give new ItemPile('chest', 5)
-
   game.buttons.down.on 'pov', () -> avatar.toggle() # TODO: disable/re-enable voxel-walk in 1st/3rd person?
   game.buttons.down.on 'vr', () -> plugins.toggle 'voxel-oculus'
   game.buttons.down.on 'home', () -> home(avatar)
-  game.buttons.down.on 'inventory', () -> plugins.get('voxel-inventory-dialog')?.toggle()
-
-  # show origin
-  plugins.get('voxel-debug').axis [0, 0, 0], 10
+  game.buttons.down.on 'inventory', () -> plugins.get('voxel-inventory-dialog')?.show()

   return game


Move thesaurus additions for wood/leaves to voxel-land

Requires deathcap/voxel-land@97f409061210f7115986c2abe9a0a1ec66975b9a

--- index.coffee
+++ index.coffee
@@ -162,11 +162,6 @@

   # recipes
   recipes = plugins.get('craftingrecipes')
-  recipes.thesaurus.registerName 'wood.log', new ItemPile('logOak')
-  recipes.thesaurus.registerName 'wood.log', new ItemPile('logBirch')
-  recipes.thesaurus.registerName 'wood.plank', new ItemPile('plankOak')
-  recipes.thesaurus.registerName 'tree.leaves', new ItemPile('leavesOak')
-
   recipes.register new AmorphousRecipe(['wood.log'], new ItemPile('plankOak', 2))
   recipes.register new AmorphousRecipe(['wood.plank', 'wood.plank'], new ItemPile('stick', 4))


:art:

:art:

--- index.coffee
+++ index.coffee
@@ -67,13 +67,13 @@
       '-NoDefaultExcludes'
     ]

-    syncReleases = (cb) -> cb()
-
-    if remoteReleases?
-      syncReleases = (cb) ->
+    syncReleases = (cb) ->
+      if remoteReleases?
         cmd = path.resolve(__dirname, '..', 'vendor', 'SyncReleases.exe')
         args = ['-u', remoteReleases, '-r', outputDirectory]
         exec {cmd, args}, cb
+      else
+        process.nextTick -> cb()

     exec {cmd, args}, (error) ->
       return done(error) if error?


[feature] 'all' cli parameter for checking all locations

--- index.coffee
+++ index.coffee
@@ -74,14 +74,18 @@
   new IkeaProduct '40212444', 'KROKTORP Tür 40x80 elfenbeinweiss'
   new IkeaProduct '90205912', 'KROKTORP Schubladenfront 60x20 elfenbeinweiss'
   new IkeaProduct '60205918', 'KROKTORP Schubladenfront 60x40 elfenbeinweiss'
+  new IkeaProduct 'S19902924', 'BRIMNES Bettgestell weiss'
 ]

-locationsWhichShouldGetChecked = [
-  new IkeaLocation '324', 'Berlin-Lichtenberg'
-  new IkeaLocation '394', 'Berlin-Spandau'
-  new IkeaLocation '421', 'Berlin-Tempelhof'
-  new IkeaLocation '129', 'Berlin-Waltersdorf'
-]
+if process.argv[2]? and process.argv[2] is 'all'
+  locationsWhichShouldGetChecked = locations
+else
+  locationsWhichShouldGetChecked = [
+    new IkeaLocation '324', 'Berlin-Lichtenberg'
+    new IkeaLocation '394', 'Berlin-Spandau'
+    new IkeaLocation '421', 'Berlin-Tempelhof'
+    new IkeaLocation '129', 'Berlin-Waltersdorf'
+  ]

 for product in products


bump log level to 0, lol

bump log level to 0, lol

--- index.coffee
+++ index.coffee
@@ -32,7 +32,7 @@
 				port: configs.port
 				before: prepareAPIRequest
 				fallback: apiFallback
-				logLevel: 5
+				logLevel: 0

 			oldRespond = v0.responses.respond
 			v0.responses.respond = (res, message, statusCode) ->


Use relative path for textures

Use relative path for textures

--- index.coffee
+++ index.coffee
@@ -29,7 +29,7 @@
       'leaves_oak_opaque',
       'glass',
       ]
-    texturePath: '/ProgrammerArt/textures/blocks/' # subproject with textures
+    texturePath: 'ProgrammerArt/textures/blocks/' # subproject with textures
     worldOrigin: [0, 0, 0],
     controls:
       discreteFire: false


将 flush 和 client 对象暴露出来

将 flush 和 client 对象暴露出来

--- index.coffee
+++ index.coffee
@@ -86,6 +86,8 @@
   cache.get = get
   cache.set = set
   cache.del = del
+  cache.flush = flush
+  cache.client = client

 cache.get = cache.set = cache.del =  ->
   throw Error 'cache must be init, at use before'


Troubleshoot: Old monitor_status file is removed

--- client/Main/monitor_status.coffee
+++ client/Main/monitor_status.coffee
@@ -1,211 +0,0 @@
-class Ping extends KDObject
-  [NOTSTARTED, WAITING, SUCCESS, FAILED] = [1..4]
-
-  constructor: (item, name, options={}) ->
-    super options
-
-    @item = item
-    @name = name
-    @identifier = options.identifier or Date.now()
-    @status = NOTSTARTED
-
-  run: ->
-    @status = WAITING
-    @startTime = Date.now()
-    @setPingTimeout()
-    @item.ping(@finish.bind(this))
-
-  setPingTimeout: ->
-    @pingTimeout = setTimeout =>
-      @status = FAILED
-      @emit "failed", @item, @name
-    , 5000
-
-  finish: ->
-    @status = SUCCESS
-    @finishTime = Date.now()
-    clearTimeout @pingTimeout
-    @pingTimeout = null
-    @emit "finish", @item, @name
-
-  getResponseTime: ->
-    status = switch @status
-      when NOTSTARTED
-        "not started"
-      when FAILED
-        "failed"
-      when SUCCESS
-        @finishTime - @startTime
-      when "WAITING"
-        "waiting"
-
-    return status
-
-class MonitorItems extends KDObject
-  constructor: (options={}) ->
-    super @options
-    @items = {}
-    @registerSingleton "monitorItems", this
-
-  register: (items) ->
-    for own name, item of items
-      @items[name] = item
-
-  getItems: ->
-    @items
-
-class MonitorStatus extends KDObject
-  constructor: (items, options={}) ->
-    super @options
-
-    @itemsToMonitor = {}
-    @reset()
-
-    @copyItemsToMonitor(items)
-    @setupListerners()
-
-  copyItemsToMonitor: (items) ->
-    for own name, item of items
-      @itemsToMonitor[name] = new Ping item, name
-
-  setupListerners: ->
-    @on "pingFailed", (item, name) ->
-      @failedPings.push name
-      @emit "pingDone", item, name
-
-    @on "pingDone", (item, name) ->
-      @finishedPings.push name
-      if _.size(@finishedPings) == _.size(@itemsToMonitor)
-        @emit "allDone"
-
-    @on "allDone", ->
-      #@emitStatus()
-      @reset()
-
-    @on "internetDown", ->
-      status = KD.getSingleton "status"
-      status.internetDown()
-
-  notify: (reason) ->
-    notifications =
-      internetUp   : "All systems go!"
-      internetDown : "Your internet is down."
-      brokerDown   : "Broker is down."
-      kitesDown    : "Kites are down."
-      bongoDown    : "Bongo is down."
-      undefined    : "Sorry, something went wrong."
-
-    msg = notifications[reason] or notifications["undefined"]
-
-    notification = new KDNotificationView
-      title     : "#{msg}"
-      type      : "tray"
-      cssClass  : "mini realtime"
-      duration  : 3303
-      click     : noop
-
-  reset: ->
-    @finishedPings = []
-    @failedPings = []
-
-  emitStatus: ->
-    if @failedPings.length is 0
-      @internetUp()
-      @notify "internetUp"
-    else
-      @deductReasonForFailure()
-
-  deductReasonForFailure: ->
-    reasons = {}
-    reasons.internetDown      = ["bongo", "broker", "external"]
-    reasons.brokerDown        = ["broker"]
-    reasons.kitesDown         = ["os"]
-    reasons.bongoDown         = ["bongo"]
-
-    for own reason, items of reasons
-      intersection = _.intersection items, @failedPings
-      if intersection.length is items.length
-        @emit reason, _.first(@failedPings)
-        @notify reason
-        log reason
-        return reason
-
-  internetUp: ->
-    log  "all's well on western front"
-    @emit 'internetUp'
-
-  run: (callback)->
-    @on "allDone", ->
-      times = {}
-      for own name, item of @itemsToMonitor
-        times[name] = item.getResponseTime()
-
-      callback times
-
-    for own name, item of @itemsToMonitor
-      item.once "finish", (i, n) =>
-        @emit "pingDone", i, n
-      item.once "failed", (i, n) =>
-        @emit "pingFailed", i, n
-      item.run()
-
-class ExternalPing extends KDObject
-  constructor: (@url) -> super
-
-  ping: (callback) ->
-    @callback = callback
-    KD.externalPong = @pong.bind(this)
-    $.ajax
-      url : @url+"?callback"+KD.externalPong
-      timeout: 5000
-      dataType: "jsonp"
-      error : ->
-
-  pong: -> @callback()
-
-do ->
-  url = "https://s3.amazonaws.com/koding-ping/ping.json"
-  external = new ExternalPing url
-
-  monitorItems = new MonitorItems
-  monitorItems.register {external}
-
-  window.jsonp =-> KD.externalPong()
-
-  KD.troubleshoot = (callback)->
-    monitorItems = KD.getSingleton("monitorItems").items
-
-    if monitorItems.length == 1
-      log "no services connected; possible auth/social worker down"
-      return
-
-    monitor = new MonitorStatus monitorItems
-    monitor.run callback
-
-class BrokerPing extends Pinger
-  constructor: (options, data) ->
-    super options, data
-
-    @init()
-
-  init:->
-    @channel = KD.remote.mq
-    @remote  = KD.remote
-
-    @channel.on 'messageArrived'   , @bound 'handleMessageArrived'
-    @channel.on 'messagePublished' , @bound 'handleChannelPublish'
-
-    @remote.on 'disconnected'      , @bound 'reset'
-    @remote.on 'disconnected'      , @bound 'setStopPinging'
-    @remote.on 'connected'         , @bound 'setStartPinging'
-    @remote.on 'connected'         , @bound 'ping'
-
-  handleUnresponsiveChannel: ->
-    log "broker unresponsive since #{@lastPong}"
-
-  ping: (callback)->
-    return if @stopPinging
-    @channel.ping callback
-
-brokerPing = new BrokerPing
-window.brokerPing = brokerPing


Remove unused modal

Remove unused modal

--- client/lanes/workspace/Modal.cjsx
+++ client/lanes/workspace/Modal.cjsx
@@ -1,47 +0,0 @@
-# This is the "real" dialog component. It's rendered to a div under document.body
-class Lanes.Workspace.Dialog extends Lanes.React.Component
-
-    propTypes:
-        title:     React.PropTypes.string.isRequired
-        onOk:      React.PropTypes.func.isRequired
-        onCancel:  React.PropTypes.func.isRequired
-        body:      React.PropTypes.element.isRequired
-        show:      React.PropTypes.bool
-        buttons:   React.PropTypes.object
-        className: React.PropTypes.string
-
-    getDefaultProps: ->
-        buttons: {'Cancel': 'default', 'OK': 'primary'}
-
-    getInitialState: ->
-        show: true
-
-    componentWillReceiveProps: (nextProps) ->
-        @setState(show: nextProps.show) if nextProps.show?
-
-    _hide: ->
-        @setState(show: false)
-
-    hide: ->
-        @_hide()
-        @props.onCancel()
-
-    render: ->
-        return null unless @state.show
-
-        buttons = for name, style of @props.buttons
-            <BS.Button key={name} className={name}
-              onClick={_.partial(@props.onButton, name)}>{name}</BS.Button>
-
-        classes = _.classnames('layout-dialog', @props.className)
-
-        <BS.Modal.Dialog className={classes}>
-            <BS.Modal.Header>
-                <BS.Modal.Title>{@props.title}</BS.Modal.Title>
-            </BS.Modal.Header>
-
-            <BS.Modal.Body>{@props.body}</BS.Modal.Body>
-
-            <BS.Modal.Footer>{@buttons}</BS.Modal.Footer>
-
-        </BS.Modal.Dialog>


Fix tooltips on room_list view.

Fix tooltips on room_list view.

--- client/room_list/room_list.coffee
+++ client/room_list/room_list.coffee
@@ -12,7 +12,7 @@
     span.width 'initial'
     if span.width() > title.width()
       span.width '100%'
-  $('[data-toggle="tooltip"]').tooltip()
+  @$('[data-toggle="tooltip"]').tooltip()

 Template.room_summary.helpers
   zoom: ->
@@ -23,7 +23,7 @@
         span.width 'initial'
         if span.width() > title.width()
           span.width '100%'
-      $('[data-toggle="tooltip"]').tooltip()
+      @$('[data-toggle="tooltip"]').tooltip()
     , .1
     Session.get 'zoom'


Fix isIndividuValidTest

Fix isIndividuValidTest

--- test/openfisca/mapping/individu-helpers.coffee
+++ test/openfisca/mapping/individu-helpers.coffee
@@ -1,5 +1,5 @@
-individuHelpers = require '../../../lib/simulation/openfisca/mapping/index'
-
+individuHelpers = require '../../../lib/simulation/openfisca/mapping/common'
+should = require 'should'

 describe 'isIndividuValid', ->
   SITUATION =
@@ -12,27 +12,33 @@
       dateDeNaissance: new Date '1940-01'

     it 'should be valid', ->
-      individuHelpers.isIndividuValid(SITUATION, target).should.be.true
+      individuHelpers.isIndividuValid(target, SITUATION).should.be.ok

   describe 'a child', ->
     target =
       role: 'enfant'
-      situationsPro: []

     describe 'under 25', ->
-      dateDeNaissance: new Date '2010-01'
+      before ->
+          target['situationsPro'] = []
+          target['dateDeNaissance'] = new Date '2010-01'

       it 'should be valid', ->
-        individuHelpers.isIndividuValid(SITUATION, target).should.be.true
+        individuHelpers.isIndividuValid(target, SITUATION).should.be.ok

     describe 'over 25', ->
-      dateDeNaissance: new Date '1970-01'
+      before ->
+        target['situationsPro'] = []
+        target['dateDeNaissance'] = new Date '1970-01'

       it 'should not be valid', ->
-        individuHelpers.isIndividuValid(SITUATION, target).should.be.false
+        should(individuHelpers.isIndividuValid(target, SITUATION)).not.be.ok

       describe 'disabled', ->
-        target.situationsPro.push { situation: 'handicap' }
+        before ->
+          target['situationsPro'] = []
+          target['dateDeNaissance'] = new Date '1970-01'
+          target.situationsPro.push { situation: 'handicap' }

         it 'should be valid', ->
-          individuHelpers.isIndividuValid(SITUATION, target).should.be.true
+          individuHelpers.isIndividuValid(target, SITUATION).should.be.ok


Fix reference to pandas_pivot_template

Fix reference to pandas_pivot_template

--- bokehjs/src/coffee/widget/pandas/pandas_pivot_table.coffee
+++ bokehjs/src/coffee/widget/pandas/pandas_pivot_table.coffee
@@ -3,8 +3,8 @@
   "underscore",
   "backbone",
   "common/has_parent",
-  "common/continuum_view"
-  "vendor/text/text!../../../template/pandaspivot.eco"
+  "common/continuum_view",
+  "./pandas_pivot_template"
 ], (_, Backbone, HasParent, ContinuumView, pandaspivot) ->

   ENTER = 13


fix wording on remove-user prompt; fixes #9758

test plan:
 * attempt to remove a user from a course
 * you should get an "Are you sure...?" type prompt, not
   "Remove User from Course"

Change-Id: Id49438985533d3566ac9df06d5ffdb38243b9e96
Reviewed-on: https://gerrit.instructure.com/12748
Tested-by: Jenkins <d95b56ce41a2e1ac4cecdd398defd7414407cc08@instructure.com>
Reviewed-by: Joe Tanner <16a9a54ddf4259952e3c118c763138e83693d7fd@instructure.com>

--- app/coffeescripts/views/course_settings/UserView.coffee
+++ app/coffeescripts/views/course_settings/UserView.coffee
@@ -98,7 +98,7 @@
       linkToStudentsDialog.render().show()

     removeFromCourse: (e) ->
-      return unless confirm I18n.t('links.unenroll_user_course', 'Remove User from Course')
+      return unless confirm I18n.t('delete_confirm', 'Are you sure you want to remove this user?')
       @$el.hide()
       success = =>
         for e in @model.get('enrollments')


Add test to confirm a recompilation bug

Add test to confirm a recompilation bug

--- test/unit/specs/Runtime-functional-spec.coffee
+++ test/unit/specs/Runtime-functional-spec.coffee
@@ -33,6 +33,15 @@
 	text: 'mutates the current path, after the current index'
 	code: '6077*p5.@'
 	outRecord: [1]
+}, {
+	text: 'mutates the current path twice, after the current index'
+	code: '''
+			>2377*pv
+			v      <
+			>2396*pv
+			@.9 _1 <
+		'''
+	outRecord: [6]
 }, {
 	text: 'mutates a conditional'
 	code: '''


delete game with all old versions works

delete game with all old versions works

--- client/src/app/model/games.coffee
+++ client/src/app/model/games.coffee
@@ -57,6 +57,16 @@

   deleteCurrent: ->
     $http.delete("/api/games/#{currentGame.version.gameId}").then(currentGame.reset)
+    test = $http.get("/api/game-versions")
+    testFunc = (testResult) ->
+      console.log(testResult)
+      console.log(testResult[0].data)
+      for food in [0 ... testResult[0].data.length]
+        if testResult[0].data[food].gameId == currentGame.version.gameId
+          #console.log testResult[0].data[food].id
+          $http.delete("/api/game-versions/#{testResult[0].data[food].id}").then(currentGame.reset)
+
+    $q.all([test]).then(testFunc, -> alert("nop men"))

   loadAll: ->
     gamesQuery = $http.get('/api/games')


field_with_errors fix

field_with_errors fix

--- app/assets/javascripts/hancock/feedback/form.coffee
+++ app/assets/javascripts/hancock/feedback/form.coffee
@@ -39,9 +39,10 @@

   $(document).delegate form_selector + " .input", 'click', (e) ->
-    e.preventDefault()
     $(e.currentTarget).removeClass("field_with_errors").find('.error').hide()
-    return false
+    # e.preventDefault()
+    # $(e.currentTarget).removeClass("field_with_errors").find('.error').hide()
+    # return false


Fix overlay positioning when scrolled down

--- app/assets/javascripts/overlay_dimensions.js.coffee
+++ app/assets/javascripts/overlay_dimensions.js.coffee
@@ -20,7 +20,7 @@
     @minMargin

   top: ->
-    ($(window).height() - @height()) / 2
+    window.scrollY + ($(window).height() - @height()) / 2

   closeButtonLeftPosition: ->
     @width() - @closeButtonOffset


Fix issue tg-4648: Epics display show only first 30 related user stories

--- app/modules/resources/userstories-resource.service.coffee
+++ app/modules/resources/userstories-resource.service.coffee
@@ -45,6 +45,7 @@
         params = {
             project: projectId
         }
+
         return http.get(url, params, httpOptions)
             .then (result) ->
                 return Immutable.fromJS(result.data)
@@ -52,13 +53,19 @@
     service.listInEpic = (epicIid) ->
         url = urlsService.resolve("userstories")

-        params = {
-            'epic': epicIid,
-            'order_by': 'epic_order',
-            'include_tasks': true
+        httpOptions = {
+            headers: {
+                "x-disable-pagination": "1"
+            }
         }

-        return http.get(url, params)
+        params = {
+            epic: epicIid,
+            order_by: 'epic_order',
+            include_tasks: true
+        }
+
+        return http.get(url, params, httpOptions)
             .then (result) ->
                 return Immutable.fromJS(result.data)


Add a www to tools js domain environments

All of this urls are redirecting to the homepage:

https://preview.dev.mas.local/en/tools/debt-advice-locator
https://uat.dev.mas.local/en/tools/debt-advice-locator
https://qa.dev.mas.local/en/tools/debt-advice-locator

Adding a www makes the tools js works without the redirect problem.

--- app/assets/javascripts/syndication/widget.js.coffee
+++ app/assets/javascripts/syndication/widget.js.coffee
@@ -15,11 +15,11 @@

   setPartnerToolsURL: ->
     domains = {
-      'preview.dev.mas.local': 'https://preview-partner-tools.dev.mas.local/',
-      'qa.dev.mas.local': 'https://qa-partner-tools.dev.mas.local/',
-      'uat.dev.mas.local': 'https://uat-partner-tools.dev.mas.local/',
-      'cultivate.dev.mas.local': 'https://cultivate-partner-tools.dev.mas.local/',
-      'staging.dev.mas.local': 'https://staging-partner-tools.dev.mas.local/'
+      'www.preview.dev.mas.local': 'https://preview-partner-tools.dev.mas.local/',
+      'www.qa.dev.mas.local': 'https://qa-partner-tools.dev.mas.local/',
+      'www.uat.dev.mas.local': 'https://uat-partner-tools.dev.mas.local/',
+      'www.cultivate.dev.mas.local': 'https://cultivate-partner-tools.dev.mas.local/',
+      'www.staging.dev.mas.local': 'https://staging-partner-tools.dev.mas.local/'
     }
     toolLink = document.getElementsByClassName(masConfig.targetSelector)[0].getAttribute('href')
     hostname = new URL(toolLink).hostname


remove ajax call on home

remove ajax call on home

--- app/assets/javascripts/views/welcome/home.js.coffee
+++ app/assets/javascripts/views/welcome/home.js.coffee
@@ -3,7 +3,7 @@
     @setElement($('#body'))
     @moveBike()
     # @manufacturerCall()
-    @createBike()
+    # @createBike()

   moveBike: ->
     register = $('#treating-right .treating-right-text')


Change settings

Change settings

--- app/assets/javascripts/wice_grid/settings.js.coffee
+++ app/assets/javascripts/wice_grid/settings.js.coffee
@@ -5,7 +5,7 @@
     $('.wice-grid-container').each (index, domElement) ->
       E.wice_grid_settings.addColumnsToToolbar(domElement)

-  $('.wice-grid-toolbar .dropdown-columns-menu').on 'show', ->
+  $(document).on 'focus', '.wice-grid-toolbar .dropdown-columns-menu', ->
     E.wice_grid_settings.setToolbarUp($(this))

   $(document).on 'click', '.wice-grid-toolbar .wice-grid-columns-selector', ->


Test flaw removal

Test flaw removal

--- src/RobustaTest/Test.coffee
+++ src/RobustaTest/Test.coffee
@@ -45,14 +45,15 @@

 class TestExecutionContext
-  failures: []
+  constructor: ->
+    @failures = []
+    @assertions = 0
+    @openAsyncCalls = 0

-  assertions: 0
   assert: (condition, msg) ->
     @assertions++
     if not condition then @failures.push msg

-  openAsyncCalls: 0
   allAsyncCallsClosedCallback: ->
   assertAsync:
     Function.composable (predicate, action, partialMessage, timeout = 100) ->


Fixed error

Fixed error

Only remove from list, make no requests

--- app/backbone/views/groups/react_group_button.coffee
+++ app/backbone/views/groups/react_group_button.coffee
@@ -8,7 +8,7 @@
   _addToGroup: ->
     group = @props.users_groups.create @props.group.attributes,
       error: =>
-       group.destroy()
+       @props.users_groups.remove group
        Factlink.notificationCenter.error 'User could not be added to group, please try again.'


Open the project root of the current active file if available.

--- index.coffee
+++ index.coffee
@@ -9,9 +9,22 @@
  * http://opensource.org/licenses/MIT
 ###

+getActiveFilePath = () ->
+  atom.workspace.getActivePaneItem()?.buffer?.file?.path
+
+getRootDir = () ->
+  dirs = atom.project.getDirectories()
+  defaultPath = dirs[0]?.path
+  return defaultPath if dirs.length < 2
+  activeFilePath = getActiveFilePath()
+  return defaultPath if not activeFilePath
+  for dir in dirs
+    return dir.path if activeFilePath.indexOf(dir.path + '/') is 0
+  defaultPath
+
 open = (filepath) ->
   if not filepath
-    dirpath = atom.project.getDirectories()[0]?.path
+    dirpath = getRootDir()
   else if require('fs').lstatSync(filepath).isFile()
     dirpath = require('path').dirname(filepath)
   else
@@ -40,8 +53,7 @@
     atom.commands.add '.tree-view .selected, atom-text-editor, atom-workspace',
       'open-terminal-here:open': (event) ->
         event.stopImmediatePropagation()
-        open @getPath?() || @getModel?().getPath?() ||
-          atom.workspace.getActivePaneItem()?.buffer?.file?.path
+        open @getPath?() || @getModel?().getPath?() || getActiveFilePath()
     atom.commands.add 'atom-workspace',
       'open-terminal-here:open-root': (event) ->
         event.stopImmediatePropagation()


Modified in browser at pixie.strd6.com

Modified in browser at pixie.strd6.com

--- test/engine_selector.coffee
+++ test/engine_selector.coffee
@@ -21,6 +21,8 @@
   indexSum = 0

   engine.each (obj, index) ->
+    index
+
     if index is 0
       equals obj, obj1
     else if index is 1


Heroku please

Heroku please

--- index.coffee
+++ index.coffee
@@ -1,5 +1,6 @@
+compression = require "compression"
 express = require "express"
-compression = require "compression"
+path = require "path"

 # Create app
 app = express()
@@ -8,7 +9,7 @@
 app.use compression()

 # Static assets
-app.use "/static", express.static __dirname + "/public"
+app.use "/static", express.static path.join(process.env.PWD, "/public")

 # Catch all
 app.get "/*", (req, res) -> res.sendFile __dirname + "/public/index.html"


Modified in browser at pixie.strd6.com

Modified in browser at pixie.strd6.com

--- test/engine_selector.coffee
+++ test/engine_selector.coffee
@@ -9,13 +9,13 @@

   enemy1 = engine.add
     enemy: true
-    x: 5
+    x: 0
     y: 10

   enemy2 = engine.add
     enemy: true
     x: 5
-    y: 10
+    y:

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


first success

first success

--- index.coffee
+++ index.coffee
@@ -154,7 +154,7 @@
 /*create a GateKeeper*/
 # /*create = (GateKeeperstxturl, user-agent) ->
 #  new GateKeeper*/
-#
+#

 r = new GateKeeperMaker('http://tupalo.com/robots.txt', "hiho").on('ready', (r) ->
   console.log r.whatsUp('/fr/s/washere/lazy_load_pics')


Slight change to error message

Slight change to error message

--- index.coffee
+++ index.coffee
@@ -54,7 +54,7 @@
     ?.then ({status, headers, data}) -> assign {}, {status, headers}, data
     ?.catch ({response}) ->
       {status, headers, data} = response
-      Promise.reject assign {}, {status, headers}, message: data
+      Promise.reject assign {}, {status, headers}, data

 fx.subscribe = (req, route, checkAccount = true) ->


Fix gulp-util require

Fix gulp-util require

--- index.coffee
+++ index.coffee
@@ -3,7 +3,7 @@
 PLUGIN_NAME = 'gulp-modify'

 through = require 'through2'
-gutil = require 'gutil'
+gutil = require 'gulp-util'

 module.exports = (options = {}) ->


no commit when no changes

no commit when no changes

--- index.coffee
+++ index.coffee
@@ -86,7 +86,7 @@
       return next()  unless config.git?.enable
       execFile '/bin/sh', ['-c', "git add -f #{filename}"], {cwd: config.tastesDir}, (err) ->
         return next err  if err?
-        execFile '/bin/sh', ['-c', "git commit -m 'updated #{filename}'"], {cwd: config.tastesDir}, (err) ->
+        execFile '/bin/sh', ['-c', "git diff-index --quiet HEAD || git commit -m 'updated #{filename}'"], {cwd: config.tastesDir}, (err) ->
           return next err  if err?
           return next()  unless config.git.remoteUrl?
           execFile '/bin/sh', ['-c', "git push -f origin HEAD:#{config.git.upstream}"], {cwd: config.tastesDir}, next


Removed now-unnecessary comment from index.coffee

--- index.coffee
+++ index.coffee
@@ -73,7 +73,6 @@
 		.all '*', (req, res) ->
 			viewPath = require('path').resolve './web/backend.js'
 			require(viewPath)(req, res)
-			# res.sendFile(__base + paths.root.dest + 'index.html')
 		.listen Number(__port), ->
 			console.info 'Web Server running on port', __port


sidebar: fix wrong require

sidebar: fix wrong require

--- client/activity/lib/components/sidebarsection/index.coffee
+++ client/activity/lib/components/sidebarsection/index.coffee
@@ -1,5 +1,5 @@
 kd = require 'kd'
-React = require 'React'
+React = require 'kd-react'
 classnames = require 'classnames'


Newline at the end of file

Newline at the end of file

--- client/app/lib/providers/machinesettingsgeneralview.coffee
+++ client/app/lib/providers/machinesettingsgeneralview.coffee
@@ -182,4 +182,4 @@
           itemClass     : CustomLinkView
           title         : @machine.domain
           href          : accessUri
-          target        : '_blank'+          target        : '_blank'


foaas

foaas

--- scripts/foaas.coffee
+++ scripts/foaas.coffee
@@ -30,7 +30,7 @@
     if name
       endpoint = FOAAS + operations[Math.floor(Math.random() * operations.length)]
       endpoint = endpoint.replace(":name",name).replace(":from",from)
-      robot.http(endpoint).header("Accept", "text/plain").get() (err, res, body) ->
+      robot.http(endpoint).header("Accept", "text/plain").get() (err, httpRes, body) ->
         res.send body
     else
       res.send "I didn't understand that"


Fetch region just before calling the run

--- client/landing/app/MainApp/VirtualizationController.coffee
+++ client/landing/app/MainApp/VirtualizationController.coffee
@@ -21,9 +21,11 @@
     @fetchVmName options, (err, vmName) =>
       return callback err  if err?
       options.correlationName = vmName
-      @kc.run options, (rest...) ->
-        # log rest...
-        callback rest...
+      @fetchRegion vmName, (region)=>
+        options.kiteName = "os-#{region}"
+        @kc.run options, (rest...) ->
+          # log rest...
+          callback rest...

   _runWrapper:(command, vm, callback)->
     [callback, vm] = [vm, callback]  unless 'string' is typeof vm
@@ -108,6 +110,18 @@
         callback? err, vm, info
       , no

+  fetchRegion: (vmName, callback)->
+    if region = @vmRegions[vmName]
+      return @utils.defer -> callback region
+
+    KD.remote.api.JVM.fetchVmInfo vmName, (err, info)=>
+      if err
+        warn err
+        callback 'aws'
+      else
+        @vmRegions[vmName] = info.region
+        callback @vmRegions[vmName]
+
   fetchVmName: (options, callback) ->
     if options.vmName?
       @utils.defer -> callback null, options.vmName
@@ -220,6 +234,7 @@
     @groupVms = []
     @defaultVmName = null
     @vmDomains = {}
+    @vmRegions = {}

   fetchTotalVMCount:(callback)->
     KD.remote.api.JVM.count (err, count)->


Fix hubot.coffee

Fix hubot.coffee

--- scripts/hubot.coffee
+++ scripts/hubot.coffee
@@ -35,13 +35,13 @@
       res.end "NG"
       return

+    pkg = require Path.join __dirname, '..', 'package.json'
+
     unless robot.brain.data.hubot
       robot.brain.data.hubot = {
         lastVersion: pkg.version
       }
       return
-
-    pkg = require Path.join __dirname, '..', 'package.json'

     console.log "deployed: #{pkg.version}, current: #{robot.brain.data.hubot.lastVersion}"
     if Semver.gt pkg.version, robot.brain.data.hubot.lastVersion


remove some imports

remove some imports

--- app/app.coffee
+++ app/app.coffee
@@ -9,15 +9,13 @@
 GitHub = require './github'
 Context = require './context'

-module_names = ['http', 'dsl', 'graph', 'settings']
+module_names = ['http', 'dsl', 'graph', 'settings', 'input', 'notebook']

 imports = [
   'builtins'
   'graphite'
   'opentsdb'
   'github'
-  'input'
-  'notebook'
   'compat'
 ]


Register ports for all frames that open them

--- background_scripts/main.coffee
+++ background_scripts/main.coffee
@@ -303,6 +303,7 @@
     [tabId, frameId] = [sender.tab.id, sender.frameId]
     port.onDisconnect.addListener -> Frames.unregisterFrame {tabId, frameId}
     port.postMessage handler: "registerFrameId", chromeFrameId: frameId
+    (portsForTab[tabId] ?= {})[frameId] = port

     # Return our onMessage handler for this port.
     (request, port) =>
@@ -310,7 +311,6 @@

   registerFrame: ({tabId, frameId, port}) ->
     frameIdsForTab[tabId].push frameId unless frameId in frameIdsForTab[tabId] ?= []
-    (portsForTab[tabId] ?= {})[frameId] = port

   unregisterFrame: ({tabId, frameId}) ->
     # FrameId 0 is the top/main frame.  We never unregister that frame.  If the tab is closing, then we tidy
@@ -389,7 +389,7 @@

   prepareToActivateMode: (tabId, originatingFrameId, {modeIndex, isVimiumHelpDialog}) ->
     @tabState[tabId] = {frameIds: frameIdsForTab[tabId][..], hintDescriptors: {}, originatingFrameId, modeIndex}
-    @tabState[tabId].ports = extend {}, portsForTab[tabId]
+    @tabState[tabId].ports = [tabId].map (frameId) -> portsForTab[tabId][frameId]
     @sendMessage "getHintDescriptors", tabId, {modeIndex, isVimiumHelpDialog}

   # Receive hint descriptors from all frames and activate link-hints mode when we have them all.


Testpie formula testing

Testpie formula testing

--- widgets/testpie/testpie.coffee
+++ widgets/testpie/testpie.coffee
@@ -51,9 +51,11 @@
     sum=0
     for val in data
       sum += val.value
+    if !sum
+      sum = 1

     arcs.append("svg:text").attr("transform", (d, i) ->
-      procent_val = _.isNan(Math.round(data[i].value/sum * 100)) ? 0 : Math.round(data[i].value/sum * 100)
+      procent_val = Math.round(data[i].value/sum * 100)
       d.innerRadius = (radius * (100-procent_val)/100) - 45  #45=max text size/2
       d.outerRadius = radius
       "translate(" + arc.centroid(d) + ")")


progress

progress

--- test/legacy/scss/2.x.coffee
+++ test/legacy/scss/2.x.coffee
@@ -0,0 +1,43 @@
+describe 'scss', ->
+
+  before ->
+    @scss = accord.load('scss')
+    @path = path.join(__dirname, 'fixtures', 'scss')
+
+  it 'should expose name, extensions, output, and engine', ->
+    @scss.extensions.should.be.an.instanceOf(Array)
+    @scss.output.should.be.a('string')
+    @scss.engine.should.be.ok
+    @scss.name.should.be.ok
+
+  it 'should render a string', (done) ->
+    @scss.render("$wow: 'red'; foo { bar: $wow; }")
+      .done((res) => should.match_expected(@scss, res.result, path.join(@path, 'string.scss'), done))
+
+  it 'should render a file', (done) ->
+    lpath = path.join(@path, 'basic.scss')
+    @scss.renderFile(lpath, { trueDoge: true })
+      .done((res) => should.match_expected(@scss, res.result, lpath, done))
+
+  it 'should include external files', (done) ->
+    lpath = path.join(@path, 'external.scss')
+    @scss.renderFile(lpath, { includePaths: [@path] })
+      .done((res) => should.match_expected(@scss, res.result, lpath, done))
+
+  it 'should not be able to compile', (done) ->
+    @scss.compile()
+      .done(((r) -> should.not.exist(r); done()), ((r) -> should.exist(r); done()))
+
+  it 'should correctly handle errors', (done) ->
+    @scss.render("!@##%#$#^$")
+      .done(should.not.exist, (-> done()))
+
+  it 'should generate a sourcemap', (done) ->
+    lpath = path.join(@path, 'basic.scss')
+    @scss.renderFile(lpath, { sourcemap: true })
+      .tap (res) ->
+        res.sourcemap.version.should.equal(3)
+        res.sourcemap.mappings.length.should.be.above(1)
+        res.sourcemap.sources[0].should.equal(lpath)
+        res.sourcemap.sourcesContent.length.should.be.above(0)
+      .done((res) => should.match_expected(@scss, res.result, lpath, done))


Fix trivial spec codes

Fix trivial spec codes

--- test/lib/reader_spec.coffee
+++ test/lib/reader_spec.coffee
@@ -31,11 +31,12 @@
       reader.readImageAsDataURI()
       expect(reader.readString()).to.equal 'ゴブリンの洞窟'

-    it 'should return the empty string when the string length is 0', ->
-      buffer = new Buffer(4)
-      [0, 0, 0, 0].forEach (i, idx) -> buffer[idx] = i
-      reader = new Reader(buffer)
-      expect(reader.readString()).to.equal ''
+    context 'when the string length is 0', ->
+      it 'should return the empty string', ->
+        buffer = new Buffer(4)
+        [0, 0, 0, 0].forEach (i, idx) -> buffer[idx] = i
+        reader = new Reader(buffer)
+        expect(reader.readString()).to.equal ''

   describe '#readInt8', ->
     it 'should return the CHAR data', ->
@@ -62,11 +63,12 @@
       fixtureImageBuf = spec.readFixtureFile 'Summary.bmp'
       expect(imageBuf.equals(fixtureImageBuf)).to.be.true

-    it 'should return the null when image data length is 0', ->
-      buffer = new Buffer(4)
-      [0, 0, 0, 0].forEach (i, idx) -> buffer[idx] = i
-      reader = new Reader(buffer)
-      expect(reader.readImage()).to.be.null
+    context 'when the image data length is 0', ->
+      it 'should return the null', ->
+        buffer = new Buffer(4)
+        [0, 0, 0, 0].forEach (i, idx) -> buffer[idx] = i
+        reader = new Reader(buffer)
+        expect(reader.readImage()).to.be.null

   describe '#readImageAsDataURI', ->
     it 'should return the dataUri string of the image data', ->


add a sanity test for the 4-case

add a sanity test for the 4-case

--- test/lib/verify-test.coffee
+++ test/lib/verify-test.coffee
@@ -126,5 +126,30 @@
               - called with `()`.
           """

+      context '4 times, satisfied', ->
+        When -> @testDouble()
+        And -> @testDouble()
+        And -> @testDouble()
+        And -> @testDouble()
+        Then -> shouldNotThrow(=> @verify(@testDouble(), times: 4))
+
+      context '4 times, unsatisfied (with 3)', ->
+        When -> @testDouble()
+        And -> @testDouble()
+        And -> @testDouble()
+        Then -> shouldThrow (=> @verify(@testDouble(), times: 4)), """
+          Unsatisfied verification on test double.
+
+            Wanted:
+              - called with `()` 4 times.
+
+            But was actually called:
+              - called with `()`.
+              - called with `()`.
+              - called with `()`.
+          """

+
+
+


add normalized intensity (y-values) to lightcurve

--- app/lib/canvas-graph.coffee
+++ app/lib/canvas-graph.coffee
@@ -1,4 +1,4 @@
-$ = window.jQuery
+# $ = window.jQuery

 class CanvasGraph
   constructor: (@canvas, @data) ->
@@ -24,9 +24,11 @@
     @canvas.addEventListener 'mousedown', (e) => @addMarkToGraph(e)
     @canvas.addEventListener 'touchstart', (e) => @addMarkToGraph(e)

-  plotPoints: (xMin = @smallestX, xMax = @largestX) ->
+  plotPoints: (xMin = @smallestX, xMax = @largestX, yMin = @smallestY, yMax = @largestY) ->
     @xMin = xMin
     @xMax = xMax
+    @yMin = yMin
+    @yMax = yMax
     @clearCanvas()

     # plot points
@@ -60,6 +62,34 @@
     @ctx.textAlign = 'left'
     @ctx.fillStyle = textColor
     @ctx.fillText( 'DAYS', 10, @canvas.height - textSpacing )
+
+    # intensity values
+    # for i in [Math.round(yMin)...Math.round(yMax)]
+      # tick_y = Math.round ( (( +i - yMin) / (yMax - yMin)) * @canvas.height )
+
+    for i in [0...20]
+      continue unless i isnt 19
+      continue unless i isnt 0
+      tick_y = Math.round ( (( +i - 0) / (20 - 0)) * @canvas.height )
+      console.log '------------------------------------'
+      console.log 'i  : ', i
+      console.log 'tick_y: ', tick_y
+      console.log 'yMin  : ', yMin
+      console.log 'yMax  : ', yMax
+      console.log 'hei   : ', @canvas.height
+      console.log 'y     : ', @toDataYCoord(tick_y)
+      @ctx.beginPath()
+      @ctx.moveTo( 0, tick_y )
+      @ctx.lineTo( 0+tickMajorLength, tick_y )
+      @ctx.lineWidth = tickWidth
+      @ctx.strokeStyle = tickColor
+      @ctx.stroke()
+
+      # top numbers
+      @ctx.font = '10pt Arial'
+      @ctx.textAlign = 'center'
+      @ctx.fillStyle = textColor
+      @ctx.fillText( i, 0+tickMajorLength+textSpacing, tick_y+5 )

     for i in [0...@dataLength]
       if i % 1 is 0 and i isnt 0
@@ -81,7 +111,7 @@
         @ctx.stroke()

       if i % 2 is 0 and i isnt 0
-        tick_x = ((+i - xMin) / (xMax - xMin)) * @canvas.width
+        # tick_x = ((+i - xMin) / (xMax - xMin)) * @canvas.width

         # bottom lines
         @ctx.beginPath()
@@ -95,7 +125,7 @@
         @ctx.font = '10pt Arial'
         @ctx.textAlign = 'center'
         @ctx.fillStyle = textColor
-        @ctx.fillText( i, tick_x, @canvas.height - textSpacing )
+        @ctx.fillText( @toDataXCoord(tick_x).toFixed(), tick_x, @canvas.height - textSpacing )

       if i % 4 is 0 and i isnt 0
         tick_x = ((+i - xMin) / (xMax - xMin)) * @canvas.width
@@ -156,6 +186,8 @@

   toCanvasXCoord: (dataPoint) -> ((dataPoint - @xMin) / (@xMax - @xMin)) * @canvas.width
   toDataXCoord: (canvasPoint) -> ((canvasPoint / @canvas.width) * (@xMax - @xMin)) + @xMin
+  toDataYCoord: (canvasPoint) -> ((canvasPoint / @canvas.height) * (@yMax - @yMin)) + @yMin
+

   addMarkToGraph: (e) =>
     e.preventDefault()


style handles, add bottom border

style handles, add bottom border

--- app/lib/canvas-graph.coffee
+++ app/lib/canvas-graph.coffee
@@ -127,18 +127,19 @@

-

+
III

-

+
III

     """

     @element.style.left = @toCanvasXPoint(e) + "px"
     @element.style.position = 'absolute'
     @element.style.top = e.target.offsetTop + "px"
-    @element.style.height = @canvas.height + 'px'
+    @element.style.height = (@canvas.height - 2) + 'px'
     @element.style.backgroundColor = 'rgba(255,0,0,.5)'
+    @element.style.borderBottom = '2px solid red'
     @element.style.pointerEvents = 'auto'
     @element.style.textAlign = 'center'

@@ -203,7 +204,9 @@
     switch e.target.className
       when "mark" then @element.style.cursor = "move"
       when "left-border" then @element.style.cursor = "ew-resize"
+      when "left-handle" then @element.style.cursor = "ew-resize"
       when "right-border" then @element.style.cursor = "ew-resize"
+      when "right-handle" then @element.style.cursor = "ew-resize"
       when "top-bar" then @element.style.cursor = "pointer"

   onMouseMove: (e) =>


feat(settings): always allow default settings description key

This should cut down on the redundant i18nDescription declarations
by allowing developers to utilize the default key + "_Description"
convention in the i18n/ files for settings and setting groups

Example: setting LDAP_Enable will look for the LDAP_Enable_Description
key unless it's explicitly overriden.

--- packages/rocketchat-lib/settings/server/methods.coffee
+++ packages/rocketchat-lib/settings/server/methods.coffee
@@ -18,7 +18,12 @@
 	updateSettings =
 		i18nLabel: options.i18nLabel or _id

-	updateSettings.i18nDescription = options.i18nDescription if options.i18nDescription?
+  # default description i18n key will be the setting name + "_Description"
+  # (eg: LDAP_Enable -> LDAP_Enable_Description)
+	updateSettings.i18nDescription = if options.i18nDescription?
+    options.i18nDescription
+  else
+    "#{_id}_Description"
 	updateSettings.type = options.type if options.type
 	updateSettings.multiline = options.multiline if options.multiline
 	updateSettings.group = options.group if options.group
@@ -49,7 +54,10 @@
 		type: 'group'
 		i18nLabel: options.i18nLabel or _id

-	updateSettings.i18nDescription = options.i18nDescription if options.i18nDescription?
+	updateSettings.i18nDescription = if options.i18nDescription?
+    options.i18nDescription
+  else
+    "#{_id}_Description"

 	upsertChanges = { $set: updateSettings }
 	if options.persistent is true


This regex tweak should capture everything up to the first instance of 'is' instead of the last

--- scripts/roles.coffee
+++ scripts/roles.coffee
@@ -43,7 +43,7 @@
       else
         msg.send "#{name}? Never heard of 'em"

-  robot.respond /@?([\w .\-_]+) is (["'\w: \-_]+)[.!]*$/i, (msg) ->
+  robot.respond /@?([\w .\-_]+?) is (["'\w: \-_]+)[.!]*$/i, (msg) ->
     name    = msg.match[1].trim()
     newRole = msg.match[2].trim()

@@ -67,7 +67,7 @@
         else
           msg.send "I don't know anything about #{name}."

-  robot.respond /@?([\w .\-_]+) is not (["'\w: \-_]+)[.!]*$/i, (msg) ->
+  robot.respond /@?([\w .\-_]+?) is not (["'\w: \-_]+)[.!]*$/i, (msg) ->
     name    = msg.match[1].trim()
     newRole = msg.match[2].trim()


Removed not needed option.

Removed not needed option.

--- app/assets/javascripts/app/lib/app_post/interface_handle.coffee
+++ app/assets/javascripts/app/lib/app_post/interface_handle.coffee
@@ -83,13 +83,6 @@
             if typeof params[i] isnt 'object'
               params_only[i] = params[i]

-          # tell server what we are calling right now
-          App.WebSocket.send(
-            action:     'active_controller',
-            controller: route,
-            params:     params_only,
-          )
-
           # remember history
           # needed to mute "redirect" url to support browser back
           history = App.Config.get('History')


Ensure that the component gets loaded upon page-change

--- app/assets/javascripts/react_components/todo_list/app.js.coffee
+++ app/assets/javascripts/react_components/todo_list/app.js.coffee
@@ -142,7 +142,7 @@
   onClick: ->
     @getFlux().actions.toggleTodo(@props.todo.id)

-# Rendering the whole component
-document.addEventListener 'DOMContentLoaded', (e) ->
+# Rendering the whole component upon page-change
+$(document).on "page:change", ->
   React.render <Application flux={flux} />,
                 document.getElementById("react_mountPoint")


Send welcomeemail after verify by pin

Send welcomeemail after verify by pin

--- workers/social/lib/social/models/user/index.coffee
+++ workers/social/lib/social/models/user/index.coffee
@@ -1164,7 +1164,11 @@
     @update {$set: status: 'confirmed'}, (err, res)=>
       return callback err if err
       JUser.emit "EmailConfirmed", @
-      return callback null
+
+      welcomeemail = require "../welcomeemail"
+      welcomeemail.send @email, @username, (err)->
+        callback err
+

   block:(blockedUntil, callback)->
     unless blockedUntil then return callback createKodingError "Blocking date is not defined"


Link up of translations and render in the glossary file

--- app/pages/lab/glossary.cjsx
+++ app/pages/lab/glossary.cjsx
@@ -3,29 +3,27 @@
 {Markdown} = (require 'markdownz').default

 counterpart.registerTranslations 'en',
-  policiesPage:
+  glossary:
     content: '''
       ## Glossary
-      A collection of definitions for terms used across the Zooniverse. The terms are split into three different groups; General Terms; Project-Specific Terms, and People.
+      A collection of definitions for terms used across the Zooniverse. The terms are split into three different groups; [General Terms](#generalTerms); [People](#people) and [Project-Specific Terms](#projectSpecificTerms).

-      ###GENERAL TERMS
+      ###GENERAL TERMS
+
+      this is my generalterm...horaay!
+
+      ###PEOPLE

-
-      ###PEOPLE
-
-
-
-      ###PROJECT-SPECIFIC TERMS
-
+      ###PROJECT-SPECIFIC TERMS

     '''

 module.exports = React.createClass
-  displayName: 'LabPoliciesPage'
+  displayName: 'Glossary'

   render: ->

-      <Markdown>{counterpart "policiesPage.content"}</Markdown>
+      <Markdown>{counterpart "glossary.content"}</Markdown>


Client: Activity: Added accountId parameter to fake message to check message is consequent or not.

--- client/activity/lib/flux/helpers/messagecollection.coffee
+++ client/activity/lib/flux/helpers/messagecollection.coffee
@@ -1,4 +1,6 @@
+whoami               = require 'app/util/whoami'
 generateDummyMessage = require 'app/util/generateDummyMessage'
+

 ###*
  * Adds given message to given messages map.
@@ -107,8 +109,9 @@
 ###
 createFakeMessage = (id, body) ->

-  message    = generateDummyMessage body
-  message.id = id
+  message           = generateDummyMessage body
+  message.accountId = whoami().socialApiId
+  message.id        = id

   return message


MachineSettingsCommonView: Base method for creating list view.

--- client/app/lib/providers/machinesettingscommonview.coffee
+++ client/app/lib/providers/machinesettingscommonview.coffee
@@ -1,34 +1,43 @@
-kd                  = require 'kd'
-KDView              = kd.View
-KDHeaderView        = kd.HeaderView
-KDButtonView        = kd.ButtonView
-KDCustomHTMLView    = kd.CustomHTMLView
-KDHitEnterInputView = kd.HitEnterInputView
-
+kd                   = require 'kd'
+KDView               = kd.View
+KDHeaderView         = kd.HeaderView
+KDButtonView         = kd.ButtonView
+KDListItemView       = kd.ListItemView
+KDCustomHTMLView     = kd.CustomHTMLView
+KDHitEnterInputView  = kd.HitEnterInputView
+KDListViewController = kd.ListViewController

 module.exports = class MachineSettingsCommonView extends KDView

   constructor: (options = {}, data) ->

-    options.header                or= ''
+    options.headerTitle           or= ''
     options.addButtonTitle        or= 'ADD'
     options.addButtonCssClass     or= ''
+    options.listViewItemClass     or= KDListItemView
     options.headerAddButtonTitle  or= 'ADD NEW'

     super options, data

+    @machine = @getData()

-    @addSubView header = new KDHeaderView
-      title : options.header
+    @createHeader()
+    @createAddView()
+    @createListView()
+    @initList()
+
+
+  createHeader: ->
+
+    { headerTitle, headerAddButtonTitle, addButtonCssClass } = @getOptions()
+
+    @addSubView header = new KDHeaderView title: headerTitle

     header.addSubView @headerAddNewButton = new KDButtonView
-      title    : options.headerAddButtonTitle
-      cssClass : "solid green compact add-button #{options.addButtonCssClass}"
+      title    : headerAddButtonTitle
+      cssClass : "solid green compact add-button #{addButtonCssClass}"
       callback : @bound 'showAddView'
-
-
-    @createAddView()

   createAddView: ->
@@ -82,3 +91,25 @@
   handleAddNew: ->

     kd.warn 'unhandled method'
+
+
+  createListView: ->
+
+    @listController  = new KDListViewController
+      startWithLazyLoader: yes
+      lazyLoaderOptions  :
+        spinnerOptions   :
+          size           : width: 28
+      viewOptions        :
+        type             : 'domain'
+        wrapper          : yes
+        itemClass        : @getOptions().listViewItemClass
+        itemOptions      :
+          machineId      : @machine._id
+
+    @addSubView @listController.getView()
+
+
+  initList: ->
+
+    kd.warn 'unhandled method'


Make these local too

Make these local too

--- client/landing/app/MainApp/maincontroller/mainview.coffee
+++ client/landing/app/MainApp/maincontroller/mainview.coffee
@@ -268,43 +268,42 @@
     loginLink.appendToSelector '.group-login-buttons'

   addGroupViews:->
-    @groupLandingView = new KDView
+    groupLandingView = new KDView
       lazyDomId : 'group-landing'

-    @groupLandingView.listenWindowResize()
-    @groupLandingView._windowDidResize = =>
-      @groupLandingView.setHeight window.innerHeight
-
-    @groupContentWrapperView = new KDView
+    groupLandingView.listenWindowResize()
+    groupLandingView._windowDidResize = =>
+      groupLandingView.setHeight window.innerHeight
+
+    groupContentWrapperView = new KDView
       lazyDomId : 'group-content-wrapper'
       cssClass : 'slideable'

-    @groupTitleView = new KDView
+    groupTitleView = new KDView
       lazyDomId : 'group-title'

-    @groupSplitView = new SplitViewWithOlderSiblings
+    groupSplitView = new SplitViewWithOlderSiblings
       lazyDomId : 'group-splitview'
-      parent : @groupContentWrapperView
-
-    @groupPersonalWrapperView = new KDView
+      parent : groupContentWrapperView
+
+    groupPersonalWrapperView = new KDView
       lazyDomId : 'group-personal-wrapper'
       cssClass : 'slideable'

-    @groupLogoView = new KDView
+    groupLogoView = new KDView
       lazyDomId: 'group-koding-logo'
       click :=>
-        @groupPersonalWrapperView.setClass 'slide-down'
-        @groupContentWrapperView.setClass 'slide-down'
-        @groupLogoView.setClass 'top'
-
-        @groupLandingView.setClass 'group-fading'
-        @utils.wait 1100, => @groupLandingView.setClass 'group-hidden'
-
-    @groupLogoView.$().css
-      top: @groupLandingView.getHeight()-42
-
-    @utils.wait => @groupLogoView.setClass 'animate'
-
+        groupPersonalWrapperView.setClass 'slide-down'
+        groupContentWrapperView.setClass 'slide-down'
+        groupLogoView.setClass 'top'
+
+        groupLandingView.setClass 'group-fading'
+        @utils.wait 1100, => groupLandingView.setClass 'group-hidden'
+
+    groupLogoView.$().css
+      top: groupLandingView.getHeight()-42
+
+    @utils.wait => groupLogoView.setClass 'animate'

   addProfileViews:->


Ensure geordiLogger is set before mount

Ensure geordiLogger is set before mount

--- app/partials/app.cjsx
+++ app/partials/app.cjsx
@@ -24,9 +24,9 @@
     initialLoadComplete: false
     user: null

-  updateUser: (user) ->
-    @setState user: user
-
+  componentWillMount: ->
+    @setupGeordi(@state.user)
+
   componentDidMount: ->
     auth.listen 'change', @handleAuthChange
     generateSessionID()
@@ -35,15 +35,15 @@
   componentWillUnmount: ->
     auth.stopListening 'change', @handleAuthChange

-  componentWillUpdate: (nextProps, nextState) ->
-    if !(@geordiLogger? && @geordiLogger.user == nextState.user)
-      @geordiLogger = new GeordiLogger nextState.user
+  setupGeordi: (user) ->
+    @geordiLogger = new GeordiLogger user

   handleAuthChange: ->
     auth.checkCurrent().then (user) =>
       @setState
         initialLoadComplete: true
         user: user
+      @setupGeordi(user)

   render: ->
     <div className="panoptes-main">


somewhat working toggl - adds and removes keys, shows your own status

--- scripts/toggl.coffee
+++ scripts/toggl.coffee
@@ -1,4 +1,8 @@
-# Get our toggl statuses
+# Show toggl status
+#
+# hubot toggl keyadd <yourapikey> - Remember my toggl api key
+# hubot toggl keydel - Forget my toggl api key
+# hubot toggl status - Show my recent time entries
 #

 module.exports = (robot) ->
@@ -13,4 +17,22 @@
     msg.reply("Ok, I lost your toggl key.")

   robot.respond /toggl status/i, (msg) ->
-    msg.send "Stub function.  This is where I would loop through the api keys I have stored and display that status for each of you."
+    users = [msg.message.user]
+    users.forEach (user) ->
+      if user.togglKey?
+        encodedAuth = new Buffer(user.togglKey + ':api_token').toString('base64')
+
+        msg
+          .http("https://www.toggl.com/api/v6/time_entries.json")
+          .header('Authorization', 'Basic ' + encodedAuth)
+          .get() (err, res, body) ->
+            resp = user.name + "\n";
+            results = JSON.parse(body)
+            if results.error
+              results.error.errors.forEach (err) ->
+                resp += err.message
+            else
+              results.data.forEach (item) ->
+                resp += item.start + " - " + item.description + " - " + item.duration + " sec\n"
+
+            msg.send resp


Save new etag after updating a resource

Save new etag after updating a resource

--- app/scripts/services.coffee
+++ app/scripts/services.coffee
@@ -20,11 +20,12 @@
           putdata[k] = v
         $http.put("/api/#{resource}/"+id, putdata,
                   headers: {'If-Match': data._etag})
-        .success (data, status) ->
-          if status == 200 and data._status == 'OK'
+        .success (res, status) ->
+          if status == 200 and res._status == 'OK'
             flash.success = "#{resource} successfully updated!"
-          if status == 200 and data._status == 'ERR'
-            for field, message of data._issues
+            data._etag = res._etag
+          if status == 200 and res._status == 'ERR'
+            for field, message of res._issues
               flash.error = "#{field}: #{message}"
       Resource.patch = (id, data, etag) ->
         $http


Fix duplicated lines on animal  moving modal

--- app/assets/javascripts/backend/animals.js.coffee
+++ app/assets/javascripts/backend/animals.js.coffee
@@ -299,7 +299,7 @@

         @showMoveAnimalModal false

-        @resetAnimalsMoving
+        @resetAnimalsMoving()

       @resetAnimalsMoving = () =>
         @moveAnimalModalOptions.animals.removeAll()
@@ -312,6 +312,9 @@
         @moveAnimalModalOptions.group undefined
         @moveAnimalModalOptions.alert false
         @moveAnimalModalOptions.checkNature false
+        @production_support_list.removeAll()
+        @workers_list.removeAll()
+        @natures_list.removeAll()

       @cancelContainerAdding = () =>
         @resetContainerAdding()


Make sure we have a current_page

Make sure we have a current_page

--- app/assets/javascripts/controllers/editor.coffee
+++ app/assets/javascripts/controllers/editor.coffee
@@ -18,7 +18,7 @@
     @routes
       '/editor/*path': (params)=>
         path = "/#{params.match[1]}"
-        if @current_page.path is path
+        if @current_page and @current_page.path is path
           @loadPath(path)
         else
           @loadNewPageFromPath(path)


remove externally-linked feedback tab (logic still in place)

--- app/assets/javascripts/partials/main-header.cjsx
+++ app/assets/javascripts/partials/main-header.cjsx
@@ -42,7 +42,8 @@
         }

         { # include feedback tab if defined
-          if @props.feedbackFormUrl?
+          showFeedbackTab = false
+          if @props.feedbackFormUrl? and showFeedbackTab
             Feedback
         }


clarify prop name

clarify prop name

--- app/assets/javascripts/partials/yale-header.cjsx
+++ app/assets/javascripts/partials/yale-header.cjsx
@@ -5,7 +5,7 @@
 Login = require '../components/login'

 module.exports = React.createClass
-  displayName: 'MainHeader'
+  displayName: 'YaleHeader'

   getDefaultProps: ->
     user: null


fix popover

fix popover

--- app/assets/javascripts/pt/tags/popover.js.coffee
+++ app/assets/javascripts/pt/tags/popover.js.coffee
@@ -8,34 +8,45 @@
       $el.data 'ptPopoverFocused', true
       attr = $el.ptAttr()

-      if not $el.data 'ptPopoverLoaded'
-        $el.data 'ptPopoverLoaded', true
-        url = attr.popover
+      setTimeout( ->
+        $el = $ $el[0]
+        attr = $el.ptAttr()

-        #if not a url assume it's content
-        if url.charAt(0)!="/"
-          $el.popover
-            content: url
-            html: true
-            trigger: 'manual'
-            container: attr.popoverContainer or 'body'
-            placement: attr.popoverPlacement or 'right'
-          $el.data 'ptPopoverLoaded', false
-          $el.popover 'show' if $el.data 'ptPopoverFocused'
-        else
-          $.ajax
-            url: url
-            success: (html) ->
-              $el.popover
-                content: html
-                html: true
-                trigger: 'manual'
-                container: attr.popoverContainer or 'body'
-                placement: attr.popoverPlacement or 'right'
-              $el.data 'ptPopoverLoaded', false
-              $el.popover 'show' if $el.data 'ptPopoverFocused'
-      else
-        $el.popover 'show'
+        log $el.data()
+
+        if not $el.data('ptPopoverLoaded') and $el.data('ptPopoverFocused')
+          $el.data 'ptPopoverLoaded', true
+          url = attr.popover
+
+          #if not a url assume it's content
+          if url.charAt(0)!="/"
+            $el.popover
+              content: url
+              html: true
+              trigger: 'manual'
+              container: attr.popoverContainer or 'body'
+              placement: attr.popoverPlacement or 'right'
+            $el.removeData 'ptPopoverLoaded'
+            $el.popover 'show' if $el.data 'ptPopoverFocused'
+          else
+            $.ajax
+              url: url
+              success: (html) ->
+                $el.popover
+                  content: html
+                  html: true
+                  trigger: 'manual'
+                  container: attr.popoverContainer or 'body'
+                  placement: attr.popoverPlacement or 'right'
+                $el.removeData 'ptPopoverLoaded'
+                $el.popover 'show' if $el.data 'ptPopoverFocused'
+        else if $el.data('ptPopoverFocused')
+          if not attr.popoverContainer
+            $el.popover 'show'
+          else
+            $el.closest(attr.popoverContainer).find('.popover').popover 'show'
+      , 500)
+

 pt.tags.push
   popover:
@@ -43,7 +54,8 @@
     callback: ->
       $el = $ this
       attr = $el.ptAttr()
-      $el.data 'ptPopoverFocused', false
+      $el.removeData 'ptPopoverLoaded'
+      $el.removeData 'ptPopoverFocused'
       if not attr.popoverContainer
         $('body').find('.popover').remove()
         # $el.popover 'hide'


cleanup

cleanup

--- app/assets/javascripts/views/chat_view.js.coffee
+++ app/assets/javascripts/views/chat_view.js.coffee
@@ -67,7 +67,6 @@
       this.loadMore(e)

   scrollToElement: (anchor)=>
-    console.log(anchor)
     @scrollContainer.scrollTop $("#" + anchor).offset().top

   loadMore: (e)=>
@@ -76,16 +75,15 @@
     @stuckToBottom = false
     loadMoreButton = @$('.js-chat-load-more')
     originalText = loadMoreButton.text()
-    curretTopEvent = @collection.first()
+    currentTopEvent = @collection.first()
     loadMoreButton.attr('disabled', true).text('Loading…')
     oldHeight = @scrollContainer[0].scrollHeight

     $.ajax(
       type: 'GET'
-      url: loadMoreButton .attr('href') + "?top_id=#{curretTopEvent.get('id')}"
+      url: loadMoreButton .attr('href') + "?top_id=#{currentTopEvent.get('id')}"
       complete: =>
         @readyToLoadMore = true
-        console.log(curretTopEvent)
         newHeight = @scrollContainer[0].scrollHeight
         @scrollContainer.scrollTop (newHeight - oldHeight)


let there be inifity scrolling in chat

let there be inifity scrolling in chat

--- app/assets/javascripts/views/chat_view.js.coffee
+++ app/assets/javascripts/views/chat_view.js.coffee
@@ -8,8 +8,9 @@
   events:
     'click   .js-chat-load-more' : 'onLoadMore'
     'click   .js-chat-create-wip': 'onCreateWip'
-
+
   initialize: (options)->
+    @readyToLoadMore = true
     @listenTo(@collection, 'add', @render)
     @scrollContainer = options.scrollContainer
     @scrollPadding = options.scrollPadding
@@ -21,7 +22,8 @@
       'overflow-x':'hidden'
       'overflow-y':'scroll'
     )
-
+    @scrollContainer.on 'scroll', this.loadMoreWhenNearTop
+
     $(window).resize(@onWindowResize.bind(this))
     @onWindowResize()

@@ -30,7 +32,7 @@
   render: =>
     @$('.js-chat-load-more').toggle(@collection.length >= 25)
     @scrollToLatestActivity() if @stuckToBottom
-
+
   scrollToLatestActivity: ->
     $(@scrollContainer).scrollTop(999999)

@@ -57,20 +59,44 @@

   onLoadMore: (e) =>
     e.preventDefault()
+    this.loadMore(e)
+
+  loadMoreWhenNearTop: (e)=>
+    nearTop = 200
+    if e.currentTarget.scrollTop < nearTop
+      this.loadMore(e)
+
+  scrollToElement: (anchor)=>
+    console.log(anchor)
+    @scrollContainer.scrollTop $("#" + anchor).offset().top
+
+  loadMore: (e)=>
+    return if @readyToLoadMore == false
+    @readyToLoadMore = false
     @stuckToBottom = false
-    originalText = $('.js-chat-load-more').text()
-    @$('.js-chat-load-more').attr('disabled', true).text('Loading…')
+    loadMoreButton = @$('.js-chat-load-more')
+    originalText = loadMoreButton.text()
+    curretTopEvent = @collection.first()
+    loadMoreButton.attr('disabled', true).text('Loading…')
+    oldHeight = @scrollContainer[0].scrollHeight
+
     $.ajax(
       type: 'GET'
-      url: $(e.target).attr('href') + "?top_id=#{@collection.first().get('id')}"
+      url: loadMoreButton .attr('href') + "?top_id=#{curretTopEvent.get('id')}"
+      complete: =>
+        @readyToLoadMore = true
+        console.log(curretTopEvent)
+        newHeight = @scrollContainer[0].scrollHeight
+        @scrollContainer.scrollTop (newHeight - oldHeight)
+
       success: (datas) =>
         fixScroll =>
           for data in _.sortBy(datas, (data) -> data['created']).reverse()
             @collection.unshift(data)

-          @$('.js-chat-load-more').text(originalText).attr('disabled', false)
+          loadMoreButton.text(originalText).attr('disabled', false)
     )
-
+
   onCreateWip: (e) ->
     e.preventDefault()
     id = $(e.currentTarget).attr('href')


fix signature for upload dialog in gb2

fix signature for upload dialog in gb2

fixes CNVS-10606

test-plan
=======
- navigate to gradebook and upload a csv of scores
- verify that uploading works as expected
- navigate to gradebook and submit the upload dialog without a file
- verify that the error banner shows across the top

Change-Id: I384ca0cfd33612050b218a174a714f4bb350af69
Reviewed-on: https://gerrit.instructure.com/28835
QA-Review: Caleb Guanzon <54fa1f30d451e4f3c341a8f3c47c9215fd0be9c6@instructure.com>
Reviewed-by: Simon Williams <088e16a1019277b15d58faf0541e11910eb756f6@instructure.com>
Tested-by: Bryan Madsen <0a3ba1af216659500dd8f41e29f3979f42452870@instructure.com>
Product-Review: Bryan Madsen <0a3ba1af216659500dd8f41e29f3979f42452870@instructure.com>

--- app/coffeescripts/gradebook2/UploadDialog.coffee
+++ app/coffeescripts/gradebook2/UploadDialog.coffee
@@ -5,7 +5,7 @@
 ], ($, gradebook_uploads_form) ->

   class UploadDialog
-    constructor: ({@context_url}) ->
+    constructor: (@context_url) ->
       @init()

     init: (opts={context_url: @context_url}) =>


removed old adnew stuff

removed old adnew stuff

--- core/app/backbone/views/autocompleted_add_to_channel_view.coffee
+++ core/app/backbone/views/autocompleted_add_to_channel_view.coffee
@@ -12,8 +12,7 @@
     "click div.auto_complete": "addCurrentlySelectedChannel"
     "click div.fake-input a": "addCurrentlySelectedChannel"
     "click .show-input-button": "showInput"
-    "mouseenter .auto_complete>div": "selectAddNew"
-    "mouseleave .auto_complete>div": "deActivateAddNew"
+    "mouseenter .auto_complete>div": "selectDefaultItem"

   regions:
     'added_channels': 'div.added_channels_container'
@@ -63,20 +62,12 @@

   focusInput: -> @$("input.typeahead").focus()

-  deActivateCurrent: ->
-    @_auto_completes_view.deActivateCurrent()
-    @deActivateAddNew()
+  deActivateCurrent: -> @_auto_completes_view.deActivateCurrent()

   setActiveAutoComplete: (key, scroll) ->
     @_auto_completes_view.setActiveAutoComplete key, scroll

-  selectAddNew: ->
-    @deActivateAutoCompleteView()  if typeof @activeChannelKey() is "number"
-    @activateAddNew()
-
-  activateAddNew: -> @$(".auto_complete>div").addClass "active"
-  deActivateAddNew: -> @$(".auto_complete>div").removeClass "active"
-  isAddNewActive: -> @$(".auto_complete>div").hasClass "active"
+  selectDefaultItem: -> console.info 'we could do something here'

   activateAutoCompleteView: (view) ->
     @setActiveAutoComplete @_auto_completes_view.list.indexOf(view)


Catch only internal links.

Catch only internal links.

--- core/htdocs_source/src/pods/oxisection-keyvalue/component.coffee
+++ core/htdocs_source/src/pods/oxisection-keyvalue/component.coffee
@@ -2,7 +2,7 @@

 Component = Em.Component.extend
     click: (evt) ->
-        if evt.target.tagName is "A"
+        if evt.target.tagName is "A" and not /^(html|\/)/.test evt.target.href
             evt.stopPropagation()
             evt.preventDefault()
             @container.lookup("route:openxpki").sendAjax


Small refactor

Small refactor

--- app/modules/services/current-user.service.coffee
+++ app/modules/services/current-user.service.coffee
@@ -125,56 +125,60 @@

     canCreatePrivateProjects: () ->
         user = @.getUser()
-        if user.get('max_private_projects') != null && user.get('total_private_projects') >= user.get('max_private_projects')
-            return {
-                valid: false,
-                reason: 'max_private_projects',
-                type: 'private_project',
-                current: user.get('total_private_projects'),
-                max: user.get('max_private_projects')
-            }
+        if user.get('max_private_projects') != null &&
+            user.get('total_private_projects') >= user.get('max_private_projects')
+                return {
+                    valid: false,
+                    reason: 'max_private_projects',
+                    type: 'private_project',
+                    current: user.get('total_private_projects'),
+                    max: user.get('max_private_projects')
+                }

         return {valid: true}

     canCreatePublicProjects: () ->
         user = @.getUser()

-        if user.get('max_public_projects') != null && user.get('total_public_projects') >= user.get('max_public_projects')
-            return {
-                valid: false,
-                reason: 'max_public_projects',
-                type: 'public_project',
-                current: user.get('total_public_projects'),
-                max: user.get('max_public_projects')
-            }
+        if user.get('max_public_projects') != null &&
+            user.get('total_public_projects') >= user.get('max_public_projects')
+                return {
+                    valid: false,
+                    reason: 'max_public_projects',
+                    type: 'public_project',
+                    current: user.get('total_public_projects'),
+                    max: user.get('max_public_projects')
+                }

         return {valid: true}

     canAddMembersPublicProject: (totalMembers) ->
         user = @.getUser()

-        if user.get('max_memberships_public_projects') != null && totalMembers > user.get('max_memberships_public_projects')
-            return {
-                valid: false,
-                reason: 'max_members_public_projects',
-                type: 'public_project',
-                current: totalMembers,
-                max: user.get('max_memberships_public_projects')
-            }
+        if user.get('max_memberships_public_projects') != null &&
+            totalMembers > user.get('max_memberships_public_projects')
+                return {
+                    valid: false,
+                    reason: 'max_members_public_projects',
+                    type: 'public_project',
+                    current: totalMembers,
+                    max: user.get('max_memberships_public_projects')
+                }

         return {valid: true}

     canAddMembersPrivateProject: (totalMembers) ->
         user = @.getUser()

-        if user.get('max_memberships_private_projects') != null && totalMembers > user.get('max_memberships_private_projects')
-            return {
-                valid: false,
-                reason: 'max_members_private_projects',
-                type: 'private_project',
-                current: totalMembers,
-                max: user.get('max_memberships_private_projects')
-            }
+        if user.get('max_memberships_private_projects') != null &&
+            totalMembers > user.get('max_memberships_private_projects')
+                return {
+                    valid: false,
+                    reason: 'max_members_private_projects',
+                    type: 'private_project',
+                    current: totalMembers,
+                    max: user.get('max_memberships_private_projects')
+                }

         return {valid: true}


Update unused keymaps

Update unused keymaps

--- keymaps/non-navigation.cson
+++ keymaps/non-navigation.cson
@@ -1,2 +1,5 @@
-# '.workspace .editor':
-#   'ctrl-alt-o': 'non-navigation:move-right'
+# '.platform-linux body atom-text-editor':
+#   'ctrl-space': 'non-navigation:move-right'
+#
+# '.platform-darwin body atom-text-editor':
+#   'cmd-space': 'non-navigation:move-right'


Remove current block normalization

Remove current block normalization

--- app/src/tasks/wallet_layout_recovery_task.coffee
+++ app/src/tasks/wallet_layout_recovery_task.coffee
@@ -75,20 +75,9 @@
       unconfirmedTransactions = unconfirmed
       savedState['lastSyncStatus'] = 'success'
       savedState['lastSyncTime'] = new Date().getTime()
-      savedState = @_normalizeCurrentBlock(lastBlock, savedState)
       @_saveSynchronizationData(savedState) if persistState
     .then =>
       unconfirmedTransactions
-
-  _normalizeCurrentBlock: (block, state) ->
-    accountIndex = 0
-    while state["account_#{accountIndex}"]?
-      for batch in (state["account_#{accountIndex}"]["batches"] or [])
-        if batch.blockHeight < block.height
-          batch.blockHeight = block.height
-          batch.blockHash = block.hash
-      accountIndex += 1
-    state

   _numberOfAccountInState: (savedState) ->
     accountIndex = 0


edison.coffee: Switch yocto version to sumo

Signed-off-by: Florin Sarbu <3a837a37a2ac9072a088641ec330e0e5d5b86f4e@resin.io>

--- edison.coffee
+++ edison.coffee
@@ -62,7 +62,7 @@
 		machine: 'edison'
 		image: 'resin-image'
 		fstype: 'zip'
-		version: 'yocto-rocko'
+		version: 'yocto-sumo'
 		deployArtifact: 'resin-edison'
 		archive: true
 		compressed: true


Properly handle /i18n fields where descriptions vary by code language

--- app/views/i18n/I18NEditComponentView.ozar.coffee
+++ app/views/i18n/I18NEditComponentView.ozar.coffee
@@ -18,12 +18,12 @@
         @wrapRow "#{propDoc.name} name value", ['name'], propDoc.name, i18n[lang]?.name, path
         if _.isObject propDoc.description
           for progLang, description of propDoc.description
-            @wrapRow "#{propDoc.name} description (#{progLang})", ['description', progLang], description, i18n[lang]?[progLang]?.description, path, 'markdown'
+            @wrapRow "#{propDoc.name} description (#{progLang})", ['description', progLang], description, i18n[lang]?.description?[progLang], path, 'markdown'
         else if _.isString propDoc.description
           @wrapRow "#{propDoc.name} description", ['description'], propDoc.description, i18n[lang]?.description, path, 'markdown'
         if _.isObject propDoc.shortDescription
           for progLang, shortDescription of propDoc.shortDescription
-            @wrapRow "#{propDoc.name} shortDescription (#{progLang})", ['shortDescription', progLang], shortDescription, i18n[lang]?[progLang]?.shortDescription, path, 'markdown'
+            @wrapRow "#{propDoc.name} shortDescription (#{progLang})", ['shortDescription', progLang], shortDescription, i18n[lang]?.shortDescription?[progLang], path, 'markdown'
         else if _.isString propDoc.shortDescription
           @wrapRow "#{propDoc.name} shortDescription", ['shortDescription'], propDoc.shortDescription, i18n[lang]?.shortDescription, path, 'markdown'
         if context = propDoc.context
@@ -36,7 +36,7 @@
         d = propDoc.returns.description
         if _.isObject d
           for progLang, description of d.description
-            @wrapRow "#{propDoc.name} return val (#{progLang})", ['description', progLang], description, i18n[lang]?[progLang]?.description, path, 'markdown'
+            @wrapRow "#{propDoc.name} return val (#{progLang})", ['description', progLang], description, i18n[lang].description?[progLang], path, 'markdown'
         else if _.isString d
           @wrapRow "#{propDoc.name} return val", ['description'], d, i18n[lang]?.description, path, 'markdown'

@@ -47,7 +47,7 @@
             path = ['propertyDocumentation', propDocIndex, 'args', argIndex]
             if _.isObject argDoc.description
               for progLang, description of argDoc.description
-                @wrapRow "#{propDoc.name} arg description #{argDoc.name} (#{progLang})", ['description', progLang], description, i18n[lang]?[progLang]?.description, path, 'markdown'
+                @wrapRow "#{propDoc.name} arg description #{argDoc.name} (#{progLang})", ['description', progLang], description, i18n[lang]?.description?[progLang], path, 'markdown'
             else if _.isString argDoc.description
               @wrapRow "#{propDoc.name} arg description #{argDoc.name}", ['description'], argDoc.description, i18n[lang]?.description, path, 'markdown'


geoip: Header is added for request

geoip: Header is added for request

--- workers/social/lib/social/models/socialapi/requests.coffee
+++ workers/social/lib/social/models/socialapi/requests.coffee
@@ -401,7 +401,8 @@
       method : 'POST'

     {reqOptions, data} = setCookieIfRequired reqOptions, data
-
+    {reqOptions, data} = setHeaderIfRequired reqOptions, data
+
     reqOptions.body = data

     request reqOptions, wrapCallback callback
@@ -456,6 +457,17 @@
     reqOptions.jar = j

     delete data.sessionToken
+
+  return {reqOptions, data}
+
+setHeaderIfRequired = (reqOptions, data)->
+  # inject clientId cookie if exists
+  if data?.clientIP
+    reqOptions.headers = {
+      'X-Forwarded-For': data.clientIP
+    }
+
+    delete data.clientIP

   return {reqOptions, data}


minor comments and formatting

minor comments and formatting

--- fizzylogo_List.coffee
+++ fizzylogo_List.coffee
@@ -231,9 +231,9 @@
         #dir receiver
         log "3 returnedContext.throwing: " + returnedContext.throwing

-        # works as follows: we find a receiver, we send it the rest
-        # of the original message hence getting a new receiver,
-        # whom we send again the rest of the message
+        # works as follows: now that we found the first receiver,
+        # we send it the rest of the original message hence getting a
+        # new receiver, whom we send again the rest of the message
         # and so and and so forth. We keep using the same context, so we
         # accrete the state changes to the same context i.e. the one we
         # are running the method body in.
@@ -316,6 +316,8 @@
             !(receiver?.flClass == FLIfFallThrough)
               log "breaking and moving on to next statement"
               break
+
+

         log "evaluation " + indentation() + "list: nothing more to evaluate"


get width and height from yeoman

get width and height from yeoman

--- generators/app/templates/scripts/game.coffee
+++ generators/app/templates/scripts/game.coffee
@@ -1,3 +1,4 @@
+Phaser  = require 'phaser'
 Boot    = require './states/boot'
 Preload = require './states/preload'
 Menu    = require './states/menu'
@@ -7,16 +8,16 @@

   constructor : ->

-    super(600, 480, Phaser.AUTO, 'game-content');
+    super <%= width %>, <%= height %>, Phaser.AUTO, 'game-content'

-    @state.add('boot', Boot);
-    @state.add('preload', Preload);
-    @state.add('menu', Menu);
-    @state.add('main', Main);
+    @state.add('boot', Boot)
+    @state.add('preload', Preload)
+    @state.add('menu', Menu)
+    @state.add('main', Main)

-    @state.start('boot');
+    @state.start('boot')

 window.onload = ->

-  game = new Game()+  game = new Game()


updateInterface might be clearer

updateInterface might be clearer

--- core/app/backbone/views/evidence/add_evidence_view.coffee
+++ core/app/backbone/views/evidence/add_evidence_view.coffee
@@ -27,17 +27,17 @@
   initialize: ->
     @model = new Backbone.Model saving: false, showBox: false
     @listenTo @model, 'change:saving', @_updateElementVisiblity
-    @listenTo @model, 'change:showBox', @_updateBox
+    @listenTo @model, 'change:showBox', @_updateInterface

   onRender: ->
     @_updateElementVisiblity()
-    @_updateBox()
+    @_updateInterface()

   _updateElementVisiblity: ->
     @$el.toggle !@collection.loading() && !@model.get('saving')
     @_updatePopovers()

-  _updateBox: ->
+  _updateInterface: ->
     if @model.get('showBox')
       @ui.buttons.hide()


let superclass behave like a marionette superclass

leave overriding inititialize  without super available

--- core/app/backbone/views/evidence/vote_up_down_view.coffee
+++ core/app/backbone/views/evidence/vote_up_down_view.coffee
@@ -3,7 +3,8 @@

   template: "evidence/vote_up_down"

-  initialize: ->
+  constructor: ->
+    super
     @bindTo @model, "change", @render, @

 class window.InteractiveVoteUpDownView extends window.VoteUpDownView


DevTools: disable workspace's broadCast feature for now, we will handle messages inline

--- client/DevTools/AppView.coffee
+++ client/DevTools/AppView.coffee
@@ -114,8 +114,10 @@
           ]
       ]

+    # DISABLE broadcastMessaging in workspace
+    @workspace.broadcastMessage = noop
+
     @workspace.ready =>
-

       {JSEditor, CSSEditor} = panes = @workspace.activePanel.panesByName


teamwork: restore location bar if requested session key is the same

--- client/Teamwork/AppView.coffee
+++ client/Teamwork/AppView.coffee
@@ -18,12 +18,18 @@
     else @teamworkApp.emit "NewSessionRequested"

   handleSessionKey: (sessionKey) ->
-    return  if sessionKey is @teamworkApp.getOption "sessionKey"
+    return @restoreLocation()  if sessionKey is @teamworkApp.getOption "sessionKey"
     @teamworkApp.emit "JoinSessionRequested", sessionKey

   handleImportUrl: (importUrl) ->
     @teamworkApp.emit "ImportRequested", importUrl

+  restoreLocation: ->
+    @setLocation @teamworkApp.getOption "sessionKey"
+
+  setLocation: (sessionKey) ->
+    KD.singleton("router").handleRoute "/Teamwork?sessionKey=#{sessionKey}"
+
   createApp: (query) ->
     return new TeamworkApp
       delegate : this


hide #dropdown-menu-closer by force

hide #dropdown-menu-closer by force

--- client/code/view/subnav.coffee
+++ client/code/view/subnav.coffee
@@ -341,6 +341,7 @@
     'click .hide-dataset': 'hideDataset'
     'click .rename-dataset': 'renameDataset'
     'click .dropdown-toggle': 'showDropdownMenuCloser'
+    'click #dropdown-menu-closer': 'hideDropdownMenuCloser'

   showChooser: ->
     app.navigate "/dataset/#{@model.get 'box'}/chooser", trigger: true
@@ -360,6 +361,11 @@
     # Clicks on tool iframes can't close open dropdowns inside of #toolbar.
     # So, we show a big transparent mask div, which will absorb the clicks.
     $('#dropdown-menu-closer').show()
+
+  hideDropdownMenuCloser: ->
+    # If the user closes the dropdown via normal means, the mask div
+    # will be left in place. This removes it when they click it.
+    $('#dropdown-menu-closer').hide()

   initialize: ->
     super()


video: add a helper method to create control view to base view

--- client/app/lib/videocollaboration/views/baseview.coffee
+++ client/app/lib/videocollaboration/views/baseview.coffee
@@ -1,5 +1,6 @@
 kd = require 'kd'
 getNick = require 'app/util/nick'
+VideoControlView = require './controlview'

 module.exports = class ChatVideoView extends kd.View

@@ -41,3 +42,9 @@
     @emit 'ViewDidHide'

+createVideoControl = (type, active) ->
+
+  cssClass = "ChatVideoControl ChatVideoControl--#{type}"
+  new VideoControlView { cssClass, active }
+
+


auth to redis when we're in production or staging envs

--- server/code/model/dataset.coffee
+++ server/code/model/dataset.coffee
@@ -31,6 +31,13 @@
 class Dataset extends ModelBase
   @dbClass: zDbDataset
   @redisClient: redis.createClient 6379, process.env.REDIS_SERVER
+
+  Dataset.redisClient.on 'connect', ->
+    if /production|staging/.test process.env.NODE_ENV
+      Dataset.redisClient.auth process.env.REDIS_PASSWORD, (err) ->
+        if err?
+          console.warn 'Redis auth error: ', err
+

   validate: ->
     return 'no tool' unless @tool? and @tool.length > 0


remove unused cleanCrontab

remove unused cleanCrontab

--- server/code/model/dataset.coffee
+++ server/code/model/dataset.coffee
@@ -90,26 +90,6 @@
       RedisClient.debouncedPublish @box, channel, message
       callback err

-  cleanCrontab: (callback) ->
-    {User} = require 'model/user'
-    User.findByShortName @user, (err, user) =>
-      if err
-        return callback err
-      if not user
-        return callback "cleanCrontab user not found: " + @user
-      _exec
-        user: user
-        boxName: @box
-        boxServer: @boxServer
-        cmd: "crontab -r"
-      , (err, res, body) =>
-        if err?
-          callback err
-        else if res.statusCode isnt 200
-          callback {statusCode: res.statusCode, body: body}
-        else
-          @toBeDeleted = null
-          @save callback

   @countVisibleDatasets: (user, callback) ->
     @dbClass.find({user: user, state: {$ne: 'deleted'}}).count callback


Revert "Remove external route"

Revert "Remove external route"

This reverts commit fddc65a2b2bf33483f7aa7aa35912942d0a4e41e.

--- server/controllers/routes.coffee
+++ server/controllers/routes.coffee
@@ -42,8 +42,8 @@
     'apps/:name/*': all: [utils.isAuthenticated, apps.app]
     'apps/:name*': all: [utils.isAuthenticated, apps.appWithSlash]

-    'cozy/*': all: devices.replication
-    #'cozy/*': all: devices.external #access couchdb directly
+    #'cozy/*': all: devices.replication
+    'cozy/*': all: devices.external #access couchdb directly

     '.well-known/host-meta.?:ext': get: experiment.webfingerHostMeta
     '.well-known/:module': all: experiment.webfingerAccount


FSFile:saveBinary: fix saveBinary implementation for new kites

--- client/finder/fs/fsfile.coffee
+++ client/finder/fs/fsfile.coffee
@@ -150,8 +150,6 @@
       @abortRequested = yes
       callback? null, abort: yes

-    kite = @getKite()
-
     iterateChunks = =>

       unless chunkQueue.length
@@ -169,10 +167,13 @@
         iterateChunks()
         return

-      kite.fsWriteFile {
-        path: FSHelper.plainPath @path
-        content, append
-      }
+      kite = @getKite().init()
+      .then =>
+
+        @getKite().fsWriteFile {
+          path: FSHelper.plainPath @path
+          content, append
+        }

       .then (res) =>
         @emit "ChunkUploaded", res


fix merge conflict

fix merge conflict

--- client/landing/includes.coffee
+++ client/landing/includes.coffee
@@ -161,7 +161,6 @@
   "app/MainApp/activitycontroller.coffee",
   "app/MainApp/notificationcontroller.coffee",
   "app/MainApp/linkcontroller.coffee",
-  "app/MainApp/paymentcontroller.coffee",
   "app/MainApp/oauthcontroller.coffee",

   # COMMON VIEWS


Replaced classregistry.coffee and some builder improvements.

--- client/landing/includes.coffee
+++ client/landing/includes.coffee
@@ -131,7 +131,6 @@
   "Framework/components/autocomplete/multipleinputview.coffee",
   "Framework/components/autocomplete/autocompletemisc.coffee",
   "Framework/components/autocomplete/autocompleteditems.coffee",
-  "Framework/classregistry.coffee",

   # --- Application ---
   "routes.coffee",


AccountSettings: Credentials: re-enable share functionality

--- client/account/lib/views/accountcredentiallistcontroller.coffee
+++ client/account/lib/views/accountcredentiallistcontroller.coffee
@@ -88,11 +88,11 @@
       fields            :
         username        :
           label         : "User"
-          # type          : "hidden"
-          # nextElement   :
-          #   userWrapper :
-          #     itemClass : KDView
-          #     cssClass  : "completed-items"
+          type          : "hidden"
+          nextElement   :
+            userWrapper :
+              itemClass : KDView
+              cssClass  : "completed-items"
         owner           :
           label         : "Give ownership"
           itemClass     : KodingSwitch
@@ -142,31 +142,31 @@

     {fields, inputs, buttons} = view.form

-    # @userController       = new KDAutoCompleteController
-    #   form                : view.form
-    #   name                : "username"
-    #   itemClass           : MemberAutoCompleteItemView
-    #   itemDataPath        : "profile.nickname"
-    #   outputWrapper       : fields.userWrapper
-    #   selectedItemClass   : MemberAutoCompletedItemView
-    #   listWrapperCssClass : "users"
-    #   submitValuesAsText  : yes
-    #   dataSource          : (args, callback)=>
-    #     {inputValue} = args
-    #     if /^@/.test inputValue
-    #       query = 'profile.nickname': inputValue.replace /^@/, ''
-    #       remote.api.JAccount.one query, (err, account)=>
-    #         if not account
-    #           @userController.showNoDataFound()
-    #         else
-    #           callback [account]
-    #     else
-    #       remote.api.JAccount.byRelevance inputValue, {}, (err, accounts)->
-    #         callback accounts
+    @userController       = new KDAutoCompleteController
+      form                : view.form
+      name                : "username"
+      itemClass           : MemberAutoCompleteItemView
+      itemDataPath        : "profile.nickname"
+      outputWrapper       : fields.userWrapper
+      selectedItemClass   : MemberAutoCompletedItemView
+      listWrapperCssClass : "users"
+      submitValuesAsText  : yes
+      dataSource          : (args, callback)=>
+        {inputValue} = args
+        if /^@/.test inputValue
+          query = 'profile.nickname': inputValue.replace /^@/, ''
+          remote.api.JAccount.one query, (err, account)=>
+            if not account
+              @userController.showNoDataFound()
+            else
+              callback [account]
+        else
+          remote.api.JAccount.byRelevance inputValue, {}, (err, accounts)->
+            callback accounts

-    # fields.username.addSubView userRequestLineEdit = @userController.getView()
-    # @userController.on "ItemListChanged", (count)->
-    #   userRequestLineEdit[if count is 0 then 'show' else 'hide']()
+    fields.username.addSubView userRequestLineEdit = @userController.getView()
+    @userController.on "ItemListChanged", (count)->
+      userRequestLineEdit[if count is 0 then 'show' else 'hide']()

     view.addSubView view.form


Client: Activity: Moved these deleted lines to channelParticipantAvatars component

--- client/activity/lib/components/dropbox/dropboxinputmixin.coffee
+++ client/activity/lib/components/dropbox/dropboxinputmixin.coffee
@@ -1,9 +1,6 @@
 kd            = require 'kd'
 React         = require 'kd-react'
 keyboardKeys  = require 'app/util/keyboardKeys'
-showError     = require 'app/util/showError'
-validator     = require 'validator'
-ActivityFlux  = require 'activity/flux'

 module.exports = DropboxInputMixin =
@@ -36,16 +33,6 @@

       dropdown.confirmSelectedItem()

-    else if @isGroupAdmin and @isGroupAdmin()
-
-      value        = event.target.value.trim()
-      isValidEmail = validator.isEmail value
-
-      return showError 'That doesn\'t seem like a valid email address.'  unless isValidEmail
-
-      ActivityFlux.actions.channel.inviteMember [{email: value}], =>
-        @setState value: ''
-

   onEsc: (event) -> @getDropdown().close()


fetchWhenOpen is now fetchOnSelect

fetchWhenOpen is now fetchOnSelect

--- client/lanes/access/screens/user-management/UserManagement.cjsx
+++ client/lanes/access/screens/user-management/UserManagement.cjsx
@@ -25,7 +25,7 @@
                 getSelection={@rolesForUser}
                 setSelection={@setRolesForUser}
                 choices={Lanes.Models.Role.all.models}
-                fetchWhenOpen={false}
+                fetchOnSelect={false}
                 name="role_names"
             />


bugfixes re: button state

bugfixes re: button state

--- common/lib/xmodule/xmodule/js/src/selfassessment/display.coffee
+++ common/lib/xmodule/xmodule/js/src/selfassessment/display.coffee
@@ -4,7 +4,7 @@
     @id = @el.data('id')
     @ajax_url = @el.data('ajax-url')
     @state = @el.data('state')
-    allow_reset = @el.data('allow_reset')
+    @allow_reset = @el.data('allow_reset')
     # valid states: 'initial', 'assessing', 'request_hint', 'done'

     # Where to put the rubric once we load it
@@ -14,17 +14,13 @@
     @rubric_wrapper = @$('.rubric-wrapper')
     @hint_wrapper = @$('.hint-wrapper')
     @message_wrapper = @$('.message-wrapper')
-    @check_button = @$('.submit-button')
+    @submit_button = @$('.submit-button')
     @reset_button = @$('.reset-button')
     @reset_button.click @reset

     @find_assessment_elements()
     @find_hint_elements()

-    if allow_reset
-      @reset_button.show()
-    else
-      @reset_button.hide()

     @rebind()

@@ -34,15 +30,25 @@

   rebind: () =>
     # rebind to the appropriate function for the current state
-    @check_button.unbind('click')
+    @submit_button.unbind('click')
+    @submit_button.show()
+    @reset_button.hide()
     if @state == 'initial'
-      @check_button.click @save_answer
+      @submit_button.prop('value', 'Submit')
+      @submit_button.click @save_answer
     else if @state == 'assessing'
-      @check_button.click @save_assessment
+      @submit_button.prop('value', 'Submit assessment')
+      @submit_button.click @save_assessment
     else if @state == 'request_hint'
-      @check_button.click @save_hint
+      @submit_button.prop('value', 'Submit hint')
+      @submit_button.click @save_hint
     else if @state == 'done'
-      @check_button.hide()
+      @submit_button.hide()
+      if @allow_reset
+        @reset_button.show()
+      else
+        @reset_button.hide()
+

   find_assessment_elements: ->
     @assessment = @$('select.assessment')
@@ -90,9 +96,8 @@
         if response.success
           @message_wrapper.html(response.message_html)
           @state = 'done'
+          @allow_reset = response.allow_reset
           @rebind()
-          if response.allow_reset
-            @reset_button.show()
         else
           @errors_area.html(response.message)
     else