odroid-c1.coffee: Promote board to released

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

--- odroid-c1.coffee
+++ odroid-c1.coffee
@@ -6,7 +6,7 @@
 	aliases: [ 'odroid-c1' ]
 	name: 'ODROID-C1+'
 	arch: 'armv7hf'
-	state: 'preview'
+	state: 'released'

 	instructions: commonImg.instructions
 	gettingStartedLink:


Don't remove  'MathJax_Hidden'

Don't remove  'MathJax_Hidden'

When the reference book is paged through using the back/forward buttons
Mathjax does not rendered correctly.  It's a strange bug because it does
render fine on a fresh page load

--- src/helpers/mathjax.coffee
+++ src/helpers/mathjax.coffee
@@ -9,7 +9,7 @@
   # MathJax calls queued events in order, so this will be called after processing completes
   window.MathJax.Hub.Queue([ ->
     # copy-pasta in `/index.coffee`
-    for nodeId in ['MathJax_Message', 'MathJax_Hidden', 'MathJax_Font_Test']
+    for nodeId in ['MathJax_Message', 'MathJax_Font_Test']
       el = document.getElementById(nodeId)
       break unless el # the elements won't exist if MathJax didn't do anything
       # Some of the elements are wrapped by divs without selectors under body


Manage album

Manage album

--- public/dreamcatcher/controllers/ib_browser_controller.coffee
+++ public/dreamcatcher/controllers/ib_browser_controller.coffee
@@ -269,7 +269,7 @@

   #- Album List -#

-  '#albumList .manage click': (el) ->#fix
+  '#albumList .manage click': (el) ->
     @showManager $('.img',el.closest("tr").next())

   '#albumList .images .img img click': (el) ->


immediate set values so doubleclick is not interfered with on ie8

--- src/selection.coffee
+++ src/selection.coffee
@@ -90,10 +90,10 @@
     @range = null
     @mouseIsDown = @keyIsDown = false
     @hasFocus = @editor.root.ownerDocument.activeElement == @editor.root
-    ScribeDOM.addEventListener(@editor.root, 'keydown',   => _.defer( => @keyIsDown = true ))
-    ScribeDOM.addEventListener(@editor.root, 'keyup',     => _.defer( => @keyIsDown = false ))
-    ScribeDOM.addEventListener(@editor.root, 'mousedown', => _.defer( => @mouseIsDown = true ))
-    ScribeDOM.addEventListener(@editor.root, 'mouseup',   => _.defer( => @mouseIsDown = false ))
+    ScribeDOM.addEventListener(@editor.root, 'keydown',   => @keyIsDown = true )
+    ScribeDOM.addEventListener(@editor.root, 'keyup',     => @keyIsDown = false )
+    ScribeDOM.addEventListener(@editor.root, 'mousedown', => @mouseIsDown = true )
+    ScribeDOM.addEventListener(@editor.root, 'mouseup',   => @mouseIsDown = false )
     rangy.init()
     @nativeSelection = rangy.getIframeSelection(@editor.renderer.iframe) if @editor.renderer.iframe.parentNode?
     this.setRange(null)


If ::element is defined before constructor is run, wrap it

This allows us to override the constructor, assign ::element, and then
call super to create wrapper shims that don’t need to invoke content.

--- src/space-pen.coffee
+++ src/space-pen.coffee
@@ -109,17 +109,25 @@
     step(fragment) for step in postProcessingSteps
     fragment

+  element: null
+
   constructor: (args...) ->
-    [html, postProcessingSteps] = @constructor.buildHtml -> @content(args...)
-    jQuery.fn.init.call(this, html)
-    throw new Error("View markup must have a single root element") if @length != 1
+    if @element?
+      jQuery.fn.init.call(this, @element)
+    else
+      [html, postProcessingSteps] = @constructor.buildHtml -> @content(args...)
+      jQuery.fn.init.call(this, html)
+      throw new Error("View markup must have a single root element") if @length != 1
+      @element = @[0]
+
     @wireOutlets(this)
     @bindEventHandlers(this)
-    jQuery.data(@[0], 'view', this)
-    for element in @[0].getElementsByTagName('*')
+    jQuery.data(@element, 'view', this)
+    for element in @element.getElementsByTagName('*')
       jQuery.data(element, 'view', this)
-    @[0].setAttribute('callAttachHooks', true)
-    step(this) for step in postProcessingSteps
+    @element.setAttribute('callAttachHooks', true)
+    if postProcessingSteps?
+      step(this) for step in postProcessingSteps
     @initialize?(args...)

   buildHtml: (params) ->


Adds more letters

Adds more letters


update tabs to use new way to find pane index

--- src/tabs-view.coffee
+++ src/tabs-view.coffee
@@ -48,7 +48,8 @@
   onDragStart: (event) =>
     super
     pane = $(event.target).closest('.pane')
-    event.originalEvent.dataTransfer.setData 'from-pane-index', pane.index()
+    paneIndex = rootView.indexOfPane(pane)
+    event.originalEvent.dataTransfer.setData 'from-pane-index', paneIndex

   onDrop: (event) =>
     super
@@ -56,22 +57,22 @@
     previousDraggedTabIndex = transfer.getData 'sortable-index'

     fromPaneIndex = ~~transfer.getData 'from-pane-index'
-    toPaneIndex   = ~~$(event.target).closest('.pane').index()
-    fromPane      = rootView.find ".pane:nth-child(#{fromPaneIndex + 1})"
+    toPaneIndex   = rootView.indexOfPane($(event.target).closest('.pane'))
+    fromPane      = $(rootView.find('.pane')[fromPaneIndex])
     fromEditor    = fromPane.find('.editor').view()

     if fromPaneIndex == toPaneIndex
       toPane   = fromPane
       toEditor = fromEditor
     else
-      toPane = rootView.find ".pane:nth-child(#{toPaneIndex + 1})"
+      toPane = $(rootView.find('.pane')[toPaneIndex])
       toEditor = toPane.find('.editor').view()

     droppedNearTab = @getSortableElement(event)
     draggedTab     = fromPane.find(".#{Tabs.viewClass()} .sortable:eq(#{previousDraggedTabIndex})")

     draggedTab.remove()
-    draggedTab.insertBefore(droppedNearTab)
+    draggedTab.insertAfter(droppedNearTab)

     currentDraggedTabIndex = draggedTab.index()


cosmetic: "timeouted" ---> "timed out (as suggested by dvv)

--- src/transport.coffee
+++ src/transport.coffee
@@ -89,7 +89,7 @@
         if @recv
             throw Error('RECV_STILL_THERE')
         @readyState = Transport.CLOSED
-        @emit('close', {status: 1001, reason: "Session timeouted"})
+        @emit('close', {status: 1001, reason: "Session timed out"})
         if @session_id
             delete MAP[@session_id]
             @session_id = null


* remove double-quote to single-quote

* remove double-quote to single-quote

--- src/type-info.coffee
+++ src/type-info.coffee
@@ -1,27 +1,22 @@
-factory         = require("custom-factory")
+factory         = require('custom-factory')
 deepEqual       = require('deep-equal')
-isObject        = require("util-ex/lib/is/type/object")
-isFunction      = require("util-ex/lib/is/type/function")
-isString        = require("util-ex/lib/is/type/string")
-isArray         = require("util-ex/lib/is/type/array")
-isUndefined     = require("util-ex/lib/is/type/undefined")
-#inject          = require("util-ex/lib/inject")
-#isBoolean     = require("util-ex/lib/is/type/boolean")
-extend          = require("util-ex/lib/extend")
-defineProperty  = require("util-ex/lib/defineProperty")
-createObject    = require("inherits-ex/lib/createObject")
-attrMeta        = require './meta/attribute'
-attributes      = require('./meta/type-attributes')()
-try Codec       = require("buffer-codec")
+isObject        = require('util-ex/lib/is/type/object')
+isFunction      = require('util-ex/lib/is/type/function')
+isString        = require('util-ex/lib/is/type/string')
+isArray         = require('util-ex/lib/is/type/array')
+isUndefined     = require('util-ex/lib/is/type/undefined')
+extend          = require('util-ex/lib/extend')
+defineProperty  = require('util-ex/lib/defineProperty')
+createObject    = require('inherits-ex/lib/createObject')
+attributes      = createObject require('./meta/type-attributes')
+try Codec       = require('buffer-codec')

 objectToString  = Object::toString
 getObjectKeys   = Object.keys

 metaNames = attributes.names
-#NAME = metaNames.name
-#REQUIRED = metaNames.required
-NAME = attrMeta.name.name || 'name'
-REQUIRED = attrMeta.required.name || 'required'
+NAME = metaNames.name
+REQUIRED = metaNames.required

 class Value
   @tryGetTypeName: (aValue)->
@@ -125,15 +120,15 @@
       if Codec
         encoding = Codec encoding
       else
-        throw new TypeError "
+        throw new TypeError '
           Should install buffer-codec package first
           to enable encoding name supports.
-        "
+        '
     if !isFunction(encoding.encode) or
        !isFunction(encoding.decode) or !encoding.name
-      throw new TypeError "
+      throw new TypeError '
         encoding should have name property, encode and decode functions.
-      "
+      '
     encoding
   constructor: (aTypeName, aOptions)->
     return super


KD.extend: add a helper "KD.getGroup()" to get the current group

seemed like kind of a no-brainer

--- client/app/MainApp/KD.extend.coffee
+++ client/app/MainApp/KD.extend.coffee
@@ -151,6 +151,8 @@

   runningInFrame: -> window.top isnt window.self

+  getGroup: -> (KD.getSingleton 'groupsController').getCurrentGroup()
+
 Object.defineProperty KD, "defaultSlug",
   get:->
     if KD.isGuest() then 'guests' else 'koding'


Modified in browser at pixie.strd6.com

Modified in browser at pixie.strd6.com

--- src/ageable.coffee
+++ src/ageable.coffee
@@ -5,8 +5,7 @@

     player.update(1)

-    #=> player.I.age == 1
-
+    #=> player.I.age == 1

 @name Ageable
 @module
@@ -22,3 +21,11 @@
     I.age += dt

   return {}
+
+
+Bounded module
+@name Bounded
+@module
+@constructor
+@param {Object} I Instance variables
+@param {Core} self Reference to including object


Show submit details in submitList

Show submit details in submitList

--- client/components/SubmitList.coffee
+++ client/components/SubmitList.coffee
@@ -4,23 +4,96 @@
 import { connect } from 'react-redux'
 import { Link } from 'react-router-dom'
 import { CometSpinLoader } from 'react-css-loaders'
+
 import Table from 'react-bootstrap/lib/Table'
+import Modal from 'react-bootstrap/lib/Modal'
+import Button from 'react-bootstrap/lib/Button'
+import Tabs from 'react-bootstrap/lib/Tabs'
+import Tab from 'react-bootstrap/lib/Tab'

 import * as actions from '../redux/actions'
+
+import styles from './SubmitList.css'
+
+OpenSubmit = (props) ->
+    <Modal show={true} onHide={props.close} dialogClassName={styles.modal}>
+        <Modal.Body>
+            <Tabs defaultActiveKey={1} id="submitTabs">
+                <Tab eventKey={1} title="Исходный код">
+

+                </Tab>
+                <Tab eventKey={2} title="Комментарии">
+                    {
+                    res = []
+                    a = (el) -> res.push(el)
+                    for comment, index in props.submit.comments
+                        a

+                    res}
+                </Tab>
+                <Tab eventKey={3} title="Результаты">
+
Вывод компилятора

+

+

+

+

+                                #
+                                Результат
+                                Время
+                                Память
+

+

+

+                            {
+                            res = []
+                            a = (el) -> res.push(el)
+                            for index, result of props.submit.results.tests
+                                a

+                                    {index}
+                                    {result.string_status}
+                                    {result.time/1000}
+                                    {result.max_memory_used}
+

+                            res}
+

+

+                </Tab>
+            </Tabs>
+        </Modal.Body>
+
+        <Modal.Footer>
+            <Button bsStyle="primary" onClick={props.close}>Закрыть</Button>
+        </Modal.Footer>
+    </Modal>

 class SubmitList extends React.Component
     constructor: (props) ->
         super(props)
+        @state = {}
         @handleReload = @handleReload.bind(this)
+        @openSubmit = @openSubmit.bind(this)
+        @closeSubmit = @closeSubmit.bind(this)

     url: () ->
         if @props?.myUser?._id
             "submits/#{@props.myUser._id}/#{@props.material._id}"

+    openSubmit: (submit) ->
+        () =>
+            @setState
+                openSubmit: submit
+
+    closeSubmit: () ->
+        @setState
+            openSubmit: null
+
     render:  () ->
         if not @props.myUser?._id
             return null

+            {
+            if @state.openSubmit?._id
+                <OpenSubmit submit={@state.openSubmit} close={@closeSubmit}/>
+            }

Попытки

             {
             if @dataOutdated()
@@ -31,10 +104,11 @@

                             Время
                             Результат
+

-                        {@props.submits && @props.submits.map((submit) ->
+                        {@props.submits && @props.submits.map((submit) =>
                             cl = undefined
                             if submit.outcome == "AC"
                                 cl = "success"
@@ -45,6 +119,7 @@

                                 {moment(submit.time).format('YYYY-MM-DD kk:mm:ss')}
                                 {submit.outcome}
+                                Подробнее

                         ).reverse()}

@@ -94,7 +169,7 @@

     requestDataAndSetTimeout: () ->
         try
-            await Promise.all(@requestData())
+            await Promise.all([@requestData()])
             console.log "Updated data", @url()
         catch
             console.log "Can't reload data", @url()


天気予報のデザインの修正

天気予報のデザインの修正


New marking task Have a single marking task. Mark all illustrations in one step. Assign marks to illustrations by comparing positions with marked rectangles.

--- overrides.coffee
+++ overrides.coffee
@@ -43,8 +43,8 @@
   @rescale() if @scaleX is 0

 LAST_TASK = true
-INITIAL_STEPS = 2 # number of initial steps before annotating rectangles
-ANNOTATION_STEPS = 2 # number of annotation steps per rectangle
+INITIAL_STEPS = 3 # number of initial steps before annotating rectangles
+ANNOTATION_STEPS = 1 # number of annotation steps per rectangle
 MARGIN = 25 # margin on cropped images

 current_tool = null
@@ -98,7 +98,7 @@
     if LAST_TASK
       task.next = 'review'
     else
-      task.next = 'parts'
+      task.next = 'details'

 classify_page.el.on decisionTree.CHANGE, ({originalEvent: {detail}})->
   {key, value} = detail
@@ -110,7 +110,18 @@
     decisionTree.currentTask.confirmButton.innerHTML = label if label?

   current_tool?.mark.details = value if key is 'details'
-  current_tool?.mark.parts = value if key is 'parts'
+
+  if key is 'parts'
+    for tool in ms.tools when tool.mark._taskIndex is 1
+      rectangle = tool.mark
+      rectangle.parts = []
+      for mark in value
+        inside =
+          mark.x >= rectangle.left &&
+          mark.x <= (rectangle.left + rectangle.width) &&
+          mark.y >= rectangle.top &&
+          mark.y <= (rectangle.top + rectangle.height)
+        rectangle.parts.push mark if inside

 classify_page.on classify_page.LOAD_SUBJECT, (e, subject)->
   ms.rescale 0, 0, subjectViewer.maxWidth, subjectViewer.maxHeight
@@ -123,6 +134,12 @@

 Group.on 'fetch', (e, groups) ->
   currentProject.groups = groups
+
+ms.addEvent 'marking-surface:element:start', 'rect', (e) ->
+  current_tool?.el.classList.remove 'selected'
+  current_tool = (tool for tool in ms.tools when tool.outline?.el is e.target)[0]
+  current_tool?.el.classList.add 'selected'
+

 ms.on 'marking-surface:add-tool', (tool) ->
   {label} = decisionTree.currentTask.getChoice() ? ''


Commands for moving in buffer more consistent with sublime

--- keymaps/apple.cson
+++ keymaps/apple.cson
@@ -5,16 +5,24 @@
   'meta-shift-down': 'core:select-to-bottom'

 '.editor':
+  'meta-left': 'editor:move-to-first-character-of-line'
   'meta-right': 'editor:move-to-end-of-line'
-  'meta-left': 'editor:move-to-beginning-of-line'
-  'alt-left': 'editor:move-to-beginning-of-word'
-  'alt-right': 'editor:move-to-end-of-word'
-  'meta-shift-left': 'editor:select-to-beginning-of-line'
+  'meta-shift-left': 'editor:select-to-first-character-of-line'
   'meta-shift-right': 'editor:select-to-end-of-line'
-  'alt-shift-left': 'editor:select-to-beginning-of-word'
-  'alt-shift-right': 'editor:select-to-end-of-word'
+
+  'home': 'editor:move-to-first-character-of-line'
+  'end': 'editor:move-to-end-of-line'
+  'shift-home': 'editor:select-to-first-character-of-line'
+  'shift-end': 'editor:select-to-end-of-line'
+
+  'alt-left': 'editor:move-to-previous-word-boundary'
+  'alt-right': 'editor:move-to-next-word-boundary'
+  'alt-shift-left': 'editor:select-to-previous-word-boundary'
+  'alt-shift-right': 'editor:select-to-next-word-boundary'
+
   'alt-backspace': 'editor:backspace-to-beginning-of-word'
   'meta-backspace': 'editor:backspace-to-beginning-of-line'
+
   'alt-delete': 'editor:delete-to-end-of-word'
   'ctrl-t': 'editor:transpose'
   'ctrl-A': 'editor:select-to-first-character-of-line'


Add operation GET to response interceptor unwrapper

--- frontend-admin/src/app/components/mnoe-api/api.svc.coffee
+++ frontend-admin/src/app/components/mnoe-api/api.svc.coffee
@@ -9,7 +9,7 @@
         extractedData = null
         if (operation == 'getList')
           extractedData = data[what]
-        else if (operation == 'put' || operation == 'post')
+        else if (operation == 'get' || operation == 'put' || operation == 'post')
           what = inflector.singularize(what)
           extractedData = data[what]
         else


Refactor code according to Coffescript lint suggestions

--- app/assets/javascripts/interaction_web_tools/chat.coffee
+++ app/assets/javascripts/interaction_web_tools/chat.coffee
@@ -76,24 +76,28 @@
     @queuedMessages.push(message)

   dismissWelcome: ->
-    $('.chat > .chat-body > .welcome').fadeOut();
+    $('.chat > .chat-body > .welcome').fadeOut()

   dequeueMessages: ->
+    console.log "dequeue messages " + @queuedMessages if @debug
     $.each @queuedMessages, (i,message) =>
-    console.log "dequeue messages " + @queuedMessages if @debug
       @sendMessage(message)
     @queuedMessages = []

   renderMessages: (messages) ->
-    typing = $.grep messages, (el) -> el.type == 'typingIndicator' && el.content == true
     console.log "messages recieved for render", messages if @debug
+    typing = $.grep(
+      messages,
+      (el) -> el.type == 'typingIndicator' && el.content == true
+    )
     @displayIndicator("agent") if typing.length

     messages = $.grep messages, (el) -> el.type == 'text'
     return unless messages.length

     $.each messages, (index, message) =>
-      message.content = message.content.replace(/(?:\r\n|\r|\n)/g, '
');
+      message.content =
+        message.content.replace(/(?:\r\n|\r|\n)/g, '
')
       @displayMessage message

@@ -116,7 +120,9 @@

   displayIndicator: (type) =>
     indicator = @chatUI.find(".indicator").first().clone()
-    wrap = $("

").append(indicator.show())
+    wrap =
+      $("

")
+      .append(indicator.show())
     @hideIndicator(type)
     @chatUI.find('.chat-messages').append(wrap)
     @autoScroll()


Fix mission creator's typeahead

Fix mission creator's typeahead

--- view/coffee/creator/create_mission.coffee
+++ view/coffee/creator/create_mission.coffee
@@ -12,8 +12,9 @@
           @stationMaster = json
           @setAutoComplete($('.autoCompleteStation'))
       setAutoComplete: (elem) ->
+        elem.typeahead('destroy')
         design = {hint: true, highlight: true}
-        config = {name: 'stations', display: 'name', source: stationMatcher(@stationMaster)}
+        config = {name: 'stations', display: 'name', source: stationMatcher(@stationMaster), limit: 100}
         elem.typeahead(design, config)
       submit: ->
         stations = _.flatMap @stations, (s) =>
@@ -28,7 +29,7 @@
             location.reload(false)
       addStation: ->
         @stations.push({name: ""})
-        @setAutoComplete($('.autoCompleteStation:last'))
+        @setAutoComplete($('.autoCompleteStation'))
       findStationId: (name) ->
         st = _.find @stationMaster, (s) -> s.name == name
         st?.id
@@ -40,7 +41,7 @@
       @getStations()
     watch:
       stations: ->
-        @setAutoComplete($('.autoCompleteStation:last'))
+        @setAutoComplete($('.autoCompleteStation'))

 stationMatcher = (xs) ->
   (q, cb) ->


Fix indentation

Fix indentation

--- lib/_config/adminConfig.coffee
+++ lib/_config/adminConfig.coffee
@@ -6,18 +6,18 @@
 			icon: 'pencil'
 			extraFields: ['owner']
 			tableColumns: [
-        { label: 'Title', name: 'title' }
-        { label: 'User', name: 'author()', template: 'adminUserCell' }
-      ]
-		Comments: {
+				{ label: 'Title', name: 'title' }
+				{ label: 'User', name: 'author()', template: 'adminUserCell' }
+			]
+		Comments:
 			color: 'green'
 			icon: 'comments'
 			extraFields: ['doc', 'owner']
 			tableColumns: [
-        { label: 'Content', name: 'content' }
-        { label: 'Post', name: 'docTitle()', template: 'adminPostCell' }
-        { label: 'User', name: 'author()', template: 'adminUserCell' }
-      ]
+				{ label: 'Content', name: 'content' }
+				{ label: 'Post', name: 'docTitle()', template: 'adminPostCell' }
+				{ label: 'User', name: 'author()', template: 'adminUserCell' }
+			]
 			children: [
 				{
 					find: (comment) ->
@@ -28,8 +28,7 @@
 						Meteor.users.find comment.owner, limit: 1
 				}
 			]
-		}
 	dashboard:
 		homeUrl: '/dashboard'
 	autoForm:
-	        omitFields: ['createdAt', 'updatedAt']
+		omitFields: ['createdAt', 'updatedAt']


Update logout.coffee

Update logout.coffee

--- ui/tests/views/logout.coffee
+++ ui/tests/views/logout.coffee
@@ -0,0 +1,3 @@
+describe.skip('LogoutView', ->
+    it('should log out a user', ->)
+)


Handle EMFILE errors on open

Handle EMFILE errors on open

Closes #8429

--- src/workspace.coffee
+++ src/workspace.coffee
@@ -468,7 +468,7 @@
         when 'EACCES'
           @notificationManager.addWarning("Permission denied '#{error.path}'")
           return Promise.resolve()
-        when 'EPERM', 'EBUSY', 'ENXIO', 'EIO', 'ENOTCONN', 'UNKNOWN', 'ECONNRESET', 'EINVAL'
+        when 'EPERM', 'EBUSY', 'ENXIO', 'EIO', 'ENOTCONN', 'UNKNOWN', 'ECONNRESET', 'EINVAL', 'EMFILE'
           @notificationManager.addWarning("Unable to open '#{error.path ? uri}'", detail: error.message)
           return Promise.resolve()
         else


use swrap method

use swrap method

--- lib/blockwise-selection.coffee
+++ lib/blockwise-selection.coffee
@@ -115,11 +115,10 @@
       @selections.push @editor.addSelectionForBufferRange(range, {reversed})
     @updateGoalColumn()

-  # which must be 'start' or 'end'
+  # which must one of ['start', 'end', 'head', 'tail']
   setPositionForSelections: (which) ->
     for selection in @selections
-      point = selection.getBufferRange()[which]
-      selection.cursor.setBufferPosition(point)
+      swrap(selection).setBufferPositionTo(which)

   clearSelections: ({except}={}) ->
     for selection in @selections.slice() when (selection isnt except)


fix "connect terminal" command

fix "connect terminal" command

--- lib/connection/terminal.coffee
+++ lib/connection/terminal.coffee
@@ -48,7 +48,7 @@

   connectCommand: ->
     tcp.listen().then (port) =>
-      "#{@escpath paths.jlpath()} -i -e \"using Juno; Juno.connect(#{port})\""
+      "#{@escpath paths.jlpath()} #{client.clargs().join(' ')} #{paths.script('boot_repl.jl')} #{port}"

   connectedRepl: -> @connectCommand().then (cmd) => @term cmd


JDomain: Remove all wip stuff for domain register.

--- workers/social/lib/social/models/domain.coffee
+++ workers/social/lib/social/models/domain.coffee
@@ -14,7 +14,6 @@
   domainManager     = new DomainManager
   JAccount          = require './account'
   JVM               = require './vm'
-  # JProxyRestriction = require './proxy/restriction'

   @share()

@@ -40,49 +39,14 @@
         createDomain: [
           (signature Object, Function)
         ]
-        # getTldList:
-        #   (signature Function)
-        # getTldPrice:
-        #   (signature String, Function)
-        # getDomainSuggestions:
-        #   (signature String, Function)
-        # getDomainInfo:
-        #   (signature String, Function)
-        # registerDomain:
-        #   (signature Object, Function)

       instance      :
-        # Basic methods
         bindVM:
           (signature Object, Function)
         unbindVM:
           (signature Object, Function)
         remove:
           (signature Function)
-
-        # # Proxy Methods
-        # deleteProxyRule:
-        #   (signature Object, Function)
-        # createProxyRule:
-        #   (signature Object, Function)
-        # fetchProxyRules:
-        #   (signature Function)
-        # updateProxyRule:
-        #   (signature Object, Function)
-        # updateRuleOrders:
-        #   (signature [Object], Function)
-        # fetchProxyRulesWithMatches:
-        #   (signature Function)
-
-        # # DNS Related methods
-        # fetchDNSRecords:
-        #   (signature String, Function)
-        # createDNSRecord:
-        #   (signature Object, Function)
-        # deleteDNSRecord:
-        #   (signature Object, Function)
-        # updateDNSRecord:
-        #   (signature Object, Function)

     sharedEvents    :
       static        : []
@@ -353,223 +317,3 @@
       if /^([\w\-]+)\.kd\.io$/.test @domain
         return callback message: "It's not allowed to delete root domains"
       @remove (err)=> callback err
-
-  # DOMAIN REGISTER STUFF ~ WIP
-
-  # @getTldList = (callback)->
-  #   domainManager.domainService.getAvailableTlds callback
-
-  # @getDomainSuggestions = (domainName, callback)->
-  #   domainManager.domainService.getDomainSuggestions domainName, callback
-
-  # @getDomainInfo = (domainName, callback) ->
-  #   domainManager.domainService.getDomainInfo domainName, callback
-
-  # @getTldPrice = (tld, callback) ->
-  #   domainManager.domainService.getTldPrice tld, callback
-
-  # @registerDomain = permit 'create domains',
-
-  #   success: (client, data, callback) ->
-
-  #     # default user info / all domains are under koding account.
-  #     params =
-  #       domainName         : data.domain
-  #       years              : data.year
-  #       customerId         : "10360936" # PROD: 10073817
-  #       regContactId       : "30714812" # PROD: 29527194
-  #       adminContactId     : "30714812" # PROD: 29527194
-  #       techContactId      : "30714812" # PROD: 29527194
-  #       billingContactId   : "30714812" # PROD: 29527194
-  #       invoiceOption      : "KeepInvoice"
-  #       protectPrivacy     : no
-
-  #     console.log "User has privileges to register domain..", params
-
-  #     @one {domain: data.domain}, (err, domain)=>
-
-  #       if err or domain
-  #         callback {message: "Already created."}
-  #         return
-
-  #       # Make transaction
-  #       @makeTransaction client, data.transaction, (err, charge)=>
-  #         return callback err  if err
-
-  #         console.log "Transaction is done."
-
-  #         domainManager.domainService.registerDomain params, (err, response)->
-
-  #           console.log "ResellerAPI response:", err, response
-
-  #           if err
-  #             return charge.cancel client, ->
-  #               callback err, data
-
-  #           if response.actionstatus is "Success"
-
-  #             console.log "Creating new JDomain..."
-  #             model = new JDomain
-  #               domain         : response.description
-  #               hostnameAlias  : []
-  #               regYears       : params.years
-  #               orderId        :
-  #                 resellerClub : response.entityid
-  #               loadBalancer   :
-  #                 mode         : "" # "roundrobin"
-  #               domainType     : "new"
-
-  #             model.save (err) ->
-  #               return callback err if err
-
-  #               { delegate } = client.connection
-
-  #               delegate.addDomain model, (err) ->
-  #                 return callback err if err
-
-  #                 callback err, model
-
-  #           else
-  #             callback {message: "Domain registration failed"}
-
-  # @makeTransaction: secure (client, data, callback)->
-  #   JPaymentCharge = require './payment/charge'
-  #   JPaymentCharge.charge client, data, callback
-
-  # bound: require 'koding-bound'
-
-  # # DNS Related Methods
-
-  # fetchDNSRecords: permit
-  #   advanced: [
-  #     { permission: 'edit own domains', validateWith: Validators.own }
-  #   ]
-  #   success: (client, recordType, callback)->
-  #     domainManager.dnsManager.fetchDNSRecords
-  #       domainName : @domain
-  #       recordType : recordType
-  #     , (err, records)->
-  #       callback err if err
-  #       callback null, records if records
-
-  # createDNSRecord: permit
-  #   advanced: [
-  #     { permission: 'edit own domains', validateWith: Validators.own }
-  #   ]
-  #   success: (client, params, callback)->
-  #     recordParams            = Object.create(params)
-  #     recordParams.domainName = @domain
-
-  #     domainManager.dnsManager.createDNSRecord recordParams, (err, response)=>
-  #       return callback err  if err
-
-  #       JDomain.update {domain:@domain}, {$addToSet: dnsRecords: params}, (err)=>
-  #         return callback err if err
-
-  #         callback err, response
-
-  # deleteDNSRecord: permit
-  #   advanced: [
-  #     { permission: 'edit own domains', validateWith: Validators.own }
-  #   ]
-  #   success: (client, params, callback)->
-  #     recordParams            = Object.create(params)
-  #     recordParams.domainName = @domain
-
-  #     domainManager.dnsManager.deleteDNSRecord recordParams, (err, response)=>
-  #       return callback err if err
-
-  #       JDomain.update {domain:@domain}, {$pull: dnsRecords: params}, (err)->
-  #         return callback err if err
-
-  #         callback err, response
-
-  # updateDNSRecord: permit
-  #   advanced: [
-  #     { permission: 'edit own domains', validateWith: Validators.own }
-  #   ]
-  #   success: (client, params, callback)->
-  #     recordParams            = Object.create(params)
-  #     recordParams.domainName = @domain
-  #     oldData                 = params.oldData
-  #     newData                 = params.newData
-
-  #     domainManager.dnsManager.updateDNSRecord recordParams, (err, response)=>
-  #       return callback err if err
-
-  #       JDomain.update
-  #         domain                  : @domain
-  #         "dnsRecords.host"       : oldData.host
-  #         "dnsRecords.value"      : oldData.value
-  #         "dnsRecords.recordType" : oldData.recordType
-  #       , {$set : {
-  #           "dnsRecords.$.host"       : newData.host
-  #           "dnsRecords.$.value"      : newData.value
-  #           "dnsRecords.$.recordType" : newData.recordType
-  #           "dnsRecords.$.ttl"        : newData.ttl
-  #           "dnsRecords.$.priority"   : newData.priority
-  #         }}
-  #       , (err) ->
-  #         return callback err if err
-
-  #       callback err, response
-
-  # # Proxy Functions
-
-  # fetchProxyRules: (callback)->
-  #   JProxyRestriction.fetchRestrictionByDomain @domain, (err, restriction)->
-  #     return callback err if err
-  #     return callback null, restriction.ruleList if restriction
-  #     return callback null, []
-
-  # fetchProxyRulesWithMatches: (callback)->
-  #   JProxyRestriction.fetchRestrictionByDomain @domain, (err, restriction)->
-  #     return callback err if err
-
-  #     restrictions = {}
-
-  #     if restriction and restriction.ruleList?
-  #       for rest in restriction.ruleList
-  #         restrictions[rest.match] = rest.action
-
-  #     callback null, restrictions
-
-  # createProxyRule: permit
-  #   advanced: [
-  #     { permission: 'edit own domains', validateWith: Validators.own }
-  #   ]
-  #   success: (client, params, callback)->
-  #     JProxyRestriction.fetchRestrictionByDomain params.domainName, (err, restriction)->
-  #       return callback err if err
-
-  #       unless restriction
-  #         restriction = new JProxyRestriction {domainName: params.domainName}
-  #         restriction.save (err)->
-  #           return callback err if err
-
-  #       restriction.addRule params, (err, rule)->
-  #         return callback err if err
-  #         callback err, rule
-
-  # updateRuleOrders: permit
-  #   advanced: [
-  #     { permission: 'edit own domains', validateWith: Validators.own }
-  #   ]
-  #   success: (client, newRuleList, callback)->
-  #     JProxyRestriction.updateRuleOrders {domainName:@domain, ruleList:newRuleList}, (err)->
-  #       callback err
-
-  # updateProxyRule: permit
-  #   advanced: [
-  #     {permission: 'edit own domains', validateWith: Validators.own}
-  #   ]
-  #   success: (client, params, callback)->
-  #     JProxyRestriction.updateRule params, (err)-> callback err
-
-  # deleteProxyRule: permit
-  #   advanced: [
-  #     {permission: 'edit own domains', validateWith: Validators.own}
-  #   ]
-  #   success: (client, params, callback)->
-  #     params.domainName = @domain
-  #     JProxyRestriction.deleteRule params, (err)-> callback err


This commit fixes bug of remote module crash but i don't know why

--- views/env-parts/utils.coffee
+++ views/env-parts/utils.coffee
@@ -1,9 +1,7 @@
-{remoteStringify} = remote.require './lib/utils'
-
 Object.clone = (obj) ->
   JSON.parse JSON.stringify obj
 Object.remoteClone = (obj) ->
-  JSON.parse remoteStringify obj
+  JSON.parse remote.require('./lib/utils').remoteStringify obj

 pad = (n) ->
   if n < 10 then "0#{n}" else n


Send and fire should have consistent interfaces

--- src/channel.coffee
+++ src/channel.coffee
@@ -5,8 +5,8 @@
   constructor: ->
     @handlers = []

-  send: (args...) ->
-    setImmediate => @fire args...
+  send: (message) ->
+    setImmediate => @fire( message )

   fire: (message) ->
     @package message


Fix load events

Fix load events

--- lib/event_store/couchdb.coffee
+++ lib/event_store/couchdb.coffee
@@ -38,7 +38,7 @@
     request
       uri: @_urlToDocument("_design/events/_view/byAggregate?key=\"#{aggregateUid}\"")
       json: {}
-    , (err, response, body) ->
+    , (err, response, body) =>
       if err?
         callback err
       else
@@ -100,6 +100,13 @@
       data         = value.data
       attachments  = value._attachments

+      pushEvent = (callback) ->
+        event              = new Event name, data
+        event.uid          = uid
+        event.aggregateUid = aggregateUid
+        events.push event
+        callback()
+
       if options.loadBlobs and attachments?
         attachmentsQueue = async.queue (attachment, attachmentCallback) =>
           request
@@ -116,16 +123,12 @@
         , 1

         attachmentsQueue.drain = ->
-          event              = new Event name, data
-          event.uid          = uid
-          event.aggregateUid = aggregateUid
-          events.push event
-          rowCallback()
+          pushEvent rowCallback

         for k, _ of attachments
           attachmentsQueue.push k
       else
-        rowCallback()
+        pushEvent rowCallback
     , 1

     rowsQueue.drain = ->


fix bug in ios

fix bug in ios

--- src/modules/toolbar.coffee
+++ src/modules/toolbar.coffee
@@ -31,9 +31,11 @@
     )
     @quill.on(@quill.constructor.events.SELECTION_CHANGE, _.bind(this.updateActive, this))
     DOM.addClass(@container, 'sc-toolbar-container')
-    if DOM.isIE(11)
+    if DOM.isIE(11) or /iPhone|iPad/i.test(navigator.userAgent)    # :(
       DOM.addEventListener(@container, 'mousedown', =>
-        return false  # IE destroys selection by default when we click away
+        # IE destroys selection by default when we click away
+        # Also fixes bug in iOS where preformating prevents subsequent typing
+        return false
       )

   initFormat: (format, callback) ->


issue #4 : add the result_container generated by focus generaor

--- lib/helpers/view_helper.coffee
+++ lib/helpers/view_helper.coffee
@@ -856,3 +856,12 @@

   "
   return new Handlebars.SafeString(html)
+
+# create the default container for search results.
+Handlebars.registerHelper "result_container", (i18n_key, options)->
+  options = options or {}
+  opt = options.hash or {}
+  #Default width
+  width = opt.width or 12
+  html = "

"
+  return new Handlebars.SafeString(html)


Improve destroying event

Improve destroying event

--- lib/highlight-line-view.coffee
+++ lib/highlight-line-view.coffee
@@ -42,7 +42,7 @@
     @subscribe @editorView, 'selection:changed', @updateSelectedLine
     @subscribe @editorView.getPane(), 'pane:active-item-changed',
       @updateSelectedLine
-    @subscribe @editorView, 'core:close', @destroy
+    atom.workspaceView.on 'pane:item-removed', @destroy
     @updateUnderlineStyle()
     for underlineStyle in underlineStyles
       @subscribe atom.config.observe(
@@ -67,6 +67,11 @@

   # Tear down any state and detach
   destroy: =>
+    found = false
+    for editor in atom.workspaceView.getEditorViews()
+      found = true if editor.id is @editorView.id
+    return if found
+    atom.workspaceView.off 'pane:item-removed', @destroy
     @unsubscribe()
     @remove()
     @detach()


Whitespace

Whitespace

--- visibility.coffee
+++ visibility.coffee
@@ -7,8 +7,8 @@
 		options.offsetTop = 0 if !options.offsetTop?
 		options.offsetBottom = 0 if !options.offsetBottom?

-		vpWidth   			= $win.width()
-		vpHeight  			= $win.height()
+		vpWidth         = $win.width()
+		vpHeight        = $win.height()
 		viewTop         = $win.scrollTop()
 		viewBottom      = viewTop + vpHeight
 		viewLeft        = $win.scrollLeft()


check interval value

check interval value

--- server/lib/konnector_poller.coffee
+++ server/lib/konnector_poller.coffee
@@ -29,7 +29,11 @@
                         interval = 23 * day
                     else
                         interval = periods[konnector.importInterval]
-                    @prepareNextCheck konnector, interval
+                    # Check interval value
+                    if interval > 0
+                        @prepareNextCheck konnector, interval
+                    else
+                        log.debug """konnector #{konnector.slug} has an incorrect importInterval value"""
                 callback()

      prepareNextCheck: (konnector, interval) ->


Cosmetics: using a RegExp instead of an ugly chain of zeroes

--- lib/models/git-difftool.coffee
+++ lib/models/git-difftool.coffee
@@ -14,7 +14,7 @@
       diffIndex = data.split('\0')
       includeStagedDiff = atom.config.get 'git-plus.includeStagedDiff'
       for line, i in diffIndex by 2
-        staged = diffIndex[i].split(' ')[3] isnt "0000000000000000000000000000000000000000"
+        staged = not /^0{40}$/.test(diffIndex[i].split(' ')[3]);
         path = diffIndex[i+1]
         if path is file and (!staged or includeStagedDiff)
           args = ['difftool']


Removed debug code again

Removed debug code again

--- src/main/bdog/Writer/HttpServer/public/lib/View/Bsoad.coffee
+++ src/main/bdog/Writer/HttpServer/public/lib/View/Bsoad.coffee
@@ -7,7 +7,6 @@
             @content = jQuery "#content"
             @hosts   = ["client"]
             @modalId = 1
-            alert( "FOO" )

         # Handle the segment by simply appending it to the <pre> tags content
         handleSegment: ( segment ) ->


Keep sort order when exporting to CSV

Keep sort order when exporting to CSV

--- app/assets/javascripts/views/declarations_view.js.coffee
+++ app/assets/javascripts/views/declarations_view.js.coffee
@@ -75,8 +75,8 @@
     allPagesParams = _.clone params
     delete allPagesParams.page
     delete allPagesParams.per_page
-    delete allPagesParams.sort
-    delete allPagesParams.sort_direction
+    # delete allPagesParams.sort
+    # delete allPagesParams.sort_direction

     @$("a[data-download-path]").each ->
       $this = $(this)


groups: obsolete call to `JGroup::createGroupBotAndPostMessage`

--- client/Pricing/AppView.coffee
+++ client/Pricing/AppView.coffee
@@ -144,17 +144,8 @@
     {JGroup} = KD.remote.api
     JGroup.create options, (err, group, subscription) =>
       return KD.showError err  if err
-
       @groupForm.destroy()
       @showGroupCreated group, subscription
-
-      # enter first post of group.
-      JGroup.createGroupBotAndPostMessage
-        title   : "Welcome"
-        body    : "Welcome to your group."
-        botname : "groupbot"
-      , (err) ->
-        KD.showError err

   checkSlug: ->
     slug      = @groupForm.inputs.GroupUrl


Admin: Don't show "Plan & Billing" menu item

--- client/admin/lib/index.coffee
+++ client/admin/lib/index.coffee
@@ -48,7 +48,7 @@
         }
         { slug : 'APIAccess',      title : 'API Access',        viewClass : AdminAPIView             }
         { slug : 'Logs',           title : 'Team Logs',         viewClass : LogsView                 }
-        { slug : 'Plan-Billing',   title : 'Plan & Billing',    viewClass : GroupPlanBillingView     }
+        # { slug : 'Plan-Billing',   title : 'Plan & Billing',    viewClass : GroupPlanBillingView     }
       ]
     koding     :
       title    : 'Koding Administration'


Update gulp sass

Update gulp sass

--- app/modules/external-apps/external-app.controller.coffee
+++ app/modules/external-apps/external-app.controller.coffee
@@ -12,8 +12,8 @@
         "tgLoader"
     ]

-    constructor: (@routeParams, @externalAppsService, @window, @currentUserService, @location, @navUrls,
-    @xhrError, @loader) ->
+    constructor: (@routeParams, @externalAppsService, @window, @currentUserService, @location,
+    @navUrls, @xhrError, @loader) ->
         @loader.start(false)
         @._applicationId = @routeParams.application
         @._state = @routeParams.state


increase reset icon delay

increase reset icon delay

--- extension/chrome/js/src/content.coffee
+++ extension/chrome/js/src/content.coffee
@@ -424,7 +424,7 @@
 				_.delay (->
 						resetIcon?()
 						return
-						), 400
+						), 600
 			return


Added realtime and fuzzy searching

Added realtime and fuzzy searching

--- client/collection_view.coffee
+++ client/collection_view.coffee
@@ -7,8 +7,14 @@
   rows: ->
     sort_by = {}
     sort_by[Session.get('key')] = Session.get('sort_order')
-    query = _.extend({}, (Session.get('top_selector')),
-                     (Session.get('field_selectors')))
+    query = {}
+    fill_query_with_regex = (session_key) ->
+      return unless Session.get(session_key)?
+      for key, val of Session.get(session_key)
+        # From http://stackoverflow.com/questions/3115150/how-to-escape-regular-expression-special-characters-using-javascript#answer-9310752
+        query[key] = $regex: val.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&")
+    fill_query_with_regex('top_selector')
+    fill_query_with_regex('field_selectors')
     get_collection()?.find(query, {sort: sort_by}).fetch()
   values_in_order: ->
     fields_in_order = _.pluck(get_collection_view_fields(), 'name')
@@ -53,7 +59,7 @@
       Meteor.call("admin_#{Session.get('collection_name')}_update",
         id, $set: update_dict)

-  'change .column_filter': (event...) ->
+  'keyup .column_filter': (e) ->
     field_selectors = {}
     $('.column_filter').each (idx, item) ->
       if item.value


Fix match count on result view

Fix match count on result view

--- lib/project/result-view.coffee
+++ lib/project/result-view.coffee
@@ -4,7 +4,7 @@

 module.exports =
 class ResultView extends View
-  @content: (model, filePath, matches) ->
+  @content: (model, filePath, result) ->
     iconClass = if fs.isReadmePath(filePath) then 'icon-book' else 'icon-file-text'

     @li class: 'path list-nested-item', 'data-path': _.escapeAttribute(filePath), =>
@@ -19,6 +19,7 @@
     @renderResult(result)

   renderResult: (result) ->
+    matches = result?.matches
     selectedIndex = @matches.find('.selected').index()

     @matches.empty()
@@ -28,7 +29,6 @@
     else
       @description.hide()

-    matches = result?.matches
     if not matches or matches.length == 0
       @hide()
     else


Remove coffeescript's 'instance' variables

--- features/step_definitions/steps.coffee
+++ features/step_definitions/steps.coffee
@@ -2,75 +2,79 @@
 should       = require 'should'
 TestSystem   = require '../support/test_system'

+# Global variables for steps below
+result = null
+system = null
+
 module.exports = ->

-  this.Given /^the System is$/, (source, callback) =>
-    @system ?= TestSystem.parse(source)
+  this.Given /^the System is$/, (source, callback) ->
+    system ?= TestSystem.parse(source)

     callback()

-  this.Given /^I dress the following JSON document:$/, (doc, callback) =>
+  this.Given /^I dress the following JSON document:$/, (doc, callback) ->
+    try
+      json = JSON.parse(doc)
+      result = system.dress(json)
+    catch e
+      result = e
+
+    callback()
+
+  this.Given /^I dress the following JSON document with (.*?):$/, (type, doc, callback) ->
     json = JSON.parse(doc)

     try
-      @result = @system.dress(json)
+      result = system.fetch(type).dress(json)
     catch e
-      @result = e
+      result = e

     callback()

-  this.Given /^I dress the following JSON document with (.*?):$/, (type, doc, callback) =>
-    json = JSON.parse(doc)
+  this.Given /^I validate the following JSON data against (.*?)$/, (type, json, callback) ->
+    type = system.fetch(type)
+    json = JSON.parse(json)

     try
-      @result = @system.fetch(type).dress(json)
+      result = types.dress(json)
     catch e
-      @result = e
+      result = e

     callback()

-  this.Given /^I validate the following JSON data against (.*?)$/, (type, json, callback) =>
-    type = @system.fetch(type)
-    json = JSON.parse(json)
-
-    try
-      @result = types.dress(json)
-    catch e
-      @result = e
-
-    callback()
-
-  this.Then /^it should be a success$/, (callback) =>
-    if @result instanceof Error
-      throw @result
+  this.Then /^it should be a success$/, (callback) ->
+    if result instanceof Error
+      throw result
       callback.fail(Error)
     else
       callback()

-  this.Then /^the result should be a Tuple representation$/, (callback) =>
-    unless @result instanceof Object
-      callback.fail new Error("#{@result} is not an object")
+  this.Then /^the result should be a Tuple representation$/, (callback) ->
+    unless result instanceof Object
+      callback.fail new Error("#{result} is not an object")
     callback()

-  this.Then /^its '(.*)' attribute should be a Date representation$/, (attr, callback) =>
-    unless @result[attr] instanceof Date
+  this.Then /^its '(.*)' attribute should be a Date representation$/, (attr, callback) ->
+    unless result[attr] instanceof Date
       callback.fail new Error("attribute is not a Date")
     callback()

-  this.Then /^the result should be a representation for Nil$/, (callback) =>
-    unless @result == null
-      callback.fail new Error("#{@result} is not a representation for Nil")
+  this.Then /^the result should be a representation for Nil$/, (callback) ->
+    unless result == null
+      callback.fail new Error("#{result} is not a representation for Nil")
     callback()

-  this.Then /^the result should be a representation for (.*?)$/, (type,callback) =>
-    unless @system.fetch(type).include(@result)
-      callback.fail new Error("#{@result} is not a representation for #{type}")
+  this.Then /^the result should be a representation for (.*?)$/, (type,callback) ->
+    unless system.fetch(type).include(result)
+      callback.fail new Error("#{result} is not a representation for #{type}")
     callback()

-  this.Then /^it should be a TypeError as:$/, (table, callback) =>
-    unless @result instanceof Qjs.TypeError
-      callback.fail new Error("#{@result} is not a TypeError")
+  this.Then /^it should be a TypeError as:$/, (table, callback) ->
+    unless result instanceof Qjs.TypeError
+      throw result
+      callback.fail new Error("#{result} is not a TypeError")
     callback()

-  this.Then /^the result should equal (\d+)$/, (expected, callback) =>
+  this.Then /^the result should equal (\d+)$/, (expected, callback) ->
     callback.pending()


Make analyzer smarter, it now reads projects and their includes to findout if the class included into app or not and some other improvements.

--- client/landing/analyze.coffee
+++ client/landing/analyze.coffee
@@ -37,7 +37,6 @@

   console.log message

-
 log "Parsing source files...", 'yellow'

 exec command, (err, res)->
@@ -63,13 +62,13 @@

     classNames.push klass

-    classes[klass] = { class: klass, file }
+    classes[klass] = { name: klass, file }

     projects[project].push classes[klass]

     if _e and eklass
       classes[klass].extends = eklass
-      relations.push { class: klass, extends: eklass }
+      relations.push { name: klass, extends: eklass }
       graph += """  "#{klass}" -> "#{eklass}";\n"""

   i = 0
@@ -96,47 +95,88 @@

     log "Following classes are defined more than once:\n", 'red'
     log conflicts
-    log ""
+

   if hasFileIssues?

-    log "Following files have more than one class in it:\n", 'yellow'
-    log fileIssues
-    log ""
+    log "Following files have more than one class in it:\n", 'red'
+    for _file, _classes of fileIssues
+      log """
+        #{_file} includes #{_classes.length} classes:
+          \t#{_classes.join ', '}
+
+      """, 'yellow'

   log "Checking for usages... (this may take time) ... safe to stop with ctrl+c", 'yellow'
   log "Following classes from pointed files may not be used in the code:", 'red'
-  log "Uses 'ack' app, you can install it via '$ brew install ack'", 'cyan'
+  unless colorDisabled
+    log "Uses 'ack' app, you can install it via '$ brew install ack'", 'cyan'

-  lastProject = null
+  koding = require '../projects'
+
+  getProject = (path)->
+
+    for name, project of koding.projects
+      if ///^#{project.path}///.test "client/#{path}"
+        return project.sourceMapRoot
+
+  lastProject     = null
+  projectIncludes = []
+  notIncluded     = []
+  CoffeeScript    = require 'coffee-script'

   findUsage = (i)->

-    klass = classNames[i]
+    iterate = ->
+      if i < classNames.length - 1
+        findUsage i+1
+      else
+        log "Individual analyze completed.\n", 'green'
+        log "Warning: following classes is not even included in any project:", 'yellow'
+        for _klass in notIncluded
+          log " - class #{_klass.name} from #{_klass.file}"
+
+    klass   = classes[classNames[i]]
+    project = getProject klass.file
+
+    unless project
+      log """
+        Path couldn't recognized: #{klass.file}
+        (it is possible that there is no project definition for this file)
+      """, 'red'
+      return iterate()
+
+    fpath   = klass.file.replace ///^#{project}///, ''
+
+    if project isnt lastProject
+      lastProject = project
+      log "\nChecking #{lastProject} project ....................", 'cyan'
+      try
+        projectIncludes = CoffeeScript.eval fs.readFileSync "#{project}includes.coffee", "utf-8"
+      catch e
+        log "Project #{project} does not have includes.coffee!!!", 'red'
+        projectIncludes = []

     # Ignore AppController classes...
     unless colorDisabled
-      process.stdout.write "\r\r#{i} - working on #{klass}\r"
+      process.stdout.write "\r\r#{i} - working on #{klass.name}\r"

-    if /AppController.coffee$/.test classes[klass].file
-      if i < classNames.length - 1 then findUsage i+1
-      return
+    if /AppController.coffee$/.test klass.file
+      return iterate()

-    exec """ack -hc "#{klass}" """, (err, res)->
-      if (parseInt res) is 1
-        klass = classes[klass]
-        project = (klass.file.split '/')[0]
-        if project isnt lastProject
-          lastProject = project
-          log "\n\nFrom #{lastProject} project ....................\n", 'cyan'
+    exec """ack -hc "#{klass.name}" """, (err, res)->

-        if colorDisabled
-          log "#{klass.class} from #{klass.file}"
-        else
-          c = "#{klass.class}".yellow; f = "#{klass.file}".blue;
-          log "#{c} from #{f}"
+      if fpath in projectIncludes
+        if (parseInt res) is 1
+          if colorDisabled
+            log "#{klass.name} from #{klass.file}"
+          else
+            c = "#{klass.name}".yellow; f = "#{klass.file}".blue;
+            log "#{c} from #{f}"
+      else
+        notIncluded.push klass

-      findUsage i+1  if i < classNames.length - 1
+      iterate()

   findUsage 0


handle 'origin' and 'local' better

handle 'origin' and 'local' better

--- client/lib/pageHandler.coffee
+++ client/lib/pageHandler.coffee
@@ -25,9 +25,11 @@
       if localPage = pageFromLocalStorage(pageInformation.slug)
         return whenGotten( localPage, 'local' )
       else
+    else
+      if site == 'origin'
         resource = slug
-    else
-      resource = "remote/#{site}/#{slug}"
+      else
+        resource = "remote/#{site}/#{slug}"
   else
     resource = slug

@@ -101,8 +103,11 @@
       wiki.log "ajax error callback", type, msg

 pageHandler.put = (pageElement, action) ->
+  wiki.log 'pageHandler.put', pageElement, action, 'pageElement-site', pageElement.data('site')
   action.date = (new Date()).getTime()
-  if (site = pageElement.data('site'))?
+  delete action.site if action.site == 'origin'
+  if (site = pageElement.data('site'))? and site != 'origin' and site != 'local'
+    # pull remote site closer to us
     pageElement.find('h1 img').attr('src', '/favicon.png')
     pageElement.find('h1 a').attr('href', '/')
     pageElement.data('site', null)
@@ -114,7 +119,7 @@
         type: 'fork'
         site: site
         date: action.date
-  if wiki.useLocalStorage()
+  if wiki.useLocalStorage() or site == 'local'
     pushToLocal(pageElement, action)
     pageElement.addClass("local")
   else


Add heroku url

Add heroku url

--- source/scripts/utils/config.coffee
+++ source/scripts/utils/config.coffee
@@ -1,11 +1,12 @@

 servers = {
-  official:  'sync.nitrotasks.com:443'
-  dev:       'localhost:8080'
+  official: 'sync.nitrotasks.com:443'
+  local:    'localhost:8080'
+  heroku:   'nitro-server.herokuapp.com'
 }

 # Set active server
-active = servers.dev
+active = servers.local

 module.exports =
   server: active


nuke idmod from base http server

nuke idmod from base http server

--- lib/challenge.iced
+++ lib/challenge.iced
@@ -2,12 +2,12 @@
 bhs                   = require 'keybase-http-server'
 Base                  = bhs.sct.SelfCertifiedToken
 mm                    = bhs.mod.mgr
-idmod                 = bhs.id
 sc                    = bhs.status.codes
 triplesec             = require 'triplesec'
 {WordArray,scrypt}    = triplesec
 {buffer_cmp_ule}      = triplesec.util
 {unix_time}           = require('iced-utils').util
+idg                   = require('keybase-messenger-core').id.generators

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

@@ -18,7 +18,7 @@
     klass : ChallengeToken
     solution : solution
   if gen
-    cfg.id = idmod.generate mm.config.id.sct
+    cfg.id = idg.sct()
   return cfg

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


retrieve parameters from dockercompose property

--- client/views/apps/apps.coffee
+++ client/views/apps/apps.coffee
@@ -50,7 +50,7 @@
     else
       ''
   parameters: ->
-    params = @def.match /(?:\{\{)([\d|\w|_|-]*?)(?=\}\})/g
+    params = @dockerCompose.match /(?:\{\{)([\d|\w|_|-]*?)(?=\}\})/g
     if params?.length
       _.uniq(params.map (p) -> p.replace('{{', '').trim())
     else


Support setting validations after init

Support setting validations after init

--- spec/PasswordValidationSpec.coffee
+++ spec/PasswordValidationSpec.coffee
@@ -38,6 +38,13 @@
     pv = new PasswordValidation input, includes: ['hat']
     expect(pv.validate()).toContain { include: ['hat'] }

+  it 'dynamically add hat', ->
+    input.value = 'muffin'
+    pv = new PasswordValidation input
+    pv.validations.includes.hat = 'hat'
+
+    expect(pv.validate()).toContain { include: ['hat'] }
+
 describe 'excluded', ->
   it 'must exclude "hat"', ->
     input.value = 'hatmuffin'


Fixed indentation

Fixed indentation

--- client/views/app/room.coffee
+++ client/views/app/room.coffee
@@ -445,9 +445,9 @@
 		msg = event.currentTarget.parentNode.parentNode
 		return if msg.classList.contains("system")
 		swal {
-		  title: t('Are_you_sure')
-		  text: t('You_will_not_be_able_to_recover')
-		  type: 'warning'
+			title: t('Are_you_sure')
+			text: t('You_will_not_be_able_to_recover')
+			type: 'warning'
 			showCancelButton: true
 			confirmButtonColor: '#DD6B55'
 			confirmButtonText: t('Yes_delete_it')
@@ -455,8 +455,8 @@
 			closeOnConfirm: false
 			html: false
 		}, ->
-		  swal t('Deleted'), t('Your_entry_has_been_deleted'), 'success'
-				ChatMessages.deleteMsg(msg)
+			swal t('Deleted'), t('Your_entry_has_been_deleted'), 'success'
+			ChatMessages.deleteMsg(msg)

 Template.room.onCreated ->
 	console.log 'room.onCreated' if window.rocketDebug


Changed command line options.

Changed command line options.

--- lib/command.coffee
+++ lib/command.coffee
@@ -1,12 +1,12 @@
 runner = ->
   livereload_hub = require('./livereload-hub')

-  opts      = require "opts"
+  opts = require "opts"
   opts.parse [
     {
       short: 'p'
       long: 'port'
-      description: 'HTTP port'
+      description: 'port'
       value: true
       required: false
     }
@@ -30,17 +30,17 @@
       required: false
     }
     {
-      long: 'ignore-host-matching'
-      description: 'Ignore HTTP host matching'
+      long: 'disable-host-header-matching'
+      description: "Disable host header matching\n(Use this option when you don't use name based virtual host)"
       required: false
     }
-  ]
+  ].reverse(), true

   port          = opts.get('port') || 35729
   api_version   = opts.get('api-version')
   log_level     = opts.get('log-level') || 'warn'
   log_file      = opts.get('log-file') || null
-  host_matching = ! opts.get('ignore-host-matching')
+  host_matching = ! opts.get('disable-host-header-matching')

   logger = require('logger').createLogger(log_file)
   logger.setLevel(log_level)


Update ExpandableRecordArray to work correctly with Ember Model

--- assets/scripts/lib/travis/expandable_record_array.coffee
+++ assets/scripts/lib/travis/expandable_record_array.coffee
@@ -1,4 +1,4 @@
-Travis.ExpandableRecordArray = DS.RecordArray.extend
+Travis.ExpandableRecordArray = Ember.RecordArray.extend
   isLoaded: false
   isLoading: false

@@ -33,9 +33,4 @@
         @pushObject object

   pushObject: (record) ->
-    content   = @get 'content'
-    id        = record.get 'id'
-    clientId  = record.get 'clientId'
-    reference = @get('store').referenceForClientId(clientId)
-
-    @addReference reference
+    @get('content').pushObject(record)


Forgot apostrophes

Forgot apostrophes

--- scripts/card-fetcher.coffee
+++ scripts/card-fetcher.coffee
@@ -11,7 +11,7 @@
 #   JacobGinsparg

 module.exports = (robot) ->
-  robot.hear /\[\[(.[\w|\,| |/]+)\]\]+/i, (msg) ->
+  robot.hear /\[\[(.[\w|\,| |/|']+)\]\]+/i, (msg) ->
     url = "http://gatherer.wizards.com/Handlers/Image.ashx"
     card = msg.match[1]
     cardCheckUrl = "https://api.deckbrew.com/mtg/cards?name=#{card}"


Removed the location filter, as it don't work with online events

--- app/assets/javascripts/filters.js.coffee
+++ app/assets/javascripts/filters.js.coffee
@@ -21,38 +21,3 @@
     $("#location-filter").show()
     $("#distance-filter").hide()
     return false
-
-$ ->
-  if navigator.geolocation
-    navigator.geolocation.getCurrentPosition(success, null)
-
-success = (data) ->
-  window.lat = data.coords.latitude
-  window.lng = data.coords.longitude
-  calculate_meeting_distance()
-  $("#location-filter").hide()
-  $("#distance-filter").show()
-
-calculate_meeting_distance = () ->
-  $(".meetings .meeting").each ->
-    meeting_lat = Number($(this).data("lat"))
-    meeting_lng = Number($(this).data("lng"))
-    $(this).attr("data-distance", distance(lat,lng,meeting_lat,meeting_lng))
-
-###
-Converts numeric degrees to radians
-###
-if typeof (Number::toRad) is "undefined"
-  Number::toRad = ->
-    this * Math.PI / 180
-
-distance = (lat1, lon1, lat2, lon2) ->
-  R = 6371; # km
-  dLat = (lat2-lat1).toRad()
-  dLon = (lon2-lon1).toRad()
-  lat1 = lat1.toRad()
-  lat2 = lat2.toRad()
-
-  a = Math.sin(dLat/2) * Math.sin(dLat/2) + Math.sin(dLon/2) * Math.sin(dLon/2) * Math.cos(lat1) * Math.cos(lat2);
-  c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));
-  d = R * c;


added preventDefault() to vote buttons

added preventDefault() to vote buttons

--- app/assets/javascripts/motions.js.coffee
+++ app/assets/javascripts/motions.js.coffee
@@ -106,6 +106,7 @@
       $('#new_vote').preventDefault()
     else
       $('#new_vote').submit()
+      event.preventDefault()
   )

 #** character count for title on discussion:new page **


Fix turbolinks reference

Fix turbolinks reference

--- app/assets/javascripts/scirate.js.coffee
+++ app/assets/javascripts/scirate.js.coffee
@@ -224,7 +224,7 @@
     if err == "Unauthorized"
       SciRate.login()

-  Turbolinks.enableTransitionCache()
+  #Turbolinks.enableTransitionCache()
   NProgress.configure(showSpinner: false, minimum: 0.4, speed: 300)

   MathJax.Hub.Config({


Replace fire + args with trigger

Replace fire + args with trigger

--- app/assets/javascripts/task_lists.coffee
+++ app/assets/javascripts/task_lists.coffee
@@ -168,10 +168,13 @@
   index      = 1 + $container.find('.task-list-item-checkbox').index($item)
   checked    = $item.prop 'checked'

-  $field.fire 'tasklist:change', [index, checked], ->
+  event = $.Event 'tasklist:change'
+  $field.trigger event, [index, checked]
+
+  unless event.isDefaultPrevented()
     $field.val updateTaskListItem($field.val(), index, checked)
     $field.trigger 'change'
-    $field.fire 'tasklist:changed', [index, checked]
+    $field.trigger 'tasklist:changed', [index, checked]

 # When the task list item checkbox is updated, submit the change
 $(document).on 'change', '.task-list-item-checkbox', ->


added missing import

added missing import

--- bokehjs/src/coffee/renderer/tile/bbox_tile_source.coffee
+++ bokehjs/src/coffee/renderer/tile/bbox_tile_source.coffee
@@ -1,3 +1,4 @@
+_ = require "underscore"
 MercatorTileSource = require('./mercator_tile_source')

 class BBoxTileSource extends MercatorTileSource


Ensure a default title on Slack upload

Ensure a default title on Slack upload

--- src/grafana.coffee
+++ src/grafana.coffee
@@ -372,6 +372,9 @@
         req.end body

     'slack': (msg, title, grafanaDashboardRequest, link) ->
+      unless title?
+        title = 'Upload'
+
       testAuthData =
         url: 'https://slack.com/api/auth.test'
         formData:


Use pwd helper in config normalizer.

Use pwd helper in config normalizer.

--- src/helpers.coffee
+++ src/helpers.coffee
@@ -290,7 +290,7 @@
     join 'root', name

   paths                = config.paths     ?= {}
-  paths.root          ?= config.rootPath  ? '.'
+  paths.root          ?= config.rootPath  ? pwd()
   paths.public        ?= config.buildPath ? joinRoot 'public'

   paths.app           ?= joinRoot 'app'


Newline at end of file

Newline at end of file

--- src/helpers.coffee
+++ src/helpers.coffee
@@ -90,7 +90,7 @@
   71: 55 # "7"
   72: 56 # "8"
   73: 57 # "9"
-
+
 exports.normalizeKeystrokes = (keystrokes) ->
   normalizedKeystrokes = []
   for keystroke in keystrokes.split(/\s+/)
@@ -110,7 +110,7 @@
       if event.location is KeyboardEvent.DOM_KEY_LOCATION_NUMPAD
         # This is a numpad number
         charCode = numpadToASCII(charCode)
-
+
       charCode = event.which if not isASCII(charCode) and isASCII(event.keyCode)
       key = keyFromCharCode(charCode)
     else
@@ -236,6 +236,6 @@

 isASCII = (charCode) ->
   0 <= charCode <= 127
-
+
 numpadToASCII = (charCode) ->
-  NumPadToASCII[charCode] ? charCode+  NumPadToASCII[charCode] ? charCode


Protect against non-saveable items.

Protect against non-saveable items.

--- lib/git-wip.coffee
+++ lib/git-wip.coffee
@@ -45,7 +45,7 @@

   activeItem: -> atom.workspace.getActiveTextEditor()

-  activeItemPath: -> @activeItem().getPath()
+  activeItemPath: -> @activeItem()?.getPath()

   getRepos: ->
     Promise.all(atom.project.getDirectories().map(atom.project.repositoryForDirectory.bind(atom.project)))


gradual upgrade of the access system (part I)

--- library/exposure/access.coffee
+++ library/exposure/access.coffee
@@ -59,12 +59,46 @@
     # the implementing services, in case if rename is necessary.
     @ACCESS_ENTITY_SYMBOL = "account"

+    # Symbol declaration table, that states what keys, if those are
+    # vectors (arrays) should be exported and then merged with their
+    # counterparts in the destination, once the composition process
+    # takes place. See the `Archetype::composition` hook definition
+    # for more information. Keys are names, values can be anything.
+    @COMPOSITION_EXPORTS = ressurections: 1, hibernations: 1
+
+    # Add the supplied implementation function to the internal stack
+    # of function that will be invoked each the time the access system
+    # is ressurecting the entity out of the session. These functions
+    # will be called asynchronously, with an ability to abruptly end
+    # the execution. Please consult with the `async` package and the
+    # source code of this method for more details on the mechanics.
+    @ressurection: (xoptions, ximplement) ->
+        noOptions = "the options must be an object"
+        noImplement = "must have implementation body"
+        noSignature = "function has invalid signature"
+        message = "Install session ressurector in %s"
+        assert identify = this.identify().underline
+        implement = _.find arguments, _.isFunction
+        options = _.find arguments, _.isPlainObject
+        assert previous = @ressurections or Array()
+        return previous unless arguments.length > 0
+        assert _.isObject(options or {}), noOptions
+        assert _.isFunction(implement), noImplement
+        assert (implement.length) > 1, noSignature
+        logger.debug message.yellow, identify.bold
+        fn = (arbitraryVector) -> return implement
+        return fn @ressurections = previous.concat
+            implement: implement or _.noop
+            options: options or Object()
+
     # Dereference the potentially existent entity from the session
     # into the supplied container, where the session is residing. It
     # basically retrieves the hibernated entity, ressurects it and
     # defined the appropriate getter property on supplied container.
     # If the entity or session does not exist, nothing gets defined.
+    # Please refer to source code, as it contains important details.
     dereference: (container, callback) ->
+        {series, apply} = async or require "async"
         assert key = @constructor.ACCESS_ENTITY_SYMBOL
         assert sid = "x-authenticate-entity" # external
         isVanillaSession = _.isObject container.cookie
@@ -72,7 +106,11 @@
         return callback() unless session = container.session
         return callback() unless content = session[sid]
         delete container[key] if _.has container, key
-        @ressurectEntity ?= (xc, xn) -> xn null, xc
+        surrogate = _.unique @constructor.ressurection()
+        functions = (o.implement.bind @ for o in surrogate)
+        boxd = (obj) -> (apply fn, obj for fn in functions)
+        fasn = (o, c) -> series boxd(o), (e, r) -> c(e, o)
+        @ressurectEntity ?= (c, fn) -> fasn _.clone(c), fn
         @ressurectEntity content, (error, entity) =>
             format = (m) -> "ressurection error: #{m}"
             masked = format error.message if error
@@ -126,7 +164,7 @@
         success = "Got valid ignition entity at #{id}"
         set = "Set %s to be access entity reference"
         logger.debug atm, try id.toString().underline
-        try @dereference request, (error, supply) =>
+        this.dereference request, (error, supply) =>
             @emit "access-entity-ignition", arguments...
             s = succeeded = _.isObject request[symbol]
             logger.debug success.yellow if succeeded
@@ -150,7 +188,7 @@
         success = "Got valid handshake entity at #{id}"
         set = "Set %s to be access entity reference"
         logger.debug atm, try id.toString().underline
-        try @dereference handshake, (error, supply) =>
+        this.dereference handshake, (error, supply) =>
             @emit "access-entity-handshake", arguments...
             s = succeeded = _.isObject handshake[symbol]
             logger.debug success.yellow if succeeded


This ordering makes more sense

This ordering makes more sense

--- library/membrane/duplex.coffee
+++ library/membrane/duplex.coffee
@@ -61,18 +61,18 @@
     @abstract yes

     # A usable hook that gets asynchronously invoked once a new
+    # channel (socket) gets connected to the Socket.IO hub in the
+    # context of the current service. The channel will be considered
+    # established only when prescreen calls the next procedure. If
+    # you wish to decline, just don't call `next` and close socket.
+    prescreen: (context, socket, next) -> next()
+
+    # A usable hook that gets asynchronously invoked once a new
     # channel (socket) gets connected and acknowledges by the server.
     # The method gets a set of parameters that maybe be useful to
     # have by the actual implementation. Please remember thet the
     # method is asynchronously wired, so be sure to call `next`.
     connected: (context, socket, next) -> next()
-
-    # A usable hook that gets asynchronously invoked once a new
-    # channel (socket) gets connected to the Socket.IO hub in the
-    # context of the current service. The channel will be considered
-    # established only when prescreen calls the next procedure. If
-    # you wish to decline, just don't call `next` and close socket.
-    prescreen: (context, socket, next) -> next()

     # An internal, static method that is used to obtain gurading
     # domains for each of the declared server site providers. Please


add up the exclusive event binder directive

--- library/membrane/visual.coffee
+++ library/membrane/visual.coffee
@@ -88,6 +88,21 @@
         method.remote.auto = (symbol, key) -> ->
             t = "#{symbol}.on(%s, #{symbol}.#{key})"
             return format t, JSON.stringify event
+        method.remote.meta.event = event; method
+
+    # The exclusive directive is a lot like `awaiting`, except it
+    # removes all the event listeners that could have been binded
+    # to the event. And only once that has been done, it binds the
+    # supplied listener to the event, which will make it the only
+    # listener of that event at the point of a method invocation.
+    @exclusive: (event, method) ->
+        assert method = @awaiting event, method
+        method.remote.auto = (symbol, key) -> ->
+            k = "#{symbol}.removeAllListeners(%s)"
+            t = "#{symbol}.on(%s, #{symbol}.#{key})"
+            binder = format t, JSON.stringify event
+            killer = format k, JSON.stringify event
+            "(#{killer}; #{binder})".toString()
         method.remote.meta.event = event; method

     # The awaiting directive is a lot like `autocall`, except the