Add translate function.

Add translate function.

--- js/flight.coffee
+++ js/flight.coffee
@@ -76,79 +76,68 @@

       if @transitionAnimation isnt true
         @displayPage()
+
     ,10
+

   # performs slide animation transition
   slideTransition: () ->
-    @targetPage.style.display = "block"
-    @currentPage.style.display = "block"
+    @targetPage.style.display = "block"

     if @back is true
       # must perform this initial tranform to get animation working in the next step
-      @targetPage.style.webkitTransition = "0ms"
-      @targetPage.style.webkitTransform = "translateX(-100%)"
-
-      # use window timeout to delay transition or will not work on android device
+      @translate(@targetPage, "X", "-100%", "0ms")
       window.setTimeout =>
-        @currentPage.style.webkitTransition = "#{@speed} ease"
-        @currentPage.style.webkitTransform = "translateX(100%)"
+        @translate(@currentPage, "X", "100%")
       , 10

     else
-      #do forward transition
-      @targetPage.style.webkitTransition = "0ms"
-      @targetPage.style.webkitTransform = "translateX(100%)"
-
+      #do forward transition
+      @translate(@targetPage,"X","100%", "0ms")
+
       window.setTimeout =>
-        @currentPage.style.webkitTransition = "#{@speed} ease"
-        @currentPage.style.webkitTransform = "translateX(-100%)"
+        @translate(@currentPage, "X", "-100%")
       , 10
-
+
     # shortern the delay here to stop a gap appearing in android
     window.setTimeout =>
-      @targetPage.style.webkitTransition = "#{@speed} ease"
-      @targetPage.style.webkitTransform = "translateX(0%)"
+      @translate(@targetPage, "X", "0%")
       @currentPage.addEventListener "webkitTransitionEnd", @finishSlide, false
       @resetState()
     , 5

-  # translate page on secified axis. Duration defaults to speed property when not passed.
-  translate: (page, axis, distance, duration) =>
-    if typeof duration is 'undefined' then duration = @speed;
-    page.style.webkitTransition = "#{duration} ease"
-    page.style.webkitTransform = "translate#{axis}(#{distance})"
-
-
+    @
+
+
   # slides panel from bottom to top and top to bottom
   slideFromBottom: () ->
      if @back is true
        # do reverse
        window.setTimeout =>
-          @currentPage.style.webkitTransition = "#{@speed} ease"
-          @currentPage.style.webkitTransform = "translateY(100%)"
+          @translate(@currentPage, "Y", "100%")
        , 10

      else
        #do forward transition
        @targetPage.style.display = "block"
-       @targetPage.style.webkitTransition = "0ms"
-       @targetPage.style.webkitTransform = "translateY(100%)"
+       @translate(@targetPage, "Y", "100%","0ms")

        window.setTimeout =>
-          @targetPage.style.webkitTransition = "#{@speed} ease"
-          @targetPage.style.webkitTransform = "translateY(0%)"
+         @translate(@targetPage, "Y", "0%")
        , 10

      window.setTimeout =>
        @targetPage.addEventListener "webkitTransitionEnd", @finishSlideFromBottom, false
-       @resetState()
      , 15
+     @resetState()
+

   # call on transition end
   finishSlide: =>
     @removeClass @currentPage, 'visible'
     @currentPage.style.display = "none"
     @addClass @targetPage, 'visible'
+
     @currentPage.removeEventListener "webkitTransitionEnd", @finishTransition, false

    finishSlideFromBottom: =>
@@ -159,6 +148,12 @@
    resetState: =>
     @back = false
     @isTransitioning = false
+
+   # translate page on secified axis. Duration defaults to speed property when not passed. Delay defaults to 0.
+   translate: (page, axis, distance, duration) =>
+    if not duration? then duration = @speed
+    page.style.webkitTransition = "#{duration} ease"
+    page.style.webkitTransform = "translate#{axis}(#{distance})"

    # displays pages when transiton is false, back animations do not matter here.
    displayPage: =>


Update Twitter username

Update Twitter username

--- js/plugin.coffee
+++ js/plugin.coffee
@@ -1,6 +1,6 @@
 #
 # CoffeeScript jQuery Plugin Boilerplate
-# By: Matthieu Aussaguel, http://www.mynameismatthieu.com, @matthieu_tweets
+# By: Matthieu Aussaguel, http://www.mynameismatthieu.com, @mattaussaguel
 # Version: 1.0 alpha 1.0
 # Updated: June 27th, 2011
 #


Hide launches in Horizontal mode

Hide launches in Horizontal mode

--- js/script.coffee
+++ js/script.coffee
@@ -56,6 +56,7 @@

 cb_spacex = (r) ->
 	table = document.createElement 'table'
+	if window.innerWidth > window.innerHeight then table.style.display = 'none'
 	for p in r
 		if p.launch_date_unix
 			core_reused = if p.reused then '*' else ''
@@ -149,4 +150,4 @@
 	return

 loadJSON "{{ site.practices_url }}?date=#{new_date}", cb_practice
-loadJSON "{{ site.spacex_api }}upcoming?date=#{new_date}", cb_spacex+loadJSON "{{ site.spacex_api }}upcoming?date=#{new_date}", cb_spacex


Check date coherence, insured by a script, so never triggered

--- js/script.coffee
+++ js/script.coffee
@@ -74,6 +74,10 @@
 	if window.innerWidth > window.innerHeight then document.querySelector('#content').classList = 'short'
 	for p in r
 		if p.launch_date_unix
+			# Compare dates
+			timed_utc = new Date(p.launch_date_utc).getTime().toString()
+			timed_local = new Date(p.launch_date_local).getTime().toString()
+			coherent = if p.launch_date_unix.toString() != timed_utc.slice(0,10) || p.launch_date_unix.toString() != timed_local.slice(0,10) then "*" else ""
 			core_reused = if p.reused then '*' else ''
 			# cap_reused = if p.reused.capsule then '*' else ''
 			t_minus = p.launch_date_unix - (new_date / 1000)
@@ -150,7 +154,7 @@
 			#
 			# CELL 6
 			#
-			body += "#{launch_time}#{tz}#{launch_time_local}#{offset}	"
+			body += "#{launch_time}#{tz}#{launch_time_local}#{offset}#{coherent}	"
 			if (p.rocket.first_stage.cores[0].reused and p.rocket.first_stage.cores[0].core_serial) or p.rocket.first_stage.cores[0].flight > 1 then core_reflown.push p.rocket.first_stage.cores[0].core_serial
 			if p.rocket.first_stage.cores.length > 1
 				if p.rocket.first_stage.cores[1].reused then core_reflown.push p.rocket.first_stage.cores[1].core_serial


Use ?= instead of ||=

Use ?= instead of ||=

--- src/nodes/doc.coffee
+++ src/nodes/doc.coffee
@@ -218,7 +218,7 @@

           if not in_hash and param_match and _.last(args)?
             in_hash = true
-            _.last(args).options ||= []
+            _.last(args).options ?= []
             name = param_match[1]
             _.last(args).options.push({name, desc, type: Referencer.getLinkMatch(line)})
           else


View#render: Fix the comment, there’s no fat arrow but we’re binding it in the constructor

--- coffee/chaplin/views/view.coffee
+++ coffee/chaplin/views/view.coffee
@@ -294,7 +294,7 @@
       throw new Error 'View#getTemplateFunction must be overridden'

     # Main render function
-    # Always bind it to the view instance
+    # This method is bound to the instance in the constructor (see above)
     render: ->
       #console.debug 'View#render', this


Remove forgetting local storage peer id

Remove forgetting local storage peer id

--- coffeescripts/Social/User.coffee
+++ coffeescripts/Social/User.coffee
@@ -8,7 +8,7 @@

         # Check local storage for peerID
         storage = new Storage.Local('p2p')
-        storage.forget('peerID')
+        # storage.forget('peerID')
         this.peerID = storage.get('peerID') ? this.generatePeerID()
         storage.put('peerID', this.peerID)


Fix a merge error

Fix a merge error

--- lib/latextools.coffee
+++ lib/latextools.coffee
@@ -471,14 +471,8 @@
   # Private: ensure modules are loaded on demand
   requireIfNeeded: (modules) ->
     # ltConsole is needed by all, so load it
-<<<<<<< HEAD
     LTConsole ?= require './ltconsole'
     @ltConsole ?= new LTConsole @state.ltConsoleState
-=======
-    unless LTConsole?
-      LTConsole = require './ltconsole'
-      @ltConsole = new LTConsole @state?.ltConsoleState
->>>>>>> project_files

     for m in modules
       console.log("requiring if needed: #{m}")


update brain request

update brain request

--- lib/brain.coffee
+++ lib/brain.coffee
@@ -133,6 +133,10 @@
     packet.c('status').t('hc-leave')
     @jabber.send(packet)

+
+  # Speak Robot!
+  say: (target, message, callback) ->
+    @message target, message, callback

   # Send a message
   message: (target, message) ->
@@ -164,12 +168,12 @@

   # Send Bot on a journey
-  request = (method, path, body, callback) ->
-    match = path.match(/^(https?):\/\/([^\/]+?)(\/.+)/)
-    headers = { Host: match[2],  'Content-Type': 'application/json', 'User-Agent': 'hipbot' }
-    port = if match[1] == 'https' then 443 else 80
-    client = http.createClient(port, match[2], port == 443)
-    path = match[3]
+  request = (method, path, body, callback) ->
+    if match = path.match(/^(https?):\/\/([^\/]+?)(\/.+)/)
+      headers = { Host: match[2],  'Content-Type': 'application/json', 'User-Agent': 'hipbot' }
+      port = if match[1] == 'https' then 443 else 80
+      client = http.createClient(port, match[2], port == 443)
+      path = match[3]

     if typeof(body) is 'function' and not callback
       callback = body
@@ -223,8 +227,6 @@

   # Load Bot Skills
   loadPlugin: (identifier, plugin, options) ->
-    throw new Error('plugin must be an object') unless typeof plugin == 'object'
-    throw new Error('plugin must have a load function') unless typeof plugin.load == 'function'
     @plugins[identifier] = plugin
     @plugins[identifier].load(this, options)
     true


limits to show maximum 10 mentors

limits to show maximum 10 mentors

--- app/assets/javascripts/components/kid_mentor_schedules.js.cjsx
+++ app/assets/javascripts/components/kid_mentor_schedules.js.cjsx
@@ -5,10 +5,10 @@
 #= require underscore
 #= require moment

-
+MAX_MENTORS_TO_DISPLAY = 10
 @KidMentorSchedules = React.createClass
   getInitialState: ->
-    mentorsToDisplay: _.keys @props.mentors
+    mentorsToDisplay: _.keys(@props.mentors)
     filters:
       ect: null
       sex: null
@@ -41,7 +41,7 @@

     return filteredMentors
   getSelectedMentors: (filteredMentors) ->
-    _.pick filteredMentors, @state.mentorsToDisplay
+    limit _.pick filteredMentors, @state.mentorsToDisplay
   onChangeSelectedMentorsToDisplay: (mentorIds) ->
     @setState mentorsToDisplay: mentorIds
   onChangeFilter: (key, value) ->
@@ -103,6 +103,7 @@
   render: ->
     filteredMentors = @getFilteredMentors()
     selectedMentors = @getSelectedMentors filteredMentors
+

@@ -122,7 +123,7 @@

             <MentorsForDisplayingFilter
               mentors=filteredMentors
-              selection=@state.mentorsToDisplay
+              selection=_.keys(selectedMentors)
               onChange=@onChangeSelectedMentorsToDisplay
             />

@@ -140,7 +141,9 @@
   DELEMITER: ";"
   onChange: (valuesAsString) ->
     if valuesAsString? and valuesAsString.length > 0
-      @props.onChange valuesAsString.split(@DELEMITER).map (id) -> parseInt id, 10
+      values = valuesAsString.split(@DELEMITER).map (id) -> parseInt id, 10
+      console.log values, limitAndRemoveFromBeginning values
+      @props.onChange limitAndRemoveFromBeginning values
     else
       @props.onChange []
   selectAll: ->
@@ -158,6 +161,14 @@
       selectedIds.push id if @props.mentors[id]?
     value = selectedIds.join @DELEMITER
     if value.length == 0 then value = null
+    sizeLabel =
+      if _.size(@props.mentors) > MAX_MENTORS_TO_DISPLAY
+
+          ({MAX_MENTORS_TO_DISPLAY} von {_.size @props.mentors})

+          Max. erreicht
+
+      else
+        ({_.size @props.mentors})

@@ -172,7 +183,7 @@
       <button
         onClick=@selectAll
         className="btn btn-default col-xs-2">
-          Select All ({_.size @props.mentors})
+          Alle wählen
{sizeLabel}
       </button>

@@ -357,6 +368,16 @@
         style={width: mentorColumnWidth+'%'}
         />
 # helpers
+
+limit = (mentorsOrArrayOfIds) ->
+  limitArray = (arr) -> arr.slice 0, MAX_MENTORS_TO_DISPLAY
+  if _.isArray mentorsOrArrayOfIds
+    limitArray mentorsOrArrayOfIds
+  else
+    _.pick mentorsOrArrayOfIds, limitArray _.keys mentorsOrArrayOfIds
+
+
+limitAndRemoveFromBeginning = (mentorIds) -> mentorIds.slice(Math.max(mentorIds.length - MAX_MENTORS_TO_DISPLAY, 0))
 availableInSchedule = (schedules, day, time) ->
   schedules?[day?.key]?[time?.key]?


Add empty dependencies array in AMD define

Seems like `r.js` v 2.1.x have a bug when module don't define dependency.

I guess that should be fixed on `r.js`, I'll open an issue over there. But that's an easy fix to make the AMD work for now.

--- lib/observable.coffee
+++ lib/observable.coffee
@@ -54,8 +54,8 @@

 if typeof define is 'function' and define.amd
-	define 'observable', -> Observable
+	define 'observable', [], -> Observable
 else if typeof exports isnt 'undefined'
 	module.exports = Observable
 else
-	window.Observable = Observable+	window.Observable = Observable


Fix test

Fix test

--- src/root-view.coffee
+++ src/root-view.coffee
@@ -222,6 +222,7 @@
     paneItem

   openSingletonSync: (uri, {changeFocus, initialLine, split}={}) ->
+    changeFocus ?= true
     uri = project.relativize(uri)
     pane = @panes.paneForUri(uri)


trigger correct callack

trigger correct callack

--- resources/assets/lib/play-detail-menu.coffee
+++ resources/assets/lib/play-detail-menu.coffee
@@ -48,9 +48,9 @@
       @props.onHide?()

-  onClick: =>
+  toggle: =>
     @setState active: !@state.active
-    @props.onShow?()
+    if @state.active then @props.onHide?() else @props.onShow?()

   render: =>
@@ -60,7 +60,7 @@
       button
         className: 'play-detail-menu__button'
         type: 'button'
-        onClick: @onClick
+        onClick: @toggle
         i className: 'fas fa-ellipsis-v'

       @renderMenu()
@@ -81,5 +81,5 @@
                   mode: @props.score.beatmap.mode
                   user: @props.score.user_id
           'data-turbolinks': false
-          onClick: @onClick
+          onClick: @toggle
           osu.trans 'users.show.extra.top_ranks.download_replay'


Prefer `textContent` over `innerText`

Prefer `textContent` over `innerText`

--- lib/elvis.coffee
+++ lib/elvis.coffee
@@ -139,7 +139,7 @@
 # Some browsers support `innerText` while others use `textContent`
 textAttr = do ->
   element = doc.createElement('div')
-  if 'innerText' of element then 'innerText' else 'textContent'
+  if 'textContent' of element then 'textContent' else 'innerText'

 directAttributes =


Bug fix in use of FileCollection

Bug fix in use of FileCollection

In particular, this fixes a DeprecationWarning in Meteor 1.6

--- lib/files.coffee
+++ lib/files.coffee
@@ -4,7 +4,7 @@
     res.setHeader 'Access-Control-Allow-Credentials', true
   next()

-@Files = FileCollection
+@Files = new FileCollection
   resumable: true
   resumableIndexName: 'files'
   http: [


Prevent firing selection update on selection loss when immediately regained

--- src/selection.coffee
+++ src/selection.coffee
@@ -8,6 +8,7 @@
   constructor: (@doc, @emitter) ->
     @document = @doc.root.ownerDocument
     @range = this.getRange()
+    @nullDelay = false

   checkFocus: ->
     return @document.activeElement == @doc.root
@@ -57,9 +58,14 @@
   update: (source) ->
     range = this.getRange()
     emit = source != 'silent' and !Range.compare(range, @range)
-    @range = range
-    # Set range before emitting to prevent infinite loop if listeners call quill.getSelection()
-    @emitter.emit(@emitter.constructor.events.SELECTION_CHANGE, range, source) if emit
+    # If range changes to null, require two update cycles to update and emit
+    if range == null and source =='user' and !@nullDelay
+      @nullDelay = true
+    else
+      @nullDelay = false
+      @range = range
+      # Set range before emitting to prevent infinite loop if listeners call quill.getSelection()
+      @emitter.emit(@emitter.constructor.events.SELECTION_CHANGE, range, source) if emit

   _decodePosition: (node, offset) ->
     if DOM.isElement(node)


Rename old methods and make the specs pass!

--- spec/atom/vim-mode-spec.coffee
+++ spec/atom/vim-mode-spec.coffee
@@ -1,7 +1,7 @@
 Editor = require 'editor'
 VimMode = require 'vim-mode'

-xdescribe "VimMode", ->
+describe "VimMode", ->
   editor = null

   beforeEach ->
@@ -38,136 +38,137 @@
     describe "the x keybinding", ->
       it "deletes a charachter", ->
         editor.buffer.setText("12345")
-        editor.setPosition(column: 1, row: 0)
+        editor.setCursorPosition([0, 1])

         editor.trigger keydownEvent('x')

         expect(editor.buffer.getText()).toBe '1345'
-        expect(editor.getPosition()).toEqual(column: 1, row: 0)
+        expect(editor.getCursorPosition()).toEqual([0, 1])

     describe "the d keybinding", ->
       describe "when followed by a d", ->
         it "deletes the current line", ->
           editor.buffer.setText("12345\nabcde\nABCDE")
-          editor.setPosition(column: 1, row: 1)
+          editor.setCursorPosition([1,1])

           editor.trigger keydownEvent('d')
           editor.trigger keydownEvent('d')

           expect(editor.buffer.getText()).toBe "12345\nABCDE"
-          expect(editor.getPosition()).toEqual(column: 0, row: 1)
+          expect(editor.getCursorPosition()).toEqual([1,0])

         describe "when the second d is prefixed by a count", ->
           it "deletes n lines, starting from the current", ->
             editor.buffer.setText("12345\nabcde\nABCDE\nQWERT")
-            editor.setPosition(column: 1, row: 1)
+            editor.setCursorPosition([1,1])

             editor.trigger keydownEvent('d')
             editor.trigger keydownEvent('2')
             editor.trigger keydownEvent('d')

             expect(editor.buffer.getText()).toBe "12345\nQWERT"
-            expect(editor.getPosition()).toEqual(column: 0, row: 1)
+            expect(editor.getCursorPosition()).toEqual([1,0])

       describe "when followed by an h", ->
         it "deletes the previous letter on the current line", ->
           editor.buffer.setText("abcd\n01234")
-          editor.setPosition(column: 1, row: 1)
+          editor.setCursorPosition([1,1])

           editor.trigger keydownEvent 'd'
           editor.trigger keydownEvent 'h'

           expect(editor.buffer.getText()).toBe "abcd\n1234"
-          expect(editor.getPosition()).toEqual {column: 0, row: 1}
+          expect(editor.getCursorPosition()).toEqual([1,0])

           editor.trigger keydownEvent 'd'
           editor.trigger keydownEvent 'h'

           expect(editor.buffer.getText()).toBe "abcd\n1234"
-          expect(editor.getPosition()).toEqual {column: 0, row: 1}
+          expect(editor.getCursorPosition()).toEqual([1,0])

       describe "when followed by a w", ->
         it "deletes to the beginning of the next word", ->
           editor.buffer.setText("abcd efg")
-          editor.setPosition(column: 2, row: 0)
+          editor.setCursorPosition([0,2])

           editor.trigger keydownEvent('d')
           editor.trigger keydownEvent('w')

           expect(editor.buffer.getText()).toBe "abefg"
-          expect(editor.getPosition()).toEqual {column: 2, row: 0}
+          expect(editor.getCursorPosition()).toEqual([0,2])

           editor.buffer.setText("one two three four")
-          editor.setPosition(column: 0, row: 0)
+          editor.setCursorPosition([0,0])

           editor.trigger keydownEvent('d')
           editor.trigger keydownEvent('3')
           editor.trigger keydownEvent('w')

           expect(editor.buffer.getText()).toBe "four"
-          expect(editor.getPosition()).toEqual {column: 0, row: 0}
+          expect(editor.getCursorPosition()).toEqual([0,0])

     describe "basic motion bindings", ->
       beforeEach ->
         editor.buffer.setText("12345\nabcde\nABCDE")
-        editor.setPosition(column: 1, row: 1)
+        editor.setCursorPosition([1,1])

       describe "the h keybinding", ->
         it "moves the cursor left, but not to the previous line", ->
           editor.trigger keydownEvent('h')
-          expect(editor.getPosition()).toEqual(column: 0, row: 1)
+          expect(editor.getCursorPosition()).toEqual([1,0])
           editor.trigger keydownEvent('h')
-          expect(editor.getPosition()).toEqual(column: 0, row: 1)
+          expect(editor.getCursorPosition()).toEqual([1,0])

       describe "the j keybinding", ->
         it "moves the cursor down, but not to the end of the last line", ->
           editor.trigger keydownEvent 'j'
-          expect(editor.getPosition()).toEqual(column: 1, row: 2)
+          expect(editor.getCursorPosition()).toEqual([2,1])
           editor.trigger keydownEvent 'j'
-          expect(editor.getPosition()).toEqual(column: 1, row: 2)
+          expect(editor.getCursorPosition()).toEqual([2,1])

       describe "the k keybinding", ->
         it "moves the cursor up, but not to the beginning of the first line", ->
           editor.trigger keydownEvent('k')
-          expect(editor.getPosition()).toEqual(column: 1, row: 0)
+          expect(editor.getCursorPosition()).toEqual([0,1])
           editor.trigger keydownEvent('k')
-          expect(editor.getPosition()).toEqual(column: 1, row: 0)
+          expect(editor.getCursorPosition()).toEqual([0,1])

       describe "the l keybinding", ->
         it "moves the cursor right, but not to the next line", ->
-          editor.setPosition(column: 4, row: 1)
+          editor.setCursorPosition([1,4])
           editor.trigger keydownEvent('l')
-          expect(editor.getPosition()).toEqual(column: 5, row: 1)
+          expect(editor.getCursorPosition()).toEqual([1,5])
           editor.trigger keydownEvent('l')
-          expect(editor.getPosition()).toEqual(column: 5, row: 1)
+          expect(editor.getCursorPosition()).toEqual([1,5])

       describe "the w keybinding", ->
         it "moves the cursor to the beginning of the next word", ->
           editor.buffer.setText("ab cde1+- \n xyz\n\nzip")
-          editor.setPosition(column: 0, row: 0)
+          editor.setCursorPosition([0,0])

           editor.trigger keydownEvent('w')
-          expect(editor.getPosition()).toEqual(column: 3, row: 0)
+          expect(editor.getCursorPosition()).toEqual([0,3])

           editor.trigger keydownEvent('w')
-          expect(editor.getPosition()).toEqual(column: 7, row: 0)
+          expect(editor.getCursorPosition()).toEqual([0,7])

           editor.trigger keydownEvent('w')
-          expect(editor.getPosition()).toEqual(column: 1, row: 1)
+          expect(editor.getCursorPosition()).toEqual([1,1])

           editor.trigger keydownEvent('w')
-          expect(editor.getPosition()).toEqual(column: 0, row: 2)
+          expect(editor.getCursorPosition()).toEqual([2,0])

           editor.trigger keydownEvent('w')
-          expect(editor.getPosition()).toEqual(column: 0, row: 3)
+          expect(editor.getCursorPosition()).toEqual([3,0])

+          editor.setCursorPosition [3,0]
           editor.trigger keydownEvent('w')
-          expect(editor.getPosition()).toEqual(column: 3, row: 3)
+          expect(editor.getCursorPosition()).toEqual([3,3])

     describe "numeric prefix bindings", ->
       it "repeats the following operation N times", ->
         editor.buffer.setText("12345")
-        editor.setPosition(column: 1, row: 0)
+        editor.setCursorPosition([0,1])

         editor.trigger keydownEvent('3')
         editor.trigger keydownEvent('x')
@@ -175,7 +176,7 @@
         expect(editor.buffer.getText()).toBe '15'

         editor.buffer.setText("123456789abc")
-        editor.setPosition(column: 0, row: 0)
+        editor.setCursorPosition([0,0])
         editor.trigger keydownEvent('1')
         editor.trigger keydownEvent('0')
         editor.trigger keydownEvent('x')


:green_heart: fix fixture path in empty project spec

--- spec/color-project-spec.coffee
+++ spec/color-project-spec.coffee
@@ -168,7 +168,7 @@
       atom.config.set 'pigments.sourceNames', ['*.sass']

       [fixturesPath] = atom.project.getPaths()
-      rootPath = "#{fixturesPath}/project-no-sources"
+      rootPath = "#{fixturesPath}-no-sources"
       atom.project.setPaths([rootPath])

       project = new ColorProject({})


Execute go fmt synchronously

Execute go fmt synchronously

--- lib/gofmt.coffee
+++ lib/gofmt.coffee
@@ -66,12 +66,13 @@
         source: @name
       callback(null, [message])
       return
-    done = (exitcode, stdout, stderr, messages) =>
-      console.log(@name + ' - stdout: ' + stdout) if stdout? and stdout.trim() isnt ''
-      messages = @mapMessages(stderr, cwd) if stderr? and stderr.trim() isnt ''
-      @emit(@name + '-complete', editor, saving)
-      callback(null, messages)
-    @dispatch.executor.exec(cmd, cwd, env, done, args)
+
+    {stdout, stderr, messages} = @dispatch.executor.execSync(cmd, cwd, env, args)
+
+    console.log @name + ' - stdout: ' + stdout if stdout? and stdout.trim() isnt ''
+    messages = @mapMessages(stderr, cwd) if stderr? and stderr.trim() isnt ''
+    @emit @name + '-complete', editor, saving
+    callback(null, messages)

   mapMessages: (data, cwd) =>
     pattern = /^(.*?):(\d*?):((\d*?):)?\s(.*)$/img


app: Refactor login code.

app: Refactor login code.

--- oghma/app.coffee
+++ oghma/app.coffee
@@ -56,49 +56,11 @@
       debug:     @_.debug
     )

-    handle_login = =>
-      @userverse.connect( @dictionary, 'oghma.thingy.user', =>
-        create = Ext.create( 'Oghma.Ext.EditObject',
-          object:
-            Name:      ''
-            Primary:   'FF0000'
-            Secondary: '00FF00'
-          types:
-            Primary:   'color'
-            Secondary: 'color'
-          title: 'Create User'
-          onSave: (userinfo) ->
-            if userinfo.Name == ''
-              alert( 'Name cannot be blank.' )
-            else
-              create.close()
-              login.close()
-              alert( "Creating user: #{userinfo.Name}" )
-          onCancel: ->
-            create.hide()
-            login.show()
-        )
-        login = Ext.create( 'Oghma.Ext.Login',
-          O: this
-          onLogin: ( user ) ->
-            login.close()
-            create.close()
-            alert( "Login #{user}" )
-          onCreate: ->
-            login.hide()
-            create.show()
-        )
-        login.show()
-        Ext.getBody().unmask()
-      )
-      @tableverse.connect( @dictionary, 'oghma.thingy.table' )
-      null
-
     @comet = new Heron.Comet(
       client_id:  @client_id
       on_message: ( msg )  => @dictionary.receive( msg )
       on_verbose: ( text ) => @verbose( text )
-      on_connect: handle_login
+      on_connect: => @login_phase()
     )

     # Thingyverses
@@ -110,6 +72,47 @@

     # Connect
     @comet.connect()
+
+  # Login Phase.
+  #
+  # Display Login window.  Also handles user creation logic.
+  login_phase: ->
+    @userverse.connect( @dictionary, 'oghma.thingy.user', =>
+      create = Ext.create( 'Oghma.Ext.EditObject',
+        object:
+          Name:      ''
+          Primary:   'FF0000'
+          Secondary: '00FF00'
+        types:
+          Primary:   'color'
+          Secondary: 'color'
+        title: 'Create User'
+        onSave: (userinfo) ->
+          if userinfo.Name == ''
+            alert( 'Name cannot be blank.' )
+          else
+            create.close()
+            login.close()
+            alert( "Creating user: #{userinfo.Name}" )
+        onCancel: ->
+          create.hide()
+          login.show()
+      )
+      login = Ext.create( 'Oghma.Ext.Login',
+        O: this
+        onLogin: ( user ) ->
+          login.close()
+          create.close()
+          alert( "Login #{user}" )
+        onCreate: ->
+          login.hide()
+          create.show()
+      )
+      login.show()
+      Ext.getBody().unmask()
+    )
+    @tableverse.connect( @dictionary, 'oghma.thingy.table' )
+    null

   # Send verbose message to the console.
   #


don't create output stream until compression begins

--- lib/index.coffee
+++ lib/index.coffee
@@ -8,8 +8,7 @@
   options     = level: 9
   initialized = false
   type        = 'zip'
-  zip         = undefined
-  out         = undefined
+  zipPath     = undefined
   fileList    = []
   fileStack   = []
   initialize = ->
@@ -17,9 +16,6 @@
     initialized = true

   return {
-    getStream: ->
-      return out
-
     setOptions: (opt) ->
       extend(options, opt)

@@ -27,9 +23,7 @@
       type = type

     setOutput: (path) ->
-      if out?
-        out.end()
-      out = fs.createWriteStream path
+      zipPath = path

     add: (path, callback) ->
       if not initialized
@@ -55,6 +49,7 @@
       if not initialized
         initialize()

+      out = fs.createWriteStream zipPath
       zip.pipe out

       async.parallel fileStack, (err) ->


Remove alt-shift-s bindings that conflict with typing AltGraph chars

Signed-off-by: Max Brunsfeld <78036c9b69b887700d5846f26a788d53b201ffbb@github.com>

--- keymaps/snippets-2.cson
+++ keymaps/snippets-2.cson
@@ -4,7 +4,3 @@
 'atom-text-editor:not([mini])':
   'tab': 'snippets:next-tab-stop'
   'shift-tab': 'snippets:previous-tab-stop'
-  'alt-shift-s': 'snippets:available'
-
-'.available-snippets atom-text-editor[mini]':
-  'alt-shift-s': 'snippets:available'


remove option validation

remove option validation

--- src/shaderify.coffee
+++ src/shaderify.coffee
@@ -2,7 +2,6 @@
 transformTools = require 'browserify-transform-tools'

 module.exports = transformTools.makeStringTransform "shaderify", {includeExtensions: ['.glsl']}, (content, opts, done) ->
-  # if !opts.config then return done new Error("Could not find configuration for shaderify")
   # chunkPath = opts.config.chunkPath || ''
   result = null
   if content?


Removed start and stop loading methods that do nothing

--- js-library/app/js/jail_iframe/classes/highlight.coffee
+++ js-library/app/js/jail_iframe/classes/highlight.coffee
@@ -30,12 +30,10 @@
     $elements.on 'mouseleave', @_onUnhover

   _onClick: =>
-    @show_button.startLoading() # must be called after show
     FactlinkJailRoot.on 'modalOpened', @_onModalOpened, @
     FactlinkJailRoot.openFactlinkModal @id

   _onModalOpened: ->
-    @show_button.stopLoading()
     FactlinkJailRoot.off 'modalOpened', @_onModalOpened, @

   _onHover: =>


Safer transition check for some broken CSS

--- lib/transition.coffee
+++ lib/transition.coffee
@@ -73,7 +73,9 @@
   # Process transition and remove all unnecessary properties
   remove: (decl) ->
     params = @parse(decl.value)
-    params = params.filter (param) => !@prefixes.remove[param[0].value]?.remove
+    params = params
+      .filter (param) => param[0]?.value
+      .filter (param) => !@prefixes.remove[param[0].value]?.remove
     value  = @stringify(params)

     return if decl.value == value


Trigger polling in spec via window resize instead of advancing clock

--- spec/view-registry-spec.coffee
+++ spec/view-registry-spec.coffee
@@ -1,7 +1,7 @@
 ViewRegistry = require '../src/view-registry'
 {View} = require '../src/space-pen-extensions'

-describe "ViewRegistry", ->
+fdescribe "ViewRegistry", ->
   registry = null

   beforeEach ->
@@ -161,13 +161,13 @@
       registry.updateDocument -> events.push('write')
       registry.readDocument -> events.push('read')

-      advanceClock(registry.documentPollingInterval)
+      window.dispatchEvent(new UIEvent('resize'))
       expect(events).toEqual []

       frameRequests[0]()
       expect(events).toEqual ['write', 'read', 'poll']

-      advanceClock(registry.documentPollingInterval)
+      window.dispatchEvent(new UIEvent('resize'))
       expect(events).toEqual ['write', 'read', 'poll', 'poll']

     it "polls the document after updating when ::pollAfterNextUpdate() has been called", ->


Do not import Y

Do not import Y

--- lib/y-richtext.coffee
+++ lib/y-richtext.coffee
@@ -1,8 +1,6 @@
 BaseClass = (require "./misc.coffee").BaseClass
-Y = require '../../yjs/lib/y.coffee'
-Y.List = require '../../y-list/lib/y-list.coffee'
-Y.Selections = require '../../y-selections/lib/y-selections.coffee'
-
+YList = require '../../y-list/lib/y-list.coffee'
+YSelections = require '../../y-selections/lib/y-selections.coffee'

 # All dependencies (like Y.Selections) to other types (that have its own
 # repository) should  be included by the user (in order to reduce the amount of
@@ -35,9 +33,9 @@
     if not @_model?
       super

-      @_set "selections", new Y.Selections()
-      @_set "characters", new Y.List()
-      @_set "cursors", new Y.List()
+      @_set "selections", new YSelections()
+      @_set "characters", new YList()
+      @_set "cursors", new YList()

       if @_characters?
         (@_get "characters").insert 0, @_characters
@@ -51,7 +49,7 @@
       @_setModel @_model

       # listen to events on the model using the function propagateToEditor
-      @_model.observe @propagateToEditor
+      @_model.observe propagateToEditor
     return @_model

   _setModel: (model) ->
@@ -209,7 +207,7 @@
     (@_get "characters").delete position, length

   createChar: (char, left=[], right=[]) ->
-    return new Y.Object {
+    return new @_model.custom_types.Object {
       char: char
       left: left
       right: right


fix a bug 输入的模块太长时，会进行提示。

fix a bug
输入的模块太长时，会进行提示。

--- lib/gitCreatePackage/gitCreatePackage-info-view.coffee
+++ lib/gitCreatePackage/gitCreatePackage-info-view.coffee
@@ -159,7 +159,10 @@
           else
             resolve false
         else
-          reject $.parseJSON(response.body).message
+          if $.parseJSON(response.body).message
+            reject $.parseJSON(response.body).message
+          else
+            reject response.body

     .then (packageHave) =>
       Q.Promise (resolve, reject, notify) =>


Add retry for 503

Add retry for 503

--- lib/proxy.coffee
+++ lib/proxy.coffee
@@ -127,6 +127,8 @@
                   throw new Error('Empty Body')
                 if response.statusCode == 200
                   self.emit 'game.on.response', req.method, parsed.pathname, resolvedBody, querystring.parse reqBody.toString()
+                else if response.statusCode == 503
+                  throw new Error('Service unavailable')
                 else
                   self.emit 'network.invalid.code', response.statusCode
               catch e


esthetics

esthetics

--- src/Models/ProjectHooks.coffee
+++ src/Models/ProjectHooks.coffee
@@ -12,8 +12,8 @@

   add: (projectId, params, fn = null) =>
     if 'string' is typeof params
-        params =
-            url: params
+      params =
+        url: params
     @debug "Projects::addHook()"
     @post "projects/#{Utils.parseProjectId projectId}/hooks", params, (data) => fn data if fn


fixed config description

fixed config description

--- lib/block-cursor.coffee
+++ lib/block-cursor.coffee
@@ -26,7 +26,7 @@
       type: 'color'
       default: 'transparent'
     blinkInterval:
-      description: 'Interval of the cursor blink - the period between primaryColor and secondaryColor - in milliseconds. Set to 0 to disable blinking (Note: doesn\'t apply to mini editors yet)'
+      description: 'Interval of the cursor blink - the period between primaryColor and secondaryColor - in milliseconds. Set to 0 to disable blinking.'
       type: 'integer'
       default: 400
       minimum: 0


Underscore-prefix value property and add accessor/setter methods

--- src/stochator.coffee
+++ src/stochator.coffee
@@ -190,11 +190,7 @@
             values = (@setValue(@mutate(getNext())) for time in [1..times])
             if times == 1 then values[0] else values

-        (times) ->
-            if times
-                (callGenerators() for time in [1..times])
-            else
-                callGenerators()
+    getValue: (value) -> @_value

     setGenerator: (configs) ->
         generatorConfigs = []
@@ -204,15 +200,11 @@
             else
                 break

-        [name, mutator] = configs[generatorConfigs.length..]
-        name or= "next"
-        if isType("Function")(name)
-            [name, mutator] = ["next", name]
+    setValue: (value) -> @_value = value

     toString: -> "[object Stochator]"

-    toString: ->
-        "[object Stochator]"
+    _value: 0

 if module?.exports
     module.exports = Stochator


screenshot addition

screenshot addition

Mac

--- lib/utils.coffee
+++ lib/utils.coffee
@@ -91,7 +91,9 @@
       try
         buf = image.toPng()
         if process.platform == "darwin"
-          filename = path.join path.homedir(), 'Desktop', "#{Date.now()}.png"
+          darwinPath = path.join path.homedir(), "Pictures", "Poi"
+          fs.ensureDirSync darwinPath
+          filename = path.join path.homedir(), "Pictures", "Poi", "#{Date.now()}.png"
         else
           fs.ensureDirSync path.join global.EXROOT, 'screenshots'
           filename = path.join global.EXROOT, 'screenshots', "#{Date.now()}.png"


Bug fix for recursive parsing

Bug fix for recursive parsing

--- lib/utils.coffee
+++ lib/utils.coffee
@@ -22,23 +22,24 @@
   @guid = -> return (S4()+S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+S4()+S4())

   # parse an object whose values are still JSON stringified
-  @parseValue: (value) ->
-    return value unless _.isString(value)
-    if (value.length > 20) and value[value.length-1] is 'Z'
-      date = moment.utc(value)
-      return if date and date.isValid() then date.toDate() else value
-    else
-      return true if value is 'true'
-      return false if value is 'false'
-      try value = JSON.parse(value) catch err
-    return value
-
-  @parseValues: (query) ->
-    return _.map(query, Utils.parseValues) if _.isArray(query)
-    return Utils.parseValue(query) if _.isString(query)
-    result = {}
-    result[key] = Utils.parseValue(value) for key, value of query
-    return result
+  @parseValues: (values) ->
+    if _.isArray(values)
+      return _.map(values, Utils.parseValues)
+    else if _.isObject(values)
+      result = {}
+      result[key] = Utils.parseValues(value) for key, value of values
+      return result
+    else if _.isString(values)
+      if (values.length > 20) and values[values.length-1] is 'Z'
+        date = moment.utc(values)
+        return if date and date.isValid() then date.toDate() else values
+      else
+        return true if values is 'true'
+        return false if values is 'false'
+        try
+          return Utils.parseValues(values) if values = JSON.parse(values)
+        catch err
+    return values

   @parseUrl: (url) ->
     url_parts = URL.parse(url)


Try to fix admin test

Try to fix admin test

--- src/sys/admin.coffee
+++ src/sys/admin.coffee
@@ -3,6 +3,6 @@
 #
 module.exports = do ->
   try
-    sh.RegRead 'HKEY_USERS\\S-1-5-20\\Environment\\TMP'
+    sh.RegRead 'HKEY_USERS\\S-1-5-20\\'
     true
   catch


alter structure current user template

alter structure current user template

--- src/user_view.coffee
+++ src/user_view.coffee
@@ -11,14 +11,14 @@
     @$element.on 'click' @user_interact_callback

   current_user_template: Handlebars.compile('
-

-        <div class="avatar"
+

+

-
{{display_name}}

+
{{display_name}}

-

+

         ')

   render: ->


fix syntax detection for jsx

fix syntax detection for jsx

--- lib/editor-proxy.coffee
+++ lib/editor-proxy.coffee
@@ -206,12 +206,12 @@
   # Returns the editor's syntax mode.
   getSyntax: ->
     syntax = @getGrammar().split(' ')[0]
-    unless resources.hasSyntax syntax
-        syntax = "html"

     if /\b(javascript|jsx)\b/.test(syntax)
       syntax = if @getCurrentScope().some((scope) -> /\bstring\b/.test scope) then 'html' else 'jsx'
-
+    else if not resources.hasSyntax syntax
+      syntax = "html"
+
     if syntax is 'html'
       # HTML can contain embedded syntaxes
       embedded = @getCurrentScope().filter((s) -> /\.embedded\./.test s).pop()


added day view

added day view

--- drm-calendar.coffee
+++ drm-calendar.coffee
@@ -6,7 +6,7 @@

 ( ($) ->
     class window.DrmCalendar
-        constructor: (@calendarClass = 'drm-calendar', @daysPerWeek = 7, @view = 'week', @addHolidays = yes) ->
+        constructor: (@calendarClass = 'drm-calendar', @daysPerWeek = 7, @view = 'date', @addHolidays = yes) ->
             self = @
             self.body = $ 'body'
             self.events = []
@@ -22,12 +22,15 @@
             self.addEventForm = self.calendar.find('form.drm-calendar-new-event').hide()
             self.showEventFormButton = self.calendar.find 'button.drm-show-event-form'
             self.calendarViewActiveButton = self.calendar.find(".drm-calendar-view-nav button[data-view=#{self.view}]").addClass 'active'
-            self.eventClass = 'events'
+            self.eventClass = 'drm-events'
             self.classes =
                 weekend: 'drm-cal-weekend'
                 muted: 'drm-cal-muted'
                 holiday: 'drm-cal-holiday'
                 today: 'drm-cal-today'
+                month: 'drm-month'
+                week: 'drm-week'
+                date: 'drm-date'

             self.months = [
                 'January'
@@ -410,6 +413,10 @@

             if self.calendar.length > 0
                 self.createCalendar self.currentMonth, self.currentDate, self.currentYear
+
+            self.calendar.on 'click', '.drm-calendar-date-prev, .drm-calendar-date-next', ->
+                direction = $(@).data 'dir'
+                self.advanceDate.call @, direction

             self.calendar.on 'click', '.drm-calendar-week-prev, .drm-calendar-week-next', ->
                 direction = $(@).data 'dir'
@@ -492,7 +499,7 @@
                 self.addEventForm.find(':input').val ''
                 self.addEventForm.find('input:checked').prop 'checked', false

-            self.calendar.on 'click', "td:not(.#{self.classes.muted})", ->
+            self.calendar.on 'click', ".drm-date", ->
                 that = $ @
                 month = self.months[that.data('month')]
                 date = that.data 'date'
@@ -509,7 +516,7 @@
             # show event details
             self.calendar.on 'click', "ul.#{self.eventClass} a", (e) ->
                 that = $ @
-                day = that.closest('td')
+                day = that.closest('.drm-date')
                 eventId = that.data 'event'
                 fullDate =
                     month: self.months[day.data('month')]
@@ -533,10 +540,11 @@
             self.body.on 'click', 'div.drm-calendar-event-details button.drm-event-close', self.removeEventDetails

         getDaysInMonth: (month, year) ->
+            month = month + 1
             new Date(year, month, 0).getDate()

-        getDayOfWeek: (month, year, day) ->
-            day = new Date year, month, day
+        getDayOfWeek: (month, date, year) ->
+            day = new Date year, month, date
             day.getDay()

         getWeeksInMonth: (numberDays, dayShift) =>
@@ -548,7 +556,7 @@
             year = calendarInner.data 'year'

             if month is @currentMonth and year is @currentYear
-                calendarInner.find("td[data-date=#{@currentDate}]").addClass @classes.today
+                calendarInner.find(".drm-date[data-date=#{@currentDate}]").addClass @classes.today

         createEvent: (newEvent) =>
             id = @events.length
@@ -570,17 +578,22 @@

         addNewCalendarEvent: (events, dates) =>
             calendarInner = @calendar.find "div.#{@calendarInnerClass}"
+
             if @view is 'month'
-                calendarItem = calendarInner.find "td[data-date=#{dates}]"
-            else if @view is 'week' and (events.allDayEvent is true or !events.time?)
-                calendarItem = calendarInner.find "td[data-date=#{dates}][data-hour='All Day Event']"
-            else if @view is 'week' and events.allDayEvent is false
+                calendarItem = calendarInner.find ".drm-date[data-date=#{dates}]"
+            else if (events.allDayEvent or !events.time?)
+                calendarItem = calendarInner.find ".drm-date[data-date=#{dates}][data-hour='All Day Event']"
+            else if !events.allDayEvent
                 # find hour td element
-                re = new RegExp '[0:]','gi'
+                re = new RegExp '^0?','gi'
+                re2 = new RegExp ':[0-9]{2}', 'gi'
                 hour = events.time.replace re, ''
-                calendarItem = calendarInner.find "td[data-date=#{dates}][data-hour=#{hour}]"
+                hour = hour.replace re2, ''
+                calendarItem = calendarInner.find ".drm-date[data-date=#{dates}][data-hour=#{hour}]"
+
             eventList = calendarItem.find "ul.#{@eventClass}"
             length = eventList.length
+            eventHtml = if events.time? then "#{events.time}:#{events.name}" else "#{events.name}"

             if length is 0
                 eventList = $ '

',
@@ -589,7 +602,7 @@
                 eventList.appendTo calendarItem

             item = $ '

',
-                html: "#{events.name}"
+                html: eventHtml

             item.appendTo eventList

@@ -681,8 +694,8 @@

         getDatesInWeek: (currentMonth, currentDate, currentYear) =>
             self = @
-            firstDay = self.getDayOfWeek currentMonth, currentYear, 1
-            numberDays = self.getDaysInMonth (currentMonth + 1), currentYear
+            firstDay = self.getDayOfWeek currentMonth, 1, currentYear
+            numberDays = self.getDaysInMonth currentMonth, currentYear
             dayShift = if firstDay is self.daysPerWeek then 0 else firstDay
             currentDay = self.getDayOfWeek currentMonth, currentDate, currentYear
             numberWeeks = self.getWeeksInMonth numberDays, dayShift
@@ -724,25 +737,27 @@
         getEventWeekNum: (dayNum, day, numberDays, dayShift) =>
             self = @
             calendarInner = self.calendar.find "div.#{@calendarInnerClass}"
-            weeks = if self.view is 'month' then calendarInner.find('tbody').find 'tr.drm-week' else calendarInner.find 'tbody.drm-week'
+            weeks = calendarInner.find '.drm-week'
             numberWeeks = self.getWeeksInMonth numberDays, dayShift
             lastWeekLength = weeks.eq(numberWeeks).length

             if dayNum is 'last' and dayShift <= day
-                if lastWeekLength < day then (numberWeeks - 2) else numberWeeks - 1
+                eventWeekNum = if lastWeekLength < day then (numberWeeks - 2) else numberWeeks - 1
             else if dayNum is 'last' and dayShift > day
-                numberWeeks - 2
+                eventWeekNum = numberWeeks - 2
             else
-                parseInt(dayNum, 10) - 1
+                eventWeekNum = parseInt(dayNum, 10) - 1
+
+            eventWeekNum = if dayShift <= day then eventWeekNum else eventWeekNum + 1

         addYearlyEvents: (events, eventDates) =>
             self = @
             calendarInner = self.calendar.find "div.#{@calendarInnerClass}"
             currentMonth = calendarInner.data 'month'
             currentYear = calendarInner.data 'year'
-            weeks = if self.view is 'month' then calendarInner.find('tbody').find 'tr.drm-week' else calendarInner.find 'tbody.drm-week'
-            firstDay = self.getDayOfWeek currentMonth, currentYear, 1
-            numberDays = self.getDaysInMonth (currentMonth + 1), currentYear
+            weeks = calendarInner.find '.drm-week'
+            firstDay = self.getDayOfWeek currentMonth, 1, currentYear
+            numberDays = self.getDaysInMonth currentMonth, currentYear
             dayShift = if firstDay is self.daysPerWeek then 0 else firstDay
             month = $.inArray events.month, self.months

@@ -753,8 +768,12 @@
                     eventWeekNum = self.getEventWeekNum events.dayNum, day, numberDays, dayShift

                     if currentMonth is month
-                        eventWeek = if dayShift <= day then eventWeek = weeks.eq eventWeekNum else eventWeek = weeks.eq eventWeekNum + 1
-                        eventDates.push eventWeek.find("td.drm-date[data-day=#{day}]").data 'date'
+                        weeks.each ->
+                            that = $ @
+                            firstDay = that.find(".#{self.classes.date}").first().data 'date'
+                            weekInfo = self.getDatesInWeek currentMonth, firstDay, currentYear
+                            if eventWeekNum is weekInfo.weekNum
+                                eventDates.push that.find(".#{self.classes.date}[data-day=#{day}]").data 'date'
             else
                 eventDates.push parseInt(events.eventDate, 10)

@@ -763,9 +782,9 @@
             calendarInner = self.calendar.find "div.#{@calendarInnerClass}"
             currentMonth = calendarInner.data 'month'
             currentYear = calendarInner.data 'year'
-            weeks = if self.view is 'month' then calendarInner.find('tbody').find 'tr.drm-week' else calendarInner.find 'tbody.drm-week'
-            firstDay = self.getDayOfWeek currentMonth, currentYear, 1
-            numberDays = self.getDaysInMonth (currentMonth + 1), currentYear
+            weeks = calendarInner.find '.drm-week'
+            firstDay = self.getDayOfWeek currentMonth, 1, currentYear
+            numberDays = self.getDaysInMonth currentMonth, currentYear
             dayShift = if firstDay is self.daysPerWeek then 0 else firstDay

             # add monthly events
@@ -774,7 +793,7 @@
                     day = $.inArray value, self.days
                     eventWeekNum = self.getEventWeekNum events.dayNum, day, numberDays, dayShift
                     eventWeek = if dayShift <= day then eventWeek = weeks.eq eventWeekNum else eventWeek = weeks.eq eventWeekNum + 1
-                    eventDates.push eventWeek.find("td.drm-date[data-day=#{day}]").data 'date'
+                    eventDates.push eventWeek.find(".#{self.classes.date}[data-day=#{day}]").data 'date'
             else
                 eventDates.push parseInt(events.eventDate, 10)

@@ -783,7 +802,7 @@
             calendarInner = self.calendar.find "div.#{@calendarInnerClass}"
             currentMonth = calendarInner.data 'month'
             currentYear = calendarInner.data 'year'
-            weeks = if self.view is 'month' then calendarInner.find('tbody').find "tr.drm-week" else calendarInner.find "tbody.drm-week"
+            weeks = calendarInner.find '.drm-week'

             # events that occur every 2 weeks
             if events.day
@@ -792,22 +811,22 @@
                     day = $.inArray value, self.days
                     length = weeks.length
                     weekPattern = if weekInfo.weekNum % 2 is 0 then 'even' else 'odd'
-                    eventWeeks = if self.view is 'month' then calendarInner.find('tbody').find "tr.#{weekPattern}-week" else calendarInner.find "tbody.#{weekPattern}-week"
+                    eventWeeks = calendarInner.find ".#{weekPattern}-week"

                     $.each eventWeeks, (key, value) ->
                         that = $ value
-                        weekLength = that.find("td:not(.#{self.classes.muted})").length
-                        eventDates.push that.find("td.drm-date[data-day=#{day}]").data('date')
+                        weekLength = that.find(".drm-date").length
+                        eventDates.push that.find(".#{self.classes.date}[data-day=#{day}]").data('date')

         addWeeklyEvents: (events, eventDates) =>
             self = @
             calendarInner = self.calendar.find "div.#{@calendarInnerClass}"
             currentMonth = calendarInner.data 'month'
             currentYear = calendarInner.data 'year'
-            firstDay = self.getDayOfWeek currentMonth, currentYear, 1
-            numberDays = self.getDaysInMonth (currentMonth + 1), currentYear
+            firstDay = self.getDayOfWeek currentMonth, 1, currentYear
+            numberDays = self.getDaysInMonth currentMonth, currentYear
             dayShift = if firstDay is self.daysPerWeek then 0 else firstDay
-            weeks = if self.view is 'month' then calendarInner.find('tbody').find 'tr.drm-week' else calendarInner.find 'tbody.drm-week'
+            weeks = calendarInner.find '.drm-week'

             # weekly events
             if events.day
@@ -816,21 +835,21 @@
                     length = weeks.length
                     $.each weeks, (key, value) ->
                         that = $ value
-                        days = if self.view is 'month' then that.find "td.drm-date" else that.find "td.drm-date[data-hour='All Day Event']"
+                        days = if self.view is 'month' then that.find ".#{self.classes.date}" else that.find ".#{self.classes.date}[data-hour='All Day Event']"
                         weekLength = days.length
                         if key is 0 and length isnt 1
-                            if dayShift <= day then eventDates.push that.find("td.drm-date[data-day=#{day}]").data('date')
+                            if dayShift <= day then eventDates.push that.find(".#{self.classes.date}[data-day=#{day}]").data('date')
                         else if key is (length - 1) and length isnt 1
-                            if day < weekLength then eventDates.push that.find("td.drm-date[data-day=#{day}]").data('date')
+                            if day < weekLength then eventDates.push that.find(".#{self.classes.date}[data-day=#{day}]").data('date')
                         else
-                            eventDates.push that.find("td.drm-date[data-day=#{day}]").data('date')
+                            eventDates.push that.find(".#{self.classes.date}[data-day=#{day}]").data('date')

             eventDates

         addDailyEvents: (events, eventDates) =>
             self = @
             calendarInner = self.calendar.find "div.#{@calendarInnerClass}"
-            days = if self.view is 'month' then calendarInner.find "tbody td.drm-date" else calendarInner.find "td.drm-date[data-hour='All Day Event']"
+            days = if self.view is 'month' then calendarInner.find ".#{self.classes.date}" else calendarInner.find ".#{self.classes.date}[data-hour='All Day Event']"
             days.each ->
                 eventDates.push $(@).data 'date'

@@ -869,12 +888,12 @@
         highlightWeekends: =>
             self = @
             calendarInner = self.calendar.find "div.#{@calendarInnerClass}"
-            weeks = if self.view is 'month' then calendarInner.find('tbody').find 'tr.drm-week' else calendarInner.find 'tbody.drm-week'
+            weeks = calendarInner.find '.drm-week'

             $.each weeks, ->
                 that = $ @
                 $.each self.weekend, (key, value) ->
-                    weekend = that.find("td[data-day=#{value}]").not ".#{self.classes.muted}, .#{self.classes.today}, .#{self.classes.holiday}"
+                    weekend = that.find(".#{self.classes.date}[data-day=#{value}]").not ".#{self.classes.muted}, .#{self.classes.today}, .#{self.classes.holiday}"
                     weekend.addClass self.classes.weekend

         addWeekNumbers: =>
@@ -883,12 +902,12 @@
             month = calendarInner.data 'month'
             year = calendarInner.data 'year'
             weekNum = 1
-            weeks = if self.view is 'month' then calendarInner.find('tbody').find 'tr.drm-week' else calendarInner.find 'tbody.drm-week'
+            weeks = calendarInner.find '.drm-week'
             weekNums = []

             $.each self.months, (key, value) ->
-                numberDays = self.getDaysInMonth (key + 1), year
-                firstDay = self.getDayOfWeek key, year, 1
+                numberDays = self.getDaysInMonth key, year
+                firstDay = self.getDayOfWeek key, 1, year
                 dayShift = if firstDay is self.daysPerWeek then 0 else firstDay
                 numberWeeks = self.getWeeksInMonth numberDays, dayShift
                 week = 1
@@ -920,8 +939,8 @@
             weekInfo = self.getDatesInWeek currentMonth, currentDate, currentYear

             $.each self.months, (key, value) ->
-                numberDays = self.getDaysInMonth (key + 1), currentYear
-                firstDay = self.getDayOfWeek key, currentYear, 1
+                numberDays = self.getDaysInMonth key, currentYear
+                firstDay = self.getDayOfWeek key, 1, currentYear
                 dayShift = if firstDay is self.daysPerWeek then 0 else firstDay
                 numberWeeks = self.getWeeksInMonth numberDays, dayShift
                 week = 1
@@ -936,6 +955,38 @@
                             weekNums.push weekNum
             weekNumber = weekNums[weekInfo.weekNum]

+        advanceDate: (direction) =>
+            calendarInner = @calendar.find "div.#{@calendarInnerClass}"
+            currentMonth = calendarInner.data 'month'
+            currentYear = calendarInner.data 'year'
+            nextYear = currentYear + 1
+            lastYear = currentYear - 1
+            nextMonth = if currentMonth is 11 then 0 else currentMonth + 1
+            lastMonth = if currentMonth is 0 then 11 else currentMonth - 1
+            currentDate = calendarInner.find(".#{@classes.date}").data 'date'
+
+            if direction is 'prev'
+                lastDayOfPrevMonth = @getDaysInMonth lastMonth, currentYear
+
+                if currentDate is 1
+                    currentDate = lastDayOfPrevMonth
+                    currentYear = if currentMonth is 0 then lastYear else currentYear
+                    currentMonth = lastMonth
+                else
+                    currentDate = currentDate - 1
+
+            else if direction is 'next'
+                lastDayOfMonth = @getDaysInMonth currentMonth, currentYear
+
+                if currentDate is lastDayOfMonth
+                    currentDate = 1
+                    currentYear = if currentMonth is 11 then nextYear else currentYear
+                    currentMonth = nextMonth
+                else
+                    currentDate = currentDate + 1
+
+            if @view is 'date' then @changeCalendar currentMonth, currentDate, currentYear
+
         advanceWeek: (direction) =>
             calendarInner = @calendar.find "div.#{@calendarInnerClass}"
             currentMonth = calendarInner.data 'month'
@@ -946,28 +997,44 @@
             lastMonth = if currentMonth is 0 then 11 else currentMonth - 1

             if direction is 'prev'
-                firstDay = calendarInner.find('td.drm-date').first().data 'date'
-                lastDayOfPrevMonth = @getDaysInMonth lastMonth + 1, currentYear
-
-                if firstDay is 1
+                firstDay = calendarInner.find(".#{@classes.date}").first().data 'date'
+                lastDayOfPrevMonth = @getDaysInMonth lastMonth, currentYear
+
+                if firstDay is 1 and @view is 'week'
                     currentDate = lastDayOfPrevMonth
                     currentYear = if currentMonth is 0 then lastYear else currentYear
                     currentMonth = lastMonth
+                else if firstDay < 7 and @view is 'week'
+                    currentDate = firstDay - 1
+                else if firstDay is 1 and @view is 'date'
+                    currentDate = lastDayOfPrevMonth - 6 # 30 - 6 1 24
+                    currentYear = if currentMonth is 0 then lastYear else currentYear
+                    currentMonth = lastMonth
+                else if firstDay < 7 and @view is 'date'
+                    currentDate = lastDayOfPrevMonth - (7 - firstDay) # 31 - (7 - 3) = 27 27  28 - (7 - 6) = 27 6 27
+                    currentYear = if currentMonth is 0 then lastYear else currentYear
+                    currentMonth = lastMonth
                 else
-                    currentDate = firstDay - 1
+                    currentDate = firstDay - 7

             else if direction is 'next'
-                lastDay = calendarInner.find('td.drm-date').last().data 'date'
-                lastDayOfMonth = @getDaysInMonth currentMonth + 1, currentYear
-
-                if lastDay is lastDayOfMonth
+                lastDay = calendarInner.find(".#{@classes.date}").last().data 'date'
+                lastDayOfMonth = @getDaysInMonth currentMonth, currentYear
+
+                if lastDay is lastDayOfMonth and @view is 'week'
                     currentDate = 1
                     currentYear = if currentMonth is 11 then nextYear else currentYear
                     currentMonth = nextMonth
+                else if (lastDay + 7 > lastDayOfMonth) and @view is 'week'
+                    currentDate = lastDayOfMonth
+                else if (lastDay + 7 > lastDayOfMonth) and @view is 'date'
+                    currentDate = 7 - (lastDayOfMonth - lastDay) # 31 - 29 = 2 then 7 - 2 = 5
+                    currentYear = if currentMonth is 11 then nextYear else currentYear
+                    currentMonth = nextMonth
                 else
-                    currentDate = lastDay + 1
-
-            @changeCalendar currentMonth, currentDate, currentYear
+                    currentDate = lastDay + 7
+
+            if @view is 'date' or @view is 'week' then @changeCalendar currentMonth, currentDate, currentYear

         advanceMonth: (direction) =>
             calendarInner = @calendar.find "div.#{@calendarInnerClass}"
@@ -1003,15 +1070,15 @@
         createMonthView: (currentMonth, currentYear) =>
             self = @
             self.calendarInnerClass = "drm-calendar-#{self.view}-view"
-            numberDays = self.getDaysInMonth (currentMonth + 1), currentYear
-            prevMonthNumberDays = self.getDaysInMonth currentMonth, currentYear
-            firstDay = self.getDayOfWeek currentMonth, currentYear, 1
+            numberDays = self.getDaysInMonth currentMonth, currentYear
+            firstDay = self.getDayOfWeek currentMonth, 1, currentYear
             dayShift = if firstDay is self.daysPerWeek then 0 else firstDay
             numberWeeks = self.getWeeksInMonth numberDays, dayShift
             nextYear = currentYear + 1
             lastYear = currentYear - 1
             nextMonth = if currentMonth is 11 then 0 else currentMonth + 1
             lastMonth = if currentMonth is 0 then 11 else currentMonth - 1
+            prevMonthNumberDays = self.getDaysInMonth lastMonth, currentYear
             calendar = null
             heading = null
             weekdays = null
@@ -1022,7 +1089,7 @@
                 weekdays += "#{value}	"
             weekdays += '

'

-            weeks = "
"
+            weeks = "
"
             i = 1
             currentDate = 1
             l = 1
@@ -1031,7 +1098,7 @@

             while i <= numberWeeks
                 j = 1
-                weeks += "
"
+                weeks += "
"
                 # if we are in week 1 we need to shift to the correct day of the week
                 if i is 1 and firstDay isnt 0
                     # add cells for the previous month until we get to the first day
@@ -1042,7 +1109,7 @@
                         j += 1
                     # start adding cells for the current month
                     while j <= self.daysPerWeek
-                        weeks += "#{currentDate}	"
+                        weeks += "#{currentDate}	"
                         j += 1
                         currentDate += 1
                 # if we are in the last week of the month we need to add blank cells for next month
@@ -1050,7 +1117,7 @@
                     while j <= self.daysPerWeek
                         # finish adding cells for the current month
                         if currentDate <= numberDays
-                            weeks += "#{currentDate}	"
+                            weeks += "#{currentDate}	"
                         # start adding cells for next month
                         else
                             weeks += "#{nextDates}	"
@@ -1060,7 +1127,7 @@
                 else
                     # if we are in the middle of the month add cells for the current month
                     while j <= self.daysPerWeek
-                        weeks += "#{currentDate}	"
+                        weeks += "#{currentDate}	"
                         j += 1
                         currentDate += 1
                 weeks += '
'
@@ -1093,18 +1160,21 @@
             $('.drm-calendar-month-prev').text self.months[lastMonth]
             $('.drm-calendar-month-next').text self.months[nextMonth]

+            $('.drm-calendar-week-prev, .drm-calendar-week-next').hide()
+            $('.drm-calendar-date-prev, .drm-calendar-date-next').hide()
+
         createWeekView: (currentMonth, currentDate, currentYear) =>
             self = @
             self.calendarInnerClass = "drm-calendar-#{self.view}-view"
-            numberDays = self.getDaysInMonth (currentMonth + 1), currentYear
-            prevMonthNumberDays = self.getDaysInMonth currentMonth, currentYear
-            firstDay = self.getDayOfWeek currentMonth, currentYear, 1
+            numberDays = self.getDaysInMonth currentMonth, currentYear
+            firstDay = self.getDayOfWeek currentMonth, 1, currentYear
             dayShift = if firstDay is self.daysPerWeek then 0 else firstDay
             numberWeeks = self.getWeeksInMonth numberDays, dayShift
             nextYear = currentYear + 1
             lastYear = currentYear - 1
             nextMonth = if currentMonth is 11 then 0 else currentMonth + 1
             lastMonth = if currentMonth is 0 then 11 else currentMonth - 1
+            prevMonthNumberDays = self.getDaysInMonth lastMonth, currentYear
             calendar = null
             heading = null
             weekdays = null
@@ -1139,28 +1209,28 @@
                         dates.month = nextMonth
                 dates

-            weekdays = "

"
-            weekdays += "	"
+            weekdaysHtml = "

	"
             $.each self.days, (key, value) ->
                 dates = getDates datesInWeek, key
-                weekdays += "#{value}
#{self.months[dates.month]} #{dates.date}	"
-            weekdays += '

'
-
-            week = "
"
-
+                weekdaysHtml += "#{value}
#{self.months[dates.month]} #{dates.date}	"
+            weekdaysHtml += '

'
+
+            weekHtml = "
"
             $.each self.hours, (key, value) ->
                 hour = value.name
-                week += '
'
-                week += "#{hour}	"
+                weekHtml += "
#{hour}	"
                 $.each self.days, (key, value) ->
                     dates = getDates datesInWeek, key
-                    week += "	"
-                week += '
'
-            week += '

'
+                    weekHtml += "	"
+                weekHtml += '
'
+            weekHtml += '
'
+
+            weekView = $ '

',
+                html: weekdaysHtml + weekHtml

             calendar = $ '

',
                 class: self.calendarInnerClass
-                html: weekdays + week
+                html: weekView
                 'data-month': currentMonth
                 'data-year': currentYear

@@ -1187,30 +1257,64 @@
             $('.drm-calendar-month-prev').text self.months[lastMonth]
             $('.drm-calendar-month-next').text self.months[nextMonth]

+            $('.drm-calendar-week-prev, .drm-calendar-week-next').show()
+            $('.drm-calendar-date-prev, .drm-calendar-date-next').hide()
+
         createDateView: (currentMonth, currentDate, currentYear) =>
             self = @
             self.calendarInnerClass = "drm-calendar-#{self.view}-view"
+            day = self.getDayOfWeek currentMonth, currentDate, currentYear
+            weekNumber = self.getWeekNumber currentMonth, currentDate, currentYear
+            weekClass = if weekNumber % 2 is 0 then 'even-week' else 'odd-week'
+            nextYear = currentYear + 1
+            lastYear = currentYear - 1
+            nextMonth = if currentMonth is 11 then 0 else currentMonth + 1
+            lastMonth = if currentMonth is 0 then 11 else currentMonth - 1
+
+            dayListHtml = "
"
+            $.each self.hours, (key, value) ->
+                hour = value.name
+                dayListHtml += "
#{hour}
"
+            dayListHtml += '
'

             calendar = $ '

',
                 class: self.calendarInnerClass
-                text: 'Day View'
                 'data-month': currentMonth
                 'data-year': currentYear
+                html: dayListHtml
+
+            headingText =
+                if currentMonth is self.currentMonth and currentDate is self.currentDate and currentYear is self.currentYear
+                    "Today, #{self.days[day]}, #{self.months[currentMonth]} #{currentDate} #{currentYear}"
+                else
+                    "#{self.days[day]}, #{self.months[currentMonth]} #{currentDate} #{currentYear}"

             heading = $ '

',
                 class: 'drm-calendar-header'
-                text: "#{@months[currentMonth]} #{currentDate} #{currentYear}"
+                text: headingText

             calendar.appendTo ".#{self.calendarClass}"
             heading.prependTo ".#{self.calendarInnerClass}"

+            $.each self.events, (key, value) ->
+                self.addEventsToCalendar value
+
+            $('.drm-calendar-year-prev').text lastYear
+            $('.drm-calendar-year-next').text nextYear
+
+            $('.drm-calendar-month-prev').text self.months[lastMonth]
+            $('.drm-calendar-month-next').text self.months[nextMonth]
+
+            $('.drm-calendar-week-prev, .drm-calendar-week-next').show()
+            $('.drm-calendar-date-prev, .drm-calendar-date-next').show()
+
         createCalendar: (month, date, year) =>
             self = @

             switch self.view
                 when 'month' then self.createMonthView month, year
                 when 'week' then self.createWeekView month, date, year
-                when 'day' then self.createDateView month, date, year
+                when 'date' then self.createDateView month, date, year

     drmCalendar = new DrmCalendar()
     drmCalendar.createEvent
@@ -1273,5 +1377,25 @@
         recurrance: "none"
         allDayEvent: false
         note: "do this once"
+    drmCalendar.createEvent
+        name: "Later That Day"
+        month: "May"
+        year: 2014
+        time: '1:30pm'
+        eventDate: 4
+        type: "test"
+        recurrance: "none"
+        allDayEvent: false
+        note: "do this once"
+    drmCalendar.createEvent
+        name: "Another One Time Event"
+        month: "May"
+        year: 2014
+        time: '2:30pm'
+        eventDate: 4
+        type: "test"
+        recurrance: "none"
+        allDayEvent: false
+        note: "do this once"

 ) jQuery


profile: applied correct subtypes to listitemviews

--- client/landing/app/MainApp/lazy/staticprofilecontroller.coffee
+++ client/landing/app/MainApp/lazy/staticprofilecontroller.coffee
@@ -437,6 +437,7 @@
        @addStaticLogic callback

+
   addActivityLogic:(callback=->)->
     log 'adding activity logic'
     activityController = new ActivityListController
@@ -495,7 +496,7 @@
       lazyLoadThreshold : .99
       itemClass         : StaticTopicsListItem
       viewOptions       :
-        cssClass        : 'static-content'
+        cssClass        : 'static-content topic'
       showHeader        : no

     topicsListWrapper = topicsController.getView()
@@ -526,7 +527,7 @@
       lazyLoadThreshold : .99
       itemClass         : StaticGroupsListItem
       viewOptions       :
-        cssClass        : 'static-content'
+        cssClass        : 'static-content group'
       showHeader        : no

     groupsListWrapper = groupsController.getView()
@@ -556,7 +557,7 @@
       lazyLoadThreshold : .99
       itemClass         : StaticAppsListItem
       viewOptions       :
-        cssClass        : 'static-content'
+        cssClass        : 'static-content app'
       showHeader        : no

     appsListWrapper = appsController.getView()
@@ -585,7 +586,7 @@
       lazyLoadThreshold : .99
       itemClass         : StaticMembersListItem
       viewOptions       :
-        cssClass        : 'static-content'
+        cssClass        : 'static-content member'
       showHeader        : no

     membersListWrapper = membersController.getView()
@@ -606,7 +607,6 @@
     callback()

-
   addStaticLogic:(callback=->)->
     log 'adding static logic'

@@ -615,7 +615,7 @@
       lazyLoadThreshold : .99
       itemClass         : StaticActivityListItemView
       viewOptions       :
-        cssClass        : 'static-content'
+        cssClass        : 'static-content static'
       showHeader        : no

     staticListWrapper = staticController.getView()
@@ -655,6 +655,8 @@
   showHomeLink:->
     @homeLink.unsetClass 'invisible'

+
+
 class StaticNavLink extends KDView
   constructor:(options,data)->
     super options,data
@@ -743,9 +745,12 @@

 class StaticTopicsListItem extends KDListItemView
   partial:(data)->
-    # log data
+    log data
     "<div class='static-topic'>
        #{data.title}
+       #{data.body}
+       #{data.counts.followers}
+       #{data.counts.post}
     </div>"

 class StaticMembersListItem extends KDListItemView


don't set referneces and notifications urls in default as open source does not use them yet

--- services/web/config/settings.defaults.coffee
+++ services/web/config/settings.defaults.coffee
@@ -104,10 +104,10 @@
 			url: "http://localhost:3036"
 		sixpack:
 			url: ""
-		references:
-			url: "http://localhost:3040"
-		notifications:
-			url: "http://localhost:3042"
+		# references:
+		# 	url: "http://localhost:3040"
+		# notifications:
+		# 	url: "http://localhost:3042"

 	templates:
 		user_id: process.env.TEMPLATES_USER_ID or "5395eb7aad1f29a88756c7f2"


Add Objective-C and Objective-C++ for valid Syntax.

With respects to the C++ language change in Atom.

--- lib/linter-clang.coffee
+++ lib/linter-clang.coffee
@@ -8,7 +8,8 @@
 class LinterClang extends Linter
   # The syntax that the linter handles. May be a string or
   # list/tuple of strings. Names should be all lowercase.
-  @syntax: ['source.c++', 'source.cpp', 'source.c']
+  @syntax: ['source.c++', 'source.cpp', 'source.c', 'source.objc++',
+  'source.objcpp', 'source.objc']

   # A string, list, tuple or callable that returns a string, list or tuple,
   # containing the command line (with arguments) used to lint.


remove commented code

remove commented code

--- lib/local_server.coffee
+++ lib/local_server.coffee
@@ -29,8 +29,6 @@
   ###

   start: (port, cb) ->
-    # opts = @project.config.server ? {}
-
     bs_options =
       port: port
       logLevel: 'silent'


Change install button icon to git-branch for git package installation

Signed-off-by: Michelle Tilley <19f7a7eb6786def4c39d6d86c40af5dbc6589663@github.com>

--- lib/package-card.coffee
+++ lib/package-card.coffee
@@ -324,6 +324,8 @@
       @packageDescription.text gitUrlInfo.https()
     else
       @packageDescription.text gitUrlInfo.toString()
+    @installButton.removeClass('icon-cloud-download')
+    @installButton.addClass('icon-git-branch')

   displayAvailableUpdate: (@newVersion) ->
     @updateInterfaceState()


Remove unusued html to markdown

Remove unusued html to markdown

--- src/smc-webapp/markdown.coffee
+++ src/smc-webapp/markdown.coffee
@@ -3,18 +3,15 @@

 Automatically parses math with Katex
 ###
-unified          = require('unified')
+unified       = require('unified')

-markdown         = require('remark-parse')
-math             = require('remark-math')
-remark2rehype    = require('remark-rehype')
-remark_stringify = require('remark-stringify')
+markdown      = require('remark-parse')
+math          = require('remark-math')
+remark2rehype = require('remark-rehype')

-rehype           = require('rehype')
-raw              = require('rehype-raw')
-katex            = require('rehype-katex')
-rehype2remark    = require('rehype-remark')
-rehype_stringify = require('rehype-stringify')
+raw           = require('rehype-raw')
+katex         = require('rehype-katex')
+stringify     = require('rehype-stringify')

 katex_markdown_processor = unified()
     .use(markdown)
@@ -22,21 +19,13 @@
     .use(remark2rehype, {allowDangerousHTML: true})
     .use(raw)
     .use(katex)
-    .use(rehype_stringify)
+    .use(stringify)

 markdown_processor = unified()
     .use(markdown)
     .use(remark2rehype, {allowDangerousHTML: true})
     .use(raw)
-    .use(rehype_stringify)
-
-html_processor = unified()
-    .use(rehype)
-    .use(rehype2remark)
-    .use(remark_stringify)
-
-exports.html_to_markdwon = (html_string) ->
-    return html_processor.processSynce(html_string).toString()
+    .use(stringify)

 exports.markdown_to_html = (markdown_string, opts) ->
     if opts.process_math


Add a missing null return

Add a missing null return

--- src/smc-webapp/r_upgrades.cjsx
+++ src/smc-webapp/r_upgrades.cjsx
@@ -264,7 +264,7 @@
     render: ->
         upgraded_projects = @props.get_projects_upgraded_by()
         if not misc.len(upgraded_projects)
-            return
+            return null
         <Panel header={@render_header()}>
             <Row key='header'>
                 <Col sm={4}>


modify BaseRepository#createDataForSave() (fix bug)

--- src/lib/base-repository.coffee
+++ src/lib/base-repository.coffee
@@ -169,7 +169,8 @@
             # exclude model properties
             if modelProperties[key]?
                 continue
+            dataForSave[key] = value

-        return data
+        return dataForSave

 module.exports = BaseRepository


creep_actions: better 'attack target' log line

--- src/logic/creep_actions.coffee
+++ src/logic/creep_actions.coffee
@@ -19,8 +19,7 @@

 attack_hostile = (creep, hostile, hostile_type) ->
   if hostile != null
-    set_job(creep,
-      "attack #{hostile_type} of #{hostile.owner.username} at #{hostile.pos}")
+    set_job(creep, "attack #{hostile_type} #{hostile.id} at #{hostile.pos}")
     creep.moveTo(hostile)
     creep.attack(hostile)
     return true


Add guards for no right clicked tab

Add guards for no right clicked tab

In the case that this event gets triggered by someone besides the
context menu and there is no right clicked tab when triggered.

--- lib/tab-bar-view.coffee
+++ lib/tab-bar-view.coffee
@@ -114,12 +114,14 @@
   closeOtherTabs: ->
     tabs = @getTabs()
     active = @children('.right-clicked').view()
+    return unless active?
     @closeTab tab for tab in tabs when tab isnt active

   closeTabsToRight: ->
     tabs = @getTabs()
     active = @children('.right-clicked').view()
     index = tabs.indexOf(active)
+    return if index is -1
     @closeTab tab for tab, i in tabs when i > index

   shouldAllowDrag: ->


fix copy paste error

fix copy paste error

--- lib/tab-bar-view.coffee
+++ lib/tab-bar-view.coffee
@@ -265,7 +265,7 @@
       false

   onDragLeave: (event) ->
-    @removePlaceholder() if e.target is e.currentTarget
+    @removePlaceholder() if event.target is event.currentTarget

   onDragEnd: (event) ->
     return unless matches(event.target, '.sortable')


Update esui.coffee

Update esui.coffee

--- data/points/esui.coffee
+++ data/points/esui.coffee
@@ -5,4 +5,5 @@
 relevance: [ "esl", "er" ]
 desc: "Enterprise Simple UI library."
 reference:
-  "ESUI Github": "https://github.com/ecomfe/esui"+  "ESUI Github": "https://github.com/ecomfe/esui"
+  "ECOM UI组件标准": "http://fe.baidu.com/doc/ecom/std/ui/v1.1/"


Server: Tests: remove logs

Server: Tests: remove logs

--- servers/testhelper/handler/createssotokenhelper.coffee
+++ servers/testhelper/handler/createssotokenhelper.coffee
@@ -49,12 +49,9 @@
   [opts, callback] = [callback, opts]  unless callback
   opts ?= {}

-  console.log 1
   createUser apiToken, opts, ({ username, email }) ->
     opts.username = username
-    console.log 2
     createSsoToken apiToken, opts, ({ token }) ->
-      console.log 3
       callback { username, email, token }


Make book prop optional

Make book prop optional

--- src/components/exercise/identifier-link.cjsx
+++ src/components/exercise/identifier-link.cjsx
@@ -13,25 +13,23 @@
 ExerciseIdentifierLink = React.createClass

   propTypes:
-    bookUUID: React.PropTypes.string.isRequired
-    exerciseUID: React.PropTypes.string.isRequired
+    bookUUID: React.PropTypes.string
+    exerciseId: React.PropTypes.string.isRequired
     project: React.PropTypes.oneOf(['concept-coach', 'tutor'])
-
-  isCCValue: ->
-    if @props.project is 'concept-coach' then 'Yes' else 'No'

   formUrl: ->
     url = 'https://docs.google.com/a/rice.edu/forms/d/' +
     '1AmwbFIRvZJ6F91PQp1I6jQgqM9Kc3qNMrHdLdqhj8FE/viewform' +
-    "?entry.649352110=#{@props.exerciseUID}" +
-    "&entry.1655668181=#{@isCCValue()}"
-    if BOOK_UID_XREF[@props.bookUUID]
+    "?entry.649352110=#{@props.exerciseId}"
+    if @props.project
+      url += "&entry.1655668181=#{if @props.project is 'concept-coach' then 'Yes' else 'No'}"
+    if @props.bookUUID and BOOK_UID_XREF[@props.bookUUID]
       url += "&entry.1091629000=#{BOOK_UID_XREF[@props.bookUUID]}"
-
+    url

   render: ->

-      ID# {@props.uid} | Report an error
+      ID# {@props.exerciseId} | Report an error

 module.exports = ExerciseIdentifierLink


Simplify initial collection insert

Simplify initial collection insert

--- client/functions.coffee
+++ client/functions.coffee
@@ -78,13 +78,10 @@
 				# Send data
 				Cloudinary.xhr = new XMLHttpRequest()

-				# Set fields
-				fields = _.extend ops.fields || {},
-					_id: collection_id
-					status: 'uploading'
-					preview: file
-
-				Cloudinary.collection.insert fields
+				Cloudinary.collection.insert
+					_id:collection_id
+					status:"uploading"
+					preview:file

 				Cloudinary.xhr.upload.addEventListener "progress", (event) ->
 						Cloudinary.collection.update _id:collection_id,


FIX: properly release bitmap from cache if source changes

--- source/Art/Engine/Elements/Shapes/BitmapElement.coffee
+++ source/Art/Engine/Elements/Shapes/BitmapElement.coffee
@@ -43,6 +43,13 @@

     loaded: (url) -> @_loaded[url]

+    @getter
+      memoryUsage: ->
+        bytes = 0
+        for k, v of @_loaded
+          bytes += v.byteSize
+        bytes
+
     temporaryPut: (duration, url, bitmap) ->
       @get url, Promise.resolve bitmap
       # log temporaryPut: {bitmap, duration, url}
@@ -73,8 +80,13 @@
     super
     @_bitmapToElementMatrix = new Matrix

+  _releaseCachedBitmap: ->
+    if @_previousCacheSource
+      sourceToBitmapCache.release @_previousCacheSource
+      @_previousCacheSource = null
+
   _unregister: ->
-    sourceToBitmapCache.release @getSource()
+    @_releaseCachedBitmap()
     super

   @getter
@@ -132,6 +144,8 @@
       validate:   (v) -> !v || isPlainArray v

   _loadBitmapFromSource: (source) ->
+    @_releaseCachedBitmap()
+    @_previousCacheSource = source
     sourceToBitmapCache.get source
     .then (bitmap) =>
       @onNextReady => @queueEvent "load", => bitmap:bitmap


added transition test to admin panel [#95231438]

--- spec/javascripts/acceptance/admin_users_page.js.coffee
+++ spec/javascripts/acceptance/admin_users_page.js.coffee
@@ -77,3 +77,12 @@
   visit '/admin/users'
   andThen ->
     ok find("a:contains('Deny')").length == 0, "Deny access"
+
+test "after clicking on projects, drects to projects", ->
+  visit '/admin/users'
+  andThen ->
+    click(".navbar-left a:eq(0)")
+    andThen ->
+      equal(currentPath(), 'projects.index')
+
+


Ignore empty words

Ignore empty words

- otherwise you could totally submit it once and snap on it, which
  actually happened a couple times and probably confused people

--- src/Game.coffee
+++ src/Game.coffee
@@ -21,6 +21,8 @@
     $('#wordForm').submit (evt) =>
       evt.preventDefault()
       word = $('#word').val()
+      if word == ""
+        return
       @sendWord word, (snap) =>
         @player.addWord word
         if @maxWords and @player.word_count >= @maxWords


instruct wkhtmltopdf to insert top/bottom margins

added `--margin-top 10` and `-margin-bottom 10` options in the invocation of `wkhtmltopdf`.

--- src/generators/html-pdf-cli-generator.coffee
+++ src/generators/html-pdf-cli-generator.coffee
@@ -68,7 +68,7 @@
     # Save the markup to a temporary file
     tempFile = fOut.replace /\.pdf$/i, '.pdf.html'
     FS.writeFileSync tempFile, markup, 'utf8'
-    SPAWN 'wkhtmltopdf', [ tempFile, fOut ], false, on_error, @
+    SPAWN 'wkhtmltopdf', [ '--margin-top', '10', '--margin-bottom', '10', tempFile, fOut ], false, on_error, @
     return


normal icon if not mutual

normal icon if not mutual

--- resources/assets/coffee/react/_components/friend-button.coffee
+++ resources/assets/coffee/react/_components/friend-button.coffee
@@ -160,7 +160,7 @@
               span
                 key: 'normal'
                 className: "#{bn}__icon #{bn}__icon--hover-hidden"
-                i className: 'fas fa-user-friends'
+                i className: 'fas fa-user'
           ]
         else
           i className: if isFriendLimit then 'fas fa-user' else 'fas fa-user-plus'


Add getGitHubTokenName

Add getGitHubTokenName

--- src/atom.coffee
+++ src/atom.coffee
@@ -352,6 +352,10 @@
   getVersion: ->
     app.getVersion()

+  # Public: Get the name of the github token in the keychain
+  getGitHubTokenName: ->
+    'Atom GitHub API Token'
+
   # Public: Get the directory path to Atom's configuration area.
   #
   # Returns the absolute path to ~/.atom


Preserve previous API behavior

Preserve previous API behavior

--- src/atom.coffee
+++ src/atom.coffee
@@ -784,6 +784,8 @@
     callback(showSaveDialogSync())

   showSaveDialogSync: (options={}) ->
+    if _.isString(options)
+      options = defaultPath: options
     currentWindow = @getCurrentWindow()
     dialog = remote.require('dialog')
     options.title ?= 'Save File'


fix a bug

fix a bug

--- prerender.coffee
+++ prerender.coffee
@@ -107,7 +107,7 @@
     searchVisible: false # entry?
   fse.outputFileSync file, buildHtmlAsString(props)

-prerenderEntry = (entry) ->
+prerenderEntry = (baseDir, entry) ->
   dir = moment(entry.pubdate).format 'YYYY/MM/DD'
   titleKey = entry.titleKey
   paths = [


Always fall back to ATOM_ACCESS_TOKEN when there is no token

--- src/auth.coffee
+++ src/auth.coffee
@@ -4,8 +4,8 @@
   # Gracefully handle keytar failing to load due to missing library on Linux
   if process.platform is 'linux'
     keytar =
-      findPassword: ->
-      replacePassword: ->
+      findPassword: -> Promise.reject()
+      setPassword: -> Promise.reject()
   else
     throw error

@@ -17,19 +17,20 @@
   # callback - A function to call with an error as the first argument and a
   #            string token as the second argument.
   getToken: (callback) ->
-    keytar.findPassword(tokenName).then (token) ->
-      if token
-        callback(null, token)
-        return
-
-      if token = process.env.ATOM_ACCESS_TOKEN
-        callback(null, token)
-        return
-
-      callback """
-        No Atom.io API token in keychain
-        Run `apm login` or set the `ATOM_ACCESS_TOKEN` environment variable.
-      """
+    keytar.findPassword(tokenName)
+      .then (token) ->
+        if token
+          callback(null, token)
+        else
+          Promise.reject()
+      .catch ->
+        if token = process.env.ATOM_ACCESS_TOKEN
+          callback(null, token)
+        else
+          callback """
+            No Atom.io API token in keychain
+            Run `apm login` or set the `ATOM_ACCESS_TOKEN` environment variable.
+          """

   # Save the given token to the keychain.
   #


Refactor clone to handle fields and use __assignAttributes

--- src/base.coffee
+++ src/base.coffee
@@ -48,8 +48,6 @@
   constructor: ->
     @__initializeFields()

-
-
   # The interface to use when querying the server for this class
   @interface: ->
     @resourceLibrary.interface
@@ -70,24 +68,34 @@
   # @param [ActiveResource::Base] cloner the resource cloning this resource (always a related resource)
   # @return [ActiveResource::Base] the cloned resource
   __createClone: (cloner) ->
-    clone = @klass().build(@attributes())
-    clone.__links = @links()
+    clone = @klass().build()
+
     @errors().each (attribute, e) => clone.errors().push(_.clone(e))
+    @klass().fields().each (f) =>
+      try
+        reflection = @association(f).reflection
+        # handle cloning of association field
+      catch
+        clone.__fields[f] = @__fields[f]

+    clone.__links = _.clone(@links())
+
+    fields = @attributes()
     @klass().reflectOnAllAssociations().each (reflection) =>
       old_association = @association(reflection.name)
       new_association = clone.association(reflection.name)
-      new_association.__links = old_association.links()
+      new_association.__links = _.clone(old_association.links())

-      if reflection.collection()
-        old_association.target.each (resource) =>
-          new_target = resource.__createClone(this)
-          new_association.setInverseInstance(new_target)
-          new_association.target.push(new_target)
-      else if old_association.target? && old_association.target != cloner
-        new_target = old_association.target.__createClone(this)
-        new_association.setInverseInstance(new_target)
-        new_association.target = new_target
+      new_target =
+        if reflection.collection()
+          old_association.target.map (resource) => resource.__createClone(this)
+        else if old_association.target? && old_association.target != cloner
+          old_association.target.__createClone(this)
+
+      if new_target
+        fields[reflection.name] = new_target
+
+    clone.__assignAttributes(fields)

     clone


:lipstick: Move `handleEvents` method definition  under the `constructor`

Method grouping

--- src/browser/Application.coffee
+++ src/browser/Application.coffee
@@ -28,6 +28,11 @@

         @handleEvents()

+    handleEvents    : ->
+        ipc.on "open", (e, options) ->
+            options ?= @options
+            new AppWindow(options)
+
     addWindow       : (window) ->
         @windows.push window
         return
@@ -36,7 +41,3 @@
         @windows.splice index, 1 for index, w of @windows when w is window
         return

-    handleEvents    : ->
-        ipc.on "open", (e, options) ->
-            options ?= @_opts
-            new AppWindow(options)


Fixes merge conflict

Fixes merge conflict

--- src/desktop/apps/how_auctions_work/client/index.coffee
+++ src/desktop/apps/how_auctions_work/client/index.coffee
@@ -1,9 +1,5 @@
 multiPageView = require '../../../components/multi_page/index.coffee'
-<<<<<<< HEAD
-mediator = require('../../../lib/mediator')
-=======
 mediator = require '../../../lib/mediator.coffee'
->>>>>>> 44144afcc6e9e59746b6d08dee539f4c7b3539cb

 module.exports.init = ->
   view = multiPageView 'auction-faqs'


Re-enabled CSRF tokens.

Re-enabled CSRF tokens.

--- web/coffee/dependencies.coffee
+++ web/coffee/dependencies.coffee
@@ -1,4 +1,8 @@
 @apiCall = (type, url, data) ->
+
+  if type == "POST":
+    data.token = $.cookie("token")
+
   $.ajax {url: url, type: type, data: data, cache: false}
   .fail (jqXHR, text) ->
     $.notify "API is offline. :(", "error"


Correct spelling

Correct spelling

--- src/core.coffee
+++ src/core.coffee
@@ -65,7 +65,7 @@
 		MITHGridDefaults[namespace] or= {}
 		MITHGridDefaults[namespace] = $.extend(true, MITHGridDefaults[namespace], defaults)

-	MITHGrid.initSynchonizer = (callbacks) ->
+	MITHGrid.initSynchronizer = (callbacks) ->
 		that = {}
 		counter = 1
 		done = false


add locking ability to variables

add locking ability to variables

--- src/core.coffee
+++ src/core.coffee
@@ -454,38 +454,49 @@
 	that.addVariable = (varName, config) ->
 		value = config.default
 		config.is or= 'rw'
-		if config.is in ['rw', 'w']
+		if config.is in ['rw', 'w', 'rwl', 'wl']
 			filter = config.filter
 			validate = config.validate
 			eventName = config.event || ('on' + varName + 'Change')
 			setName = config.setter || ('set' + varName)
+			lockName = config.locker || ('lock' + varName)
+			unlockName = config.unlocker || ('unlock' + varName)
 			that.events[eventName] = MITHGrid.initEventFirer()
 			if filter?
 				if validate?
-					that[setName] = (v) ->
+					setter = (v) ->
 						v = validate filter v
 						if value != v
 							value = v
 							that.events[eventName].fire(value)
 				else
-					that[setName] = (v) ->
+					setter = (v) ->
 						v = filter v
 						if value != v
 							value = v
 							that.events[eventName].fire(value)
 			else
 				if validate?
-					that[setName] = (v) ->
+					setter = (v) ->
 						v = validate v
 						if value != v
 							value = v
 							that.events[eventName].fire(value)
 				else
-					that[setName] = (v) ->
+					setter = (v) ->
 						if value != v
 							value = v
 							that.events[eventName].fire(value)
-		if config.is in ['r', 'rw']
+			if config.is in ['rwl', 'wl']
+				locked = 0
+				that[lockName] = -> locked += 1
+				that[unlockName] = -> locked -= 1
+				oldSetter = setter
+				setter = (v) ->
+					if locked == 0
+						oldSetter(v)
+			that[setName] = setter
+		if config.is in ['r', 'rw', 'rwl']
 			getName = config.getter || ('get' + varName)
 			that[getName] = () -> value


Added sound effects, but they are at a delay

--- web/scripts/gameManager.coffee
+++ web/scripts/gameManager.coffee
@@ -394,6 +394,7 @@

     gameWon: =>
         clearInterval clockHandle
+        playAudio 'victory.ogg'
         @stars += 1
         @score += 5
         @gameManager.gameWon @score, @stars
@@ -405,6 +406,7 @@
         for name, character of @gameConfig.characters
             @visual.changeState character.index, 4
             character.moves = null
+        playAudio 'defeat.ogg'
         @startedGame = false
         alert "Try again!"
         clockHandle = setInterval @clock, 17


new naming fix

new naming fix

--- templates/default/app/controllers/applicationController.coffee
+++ templates/default/app/controllers/applicationController.coffee
@@ -17,8 +17,8 @@
     # TODO: FIXME get rid off localhost setting
     layer = new Steroids.Layer { location: "http://localhost:13101" + @getAttribute("data-location") }

-    Steroids.Modal.show layer:layer
+    Steroids.modal.show layer:layer

   $(".closesModal").on "tap", () ->

-     Steroids.Modal.hide()
+     Steroids.modal.hide()


2.1.5

--- src/eops.coffee
+++ src/eops.coffee
@@ -22,7 +22,7 @@
   console.log ''

 program
-  .version('2.1.3')
+  .version('2.1.5')
   .usage('[options] <emails.csv>')
   .option('-c --compare <file>', 'hashed emails (already_hashed.csv)')
   .option('-e --case <alter>', 'whether to upper or lower case the email before hashing (upper, lower, as-is)', /^(upper|lower|as\-is)$/i, 'as-is')


Don't focus stats when attaching

Don't focus stats when attaching

Leave the editor with focus since the stats aren't interactive

--- src/packages/editor-stats/src/editor-stats-view.coffee
+++ src/packages/editor-stats/src/editor-stats-view.coffee
@@ -118,7 +118,6 @@

   attach: ->
     @.insertBefore @statusBar
-    @focus()
     @draw()

   detach: =>


remove dataset autofetch

remove dataset autofetch

--- client/code/model/dataset.coffee
+++ client/code/model/dataset.coffee
@@ -17,7 +17,6 @@
       key: 'tool'
       relatedModel: Cu.Model.Tool
       includeInJSON: 'name'
-      autoFetch: true
     }
   ]


Adds some onboarding logging to investigate potential bug

--- services/web/app/coffee/Features/Project/ProjectController.coffee
+++ services/web/app/coffee/Features/Project/ProjectController.coffee
@@ -273,6 +273,7 @@
 					else if event?
 						return cb(null, false)
 					else
+						logger.log user_id, event, "autocompile onboarding not shown yet to this user"
 						return cb(null, true)
 		}, (err, results)->
 			if err?


Environments: Remove unnecessary data for firewall rules in stack recipe.

--- client/Environments/views/stackview.coffee
+++ client/Environments/views/stackview.coffee
@@ -105,6 +105,9 @@
             if dia.data.meta?.initScript
               obj.initScript = "[...]"
             obj
+          else if name is 'rules'
+            title   : dia.data.name
+            rules   : dia.data.rules
           else dia.data

     return if asYaml then jsyaml.dump dump else dump


form workflow: forward any "Cancel" events from the forms

Any form should be able to send a signal to "cancel" the workflow.  This event can be listened to from outside the workflow

--- client/app/CommonViews/formworkflow.coffee
+++ client/app/CommonViews/formworkflow.coffee
@@ -74,6 +74,7 @@
     @forms[formName] = form
     @addSubView form
     form.hide()
+    @forwardEvent form, 'Cancel'
     @provideData formName, provides
     return this


Tests: Collaboration: Added openTerminalForInviteUser test.

--- client/test/lib/collaboration/start.coffee
+++ client/test/lib/collaboration/start.coffee
@@ -2,6 +2,9 @@
 helpers              = require '../helpers/helpers.js'
 ideHelpers           = require '../helpers/idehelpers.js'
 collaborationHelpers = require '../helpers/collaborationhelpers.js'
+terminalHelpers      = require '../helpers/terminalhelpers.js'
+assert               = require 'assert'
+

 chatBox  = '.collaboration.message-pane'

@@ -184,3 +187,34 @@
     waitAndEndSession(browser)
     browser.end()

+
+  openTerminalForInviteUser: (browser) ->
+
+    host         = utils.getUser no, 0
+    hostBrowser  = process.env.__NIGHTWATCH_ENV_KEY is 'host_1'
+    participant  = utils.getUser no, 1
+    paneSelector = '.pane-wrapper .kdsplitview-panel.panel-1 .application-tab-handle-holder'
+    terminalTabs = "#{paneSelector} .terminal"
+
+    start(browser)
+    collaborationHelpers.closeChatPage(browser)
+
+    browser.elements 'css selector', terminalTabs, (result) =>
+      length = result.value.length
+
+      if hostBrowser
+        browser.pause 10000
+
+      else
+        terminalHelpers.openNewTerminalMenu(browser)
+        terminalHelpers.openTerminal(browser)
+
+      browser.elements 'css selector', terminalTabs, (result) =>
+        newLength = result.value.length
+
+        assert.equal newLength, length + 1
+
+    leave(browser)
+    waitAndEndSession(browser)
+    browser.end()
+


Route blueprint has been improved

Route blueprint has been improved