Fix serial dot notation for past flights

--- js/script.coffee
+++ js/script.coffee
@@ -121,8 +121,8 @@
 			body += "#{p.rocket.rocket_name} #{p.rocket.rocket_type}#{if p.rocket.first_stage.cores[0].landing_vehicle then " to #{p.rocket.first_stage.cores[0].landing_vehicle} " else ' EXP '}"
 			for c in p.rocket.first_stage.cores
 			  body += "[#{c.core_serial or 'TBD'}] "
-				# body += ""
-				body += ""
+				body += ""
+				# body += ""
 			body += "	"
 			#
 			# CELL 4
@@ -150,8 +150,8 @@
 	table.appendChild tfoot
 	document.querySelector('#content').appendChild table
 	for core_id in core_reflown
-		loadJSON "{{ site.spacex_api }}?core_serial=#{core_id}&date=#{new_date}", cb_reflow
-		# loadJSON "{{ site.spacex_api }}?core_serial=#{core_id.split(".")[0]}&date=#{new_date}", cb_reflow
+		# loadJSON "{{ site.spacex_api }}?core_serial=#{core_id}&date=#{new_date}", cb_reflow
+		loadJSON "{{ site.spacex_api }}?core_serial=#{core_id.split(".")[0]}&date=#{new_date}", cb_reflow
 	console.log cap_reflown
 	for cap_id in cap_reflown
 		loadJSON "{{ site.spacex_api }}?cap_serial=#{cap_id}&date=#{new_date}", cb_reflow


render before img loaded as well

render before img loaded as well

--- js/static.coffee
+++ js/static.coffee
@@ -8,15 +8,23 @@
   PRINT = false

  renderWeb = (render) ->
+  _imagesLoaded = false
+  _count = 0
+  _interval = null
+
+  _render = ->
+   render.setFills()
+   if _imagesLoaded
+    _count++
+    if _count is 10
+     clearInterval _interval
+
+
   render.mediaLoaded ->
-   render.setFills()
-   n = 0
-   int = setInterval ->
-    render.setFills()
-    n++
-    if n is 10
-     clearInterval int
-   , 1000
+   _imagesLoaded = true
+   _render()
+
+  _interval = setInterval _render, 1000

  renderPrint = (render) ->
   render.mediaLoaded ->


replace pluck with map

replace pluck with map

--- client/angular/components/poll/dot_vote/vote_form/poll_dot_vote_vote_form.coffee
+++ client/angular/components/poll/dot_vote/vote_form/poll_dot_vote_vote_form.coffee
@@ -53,7 +53,7 @@
       prepareFn: ->
         EventBus.emit $scope, 'processing'
         $scope.stance.id = null
-        return unless _.sum(_.pluck($scope.stanceChoices, 'score')) > 0
+        return unless _.sum(_.map($scope.stanceChoices, 'score')) > 0
         $scope.stance.stanceChoicesAttributes = $scope.stanceChoices

     submitOnEnter $scope, element: $element


editable table leading row border

editable table leading row border

--- app/assets/javascripts/backbone_js/ladas_editable_table_aligner.js.coffee
+++ app/assets/javascripts/backbone_js/ladas_editable_table_aligner.js.coffee
@@ -48,7 +48,7 @@
       #$("#" + obj.form_id + "_ajax_content").find("tr.leading_tbody_row").remove()

       orig  = $("#" + obj.form_id).find('tr.filtering_tr')
-      new_tr = $('

').addClass("leading_tbody_row").css("height", "1px").css("border-width", "0").css("border", "0").attr("data-row-count-number", "leading_tbody_row")
+      new_tr = $('

').addClass("leading_tbody_row").css("height", "1px").css("background-color", "#CCC").css("border-width", "0").css("border", "0").attr("data-row-count-number", "leading_tbody_row")

       orig.each (index, element) =>
         $(element).find("th").each (td_index, td_element) =>


fix bug introduced when experimenting with logging

--- bokehjs/src/coffee/renderer/glyph/glyph.coffee
+++ bokehjs/src/coffee/renderer/glyph/glyph.coffee
@@ -302,21 +302,21 @@
     hit_test: (geometry) ->
       if geometry.type == "point"
         if @_hit_point?
-          result = @_hit_point(geometry)
+          return @_hit_point(geometry)
         else if not @_point_hit_warned?
           type = @mget('glyphspec').type
           logger.warn("'point' selection not available on #{type} renderer")
           @_point_hit_warned = true
-        return null
+          return null

       else if geometry.type == "rect"
         if @_hit_rect?
-          result = @_hit_rect(geometry)
+          return @_hit_rect(geometry)
         else if not @_rect_hit_warned?
           type = @mget('glyphspec').type
           logger.warn("'rect' selection not available on #{type} renderer")
           @_rect_hit_warned = true
-        return null
+          return null

       else
         logger.error("unrecognized selection geometry type '#{ geometry.type }'")


this check is enough

this check is enough

--- client/Framework/core/KD.coffee
+++ client/Framework/core/KD.coffee
@@ -107,7 +107,7 @@

     {callback, onFailMsg, onFail, silence, tryAgain} = options

-    unless KD.whoami() instanceof KD.remote.api.JAccount and KD.isLoggedIn()
+    unless KD.isLoggedIn()

       if onFailMsg
         new KDNotificationView


oauth: remove oauth enabled checker

oauth: remove oauth enabled checker

--- client/account/lib/index.coffee
+++ client/account/lib/index.coffee
@@ -15,7 +15,6 @@
 whoami                = require 'app/util/whoami'
 checkFlag             = require 'app/util/checkFlag'
 showError             = require 'app/util/showError'
-oauthEnabled          = require 'app/util/oauthEnabled'
 AppController         = require 'app/appcontroller'
 Encoder               = require 'htmlencode'
 require('./routehandler')()
@@ -54,8 +53,7 @@
       ]

-  if oauthEnabled() is yes
-    NAV_ITEMS.personal.items.push { slug : 'Externals',   title : "Linked accounts", listType: "linkedAccounts" }
+  NAV_ITEMS.personal.items.push { slug : 'Externals',   title : "Linked accounts", listType: "linkedAccounts" }

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


Avoid race condition for now.

Avoid race condition for now.

--- client/helpers/spendflow.coffee
+++ client/helpers/spendflow.coffee
@@ -69,13 +69,14 @@
 @showNavError = (message) ->
   showAlert(message, $(errorAlertSelector))

-Meteor.startup ->
-  # Send metadata to stuff
-  analytics.initialize {
-    'Errorception': {
-      meta: true
-    }
-  }
+# Race condition? Removed for now, opened
+#Meteor.startup ->
+#  # Send metadata to stuff
+#  analytics.initialize {
+#    'Errorception': {
+#      meta: true
+#    }
+#  }

 Deps.autorun ->
   currentUser = Meteor.user()


Create and append status bar widget in AppController.

We might need to find a better place for creating and appending that element.

--- client/ide/AppController.coffee
+++ client/ide/AppController.coffee
@@ -81,6 +81,9 @@
         splitView = panel.layout.getSplitViewByName 'BaseSplit'
         splitView.on 'ResizeDidStop', @bound 'handleResize'

+        splitViewPanel = ideView.parent.parent
+        splitViewPanel.addSubView @statusBar = new IDE.StatusBar
+
         appView.emit 'KeyViewIsSet'

   setActiveTabView: (tabView) ->


IDE: added initial chat api to the controller

--- client/ide/AppController.coffee
+++ client/ide/AppController.coffee
@@ -1010,3 +1010,33 @@
       object.emit 'RealTimeManagerSet'

     if @rtm?.isReady then callback() else @once 'RTMIsReady', => callback()
+
+
+
+  createChatPane: ->
+
+    @startSession (err, [channel]) =>
+
+      return KD.showError err  if err
+
+      @getView().addSubView @chat = new IDE.ChatView {}, channel
+      @chat.show()
+
+
+  showChat: ->
+
+    return @createChatPane()  unless @chat
+
+    @chat.show()
+
+
+  startSession: (callback) ->
+
+    {message} = KD.singletons.socialapi
+    nick      = KD.nick()
+
+    message.initPrivateMessage
+      body       : "@#{nick} initiated an IDE session."
+      recipients : [ nick ]
+    , callback
+


AppController: Put existence check in forEachSubViewInIDEViews_.

--- client/ide/AppController.coffee
+++ client/ide/AppController.coffee
@@ -583,7 +583,7 @@
       [paneType, callback] = [callback, paneType]

     for ideView in @ideViews
-      for pane in ideView.tabView.panes
+      for pane in ideView.tabView.panes when pane
         view = pane.getSubViews().first
         if paneType
           if view.getOptions().paneType is paneType


AppController: adhere to style

AppController: adhere to style

--- client/ide/AppController.coffee
+++ client/ide/AppController.coffee
@@ -201,9 +201,8 @@

     splitViewPanel = @activeTabView.parent.parent
     if splitViewPanel instanceof KDSplitViewPanel
-      layout = splitViewPanel._layout
-    else
-      layout = @layout
+    then layout = splitViewPanel._layout
+    else layout = @layout

     @activeTabView = null


AppController: Minor refactor for long method.

--- client/ide/AppController.coffee
+++ client/ide/AppController.coffee
@@ -906,25 +906,12 @@
     @rtm.getFile fileId

     @rtm.once 'FileLoaded', (doc) =>
+      nickname = KD.nick()
+      hostName = @collaborationHost
+
       @rtm.setRealtimeDoc doc
-      nickname           = KD.nick()
-      myWatchMapName     = "#{nickname}WatchMap"
-      mySnapshotName     = "#{nickname}Snapshot"
-      hostName           = @collaborationHost
-
-      @participants      = @rtm.getFromModel 'participants'
-      @changes           = @rtm.getFromModel 'changes'
-      @broadcastMessages = @rtm.getFromModel 'broadcastMessages'
-      @pingTime          = @rtm.getFromModel 'pingTime'
-      @myWatchMap        = @rtm.getFromModel myWatchMapName
-      @mySnapshot        = @rtm.getFromModel mySnapshotName
-
-      @participants      or= @rtm.create 'list',   'participants', []
-      @changes           or= @rtm.create 'list',   'changes', []
-      @broadcastMessages or= @rtm.create 'list',   'broadcastMessages', []
-      @pingTime          or= @rtm.create 'string', 'pingTime'
-      @myWatchMap        or= @rtm.create 'map',    myWatchMapName, {}
-      @mySnapshot        or= @rtm.create 'map',    mySnapshotName, @getWorkspaceSnapshot()
+
+      @setCollaborativeReferences()

       if @amIHost
         @getView().setClass 'host'
@@ -965,6 +952,27 @@
           @createPaneFromChange change

       KD.utils.repeat 60 * 55 * 1000, => @rtm.reauth()
+
+
+  setCollaborativeReferences: ->
+
+    nickname           = KD.nick()
+    myWatchMapName     = "#{nickname}WatchMap"
+    mySnapshotName     = "#{nickname}Snapshot"
+
+    @participants      = @rtm.getFromModel 'participants'
+    @changes           = @rtm.getFromModel 'changes'
+    @broadcastMessages = @rtm.getFromModel 'broadcastMessages'
+    @pingTime          = @rtm.getFromModel 'pingTime'
+    @myWatchMap        = @rtm.getFromModel myWatchMapName
+    @mySnapshot        = @rtm.getFromModel mySnapshotName
+
+    @participants      or= @rtm.create 'list',   'participants', []
+    @changes           or= @rtm.create 'list',   'changes', []
+    @broadcastMessages or= @rtm.create 'list',   'broadcastMessages', []
+    @pingTime          or= @rtm.create 'string', 'pingTime'
+    @myWatchMap        or= @rtm.create 'map',    myWatchMapName, {}
+    @mySnapshot        or= @rtm.create 'map',    mySnapshotName, @getWorkspaceSnapshot()

   registerCollaborationSessionId: ->


:libstick: Rename Menu toggle

:libstick: Rename Menu toggle

--- menus/cubic-bezier.cson
+++ menus/cubic-bezier.cson
@@ -1,4 +1,3 @@
-# See https://atom.io/docs/latest/creating-a-package#menus for more details
 'context-menu':
   '.overlayer':
       'Cubic Bezier': 'cubic-bezier:open'
@@ -9,7 +8,7 @@
     'submenu': [
       'label': 'Cubic Bezier'
       'submenu': [
-        { 'label': 'Open/Reset', 'command': 'cubic-bezier:open' }
+        { 'label': 'Toggle', 'command': 'cubic-bezier:open' }
       ]
     ]
   }


initial menu

initial menu

--- menus/julia-client.cson
+++ menus/julia-client.cson
@@ -1,22 +1,40 @@
-# See https://atom.io/docs/latest/hacking-atom-package-word-count#menus for more details
-# 'context-menu':
-#   'atom-text-editor': [
-#     {
-#       'label': 'Toggle julia-client'
-#       'command': 'julia-client:toggle'
-#     }
-#   ]
-# 'menu': [
-#   {
-#     'label': 'Packages'
-#     'submenu': [
-#       'label': 'julia-client'
-#       'submenu': [
-#         {
-#           'label': 'Toggle'
-#           'command': 'julia-client:toggle'
-#         }
-#       ]
-#     ]
-#   }
-# ]
+menu: [
+  {
+    label: 'Packages'
+    submenu: [{
+      label: 'Julia'
+      submenu: [
+        {label: 'Start Julia', command: 'julia-client:start-julia'}
+        {label: 'Stop Julia', command: 'julia-client:kill-julia'}
+        {label: 'Interrupt Julia', command: 'julia-client:interrupt-julia'}
+        {
+          label: 'Working Directory'
+          submenu: [
+            {label: 'Current File\'s Folder', command: 'julia-client:work-in-file-folder'}
+            {label: 'Current Project\'s Folder', command: 'julia-client:work-in-project-folder'}
+            {label: 'Home Folder', command: 'julia-client:work-in-home-folder'}
+          ]
+        }
+
+        {type: 'separator'}
+
+        {label: 'Evaluate', command: 'julia-client:evaluate'}
+        {label: 'Evaluate All', command: 'julia-client:evaluate-all'}
+        {label: 'Toggle Console', command: 'julia-client:toggle-console'}
+        {label: 'Clear Console', command: 'julia-client:clear-console'}
+
+        {type: 'separator'}
+
+        {label: 'Open Startup File', command: 'julia:open-startup-file'}
+        {label: 'Open Julia Home', command: 'julia:open-julia-home'}
+        {label: 'Open Package in New Window...', command: 'julia:open-package-in-new-window'}
+      ]
+    }]
+  }
+]
+
+'context-menu':
+  'atom-text-editor[data-grammar="source julia"]': [
+    {label: 'Evaluate', command: 'julia-client:evaluate'}
+    {type: 'separator'}
+  ]


BUGFIX: use slim arrow in main file

BUGFIX: use slim arrow in main file

--- lib/autocomplete-haskell.coffee
+++ lib/autocomplete-haskell.coffee
@@ -14,16 +14,14 @@
   provider: null

   activate: ->
-    @provider = new AutocompleteProvider unless @provider?
+    @provider = new AutocompleteProvider

   deactivate: ->
     @provider.dispose()
     @provider = null

-  autocompleteProvider_1_0_0: () =>
-    @provider = new AutocompleteProvider unless @provider?
+  autocompleteProvider_1_0_0: () ->
     {provider:@provider}

-  consumeGhcMod_0_1_0: (service) =>
-    @provider = new AutocompleteProvider unless @provider?
+  consumeGhcMod_0_1_0: (service) ->
     @provider.ghcModProvider service


KodingRouter: Minor MR fix. Removed bind.

--- client/landing/app/MainApp/kodingrouter.coffee
+++ client/landing/app/MainApp/kodingrouter.coffee
@@ -86,7 +86,7 @@
         appManager.open app, (appInstance)=>
           appInstance.setOption "initialRoute", @getCurrentPath()

-        handleQuery.call this  if appManager.get app
+        handleQuery()  if appManager.get app

   handleNotFound:(route)->


Fixed missing "throw"

Fixed missing "throw"

--- core/app/backbone/views/evidence/ndp_fact_relation_or_comment_view.coffee
+++ core/app/backbone/views/evidence/ndp_fact_relation_or_comment_view.coffee
@@ -14,4 +14,4 @@
     else if @model instanceof FactRelation
       @contentRegion.show new FactBaseView model: @model.getFact()
     else
-      "Invalid type of model: #{@model}"
+      throw "Invalid type of model: #{@model}"


bugfix: run processIncludedPoints() when removing points too

Former-commit-id: b77fce52cdd1edc0a656bb78634f511da796669f [formerly a1cfe9897e4e03713bdb215a480465dcd920dd4f] [formerly 2c4ba59a224a6a6e12457439312bd4e0fdee8ca2 [formerly 2c4ba59a224a6a6e12457439312bd4e0fdee8ca2 [formerly d3c29ac1467bbede0343f6aea24437bd109a515d]]]
Former-commit-id: 444c9ffc3d61e61a1e33a41afe818149ff2a8148 [formerly e3dc64ed6bc576a34eb1ef3e49fdcc069cbf1f2c]
Former-commit-id: 71ea771ed22eddead6e6a7e7c074e3de732e3ddc
Former-commit-id: 93445a686783161c4806f05aebeafe17ca58d4f7

--- app/assets/javascripts/backbone/apps/franklin/proposal/crafting/crafting_controller.coffee
+++ app/assets/javascripts/backbone/apps/franklin/proposal/crafting/crafting_controller.coffee
@@ -234,6 +234,7 @@
           model.trigger 'destroy', model, model.collection
           toastr.success 'Point deleted'

+      @layout.processIncludedPoints()
       @trigger 'point:removal', model


fixbug: 创建充值记录时提供一个非数字作为金额

fixbug: 创建充值记录时提供一个非数字作为金额

--- core/router/admin.coffee
+++ core/router/admin.coffee
@@ -1,4 +1,5 @@
 express = require 'express'
+_ = require 'underscore'

 {requestAdminAuthenticate, renderAccount} = require './middleware'

@@ -16,7 +17,10 @@
     unless account
       return res.error 'account_not_exist'

-    mAccount.incBalance account, 'deposit', parseFloat(req.body.amount),
+    amount = parseFloat req.body.amount
+    amount = 0 unless _.isNaN amount
+
+    mAccount.incBalance account, 'deposit', amount,
       type: req.body.type
       order_id: req.body.order_id
     , ->


Explicit m,s notation

Explicit m,s notation

--- client/rider/eta/etaTime.coffee
+++ client/rider/eta/etaTime.coffee
@@ -18,7 +18,7 @@
   # For short times, display seconds
   secs = duration.seconds()
   if secs < 0
-    return "0:00"
+    return "now"
   if secs < 10
-    return "#{duration.minutes()}:0#{secs}"
-  return "#{duration.minutes()}:#{secs}"
+    return "#{duration.minutes()}m 0#{secs}s"
+  return "#{duration.minutes()}m #{secs}s"


Use the new addModalPanel() method

Use the new addModalPanel() method

--- lib/command-palette-view.coffee
+++ lib/command-palette-view.coffee
@@ -1,5 +1,7 @@
 _ = require 'underscore-plus'
 {$, $$, SelectListView} = require 'atom'
+# {$, $$} = require 'space-pen'
+# {SelectListView} = require 'atom-space-pen-views'

 module.exports =
 class CommandPaletteView extends SelectListView
@@ -11,19 +13,26 @@
   initialize: ->
     super

-    @addClass('command-palette overlay from-top')
+    @addClass('command-palette')
     atom.workspaceView.command 'command-palette:toggle', => @toggle()

   getFilterKey: ->
     'displayName'

   toggle: ->
-    if @hasParent()
+    if @panel?.isVisible()
       @cancel()
     else
-      @attach()
+      @show()

-  attach: ->
+  detach: ->
+    # dont actually want to detach. @cancel() calls this.
+    @hide()
+
+  show: ->
+    @panel ?= atom.workspace.addModalPanel(item: this)
+    @panel.show()
+
     @storeFocusedElement()

     if @previouslyFocusedElement[0] and @previouslyFocusedElement[0] isnt document.body
@@ -42,10 +51,12 @@
     commands = _.sortBy(commands, 'displayName')
     @setItems(commands)

-    atom.workspaceView.append(this)
     @focusFilterEditor()

-  viewForItem: ({name, displayName}) ->
+  hide: ->
+    @panel?.hide()
+
+  viewForItem: ({name, displayName, eventDescription}) ->
     keyBindings = @keyBindings
     $$ ->
       @li class: 'event', 'data-event-name': name, =>


Don't show issue url if package repo isn't found

--- lib/deprecation-cop-view.coffee
+++ lib/deprecation-cop-view.coffee
@@ -58,10 +58,9 @@

   createIssueUrl: (packageName, deprecation, stack) ->
-    return '' unless pack = atom.packages.getActivePackage(packageName)
+    return unless repo = atom.packages.getActivePackage(packageName)?.metadata?.repository
+    repoUrl = repo.url ? repo

-    {metadata} = pack
-    repoUrl = metadata.repository?.url or metadata.repository
     title = "#{deprecation.getOriginName()} is deprecated."
     stacktrace = stack.map(({functionName, location}) -> "#{functionName} (#{location})").join("\n")
     body = "#{deprecation.getMessage()}\n```\n#{stacktrace}\n```"
@@ -98,7 +97,8 @@
                     @span class: 'icon icon-alert'
                     if packageName = self.getPackageName(stack)
                       @span packageName + " package (called #{_.pluralize(stack.callCount, 'time')})"
-                      @a href:self.createIssueUrl(packageName, deprecation, stack), "Create Issue on #{packageName} repo"
+                      if url = self.createIssueUrl(packageName, deprecation, stack)
+                        @a href:url, "Create Issue on #{packageName} repo"
                     else
                       @span "atom core"  + " (called #{_.pluralize(stack.callCount, 'time')})"


include module metadata plugin

include module metadata plugin

--- scripts/configs/aloha.coffee
+++ scripts/configs/aloha.coffee
@@ -67,6 +67,7 @@
         'oer/multipart'
         'oer/copy'
         'oer/cleanup'
+        'oer/metadata'
       ]

       # This whole thing is what's needed to:


Favicon colors.

Favicon colors.

--- app/assets/javascripts/_site.js.coffee
+++ app/assets/javascripts/_site.js.coffee
@@ -16,7 +16,9 @@
   messageTimeout: null
   swipe: false
   panel: 1
-  colorHash: new ColorHash()
+  colorHash: new ColorHash
+    lightness: [.3,.4,.5,.6,.7]
+    saturation: [.7,.8]

   hideTagsForm: ->
     tagsForm = $(".tags-form-wrap")
@@ -27,12 +29,11 @@
     field.blur()

   faviconColors: (target) ->
-    if feedbin && feedbin.data && feedbin.data.favicon_colors
-      $(".favicon-default", target).each ->
-        host = $(@).data("host")
-        color = feedbin.colorHash.hex(host)
-        $(@).css
-          "background-color": color
+    $(".favicon-default", target).each ->
+      host = $(@).data("host")
+      color = feedbin.colorHash.hex(host)
+      $(@).css
+        "background-color": color

   calculateColor: (backgroundColor, foregroundColor) ->
     canvas = document.createElement('canvas')
@@ -924,15 +925,6 @@
     modal.modal('show')
     modalClass

-  modal: (selector, cssClass = null) ->
-    activeModal = $(selector)
-    $('.modal').each ->
-      unless $(@).get(0) == activeModal.get(0)
-        $(@).modal('hide')
-    activeModal.modal('toggle')
-    if cssClass
-      activeModal.addClass(cssClass)
-
   loadLink: (href) ->
     form = $("[data-behavior~=view_link_form]")
     $("#url", form).val(href)
@@ -967,8 +959,6 @@
   entries: {}

   feedCandidates: []
-
-  modalShowing: false

   images: []


fix clicking to edit.

fix clicking to edit.

--- app/assets/javascripts/notes.js.coffee
+++ app/assets/javascripts/notes.js.coffee
@@ -5,9 +5,9 @@
 jQuery ->

   # $(".best_in_place").best_in_place();
-  $(".note").click ->
-    $(this).find('.content').toggle()
-    $(this).find('form').toggle()
+  $(".content").click ->
+    $(this).toggle()
+    $(this).siblings("form").toggle()
     $(this).find('textarea').focus()
     # textarea = "<textarea style='width: #{content.width() - 12}px; height: #{content.height()}px;'>"
     # textarea += content.text()


Trying to fix a bug in IE8!

Trying to fix a bug in IE8!

--- core/app/assets/javascripts/base/topbar.coffee
+++ core/app/assets/javascripts/base/topbar.coffee
@@ -6,8 +6,10 @@
   $('body').animate marginTop: 0, 'slow'
   $top_bar.fadeOut "slow"
   $earth.animate marginTop: 104, 'slow'
+  $('input, textarea').placeholder()

 $dimmed_top_bar.on 'click', 'a.sign_in', ->
   $('body').animate marginTop: -160, 'slow'
   $top_bar.fadeIn "slow"
   $earth.animate marginTop: 0, 'slow'
+  $('input, textarea').placeholder()


Most of file upload on Cordova #253

Most of file upload on Cordova #253

--- lib/files.coffee
+++ lib/files.coffee
@@ -1,3 +1,9 @@
+corsHandler = (req, res, next) ->
+  if req.headers?.origin
+    res.setHeader 'Access-Control-Allow-Origin', req.headers.origin
+    res.setHeader 'Access-Control-Allow-Credentials', true
+  next()
+
 @Files = FileCollection
   resumable: true
   resumableIndexName: 'files'
@@ -6,6 +12,29 @@
     path: '/id/:_id'
     lookup: (params, query) ->
       _id: params._id
+    handler: corsHandler
+  ,
+    method: 'post'
+    path: '/_resumable'
+    lookup: -> {}
+    handler: corsHandler
+  ,
+    method: 'head'
+    path: '/_resumable'
+    lookup: -> {}
+    handler: corsHandler
+  ,
+    method: 'options'
+    path: '/_resumable'
+    lookup: -> {}
+    handler: (req, res, next) ->
+      res.writeHead 200,
+        'Content-Type': 'text/plain'
+        'Access-Control-Allow-Origin': req.headers.origin
+        'Access-Control-Allow-Credentials': true
+        'Access-Control-Allow-Headers': 'x-auth-token, user-agent'
+        'Access-Control-Allow-Methods': 'GET, POST, HEAD, OPTIONS'
+      res.end()
   ]

 if Meteor.isServer


log only if debug true

log only if debug true

--- packages/rocketchat-hubot/hubot.coffee
+++ packages/rocketchat-hubot/hubot.coffee
@@ -146,7 +146,7 @@
 				console.error "Hubot error: #{err}" if DEBUG
 				robot.logger.error "RocketChat send error: #{err}"

-RocketBot = new Robot null, null, false, Meteor.settings?.botname ? 'rocketbot'
+RocketBot = new Robot null, null, false, 'rocketbot'
 RocketBot.alias = 'bot'
 RocketBot.adapter = new RocketChatAdapter RocketBot
 HubotScripts(RocketBot)


fixed adding external scripts

fixed adding external scripts

--- packages/rocketchat-hubot/hubot.coffee
+++ packages/rocketchat-hubot/hubot.coffee
@@ -41,6 +41,99 @@
 	error: (callback) -> super Meteor.bindEnvironment(callback)
 	catchAll: (callback) -> super Meteor.bindEnvironment(callback)

+class RocketChatAdapter extends Hubot.Adapter
+	# Public: Raw method for sending data back to the chat source. Extend this.
+	#
+	# envelope - A Object with message, room and user details.
+	# strings  - One or more Strings for each message to send.
+	#
+	# Returns nothing.
+	send: (envelope, strings...) ->
+		sendHelper @robot, envelope, strings, (string) =>
+			console.log "send #{envelope.rid}: #{string} (#{envelope.u.username})" if DEBUG
+			return @priv envelope, string if envelope.message.private
+			Meteor.call "sendMessage",
+				u:
+					username: "rocketbot"
+				msg: string
+				rid: envelope.rid
+
+	# Public: Raw method for sending emote data back to the chat source.
+	#
+	# envelope - A Object with message, room and user details.
+	# strings  - One or more Strings for each message to send.
+	#
+	# Returns nothing.
+	emote: (envelope, strings...) ->
+		sendHelper @robot, envelope, strings, (string) =>
+			console.log "emote #{envelope.rid}: #{string} (#{envelope.u.username})" if DEBUG
+			return @priv envelope, "*** #{string} ***" if envelope.message.private
+			Meteor.call "sendMessage",
+				u:
+					username: "rocketbot"
+				msg: string
+				rid: envelope.rid
+				action: true
+
+	# Priv: our extension -- send a PM to user
+	priv: (envelope, strings...) ->
+		sendHelper @robot, envelope, strings, (string) ->
+			console.log "priv #{envelope.rid}: #{string} (#{envelope.u.username})" if DEBUG
+			Meteor.call "sendMessage",
+				u:
+					username: "rocketbot"
+				to: "#{envelope.u.username}"
+				msg: string
+				rid: envelope.rid
+
+	# Public: Raw method for building a reply and sending it back to the chat
+	# source. Extend this.
+	#
+	# envelope - A Object with message, room and user details.
+	# strings  - One or more Strings for each reply to send.
+	#
+	# Returns nothing.
+	reply: (envelope, strings...) ->
+		if envelope.message.private
+			@priv envelope, strings...
+		else
+			@send envelope, strings.map((str) -> "#{envelope.u.username}: #{str}")...
+
+	# Public: Raw method for setting a topic on the chat source. Extend this.
+	#
+	# envelope - A Object with message, room and user details.
+	# strings  - One more more Strings to set as the topic.
+	#
+	# Returns nothing.
+	topic: (envelope, strings...) ->
+
+	# Public: Raw method for playing a sound in the chat source. Extend this.
+	#
+	# envelope - A Object with message, room and user details.
+	# strings  - One or more strings for each play message to send.
+	#
+	# Returns nothing
+	play: (envelope, strings...) ->
+
+	# Public: Raw method for invoking the bot to run. Extend this.
+	#
+	# Returns nothing.
+	run: ->
+
+	# Public: Raw method for shutting the bot down. Extend this.
+	#
+	# Returns nothing.
+	close: ->
+
+class RocketBotReceiver
+	constructor: (message) ->
+		RocketBotUser = new Hubot.User(message.u.username, rid: message.rid)
+		RocketBotTextMessage = new Hubot.TextMessage(RocketBotUser, message.msg, message._id)
+		RocketBot.adapter.receive RocketBotTextMessage
+		console.log 'message: ', message if DEBUG
+		console.log 'RocketBot: ', RocketBot if DEBUG
+		return message
+
 sendHelper = Meteor.bindEnvironment (robot, envelope, strings, map) ->
 	while strings.length > 0
 		string = strings.shift()
@@ -53,101 +146,11 @@
 				console.error "Hubot error: #{err}" if DEBUG
 				robot.logger.error "RocketChat send error: #{err}"

-class RocketChatAdapter extends Hubot.Adapter
-	# Public: Raw method for sending data back to the chat source. Extend this.
-	#
-	# envelope - A Object with message, room and user details.
-	# strings  - One or more Strings for each message to send.
-	#
-	# Returns nothing.
-	send: (envelope, strings...) ->
-		sendHelper @robot, envelope, strings, (string) =>
-			console.log "send #{envelope.rid}: #{string} (#{envelope.u.username})" if DEBUG
-			return @priv envelope, string if envelope.message.private
-			Meteor.call "sendMessage",
-				u:
-					username: "rocketbot"
-				msg: string
-				rid: envelope.rid
-
-	# Public: Raw method for sending emote data back to the chat source.
-	#
-	# envelope - A Object with message, room and user details.
-	# strings  - One or more Strings for each message to send.
-	#
-	# Returns nothing.
-	emote: (envelope, strings...) ->
-		sendHelper @robot, envelope, strings, (string) =>
-			console.log "emote #{envelope.rid}: #{string} (#{envelope.u.username})" if DEBUG
-			return @priv envelope, "*** #{string} ***" if envelope.message.private
-			Meteor.call "sendMessage",
-				u:
-					username: "rocketbot"
-				msg: string
-				rid: envelope.rid
-				action: true
-
-	# Priv: our extension -- send a PM to user
-	priv: (envelope, strings...) ->
-		sendHelper @robot, envelope, strings, (string) ->
-			console.log "priv #{envelope.rid}: #{string} (#{envelope.u.username})" if DEBUG
-			Meteor.call "sendMessage",
-				u:
-					username: "rocketbot"
-				to: "#{envelope.u.username}"
-				msg: string
-				rid: envelope.rid
-
-	# Public: Raw method for building a reply and sending it back to the chat
-	# source. Extend this.
-	#
-	# envelope - A Object with message, room and user details.
-	# strings  - One or more Strings for each reply to send.
-	#
-	# Returns nothing.
-	reply: (envelope, strings...) ->
-		if envelope.message.private
-			@priv envelope, strings...
-		else
-			@send envelope, strings.map((str) -> "#{envelope.u.username}: #{str}")...
-
-	# Public: Raw method for setting a topic on the chat source. Extend this.
-	#
-	# envelope - A Object with message, room and user details.
-	# strings  - One more more Strings to set as the topic.
-	#
-	# Returns nothing.
-	topic: (envelope, strings...) ->
-
-	# Public: Raw method for playing a sound in the chat source. Extend this.
-	#
-	# envelope - A Object with message, room and user details.
-	# strings  - One or more strings for each play message to send.
-	#
-	# Returns nothing
-	play: (envelope, strings...) ->
-
-	# Public: Raw method for invoking the bot to run. Extend this.
-	#
-	# Returns nothing.
-	run: ->
-
-	# Public: Raw method for shutting the bot down. Extend this.
-	#
-	# Returns nothing.
-	close: ->
-
-class RocketBotReceiver
-	constructor: (message) ->
-		RocketBotUser = new Hubot.User(message.u.username, rid: message.rid)
-		RocketBotTextMessage = new Hubot.TextMessage(RocketBotUser, message.msg, message._id)
-		RocketBot.adapter.receive RocketBotTextMessage
-		console.log RocketBot;
-		return message
-
 RocketBot = new Robot null, null, false, Meteor.settings?.botname ? 'rocketbot'
 RocketBot.alias = 'bot'
 RocketBot.adapter = new RocketChatAdapter RocketBot
+HubotScripts(RocketBot)
+
 RocketChat.callbacks.add 'afterSaveMessage', RocketBotReceiver, RocketChat.callbacks.priority.LOW

 # Meteor.startup ->


add alerts for change of tutor roles

add alerts for change of tutor roles

--- src/app/units/partials/directives/unit-contexts.coffee
+++ src/app/units/partials/directives/unit-contexts.coffee
@@ -124,14 +124,17 @@
   replace: true
   restrict: 'E'
   templateUrl: 'units/partials/templates/staff-admin-context.tpl.html'
-  controller: ($scope, $rootScope, Unit, UnitRole) ->
+  controller: ($scope, $rootScope, Unit, UnitRole, alertService) ->
     temp = []
     users = []

     $scope.changeRole = (unitRole, role_id) ->
       unitRole.role_id = role_id
       unitRole.unit_id = $scope.unit.id
-      UnitRole.update { id: unitRole.id, unit_role: unitRole }
+      UnitRole.update { id: unitRole.id, unit_role: unitRole },
+        (response) -> alertService.add("success", "Role changed", 2000)
+        (response) ->
+          alertService.add("danger", response.data.error, 6000)

     $scope.addSelectedStaff = ->
       staff = $scope.selectedStaff


Fix `becomes` listener was always called

--- src/resources/forms/orbeon/builder/resources/section-grid-repeat/position.coffee
+++ src/resources/forms/orbeon/builder/resources/section-grid-repeat/position.coffee
@@ -55,7 +55,7 @@
         currentValue = null
         (newValue) ->
             if newValue?
-                if currentValue is null or newValue.el != currentValue.el
+                if currentValue is null or not f$.is newValue.el, currentValue.el
                     was currentValue if currentValue?
                     currentValue = newValue
                     becomes newValue


WIP on jPlayer

WIP on jPlayer

--- app/assets/javascripts/rglossa/speech/components/centre/results/jplayer.jsx.coffee
+++ app/assets/javascripts/rglossa/speech/components/centre/results/jplayer.jsx.coffee
@@ -2,37 +2,39 @@

 window.Jplayer = React.createClass
   componentDidMount: ->
+    $node = $(@getDOMNode())
+    mediaObj = @props.mediaObj
     @textBox = @createTextBox()

     $(document).tooltip
-      content: -> $(@).prop('title')
-
-    mov = @mediaObj.mov.movie_loc
-    path = @mediaObj.mov.path
-    supplied = @mediaObj.mov.supplied
-    $("#movietitle").text(@mediaObj.title)
-    last_line = parseInt(@mediaObj.last_line)
-
-    @textBox.init(@, @mediaObj)
-
-    @textBox.currentID = parseInt(@mediaObj.start_at)
-
-    start = parseInt(@mediaObj.start_at)
-    stop  = parseInt(@mediaObj.end_at)
+      content: -> $node.prop('title')
+
+    mov = mediaObj.mov.movie_loc
+    path = mediaObj.mov.path
+    supplied = mediaObj.mov.supplied
+    $("#movietitle").text(mediaObj.title)
+    last_line = parseInt(mediaObj.last_line)
+
+    @textBox.init($node, mediaObj)
+
+    @textBox.currentID = parseInt(mediaObj.start_at)
+
+    start = parseInt(mediaObj.start_at)
+    stop  = parseInt(mediaObj.end_at)
     @textBox.redraw(start,stop, last_line)
     start = parseFloat($("#jp-"+start).data("start_timecode"))
     stop  = parseFloat($("#jp-"+stop).data("end_timecode"))

-    console.log(@mediaObj)
-
-    @$(".jp-jplayer").jPlayer
+    console.log(mediaObj)
+
+    $node.find(".jp-jplayer").jPlayer
       solution: "flash, html"
       ready: ->
-        $(@).jPlayer "setMedia",
+        $node.jPlayer "setMedia",
           rtmpv: path + mov
           m4v: path+mov
           poster: "assets/rglossa/speech/_6.6-%27T%27_ligo.skev.graa.jpg"
-        $(@).jPlayer( "play", start)
+        $node.jPlayer( "play", start)

       timeupdate: (event) =>
         ct = event.jPlayer.status.currentTime
@@ -82,7 +84,7 @@
     currentEndTime:0
     currentStartTime:0

-    init: (view, mediaObj) ->
+    init: ($view, mediaObj) ->
       display_attribute = mediaObj.display_attribute
       annotation = mediaObj.divs.annotation
       @start_at_line = parseInt(mediaObj.start_at)
@@ -102,7 +104,7 @@
         .attr("id", 'jp-' + n)
         .data("start_timecode",timecode)
         .data("end_timecode",end_timecode)
-        .on "click", (e) -> alert($(@).data("start_timecode")+" id:"+$(@).attr("id"))
+        .on "click", (e) -> alert($view.data("start_timecode")+" id:"+$view.attr("id"))

         if n < @start_at_line or n > @end_at_line
           div.css({"display":"none"})
@@ -149,7 +151,7 @@

         div.append(speakerDiv)
         div.append(segmentDiv)
-        view.$('.jplayer-text').append(div)
+        $view.find('.jplayer-text').append(div)

     redraw: (first, last, last_line) ->
@@ -197,7 +199,7 @@

-                 <object id="jp_flash_1" name="jp_flash_1" data="assets/rglossa/speech/Jplayer.swf" type="application/x-shockwave-flash" width="1" height="1" tabIndex="-1" style={{width: 1, height: 1}}>
+                 <object id="jp_flash_1" name="jp_flash_1" data="Jplayer.swf" type="application/x-shockwave-flash" width="1" height="1" tabIndex="-1" style={{width: 1, height: 1}}>
                      <param name="flashvars" value="jQuery=jQuery&id=jplayer&vol=0.8&muted=false" />
                      <param name="allowscriptaccess" value="always" />
                      <param name="bgcolor" value="#000000" />


fix event name showing event type in doc library

--- app/assets/javascripts/species/views/documents/document_result_component.js.coffee
+++ app/assets/javascripts/species/views/documents/document_result_component.js.coffee
@@ -20,13 +20,11 @@
   ).on("init")

   meetingTitle: ( ->
-    eventName = @get('doc.event_type')
-
-    if eventName == 'IdMaterials'
+    if @get('doc.event_type') == 'IdMaterials'
       return ''

-    return eventName
-  ).property('doc.event_type')
+    return @get('doc.event_name')
+  ).property('doc.event_type', 'doc.event_name')

   date: ( ->
     date = @get('doc.date')


build-zipタスクのサブタスクに、フック用のタスクを追加

build-zipタスクのサブタスクに、フック用のタスクを追加

--- lib/index.coffee
+++ lib/index.coffee
@@ -15,34 +15,74 @@

 module.exports = class Lamjet
   @setup: (gulp)->
+    gulp.task "before-clean", ->
+      # nop
+
     gulp.task "clean", (callback)->
       del(["./out", "./out.zip"], callback)
+
+    gulp.task "after-clean", ->
+      # nop
+
+    gulp.task "before-compile", ->
+      # nop

     gulp.task "compile", ->
       gulp.src("./src/**/*.coffee")
         .pipe(coffee()).on("error", gutil.log)
         .pipe(gulp.dest("./out"))

+    gulp.task "after-compile", ->
+      # nop
+
+    gulp.task "before-copy-package-json", ->
+      # nop
+
     gulp.task "copy-package-json", ->
       gulp.src("./package.json").
         pipe(gulp.dest("./out"))

+    gulp.task "after-copy-package-json", ->
+      # nop
+
+    gulp.task "before-install-dependencies", ->
+      # nop
+
     gulp.task "install-dependencies", ->
       gulp.src("./out/package.json")
         .pipe(install({production: true}))
+
+    gulp.task "after-install-dependencies", ->
+      # nop
+
+    gulp.task "before-archive-to-zip", ->
+      # nop

     gulp.task "archive-to-zip", ->
       gulp.src(["out/**/*"])
         .pipe(zip("out.zip"))
         .pipe(gulp.dest("./"))

+    gulp.task "after-archive-to-zip", ->
+      # nop
+
     gulp.task "build-zip", (callback)->
       return runSequence(
+        ["before-clean"],
         ["clean"],
+        ["after-clean"],
+        ["before-compile"],
         ["compile"],
+        ["after-compile"],
+        ["before-copy-package-json"],
         ["copy-package-json"],
+        ["after-copy-package-json"],
+        ["before-install-dependencies"],
         ["install-dependencies"],
+        ["after-install-dependencies"],
+        ["before-archive-to-zip"],
         ["archive-to-zip"],
+        ["after-archive-to-zip"],
         callback)

     gulp.task "deploy-to-aws-lambda", (callback)->


add more comments around what paramters to join do

--- lib/index.coffee
+++ lib/index.coffee
@@ -54,9 +54,9 @@
         '-2', '1'           # ...to the first field from the right file
         '-t', options.delim # Use delim as the delimiter in input and output
       ]
-      spawn_opts.push '-a1' if options.type in ['left', 'full']
-      spawn_opts.push '-a2' if options.type in ['right', 'full']
-      spawn_opts.push file_names...
+      spawn_opts.push '-a1' if options.type in ['left', 'full'] # Keep unpaired lines from left
+      spawn_opts.push '-a2' if options.type in ['right', 'full'] # Keep unpaired lines from right
+      spawn_opts.push file_names... # Files to join

       # console.log "FILE NAMES:", file_names
       # console.log "SPAWN OPTS: join", spawn_opts.join ' '


fix bug in hook function

fix bug in hook function

--- lib/index.coffee
+++ lib/index.coffee
@@ -85,7 +85,7 @@

     apply_hook = (obj) ->
       if not obj.options.hook then return obj
-      obj.data = obj.options.hook(response)
+      obj.data = obj.options.hook(obj.data)
       return obj

     ###*
@@ -101,9 +101,13 @@
      * This needs to be gutted and refactored still
     ###

-    compile_single_views = (collection, template, out_fn) ->
-      if not _.isArray(collection)
-        throw new Error "collection must return an array"
+    compile_single_views = (obj) ->
+      if not obj.template or not obj.out then return
+
+      if obj.template and not obj.out
+        throw new Error("You must also provide an 'out' option")
+      if obj.out and not obj.template
+        throw new Error("You must also provide a 'template' option")

       W.map collection, (item) =>
         @roots.config.locals.item = item


Always hide the default Artsy logo header in the microsite context

--- lib/middleware/microsite.coffee
+++ lib/middleware/microsite.coffee
@@ -27,5 +27,6 @@

     res.locals.sd.MICROSITE_FAIR      = fair.toJSON()
     res.locals.sd.MICROSITE_PROFILE   = profile.toJSON()
+    res.locals.sd.HIDE_HEADER         = true

   next()


Test for long sequences (5, 6 or 7 bytes)

--- test/long.coffee
+++ test/long.coffee
@@ -5,3 +5,25 @@

 describe 'Long sequences', ->
   it 'are invalid', ->
+    (5*i+1 for i in [5..6])
+    .concat [32]
+    .map (bits)->
+      (2 << bits - 1) - 1 >>> 0
+    .reduce (ranges, n)->
+      res = if ranges.length
+        ranges
+      else
+        []
+      res.push
+        max: n
+        min: if ranges.length
+          ranges[ranges.length - 1].max
+        else
+          ranges
+      res
+    .forEach (range)->
+       for i in [1..108]
+         z = random range.min+1, range.max
+         assert utf8.valid q = utf8 z
+         assert z == utf8.code q
+         random.test4 false, q


ComputeProvider: no need to update domains anymore [completes #90733584]

--- workers/social/lib/social/models/computeproviders/computeprovider.coffee
+++ workers/social/lib/social/models/computeproviders/computeprovider.coffee
@@ -329,55 +329,23 @@
     JAccount.on 'UsernameChanged', ({ oldUsername, username, isRegistration })->

       return  unless oldUsername and username
+      return  if isRegistration

       JMachine = require './machine'

-      unless isRegistration
-
-        console.log "Removing user #{oldUsername} vms..."
-
-        JMachine.update
-          provider      : 'koding'
-          credential    : oldUsername
-        ,
-          $set          :
-            userDeleted : yes
-        ,
-          multi         : yes
-        , (err)->
-          if err?
-            console.error \
-              "Failed to mark them as deleted for #{oldUsername}:", err
-
-        return
-
-
-      oldDomain = "#{oldUsername}.#{KONFIG.userSitesDomain}"
-
-      JMachine.one
-
-        provider : 'koding'
-        domain   : ///#{oldDomain}$///
-
-      , (err, machine)->
-
-        if err? or not machine
-          # discard any error or not found cases
-          # console.log "Failed to find machine for #{username}", err
-        else
-
-          newDomain = "#{machine.uid}.#{username}.#{KONFIG.userSitesDomain}"
-
-          machine.update
-
-            $set         :
-              domain     : newDomain
-              credential : username
-
-          , (err)->
-
-            unless err
-              console.log """Machine domain updated for #{username}
-                             from *.#{oldDomain} to #{newDomain}"""
-            else
-              console.log "Failed to update machine domain for #{username}", err
+      console.log "Removing user #{oldUsername} vms..."
+
+      JMachine.update
+        provider      : $in: ['koding', 'managed']
+        credential    : oldUsername
+      ,
+        $set          :
+          userDeleted : yes
+      ,
+        multi         : yes
+      , (err)->
+        if err?
+          console.error \
+            "Failed to mark them as deleted for #{oldUsername}:", err
+
+      return


grid: removed unused class

grid: removed unused class

--- app/_src/components/grid.coffee
+++ app/_src/components/grid.coffee
@@ -31,7 +31,6 @@
 	CLASS_IMG = 'team-grid__image'
 	CLASS_ANCHOR = 'team-grid__link'
 	CLASS_ANIMATE_ITEM = 'team-grid__item--animate'
-	CLASS_SPINNER_INACTIVE = 'spinner--inactive'
 	CLASS_READY = 'grid-show'

 	IS_GRID_REPEATABLE = false


ComputeProvider: createGroupStack: keep createdStack as a global variable and use it for callback

--- workers/social/lib/social/models/computeproviders/computeprovider.coffee
+++ workers/social/lib/social/models/computeproviders/computeprovider.coffee
@@ -412,6 +412,7 @@
     options      ?= {}
     res           = {}
     instanceCount = 0
+    createdStack  = null

     { template, account, group } = {}

@@ -419,7 +420,8 @@

       (next) ->
         fetchGroupStackTemplate client, (err, _res) ->
-          { template, account, group } = res = _res
+          unless err
+            { template, account, group } = res = _res
           next err

       (next) ->
@@ -449,9 +451,11 @@
                 group, change: 'decrement', instanceCount
               }, -> next err
           else
-            next null, stack
-
-    ], callback
+            createdStack = stack
+            next()
+
+    ], (err) ->
+      callback err, createdStack

   do ->


ComputeProvider:create shouldReviveProvisioners

--- workers/social/lib/social/models/computeproviders/computeprovider.coffee
+++ workers/social/lib/social/models/computeproviders/computeprovider.coffee
@@ -72,7 +72,8 @@

   @create = revive

-    shouldReviveClient   : yes
+    shouldReviveClient       : yes
+    shouldReviveProvisioners : yes

   , (client, options, callback)->


woops forgot to inject UserRecordsInterface

--- app/angular-record-store.coffee
+++ app/angular-record-store.coffee
@@ -10,7 +10,7 @@
 # $compile is a joke, actually $upload (current version used is 3.x, need to update, might not even need to use)
 app.factory('RestfulClient', ['$http', '$compile', AngularRecordStore.RestfulClient])

-app.factory 'Records', (RecordStore, GroupRecordsInterface, BucketRecordsInterface) ->
+app.factory 'Records', (RecordStore, GroupRecordsInterface, BucketRecordsInterface, UserRecordsInterface) ->
   db = new Loki('cobudgetApp')
   recordStore = new RecordStore(db)
   recordStore.addRecordsInterface(GroupRecordsInterface)


Minor fixes to Popup

Minor fixes to Popup

--- lib/Popup.coffee
+++ lib/Popup.coffee
@@ -3,7 +3,7 @@
 # Keeps track of unique IDs for popup-enabled elements, to allow closing
 # of the popup, in the event of a second click on the associated element
 popupID = -1
-popupIDs = 0
+popupIDs = 1

 # Keeps track of callback function to execute on closing the popup
 popupCloseCallback = null
@@ -36,7 +36,7 @@
     options.close.call element, element if options.close
     display.release() if display.release

-  if display instanceof ST.View
+  if ST.View && (display instanceof ST.View)
     display.load()
     popup.append display.element()
   else


Fix: Legacy "popup" and "closePopup" methods don't work.

--- lib/Popup.coffee
+++ lib/Popup.coffee
@@ -92,8 +92,8 @@
     'Popup'
 }

-window.closePopup = Popup.close
-window.popup = Popup.show
+window.closePopup = -> Popup.close()
+window.popup = -> Popup.show()

 # Associates a popup menu with selected elements.
 # items   Items for menu, see #popup


:bug: Fix deserialization

:bug: Fix deserialization

--- lib/about.coffee
+++ lib/about.coffee
@@ -12,8 +12,7 @@

 atom.deserializers.add
   name: 'AboutView'
-  version: 1
-  deserialize: createAboutView
+  deserialize: (state) -> createAboutView(state)

 module.exports = About =
   activate: ->


Added tests for file compress as zip and targz

--- client/test/lib/ide/file.coffee
+++ client/test/lib/ide/file.coffee
@@ -125,3 +125,59 @@
     ideHelpers.openFile(browser, user, fileName)

     browser.end()
+
+
+  compressFileZip: (browser) ->
+
+    user = helpers.beginTest(browser)
+    helpers.waitForVMRunning(browser)
+
+    fileName        = helpers.createFile(browser, user)
+    webPath         = '/home/' + user.username + '/Web'
+    fileSelector    = "span[title='" + webPath + '/' + fileName + "']"
+    submenuSelector = 'li.as-zip'
+    newFile         = "span[title='" + webPath + '/' + fileName + ".zip']"
+
+    browser
+      .waitForElementPresent     fileSelector, 20000
+      .click                     fileSelector
+      .click                     fileSelector + ' + .chevron'
+      .waitForElementVisible     'li.compress', 20000
+      .click                     'li.compress'
+      .waitForElementVisible     submenuSelector, 20000
+      .click                     submenuSelector
+      .pause                     2000
+      .waitForElementPresent     newFile, 20000 # Assertion
+
+    helpers.deleteFile(browser, fileSelector)
+    helpers.deleteFile(browser, newFile)
+
+    browser.end()
+
+
+  compressFileTarGz: (browser) ->
+
+    user = helpers.beginTest(browser)
+    helpers.waitForVMRunning(browser)
+
+    fileName        = helpers.createFile(browser, user)
+    webPath         = '/home/' + user.username + '/Web'
+    fileSelector    = "span[title='" + webPath + '/' + fileName + "']"
+    submenuSelector = 'li.as-targz'
+    newFile         = "span[title='" + webPath + '/' + fileName + ".tar.gz']"
+
+    browser
+      .waitForElementPresent     fileSelector, 20000
+      .click                     fileSelector
+      .click                     fileSelector + ' + .chevron'
+      .waitForElementVisible     'li.compress', 20000
+      .click                     'li.compress'
+      .waitForElementVisible     submenuSelector, 20000
+      .click                     submenuSelector
+      .pause                     2000
+      .waitForElementPresent     newFile, 20000 # Assertion
+
+    helpers.deleteFile(browser, fileSelector)
+    helpers.deleteFile(browser, newFile)
+
+    browser.end()


Spacing between functions

Spacing between functions

--- app/javascript/src/classes/note.coffee
+++ app/javascript/src/classes/note.coffee
@@ -43,11 +43,14 @@
     @elements.body.observe 'mouseout', @bodyHideTimer.bindAsEventListener(this)
     @elements.body.observe 'click', @showEditBox.bindAsEventListener(this)
     @adjustScale()
-    return
+
+
   textValue: ->
     if notesManager.debug
       console.debug 'Note#textValue (id=%d)', @id
     @old.raw_body.strip()
+
+
   hideEditBox: (e) ->
     if notesManager.debug
       console.debug 'Note#hideEditBox (id=%d)', @id
@@ -61,6 +64,8 @@
       $('note-history-' + boxid).stopObserving()
       $('edit-box').remove()
     return
+
+
   showEditBox: (e) ->
     if notesManager.debug
       console.debug 'Note#showEditBox (id=%d)', @id
@@ -87,6 +92,8 @@
     $('note-history-' + @id).observe 'click', @history.bindAsEventListener(this)
     $('edit-box-text').focus()
     return
+
+
   bodyShow: (e) ->
     if notesManager.debug
       console.debug 'Note#bodyShow (id=%d)', @id
@@ -184,11 +191,15 @@
       @elements.body.style.left = @elements.box.offsetLeft + 'px'
     @elements.body.style.visibility = 'visible'
     return
+
+
   bodyHideTimer: (e) ->
     if notesManager.debug
       console.debug 'Note#bodyHideTimer (id=%d)', @id
     @hideTimer = setTimeout(@bodyHide.bindAsEventListener(this), 250)
     return
+
+
   bodyHide: (e) ->
     if notesManager.debug
       console.debug 'Note#bodyHide (id=%d)', @id
@@ -196,6 +207,8 @@
     if notesManager.noteShowingBody == this
       notesManager.noteShowingBody = null
     return
+
+
   addDocumentObserver: (name, func) ->
     document.observe name, func
     @document_observers.push [
@@ -203,6 +216,8 @@
       func
     ]
     return
+
+
   clearDocumentObservers: (name, handler) ->
     i = 0
     while i < @document_observers.length
@@ -211,6 +226,8 @@
       ++i
     @document_observers = []
     return
+
+
   dragStart: (e) ->
     if notesManager.debug
       console.debug 'Note#dragStart (id=%d)', @id
@@ -227,6 +244,8 @@
     @dragging = true
     @bodyHide()
     return
+
+
   dragStop: (e) ->
     if notesManager.debug
       console.debug 'Note#dragStop (id=%d)', @id
@@ -240,6 +259,8 @@
     @dragging = false
     @bodyShow()
     return
+
+
   adjustScale: ->
     if notesManager.debug
       console.debug 'Note#adjustScale (id=%d)', @id
@@ -247,6 +268,8 @@
     for p of @fullsize
       @elements.box.style[p] = @fullsize[p] * ratio + 'px'
     return
+
+
   drag: (e) ->
     left = @boxStartX + e.pointerX() - (@cursorStartX)
     top = @boxStartY + e.pointerY() - (@cursorStartY)
@@ -259,6 +282,8 @@
     @fullsize.top = top / ratio
     e.stop()
     return
+
+
   editDragStart: (e) ->
     if notesManager.debug
       console.debug 'Note#editDragStart (id=%d)', @id
@@ -276,6 +301,8 @@
     @editStartY = @elements.editBox.offsetTop
     @dragging = true
     return
+
+
   editDragStop: (e) ->
     if notesManager.debug
       console.debug 'Note#editDragStop (id=%d)', @id
@@ -286,6 +313,8 @@
     @editStartY = null
     @dragging = false
     return
+
+
   editDrag: (e) ->
     left = @editStartX + e.pointerX() - (@cursorStartX)
     top = @editStartY + e.pointerY() - (@cursorStartY)
@@ -293,6 +322,8 @@
     @elements.editBox.style.top = top + 'px'
     e.stop()
     return
+
+
   resizeStart: (e) ->
     if notesManager.debug
       console.debug 'Note#resizeStart (id=%d)', @id
@@ -311,6 +342,8 @@
     e.stop()
     @bodyHide()
     return
+
+
   resizeStop: (e) ->
     if notesManager.debug
       console.debug 'Note#resizeStop (id=%d)', @id
@@ -326,6 +359,8 @@
     @dragging = false
     e.stop()
     return
+
+
   resize: (e) ->
     width = @boxStartWidth + e.pointerX() - (@cursorStartX)
     height = @boxStartHeight + e.pointerY() - (@cursorStartY)
@@ -338,6 +373,8 @@
     @fullsize.height = height / ratio
     e.stop()
     return
+
+
   save: (e) ->
     if notesManager.debug
       console.debug 'Note#save (id=%d)', @id
@@ -385,6 +422,8 @@
 )
     e.stop()
     return
+
+
   cancel: (e) ->
     if notesManager.debug
       console.debug 'Note#cancel (id=%d)', @id
@@ -397,6 +436,8 @@
     @elements.body.innerHTML = @old.formatted_body
     e.stop()
     return
+
+
   removeCleanup: ->
     if notesManager.debug
       console.debug 'Note#removeCleanup (id=%d)', @id
@@ -411,6 +452,8 @@
     notesManager.all = allTemp
     notesManager.updateNoteCount()
     return
+
+
   remove: (e) ->
     if notesManager.debug
       console.debug 'Note#remove (id=%d)', @id
@@ -438,6 +481,8 @@
 )
     e.stop()
     return
+
+
   history: (e) ->
     if notesManager.debug
       console.debug 'Note#history (id=%d)', @id


Extend recognised comment-symbols

Extend recognised comment-symbols

--- grammars/runoff.cson
+++ grammars/runoff.cson
@@ -32,7 +32,7 @@
 	# Comment lines
 	comment:
 		name: "comment.line.runoff"
-		begin: "^\\.!"
+		begin: "^\\.[!*~]"
 		end: "$"
 		beginCaptures:
 			0: name: "punctuation.definition.comment.runoff"


move tooltipDisposable outside initialize function

--- lib/selection-count-view.coffee
+++ lib/selection-count-view.coffee
@@ -1,6 +1,8 @@
 _ = require 'underscore-plus'

 class SelectionCountView extends HTMLElement
+  toolTipDisposable: null
+
   initialize: ->
     @classList.add('selection-count', 'inline-block')

@@ -10,8 +12,6 @@

     @subscribeToConfig()
     @subscribeToActiveTextEditor()
-
-    toolTipDisposable: null

   destroy: ->
     @activeItemSubscription.dispose()


[ubersicht network] Fix conditionals

[ubersicht network] Fix conditionals

--- ubersicht/network.coffee
+++ ubersicht/network.coffee
@@ -10,7 +10,7 @@
   if deviceId == 'none'
     @$label().html(@name)
     @$value(0).html(deviceId)
-  if networkName == 'ethernet'
+  else if networkName == 'ethernet'
     @$label().html(networkName)
     @$value(0).html(deviceId)
   else


Fixed something

Fixed something

--- public/scripts/app/services/playlists.coffee
+++ public/scripts/app/services/playlists.coffee
@@ -1,6 +1,6 @@
 angular.module('ponyfm').factory('playlists', [
-	'$rootScope', '$state', '$http'
-	($rootScope, $state, $http) ->
+	'$rootScope', '$state', '$http', 'auth'
+	($rootScope, $state, $http, auth) ->
 		playlistDef = null
 		playlists = {}
 		playlistPages = []
@@ -49,10 +49,11 @@
 				def

 			refresh: () ->
-				$.getJSON('/api/web/playlists/pinned')
-					.done (playlists) -> $rootScope.$apply ->
-						self.pinnedPlaylists.length = 0
-						self.pinnedPlaylists.push playlist for playlist in playlists
+				if auth.data.isLogged
+					$.getJSON('/api/web/playlists/pinned')
+						.done (playlists) -> $rootScope.$apply ->
+							self.pinnedPlaylists.length = 0
+							self.pinnedPlaylists.push playlist for playlist in playlists

 			deletePlaylist: (playlist) ->
 				def = new $.Deferred()


better Turbolinks management

better Turbolinks management

--- vendor/assets/javascripts/simple_form_extension/redactor.coffee
+++ vendor/assets/javascripts/simple_form_extension/redactor.coffee
@@ -10,11 +10,14 @@
     # Avoid double initialization
     unless $textArea.data('initialized.redactor')
       $textArea.redactor
-        imageUpload: "/redactor_rails/pictures?" + params
+        imageUpload: ["/redactor_rails/pictures", params].join('?')
         imageGetJson: "/redactor_rails/pictures"
         path: "/assets/redactor-rails"
         css: "style.css"
       $textArea.data('initialized.redactor', true)

-$(document).ready(initRedactor);
-$(window).bind('page:change', initRedactor);
+
+$(document).ready ->
+  initRedactor() if Turbolinks is undefined
+
+$(document).on('page:change', initRedactor);


:bug: Allow about view to be split

:bug: Allow about view to be split

--- lib/about.coffee
+++ lib/about.coffee
@@ -7,7 +7,7 @@

 createAboutView = (state) ->
   AboutView ?= require './about-view'
-  aboutView ?= new AboutView(state)
+  aboutView = new AboutView(state)
   aboutView

 atom.deserializers.add


fixed an issue where new JPrivateMessages could not be sent. Solved by disambiguation the sender/recipient in dispatchMessages

--- workers/social/lib/social/models/messages/privatemessage.coffee
+++ workers/social/lib/social/models/messages/privatemessage.coffee
@@ -45,7 +45,7 @@
     # a helper for sending to mulitple recipients.
     dispatchMessages =(sender, recipients, pm, callback)->
       deliver = race (i, recipient, pm, fin)->
-        recipient.addPrivateMessage pm, (err)->
+        recipient.addPrivateMessage pm, {as:'recipient'}, (err)->
           if err
             fin err
           else


Fixed warning from imagepreview.spec.coffee.

--- django_cradmin/static/django_cradmin/src/lib/imagepreview/imagepreview.spec.coffee
+++ django_cradmin/static/django_cradmin/src/lib/imagepreview/imagepreview.spec.coffee
@@ -27,7 +27,7 @@
     scope = {}
     html = """
     <div django-cradmin-image-preview>
-      <img django-cradmin-image-preview-img src="hello.png">
+      <img django-cradmin-image-preview-img src="https://upload.wikimedia.org/wikipedia/commons/b/ba/Crystal_Clear_app_tux.png?download">
       <input type="file" name="myfile" django-cradmin-image-preview-filefield>
     </div>
     """


Collapse license comment

Collapse license comment

--- lib/videojs-HTML5-niconicoplayer.coffee
+++ lib/videojs-HTML5-niconicoplayer.coffee
@@ -1,4 +1,5 @@
-###! videojs-HTML5-niconicoplayer - v0.0.0 - 2015-1-19
+###!
+# videojs-HTML5-niconicoplayer - v0.0.0 - 2015-1-19
 # Copyright (c) 2015 Koki Takahashi
 # Licensed under the MIT license.
 ###


Add a test for formatDate

Add a test for formatDate

--- test/test.coffee
+++ test/test.coffee
@@ -37,6 +37,11 @@
     it 'should return an expected result', ->
       assert.strictEqual bitterServer.escapeTags('
Night & "Day"
'),
         '<h1>Night & "Day"</h1>'
+
+  describe 'formatDate', ->
+    it 'should return an expected result', ->
+      assert.strictEqual bitterServer.formatDate('2013', '06', '09'),
+        'June 9, 2013'

 describe 'server', ->
   before (done) ->


update test suites

update test suites

--- test/test.coffee
+++ test/test.coffee
@@ -4,7 +4,7 @@

 str = 'testStr'
 dir = 'testDir'
-file = 'test.txt'
+file = "#{dir}/test.txt"

 describe 'echo()', ->
     describe 'to std*', ->
@@ -61,8 +61,10 @@
                 (data, cbk)->
                     data.should.to.equal str
                     cbk()
-                ->
-                    fs.unlink file, done
+                (cbk)->
+                    fs.unlink file, cbk
+                ->
+                    fs.rmdir dir, done
             ]

         it 'append new file', (done)->
@@ -76,8 +78,10 @@
                 (data, cbk)->
                     data.should.to.equal str
                     cbk()
-                ->
-                    fs.unlink file, done
+                (cbk)->
+                    fs.unlink file, cbk
+                ->
+                    fs.rmdir dir, done
             ]

         it 'create then append', (done)->
@@ -100,8 +104,10 @@
                 (data, cbk)->
                     data.should.to.equal str + '\n' + str
                     cbk()
-                ->
-                    fs.unlink file, done
+                (cbk)->
+                    fs.unlink file, cbk
+                ->
+                    fs.rmdir dir, done
             ]

         it 'append then create', (done)->
@@ -124,8 +130,66 @@
                 (data, cbk)->
                     data.should.to.equal str
                     cbk()
-                ->
-                    fs.unlink file, done
+                (cbk)->
+                    fs.unlink file, cbk
+                ->
+                    fs.rmdir dir, done
+            ]
+
+        it 'echo Object', (done)->
+            obj = {str: true}
+            async.waterfall [
+                (cbk)->
+                    echo obj, '>', file, cbk
+                (cbk)->
+                    fs.readFile file,
+                        encoding: 'utf8'
+                    , cbk
+                (data, cbk)->
+                    JSON.parse(data).should.to.deep.equal obj
+                    cbk()
+                (cbk)->
+                    fs.unlink file, cbk
+                ->
+                    fs.rmdir dir, done
+            ]
+
+        it 'echo Array', (done)->
+            arr = [1, 2, 3, 4]
+            async.waterfall [
+                (cbk)->
+                    echo arr, '>', file, cbk
+                (cbk)->
+                    fs.readFile file,
+                        encoding: 'utf8'
+                    , cbk
+                (data, cbk)->
+                    JSON.parse(data).should.to.deep.equal arr
+                    cbk()
+                (cbk)->
+                    fs.unlink file, cbk
+                ->
+                    fs.rmdir dir, done
+            ]
+
+        it 'echo Function', ->
+            func = ->
+                'func'
+            async.waterfall [
+                (cbk)->
+                    echo func, '>', file, cbk
+                (cbk)->
+                    fs.readFile file,
+                        encoding: 'utf8'
+                    , cbk
+                (data, cbk)->
+                    func2 = eval "(#{data})"
+                    func2().should.to.equal 'func'
+                    cbk()
+                (cbk)->
+                    fs.unlink file, cbk
+                ->
+                    fs.rmdir dir, done
             ]

 describe 'echo.sync()', ->
@@ -157,3 +221,100 @@
             console.error = err

     describe 'to local file', ->
+        it 'create new file', ->
+            echo.sync str, '>', file
+
+            data = fs.readFileSync file,
+                encoding: 'utf8'
+
+            data.should.to.equal str
+
+            fs.unlinkSync file
+            fs.rmdirSync dir
+
+        it 'append new file', ->
+            echo.sync str, '>>', file
+
+            data = fs.readFileSync file,
+                encoding: 'utf8'
+            data.should.to.equal str
+
+            fs.unlink file
+            fs.rmdirSync dir
+
+        it 'create then append', ->
+            echo.sync str, '>', file
+
+            data = fs.readFileSync file,
+                encoding: 'utf8'
+
+            data.should.to.equal str
+
+            echo.sync str, '>>', file
+
+            data = fs.readFileSync file,
+                encoding: 'utf8'
+
+            data.should.to.equal str + '\n' + str
+
+            fs.unlinkSync file
+            fs.rmdirSync dir
+
+        it 'append then create', ->
+            echo.sync str, '>>', file
+            data = fs.readFileSync file,
+                encoding: 'utf8'
+
+            data.should.to.equal str
+
+            echo.sync str, '>', file
+
+            data = fs.readFileSync file,
+                encoding: 'utf8'
+
+            data.should.to.equal str
+
+            fs.unlinkSync file
+            fs.rmdirSync dir
+
+        it 'echo Object', ->
+            obj = {str: true}
+
+            echo.sync obj, '>', file
+
+            data = fs.readFileSync file,
+                encoding: 'utf8'
+
+            JSON.parse(data).should.to.deep.equal obj
+
+            fs.unlinkSync file
+            fs.rmdirSync dir
+
+        it 'echo Array', ->
+            arr = [1, 2, 3, 4]
+
+            echo.sync arr, '>', file
+
+            data = fs.readFileSync file,
+                encoding: 'utf8'
+
+            JSON.parse(data).should.to.deep.equal arr
+
+            fs.unlinkSync file
+            fs.rmdirSync dir
+
+        it 'echo Function', ->
+            func = ->
+                'func'
+
+            echo.sync func, '>', file
+
+            data = fs.readFileSync file,
+                encoding: 'utf8'
+
+            func2 = eval "(#{data})"
+
+            func2().should.to.equal 'func'
+
+            fs.unlinkSync file
+            fs.rmdirSync dir


test: use promise

test: use promise

--- test/test.coffee
+++ test/test.coffee
@@ -7,8 +7,10 @@
 module.exports =
   scratch: (context) ->
     context.beforeEach (next) ->
-      mecano.remove destination: scratch, ->
-        mecano.mkdir destination: scratch, next
+      mecano.remove
+        destination: scratch
+      .mkdir destination: scratch
+      .then next
     scratch
   config: ->
     try


Add a test for obfuscateEmail

Add a test for obfuscateEmail

--- test/test.coffee
+++ test/test.coffee
@@ -46,6 +46,11 @@
         'December 31, 2020'
       assert.strictEqual bitterServer.formatDate('2001', '01', '01'),
         'January 1, 2001'
+
+  describe 'obfuscateEmail', ->
+    it 'should return expected result', ->
+      assert.strictEqual bitterServer.obfuscateEmail('test@example.com'),
+        'test@example.com'

 describe 'server', ->
   before (done) ->


use logger.error message as title of sentry report

--- libraries/logger/logging-manager.coffee
+++ libraries/logger/logging-manager.coffee
@@ -12,16 +12,27 @@
 		@raven = new raven.Client(sentry_dsn, options)

 	captureException: (attributes, message, level) ->
-		error = attributes.err or attributes.error or message
-		req = attributes.req
+		# handle case of logger.error "message"
+		if typeof attributes is 'string'
+			attributes = {err: attributes}
+		# extract any error object
+		error = attributes.err or attributes.error
+		# use our log message as the title when available
+		if not error?
+			error = {message: message} if typeof message is 'string'
+		else if message?
+			error.exception = error.message
+			error.message = message
+		# report the error
 		if error?
+			# capture attributes and use *_id objects as tags
 			tags = {}
 			extra = {}
-			# capture attributes and use *_id objects as tags
 			for key, value of attributes
 				tags[key] = value if key.match(/_id/) and typeof value == 'string'
 				extra[key] = value
 			# capture req object if available
+			req = attributes.req
 			if req?
 				extra.req =
 					method: req.method


fix issue https://github.com/vatesfr/xo-web/issues/178

--- app/modules/new-vm/index.coffee
+++ app/modules/new-vm/index.coffee
@@ -195,6 +195,11 @@
       # TODO:
       # - disable the form during creation
       # - indicate the progress of the operation
+      notify.info {
+        title: 'VM creation'
+        message: 'VM creation started'
+      }
+
       xoApi.call('vm.create', data).then (id) ->
         # If nothing to sets, just stops.
         return id unless CPUs or name_description or memory


Fix missing 'patch' login and wrong response codes in sync

--- app/assets/rdb/index.coffee
+++ app/assets/rdb/index.coffee
@@ -26,12 +26,12 @@
     data = ''
     json = undefined

-    if model && (method == 'create' || method == 'update')
+    if model && (method == 'create' || method == 'update' || method == 'patch')
       xhr.setRequestHeader 'Content-Type', 'application/json'
       json = options.attrs || model.toJSON options
       data = JSON.stringify json

-    xhr.setRequestHeader 'Accept','application/jsonx'
+    xhr.setRequestHeader 'Accept','application/json'

     csrf = document.getElementsByName('csrf-token')
     if csrf.length > 0
@@ -43,7 +43,7 @@
         if CONTENT_TYPES.json.test(ct)
           xhr.responseJSON = JSON.parse xhr.response

-        if xhr.status == 200
+        if xhr.status >= 200 && xhr.status < 300
           options.success xhr.responseJSON
           resolve xhr
         else


Fixes steelbrain/atom-hack#18

Fixes steelbrain/atom-hack#18

--- lib/panel.coffee
+++ lib/panel.coffee
@@ -11,7 +11,7 @@
     @decorations.forEach (decoration)-> try decoration.getMarker().destroy() catch
     @decorations = []
     if @main.errors.length < 1 then return @destroy()
-    @clear if @status is 1
+    @clear()
     editors = []
     try active_file = atom.workspace.getActiveEditor().getPath() catch then return
     for editor in atom.workspace.getEditors() then editors[editor.getPath()] = editor


Added file extension for exports.

Added file extension for exports.

--- RubyNetHTTPCodeGenerator.coffee
+++ RubyNetHTTPCodeGenerator.coffee
@@ -39,7 +39,7 @@
             }

         multipart_body = request.multipartBody
-        if multipart_body
+        if multipart_body
             return {
                 "has_multipart_body":true
                 "multipart_body": ({
@@ -100,8 +100,9 @@

 RubyNetHTTPCodeGenerator.identifier =
-    "com.luckymarmot.PawExtensions.RubyNetHTTPCodeGenerator";
+    "com.luckymarmot.PawExtensions.RubyNetHTTPCodeGenerator"
 RubyNetHTTPCodeGenerator.title =
-    "Ruby (Net::HTTP)";
+    "Ruby (Net::HTTP)"
+RubyNetHTTPCodeGenerator.fileExtension = "rb"

 registerCodeGenerator RubyNetHTTPCodeGenerator


modal white cover - remove when modal closes

--- app/assets/javascripts/species/controllers/downloads_controller.js.coffee
+++ app/assets/javascripts/species/controllers/downloads_controller.js.coffee
@@ -1,4 +1,4 @@
-Species.DownloadsController = Ember.Controller.extend
+Species.DownloadsController = Ember.Controller.extend Species.Spinner,
   needs: [
     'downloadsForCmsListings',
     'downloadsForCitesListings', 'downloadsForCitesRestrictions',
@@ -31,4 +31,6 @@
   ).property('euLegislation')

   close: () ->
-    @set('downloadsPopupVisible', false)+    @set('downloadsPopupVisible', false)
+    # Closing the spinner cover and resetting the spinner image.
+    $(@spinnerSelector).css("visibility", "hidden").find('img').show()


Add one more assert :D

Add one more assert :D

--- library/exposure/publish.coffee
+++ library/exposure/publish.coffee
@@ -83,7 +83,7 @@
     # is asynchronously wired in, so consult with `async` package.
     # Please be sure invoke the `next` arg to proceed, if relevant.
     preprocess: (request, response, resource, domain, next) ->
-        descriptions = @collectDescriptions()
+        assert descriptions = @collectDescriptions()
         internalError = "unexpected publishing error"
         assert _.isObject request.records = descriptions
         return next() unless _.isObject request.platform


fix a type in the doc

fix a type in the doc

--- library/exposure/tracked.coffee
+++ library/exposure/tracked.coffee
@@ -63,7 +63,7 @@
     # Also, the compounds for the composition system belong here.
     @compose Localized

-    # This block here defines a set of translation files thar are
+    # This block here defines a set of translation files that are
     # used by the service. Please keep in mind, that translations
     # are inherited from all of the base classes, and the tookit
     # then loads each translation file and combines all messages


REPL wasn't getting the right ORM since the last change, and toJSON is worked around due to breakage in waterline for recursive object transformation methods, see https://github.com/balderdashy/waterline/pull/818

--- packages/shrub-orm/index.coffee
+++ packages/shrub-orm/index.coffee
@@ -85,7 +85,7 @@
 	# Provide ORM to the REPL context.
 	registrar.registerHook 'replContext', (context) ->

-		context.orm = clientModule
+		context.orm = exports

 exports.initialize = (config, fn) ->

@@ -118,6 +118,16 @@
 				@find().then (models) ->
 					Promise.all model.destroy() for model in models

+			collection.attributes.toJSON ?= ->
+				O = @toObject()
+
+				# Remove toJSON return until the following PR makes it in
+				# https://github.com/balderdashy/waterline/pull/818
+				# This will ignore 'protected' attributes, unfortunately.
+				O.toJSON = null
+
+				O
+
 	# Invoke hook `collectionsAlter`.
 	# Allows packages to alter any Waterline collections defined.
 	pkgman.invoke 'collectionsAlter', collections_, waterline


Implement C++ void main() {} sample code wrapper

--- app/views/play/level/tome/Spell.coffee
+++ app/views/play/level/tome/Spell.coffee
@@ -82,8 +82,20 @@
         }
       """
     if @language is 'cpp' and not @languages[@language]
-      # TODO: do some transforms here to handle most common sample code differences between JavaScript and C++
-      @languages.cpp = @languages.javascript
+      # TODO: do more transforms here to handle most common sample code differences between JavaScript and C++
+      lines = (@languages.javascript ? '').split '\n'
+      lines.push '' if lines[lines.length - 1] isnt ''
+      code = """
+        void main() {
+        #{(lines.map ((line) -> '    ' + line)).join('\n')}
+        }
+      """
+      code = code.replace new RegExp('var i =', 'g'), 'int i ='
+      code = code.replace new RegExp('    var x', 'g'), '    float x'
+      code = code.replace new RegExp('    var y', 'g'), '    float y'
+      code = code.replace new RegExp('    var dist', 'g'), '    float dist'
+      code = code.replace new RegExp('    var ', 'g'), '    auto '
+      @languages.cpp = code
     @originalSource = @languages[@language] ? @languages.javascript
     @originalSource = @addPicoCTFProblem() if window.serverConfig.picoCTF


Fix for issue with visiting /login in chrome while logged in.

--- server/code/index.coffee
+++ server/code/index.coffee
@@ -413,7 +413,7 @@
 # Render login page
 app.get '/login/?', (req, resp) ->
   if req.user?.real
-    resp.redirect '/datasets'
+    return resp.redirect '/datasets'
   resp.render 'login',
     errors: req.flash('error')


change require to define

 change require to define

refs CNVS-25916

this declaration works, but is more correct as a define statement
because it's building a module for the bundle to require and use

Change-Id: I466fe500c5791bf076d5b80b0bb7b85890239923
Reviewed-on: https://gerrit.instructure.com/70569
Reviewed-by: Ryan Shaw <ea3cd978650417470535f3a4725b6b5042a6ab59@instructure.com>
Product-Review: Ryan Shaw <ea3cd978650417470535f3a4725b6b5042a6ab59@instructure.com>
QA-Review: Ryan Shaw <ea3cd978650417470535f3a4725b6b5042a6ab59@instructure.com>
Tested-by: Jenkins

--- app/coffeescripts/bundles/modules/content_migration_setup.coffee
+++ app/coffeescripts/bundles/modules/content_migration_setup.coffee
@@ -1,4 +1,4 @@
-require [
+define [
   'i18n!content_migrations'
   'jquery'
   'compiled/collections/ProgressingContentMigrationCollection'


ease back on the throttle a bit

ease back on the throttle a bit

--- lib/helpers.iced
+++ lib/helpers.iced
@@ -32,7 +32,7 @@
       exponent = ((headroom * headroom) / 8)
       if exponent <= 0 then exponent = 1

-      @throttle = 500 / exponent
+      @throttle = 550 / exponent

       # console.log @throttle


only run chain if it exists

only run chain if it exists

--- lib/index.coffee
+++ lib/index.coffee
@@ -119,7 +119,7 @@

   _emitKey: (key, done) ->
     context = key:key, values:[]
-    @_chain.run context:context, done:(error) =>
+    @_chain?.run context:context, done:(error) =>
       if error? then return done error
       @push value for value in context.values
       process.nextTick done


change acceptance test to use redis history client

--- services/document-updater/test/acceptance/coffee/ApplyingUpdatesToADocTests.coffee
+++ services/document-updater/test/acceptance/coffee/ApplyingUpdatesToADocTests.coffee
@@ -4,7 +4,7 @@
 expect = chai.expect
 async = require "async"
 Settings = require('settings-sharelatex')
-rclient_web = require("redis-sharelatex").createClient(Settings.redis.web)
+rclient_history = require("redis-sharelatex").createClient(Settings.redis.history)
 rclient_du = require("redis-sharelatex").createClient(Settings.redis.documentupdater)
 Keys = Settings.redis.documentupdater.key_schema

@@ -49,10 +49,10 @@
 				done()

 		it "should push the applied updates to the track changes api", (done) ->
-			rclient_web.lrange "UncompressedHistoryOps:#{@doc_id}", 0, -1, (error, updates) =>
+			rclient_history.lrange "UncompressedHistoryOps:#{@doc_id}", 0, -1, (error, updates) =>
 				throw error if error?
 				JSON.parse(updates[0]).op.should.deep.equal @update.op
-				rclient_web.sismember "DocsWithHistoryOps:#{@project_id}", @doc_id, (error, result) =>
+				rclient_history.sismember "DocsWithHistoryOps:#{@project_id}", @doc_id, (error, result) =>
 					throw error if error?
 					result.should.equal 1
 					done()
@@ -82,9 +82,9 @@
 				done()

 		it "should push the applied updates to the track changes api", (done) ->
-			rclient_web.lrange "UncompressedHistoryOps:#{@doc_id}", 0, -1, (error, updates) =>
+			rclient_history.lrange "UncompressedHistoryOps:#{@doc_id}", 0, -1, (error, updates) =>
 				JSON.parse(updates[0]).op.should.deep.equal @update.op
-				rclient_web.sismember "DocsWithHistoryOps:#{@project_id}", @doc_id, (error, result) =>
+				rclient_history.sismember "DocsWithHistoryOps:#{@project_id}", @doc_id, (error, result) =>
 					result.should.equal 1
 					done()

@@ -127,12 +127,12 @@
 						done()

 			it "should push the applied updates to the track changes api", (done) ->
-				rclient_web.lrange "UncompressedHistoryOps:#{@doc_id}", 0, -1, (error, updates) =>
+				rclient_history.lrange "UncompressedHistoryOps:#{@doc_id}", 0, -1, (error, updates) =>
 					updates = (JSON.parse(u) for u in updates)
 					for appliedUpdate, i in @updates
 						appliedUpdate.op.should.deep.equal updates[i].op

-					rclient_web.sismember "DocsWithHistoryOps:#{@project_id}", @doc_id, (error, result) =>
+					rclient_history.sismember "DocsWithHistoryOps:#{@project_id}", @doc_id, (error, result) =>
 						result.should.equal 1
 						done()


test(karma): Only test full macgyver script


adjusts some info fields to match the toolkit (issue #440)

--- app/js/services/info.coffee
+++ app/js/services/info.coffee
@@ -18,7 +18,6 @@
         @is_refreshing = true
         @q.all([@common_api.get_info(), @wallet.wallet_get_info()]).then (results) =>
             data = results[0]
-            #console.log "watch_for_updates get_info:>", results
             @info.transaction_scanning = results[1].transaction_scanning
             @info.network_connections = data.network_num_connections
             @info.wallet_open = data.wallet_open
@@ -26,11 +25,8 @@
             @info.last_block_time = data.blockchain_head_block_timestamp
             @info.last_block_num = data.blockchain_head_block_num
             @info.blockchain_head_block_age = data.blockchain_head_block_age
-            @info.income_per_block = data.blockchain_delegate_pay_rate
             @info.share_supply = data.blockchain_share_supply
-            @blockchain.get_asset(0).then (v)=>
-                @info.blockchain_delegate_pay_rate = @utils.formatAsset(@utils.asset(data.blockchain_delegate_pay_rate, v))
-            @info.wallet_scan_progress = data.scan_progress
+            @info.wallet_scan_progress = results[1].scan_progress
             if(!@info.client_version)
               @info.client_version=data.client_version

@@ -41,6 +37,9 @@
                 @info.delegate_reg_fee = data.delegate_reg_fee
                 @info.asset_reg_fee = data.asset_reg_fee
                 @info.transaction_fee = data.transaction_fee
+                if @wallet.main_asset
+                    @info.income_per_block = data.max_delegate_pay_per_block
+                    @info.blockchain_delegate_pay_rate = @utils.formatAsset(@utils.asset(data.max_delegate_pay_per_block, @wallet.main_asset))
                 @is_refreshing = false
                 @symbol = data.symbol
         , =>


add #toCanvasXPoint to Mark, marks scaling correctly on zoom toggle

--- app/lib/canvas-graph.coffee
+++ app/lib/canvas-graph.coffee
@@ -70,7 +70,6 @@
     @ctx.translate(0,@canvas.height)
     @ctx.scale(1,-1)

-
   toCanvasXCoord: (dataPoint) -> ((dataPoint - @smallestX) / (@largestX - @smallestX)) * @canvas.width

   # toDataXCoord: (domCoord) -> ((domCoord - @canvas.getBoundingClientRect().left)/ @canvas.width) * (@largestX - @smallestX)
@@ -117,7 +116,7 @@
     @element.style.borderTop =  '13px solid red'
     @element.style.pointerEvents = 'auto'

-    @startingPoint = (e.pageX-@canvas.getBoundingClientRect().left) - MIN_WIDTH
+    @startingPoint = @toCanvasXPoint(e) - MIN_WIDTH
     @dragging = false

     @element.addEventListener 'mouseover', (e) => @hovering = true
@@ -128,8 +127,8 @@
     window.addEventListener 'mouseup', (e) => @onMouseUp(e)

   draw: (e) ->
-    markLeftX = Math.min @startingPoint, (e.pageX-@canvas.getBoundingClientRect().left)
-    markRightX = Math.max @startingPoint, (e.pageX-@canvas.getBoundingClientRect().left)
+    markLeftX = Math.min @startingPoint, @toCanvasXPoint(e)
+    markRightX = Math.max @startingPoint, @toCanvasXPoint(e)

     width = (Math.min (Math.max (Math.abs markRightX - markLeftX), MIN_WIDTH), MAX_WIDTH)

@@ -188,4 +187,7 @@
     @dragging = false
     @moving = false

+  toCanvasXPoint: (e) -> e.pageX-@canvas.getBoundingClientRect().left - window.scrollX
+
+
 module?.exports = CanvasGraph: CanvasGraph, Marks: Marks, Mark: Mark


teams: minor code styling

teams: minor code styling

--- workers/social/lib/social/models/invitation.coffee
+++ workers/social/lib/social/models/invitation.coffee
@@ -257,15 +257,12 @@

   getName = (delegate) ->
+
     { nickname, firstName, lastName } = delegate.profile

     name = nickname
-
-    if "#{firstName}" is not ''
-      name = firstName
-
-    if "#{lastName}" is not ''
-      name = "#{name} #{lastName}"
+    name = firstName              if firstName
+    name = "#{name} #{lastName}"  if firstName and lastName

     return name


worker: add more unset options while deleting the user

--- workers/social/lib/social/models/user/index.coffee
+++ workers/social/lib/social/models/user/index.coffee
@@ -201,15 +201,25 @@
         # it to be seen in the codebase and it wont be mapped to a JUser
         emailBeforeDeletion : user.email
         status              : 'deleted'
-        sshKeys             : []
         username            : username
-        password            : createId()
-        registeredAt        : new Date 0
-        lastLoginDate       : new Date 0
-        passwordStatus      : 'autogenerated'
-        emailFrequency      : {}
       }
-      modifier = { $set: userValues, $unset: { oldUsername: 1 } }
+      unsetValues = {
+        sshKeys             : 1
+        password            : 1
+        salt                : 1
+        twofactorkey        : 1
+        onlineStatus        : 1
+        registeredAt        : 1
+        lastLoginDate       : 1
+        passwordStatus      : 1
+        emailFrequency      : 1
+        oldUsername         : 1
+        blockedUntil        : 1
+        blockedReason       : 1
+        registeredFrom      : 1
+        inactive            : 1
+      }
+      modifier = { $set: userValues, $unset: $unsetValues }
       # update the user with empty data

       user.update modifier, updateUnregisteredUserAccount({


Don't Sanitize Undefined Team Notices (#1725)

Don't Sanitize Undefined Team Notices

GitOrigin-RevId: 540316d71bc4047d25100bb0ef524d5d2adba0b1

--- services/web/app/coffee/Features/Subscription/SubscriptionViewModelBuilder.coffee
+++ services/web/app/coffee/Features/Subscription/SubscriptionViewModelBuilder.coffee
@@ -96,7 +96,8 @@
 				}

 			for memberGroupSubscription in memberGroupSubscriptions
-				memberGroupSubscription.teamNotice = sanitizeHtml(memberGroupSubscription.teamNotice)
+				if memberGroupSubscription.teamNotice
+					memberGroupSubscription.teamNotice = sanitizeHtml(memberGroupSubscription.teamNotice)

 			callback null, {
 				personalSubscription,


Reverse an un-necessary re-arrangement of tests

--- services/web/test/unit/coffee/Authentication/AuthenticationControllerTests.coffee
+++ services/web/test/unit/coffee/Authentication/AuthenticationControllerTests.coffee
@@ -185,14 +185,14 @@
 				@req.login.callCount.should.equal 1
 				done()

+		it 'should call req.session.save', (done) ->
+			@call (err) =>
+				@req.session.save.callCount.should.equal 1
+				done()
+
 		it 'should call UserSessionsManager.trackSession', (done) ->
 			@call (err) =>
 				@UserSessionsManager.trackSession.callCount.should.equal 1
-				done()
-
-		it 'should call req.session.save', (done) ->
-			@call (err) =>
-				@req.session.save.callCount.should.equal 1
 				done()

 		describe 'when req.session.save produces an error', ->


Exclude sessions with no path from list

Exclude sessions with no path from list

--- src/packages/fuzzy-finder/lib/fuzzy-finder-view.coffee
+++ src/packages/fuzzy-finder/lib/fuzzy-finder-view.coffee
@@ -147,7 +147,8 @@
       @loadPathsTask.start()

   populateOpenBufferPaths: ->
-    editSessions = rootView.project.getEditSessions()
+    editSessions = rootView.project.getEditSessions().filter (editSession)->
+      editSession.getPath()?

     editSessions = _.sortBy editSessions, (editSession) =>
       if editSession is rootView.getActiveEditSession()
@@ -155,7 +156,7 @@
       else
         -(editSession.lastOpened or 1)

-    @paths = _.map editSessions, (editSession) =>
+    @paths = _.map editSessions, (editSession) ->
       rootView.project.relativize editSession.getPath()

     @setArray(@paths)


:memo:

:memo:

--- lib/index.coffee
+++ lib/index.coffee
@@ -26,6 +26,7 @@
     @editorObserver = atom.workspace.observeTextEditors (editor) =>
       @handleEvents(editor)

+  # Public: Deactivates the package.
   deactivate: ->
     @commands.dispose()
     @editorObserver.dispose()


Working towards usable code. Woot

Working towards usable code. Woot

--- lib/suite.coffee
+++ lib/suite.coffee
@@ -38,50 +38,66 @@
     # Don't forget to call our super!
     super()

-  _on_child_before: (meta, done) =>
-    ###
-    @emit 'before', [], =>
-      console.log "#{@description}: Child befores---------------"
-      if @session.completed_tests is 0
-        @_run_before_alls()
-      else
-        @_run_before_eachs()
-    ###
-    @_run_befores meta, -> done()
-
-  _on_child_after: (meta, done) =>
-    @_run_afters meta, -> done()
+  _on_child_before_all: (meta, done) =>
+    @_run_before_alls meta, -> done()
+
+  _on_child_before_each: (meta, done) =>
+    @_run_before_eachs meta, -> done()
+
+  _on_child_after_each: (meta, done) =>
+    @_run_after_eachs meta, -> done()

   _on_child_complete: (meta, done) =>
     @_next()

   _on_child_test: (meta, done) =>
-    #done()
+    done()

   _complete: () =>
-    @emit 'complete'
-
-  _run_afters: (meta, callback) =>
-    @emit 'after', [meta], =>
+    @_run_after_alls =>
+      @emit 'complete'
+
+  _run_after_alls: (callback) =>
+    @emit 'after_all', [], =>
+      @_run_runners @_after_alls, ->
+        callback()
+
+  _run_after_eachs: (meta, callback) =>
+    @emit 'after_each', [meta], =>
       @_run_runners @_after_eachs, =>
         callback()

-  _run_befores: (meta, callback) =>
-    @emit 'before', [meta], =>
-      if @session.ran_before_alls
-        @_run_runners @_before_eachs, =>
+  _run_before_alls: (meta, callback) =>
+    @emit 'before_all', [meta], =>
+      if not @session.ran_before_alls
+        @session.ran_before_alls = true
+        @_run_runners @_before_alls, =>
           callback()
       else
-        @session.ran_before_alls = true
-        @_run_runners @_before_alls, =>
-          @_run_runners @_before_eachs, =>
+        callback()
+
+  _run_before_eachs: (meta, callback) =>
+    @emit 'before_each', [meta], =>
+      @_run_runners @_before_eachs, =>
+        callback()
+
+  _run_test: (test, callback) =>
+    @_run_before_alls @session.meta, =>
+      @_run_before_eachs @session.meta, =>
+        test.run =>
+          @_run_after_eachs @session.meta, =>
             callback()

-  _run_test: (test, callback) =>
-    @_run_befores @session.meta, =>
-      test.run =>
-        @_run_afters @session.meta, =>
-          callback()
+  _run_suite: (suite) =>
+    # Note that due to a bug in coffeescript, we need to explicitly tell
+    # emighter that we want to use a callback.
+    # See: https://github.com/jashkenas/coffee-script/issues/2489
+    suite.on 'before_all', @_on_child_before_all, callback: true
+    suite.on 'before_each', @_on_child_before_each, callback: true
+    suite.on 'after_each', @_on_child_after_each, callback: true
+    suite.on 'test', @_on_child_test, callback: true
+    suite.on 'complete', @_on_child_complete, callback: true
+    suite._run()

   _next: =>
     @session.item = @_tests_and_suites[++@session.index]
@@ -98,20 +114,6 @@
     else
       @_run_test @session.item, @_next

-  _run_after_alls: =>
-    @_run_runners @_after_alls, ->
-      @_complete()
-
-  _run_suite: (suite) =>
-    # Note that due to a bug in coffeescript, we need to explicitly tell
-    # emighter that we want to use a callback.
-    # See: https://github.com/jashkenas/coffee-script/issues/2489
-    suite.on 'before', @_on_child_before, callback: true
-    suite.on 'after', @_on_child_after, callback: true
-    suite.on 'test', @_on_child_test, callback: true
-    suite.on 'complete', @_on_child_complete, callback: true
-    suite._run()
-
   _run: =>
     @session =
       ran_before_alls: false


update cart item functions and layout

update cart item functions and layout

--- assets/coffeescript/pupil_store.coffee
+++ assets/coffeescript/pupil_store.coffee
@@ -259,39 +259,28 @@

"

-          specTxtHtml = "

+          specTxtHtml = "

#{ db[v.product]['title_product'] }

-
+                            <btn class='Cart-removeItem Grid-cell u-textRight' style='align-self:start;'>
+                              close
+                            </btn>

-                          #{ cart_spec_html }
-
unit cost: € #{ Number(db[v.product]['cost']) }

-
"
-
-          costFormulaHtml = "

-

-
-

-

-

-

-

-

-

-

-

-

-
+

+

+                              #{ cart_spec_html }
+
unit cost: € #{ Number(db[v.product]['cost']) }

-
"
-
-          costSumHtml = "

-

-
-

-
€ #{ Number(db[v.product]['cost'] * v.qty) }

+

+

+
keyboard_arrow_up

+

+                                  #{ v.qty }
+

+
keyboard_arrow_down

+

+
€ #{ Number(db[v.product]['cost'] * v.qty) }

-

"

@@ -299,16 +288,7 @@

" +
                         productImg +
                         specTxtHtml +
-                        "
" +
-                          "
" +
-                            costFormulaHtml +
-                            costSumHtml +
-                          "

-

-                        <btn class='Cart-removeItem Grid-cell u-textRight' style='align-self:start;'>
-                          close
-                        </btn>
-

+                      "

"

           $("#Cart-table").append(newRow)
@@ -371,7 +351,7 @@
         $(numDisplay).text("#{ item.qty }")

         # update row sum
-        $(row).find("p[class='Cart--sumRow Cart-costCalc--subTotal']").text("€ " + "#{ Number(get_product_database()[item.product].cost * item.qty) }")
+        $(row).find("p[id='subTotal']").text("€ " + "#{ Number(get_product_database()[item.product].cost * item.qty) }")

         # update cart subtotal
         totalPrice = if LocalStorage.length() > 0 then (Number(get_product_database()[v.product].cost * v.qty) for k,v of LocalStorage.dict()) else ""


payments: comment-out call to method using deprecated signature

--- client/landing/app/Applications/Account.kdapplication/views/paymenthistory.coffee
+++ client/landing/app/Applications/Account.kdapplication/views/paymenthistory.coffee
@@ -35,7 +35,8 @@
       style     : 'clean-gray account-header-cc'
       title     : 'Update Billing Info'
       callback  : ->
-        KD.getSingleton('paymentController').updateBillingInfo 'user'
+        # TODO: needs implementin'
+        # KD.getSingleton('paymentController').updateBillingInfo 'user'

     @getView().parent.addSubView reloadButton = new KDButtonView
       style     : 'clean-gray account-header-button'


sip model changes

sip model changes

--- client/landing/app/Applications/Activity.kdapplication/views/activityinnernavigation.coffee
+++ client/landing/app/Applications/Activity.kdapplication/views/activityinnernavigation.coffee
@@ -39,7 +39,7 @@
         { title : "Status Updates",   type : "CStatusActivity" }
         { title : "Code Snippets",    type : "CCodeSnipActivity" }
         { title : "Q&A",              type : "qa",         disabledForBeta : yes }
-        { title : "Discussions",      type : "discussion", disabledForBeta : yes }
+        { title : "Discussions",      type : "CDiscussionActivity" }
         { title : "Links",            type : "link",       disabledForBeta : yes }
         # { title : "Code Shares",      type : "codeshare", disabledForBeta : yes }
         # { title : "Commits",          type : "commit", disabledForBeta : yes }


Remove trailing spaces

Remove trailing spaces

--- client/landing/app/Applications/Members.kdapplication/ContentDisplays/ownprofileview.coffee
+++ client/landing/app/Applications/Members.kdapplication/ContentDisplays/ownprofileview.coffee
@@ -2,10 +2,10 @@
   constructor:->
     super
     memberData = @getData()
-
+
     memberData.skillTags or= []
-
-    @avatar = new AvatarStaticView
+
+    @avatar = new AvatarStaticView
       size        :
         width     : 90
         height    : 90
@@ -16,7 +16,7 @@

     @profileName = new PersonalFormNameView {memberData}
     @location    = new PersonalFormLocationView {memberData}
-
+
     @followers = new KDView
       tagName     : 'a'
       attributes  :
@@ -36,19 +36,19 @@
         return if memberData.counts.following is 0
         appManager.tell "Members", "createFolloweeContentDisplay", memberData, 'following'
     , memberData
-
-    @aboutYou     = new PersonalFormAboutView {memberData}
+
+    @aboutYou     = new PersonalFormAboutView {memberData}
     @skillTagView = new PersonalFormSkillTagView {memberData}
-
+
     @setListeners()
-
+
   viewAppended:->
     super
     @setTemplate @pistachio()
     @template.update()

   putNick:(nick)-> "@#{nick}"
-
+
   pistachio:->
     """
     <div class="profileleft">
@@ -82,12 +82,12 @@
       </div>
     </section>
     """
-
+
   setListeners:->
     @listenTo
       KDEventTypes        : "AutoCompleteNeedsTagData"
       listenedToInstance  : @skillTagView
-      callback      : (pubInst,event)=>
+      callback      : (pubInst,event)=>
         {callback,inputValue,blacklist} = event
         @fetchAutoCompleteDataForTags inputValue,blacklist,callback


Set download mode to 755

Set download mode to 755

--- lib/utils.coffee
+++ lib/utils.coffee
@@ -29,9 +29,11 @@
 # The purpose of this function is to be able to stub it
 # on downloadNodePackage() tests.
 exports.downloadAndExtract = (url, dest, callback) ->
-	download = new Download(extract: true)
-		.get(url)
-		.dest(dest)
+	download = new Download
+		extract: true
+		mode: '755'
+	.get(url)
+	.dest(dest)

 	download.run(_.unary(callback))


#242 remove unused util function

#242 remove unused util function

--- lib/utils.coffee
+++ lib/utils.coffee
@@ -135,22 +135,6 @@
 eachCursor = (editor, fn) ->
   for cursor in editor.getCursors()
     fn(cursor)
-
-bufferPositionForScreenPositionWithoutClip = (editor, screenPosition) ->
-  {row, column} = Point.fromObject(screenPosition)
-  bufferRow = editor.bufferRowForScreenRow(row)
-  bufferColumn = editor.displayBuffer
-    .tokenizedLineForScreenRow(row)
-    .bufferColumnForScreenColumn(column)
-  new Point(bufferRow, bufferColumn)
-
-screenPositionForBufferPositionWithoutClip = (editor, bufferPosition) ->
-  {row, column} = Point.fromObject(bufferPosition)
-  screenRow = editor.screenRowForBufferRow(row)
-  screenColumn = editor.displayBuffer
-    .tokenizedLineForScreenRow(row)
-    .screenColumnForBufferColumn(column)
-  new Point(screenRow, screenColumn)

 # [FIXME] Polyfills: Remove after atom/text-buffer is updated
 poliyFillsToTextBufferHistory = (history) ->
@@ -692,8 +676,6 @@
   getVisibleEditors
   eachSelection
   eachCursor
-  bufferPositionForScreenPositionWithoutClip
-  screenPositionForBufferPositionWithoutClip
   getNewTextRangeFromCheckpoint
   findIndex
   mergeIntersectingRanges