fixes

fixes

--- lib/browser-plus-view.coffee
+++ lib/browser-plus-view.coffee
@@ -174,11 +174,11 @@
               @htmlv[0]?.executeJavaScript init
           if jss = @model.browserPlus.plugins?.jss
             for js in jss
-              @htmlv[0]?.executeJavaScript BrowserPlusView.loadJS(js,true)
+              @htmlv[0]?.executeJavaScript BrowserPlusView.loadJS.call(@,js,true)

           if csss = @model.browserPlus.plugins?.csss
             for css in csss
-              @htmlv[0]?.executeJavaScript BrowserPlusView.loadCSS(css,true)
+              @htmlv[0]?.executeJavaScript BrowserPlusView.loadCSS.call(@,css,true)

           if menus = @model.browserPlus.plugins?.menus
             for menu in menus
@@ -192,8 +192,8 @@
           #               node.innerHTML='#{@model.browserPlus.bpStyle}';
           #               document.getElementsByTagName('head')[0].appendChild(node);
           #               """
-          @htmlv[0]?.executeJavaScript BrowserPlusView.loadCSS('bp-style.css')
-          @htmlv[0]?.executeJavaScript BrowserPlusView.loadCSS('jquery.notifyBar.css')
+          @htmlv[0]?.executeJavaScript BrowserPlusView.loadCSS.call @,'bp-style.css',true
+          @htmlv[0]?.executeJavaScript BrowserPlusView.loadCSS.call @,'jquery.notifyBar.css',true

       @htmlv[0]?.addEventListener "page-favicon-updated", (e)=>
         _ = require 'lodash'
@@ -493,6 +493,7 @@
     fs.readFileSync "#{@model.browserPlus.resources}/jquery.hotkeys.min.js",'utf-8'

   @loadCSS: (filename,fullpath)->
+    debugger
     filename = "#{@model.browserPlus.resources}/#{filename}" unless fullpath
     """
     jQuery('head').append(jQuery('<link type="text/css" rel="stylesheet" href="#{filename}">'))


Fix fitInScreen login and leverage goog.math.Size.

Also small refactor.

--- app/client/js/react/pages/song.coffee
+++ app/client/js/react/pages/song.coffee
@@ -4,6 +4,7 @@
 goog.require 'goog.dom.BufferedViewportSizeMonitor'
 goog.require 'goog.dom.ViewportSizeMonitor'
 goog.require 'goog.dom.classlist'
+goog.require 'goog.math.Size'
 goog.require 'goog.string'

 class app.react.pages.Song
@@ -28,6 +29,7 @@
           article
             dangerouslySetInnerHTML: '__html': @lyricsHtml()
             onPointerUp: @onArticlePointerUp
+            ref: 'article'
           menu ref: 'menu',
             a
               href: routes.home.createUrl(),
@@ -75,20 +77,29 @@
         TODO(steida): Implement and describe strategies.
       ###
       setLyricsMaxFontSize: ->
-        el = @getDOMNode()
-        originalVisibility = el.style.visibility
-        el.style.visibility = 'hidden'
+        songElSize = @getSize @getDOMNode()
+        articleEl = @refs['article'].getDOMNode()
+        # TODO(steida): Decide minimal fontSize readability.
+        # TODO constanta MINIMAL_READABLE_FONT_SIZE
         fontSize = 5
-        while fontSize != 55
-          el.style.fontSize = "#{fontSize}px"
-          scrollbarIsVisible =
-            el.scrollHeight > el.offsetHeight ||
-            el.scrollWidth > el.offsetWidth
-          if scrollbarIsVisible
-            el.style.fontSize = "#{--fontSize}px"
-            break
-          fontSize++
-        el.style.visibility = originalVisibility
+        @toAvoidUnnecessaryReflow =>
+          while fontSize != 55
+            articleEl.style.fontSize = "#{fontSize}px"
+            articleElSize = @getSize articleEl
+            fitsInsideProperly = songElSize.fitsInside articleElSize
+            if fitsInsideProperly
+              articleEl.style.fontSize = "#{--fontSize}px"
+              break
+            fontSize++
+
+      getSize: (el) ->
+        new goog.math.Size el.offsetWidth, el.offsetHeight
+
+      toAvoidUnnecessaryReflow: (fn) ->
+        songEl = @getDOMNode()
+        songEl.style.visibility = 'hidden'
+        fn()
+        songEl.style.visibility = ''

   @MSG_BACK: goog.getMsg 'Back'
   @MSG_EDIT: goog.getMsg 'Edit'


buttons yo

buttons yo

--- Framework/Views/Controls/ImageButton_Framework.coffee
+++ Framework/Views/Controls/ImageButton_Framework.coffee
@@ -3,6 +3,7 @@
     options = root._.extend({
       type: "flat"
       onClick: () => Ti.API.info("button clicked")
+      backgroundColor: "transparent"
     }, options)

     if options.type == "back"
@@ -15,6 +16,7 @@
     bgPressed = "/Common/Framework/Images/iOS/TitleBar/Buttons/backPressed.png"

     button = Ti.UI.createLabel({
+      backgroundColor: settings.backgroundColor
       backgroundImage: bg
       backgroundLeftCap: 15
       backgroundRightCap: 10
@@ -56,6 +58,7 @@
     bgPressed = "/Common/Framework/Images/iOS/TitleBar/Buttons/buttonPressed.png"

     button = Ti.UI.createLabel({
+      backgroundColor: settings.backgroundColor
       backgroundImage: bg
       backgroundLeftCap: 10
       backgroundRightCap: 10


initialize selected geo entities ids with an empty array to avoid errors on initial load

--- app/assets/javascripts/species/controllers/search_controller.js.coffee
+++ app/assets/javascripts/species/controllers/search_controller.js.coffee
@@ -6,7 +6,7 @@
   autoCompleteRegions: null
   autoCompleteCountries: null
   selectedGeoEntities: []
-  selectedGeoEntitiesIds: null
+  selectedGeoEntitiesIds: []

   loadTaxonConcepts: ->
     @transitionToRoute('search', {
@@ -18,7 +18,7 @@
   setFilters: (filtersHash) ->
     @set('taxonomy', filtersHash.taxonomy)
     @set('taxonConceptQuery', filtersHash.taxon_concept_query)
-    @set('selectedGeoEntitiesIds', filtersHash.geo_entities_ids)
+    @set('selectedGeoEntitiesIds', filtersHash.geo_entities_ids || [])

   autoCompleteTaxonConcepts: ( ->
     taxonConceptQuery = @get('taxonConceptQuery')


Change group IDs to match production values

--- classify/menu.coffee
+++ classify/menu.coffee
@@ -5,8 +5,8 @@
 class ClassifyMenu
   GROUPS =
     'all-locations': true
-    'california': "53ac8475edf877f0bc000002"
-    'tasmania': "536d226d3ae740fd20000003"
+    'california': "536d226d3ae740fd20000003"
+    'tasmania': "536d226d3ae740fd20000004"

   html = require "./menu-html"


cleanup

cleanup

--- client/create.coffee
+++ client/create.coffee
@@ -14,8 +14,6 @@
     ContextLinkExtension::onClick = (e) ->
         editor = this.base
         editor.triggerAnchorAction(e)
-
-        # editor.__proto__.anchorPreviewClickHandler(e)

     editor = new MediumEditor ".medium-editable",
         buttons: ['contextLink', 'bold', 'italic', 'underline'],
@@ -305,7 +303,6 @@
         console.log("delete")
         srcE = if d.srcElement then d.srcElement else d.target
         parentSection = $(srcE).closest('section')
-        console.log parentSection.data()
         horizontalIndex = parentSection.data('index')
         horizontalSections = Session.get('horizontalSections')
         horizontalSections[Session.get('currentVertical')].data.splice(horizontalIndex, 1)
@@ -362,14 +359,11 @@
             # userId: user #TODO add this back in
             lastSaved: date

-        console.log(storyDocument)
-
         Session.set("storyDashTitle", storyDashTitle)
         storyId = Stories.findOne(storyDashTitle: storyDashTitle)?._id
         unless storyId
             storyId = Session.get("storyId")
         console.log("ID", storyId)
-        console.log storyDocument
         if storyId
             Stories.update({_id: storyId}, {$set: storyDocument})
         else


rm keybindings for features that won't be in v14.1

--- client/editor.coffee
+++ client/editor.coffee
@@ -48,9 +48,9 @@

   k = # extra keys for CodeMirror
     Tab: -> c = cm.getCursor(); opts.autocomplete? cm.getLine(c.line), c.ch; return
-    F4: -> opts.pop?(); return
     Enter: -> (if opts.debugger then opts.over?() else cm.execCommand 'newlineAndIndent'); return
     'Ctrl-Enter': -> (if opts.debugger then opts.over?()); return
+  ###
     F6: -> opts.openInExternalEditor? cm.getValue(), cm.getCursor().line, (err, text) ->
       if err then $.alert '' + err, 'Error' else c = cm.getCursor().line; cm.setValue text; cm.setCursor c
       return
@@ -71,6 +71,7 @@
           r[0] = r[0][sel.p.ch..]; cm.replaceRange r.join('\n'), sel.p, sel.q, 'D'; return
         cm.setSelections o
       return
+  ###

   k["'\uf800'"] = k['Shift-Esc'] = QT = -> # QT: Quit (and lose changes)
     opts.close?()


Prevent dragging of DOM elements. Fixes #202

--- client/import.coffee
+++ client/import.coffee
@@ -143,6 +143,9 @@
   ImportingFiles.remove({})

 Meteor.startup ->
+  $(document).on 'dragstart', (e) ->
+    e.preventDefault()
+
   $(document).on 'dragenter', (e) ->
     e.preventDefault()


Observe configuration and reload database view.

--- lib/existdb-tree-view.coffee
+++ lib/existdb-tree-view.coffee
@@ -43,6 +43,10 @@

             atom.config.observe 'existdb-tree-view.scrollAnimation', (enabled) =>
                 @animationDuration = if enabled then 300 else 0
+            atom.config.onDidChange('existdb.server', (ev) => @checkServer(() => @populate()))
+            atom.config.onDidChange('existdb.user', (ev) => @checkServer(() => @populate()))
+            atom.config.onDidChange('existdb.password', (ev) => @checkServer(() => @populate()))
+            atom.config.onDidChange('existdb.root', (ev) => @checkServer(() => @populate()))

             @treeView.width(@state.width) if @state?.width
             @toggle() if @state?.show
@@ -76,7 +80,7 @@
             @checkServer(() => @load(root))

         load: (item, callback) =>
-            console.log("Loading collection contents for item #{item.path}")
+            console.log("Loading collection contents for item #{item.path} using server #{@config.getConfig(editor).server}")
             self = this
             editor = atom.workspace.getActiveTextEditor()
             url = @config.getConfig(editor).server +


Cache file paths.

Cache file paths.

--- lib/fuzzy-finder-view.coffee
+++ lib/fuzzy-finder-view.coffee
@@ -8,6 +8,8 @@

 module.exports =
 class FuzzyFinderView extends SelectListView
+  filePaths: null
+  filesPathsPromise: null
   subscriptions: null
   alternateScoring: false

@@ -246,18 +248,24 @@
       super(data)

   dataForFilePaths: (filePaths) ->
-    projectHasMultipleDirectories = atom.project.getDirectories().length > 1
-
-    promises = filePaths.map (filePath) ->
-      [rootPath, projectRelativePath] = atom.project.relativizePath(filePath)
-      if rootPath and projectHasMultipleDirectories
-        projectRelativePath = path.join(path.basename(rootPath), projectRelativePath)
-      if repo = repositoryForPath(filePath)
-        repo.getCachedPathStatus(filePath).then (status) ->
-          {filePath, projectRelativePath, status}
-      else
-        Promise.resolve({filePath, projectRelativePath})
-    Promise.all(promises)
+    # Don't regenerate project relative paths unless the file paths have changed
+    if filePaths isnt @filePaths
+      projectHasMultipleDirectories = atom.project.getDirectories().length > 1
+
+      @filePaths = filePaths
+
+      promises = filePaths.map (filePath) ->
+        [rootPath, projectRelativePath] = atom.project.relativizePath(filePath)
+        if rootPath and projectHasMultipleDirectories
+          projectRelativePath = path.join(path.basename(rootPath), projectRelativePath)
+        if repo = repositoryForPath(filePath)
+          repo.getCachedPathStatus(filePath).then (status) ->
+            {filePath, projectRelativePath, status}
+        else
+          Promise.resolve({filePath, projectRelativePath})
+      @filesPathsPromise = Promise.all(promises)
+
+    @filesPathsPromise

   show: ->
     @storeFocusedElement()


Hide "advancedMode" option and assume it as always true

--- lib/util/configuration-form-view.coffee
+++ lib/util/configuration-form-view.coffee
@@ -15,6 +15,6 @@
     # @addRow @createFieldRow("repoUsername", "text", Configuration.labels.repoUsername)
     # @addRow @createFieldRow("password", "password", Configuration.labels.password)
     @addRow @createFieldRow("cloneDir", "directory", Configuration.labels.cloneDir)
-    @addRow @createFieldRow("advancedMode", "checkbox", Configuration.labels.advancedMode)
+    # @addRow @createFieldRow("advancedMode", "checkbox", Configuration.labels.advancedMode)

 module.exports = document.registerElement('awe-configuration-form-view', prototype: ConfigurationFormView.prototype, extends: 'div')


reduce localStorage space

reduce localStorage space

--- app/scripts/services/highlight.coffee
+++ app/scripts/services/highlight.coffee
@@ -14,7 +14,7 @@

     class Highlight
       constructor: (data) ->
-        _.extend(@, data)
+        _.extend @, _.pick(data, ['_id', 'title', 'description', 'game', 'date', 'views', 'url', 'preview', 'length'])
         @_searchText = [@title, @description, @game].join(' ').toLowerCase()
         @human_length = formatLength(@length)


Don't plummet active block when removing blocks

--- app/scripts/services/tetromino.coffee
+++ app/scripts/services/tetromino.coffee
@@ -83,6 +83,7 @@
             @info.plumetting_block = false
             @on_block_land block
             on_land_callback() if on_land_callback
+        drop_single_block()
         drop_single_block_interval = $interval(drop_single_block, 25)

       # Returns an array of blocks anywhere over top of the given blocks
@@ -139,6 +140,7 @@
         @info.current_score += @info.score_value
         @increment_level_if_necessary()
         on_top = @blocks_on_top(to_remove)
+        on_top = on_top.filter((b) -> !b.active)
         @plummet_blocks(on_top) if on_top.length > 0
         @check_for_tetrominos()


Update binary for prebuild phantomjs

Update binary for prebuild phantomjs

--- craster.coffee
+++ craster.coffee
@@ -62,7 +62,7 @@
 phantomjs = (args, log, onExit) ->
   args.unshift path.join(__dirname, 'capture.js')
   args.unshift '--web-security=false'
-  command = "node_modules/phantomjs-prebuilt/bin/phantomjs"
+  command = "node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs"

   cli.debug "#{command} #{args.join(' ')}"


Fix bug when adding a new school while signing up.

--- app/assets/javascripts/angular/signup.js.coffee
+++ app/assets/javascripts/angular/signup.js.coffee
@@ -22,19 +22,19 @@
       params = { state: self.state }
       self.loadRemoteCollection('districts',params)

-    self.loadSchools = () ->
+    self.loadSchools = (success_fn = null) ->
       if self.isDomestic()
-        self.loadDomesticSChools()
+        self.loadDomesticSchools(success_fn)
       else
-        self.loadIntlSchools()
+        self.loadIntlSchools(success_fn)

-    self.loadDomesticSChools = () ->
+    self.loadDomesticSchools = (success_fn = null) ->
       params = { district_id : self.district.id }
-      self.loadRemoteCollection('schools',params)
+      self.loadRemoteCollection('schools',params, success_fn)

-    self.loadIntlSchools = () ->
+    self.loadIntlSchools = (success_fn = null) ->
       params = { country_id : self.country.id }
-      self.loadRemoteCollection('schools',params)
+      self.loadRemoteCollection('schools',params, success_fn)

     self.countrySelected = () ->
       if self.isDomestic()
@@ -56,13 +56,14 @@
         self.loadDomesticSChools()
       delete self.school

-    self.loadRemoteCollection = (collectionName, params={}) ->
+    self.loadRemoteCollection = (collectionName, params={}, success_fn=null) ->
       url = API_V1[collectionName.toUpperCase()]
       $http({method: 'GET', url: url, params: params})
       .success (data, status, headers, config) ->
         $log.log("loaded #{collectionName} collection from #{url}")
         self[collectionName] = data
-
+        if success_fn
+          success_fn()
       .error (data, status) ->
         $log.log "Error loading #{collectionName} collection"
         self[collectionName] || =[]
@@ -118,11 +119,12 @@

       self.postToResource resource, data, (returnData) ->
         id = returnData['school_id']
-        self.loadSchools()
-        for school in self.schools
-          if school.id == $id
-            self.school = school
-        self.editSchool = false
+
+        self.loadSchools () ->
+          for school in self.schools
+            if school.id == id
+              self.school = school
+          self.editSchool = false

     self.form_params = () ->


update units when changing any working unit or computation method

--- app/assets/javascripts/backend/budget.js.coffee
+++ app/assets/javascripts/backend/budget.js.coffee
@@ -185,8 +185,9 @@
   $(document).on 'change', "select[name='budget_indicator']", ->
     indicator = $(this).val().split('-')[0]
     unit = $(this).val().split('-')[1]
-    $(this).parent().find("select[id$='working_indicator']").val(indicator)
-    $(this).parent().find("select[id$='working_unit']").val(unit)
+    $(this).parent().find("input:hidden[id$='working_indicator']").val(indicator)
+    $(this).parent().find("input:hidden[id$='working_unit']").val(unit)
+    $(this).parent().find("input:hidden[id$='working_unit']").trigger('change')

   # manages selects to show only indicators in relation with the given variant
   $(document).on 'selector:change', "input:hidden[data-parameter-name='variant_id'][name^='production[budgets_attributes]']", ->
@@ -224,4 +225,14 @@
         unit_select.trigger('change')
       error: () -> indicator_select.children("option").attr('disabled', false)

+  # updates items units when changing production unit
+  $(document).on 'change', "select[id='production_working_unit']", ->
+    updateItemUnits()
+  # updates items units when changing budget unit
+  $(document).on 'change', "input:hidden[id$='working_unit']", ->
+    updateItemUnits($(this).closest("tr"))
+  # updates items units when changing computation method
+  $(document).on 'change', "select[name$='[computation_method]']", ->
+    updateItemUnits($(this).closest("tr"))
+
 ) jQuery


changed size: delete button

changed size: delete button

--- app/assets/javascripts/buttons_helper.js.coffee
+++ app/assets/javascripts/buttons_helper.js.coffee
@@ -12,7 +12,7 @@
       $(this).addClass("looks_like_button btn btn-primary").html " " + $(this).html()

     $(".delete_destroy:not(.looks_like_button)").each ->
-      $(this).addClass("looks_like_button btn btn-danger").html " " + $(this).html()
+      $(this).addClass("looks_like_button btn btn-sm btn-danger").html " " + $(this).html()

     $(".editar_edit:not(.looks_like_button)").each ->
       $(this).addClass("looks_like_button btn btn-warning").html " " + $(this).html()


Fix #724

Fix #724

--- app/assets/javascripts/libs/pan_zoom_svg.coffee
+++ app/assets/javascripts/libs/pan_zoom_svg.coffee
@@ -45,22 +45,15 @@

   mouseWheelHandler : (event) =>

-    @mouseDown = true
-    @startMouse = @mouseToSVGLocalCoordinates(event)
-    @startMatrix = @svgElement.getCTM()
-
-
-  mouseWheelHandler : (event) =>
-
     event.preventDefault()
     return if @mouseDown

     buffer = @buffer
-    { wheelDelta, wheelDeltaX, wheelDeltaY, pageX, pageY } = event.originalEvent
+    { deltaY, pageX, pageY } = event.originalEvent

-    buffer += wheelDeltaY
+    buffer += deltaY

-    if wheelDeltaY < 0
+    if deltaY < 0
       @zoom -= STEP
     else
       @zoom += STEP


fix urls of downloaded files to those provided by clsi

--- services/web/public/coffee/ide/pdf/controllers/PdfController.coffee
+++ services/web/public/coffee/ide/pdf/controllers/PdfController.coffee
@@ -125,7 +125,8 @@
 						file.name = "#{file.path.replace(/^output\./, "")} file"
 					else
 						file.name = file.path
-					file.url = "/project/#{project_id}/output/#{file.path}"
+					if not file.url?
+						file.url = "/project/#{project_id}/output/#{file.path}"
 					if response.clsiServerId?
 						file.url = file.url + "?clsiserverid=#{response.clsiServerId}"
 					$scope.pdf.outputFiles.push file


remove console.log in tests

remove console.log in tests

--- services/web/test/unit/coffee/Compile/CompileControllerTests.coffee
+++ services/web/test/unit/coffee/Compile/CompileControllerTests.coffee
@@ -194,7 +194,6 @@
 					.should.equal true

 			it "should set the content-disposition header with a safe version of the project name", ->
-				console.log @res.setContentDisposition.args[0]
 				@res.setContentDisposition
 					.calledWith('', filename: "test_nam_.pdf")
 					.should.equal true


Simplify.

Simplify.

--- src/vocabulary/take.coffee
+++ src/vocabulary/take.coffee
@@ -78,15 +78,11 @@
         copyIndices[axis]++
     new APLArray data, shape, stride
   else
-    stride = []
     offset = omega.offset
     for x, i in a
-      if x >= 0
-        stride.push omega.stride[i]
-      else
-        stride.push omega.stride[i]
+      if x < 0
         offset += (omega.shape[i] + x) * omega.stride[i]
-    new APLArray omega.data, shape, stride, offset
+    new APLArray omega.data, shape, omega.stride, offset

 # Mix (`↑`)
 #


Add norwegian error text for unknown error

--- coffee/server.coffee
+++ coffee/server.coffee
@@ -45,7 +45,7 @@
   console.error err.stack

   return res.end() if req.method is 'HEAD'
-  return res.json message: err.message or 'Unknown Error'
+  return res.json message: err.message or 'Ukjent feil'

 app.use (req, res) -> res.json 404, message: "Resource not found"


update method name in test

update method name in test

--- test/api.test.coffee
+++ test/api.test.coffee
@@ -1,6 +1,6 @@
 fs = require 'fs'
 path = require 'path'
-{create} = require '../api'
+{init} = require '../api'
 uuid = require 'uuid'
 should = require 'should'

@@ -9,7 +9,7 @@
 describe 'api', ->
   api = null
   before ->
-    api = create
+    api = init
       accountSid: config.accountSid
       authToken: config.authToken
       appId: config.appId
@@ -36,6 +36,7 @@
         friendlyName: name
       , (e ,r, b) ->
         if e then return done e
+        console.log b
         b.should.be.an.Object
         b.statusCode.should.equal '000000'
         b.SubAccount.should.be.an.Object
@@ -59,18 +60,18 @@
     #       b.statusCode.should.equal '000000'
     #       done()
   # getSubAccounts
-  describe 'getSubAccounts', ->
-    it 'should return subaccounts', (done) ->
-      api.getSubAccounts (e, r, b) ->
-        if e then return done e
-        b.statusCode.should.equal '000000'
-        b.SubAccount.should.be.an.Array
-        if b.SubAccount.length > 0
-          b.SubAccount[0].should.have.keys [
-            'subAccountSid', 'voipAccount', 'dateCreated',
-            'friendlyName', 'voipPwd', 'subToken'
-          ]
-        done()
+  # describe 'getSubAccounts', ->
+  #   it 'should return subaccounts', (done) ->
+  #     api.getSubAccounts (e, r, b) ->
+  #       if e then return done e
+  #       b.statusCode.should.equal '000000'
+  #       b.SubAccount.should.be.an.Array
+  #       if b.SubAccount.length > 0
+  #         b.SubAccount[0].should.have.keys [
+  #           'subAccountSid', 'voipAccount', 'dateCreated',
+  #           'friendlyName', 'voipPwd', 'subToken'
+  #         ]
+  #       done()
   # querySubAccountByName
   # billRecords


Tweaked brunch config so it doesn't watch server test files.

--- config.coffee
+++ config.coffee
@@ -5,6 +5,7 @@
 exports.config =
   paths:
     'public': 'public'
+    'watched': ['app', 'test/app', 'vendor']

   conventions:
     ignored: (path) -> startsWith(sysPath.basename(path), '_')
@@ -54,7 +55,7 @@
       options:
         line_endings:
           value: 'unix'
-          level: 'error'
+          level: 'ignore'
         max_line_length:
           level: 'ignore'
         no_unnecessary_fat_arrows:
@@ -69,6 +70,7 @@
       allowCache: true

   onCompile: (files) ->
+    # TODO: update to the new setting
     exec = require('child_process').exec
     regexFrom = '\\/\\/# sourceMappingURL=([^\\/].*)\\.map'
     regexTo = '\\/\\/# sourceMappingURL=\\/javascripts\\/$1\\.map'


Factor out skip, clean up layouts

Factor out skip, clean up layouts

--- layout.coffee
+++ layout.coffee
@@ -411,8 +411,14 @@
       # console.log 'added', child, @
       @update(child)

-    update: (sender) ->
-#      console.log 'update', sender
+    # override to update the position of the parent view's children
+    update: (sender) =>
+      # console.log 'update', sender
+      return if @skip
+
+    # returns true if the layout should't update
+    skip: () =>
+      true if @locked or (not @parent?.subviews)

   class SimpleLayout extends Layout
@@ -426,47 +432,40 @@
       attributes.types.spacing = 'number'
       attributes.types.inset = 'number'
       super(el, attributes)
-      @update()

     set_attribute: (attr) ->
       axis = switch attr
         when 'x' then 'width'
         when 'y' then 'height'
-      axis = 'width' if attr is 'x'
       attribute = attr
-#      console.log('set_attribute', attr, typeof attr)
+     # console.log('set_attribute', attr, typeof attr)
       @update()

     set_spacing: (space) ->
-#      console.log('set_spacing', space, typeof space)
+     # console.log('set_spacing', space, typeof space)
       spacing = space
       @update()

     set_inset: (i) ->
-#      console.log('set_spacing', space, typeof space)
+     # console.log('set_spacing', space, typeof space)
       inset = i
       @update()

     added: (child) ->
-#      console.log 'added', child
+     # console.log 'added', child
       child.bind(axis, @update)
       super(child)

-    update: (sender) ->
-      if @locked
-#        console.log 'locked'
-        return
-      subviews = @parent.subviews
-      if not subviews
-        return
-      super(sender)
+    update: (sender) =>
+      # console.log('skip', @skip, @locked)
+      return if @skip()
       pos = inset
       skip = true if sender
-      for subview in subviews
+      for subview in @parent.subviews
         if (skip and subview != sender)
-#          console.log 'skipping', subview
+          # console.log 'skipping', subview
         else
-#          console.log 'updating', subview, attribute, pos
+          # console.log 'updating', subview, @attribute, pos
           subview.setAttribute(attribute, pos) unless subview[attribute] == pos
           skip = false


fix photo picker buttons

fix photo picker buttons

--- Modules/PhotoPicker/PhotoPickerTable.coffee
+++ Modules/PhotoPicker/PhotoPickerTable.coffee
@@ -19,24 +19,24 @@
     })

     @addFromCameraButton = root.app.create("Button", {
+      text: "Take Photo"
+      left: 10
+      top: 10
+      bottom: 10
+      height: 34
+      width: 120
+      iconSettings: {
+        image: "/Common/Modules/PhotoPicker/Images/black/camera.png"
+        height: 20
+        width: 20
+        left: 5
+        right: 5
+      }
       style: {
         gradient: ["#EEE", "#CECECE"]
         borderColor: "#222"
         labelShadowColor: "#FFF"
-        labelText: "Take Photo"
         labelColor: "#222"
-        iconSettings: {
-          image: "/Common/Modules/PhotoPicker/Images/black/camera.png"
-          height: 20
-          width: 20
-          left: 5
-          right: 5
-        }
-        left: 10
-        top: 10
-        bottom: 10
-        height: 35
-        width: 120
       }
       onClickStyle: {
        gradient: ["#CECECE", "#EEE"]
@@ -46,24 +46,24 @@
     @buttons.add @addFromCameraButton.view

     @addFromGalleryButton = root.app.create("Button", {
+      text: "From Library"
+      right: 10
+      top: 10
+      bottom: 10
+      height: 34
+      width: 120
+      iconSettings: {
+        image: "/Common/Modules/PhotoPicker/Images/black/photos.png"
+        height: 20
+        width: 20
+        left: 5
+        right: 5
+      }
       style: {
         gradient: ["#EEE", "#CECECE"]
         borderColor: "#222"
         labelShadowColor: "#FFF"
-        labelText: "From Library"
         labelColor: "#222"
-        iconSettings: {
-          image: "/Common/Modules/PhotoPicker/Images/black/photos.png"
-          height: 20
-          width: 20
-          left: 5
-          right: 5
-        }
-        right: 10
-        top: 10
-        bottom: 10
-        height: 35
-        width: 120
       }
       onClickStyle: {
        gradient: ["#CECECE", "#EEE"]


Fix Application constructor.

Fix Application constructor.

--- system/Application.coffee
+++ system/Application.coffee
@@ -22,7 +22,6 @@
       @killHandlers = []
       @console = null # The main text I/O console for this application.
       throw "#{main} is not an application main module" if not @mod.initApp?
-      @obj.initApp(this) # Initialize the application.

     init: (id) ->
       @obj.initApp(this, id)


Update query after adding part-of-speech

--- app/assets/javascripts/rglossa/components/cwb-multiword-term.coffee
+++ app/assets/javascripts/rglossa/components/cwb-multiword-term.coffee
@@ -24,6 +24,7 @@
   addPos: (pos) ->
     @set('term.pos', pos)
     @get('tagsInput').addTag(pos.value)
+    @get('parentView').updateQuery()

   addFeature: (option, feature, pos) ->
     @get('term.features').pushObject
@@ -54,6 +55,6 @@
           # have to do this manually
           parentView = @get('parentView')
           parentView.displayedQueryDidChange()
-          parentView.updateQuery()

           break
+    parentView.updateQuery()


options.target option for up.visit

options.target option for up.visit

--- lib/assets/javascripts/up/link.js.coffee
+++ lib/assets/javascripts/up/link.js.coffee
@@ -98,13 +98,16 @@
   @method up.visit
   @param {String} url
     The URL to visit.
+  @param {String} [options.target='body']
+    The selector to replace.
+    See options for [`up.replace`](/up.flow#up.replace)
   @param {Object} options
     See options for [`up.replace`](/up.flow#up.replace)
   ###
   visit = (url, options) ->
-    u.debug "Visiting #{url}"
-    # options = util.options(options, )
-    up.replace('body', url, options)
+    options = u.options(options)
+    selector = u.option(options.target, 'body')
+    up.replace(selector, url, options)

   ###*
   Follows the given link via AJAX and replaces a CSS selector in the current page


Expose up.error as public API

Expose up.error as public API

--- lib/assets/javascripts/up/util.js.coffee
+++ lib/assets/javascripts/up/util.js.coffee
@@ -112,24 +112,44 @@
     element = document.createElement(tagName)
     element.innerHTML = html if isPresent(html)
     element
-
+
+  ###*
+  @method up.debug
+  @protected
+  ###
   debug = (message, args...) ->
     message = "[UP] #{message}"
     console.debug(message, args...)

+  ###*
+  @method up.warn
+  @protected
+  ###
   warn = (message, args...) ->
     message = "[UP] #{message}"
     console.warn(message, args...)

+  ###*
+  Throws a fatal error with the given message.
+
+  - The error will be printed to the [error console](https://developer.mozilla.org/en-US/docs/Web/API/Console/error)
+  - An [`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) (exception) will be thrown, unwinding the current call stack
+  - The error message will be printed in a corner of the screen
+
+  \#\#\#\# Examples
+
+      up.error('Division by zero')
+      up.error('Unexpected result %o', result)
+
+  @method up.error
+  ###
   error = (args...) ->
     args[0] = "[UP] #{args[0]}"
     console.error(args...)
     asString = stringifyConsoleArgs(args)
     $error = presence($('.up-error')) || $('

').prependTo('body')
-    # $error = $('body')
     $error.addClass('up-error')
     $error.text(asString)
-    # alert "#{asString}\n\nOpen the developer console for details."
     throw new Error(asString)

   CONSOLE_PLACEHOLDERS = /\%[odisf]/g
@@ -507,7 +527,7 @@
       deferred
     else
       $element.css(lastFrame)
-      resolvedPromise()
+      resolvedDeferred()

   ANIMATION_PROMISE_KEY = 'up-animation-promise'

@@ -963,3 +983,7 @@
   emptyJQuery: emptyJQuery

 )()
+
+up.error = up.util.error
+up.warn = up.util.warn
+up.debug = up.util.debug


Replace debug-plugin with debug-extra

Replace debug-plugin with debug-extra

--- lib/cl.coffee
+++ lib/cl.coffee
@@ -4,11 +4,13 @@
 # so it's OK to process them one by one like this
 # If one day we need to process more command line arguments,
 # it's better to find a 3rd party command line library to do this job.
+patternDebug = /^-(-debug|d)$/i
+patternDebugEx = /^--debug-extra=\w[\w-]*(,\w[\w-]*)*$/i
 process.argv.forEach (arg) ->
-  if /^-(-debug|d)$/i.test(arg)
+  if patternDebug.test(arg)
     process.env.DEBUG = 1
     console.log "Debug Mode"
-  else if /^--debug-plugin=\w[\w-]*$/i.test(arg)
+  else if patternDebugEx.test(arg)
     name = arg.split("=")[1]
-    process.env.DEBUG_PLUGIN = name
-    console.log "Debugging Plugin: #{name}"
+    process.env.DEBUG_EXTRA = name
+    console.log "Debugging Extra: #{name}"


Use coffeescript interpolation

Use coffeescript interpolation

--- test/test.app.coffee
+++ test/test.app.coffee
@@ -12,7 +12,7 @@
 casper.waitForSelector '.note', ->
   casper.test.info 'Testing denominations loaded on first run'

-  @test.assert @getCurrentUrl() == casper.TEST_URL + '#convert/EUR-USD',
+  @test.assert @getCurrentUrl() == '#{casper.TEST_URL}#convert/EUR-USD',
     'EUR and USD are the default currencies'

   @test.assertEval ->


Added Danish translations to Chat (#2450)

Thanks a lot to @Chikachi 😍!

--- public/assets/chat/chat.coffee
+++ public/assets/chat/chat.coffee
@@ -184,6 +184,23 @@
     state: 'offline'
     initialQueueDelay: 10000
     translations:
+      'da':
+        'Chat with us!': 'Chat med os!'
+        'Scroll down to see new messages': 'Scroll ned for at se nye beskeder'
+        'Online': 'Online'
+        'Offline': 'Offline'
+        'Connecting': 'Forbinder'
+        'Connection re-established': 'Forbindelse genoprettet'
+        'Today': 'I dag'
+        'Send': 'Send'
+        'Chat closed by %s': 'Chat lukket af %s'
+        'Compose your message...': 'Skriv en besked...'
+        'All colleagues are busy.': 'Alle kollegaer er optaget.'
+        'You are on waiting list position %s.': 'Du er i venteliste som nummer %s.'
+        'Start new conversation': 'Start en ny samtale'
+        'Since you didn\'t respond in the last %s minutes your conversation with %s got closed.': 'Da du ikke har svaret i de sidste %s minutter er din samtale med %s blevet lukket.'
+        'Since you didn\'t respond in the last %s minutes your conversation got closed.': 'Da du ikke har svaret i de sidste %s minutter er din samtale blevet lukket.'
+        'We are sorry, it takes longer as expected to get an empty slot. Please try again later or send us an email. Thank you!': 'Vi beklager, det tager længere end forventet at få en ledig plads. Prøv venligst igen senere eller send os en e-mail. På forhånd tak!'
       'de':
         'Chat with us!': 'Chatte mit uns!'
         'Scroll down to see new messages': 'Scrolle nach unten um neue Nachrichten zu sehen'


Fix a typo

Fix a typo

--- app/templates/app/models/entry.coffee
+++ app/templates/app/models/entry.coffee
@@ -14,4 +14,4 @@
 EntrySchema.statics.all = ->
   this.find().sort({_id: -1})

-mongoose.model 'Article', EntrySchema
+mongoose.model 'Entry', EntrySchema


remove console.clear()

remove console.clear()

--- client/app/Applications/Activity.kdapplication/AppController.coffee
+++ client/app/Applications/Activity.kdapplication/AppController.coffee
@@ -58,7 +58,6 @@
       @ready @bound "populateActivity"

     @emit 'ready'
-    console.clear()

   resetAll:->
     @lastTo    = null


CollaborativeWorkspace: Proper variable to get state of is old session.

--- client/landing/CollaborativeWorkspace/collaborativeworkspace.coffee
+++ client/landing/CollaborativeWorkspace/collaborativeworkspace.coffee
@@ -47,7 +47,8 @@
       cb = =>
         isOldSession = keys = snapshot.val()?.keys
         if isOldSession
-          @sessionData = keys
+          @isOldSession = yes
+          @sessionData  = keys
           @createPanel()
         else
           @createPanel()


Modified in browser at pixie.strd6.com

Modified in browser at pixie.strd6.com

--- test/flickerable.coffee
+++ test/flickerable.coffee
@@ -28,14 +28,10 @@

   equals player.I.alpha, 0.2

-  5.times ->
+  4.times ->
     player.update()

   equals player.I.alpha, 0.9

-  5.times ->
-    player.update()
-
-  equals player.I.alpha, 0.2
-
+
 module()


Modified in browser at pixie.strd6.com

Modified in browser at pixie.strd6.com

--- test/game_object.coffee
+++ test/game_object.coffee
@@ -75,6 +75,6 @@
     ok true, "destroyed event is fired on destroy"

   o.destroy()
-  o.destroy() #
+  o.destroy() # Make sure it's not called twice

 module()


test: clarify why we create 10 million reservations

--- test/reservation.coffee
+++ test/reservation.coffee
@@ -74,10 +74,10 @@
       return cb null, 'patience_is_bitter_but_fruit_is_sweet'

 describe 'ReserveResource', ->
-  it "doesn't leak memory", ->
-    # Essentially just asserting that we can instantiate 10 milliion ReserveResources without
-    # running out of memory, so not quite the same as actuall testing for memory leaks, but good
-    # enough.
+  it "allows you to create a bunch of reservations", ->
+    # Reasons it might fail:
+    #  * memory leaks
+    #  * connection limits
     for i in [0...10000000]
       resource = new ReserveResource 'some worker', process.env.REDIS_HOST, process.env.REDIS_PORT
       resource._init_redis()


fix room publication

fix room publication

--- server/startup/roomPublishes.coffee
+++ server/startup/roomPublishes.coffee
@@ -19,15 +19,7 @@

 		if RocketChat.authz.hasPermission(this.userId, 'view-join-code')
 			options.fields.joinCode = 1
-
-		if RocketChat.authz.hasPermission(this.userId, 'view-c-room')
-			return RocketChat.models.Rooms.findByTypeAndName 'c', identifier, options
-		else if RocketChat.authz.hasPermission(this.userId, 'view-joined-room')
-			roomId = RocketChat.models.Subscriptions.findByTypeNameAndUserId('c', identifier, this.userId).fetch()
-			if roomId.length > 0
-				return RocketChat.models.Rooms.find(roomId[0]?.rid, options)
-
-		return this.ready()
+		return RocketChat.models.Rooms.find({}, options)

 	RocketChat.roomTypes.setPublish 'p', (identifier) ->
 		options =
@@ -46,8 +38,9 @@
 				sysMes: 1
 				details: 1

-		user = RocketChat.models.Users.findOneById this.userId, fields: username: 1
-		return RocketChat.models.Rooms.findByTypeAndNameContainingUsername 'p', identifier, user.username, options
+		return RocketChat.models.Rooms.find({}, options)
+		#user = RocketChat.models.Users.findOneById this.userId, fields: username: 1
+		#return RocketChat.models.Rooms.findByTypeAndNameContainingUsername 'p', identifier, user.username, options

 	RocketChat.roomTypes.setPublish 'd', (identifier) ->
 		options =
@@ -61,7 +54,4 @@
 				jitsiTimeout: 1
 				details: 1

-		user = RocketChat.models.Users.findOneById this.userId, fields: username: 1
-		if RocketChat.authz.hasAtLeastOnePermission(this.userId, ['view-d-room', 'view-joined-room'])
-			return RocketChat.models.Rooms.findByTypeContainigUsernames 'd', [user.username, identifier], options
-		return this.ready()
+		return RocketChat.models.Rooms.find({}, options)


clear ivars after each run and close opened files

--- parsers/file_parser.coffee
+++ parsers/file_parser.coffee
@@ -2,7 +2,7 @@
 # Modules
 #

-fs         = require('graceful-fs')
+fs         = require('fs')
 path       = require('path')
 marked     = require('marked')
 _          = require('underscore')
@@ -27,7 +27,8 @@
   projectDir: path.join(__dirname, '..', '..')

   parse: (file, failed) ->
-    console.log "Parsing files...\n\n\n"
+    App.failures = []
+    console.log "Parsing files referenced in #{file.name}...\n\n\n"
     @currentPath = file.fullParentDir

     output = fs.readFileSync file.fullPath, 'utf-8'
@@ -44,12 +45,13 @@
       @sameDirMarkdowns.push sameDirMarkdownFileMatch[1] if sameDirMarkdownFileMatch
       @otherDirMarkdowns.push otherDirMarkdownFileMatch[1] if otherDirMarkdownFileMatch

-
     @checkRelativeImages(@relativeImages, file.fullPath)
     @checkSameDirMarkdowns(@sameDirMarkdowns, @currentPath, file.fullPath)
     @checkOtherDirMarkdowns(@otherDirMarkdowns, @currentPath, file.fullPath)

     failed = if App.failures.length then true else false
+    @relativeImages = @sameDirMarkdowns = @otherDirMarkdowns = []
+
     failed

   checkRelativeImages: (images, refFile) ->
@@ -60,13 +62,13 @@
       catch err
         @printErrorAndReturnFailure(file, refFile)

-  checkSameDirMarkdowns: (files, curPath, fullPath) ->
+  checkSameDirMarkdowns: (files, curPath, refFile) ->
     _.each files, (file) =>
       try
         fd = fs.openSync path.join(curPath, file), 'r'
         fs.closeSync(fd)
       catch err
-        @printErrorAndReturnFailure(file, fullPath)
+        @printErrorAndReturnFailure(file, refFile)

   checkOtherDirMarkdowns: (files, curPath, refFile) ->
     _.each files, (file) =>


Docs: bootstrapping improved, added first two singletons and router support

--- docs/src/main.coffee
+++ docs/src/main.coffee
@@ -1,4 +1,22 @@
 MainView = require './views/mainview'

 # bootstrap the thing.
-do -> new MainView+do ->
+  KD.registerSingleton 'router',   new KDRouter
+  KD.registerSingleton 'mainView', new MainView
+
+  {router, mainView} = KD.singletons
+
+  handleRoute = ({params : {page, section}, query}) ->
+
+    log page, section, query
+
+    mainView.showPage page, section
+
+  # add the routes
+  router.addRoutes
+    '/:page?'         : handleRoute
+    '/:page/:section' : handleRoute
+
+
+  router.listen()


Workaround for css bug of electron 0.37

Workaround for css bug of electron 0.37

--- views/services/layout.cjsx
+++ views/services/layout.cjsx
@@ -38,6 +38,7 @@
     """
     poi-app {
       height: #{window.innerHeight}px;
+      width: 0px;
     }
     poi-app div.poi-app-tabpane {
       height: #{tabpaneHeight};


disable webmention verification

disable webmention verification

--- views/to-verify/map.coffee
+++ views/to-verify/map.coffee
@@ -3,5 +3,5 @@
     if doc.from and doc.srcid
       emit doc.timestamp, [doc.from, doc.srcid]

-    else if doc.webmention
-      emit doc.timestamp, doc.from
+    #else if doc.webmention
+    #  emit doc.timestamp, doc.from


Work with default-production Tango endpoint

--- config/config.coffee
+++ config/config.coffee
@@ -57,7 +57,8 @@
         "Basic " + btoa(user + ":" + pass)

     tangocard_get: (url, success, error) ->
-        fullurl = @HUBOT_TANGOCARD_ROOTURL() + url
+        baseurl = @HUBOT_TANGOCARD_ROOTURL() || 'https://api.tangocard.com/raas/v1/'
+        fullurl = "#{baseurl}#{url}"
         $.ajax
             type: 'GET'
             url: fullurl
@@ -68,7 +69,8 @@
                 Authorization: @basic_auth()

     tangocard_post: (url, data, success, error) ->
-        fullurl = @HUBOT_TANGOCARD_ROOTURL() + url
+        baseurl = @HUBOT_TANGOCARD_ROOTURL() || 'https://api.tangocard.com/raas/v1/'
+        fullurl = "#{baseurl}#{url}"
         $.ajax
             type: 'POST'
             url: fullurl


Fixed indendation on allowed actions

Fixed indendation on allowed actions

--- snippets/ssf_4-0_.cson
+++ snippets/ssf_4-0_.cson
@@ -243,7 +243,7 @@
      */
     private static \\$allowed_actions = [
     \t\'${1}\' => ${2:true}
-  ];
+    ];
     """
   'hide_ancestor':
     'prefix': 'hide_ancestor'


Don't append 'Email' to route name

Don't append 'Email' to route name

--- emails.coffee
+++ emails.coffee
@@ -350,10 +350,11 @@
       #    /emails/preview/sampleTemplate/:param
       #
       # Also capitalize the first character in the template name for
-      # the name of the route.
+      # the name of the route, so it will look like `previewSample` for a
+      # template named `sample`.
       path = "#{settings.routePrefix}/#{type}" + template.route.path
       name = Utils.capitalizeFirstChar(template.name)
-      routeName = "#{type}#{name}Email"
+      routeName = "#{type}#{name}"

       Utils.Logger.info "Add route: [#{routeName}] at path /" + path, TAG


do better things :p

do better things :p

--- js/src/http/ObjectSearchKeyApi.coffee
+++ js/src/http/ObjectSearchKeyApi.coffee
@@ -34,9 +34,6 @@
         return response.data

     getIndexPair: ( id ) ->
-      Requests.getAsBlobFromUrl(sharingPairUrl() + '/' + id)
-      .then (response) ->
-        log.info('uploadSharingPair', { id } )
-        return response.data
+      return Requests.getAsBlobFromUrl(sharingPairUrl() + '/' + id)

   return ObjectSearchKeyApi


Node modules koding: fix wrong argument name

--- node_modules_koding/bongo/lib/expressify.coffee
+++ node_modules_koding/bongo/lib/expressify.coffee
@@ -15,7 +15,7 @@
   )

   userRules   = KONFIG.nodejsRateLimiter.userRules
-  rateLimiter = new RateLimit(redisClient, rules)
+  rateLimiter = new RateLimit redisClient, userRules

   bongo = this

@@ -31,7 +31,7 @@
     return callback no  unless KONFIG.nodejsRateLimiter.enabled

     if /^guest-/.test id
-      guestRules = KONFIG.nodejsRateLimiter.guestRules
+      guestRules        = KONFIG.nodejsRateLimiter.guestRules
       rateLimiter.rules = rateLimiter.convertRules guestRules

     rateLimiter.incr id, (err, isRateLimited) ->


remove empty lines

remove empty lines

--- app/assets/javascripts/chaltron/datatables.js.coffee
+++ app/assets/javascripts/chaltron/datatables.js.coffee
@@ -40,7 +40,6 @@
       ]
     })

-
     # datatable class
     div = $('table.datatable')
     @initTable(container: div)
@@ -58,7 +57,6 @@
 $(document).on 'page:change', ->
   table = new DataTableBuilder
   table.go()
-

 # specify date format (for sorting)
 $.fn.dataTable.moment('DD MMM HH:mm')


Disable jQuery cache on console

Disable jQuery cache on console

--- app/assets/javascripts/garage/docs/console.js.coffee
+++ app/assets/javascripts/garage/docs/console.js.coffee
@@ -66,6 +66,7 @@
     $.ajax
       type: $('#method').val(),
       url: url,
+      cache: false,
       data: buildData($('.parameters')),
       dataType: 'json',
       success: (data, textStatus, xhr) ->


Hotfix for render bug

Hotfix for render bug

--- app/assets/javascripts/oxalis/view/plane_view.coffee
+++ app/assets/javascripts/oxalis/view/plane_view.coffee
@@ -191,9 +191,8 @@
   setActivePlane : (planeID) =>
     @flycam.setActivePlane planeID
     for i in [0..2]
-      catcherStyle = $(".inputcatcher")[i].style
-      #catcherStyle.borderColor  = "#f8f800"   #  else "#C7D1D8"
       $(".inputcatcher")[i].style.borderWidth = if i==planeID then "2px" else "0px"
+    @flycam.hasChanged = true

   getCameras : =>
     @camera


Fix get users

Fix get users

--- scripts/circular.coffee
+++ scripts/circular.coffee
@@ -95,7 +95,7 @@
     @users: ->
       return ["user1", "user2", "user3"] if DEBUG
       users = []
-      for id, user of robot.brain.users
+      for id, user of robot.brain.users()
         users.push user.name
       users


Update yale-home-page.cjsx

Update yale-home-page.cjsx

--- app/assets/javascripts/components/yale-home-page.cjsx
+++ app/assets/javascripts/components/yale-home-page.cjsx
@@ -28,12 +28,11 @@

-                  Help build a database of Yale theater history in New Haven
+                  Help create a database of Yale theater history

-                  Onboarding instructions for user. Cras imperdiet auctor convallis.
-                  Nulla fermentum vitae leo venenatis interdum.
+                  Identify and transcribe important roles, dates, titles and more from 90 years of digitized performance programs in the Yale University Library. Get started with one of these two tasks:


Fix glitching of axis which are related to the merit order

Fixes: #2047

--- app/assets/javascripts/lib/views/d3_chart_view.coffee
+++ app/assets/javascripts/lib/views/d3_chart_view.coffee
@@ -24,7 +24,7 @@

     if @model.get('requires_merit_order')
       @check_merit_enabled()
-      @drawn = false
+      @drawn = App.settings.merit_order_enabled()

     @refresh()


Added updateTotals() to Order model

Added updateTotals() to Order model

--- app/assets/javascripts/sprangular/models/order.coffee
+++ app/assets/javascripts/sprangular/models/order.coffee
@@ -42,6 +42,9 @@
   hasVariant: (variant) ->
     variant && @findVariant(variant.id).length > 0

+  updateTotals: ->
+    @total = @itemTotal + @taxTotal + @shipTotal
+
   actualShippingAddress: ->
     if @shipToBillAddress
       @billingAddress


show/hide #applicationsList by CSS selector instead of using the view this., that didn't seem to work because it's actually an element inside the hidden container.

--- app/assets/javascripts/views/applications/menu.coffee
+++ app/assets/javascripts/views/applications/menu.coffee
@@ -22,9 +22,9 @@

   onAdd: ->
     if @collection.length > 0
-      @$el.show()
+      $("#applicationsList").show()
     else
-      @$el.hide()
+      $("#applicationsList").hide()

   initialize: ->
     @listenTo @collection, "add", @onAdd


Render: Add option to unbind all textures on each mesh to circumvent some problems.

--- engine/render.coffee
+++ engine/render.coffee
@@ -80,6 +80,8 @@
         @background_alpha = if ba? then ba else 1
         @compiled_shaders_this_frame = 0
         @use_frustum_culling = true
+        @unbind_textures_on_draw_mesh = false
+        @unbind_textures_on_draw_wiewport = true
         @probes = []

         # Temporary variables
@@ -487,11 +489,20 @@
         inv_radius_y = 2/inv_radius_y
         inv_radius_z = 2/inv_radius_z

+        # TODO: This was added to workaround a problem with meshes
+        # cloned from another scene; it shouldn't be necessary
+        if @unbind_textures_on_draw_mesh
+            # unbind all textures
+            for tex, i in @bound_textures when tex?
+                tex.bound_unit = -1
+                gl.activeTexture gl.TEXTURE0 + i
+                gl.bindTexture tex.gl_target, null
+            gl.activeTexture gl.TEXTURE0
+            @active_texture = @next_texture = 0
+            @bound_textures.splice 0
+
         # Main routine for each submesh
-        submesh_idx = -1
-
-        for mat in amesh.materials
-            submesh_idx += 1
+        for mat,submesh_idx in amesh.materials
             if not (pass_ == -1 or mesh.passes[submesh_idx] == pass_)
                 continue

@@ -678,15 +689,16 @@
         # For usage outside this render loop
         mat4.mul cam.world_to_screen_matrix, cam.projection_matrix, world2cam

-        # unbind all textures
         # TODO: Is this necessary?
-        for tex, i in @bound_textures when tex?
-            tex.bound_unit = -1
-            gl.activeTexture gl.TEXTURE0 + i
-            gl.bindTexture tex.gl_target, null
-        gl.activeTexture gl.TEXTURE0
-        @active_texture = @next_texture = 0
-        @bound_textures.splice 0
+        if @unbind_textures_on_draw_wiewport
+            # unbind all textures
+            for tex, i in @bound_textures when tex?
+                tex.bound_unit = -1
+                gl.activeTexture gl.TEXTURE0 + i
+                gl.bindTexture tex.gl_target, null
+            gl.activeTexture gl.TEXTURE0
+            @active_texture = @next_texture = 0
+            @bound_textures.splice 0

         {mesh_lod_min_length_px} = @context


hub: get text file -- use utf not ascii!

--- salvus/hub.coffee
+++ salvus/hub.coffee
@@ -2544,7 +2544,7 @@
                             @error_to_client(id:mesg.id, error:err)
                         else
                             # since this is get_text_file
-                            data = data.toString('ascii')
+                            data = data.toString('utf-8')
                             @push_to_client(message.public_text_file_contents(id:mesg.id, data:data))


Warm cache with one themes

Warm cache with one themes

--- build/tasks/prebuild-less-task.coffee
+++ build/tasks/prebuild-less-task.coffee
@@ -8,14 +8,35 @@
     prebuiltConfigurations = [
       ['atom-dark-ui', 'atom-dark-syntax']
       ['atom-dark-ui', 'atom-light-syntax']
+      ['atom-dark-ui', 'one-dark-syntax']
+      ['atom-dark-ui', 'one-light-syntax']
       ['atom-dark-ui', 'solarized-dark-syntax']
       ['atom-dark-ui', 'base16-tomorrow-dark-theme']
       ['atom-dark-ui', 'base16-tomorrow-light-theme']
+
       ['atom-light-ui', 'atom-light-syntax']
       ['atom-light-ui', 'atom-dark-syntax']
+      ['atom-light-ui', 'one-dark-syntax']
+      ['atom-light-ui', 'one-light-syntax']
       ['atom-light-ui', 'solarized-dark-syntax']
       ['atom-light-ui', 'base16-tomorrow-dark-theme']
       ['atom-light-ui', 'base16-tomorrow-light-theme']
+
+      ['one-dark-ui', 'one-dark-syntax']
+      ['one-dark-ui', 'one-light-syntax']
+      ['one-dark-ui', 'atom-dark-syntax']
+      ['one-dark-ui', 'atom-light-syntax']
+      ['one-dark-ui', 'solarized-dark-syntax']
+      ['one-dark-ui', 'base16-tomorrow-dark-theme']
+      ['one-dark-ui', 'base16-tomorrow-light-theme']
+
+      ['one-light-ui', 'one-light-syntax']
+      ['one-light-ui', 'one-dark-syntax']
+      ['one-light-ui', 'atom-light-syntax']
+      ['one-light-ui', 'atom-dark-syntax']
+      ['one-light-ui', 'solarized-dark-syntax']
+      ['one-light-ui', 'base16-tomorrow-dark-theme']
+      ['one-light-ui', 'base16-tomorrow-light-theme']
     ]

     directory = path.join(grunt.config.get('atom.appDir'), 'less-compile-cache')


Removed debugging.

Removed debugging.

--- app/assets/javascripts/app/controllers/_channel/chat.coffee
+++ app/assets/javascripts/app/controllers/_channel/chat.coffee
@@ -118,8 +118,6 @@
     @updateParams()

   updateParams: =>
-    console.log('id', @id)
-
     quote = (value) ->
       if value.replace
         value = value.replace('\'', '\\\'')


Moved to new asset feature.

Moved to new asset feature.

--- app/assets/javascripts/app/controllers/navigation.js.coffee
+++ app/assets/javascripts/app/controllers/navigation.js.coffee
@@ -92,24 +92,8 @@
         processData: true,
         success: (data, status, xhr) =>

-          # load user collection
-          if data.load.users
-            App.Collection.load( type: 'User', data: data.load.users )
-
-          # load user collection
-          if data.load.organizations
-            for organization_id, organization of data.load.organizations
-              if organization.user_ids
-                organization.users = []
-                for user_id in organization.user_ids
-                  user = App.User.find( user_id )
-                  organization.users.push user
-            App.Collection.load( type: 'Organization', data: data.load.organizations )
-
-
-          # load ticket collection
-          if data.load.tickets
-            App.Collection.load( type: 'Ticket', data: data.load.tickets )
+          # load collections
+          App.Event.trigger 'loadAssets', data.assets

           @result = data.result
           for area in @result


#133 use PUT for writing data

#133 use PUT for writing data

--- app/assets/javascripts/oxalis/model/binary/pushqueue.coffee
+++ app/assets/javascripts/oxalis/model/binary/pushqueue.coffee
@@ -111,7 +111,7 @@

     if @socket? then @socket else @socket = new ArrayBufferSocket(
       senders : [
-        new ArrayBufferSocket.XmlHttpRequest("/datasets/#{@dataSetName}/layers/#{@dataLayerName}/data?cubeSize=#{1 << @cube.BUCKET_SIZE_P}&annotationId=#{@tracingId}", "POST")
+        new ArrayBufferSocket.XmlHttpRequest("/datasets/#{@dataSetName}/layers/#{@dataLayerName}/data?cubeSize=#{1 << @cube.BUCKET_SIZE_P}&annotationId=#{@tracingId}", "PUT")
       ]
       requestBufferType : Uint8Array
       responseBufferType : Uint8Array


Added missing $location service to SignUpCtrl dependencies

--- app/assets/javascripts/sprangular/controllers/signup.coffee
+++ app/assets/javascripts/sprangular/controllers/signup.coffee
@@ -1,4 +1,4 @@
-Sprangular.controller 'SignupCtrl', ($scope, Account, Status, Flash) ->
+Sprangular.controller 'SignupCtrl', ($scope, $location, Account, Status, Flash) ->

   $scope.user = { email: '', password: '', password_confirmation: '', errors: {} }
   $scope.signingUp = false


work on the router

work on the router

--- core/KDRouter.coffee
+++ core/KDRouter.coffee
@@ -6,7 +6,7 @@

   getHashFragment =(url)-> url.substr url.indexOf '#'

-  handleNotFound =(route)-> @handleNotFound? route
+  handleNotFound =(route)=> @handleNotFound? route

   changeRoute =(frag)->
     node = tree
@@ -28,12 +28,18 @@
     if listeners?.length
       listener.call null, params for listener in listeners

+  window.addEventListener 'popstate', (event)->
+    console.log event
+    console.log location
+
   window.addEventListener 'hashchange', (event)->
     changeRoute getHashFragment(event.newURL)

   @init =-> changeRoute location.hash.substr 1 if location.hash.length

   @handleNotFound =-> log "The route #{route} was not found!"
+
+  @handleRoute =(route)-> changeRoute route

   @addRoutes =(routes)->
     @addRoute route, listener for own route, listener of routes


Modified in browser at pixie.strd6.com

Modified in browser at pixie.strd6.com

--- test/engine_camera.coffee
+++ test/engine_camera.coffee
@@ -17,9 +17,18 @@
   equal engine.I.cameraTransform.b, 0
   equal engine.I.cameraTransform.c, 0
   equal engine.I.cameraTransform.d, 1
+  equal engine.I.cameraTransform.tx, 0
+  equal engine.I.cameraTransform.ty, 0

   engine.follow(gameObject, "centered")

   engine.update()

+  equal engine.I.cameraTransform.a, 1
+  equal engine.I.cameraTransform.b, 0
+  equal engine.I.cameraTransform.c, 0
+  equal engine.I.cameraTransform.d, 1
+  equal engine.I.cameraTransform.tx, (App.width / 2) - gameObject.I.x
+  equal engine.I.cameraTransform.ty, (App.height / 2) - gameObject.I.y
+
 module()


update factoids tests

update factoids tests

update tests for factoids command

--- test/factoids_test.coffee
+++ test/factoids_test.coffee
@@ -54,7 +54,7 @@
       expect(spies.respond).to.have.been.calledWith(/remember (.{3,})/i)

     it 'registered respond factoids', ->
-      expect(spies.respond).to.have.been.calledWith(/factoids/i)
+      expect(spies.respond).to.have.been.calledWith(/factoids?/i)

     it 'registered respond alias', ->
       expect(spies.respond).to.have.been.calledWith(/alias (.{3,}) = (.{3,})/i)
@@ -116,10 +116,8 @@
     adapter.receive(new TextMessage user, 'hubot: remember foo')

   it 'responds to factoids', (done) ->
-    adapter.receive(new TextMessage user, 'hubot: learn foo = bar')
-
     adapter.on 'reply', (envelope, strings) ->
-      expect(strings[0]).to.match /http:\/\/not-yet-set\/hubot\/factoids/
+      expect(strings[0]).to.match /http:\/\/not-yet-set\/.*\/factoids/
       done()

     adapter.receive(new TextMessage user, 'hubot: factoids')


Improve oembed server side to decode compressed contents

--- packages/rocketchat-oembed/server/server.coffee
+++ packages/rocketchat-oembed/server/server.coffee
@@ -1,7 +1,11 @@
 URL = Npm.require('url')
 http = Npm.require('http')
 https = Npm.require('https')
+zlib = Npm.require('zlib')
 querystring = Npm.require('querystring')
+
+gunzipSync = Meteor.wrapAsync zlib.gunzip.bind(zlib)
+inflateSync = Meteor.wrapAsync zlib.inflate.bind(zlib)

 OEmbed = {}

@@ -15,9 +19,8 @@
 		hostname: urlObj.hostname
 		path: urlObj.path
 		rejectUnauthorized: !RocketChat.settings.get 'Allow_Invalid_SelfSigned_Certs'
-		headers: {
+		headers:
 			'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2227.0 Safari/537.36'
-		}

 	httpOrHttps = if urlObj.protocol is 'https:' then https else http

@@ -27,7 +30,7 @@
 		requestOptions: opts
 		parsedUrl: parsedUrl

-	request = httpOrHttps.request opts, (response) ->
+	request = httpOrHttps.request opts, Meteor.bindEnvironment (response) ->
 		if response.statusCode is 301 and response.headers.location?
 			request.abort()
 			console.log response.headers.location
@@ -41,16 +44,26 @@
 		if response.statusCode isnt 200
 			return callback null, {parsedUrl: parsedUrl}

-		str = ''
+		chunks = []
+		chunksTotalLength = 0
 		response.on 'data', (chunk) ->
-			str += chunk
-			if str.length > 250000
+			chunks.push chunk
+			chunksTotalLength += chunk.length
+			if chunksTotalLength > 250000
 				request.abort()

-		response.on 'end', ->
+		response.on 'end', Meteor.bindEnvironment ->
+			buffer = Buffer.concat(chunks)
+
+			try
+				if response.headers['content-encoding'] is 'gzip'
+					buffer = gunzipSync buffer
+				else if response.headers['content-encoding'] is 'deflate'
+					buffer = inflateSync buffer
+
 			callback null, {
 				headers: response.headers
-				body: str
+				body: buffer.toString()
 				parsedUrl: parsedUrl
 			}


Fix util/inspect with RegExps in node.js.

--- application/chrome/content/wesabe/util/inspect.coffee
+++ application/chrome/content/wesabe/util/inspect.coffee
@@ -148,7 +148,7 @@
   style 'shell', string, opts

 inspectRegExp = (regexp, opts) ->
-  style 'regexp', regexp.toSource(), opts
+  style 'regexp', regexp.toString(), opts

 inspectElement = (element, opts) ->
   attrs = (" #{nodeName}#{style 'punct', '=', opts}#{inspect nodeValue, undefined, undefined, opts}" for {nodeName, nodeValue} in element.attributes).join('')


removing datetime on objects, grabbing new event with new random datetime

--- events.coffee
+++ events.coffee
@@ -1,147 +1,113 @@
 sampleEvents = [
 	{
 		description: "Audrey Oliver signed into Salesforce"
-		datetime: "7/21/15 12:54 PM"
 	}
 	{
 		description: "Audrey Oliver failed to sign into Salesforce"
-		datetime: "7/20/15 7:17 AM"
 	}
 	{
 		description: "Audrey Oliver had a suspicious sign in into Salesforce"
-		datetime: "7/19/15 1:40 AM"
 	}
 	{
 		description: "Audrey Oliver attempted to reset their password, but is currently blocked"
-		datetime: "7/17/15 8:03 PM"
 	}
 	{
 		description: "Audrey Oliver attempted to reset their password, but abandoned the attempt"
-		datetime: "7/16/15 2:26 PM"
 	}
 	{
 		description: "Audrey Oliver attempted to reset their password, but cancelled the attempt"
-		datetime: "7/15/15 8:49 AM"
 	}
 	{
 		description: "Audrey Oliver attempted to reset their password, and contacted the admin"
-		datetime: "7/14/15 3:12 AM"
 	}
 	{
 		description: "Audrey Oliver failed to reset their password"
-		datetime: "7/12/15 9:35 PM"
 	}
 	{
 		description: "Audrey Oliver successfully reset their password"
-		datetime: "7/11/15 3:58 PM"
 	}
 	{
 		description: "Audrey Oliver registered for password reset"
-		datetime: "7/10/15 10:21 AM"
 	}
 	{
 		description: "Clifford Word created Audrey Oliver"
-		datetime: "7/9/15 4:44 AM"
 	}
 	{
 		description: "Clifford Word updated Audrey Oliver's display name"
-		datetime: "7/7/15 11:07 PM"
 	}
 	{
 		description: "Clifford Word deleted Audrey Oliver"
-		datetime: "7/6/15 5:30 PM"
 	}
 	{
 		description: "Clifford Word created the Sales group"
-		datetime: "7/5/15 11:53 AM"
 	}
 	{
 		description: "Clifford Word updated the Sales group's display name"
-		datetime: "7/4/15 6:16 AM"
 	}
 	{
 		description: "Clifford Word deleted the Sales group"
-		datetime: "7/3/15 12:39 AM"
 	}
 	{
 		description: "Audrey Oliver requested to join the Sales group"
-		datetime: "7/1/15 7:02 PM"
 	}
 	{
 		description: "Clifford Word approved Audrey Oliver's request to join the Sales group"
-		datetime: "6/30/15 1:25 PM"
 	}
 	{
 		description: "Clifford Word rejected Audrey Oliver's request to join the Sales group"
-		datetime: "6/29/15 7:48 AM"
 	}
 	{
 		description: "Clifford Word added Audrey Oliver to the Sales group"
-		datetime: "6/28/15 2:11 AM"
 	}
 	{
 		description: "Clifford Word removed Audrey Oliver to the Sales group"
-		datetime: "6/26/15 8:34 PM"
 	}
 	{
 		description: "Clifford Word created Salesforce"
-		datetime: "6/25/15 2:57 PM"
 	}
 	{
 		description: "Clifford Word updated Salesforce's display name"
-		datetime: "6/24/15 9:20 AM"
 	}
 	{
 		description: "Clifford Word deleted Salesforce"
-		datetime: "6/23/15 3:43 AM"
 	}
 	{
 		description: "Clifford Word assigned Audrey Oliver to Salesforce"
-		datetime: "6/21/15 10:06 PM"
 	}
 	{
 		description: "Clifford Word updated Audrey Oliver's Salesforce credentials/role"
-		datetime: "6/20/15 4:30 PM"
 	}
 	{
 		description: "Clifford Word removed Audrey Oliver from Salesforce"
-		datetime: "6/19/15 10:53 AM"
 	}
 	{
 		description: "Audrey Oliver's Salesforce password was successfully rolled over"
-		datetime: "6/18/15 5:16 AM"
 	}
 	{
 		description: "Audrey Oliver's Salesforce password failed to roll over"
-		datetime: "6/16/15 11:39 PM"
 	}
 	{
 		description: "Audrey Oliver was provisioned into Salesforce"
-		datetime: "6/15/15 6:02 PM"
 	}
 	{
 		description: "Audrey Oliver failed to be provisioned into Salesforce"
-		datetime: "6/14/15 12:25 PM"
 	}
 	{
 		description: "Wingtip Toys was created"
-		datetime: "6/13/15 6:48 AM"
 	}
 	{
 		description: "Clifford Word updated Wingtip Toys's display name"
-		datetime: "6/12/15 1:11 AM"
 	}
 ]

-
 randomDate = (start, end) ->
-	new Date(start.getTime() + Math.random() * (end.getTime() - start.getTime()))
+	# gets a date between the start & end time
+	return new Date(start.getTime() + (Math.random() * (end.getTime() - start.getTime())))

 events = []

 for i in [0..100]
+	event = {}
 	event = sampleEvents[Math.floor(Math.random() * sampleEvents.length)]
-	Math.seedrandom()
-	newDatetime = randomDate(new Date(2012, 0, 1), new Date())
-	event["datetime"] = newDatetime
-	events.push(event)
+	event["datetime"] = randomDate(new Date(2012, 0, 1), new Date())
+	events.push(clone(event))


Configure linter

Configure linter

--- etc/atom/config.cson
+++ etc/atom/config.cson
@@ -34,6 +34,10 @@
   linter:
     lintOnChange: false
     showErrorPanel: false
+    showErrorTabFile: false
+    showErrorTabProject: false
+    statusIconPosition: "Right"
+    statusIconScope: "File"
   "linter-jshint":
     lintInlineJavaScript: true
   "symbols-tree-view":


BuildExpressionFromJavascriptObject now takes array, cleans up array checking logic

--- javascripts/lib/math/build_expression_from_javascript_object.coffee
+++ javascripts/lib/math/build_expression_from_javascript_object.coffee
@@ -19,9 +19,9 @@

       process: (object_to_convert)->
         return @blank_builder.build() unless object_to_convert
-        if object_to_convert.length != undefined && typeof object_to_convert != "string"
+        if object_to_convert instanceof Array
           exp = @expression_builder.build()
-          @processExpression(exp, object_to_convert)
+          @processExpressionParts(exp, object_to_convert)
         else
           switch typeof(object_to_convert)
             when "number" then @number_builder.build(value: object_to_convert)
@@ -52,6 +52,7 @@

     BuildExpressionFromJavascriptObject.buildExpression = ->
       builder = BuildExpressionFromJavascriptObject.build()
-      builder.process(arguments)
+      arguments_as_array = Array.prototype.slice.call(arguments, 0)
+      builder.process(arguments_as_array)

     return BuildExpressionFromJavascriptObject


Fixes bug in js object expression dsl which caused it to create too many extra expressions

--- javascripts/lib/math/build_expression_from_javascript_object.coffee
+++ javascripts/lib/math/build_expression_from_javascript_object.coffee
@@ -18,7 +18,8 @@
         @blank_builder = @opts.blank_builder || components.blank
         @multiplication_builder = @opts.multiplication_builder || components.multiplication

-      process: (object_to_convert)->
+
+      proc_method = (object_to_convert)->
         return @blank_builder.build() unless object_to_convert
         if object_to_convert instanceof Array
           @convertSubExpression(object_to_convert)
@@ -36,6 +37,8 @@
                   @numberFromString(obj)
                 else throw "STRING NOT IMPLEMENTED"
             when "object" then @convertObject(object_to_convert)
+      process: logger().instrument(name: "Process", fn: proc_method)
+

       matchesNumberRegexp: (str)->
         str.search(/\d+/) != -1
@@ -52,7 +55,8 @@
       convertSubExpression: (parts) ->
         exp = @expression_builder.build()
         for x in parts
-          exp = exp.append(@process(x))
+          converted_part = @process(x)
+          exp = exp.append(converted_part)
         exp

       convertObject: (object)->
@@ -73,21 +77,27 @@
           power: power
         )

-      convertImplicitSubexp: (subexp_raw)->
-        if typeof subexp_raw == "number"
-          @expression_builder.build(expression: [@process(subexp_raw)])
-        else if subexp_raw == null
+      convertImplicitSubexp = (subexp)->
+        processed = @process(subexp)
+        if typeof subexp == "number"
+          @expression_builder.build(expression: [processed])
+        else if subexp == null || subexp == false
           @expression_builder.build(expression: [])
+        else if subexp instanceof Array
+          processed
         else
-          @process(subexp_raw)
+          @expression_builder.build(expression: [processed])

-
+      convertImplicitSubexp: logger().instrument(name: "convertImplicitSubexp", fn: convertImplicitSubexp)

     class_mixer BuildExpressionFromJavascriptObject

     BuildExpressionFromJavascriptObject.buildExpression = ->
       builder = BuildExpressionFromJavascriptObject.build()
       arguments_as_array = Array.prototype.slice.call(arguments, 0)
-      builder.process(arguments_as_array)
+      converted_part = builder.process(arguments_as_array)
+      logger().info("returned converted from process in buildExpression", converted_part.toString(), arguments_as_array)
+      converted_part

     return BuildExpressionFromJavascriptObject
+


Sort templates by filename client-side

Sort templates by filename client-side

--- client/source/models/templates.coffee
+++ client/source/models/templates.coffee
@@ -4,3 +4,4 @@
 module.exports = class Templates extends Collection
   url: '/api/templates/'
   model: Template
+  comparator: 'filename'


less tooltip delay

less tooltip delay

--- coffee/src/views/controls_view.coffee
+++ coffee/src/views/controls_view.coffee
@@ -240,7 +240,7 @@
 class FullscreenControlView extends IconControlView
   controlName: => 'FullscreenControl'
   className: @classNameExtend 'fullscreen'
-  tooltip: => title: 'Fullscreen', delay: show: 500
+  tooltip: => title: 'Fullscreen', delay: show: 300
   defaults: => _.extend super,
     icon: 'fullscreen'

@@ -249,7 +249,7 @@
 class EditControlView extends IconControlView
   controlName: => 'EditControl'
   className: @classNameExtend 'edit'
-  tooltip: => title: 'Edit', delay: show: 500
+  tooltip: => title: 'Edit', delay: show: 300
   defaults: => _.extend super,
     icon: 'edit'

@@ -258,7 +258,7 @@
 class SourcesControlView extends IconControlView
   controlName: => 'SourcesControl'
   className: @classNameExtend 'sources'
-  tooltip: => title: 'Sources', delay: show: 500
+  tooltip: => title: 'Sources', delay: show: 300
   defaults: => _.extend super,
     icon: 'globe'

@@ -267,7 +267,7 @@
 class PreviousControlView extends IconControlView
   controlName: => 'PreviousControl'
   className: @classNameExtend 'previous'
-  tooltip: => title: 'Previous', delay: show: 500
+  tooltip: => title: 'Previous', delay: show: 300
   defaults: => _.extend super,
     icon: 'arrow-left'

@@ -276,7 +276,7 @@
 class NextControlView extends IconControlView
   controlName: => 'NextControl'
   className: @classNameExtend 'next'
-  tooltip: => title: 'Next', delay: show: 500
+  tooltip: => title: 'Next', delay: show: 300
   defaults: => _.extend super,
     icon: 'arrow-right'

@@ -285,7 +285,7 @@
 class GridControlView extends IconControlView
   controlName: => 'GridControl'
   className: @classNameExtend 'grid'
-  tooltip: => title: 'Grid', delay: show: 500
+  tooltip: => title: 'Grid', delay: show: 300
   defaults: => _.extend super,
     icon: 'th'

@@ -294,7 +294,7 @@
 class PlayControlView extends IconControlView
   controlName: => 'PlayControl'
   className: @classNameExtend 'play'
-  tooltip: => title: 'Play', delay: show: 500
+  tooltip: => title: 'Play', delay: show: 300
   defaults: => _.extend super,
     icon: 'play'

@@ -303,7 +303,7 @@
 class PauseControlView extends IconControlView
   controlName: => 'PauseControl'
   className: @classNameExtend 'pause'
-  tooltip: => title: 'Pause', delay: show: 500
+  tooltip: => title: 'Pause', delay: show: 300
   defaults: => _.extend super,
     icon: 'pause'

@@ -312,7 +312,7 @@
 class RandomControlView extends IconControlView
   controlName: => 'RandomControl'
   className: @classNameExtend 'random'
-  tooltip: => title: 'Random', delay: show: 500
+  tooltip: => title: 'Random', delay: show: 300
   defaults: => _.extend super,
     icon: 'magic'

@@ -349,7 +349,7 @@
 class AcornControlView extends ImageControlView
   controlName: => 'AcornControl'
   className: @classNameExtend 'acorn'
-  tooltip: => title: 'Website', delay: show: 500
+  tooltip: => title: 'Website', delay: show: 300
   defaults: => _.extend super,
     image: acorn.config.img.acorn_inverse

@@ -359,7 +359,7 @@

   controlName: => 'ElapsedTimeControl'

-  tooltip: => title: 'Elapsed Time', delay: show: 500
+  tooltip: => title: 'Elapsed Time', delay: show: 300
   className: @classNameExtend 'elapsed-time-control-view'


refactor test

refactor test

--- spec/SpecHelper.coffee
+++ spec/SpecHelper.coffee
@@ -76,33 +76,17 @@
   it "cleans up observers", verifyCleanup

 verifySingleSubscriber = (srcF, expectedEvents) ->
-  src = null
-  events = []
-  before ->
-    src = srcF()
-  before (done) ->
+  verifyStreamWith srcF, expectedEvents, (src, events, done) ->
     src.subscribe (event) ->
       if event.isEnd()
         done()
       else
         expect(event instanceof Bacon.Initial).to.deep.equal(false)
         events.push(toValue(event))
-  it "is an EventStream", ->
-    expect(src instanceof Bacon.EventStream).to.equal(true)
-  it "outputs expected events in order", ->
-    expect(events).to.deep.equal(toValues(expectedEvents))
-  it "the stream is exhausted", ->
-     verifyExhausted src
-  it "cleans up observers", verifyCleanup

 # get each event with new subscriber
 verifySwitching = (srcF, expectedEvents, done) ->
-  src = null
-  events = []
-  before ->
-    src = srcF()
-    expect(src instanceof Bacon.EventStream).to.equal(true)
-  before (done) ->
+  verifyStreamWith srcF, expectedEvents, (src, events, done) ->
     newSink = ->
       (event) ->
         if event.isEnd()
@@ -113,7 +97,16 @@
           src.subscribe(newSink())
           Bacon.noMore
     src.subscribe(newSink())
-  it "outputs expected value in order when switching to new observer after each event", ->
+
+verifyStreamWith = (srcF, expectedEvents, collectF) ->
+  src = null
+  events = []
+  before ->
+    src = srcF()
+    expect(src instanceof Bacon.EventStream).to.equal(true)
+  before (done) ->
+    collectF(src, events, done)
+  it "outputs expected value in order", ->
     expect(events).to.deep.equal(toValues(expectedEvents))
   it "the stream is exhausted", ->
      verifyExhausted src


Mock the test-module response

Mock the test-module response

--- spec/clean-spec.coffee
+++ spec/clean-spec.coffee
@@ -23,8 +23,10 @@
       response.sendFile path.join(__dirname, 'fixtures', 'node_x64.lib')
     app.get '/node/v0.10.3/SHASUMS256.txt', (request, response) ->
       response.sendFile path.join(__dirname, 'fixtures', 'SHASUMS256.txt')
-    app.get '/tarball/test-module-1.0.0.tgz', (request, response) ->
-      response.sendFile path.join(__dirname, 'fixtures', 'test-module-1.0.0.tgz')
+    app.get '/test-module', (request, response) ->
+      response.sendFile path.join(__dirname, 'fixtures', 'install-test-module.json')
+    app.get '/tarball/test-module-1.2.0.tgz', (request, response) ->
+      response.sendFile path.join(__dirname, 'fixtures', 'test-module-1.2.0.tgz')

     server = http.createServer(app)


:Bug:About translation typos

:Bug:About translation typos

--- def/pt-br/about.cson
+++ def/pt-br/about.cson
@@ -1,12 +1,12 @@
 About:
   tabTitle: "Sobre"
-  releaseNotes: "Notas de lançamento"
-  newUpdate: "Nova atualização"
+  releaseNotes: "Notas De Lançamento"
+  newUpdate: "Nova Atualização"
   automaticDownloadUpdates: "Baixar automaticamente as atualizações"
   restartInstall: "Reiniciar e instalar"
   license: "Licença"
-  termsOfUse: "Termos de uso"
+  termsOfUse: "Termos de Uso"
   with: " com "
   by: " por "
   andTheAwesome: "E o incrível "
-  atomCommunity: "Comunidade do Atom"
+  atomCommunity: "Comunidade Do Atom"


AC: Bump AWS unit test delay to 50ms

AC: Bump AWS unit test delay to 50ms

--- test/unit/aws.spec.coffee
+++ test/unit/aws.spec.coffee
@@ -6,6 +6,8 @@
 API = require('../../modules/providers/aws')
 specUtils = require('./utils')
 mockArgs = specUtils.mockArgs
+
+PROMISE_DELAY = 50

 describe 'aws', ->
   mockEC2 = specUtils.mock.ec2()
@@ -57,7 +59,7 @@

     it 'otherwise should create the instance', ->
       subject(mockArgs('aws create dummy.02 --cluster dummy --user ubuntu --ssh-key /path/to/id_rsa --ssh-pub-key ' + pubKeyPath))
-      waits 20
+      waits PROMISE_DELAY
       runs ->
         runParams = specUtils.spies.ec2.runInstances.mostRecentCall.args[0]
         saveParams = utils.saveInstanceToCluster.mostRecentCall.args[1]
@@ -86,7 +88,7 @@

     it 'otherwise should destroy the instance', ->
       subject(mockArgs('aws destroy dummy.01 --force'))
-      waits 20
+      waits PROMISE_DELAY
       runs ->
         expect(specUtils.spies.ec2.terminateInstances.mostRecentCall.args[0]).toEqual({
           InstanceIds: [ 'InstanceId' ]
@@ -103,7 +105,7 @@

     it 'otherwise should reboot the instance', ->
       subject(mockArgs('aws reboot dummy.01'))
-      waits 20
+      waits PROMISE_DELAY
       runs ->
         expect(specUtils.spies.ec2.rebootInstances.mostRecentCall.args[0]).toEqual({
           InstanceIds: [ 'InstanceId' ]
@@ -119,7 +121,7 @@

     it 'otherwise should start the instance', ->
       subject(mockArgs('aws start dummy.01'))
-      waits 20
+      waits PROMISE_DELAY
       runs ->
         expect(specUtils.spies.ec2.startInstances.mostRecentCall.args[0]).toEqual({
           InstanceIds: [ 'InstanceId' ]
@@ -143,7 +145,7 @@

     it 'otherwise should stop the instance', ->
       subject(mockArgs('aws stop dummy.01'))
-      waits 20
+      waits PROMISE_DELAY
       runs ->
         expect(specUtils.spies.ec2.stopInstances.mostRecentCall.args[0]).toEqual({
           InstanceIds: [ 'InstanceId' ]


Delete duplicated test

Delete duplicated test

--- tests/api-key.spec.coffee
+++ tests/api-key.spec.coffee
@@ -169,17 +169,6 @@
 							.get('query')
 							m.chai.expect(promise).to.eventually.be.null

-						it 'should not pass an apikey query string', ->
-							promise = request.send
-								method: 'GET'
-								baseUrl: 'https://api.resin.io'
-								url: '/foo'
-								apiKey: ''
-							.get('request')
-							.get('uri')
-							.get('query')
-							m.chai.expect(promise).to.eventually.be.null
-
 					describe '.stream()', ->

 						return if IS_BROWSER


Added tests for Croatian locale.

Added tests for Croatian locale.

--- tests/locales.test.coffee
+++ tests/locales.test.coffee
@@ -311,3 +311,16 @@

     it "shows the correct CONFIRM translation", ->
       expect(@labels.confirm).to.equal "Megerősít"
+
+  describe "Croatian", ->
+    beforeEach ->
+      @setLocale "hr"
+
+    it "shows the correct OK translation", ->
+      expect(@labels.ok).to.equal "OK"
+
+    it "shows the correct CANCEL translation", ->
+      expect(@labels.cancel).to.equal "Odustani"
+
+    it "shows the correct CONFIRM translation", ->
+      expect(@labels.confirm).to.equal "Potvrdi"


added possibility to add predefined path for scaled images

--- modules/gui/platforms/node/tools/images.coffee
+++ modules/gui/platforms/node/tools/images.coffee
@@ -14,12 +14,12 @@

         ##
         _scale = (size, src, dest, next)->
+            setImmediate ()=>
+                if typeof size is 'function'
+                    size src, dest, next

-            if typeof size is 'function'
-                size src, dest, next
-
-            else
-                im.convert [src, '-resize', size+'\>', dest], next
+                else
+                    im.convert [src, '-resize', size+'\>', dest], next

         data =
             src: dest
@@ -31,12 +31,23 @@

                 done null, data

-            each: (name, size, next)->
+            each: (name, dimension, next)->
+
+                if !(typeof dimension is 'object')
+                    dimension =
+                        size: dimension
+                        path: (dest, name, dimension)->
+                            dest.replace /\.([a-zA-Z]+)$/, ('.'+name+'.$1')
+
                 if name is 'full'
                     _dest = dest
+
                 else
-                    data.thumbnails[name] = _dest = dest.replace /\.([a-zA-Z]+)$/, ('.'+name+'.$1')
+                    if typeof (_dest = dimension.path) is 'function'
+                        _dest = _dest dest, name, dimension
+
+                    data.thumbnails[name] = _dest

-                _scale size, src, _dest, next
+                _scale dimension.size, src, _dest, next


Added some time to account for latency.

Added some time to account for latency.

--- tests/youtube-info.coffee
+++ tests/youtube-info.coffee
@@ -2,18 +2,22 @@

 helper = new Helper('../scripts/youtube-info.coffee')
 expect = require('chai').expect
-stub = require('sinon').stub
+stub = require('sinon')

 describe 'when user links', ->
   room = null
-  random_stub = null

   beforeEach ->
     room = helper.createRoom()
+    this.clock = sinon.useFakeTimers()
+
+  afterEach ->
+    this.clock.restore()

   context 'youtube.com url', ->
     beforeEach ->
       room.user.say 'alice', 'https://www.youtube.com/watch?v=ePoi0_zSnYk'
+      this.clock.tick(3000)

     it 'should be able to find title', ->
       expect(room.messages[1][1]).to.contain "Adele's Hello by the Movies"
@@ -21,6 +25,7 @@
   context 'youtube.com url with additional values', ->
     beforeEach ->
       room.user.say 'alice', 'https://www.youtube.com/watch?v=iq9DLJfpHd0&feature=youtu.be&ab_channel=CatRe-Tailer'
+      this.clock.tick(3000)

     it 'should be able to find title', ->
       expect(room.messages[1][1]).to.contain "Shia Surprise"
@@ -28,6 +33,7 @@
   context 'youtu.be url', ->
     beforeEach ->
       room.user.say 'alice', 'https://youtu.be/HP66dH1yEZo'
+      this.clock.tick(3000)

     it 'should be able to find title', ->
       expect(room.messages[1][1]).to.contain "R2D2 learns a new trick"
@@ -35,6 +41,7 @@
   context 'youtu.be url with additional values', ->
     beforeEach ->
       room.user.say 'alice', 'https://youtu.be/oVnAVcbMoSM?t=39s'
+      this.clock.tick(3000)

     it 'should be able to find title', ->
       expect(room.messages[1][1]).to.contain "GoPro fall at Garden of the Gods"


Unmemoized getSchemaReferenceFields by default.

--- src/SchemaUtils.coffee
+++ src/SchemaUtils.coffee
@@ -24,16 +24,16 @@
       if fieldSchema?
         callback(fieldSchema, fieldId)

-  getSchemaReferenceFields: _.memoize(
-    (collection) ->
-      refFields = {}
-      schema = collection.simpleSchema()
-      Collections.forEachFieldSchema schema, (field, fieldId) ->
-        if field.collectionType
-          refFields[fieldId] = field
-      refFields
-    (collection) -> Collections.getName(collection)
-  )
+  getSchemaReferenceFields: (collection) ->
+    refFields = {}
+    schema = collection.simpleSchema()
+    Collections.forEachFieldSchema schema, (field, fieldId) ->
+      if field.collectionType
+        refFields[fieldId] = field
+    refFields
+
+  getSchemaReferenceFieldsMemoized: _.memoize(
+      SchemaUtils.getSchemaReferenceFields, Collections.getName.bind(Collections))

   getRefModifier: (model, collection, idMaps) ->
     modifier = {}


copy generator templates (grunt)

copy generator templates (grunt)

--- grunt.coffee
+++ grunt.coffee
@@ -56,7 +56,7 @@
           bare: true
     copy:
       packageJSON:
-        src: 'packages/**/package.json'
+        src: ['packages/**/package.json', 'packages/tower-generator/server/generators/**/templates/**/*']
         strip: 'packages/'
         dest: 'lib'
     watch:


Add scripts for interactions in agreements#new

--- app/assets/javascripts/search-filter.coffee
+++ app/assets/javascripts/search-filter.coffee
@@ -14,10 +14,27 @@
   $target = $($(this).data('target'))
   filter = $(this).val()
   if filter == ""
-    $target.find('.row-list').show()
+    showRelatedElements()
   else
     $target.find('.row-list').each (index, element) ->
-      if $(element).text().toLowerCase().indexOf( filter.toLowerCase() ) != -1
+      if $(element).text().toLowerCase().indexOf( filter.toLowerCase() ) != -1 && $(this).is(':visible')
         $(element).show()
       else
         $(element).hide()
+
+$(document).on 'change', '.row-list input[type="checkbox"]', ->
+  if $(this).is(':checked')
+    $('.services-list').append '
' + $(this).parent().text() + '
'
+  else
+    $('.services-list li[data-list="' + $(this).val() + '"').remove()
+  return
+
+$(document).on 'change', '#agreement_service_provider_organization_id',->
+  showRelatedElements()
+
+showRelatedElements = () ->
+  organizationID = $('#agreement_service_provider_organization_id').val()
+  $('.content-list .row-list').each (index, element) =>
+    $(element).hide()
+    if $(element).attr('data-organization') == organizationID || !organizationID
+      $(element).show()


updated for modified frustum apis

updated for modified frustum apis

--- app/assets/jax/controllers/octree.js.coffee
+++ app/assets/jax/controllers/octree.js.coffee
@@ -44,7 +44,7 @@

     @_cam = camera = new Jax.Camera()
     camera.perspective near: 1, far: 50, width: @context.canvas.width, height: @context.canvas.height
-    camera.setPosition [0, 0, 5]
+    camera.setPosition [0.1, 0.1, 4.75]
     @world.addObject camera.getFrustum().getRenderable()

     context = @context
@@ -55,26 +55,26 @@
         numNodes = 0
         octree.traverse camera.getPosition(), (node) =>
           numNodes++
-          size = node.size * 2
+          size = node.size
           node.mesh.render context, this, material

           switch camera.getFrustum().cube(node.position, size, size, size)
             when Jax.Scene.Frustum.OUTSIDE
               # not visible, abort traversal
               return false
-            when Jax.Scene.Frustum.INTERSECT
-              # partially visible, render immediate objects and check sub-nodes
-              for i, o of node.objects
-                numObjs++
-                o.render context, material
-              return true
-            else
+            when Jax.Scene.Frustum.INSIDE
               # wholly visible, render all objects in this and child nodes
               # and then abort traversal
               for i, o of node.nestedObjects
                 numObjs++
                 o.render context, material
               return false
+            else
+              # partially visible, render immediate objects and check sub-nodes
+              for i, o of node.objects
+                numObjs++
+                o.render context, material
+              return true
         if min is null or min > numObjs then min = numObjs
         if max is null or max < numObjs then max = numObjs
         $('#jax-banner').html("Objects rendered: #{numObjs}; nodes traversed: #{numNodes}; records: [#{min}, #{max}]")


focus on the first input element in lightbox

--- app/coffee/modules/common/lightboxes.coffee
+++ app/coffee/modules/common/lightboxes.coffee
@@ -41,10 +41,11 @@

         $el.css('display', 'flex')

-        $el.find('input,textarea').first().focus()
-
         @animationFrame.add =>
             $el.addClass("open")
+
+            @animationFrame.add ->
+                $el.find('input,textarea').first().focus()

         @animationFrame.add =>
             lightboxContent.show()


fix delete redirection

fix delete redirection

--- app/coffee/modules/common/lightboxes.coffee
+++ app/coffee/modules/common/lightboxes.coffee
@@ -80,12 +80,17 @@
             docEl.off(".lightbox")
             docEl.off(".keyboard-navigation") # Hack: to fix problems in the WYSIWYG textareas when press ENTER

+            $el.addClass('close-started') # don't attach animations
+
             @animationFrame.add =>
                 $el.addClass('close')

                 $el.one "transitionend", =>
                     $el.removeAttr('style')
-                    $el.removeClass("open").removeClass('close')
+                    $el
+                        .removeClass("open")
+                        .removeClass('close')
+                        .removeClass('close-started')

                     if @.onClose
                         @rootScope.$apply(@.onClose)
@@ -99,7 +104,7 @@

     getLightboxOpen: ->
-        return $(".lightbox.open")
+        return $(".lightbox.open:not(.close-started)")

     closeAll: ->
         docEl = angular.element(document)


Use map instead of hash for metrics

Use map instead of hash for metrics

--- libraries/metrics/prom_wrapper.coffee
+++ libraries/metrics/prom_wrapper.coffee
@@ -1,6 +1,6 @@
 prom = require('prom-client')
 registry = require('prom-client').register
-metrics = {}
+metrics = new Map()

 optsKey = (opts) ->
@@ -33,16 +33,16 @@
 	registry: registry

 	metric: (type, name) ->
-		registry.getSingleMetric(name) || new MetricWrapper(type, name)
+		metrics.get(name) || new MetricWrapper(type, name)

 	collectDefaultMetrics: prom.collectDefaultMetrics

 class MetricWrapper
 	constructor: (type, name) ->
-		metrics[name] = this
+		metrics.set(name, this)
 		@name = name
-		@instances = {}
+		@instances = new Map()
 		@lastAccess = new Date()
 		@metric = switch type
 			when "counter"
@@ -77,22 +77,22 @@

 	sweep: () ->
 		thresh = new Date(Date.now() - 1000 * 60 * PromWrapper.ttlInMinutes)
-		for key in Object.keys(@instances)
-			if thresh > @instances[key].time
+		@instances.forEach (instance, key) =>
+			if thresh > instance.time
 				if process.env['DEBUG_METRICS']
-					console.log("Sweeping stale metric instance", @name, opts: @instances[key].opts, key)
-				@metric.remove(optsAsArgs(@instances[key].opts, @metric.labelNames)...)
+					console.log("Sweeping stale metric instance", @name, opts: instance.opts, key)
+				@metric.remove(optsAsArgs(instance.opts, @metric.labelNames)...)

 		if thresh > @lastAccess
 			if process.env['DEBUG_METRICS']
-				console.log("Sweeping stale metric", @name)
-			delete metrics[@name]
+				console.log("Sweeping stale metric", @name, thresh, @lastAccess)
+			metrics.delete(@name)
 			registry.removeSingleMetric(@name)

 	_execMethod: (method, opts, value) ->
 		opts = extendOpts(opts, @metric.labelNames)
 		key = optsKey(opts)
-		@instances[key] = { time: new Date(), opts } unless key == ''
+		@instances.set(key, { time: new Date(), opts }) unless key == ''
 		@lastAccess = new Date()
 		@metric[method](opts, value)

@@ -106,8 +106,8 @@
 			if PromWrapper.ttlInMinutes
 				if process.env['DEBUG_METRICS']
 					console.log("Sweeping metrics")
-				for key in Object.keys(metrics)
-					metrics[key].sweep()
+				metrics.forEach (metric, key) =>
+					metric.sweep()
 	60000)


About: Team list updated

About: Team list updated

--- client/About/team.coffee
+++ client/About/team.coffee
@@ -5,10 +5,10 @@
     active        : [

         username  : 'devrim'
-        title     : 'Co-Founder & CEO'
+        title     : 'CEO & Co-Founder'
       ,
         username  : 'sinan'
-        title     : 'Co-Founder & Chief UI Engineer'
+        title     : 'Chief of UI/UX & Co-F'
       ,
         username  : 'chris'
         title     : 'Director of Engineering'
@@ -63,12 +63,6 @@
       ,
         username  : 'pablostanley'
         title     : 'Illustrator'
-      # ,
-      #   username  : 'leeolayvar'
-      #   title     : 'Community Manager'
-      # ,
-      #   username  : 'stefanbc'
-      #   title     : 'Community Manager'
       ,
         username  : 'dicle'
         title     : 'Business Analyst'
@@ -81,6 +75,12 @@
       ,
         username  : 'nesli'
         title     : 'Chef de Cuisine'
+      # ,
+      #   username  : 'leeolayvar'
+      #   title     : 'Community Manager'
+      # ,
+      #   username  : 'stefanbc'
+      #   title     : 'Community Manager'
       ]

     suspended     : []


cleanup

cleanup

Former-commit-id: 0d13d3bf3989b6cb4974e6a6283c546ec093c4cd [formerly 313fd25fbff3913788e37d58f8c2a40c5cf4ad42] [formerly 05d2db61e61d6ceed6ed4adf81834533a38f230e [formerly 491e24500c0fa88b4ab49a3f5eebb0bde4357325]] [formerly 07f94b27c42ab678018268e2e63144c4fb74dec6 [formerly d8698f24a4417f42d160a13d69a8b7436fbee3ab] [formerly 76e9f46d06dd6efd8966708f7c18e731dc964dd0 [formerly 76e9f46d06dd6efd8966708f7c18e731dc964dd0 [formerly 91ad28e1f7ccb1e0a2f6aa103d068bf072549343]]]]
Former-commit-id: 35687d9564e685e10b7948050d2cf7c13bc39759 [formerly 07c502ed0873549f578ae08903920023cb9ebbe9] [formerly 3eb1060085e36426b3cda28c809f4b17ca36ee78 [formerly b4d9b6bd54069786310681353e74581de5142408]]
Former-commit-id: 1d8f1f6b994d5aec8a079db9cc4413ecd8f47105 [formerly 43ec0c6b67235e0188af3dbb0922adc64527cae6]
Former-commit-id: 0e5734b83416735a1c8ae9c98aee60b29ddc9e4e
Former-commit-id: a51e2862176ec695a771def6157b591f6b74bb5f

--- app/assets/javascripts/backbone/apps/franklin/proposal/toggle/toggle_view.coffee
+++ app/assets/javascripts/backbone/apps/franklin/proposal/toggle/toggle_view.coffee
@@ -26,8 +26,7 @@
       results_call = 'View All Opinions'

       current_user = App.request 'user:current'
-      console.log results_call
-
+
       _.extend {}, @model.attributes,
         results_call : results_call
         active : active


Fixed typo.

Fixed typo.

--- snippets/php.cson
+++ snippets/php.cson
@@ -1,9 +1,9 @@
 ".text.html.basic, .text.html.php":

   'PHP snippets - construct method':
-    'prefix': 'boo:checkbox'
+    'prefix': 'php:construct'
     'body': """
-      public function __construct(${1:Reqeust} $${2:request})
+      public function __construct(${1:Request} $${2:request})
       {
           $this->${2:request} = $${2:request};
       }


Removes debug config

Removes debug config

--- config.coffee
+++ config.coffee
@@ -27,7 +27,3 @@
       precompile: true
       root: 'templates'
       joinTo: 'javascripts/app.js' : /^app/
-
-  es6ModuleTranspiler:
-    debug: yes
-


Fix chai config to not fail in case meteor is run without settings

--- config.coffee
+++ config.coffee
@@ -1,6 +1,6 @@
 # Include stack trace in assertion error messages
 # http://chaijs.com/guide/styles/#configure-section
 if Meteor.isServer
-  chai.config.includeStack = Meteor.settings.chai?.includeStack || true
+  chai.config.includeStack = Meteor.settings?.chai?.includeStack || true
 else
-  chai.config.includeStack = Meteor.settings.public?.chai?.includeStack || true
+  chai.config.includeStack = Meteor.settings?.public?.chai?.includeStack || true


Pinch scale bug

Pinch scale bug

--- framer/GestureInputRecognizer.coffee
+++ framer/GestureInputRecognizer.coffee
@@ -270,7 +270,7 @@
 			event.distance = Utils.pointDistance(pointA, pointB)
 			event.scale = 1

-		if @session?.pinchStartEvent
+		if @session?.started.pinch
 			event.scale = event.distance / @session.started.pinch.distance

 		# Convert point style event properties to dom style:


Fix doc for github-trending

Fix doc for github-trending

--- scripts/github-trending.coffee
+++ scripts/github-trending.coffee
@@ -1,5 +1,5 @@
 # Description:
-#   get the latest trending repositories on github
+#   Gets the latest trending repositories on GitHub.
 #
 # Dependencies:
 #   cheerio
@@ -9,10 +9,12 @@
 #   None
 #
 # Commands:
-#   trending          : list trending repositories (all languages)
-#   trending-language : list trending repositories for the given language
-#   trending project  : get general information for the given project
+#   hubot trending - Lists trending repositories (all languages).
+#   hubot trending-[language] - Lists trending repositories for the given language.
+#   hubot trending [project] - Gets general information for the given project.
 #
+# Author:
+#   Sabri Eddir

 cheerio = require 'cheerio'
 request = require 'request'


fix incorrect docs for up.modal.extract

fix incorrect docs for up.modal.extract

--- lib/assets/javascripts/unpoly/modal.js.coffee
+++ lib/assets/javascripts/unpoly/modal.js.coffee
@@ -337,7 +337,7 @@
   Example:

       var html = 'before
inner
 after';
-      up.modal.extract('/foo', '.content', html);
+      up.modal.extract('.content', html);

   The would open a modal with the following contents:

@@ -346,8 +346,10 @@
   Emits events [`up:modal:open`](/up:modal:open) and [`up:modal:opened`](/up:modal:opened).

   @function up.modal.extract
-  @param {String} url
-    The URL to load.
+  @param {String} selector
+    The CSS selector to extract from the HTML.
+  @param {String} html
+    The HTML containing the modal content.
   @param {Object} options
     See options for [`up.modal.follow`](/up.modal.follow).
   @return {Promise}


Revert "DataField"

Revert "DataField"

This reverts commit b24c25a5fbd600df9ed4d3ae72124bfdd79982f7.

The patched caused problems for some users.

--- src/base/DataField/DataField.coffee
+++ src/base/DataField/DataField.coffee
@@ -306,7 +306,7 @@
 		if @isDisabled()
 			@disable()
 		if @isHidden()
-			@hide(true)
+			@hide()
 		@setOpacity()
 		@callOnOthers("render")
 		@_onRender?(@)


Correctly interpolate string

Correctly interpolate string

--- src/coffee/services/s3client.coffee
+++ src/coffee/services/s3client.coffee
@@ -53,7 +53,7 @@
     return unless @_metrics
     prefix = if @_metricsPrefix then "#{@_metricsPrefix}." else ''
     switch typ
-      when 'increment' then @_metrics.increment "#{prefix}key"
+      when 'increment' then @_metrics.increment "#{prefix}#{key}"

   ###*
    * Lists all files in the given bucket


Add: static property for list of action groups in Product Sync.

--- src/coffee/sync/product-sync.coffee
+++ src/coffee/sync/product-sync.coffee
@@ -6,23 +6,26 @@
 #
 # Action groups for products are:
 # - `base` (name, slug, description)
-# - `references` (taxCategory, categories)
+# - `references` (taxCategory)
 # - `prices`
 # - `attributes`
 # - `images`
 # - `variants`
+# - `categories`
 #
 # Examples
 #
 #   {ProductSync} = require 'sphere-node-sdk'
 #   sync = new ProductSync
-#   syncedActions = sync.buildActions(newCategory, existingCategory)
+#   syncedActions = sync.buildActions(newProduct, existingProduct)
 #   if syncedActions.shouldUpdate()
 #     client.products.byId(syncedActions.getUpdatedId())
 #     .update(syncedActions.getUpdatePayload())
 #   else
 #     # do nothing
 class ProductSync extends BaseSync
+
+  @actionGroups = ['base', 'references', 'prices', 'attributes', 'images', 'variants', 'categories']

   # Public: Construct a `ProductSync` object.
   constructor: ->