Wercker test build

Wercker test build

--- spec/git-spec.coffee
+++ spec/git-spec.coffee
@@ -1,4 +1,6 @@
 git = require '../lib/git'
+
+only_wercker = () -> if process.env.WERCKER then describe else ->

 inject_atom_project = () ->
     atom.project =
@@ -6,11 +8,10 @@
         destroy: -> return

 describe 'Git lib', ->
-    describe 'get_local_git_config', ->
+    only_wercker() 'get_local_git_config', ->
         it 'with error', ->
             git.get_local_git_config (err, data) ->
-                expect(err).toBe('This package does not have repository')
-                expect(data).toBeUndefined()
+                console.log(data)

     describe 'get_local_project_git', ->
         it 'Success with values', ->


Let's see if this asset compression works.

--- app/lib/Util.coffee
+++ app/lib/Util.coffee
@@ -31,7 +31,6 @@
             fs.unlinkSync path.join directory, file

     getAssets: (env) ->
-        # inDevelopment = env is 'development'
         assets = 'app/assets'
         publicAssets = path.join __dirname, '../../public/assets'
         filenames = ['app.js', 'app.css']
@@ -42,6 +41,11 @@
         environment.appendPath 'components'
         environment.appendPath 'node_modules'
         environment.appendPath path.join assets, 'stylesheets'
+
+        if env is 'production'
+            environment.jsCompressor  = 'uglify'
+            environment.cssCompressor = 'csso'
+            environment = environment.index

         manifest = new Mincer.Manifest environment, publicAssets
         manifest.compile filenames


Proxy dep in java

Proxy dep in java

--- actions/java.coffee
+++ actions/java.coffee
@@ -2,11 +2,10 @@
 path = require 'path'
 semver = require 'semver'
 url = require 'url'
-proxy = require './proxy'
 module.exports = []

-module.exports.push (ctx) ->
-  proxy.configure ctx
+module.exports.push module.exports.configure = (ctx) ->
+  require('./proxy').configure ctx
   ctx.config.java ?= {}
   ctx.config.java.java_home ?= '/usr/java/default'
   ctx.config.java.proxy = ctx.config.proxy.http_proxy if typeof ctx.config.java is 'undefined'


validate: Bump test timeout

validate: Bump test timeout

--- spec/validate.coffee
+++ spec/validate.coffee
@@ -28,6 +28,7 @@
     stderr = null
     stdout = null
     before (done) ->
+      @timeout 4*1000
       extra = test.validationOptions or ""
       guv_validate test.input, extra, (e, stdo, stde) ->
         err = e


Workspace: Use KDView instead JView, no need to compile a pistachio template for one widget

--- client/Workspace/workspace.coffee
+++ client/Workspace/workspace.coffee
@@ -1,4 +1,4 @@
-class Workspace extends JView
+class Workspace extends KDView

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

@@ -73,10 +73,5 @@
     container.setHeight panel.getHeight() - header.getHeight()  if header

   viewAppended: ->
-    super
+    @addSubView @container
     @_windowDidResize()
-
-  pistachio: ->
-    """
-      {{> @container}}
-    """


Remove log

Remove log

--- app/pages/home.cjsx
+++ app/pages/home.cjsx
@@ -77,7 +77,6 @@
         <ZooniverseLogoType />
         {if @props.user
           <PromiseRenderer promise={@lastFourProjects()}>{(projectPreferences) =>
-            console.log(projectPreferences)
             if projectPreferences.length > 0
               <div className="recent-projects">
                 <Translate component="h5" content="home.recentProjects.title" />


Reset NODE_ENV to empty before running terminal

--- index.coffee
+++ index.coffee
@@ -41,7 +41,7 @@
     defaultCommand = 'start /D "%cd%" cmd' +
       ' /K "set NODE_PATH=& set NODE_ENV=& set GOOGLE_API_KEY="'
   else
-    defaultCommand = 'x-terminal-emulator'
+    defaultCommand = 'NODE_ENV= x-terminal-emulator'

 module.exports =
   config: {


fix(format): screamingSnakeCase and snakeCase missing assignmnt

--- index.coffee
+++ index.coffee
@@ -64,8 +64,8 @@
 				switch filter
 					when 'lowerCamelCase' then detail = detail.charAt(0).toLowerCase() + detail.slice(1)
 					when 'lowerCase' then detail = detail.toLowerCase()
-					when 'screamingSnakeCase' then detail.replace(/([a-z\d])([A-Z])/g, '$1_$2').toUpperCase()
-					when 'snakeCase' then detail.replace(/([a-z\d])([A-Z])/g, '$1_$2').toLowerCase()
+					when 'screamingSnakeCase' then detail = detail.replace(/([a-z\d])([A-Z])/g, '$1_$2').toUpperCase()
+					when 'snakeCase' then detail = detail.replace(/([a-z\d])([A-Z])/g, '$1_$2').toLowerCase()
 					when 'spinalCase' then detail = detail.replace(/([a-z\d])([A-Z])/g, '$1-$2').toLowerCase()
 					when 'trainCase' then detail = detail.replace(/([a-z\d])([A-Z])/g, '$1-$2').charAt(0).toUpperCase() + detail.replace(/([a-z\d])([A-Z])/g, '$1-$2').slice(1)
 					when 'upperCamelCase' then detail = detail.charAt(0).toUpperCase() + detail.slice(1)


reorder according to semantical meaning

reorder according to semantical meaning

--- index.coffee
+++ index.coffee
@@ -56,9 +56,9 @@
 # framework is indeed loaded and are not missing. This is precaution
 # to make sure that the framework is in usable state, once is loaded.
 # You can refer to this definitions from the outside of the framework.
+assert _.isObject nucleus = module.exports.nucleus
 assert _.isObject membrane = module.exports.membrane
 assert _.isObject semantic = module.exports.semantic
-assert _.isObject nucleus = module.exports.nucleus
 assert _.isObject gearbox = module.exports.gearbox
 assert _.isObject applied = module.exports.applied
 assert _.isObject fringes = module.exports.fringes


class refactor - corrected callback

class refactor - corrected callback

--- index.coffee
+++ index.coffee
@@ -14,7 +14,7 @@

-makeLink = (phrase) ->
+makeLink = phrase (phraseLink) ->
   if phrase is null then console.log 'we need phrase'
   else
   getPhraseLink phrase
@@ -47,5 +47,5 @@
    phraseLink.toJSON()

-exports.phraseLink = makeLink
+exports.makeLink = makeLink


Push commands onto an array instead of counting them.

--- index.coffee
+++ index.coffee
@@ -70,7 +70,7 @@

   pos: null

-  prompt_count: 0
+  commands: []

   constructor: (@scope) ->
     @pos = new Position()
@@ -83,13 +83,12 @@
     false

   prompt: ->
-    output = prompt("[#{@prompt_count}] pry> ")
+    @commands.push output = prompt("[#{@commands.length}] pry> ")
     if @[output]
       @prompt() if @[output]()
     else
       console.log("=> #{@scope(output)}")
       @prompt()
-    @prompt_count += 1

 pry = (scope) ->
   presenter = new Presenter(scope)


Add options for foreground and background colors

--- index.coffee
+++ index.coffee
@@ -28,6 +28,8 @@
         brightPurple: '#ad7fa8'
         brightCyan  : '#34e2e2'
         brightWhite : '#eeeeec'
+        background  : '#000000'
+        foreground  : '#f0f0f0'

       scrollback: 1000
       cursorBlink: yes
@@ -53,12 +55,14 @@
         normalBlue, normalPurple, normalCyan, normalWhite
         brightBlack, brightRed, brightGreen, brightYellow
         brightBlue, brightPurple, brightCyan, brightWhite
+        background, foreground
       }} = atom.config.getSettings().term2
       [
         normalBlack, normalRed, normalGreen, normalYellow
         normalBlue, normalPurple, normalCyan, normalWhite
         brightBlack, brightRed, brightGreen, brightYellow
         brightBlue, brightPurple, brightCyan, brightWhite
+        background, foreground
       ]

     createTermView:->


fixed a little how the arrow is drawn (maybe)

+ renamed a function and cleaned up dead code

--- dramagrama.coffee
+++ dramagrama.coffee
@@ -31,7 +31,7 @@
 			if childBlock
 				@drawer.connectExistingBlocks(parentBlock, childBlock, "down", child.arrow )
 			else
-				childBlock = @drawer.connectToRectangle(parentBlock, child, i, "down", child.arrow)
+				childBlock = @drawer.drawAndConnectToBlock(parentBlock, child, i, "down", child.arrow)
 				@blocksThatIHaveDrawn[child.name] = childBlock
 				@drawRootedBlock child
 				i++
@@ -283,7 +283,7 @@
 			"font-family":"'Shadows Into Light Two', sans-serif"
 			})

-	connectToRectangle:(previousBlock, block, childIndex, direction, arrow) ->
+	drawAndConnectToBlock:(previousBlock, block, childIndex, direction, arrow) ->
 		previousRectangle = previousBlock.rectangle # block also contains the svg, just in case
 		x = childIndex * (@rectangleWidth + @childrenHorizontalPadding) + previousRectangle.top.x
 		y = previousRectangle.top.y + @rectangleHeight + @childrenVerticalPadding
@@ -297,11 +297,6 @@
 		@drawLine connector, myConnector, arrow
 		return drawn

-	connectRectangles: (parentBlock, childBlock, direction, arrow)->
-		connector = parentBlock.rectangle.getConnectorForDirection direction
-		myConnector = childBlock.rectangle.getConnectorForDirection "up"
-		@drawLine connector, myConnector, arrow
-
 	connectExistingBlocks:(block1, block2, direction, arrow) ->
 		connector1 = block1.rectangle.getConnectorForDirection direction
 		connector2 = block2.rectangle.getConnectorForDirection "up"
@@ -318,8 +313,10 @@
 			@drawPath(point2, point1, arrow.headLeft, arrow.type)

 		return unless arrow.message
-		midpoint = point1.y + (point2.y - point1.y)/2
-		@paper.text(point1.x + 5, midpoint, arrow.message).attr(
+
+		y_mid = point1.y + 20 #point1.y + (point2.y - point1.y)/2
+		x_mid = point1.x + 5 #(point2.x - point1.x)/2 + 5
+		@paper.text(x_mid, y_mid, arrow.message).attr(
 			{"font-size": "12px",
 			"font-family":"'Shadows Into Light Two', sans-serif",
 			"text-anchor":"start"})


add comments to router, downcase route

add comments to router, downcase route

express has case-insensitive routes

--- services/web/app/coffee/router.coffee
+++ services/web/app/coffee/router.coffee
@@ -106,7 +106,9 @@
 		webRouter.post '/project/:Project_id/settings/admin', AuthorizationMiddlewear.ensureUserCanAdminProject, ProjectController.updateProjectAdminSettings

 		webRouter.post '/project/:Project_id/compile', AuthorizationMiddlewear.ensureUserCanReadProject, CompileController.compile
-		webRouter.get  '/Project/:Project_id/output/output.pdf', AuthorizationMiddlewear.ensureUserCanReadProject, CompileController.downloadPdf
+		# Used by the web download buttons, adds filename header
+		webRouter.get  '/project/:Project_id/output/output.pdf', AuthorizationMiddlewear.ensureUserCanReadProject, CompileController.downloadPdf
+		# Used by the pdf viewers
 		webRouter.get  /^\/project\/([^\/]*)\/output\/(.*)$/,
 			((req, res, next) ->
 				params =


Updating Documentation

Updating Documentation

--- github.coffee
+++ github.coffee
@@ -547,6 +547,7 @@
       constructor: (@options) ->
         user = @options.user
         repo = @options.name
+        # Set the `git` instance variable
         @git = new GitRepo(user, repo)
         @repoPath = "/repos/#{user}/#{repo}"
         @currentTree =
@@ -558,6 +559,8 @@
       getBranches: -> @git.getBranches()

+      # Get a branch of a repository
+      # -------
       getBranch: (branchName) ->
         getRef = =>
           deferred = new jQuery.Deferred()
@@ -566,6 +569,8 @@
         new Branch(@git, getRef)

+      # Get the default branch of a repository
+      # -------
       getDefaultBranch: () ->
         # Calls getInfo() to get the default branch name
         getRef = =>
@@ -602,14 +607,16 @@
       # --------
       # Takes an object of optional paramaters:
       #
-      # - path: Only commits containing this file path will be returned
-      # - author: GitHub login, name, or email by which to filter by commit author
-      # - since: ISO 8601 date - only commits after this date will be returned
-      # - until: ISO 8601 date - only commits before this date will be returned
+      # - `path`: Only commits containing this file path will be returned
+      # - `author`: GitHub login, name, or email by which to filter by commit author
+      # - `since`: ISO 8601 date - only commits after this date will be returned
+      # - `until`: ISO 8601 date - only commits before this date will be returned
       getCommits: (options) ->
         @git.getCommits(options)

+    # Gist API
+    # -------
     class Gist
       constructor: (@options) ->
         id = @options.id
@@ -624,15 +631,16 @@

       # Create the gist
       # --------
-      # {
-      #  "description": "the description for this gist",
-      #    "public": true,
-      #    "files": {
-      #      "file1.txt": {
-      #        "content": "String file contents"
-      #      }
-      #    }
-      # }
+      #
+      #     {
+      #        "description": "the description for this gist",
+      #        "public": true,
+      #        "files": {
+      #          "file1.txt": {
+      #            "content": "String file contents"
+      #          }
+      #        }
+      #     }
       create: (options) ->
         _request 'POST', "/gists", options


Standardise input parameters

Standardise input parameters

--- app/facebook.coffee
+++ app/facebook.coffee
@@ -91,8 +91,13 @@
 						title: res.name
 						raw: res
 						source: query.url
-						date: new Date(res.start_time).getTime()
-						location: ''
+						date: new Date(res.start_time)
+						location: {
+							address: ''
+							name: ''
+							lon: 0
+							lat: 0
+						}
 					]
 					onSuccess: query.onSuccess
 					onError: query.onError


Add modelLoaded handler so that Global data is loaded in immediately.

--- src/code/wrapper.coffee
+++ src/code/wrapper.coffee
@@ -82,8 +82,9 @@
       @scheduleDataUpdate()
     "#{@datasetName}-dataReset":=>
       @scheduleDataUpdate()
-    "getDataset": () =>
-      l.info("getDataSet sent by interactive (what to do?)")
+    "modelLoaded": () =>
+      l.info("Model loaded called")
+      @runtimePhone.post('interactiveStateGlobal', @globalState)
     "dataset": (data)=>
       @globalState[@globalStateKey] = data
       @runtimePhone.post('interactiveStateGlobal', @globalState)


One more ActiveX

One more ActiveX

--- src/sys/ie.coffee
+++ src/sys/ie.coffee
@@ -2,7 +2,7 @@
 Start MSIE
 ###
 module.exports = ->
-  ie = new ActiveXObject "InternetExplorer.Application"
+  ie = activeX "InternetExplorer.Application"
   ie.Visible = true
   ie.Navigate 'about:blank'
   wsh.Sleep 100 while ie.Busy


Removing jQuery

Removing jQuery

--- test/dummy/app/assets/javascripts/views/admin/articles/list.coffee
+++ test/dummy/app/assets/javascripts/views/admin/articles/list.coffee
@@ -4,22 +4,24 @@

   render: (opts) ->
     for article in opts.articles
-      $('#articles').append this._articleForListTemplate(article)
+      renderedArticle = this._articleForListTemplate(article)
+      document.getElementById('articles').insertAdjacentHTML('beforeend', renderedArticle)

   renderNewArticle: (article) ->
-    $('#articles').prepend this._articleForListTemplate(article)
+    renderedArticle = this._articleForListTemplate(article)
+    document.getElementById('articles').insertAdjacentHTML('afterbegin', renderedArticle)

   updateArticle: (articleId) ->
-    return if $("#article_#{articleId}").length is 0
+    return unless document.getElementById("article_#{articleId}")
     App.Models.Article.find(id: articleId).then (article) =>
-      $("#article_#{article.id}").replaceWith this._articleForListTemplate(article)
+      document.getElementById("article_#{articleId}").outerHTML = this._articleForListTemplate(article)

   commentsQuantityChangedForArticle: (articleId, quantity) ->
-    return if $("#article_#{articleId}").length is 0
-    sel = $("#article_#{articleId} span.comments_quantity")
-    match = /\d+/.exec sel.text()
+    return unless document.getElementById("article_#{articleId}")
+    sel = document.querySelector("#article_#{articleId} span.comments_quantity")
+    match = /\d+/.exec(sel.textContent)
     quantity = parseInt(match[0]) + quantity
-    sel.text "#{quantity} comment#{if quantity is 1 then '' else 's'}"
+    sel.textContent = "#{quantity} comment#{if quantity is 1 then '' else 's'}"

   _articleForListTemplate: (article) ->
     JST["templates/admin/articles/article_for_list"] article: article


Revert canonicalization update to Sabine in accordance with XWS spec.

--- coffeescripts/cards-common.coffee
+++ coffeescripts/cards-common.coffee
@@ -4099,7 +4099,7 @@
         {
             name: 'Sabine Wren (TIE Fighter)'
             id: 223
-            canonical_name: "sabinewren-swx59"
+            canonical_name: "sabinewren"
             unique: true
             faction: 'Rebel Alliance'
             ship: 'TIE Fighter'


Guns for Hire released.

Guns for Hire released.

--- coffeescripts/cards-common.coffee
+++ coffeescripts/cards-common.coffee
@@ -2,7 +2,6 @@
 exportObj = exports ? this

 exportObj.unreleasedExpansions = [
-    'Guns for Hire Expansion Pack'
     'Alpha-class Star Wing Expansion Pack',
     'M12-L Kimogila Fighter Expansion Pack',
     'Phantom II Expansion Pack',


fix(keymap): add ctrl-enter to send email

--- internal_packages/composer/keymaps/composer.cson
+++ internal_packages/composer/keymaps/composer.cson
@@ -3,6 +3,7 @@
   'cmd-B' : 'composer:show-and-focus-bcc'
   'cmd-C' : 'composer:show-and-focus-cc'
   'cmd-enter' : 'composer:send-message'
+  'ctrl-enter' : 'composer:send-message'

 '.composer-outer-wrap div[contenteditable]':
   'escape' : 'composer:delete-empty-draft'


Removing duplicate 'CATCH'

Removing duplicate 'CATCH'

--- rewriter.coffee
+++ rewriter.coffee
@@ -180,7 +180,7 @@

       # Don't end an implicit call on next indent if any of these are in an argument
       if inImplicitCall() and tag in ['IF', 'TRY', 'FINALLY', 'CATCH',
-        'CLASS', 'SWITCH', 'CATCH']
+        'CLASS', 'SWITCH']
         stack.push ['CONTROL', i, ours: true]
         return forward(1)


Update conversation.coffee

Update conversation.coffee


Add transform origin, fix curve name

Add transform origin, fix curve name

--- src/animation.coffee
+++ src/animation.coffee
@@ -54,6 +54,7 @@
 		# Set all the defaults
 		@time ?= 1000
 		@curve ?= "linear"
+		@origin ?= "50% 50%"
 		@count = 0

 		@precision ?= config.animationPrecision
@@ -153,6 +154,7 @@
 				-webkit-animation-name: #{@animationName};
 				-webkit-animation-timing-function: linear;
 				-webkit-animation-fill-mode: both;
+				-webkit-tranform-origin: #{@origin};
 			}"

 		@view.addClass @animationName
@@ -328,8 +330,8 @@
 			return bezier.defaults.EaseOut @precision, time
 		else if curve in ["ease-in-out"]
 			return bezier.defaults.EaseInOut @precision, time
-		else if curve[.."cubic-bezier".length-1] is "cubic-bezier"
-			v = parseCurve curve, "cubic-bezier"
+		else if curve[.."bezier-curve".length-1] is "bezier-curve"
+			v = parseCurve curve, "bezier-curve"
 			return bezier.BezierCurve v[0], v[1], v[2], v[3], precision, time
 		else if curve[.."spring".length-1] is "spring"
 			v = parseCurve curve, "spring"


first spec, failing

first spec, failing


Removed HIM instance text from new user email

--- src/api/users.coffee
+++ src/api/users.coffee
@@ -171,14 +171,14 @@

     var plainMessage;
     plainMessage = '<---------- New User - Set Password ----------> \r\n \r\n';
-    plainMessage += 'Hi '+userData.firstname+', A profile has been created for you on OpenHIM ('+config.alerts.himInstance+') \r\n';
+    plainMessage += 'Hi '+userData.firstname+', A profile has been created for you on OpenHIM \r\n';
     plainMessage += 'Follow the below link to set your password and log into OpenHIM Console  \r\n';
     plainMessage += setPasswordLink + '\r\n';
     plainMessage += '<---------- New User - Set Password ----------> \r\n \r\n';
     plainMessage += '\r\n';

     var htmlMessage;
-    htmlMessage = '
Hi '+userData.firstname+', A profile has been created for you on OpenHIM ('+config.alerts.himInstance+')
';
+    htmlMessage = '
Hi '+userData.firstname+', A profile has been created for you on OpenHIM
';
     htmlMessage += '
Follow the below link to set your password and log into OpenHIM Console
';
     htmlMessage += '
'+setPasswordLink+'
';


Improved SVG Layer with respect to fill and color

--- framer/SVGLayer.coffee
+++ framer/SVGLayer.coffee
@@ -2,14 +2,23 @@
 {Color} = require "./Color"
 {Layer, layerProperty} = require "./Layer"

+validFill = (value) ->
+	Color.validColorValue(value) or _.startsWith(value, "url(")
+
+toFill = (value) ->
+	if _.startsWith(value, "url(")
+		return value
+	else
+		return Color.toColor(value)
 class exports.SVGLayer extends Layer

 	constructor: (options={}) ->
 		options.backgroundColor ?= null
-		options.fill ?= "black"
 		super options

-	@define "backgroundColor", layerProperty(@, "fill", "fill", null, Color.validColorValue, Color.toColor)
+	@define "fill", layerProperty(@, "fill", "fill", null, validFill, toFill)
+	@define "stroke", layerProperty(@, "stroke", "stroke", null, validFill, toFill)
+	@define "color", layerProperty(@, "color", "color", null, Color.validColorValue, Color.toColor, null, ((layer, value) -> layer.fill = value), "_elementHTML", true)

 	@define "gradient",
 		get: ->
@@ -24,24 +33,21 @@
 				else
 					@_gradient = null
 			@updateGradientSVG()
-
+
 	updateGradientSVG: =>
+		if not Gradient.isGradient(@_gradient)
+			@_elementGradientSVG.innerHTML = ""
+			return

-		isGradient = Gradient.isGradient @_gradient
-
-		if not @_elementGradientSVG and isGradient
+		if not @_elementGradientSVG
 			@_elementGradientSVG = document.createElementNS("http://www.w3.org/2000/svg", "svg")
 			@_element.appendChild @_elementGradientSVG

-		if isGradient
-			id = "#{@id}-gradient"
-			@_elementGradientSVG.innerHTML = """
-				<linearGradient id='#{id}' gradientTransform='rotate(#{@gradient.angle - 90}, 0.5, 0.5)' >
-					<stop offset="0" stop-color='##{@gradient.start.toHex()}' stop-opacity='#{@gradient.start.a}' />
-					<stop offset="1" stop-color='##{@gradient.end.toHex()}' stop-opacity='#{@gradient.end.a}' />
-				</linearGradient>
-			"""
-			@style.fill = "url(##{id})"
-		else
-			@_elementGradientSVG.innerHTML = ""
-			@fill = @fill
+		id = "#{@id}-gradient"
+		@_elementGradientSVG.innerHTML = """
+			<linearGradient id='#{id}' gradientTransform='rotate(#{@gradient.angle - 90}, 0.5, 0.5)' >
+				<stop offset="0" stop-color='##{@gradient.start.toHex()}' stop-opacity='#{@gradient.start.a}' />
+				<stop offset="1" stop-color='##{@gradient.end.toHex()}' stop-opacity='#{@gradient.end.a}' />
+			</linearGradient>
+		"""
+		@fill = "url(##{id})"


window.extensions is a map of loaded extension instances

--- src/window.coffee
+++ src/window.coffee
@@ -12,7 +12,7 @@
 windowAdditions =
   editor: null

-  extensions: []
+  extensions: {}

   appRoot: OSX.NSBundle.mainBundle.resourcePath

@@ -37,20 +37,20 @@
     "window:" + @path

   loadExtensions: ->
-    extension.shutdown() for extension in @extensions
-    @extensions = []
+    extension.shutdown() for name, extension of @extensions
+    @extensions = {}

     extensionPaths = fs.list require.resourcePath + "/extensions"
     for extensionPath in extensionPaths when fs.isDirectory extensionPath
       try
         extension = require extensionPath
-        extensions.push new extension()
+        @extensions[extension.name] = new extension
       catch error
         console.warn "window: Loading Extension '#{fs.base extensionPath}' failed."
         console.warn error

     # After all the extensions are created, start them up.
-    for extension in @extensions
+    for name, extension of @extensions
       try
         extension.startup()
       catch error
@@ -84,7 +84,7 @@
       Event.trigger 'window:open', path

   close: (path) ->
-    extension.shutdown() for extension in @extensions
+    extension.shutdown() for name, extension of @extensions

     atomController.close
     Event.trigger 'window:close', path


enable cors

enable cors

--- app/back/app.coffee
+++ app/back/app.coffee
@@ -44,6 +44,11 @@
     fingerprinting: false
   })

+app.use (req, res, next) ->
+  res.header 'Access-Control-Allow-Origin', '*'
+  res.header 'Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept'
+  next()
+
 app.use '/', pages_controller

 if config.env_development


substitute text for empty story.

substitute text for empty story.

--- assets/front.coffee
+++ assets/front.coffee
@@ -261,7 +261,10 @@
 						tag = trackids.length
 						length = segment.tracks[0].metadata.length
 						console.log(segment.tracks[0].metadata)
-						story = segment.tracks[0].metadata.story
+						if segment.tracks[0].metadata.story
+							story = segment.tracks[0].metadata.story
+						else
+							story = "This one is still a mystery. Please let us know if you can solve."
 						minutes = Math.floor(length/60)
 						seconds = Math.floor(length%60)
 						if seconds < 10
@@ -274,12 +277,7 @@
 							# Assume that every artistN has corresponding other stash-targets lengthN
 							# and (eventually) titleN.
 							artist.innerHTML = segment.tracks[0].metadata.artist
-							if story
-								console.log("we have a story")
-								console.log(story)
-								document.getElementById('story'+tag).innerHTML = segment.tracks[0].metadata.story
-							else
-								document.getElementById('story'+tag).innerHTML = "This one is still a mystery. Please let us know if you can solve."
+							document.getElementById('story'+tag).innerHTML = segment.tracks[0].metadata.story
 							document.getElementById('length'+tag).innerHTML = minutes + ":" + seconds
 				# console.log(segment.tracks[0].metadata)
 				# console.log(segment.tracks[0].metadata.id)


lame client side error ui to ensure votes have stars #165

--- public/javascripts/application.coffee
+++ public/javascripts/application.coffee
@@ -56,9 +56,13 @@
     .hover (e) ->
       hoverAt or= Date.now()
     .submit (e) ->
-      $(this)
+      $this = $(this)
         .find('input[type=hidden].hoverAt').val(hoverAt).end()
         .find('input[type=hidden].requestAt').val(requestAt).end()
+      if $this.find('div.stars:has(.star.filled)').length < 4
+        alert 'All ratings must have at least 1 star.'
+        false
+      else true
     .delegate 'a.change', 'click', (e) ->
       e.preventDefault()
       $form = $(this).closest('form').toggleClass('view edit')


Clampable#clampToBounds

Clampable#clampToBounds

--- src/clampable.coffee
+++ src/clampable.coffee
@@ -21,7 +21,8 @@

   player = GameObject()

-  player.cla 30,
+  player.clamp
+    health
     x: 50
     y: 50
     easing: "quadratic"


config: brokers no longer have version number in the hostname

--- config/main.sjc-production.coffee
+++ config/main.sjc-production.coffee
@@ -174,11 +174,11 @@
       mainUri   : "http://koding.com"
       broker    :
         servicesEndpoint: "/-/services/broker"
-        sockJS   : "https://broker-#{version}.koding.com/subscribe"
+        sockJS   : "https://broker.koding.com/subscribe"
       brokerKite:
         servicesEndpoint: "/-/services/brokerKite"
         brokerExchange: 'brokerKite'
-        sockJS   : "https://brokerkite-#{version}.koding.com/subscribe"
+        sockJS   : "https://brokerkite.koding.com/subscribe"
       premiumBrokerKite:
         servicesEndpoint: "/-/services/premiumBrokerKite"
         brokerExchange: 'premiumBrokerKite'


Clean up constructor with a decorator

Clean up constructor with a decorator

--- src/coffee/history/controllers.coffee
+++ src/coffee/history/controllers.coffee
@@ -25,8 +25,6 @@
     serviceStamp: 'serviceStamp'
     notify: 'notify'

-  #--- Functions.
-
   # Test to see if two strings overlap.
   overlaps = (x, y) -> x && y && (x.indexOf(y) >= 0 || y.indexOf(x) >= 0)

@@ -51,6 +49,12 @@

     conf

+  # Decorator to create injecting constructor.
+  inject = (fn) -> (injected...) ->
+    for [name, _], idx in injectables
+      @[name] = injected[idx]
+    fn.call @
+
   Controllers = ng.module 'steps.history.controllers', ['steps.services']

   Controllers.controller 'HistoryCtrl', class HistoryController
@@ -59,12 +63,10 @@

     @$inject: (snd for [fst, snd] in injectables)

-    constructor: (injected...) ->
-      for [name, _], idx in injectables
-        @[name] = injected[idx]
-
+    constructor: inject ->
       @init()
       @startWatching()
+      console.log @

     elide: true


Refactor z-index allocation to a separate function.

--- content_scripts/link_hints.coffee
+++ content_scripts/link_hints.coffee
@@ -197,36 +197,37 @@
       indicator = @mode.indicator + (if typedCharacters then ": \"#{typedCharacters}\"" else "") + "."
       @hintMode.setIndicator indicator

-  #
-  # Creates a link marker for the given link.
-  #
-  createMarkerFor: do ->
+  getNextZIndex: do ->
     # This is the starting z-index value; it produces z-index values which are greater than all of the other
     # z-index values used by Vimium.
     baseZIndex = 2140000000
-
-    (desc) ->
-      marker =
-        if desc.frameId == frameId
-          localHintDescriptor = HintCoordinator.getLocalHintMarker desc
-          el = DomUtils.createElement "div"
-          el.rect = localHintDescriptor.rect
-          el.style.left = el.rect.left + "px"
-          el.style.top = el.rect.top  + "px"
-          # Each hint marker is assigned a different z-index.
-          el.style.zIndex = baseZIndex += 1
-          extend el,
-            className: "vimiumReset internalVimiumHintMarker vimiumHintMarker"
-            showLinkText: localHintDescriptor.showLinkText
-            localHintDescriptor: localHintDescriptor
-        else
-          {}
-
-      extend marker,
-        hintDescriptor: desc
-        isLocalMarker: desc.frameId == frameId
-        linkText: desc.linkText
-        stableSortCount: ++@stableSortCount
+    -> baseZIndex += 1
+
+  #
+  # Creates a link marker for the given link.
+  #
+  createMarkerFor: (desc) ->
+    marker =
+      if desc.frameId == frameId
+        localHintDescriptor = HintCoordinator.getLocalHintMarker desc
+        el = DomUtils.createElement "div"
+        el.rect = localHintDescriptor.rect
+        el.style.left = el.rect.left + "px"
+        el.style.top = el.rect.top  + "px"
+        # Each hint marker is assigned a different z-index.
+        el.style.zIndex = @getNextZIndex()
+        extend el,
+          className: "vimiumReset internalVimiumHintMarker vimiumHintMarker"
+          showLinkText: localHintDescriptor.showLinkText
+          localHintDescriptor: localHintDescriptor
+      else
+        {}
+
+    extend marker,
+      hintDescriptor: desc
+      isLocalMarker: desc.frameId == frameId
+      linkText: desc.linkText
+      stableSortCount: ++@stableSortCount

   # Handles <Shift> and <Ctrl>.
   onKeyDownInMode: (event) ->


fix style problems part 3

fix style problems part 3

--- coffee-script.coffee
+++ coffee-script.coffee
@@ -155,11 +155,11 @@
     require.extensions[ext] = loadFile

   # Patch Node's module loader to be able to handle .coffee.md in require.extensions
-  do (module = require 'module') ->
+  do (Module = require 'module') ->
     NATIVELOAD = "function(filename){debug('load'+JSON.stringify(filename)+'formodule'+JSON.stringify(this.id));assert(!this.loaded);this.filename=filename;this.paths=Module._nodeModulePaths(path.dirname(filename));varextension=path.extname(filename)||'.js';if(!Module._extensions[extension])extension='.js';Module._extensions[extension](this,filename);this.loaded=true;}"

     # Only keep going if we're sure module.prototype.load is what we expect
-    return unless module::load.toString().replace(/\s+/g, "") is NATIVELOAD
+    return unless Module::load.toString().replace(/\s+/g, '') is NATIVELOAD

     findExtension = (filename) ->
       extensions = path.basename(filename).split '.'
@@ -170,16 +170,16 @@
       # Start with the longest extension and work our way shortwards
       while extensions.shift()
         curExtension = '.' + extensions.join '.'
-        return curExtension if module._extensions[curExtension]
+        return curExtension if Module._extensions[curExtension]

       '.js'

-    module::load = (filename) ->
+    Module::load = (filename) ->
       @filename = filename
-      @paths = module._nodeModulePaths path.dirname filename
+      @paths = Module._nodeModulePaths path.dirname filename

       extension = findExtension filename
-      module._extensions[extension](this, filename)
+      Module._extensions[extension](this, filename)
       @loaded = true


feat: extends supported languages for code block (#55)

* feat: extends supported languages for code block

- dockerfile
- properties (git-config, java-properies)
- makefile
- perl and perl6
- toml

* refactor: add 'embedded' for code block grammars

--- grammars/asciidoc.cson
+++ grammars/asciidoc.cson
@@ -530,7 +530,7 @@
             'end': '\\1'
             'endCaptures':
               '0': 'name': 'support.asciidoc'
-            'contentName': 'source.go'
+            'contentName': 'source.embedded.go'
             'patterns': ['include': 'source.go']
           }
         ]
@@ -583,7 +583,7 @@
             'end': '\\1'
             'endCaptures':
               '0': 'name': 'support.asciidoc'
-            'contentName': 'source.gfm'
+            'contentName': 'source.embedded.gfm'
             'patterns': ['include': 'source.gfm']
           }
         ]
@@ -610,7 +610,7 @@
             'end': '\\1'
             'endCaptures':
               '0': 'name': 'support.asciidoc'
-            'contentName': 'source.yaml'
+            'contentName': 'source.embedded.yaml'
             'patterns': ['include': 'source.yaml']
           }
         ]
@@ -637,7 +637,7 @@
             'end': '\\1'
             'endCaptures':
               '0': 'name': 'support.asciidoc'
-            'contentName': 'source.coffee'
+            'contentName': 'source.embedded.coffee'
             'patterns': ['include': 'source.coffee']
           }
         ]
@@ -664,7 +664,7 @@
             'end': '\\1'
             'endCaptures':
               '0': 'name': 'support.asciidoc'
-            'contentName': 'source.json'
+            'contentName': 'source.embedded.json'
             'patterns': ['include': 'source.json']
           }
         ]
@@ -691,7 +691,7 @@
               'end': '\\1'
               'endCaptures':
                 '0': 'name': 'support.asciidoc'
-              'contentName': 'source.css'
+              'contentName': 'source.embedded.css'
               'patterns': ['include': 'source.css']
           }
         ]
@@ -718,7 +718,7 @@
             'end': '\\1'
             'endCaptures':
               '0': 'name': 'support.asciidoc'
-            'contentName': 'source.css.less'
+            'contentName': 'source.embedded.css.less'
             'patterns': ['include': 'source.css.less']
           }
         ]
@@ -745,7 +745,7 @@
             'end': '\\1'
             'endCaptures':
               '0': 'name': 'support.asciidoc'
-            'contentName': 'text.xml'
+            'contentName': 'text.embedded.xml'
             'patterns': ['include': 'text.xml']
           }
         ]
@@ -772,12 +772,175 @@
             'end': '\\1'
             'endCaptures':
               '0': 'name': 'support.asciidoc'
-            'contentName': 'source.rust'
+            'contentName': 'source.embedded.rust'
             'patterns': ['include': 'source.rust']
           }
         ]
       }

+
+      # Matches Dockerfile AsciiDoc code blocks
+      #
+      # Examples
+      #
+      #   [source,dockerfile]
+      #   ----
+      #  ...
+      #   ----
+      {
+        'begin': '^\\[source,\\s*(docker(file))\\]$'
+        'beginCaptures':
+          '0': 'name': 'support.asciidoc'
+        'end': '^\\s*$'
+        'patterns': [
+          {
+            'begin': '(^\\s*-{4,}\\s*$)'
+            'beginCaptures':
+              '0': 'name': 'support.asciidoc'
+            'end': '\\1'
+            'endCaptures':
+              '0': 'name': 'support.asciidoc'
+            'contentName': 'source.embedded.dockerfile'
+            'patterns': ['include': 'source.dockerfile']
+          }
+        ]
+      }
+
+      # Matches properties AsciiDoc code blocks
+      #
+      # Examples
+      #
+      #   [source,properties]
+      #   ----
+      #  ...
+      #   ----
+      {
+        'begin': '^\\[source,\\s*properties\\]$'
+        'beginCaptures':
+          '0': 'name': 'support.asciidoc'
+        'end': '^\\s*$'
+        'patterns': [
+          {
+            'begin': '(^\\s*-{4,}\\s*$)'
+            'beginCaptures':
+              '0': 'name': 'support.asciidoc'
+            'end': '\\1'
+            'endCaptures':
+              '0': 'name': 'support.asciidoc'
+            'contentName': 'source.embedded.git-config'
+            'patterns': ['include': 'source.git-config']
+          }
+        ]
+      }
+
+      # Matches Makefile AsciiDoc code blocks
+      #
+      # Examples
+      #
+      #   [source,makefile]
+      #   ----
+      #  ...
+      #   ----
+      {
+        'begin': '^\\[source,\\s*(makefile|make)\\]$'
+        'beginCaptures':
+          '0': 'name': 'support.asciidoc'
+        'end': '^\\s*$'
+        'patterns': [
+          {
+            'begin': '(^\\s*-{4,}\\s*$)'
+            'beginCaptures':
+              '0': 'name': 'support.asciidoc'
+            'end': '\\1'
+            'endCaptures':
+              '0': 'name': 'support.asciidoc'
+            'contentName': 'source.embedded.makefile'
+            'patterns': ['include': 'source.makefile']
+          }
+        ]
+      }
+
+      # Matches Perl AsciiDoc code blocks
+      #
+      # Examples
+      #
+      #   [source,perl]
+      #   ----
+      #  ...
+      #   ----
+      {
+        'begin': '^\\[source,\\s*perl\\]$'
+        'beginCaptures':
+          '0': 'name': 'support.asciidoc'
+        'end': '^\\s*$'
+        'patterns': [
+          {
+            'begin': '(^\\s*-{4,}\\s*$)'
+            'beginCaptures':
+              '0': 'name': 'support.asciidoc'
+            'end': '\\1'
+            'endCaptures':
+              '0': 'name': 'support.asciidoc'
+            'contentName': 'source.embedded.perl'
+            'patterns': ['include': 'source.perl']
+          }
+        ]
+      }
+
+      # Matches Perl6 AsciiDoc code blocks
+      #
+      # Examples
+      #
+      #   [source,perl6]
+      #   ----
+      #  ...
+      #   ----
+      {
+        'begin': '^\\[source,\\s*perl6\\]$'
+        'beginCaptures':
+          '0': 'name': 'support.asciidoc'
+        'end': '^\\s*$'
+        'patterns': [
+          {
+            'begin': '(^\\s*-{4,}\\s*$)'
+            'beginCaptures':
+              '0': 'name': 'support.asciidoc'
+            'end': '\\1'
+            'endCaptures':
+              '0': 'name': 'support.asciidoc'
+            'contentName': 'source.embedded.perl6'
+            'patterns': ['include': 'source.perl6']
+          }
+        ]
+      }
+
+      # Matches Toml AsciiDoc code blocks
+      #
+      # Examples
+      #
+      #   [source,toml]
+      #   ----
+      #  ...
+      #   ----
+      {
+        'begin': '^\\[source,\\s*toml\\]$'
+        'beginCaptures':
+          '0': 'name': 'support.asciidoc'
+        'end': '^\\s*$'
+        'patterns': [
+          {
+            'begin': '(^\\s*-{4,}\\s*$)'
+            'beginCaptures':
+              '0': 'name': 'support.asciidoc'
+            'end': '\\1'
+            'endCaptures':
+              '0': 'name': 'support.asciidoc'
+            'contentName': 'source.embedded.toml'
+            'patterns': ['include': 'source.toml']
+          }
+        ]
+      }
+
       # Matches Erlang AsciiDoc code blocks
       #
       # Examples
@@ -799,7 +962,7 @@
             'end': '\\1'
             'endCaptures':
               '0': 'name': 'support.asciidoc'
-            'contentName': 'source.erlang'
+            'contentName': 'source.embedded.erlang'
             'patterns': ['include': 'source.erlang']
           }
         ]
@@ -826,7 +989,7 @@
             'end': '\\1'
             'endCaptures':
               '0': 'name': 'support.asciidoc'
-            'contentName': 'source.cs'
+            'contentName': 'source.embedded.cs'
             'patterns': ['include': 'source.cs']
           }
         ]
@@ -853,7 +1016,7 @@
             'end': '\\1'
             'endCaptures':
               '0': 'name': 'support.asciidoc'
-            'contentName': 'source.php'
+            'contentName': 'source.embedded.php'
             'patterns': ['include': 'source.php']
           }
         ]
@@ -880,7 +1043,7 @@
             'end': '\\1'
             'endCaptures':
               '0': 'name': 'support.asciidoc'
-            'contentName': 'source.shell'
+            'contentName': 'source.embedded.shell'
             'patterns': ['include': 'source.shell']
           }
         ]
@@ -907,7 +1070,7 @@
             'end': '\\1'
             'endCaptures':
               '0': 'name': 'support.asciidoc'
-            'contentName': 'source.python'
+            'contentName': 'source.embedded.python'
             'patterns': ['include': 'source.python']
           }
         ]
@@ -934,7 +1097,7 @@
             'end': '\\1'
             'endCaptures':
               '0': 'name': 'support.asciidoc'
-            'contentName': 'source.c'
+            'contentName': 'source.embedded.c'
             'patterns': ['include': 'source.c']
           }
         ]
@@ -961,7 +1124,7 @@
             'end': '\\1'
             'endCaptures':
               '0': 'name': 'support.asciidoc'
-            'contentName': 'source.cpp'
+            'contentName': 'source.embedded.cpp'
             'patterns': ['include': 'source.cpp']
           }
         ]
@@ -988,7 +1151,7 @@
             'end': '\\1'
             'endCaptures':
               '0': 'name': 'support.asciidoc'
-            'contentName': 'source.objc'
+            'contentName': 'source.embedded.objc'
             'patterns': ['include': 'source.objc']
           }
         ]
@@ -1015,7 +1178,7 @@
             'end': '\\1'
             'endCaptures':
               '0': 'name': 'support.asciidoc'
-            'contentName': 'source.swift'
+            'contentName': 'source.embedded.swift'
             'patterns': ['include': 'source.swift']
           }
         ]
@@ -1042,7 +1205,7 @@
             'end': '\\1'
             'endCaptures':
               '0': 'name': 'support.asciidoc'
-            'contentName': 'text.html.basic'
+            'contentName': 'text.embedded.html.basic'
             'patterns': ['include': 'text.html.basic']
           }
         ]
@@ -1069,7 +1232,7 @@
             'end': '\\1'
             'endCaptures':
               '0': 'name': 'support.asciidoc'
-            'contentName': 'source.elixir'
+            'contentName': 'source.embedded.elixir'
             'patterns': ['include': 'source.elixir']
           }
         ]
@@ -1096,7 +1259,7 @@
             'end': '\\1'
             'endCaptures':
               '0': 'name': 'support.asciidoc'
-            'contentName': 'source.diff'
+            'contentName': 'source.embedded.diff'
             'patterns': ['include': 'source.diff']
           }
         ]
@@ -1123,7 +1286,7 @@
             'end': '\\1'
             'endCaptures':
               '0': 'name': 'support.asciidoc'
-            'contentName': 'source.julia'
+            'contentName': 'source.embedded.julia'
             'patterns': ['include': 'source.julia']
           }
         ]
@@ -1150,7 +1313,7 @@
             'end': '\\1'
             'endCaptures':
               '0': 'name': 'support.asciidoc'
-            'contentName': 'source.r'
+            'contentName': 'source.embedded.r'
             'patterns': ['include': 'source.r']
           }
         ]
@@ -1177,7 +1340,7 @@
             'end': '\\1'
             'endCaptures':
               '0': 'name': 'support.asciidoc'
-            'contentName': 'source.haskell'
+            'contentName': 'source.embedded.haskell'
             'patterns': ['include': 'source.haskell']
           }
         ]
@@ -1204,7 +1367,7 @@
             'end': '\\1'
             'endCaptures':
               '0': 'name': 'support.asciidoc'
-            'contentName': 'source.elm'
+            'contentName': 'source.embedded.elm'
             'patterns': ['include': 'source.elm']
           }
         ]
@@ -1231,7 +1394,7 @@
             'end': '\\1'
             'endCaptures':
               '0': 'name': 'support.asciidoc'
-            'contentName': 'source.sql'
+            'contentName': 'source.embedded.sql'
             'patterns': ['include': 'source.sql']
           }
         ]
@@ -1258,7 +1421,7 @@
             'end': '\\1'
             'endCaptures':
               '0': 'name': 'support.asciidoc'
-            'contentName': 'source.clojure'
+            'contentName': 'source.embedded.clojure'
             'patterns': ['include': 'source.clojure']
           }
         ]
@@ -1496,6 +1659,108 @@
         'patterns': ['include': 'source.rust']
       }

+      # Matches Dockerfile Markdown-style code blocks
+      #
+      # Examples
+      #
+      #   ```dockerfile
+      #   ...
+      #   ```
+      {
+        'begin': '^`{3,}\\s*(docker(file))\\s*$'
+        'beginCaptures':
+          '0': 'name': 'support.asciidoc'
+        'end': '^`{3,}$'
+        'endCaptures':
+          '0': 'name': 'support.asciidoc'
+        'patterns': ['include': 'source.dockerfile']
+      }
+
+      # Matches properties Markdown-style code blocks
+      #
+      # Examples
+      #
+      #   ```properties
+      #   ...
+      #   ```
+      {
+        'begin': '^`{3,}\\s*properties\\s*$'
+        'beginCaptures':
+          '0': 'name': 'support.asciidoc'
+        'end': '^`{3,}$'
+        'endCaptures':
+          '0': 'name': 'support.asciidoc'
+        'patterns': ['include': 'source.git-config']
+      }
+
+      # Matches Makefile Markdown-style code blocks
+      #
+      # Examples
+      #
+      #   ```makefile
+      #   ...
+      #   ```
+      {
+        'begin': '^`{3,}\\s*(makefile|make)\\s*$'
+        'beginCaptures':
+          '0': 'name': 'support.asciidoc'
+        'end': '^`{3,}$'
+        'endCaptures':
+          '0': 'name': 'support.asciidoc'
+        'patterns': ['include': 'source.makefile']
+      }
+
+      # Matches Perl Markdown-style code blocks
+      #
+      # Examples
+      #
+      #   ```perl
+      #   ...
+      #   ```
+      {
+        'begin': '^`{3,}\\s*perl\\s*$'
+        'beginCaptures':
+          '0': 'name': 'support.asciidoc'
+        'end': '^`{3,}$'
+        'endCaptures':
+          '0': 'name': 'support.asciidoc'
+        'patterns': ['include': 'source.perl']
+      }
+
+      # Matches Perl6 Markdown-style code blocks
+      #
+      # Examples
+      #
+      #   ```perl6
+      #   ...
+      #   ```
+      {
+        'begin': '^`{3,}\\s*perl6\\s*$'
+        'beginCaptures':
+          '0': 'name': 'support.asciidoc'
+        'end': '^`{3,}$'
+        'endCaptures':
+          '0': 'name': 'support.asciidoc'
+        'patterns': ['include': 'source.perl6']
+      }
+
+      # Matches Toml Markdown-style code blocks
+      #
+      # Examples
+      #
+      #   ```toml
+      #   ...
+      #   ```
+      {
+        'begin': '^`{3,}\\s*toml\\s*$'
+        'beginCaptures':
+          '0': 'name': 'support.asciidoc'
+        'end': '^`{3,}$'
+        'endCaptures':
+          '0': 'name': 'support.asciidoc'
+        'patterns': ['include': 'source.toml']
+      }
+
       # Matches Erlang Markdown-style code blocks
       #
       # Examples


make the delete button look like a link

make the delete button look like a link

--- src/components/task-plan/reading.cjsx
+++ src/components/task-plan/reading.cjsx
@@ -115,7 +115,7 @@
     classes.push('disabled') unless @props.enabled
     classes = classes.join(' ')

-    deleteLink = <BS.Button bsStyle="danger" onClick={@props.onDelete}>Delete</BS.Button> if @props.enabled
+    deleteLink = <BS.Button bsStyle="link" onClick={@props.onDelete}>Delete</BS.Button> if @props.enabled

     <span>
       <BS.Button bsStyle="primary" className={classes} onClick={@props.onPublish}>Publish</BS.Button>


Change requestAnimationFrame precedence

Change requestAnimationFrame precedence

Try to use requestAnimationFrame before looking at the vendor prefix variants.

Fixes this warning in Chrome:

> 'webkitRequestAnimationFrame' is vendor-specific. Please use the standard 'requestAnimationFrame' instead.

--- src/core/util.coffee
+++ src/core/util.coffee
@@ -136,15 +136,15 @@
         s4() + s4() + s4())

   requestAnimationFrame: (f) ->
+    return window.requestAnimationFrame(f) if window.requestAnimationFrame
     return window.webkitRequestAnimationFrame(f) if window.webkitRequestAnimationFrame
-    return window.requestAnimationFrame(f) if window.requestAnimationFrame
     return window.mozRequestAnimationFrame(f) if window.mozRequestAnimationFrame
     return setTimeout(f, 0)

   cancelAnimationFrame: (f) ->
+    return window.cancelAnimationFrame(f) if window.cancelAnimationFrame
     return window.webkitCancelRequestAnimationFrame(f) if window.webkitCancelRequestAnimationFrame
     return window.webkitCancelAnimationFrame(f) if window.webkitCancelAnimationFrame
-    return window.cancelAnimationFrame(f) if window.cancelAnimationFrame
     return window.mozCancelAnimationFrame(f) if window.mozCancelAnimationFrame
     return clearTimeout(f)


Initialize next-track/next-artist from the current ones

--- assets/front.coffee
+++ assets/front.coffee
@@ -240,9 +240,8 @@
     console.log("InGetJSON")
     console.log(segments)
     for segment in segments
-      document.getElementById('artist').innerHTML = segment.tracks[0].metadata.artist
-      # document.getElementById('title').innerHTML = segment.tracks[0].metadata.title
-      window._next_artist = window._next_title = ""
+      document.getElementById('artist').innerHTML = window._next_artist = segment.tracks[0].metadata.artist
+      # document.getElementById('title').innerHTML = window._next_title = segment.tracks[0].metadata.title
       window._track_id = segment.tracks[0].metadata.id
       console.log("Segment")
       console.log(segment)


Modified in browser at pixie.strd6.com

Modified in browser at pixie.strd6.com

--- src/engine_clear.coffee
+++ src/engine_clear.coffee
@@ -18,7 +18,7 @@

   self.bind "init", ->
     if I.background?.isString?()
-      I.background =
+      I.background = Sprite.loadByName I.background

   self.bind "beforeDraw", ->
     if I.clear


Remove old file

Remove old file

--- gulp/tasks/copy.coffee
+++ gulp/tasks/copy.coffee
@@ -1,11 +0,0 @@
-gulp   = require("gulp")
-config = require("../config")
-$      = config.plugins
-
-gulp.task("copy", ["copy:font"])
-
-gulp.task "copy:font", ->
-  gulp.src(config.src.fonts)
-  .pipe($.plumber())
-  .pipe($.flatten())
-  .pipe(gulp.dest(config.dist.fonts))


Update comment.

Update comment.

--- src/default-directory-searcher.coffee
+++ src/default-directory-searcher.coffee
@@ -76,7 +76,7 @@
   #   * `follow` {boolean} whether symlinks should be followed.
   #
   # Returns a *thenable* `DirectorySearch` that includes a `cancel()` method. If `cancel()` is
-  # invoked before the `DirectorySearch` is determined, it will reject the `DirectorySearch`.
+  # invoked before the `DirectorySearch` is determined, it will resolve the `DirectorySearch`.
   search: (directories, regex, options) ->
     rootPaths = directories.map (directory) -> directory.getPath()
     isCancelled = false


Switching tax to abstract

Switching tax to abstract

--- src/features/tax.coffee
+++ src/features/tax.coffee
@@ -1,21 +1,3 @@
-	class Tax
+	class Tax extends Abstract

-		constructor: (@m) ->
-
-		Get: (callback, error) ->
-
-			return @m.Request 'taxes/'+id, 'GET', null, callback, error
-
-		Find: (terms, callback, error) ->
-
-			return @m.Request 'taxes', 'GET', terms, callback, error
-
-		List: (terms, callback, error) ->
-
-			return @m.Request 'taxes', 'GET', terms, callback, error
-
-		Fields: (id = 0, callback, error) ->
-
-			uri  = 'taxes/'+ if id != 0 then id+'/fields' else 'fields'
-
-			return @m.Request uri, 'GET', null, callback, error
+		endpoint: 'taxes'


support asyncxmls new add event behavior properly

--- src/dt-jquery.coffee
+++ src/dt-jquery.coffee
@@ -14,22 +14,29 @@
         @_jquery_delay.push(job)

+# invoke all delayed jquery work
+release = () ->
+    if @_jquery_delay?
+        for job in @_jquery_delay
+            do job
+        delete @_jquery_delay
+
+
 jqueryify = (tpl) ->
-    tpl.xml._jquery = $()
+
+    tpl.on 'add', (parent, el) ->
+        # insert into parent
+        delay.call parent, ->
+            if parent is tpl.xml
+                parent._jquery = parent._jquery.add(el._jquery)
+#                 parent._jquery.data('dt-jquery', parent)
+            else
+                parent._jquery.append(el._jquery)

     tpl.on 'close', (el) ->
-        el._jquery = $(el.toString())
-        # invoke all delayed jquery work
-        if el._jquery_delay?
-            for job in el._jquery_delay
-                do job
-            delete el._jquery_delay
-        # insert into parent
-        delay.call el.parent, ->
-            if el.parent is tpl.xml
-                el.parent._jquery = el.parent._jquery.add(el._jquery)
-            else
-                el.parent._jquery.append(el._jquery)
+        el._jquery ?= $(el.toString())
+#         el._jquery.data('dt-jquery', el)
+        release.call el

         el.on 'newListener', (type) ->
             return if el._events?[type]?.length # dont bind two times for the same type
@@ -57,7 +64,11 @@
         el._jquery?.remove()

     tpl.on 'end', ->
+        tpl.xml._jquery = $()
+#         tpl.xl._jquery.data('dt-jquery', tpl.xml)
+        release.call tpl.xml
         tpl.jquery = tpl.xml._jquery
+#         tpl.jquery.data('dt-jquery', tpl)

     old_query = tpl.xml.query
     tpl.xml.query = (type, tag, key) ->


Add HTTPS support

Add HTTPS support

--- siteshot.coffee
+++ siteshot.coffee
@@ -26,7 +26,7 @@
           routes = _.flatten(_.pluck result.urlset.url, 'loc')

           # Async page loading
-          phantom.create (ph) =>
+          phantom.create '--ignore-ssl-errors=yes', '--ssl-protocol=any', (ph) =>
             # Load each route in headless server webkit
             pageLoad = (route, callback) =>
               ph.createPage (page) =>


Added Options, with Manifest Support

Added Options, with Manifest Support

Options now work, and override manifest options of the same names.

--- bin/kdc-plus.coffee
+++ bin/kdc-plus.coffee
@@ -19,10 +19,11 @@
   # Define our opts
   opts.version '@@version'
   opts.usage '[options] <kdapp directory>'
+  opts.option '-p, --pipe', 'Pipe to STDOUT instead of to a file'
+  opts.option '-f, --file <file>', 'Choose the output file'
+  opts.option '--no-coffee', 'No coffee-script support'
+  opts.option '-c, --commonjs', 'Support commonjs'
   opts.parse argv
-
-  #Hack for now
-  opts.coffee ?= true

   [appPath, unhandledArgs] = opts.args

@@ -42,6 +43,35 @@
     if err?
       log "Error Loading Manifest: #{err.message}"
       return process.exit 1
+
+    # ## CLI & Manifest Defaults
+    # Now that we have a manifest loaded, assign our defaults, letting the
+    # CLI opts override everything.
+
+    # If they declared pipe and file, warn that file is ignored.
+    if opts.file? and opts.pipe
+      log 'Warning: --pipe and --file are both defined, file will be ignored.'
+
+    # Since pipe desn't make sense as a manifest option, lets warn it.
+    if manifest.pipe is true
+      log 'Warning: "pipe" is not supported in the manifest'
+
+    if opts.file? or manifest.file?
+      opts.file = opts.file ? manifest.file
+    else
+      opts.file = 'index.js'
+
+    if opts.commonjs? or manifest.commonjs?
+      opts.commonjs = opts.commonjs ? manifest.commonjs
+    else
+      opts.commonjs = false
+
+    # Remember, coffee defaults to on. So we allow the option of turning it off
+    if opts.coffee is false
+      opts.coffee = opts.coffee
+    else if manifest.coffee is false
+      opts.coffee = manifest.coffee
+

     if vwarns? then log warning for warning in vwarns
     if vfails?
@@ -67,15 +97,22 @@
       log "Error Compiling KDApp: #{err.message}"
       process.exit 1

-    destination = fs.createWriteStream path.join appPath, 'index.js'
-    destination.on 'error', (err) ->
+
+    # Now we finally pipe the output out of our program. We either pipe it to
+    # a file, or STDOUT (if defined)
+    if opts.pipe
+      out     = process.stdout
+    else
+      out     = fs.createWriteStream path.join appPath, opts.file
+
+    out.on 'error', (err) ->
       log "Error Saving Compiled KDApp: #{err.message}"
       process.exit 1

-    destination.on 'finish', ->
+    out.on 'finish', ->
       log "KDApp Compiled Successfully!"

-    loader.pipe destination
+    loader.pipe out


more readme updates

more readme updates

--- src/githubfollow.coffee
+++ src/githubfollow.coffee
@@ -5,7 +5,7 @@
 #   None outside node dependencies
 #
 # Configuration:
-#   You need to configure the GHF_KEY environement variable to a valid github Personal access tokens
+#   You need to configure the GHF_KEY environement variable with a valid github Personal access tokens
 #
 # Commands:
 #   hubot follow <githubrepo> - start to follow a github repository - eg. github/hubot


Move section numberizer into new Content helper

--- src/helpers/task.coffee
+++ src/helpers/task.coffee
@@ -19,98 +19,4 @@
   isDue: ({due_at}) ->
     moment(due_at).isBefore(TimeStore.getNow())

-  getHumanUnacceptedScore: (task) ->
-    score = Math.round((
-      task.correct_on_time_exercise_count / task.exercise_count
-      ) * 100 )
-    "#{score}%"
-
-  getHumanScoreWithLateWork: (task) ->
-    score = Math.round((
-      task.correct_exercise_count / task.exercise_count
-      ) * 100 )
-    "#{score}%"
-
-  getHumanUnacceptedProgress: (task) ->
-    progress = Math.round((
-      task.completed_on_time_exercise_count / task.exercise_count
-      ) * 100 )
-    "#{progress}%"
-
-  getHumanProgressWithLateWork: (task) ->
-    progress = Math.round((
-      task.completed_exercise_count / task.exercise_count
-      ) * 100 )
-    "#{progress}%"
-
-  getCompletedSteps: (task) ->
-    task.completed_on_time_step_count + task.completed_accepted_late_step_count
-
-  getCompletedPercent: (task) ->
-    if task.type is 'homework'
-      score = task.completed_on_time_exercise_count + task.completed_accepted_late_exercise_count
-      percent = Math.round( (score / task.exercise_count) * 100 )
-    else
-      score = task.completed_on_time_step_count + task.completed_accepted_late_step_count
-      percent = Math.round( (score / task.step_count) * 100 )
-
-  getScorePercent: (task) ->
-    if task.type is 'homework'
-      score = task.correct_on_time_exercise_count + task.correct_accepted_late_exercise_count
-      percent = Math.round( (score / task.exercise_count) * 100 )
-    else
-      score = task.correct_on_time_step_count + task.correct_accepted_late_step_count
-      percent = Math.round( (score / task.step_count) * 100 )
-
-  getScoreNumber: (task) ->
-    if task.type is 'homework'
-      score = task.correct_on_time_exercise_count + task.correct_accepted_late_exercise_count
-    else
-      score = task.correct_on_time_step_count + task.correct_accepted_late_step_count
-
-  hasAdditionalLateWork: (task) ->
-    task.completed_accepted_late_step_count and (
-      task.completed_step_count >  task.completed_on_time_step_count +
-        task.completed_accepted_late_step_count
-    )
-
-  isLateAccepted: (task) ->
-    task.is_late_work_accepted
-
-  # called by readings and homework UI to determine if there's late work
-  hasLateWork: (task) ->
-    @lateStepCount(task) > 0
-  lateStepCount: (task) ->
-    if task.type is 'homework'
-      task.completed_exercise_count - task.completed_on_time_exercise_count -
-        task.completed_accepted_late_exercise_count
-    else
-      task.completed_step_count - task.completed_on_time_step_count -
-        task.completed_accepted_late_step_count
-
-  getHumanProgress: (task) ->
-    complete = @getCompletedSteps(task)
-    "#{complete} of #{task.step_count}"
-
-  getHumanDueDate: (task) ->
-    task.due_at
-
-  getHumanCompletedPercent: (task) ->
-    "#{@getCompletedPercent(task)}%"
-
-  getHumanScorePercent: (task) ->
-    "#{@getScorePercent(task)}%"
-
-  getHumanScoreNumber: (task) ->
-    "#{@getScoreNumber(task)} of #{task.step_count}"
-
-  getHumanStatus: (task, options = {displayAs: 'number'}) ->
-    if options.displayAs is 'number'
-      @getHumanProgress(task)
-    else
-      @getHumanCompletedPercent(task)
-
-  isLate: (task) ->
-    task.completed_on_time_step_count < task.completed_step_count
-
 }


Add multi room support to talker, using multiple sockets as a room context.

--- src/hubot/talker.coffee
+++ src/hubot/talker.coffee
@@ -7,7 +7,7 @@
 class Talker extends Robot
   send: (user, strings...) ->
     strings.forEach (str) =>
-      @bot.write {"type": "message", "content": str}
+      @bot.write user.room, {"type": "message", "content": str}

   reply: (user, strings...) ->
     strings.forEach (str) =>
@@ -15,49 +15,50 @@

   run: ->
     self = @
-    options =
-      token:   process.env.HUBOT_TALKER_TOKEN
-      rooms:   process.env.HUBOT_TALKER_ROOMS
+    token = process.env.HUBOT_TALKER_TOKEN
+    rooms = process.env.HUBOT_TALKER_ROOMS.split(',')

-    console.log options
-    bot = new TalkerClient(options)
+    bot = new TalkerClient()
     console.log bot

-    bot.connect ->
-      options.rooms.split(',').forEach (room) ->
-        console.log "Entering room: " + room
-        bot.write {"room": room, "token": options.token, "type": "connect"}
+    ping = (room)->
+      setInterval ->
+        bot.write room, {type: "ping"}
+      , 25000

-      setInterval ->
-        bot.write {type: "ping"}
-      , 25000
+    bot.on "Ready", (room)->
+      message = {"room": room, "token": token, "type": "connect"}
+      bot.write room, message
+      ping room

     bot.on "Users", (message)->
       for user in message.users
         self.userForId(user.id, user)

-    bot.on "TextMessage", (message)->
-      console.log message
-
-      author = self.userForId(message.user.id, message.user)
+    bot.on "TextMessage", (room, message)->
+      content = message.content

       # Replace "@mention" with "mention: ", case-insensitively
       regexp = new RegExp("\\b@#{self.quoteRegex(self.name)}\\b", 'i')
       content = message.content.replace(regexp, "#{self.name}: ")

-      self.receive new Robot.TextMessage(author, content)
+      self.receive new Robot.TextMessage self.userForMessage(room, message), content

-    bot.on "EnterMessage", (message) ->
-      console.log message
-      author = self.userForId(message.user.id, message.user)
-      self.receive new Robot.EnterMessage(author)
+    bot.on "EnterMessage", (room, message) ->
+      self.receive new Robot.EnterMessage self.userForMessage(room, message)

-    bot.on "LeaveMessage", (message) ->
-      console.log message
-      author = self.userForId(message.user.id, message.user)
-      self.receive new Robot.LeaveMessage(author)
+    bot.on "LeaveMessage", (room, message) ->
+      self.receive new Robot.LeaveMessage self.userForMessage(room, message)
+
+    for room in rooms
+      bot.sockets[room] = bot.createSocket(room)

     @bot = bot
+
+  userForMessage: (room, message)->
+    author = @userForId(message.user.id, message.user)
+    author.room = room
+    author

   quoteRegex: (string) ->
     string.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&")
@@ -65,66 +66,61 @@
 module.exports = Talker

 class TalkerClient extends EventEmitter
-  constructor: (options) ->
-    @token         = options.token
-    @rooms         = options.rooms.split(",")
+  constructor: ->
     @domain        = 'talkerapp.com'
     @encoding      = 'utf8'
     @port          = 8500
+    @sockets       = {}

-  connect: (callback) ->
+  createSocket: (room) ->
     self = @

-    @socket = tls.connect @port, @domain, ->
-      # callback called only after successful socket socket
-      console.log "Connected to " + self.domain
-      self.socket.setEncoding @encoding
-      callback()
+    socket = tls.connect @port, @domain, ->
+      console.log("Connected to room #{room}.")
+      self.emit "Ready", room

     #callback
-    @socket.addListener 'data', (data) ->
+    socket.on 'data', (data) ->
       for line in data.split '\n'
-        console.log line
-
-        message = unless line is ''
-          message = JSON.parse(line)
-        else
-          message = null
+        message = if line is '' then null else JSON.parse(line)

         if message
-          if message.type == "connected"
-            self.emit "Connected"
+          console.log "From room #{room}: #{line}"
           if message.type == "users"
             self.emit "Users", message
           if message.type == "message"
-            self.emit "TextMessage", message
+            self.emit "TextMessage", room, message
           if message.type == "join"
-            self.emit "EnterMessage", message
+            self.emit "EnterMessage", room, message
           if message.type == "leave"
-            self.emit "LeaveMessage", message
+            self.emit "LeaveMessage", room, message
           if message.type == "error"
-            self.disconnect message.message
+            self.disconnect room, message.message

-
-    @socket.addListener "eof", ->
+    socket.addListener "eof", ->
       console.log "eof"
-    @socket.addListener "timeout", ->
+    socket.addListener "timeout", ->
       console.log "timeout"
-    @socket.addListener "end", ->
+    socket.addListener "end", ->
       console.log "end"

-  write: (arguments) ->
+    socket.setEncoding @encoding
+
+    socket
+
+  write: (room, arguments) ->
     self = @
+    @sockets[room]

-    if @socket.readyState != 'open'
-      return self.disconnect 'cannot send with readyState: ' + @socket.readyState
+    if @sockets[room].readyState != 'open'
+      return @disconnect 'cannot send with readyState: ' + @sockets[room].readyState

     message = JSON.stringify(arguments)
-    console.log message
+    console.log "To room #{room}: #{message}"

-    @socket.write message, @encoding
+    @sockets[room].write message, @encoding

-  disconnect: (why) ->
-    if @socket.readyState != 'closed'
-      @socket.close
+  disconnect: (room, why) ->
+    if @sockets[room] != 'closed'
+      @sockets[room]
       console.log 'disconnected (reason: ' + why + ')'


force logged-in users into inner for plans

--- js/app.coffee
+++ js/app.coffee
@@ -519,6 +519,10 @@
     mixpanel.track("View Privacy")
   @get "^/jobs.*", (cx) => VM.jobs.display(cx)
   @get "^/pricing.*", (cx) =>
+    # the pricing page has broken links if served from outer to a logged-in user;
+    # force them to inner.
+    if VM.current_user
+      return cx.redirect "/account/plans"
     VM.billing().loadPlans()
     VM.billing().loadPlanFeatures()
     VM.pricing.display(cx)


Modified in browser at pixie.strd6.com

Modified in browser at pixie.strd6.com

--- src/game_over.coffee
+++ src/game_over.coffee
@@ -4,6 +4,14 @@
 @see TextScreen
 @name GameOver
 @constructor
+###
+
+###*
+Transitions to the title state on user input.
+
+@name update
+@methodOf GameOver#
+@event
 ###

 ###*


better this way

better this way

--- library/nucleus/watch.coffee
+++ library/nucleus/watch.coffee
@@ -163,7 +163,7 @@
         message = "Zombies at #{relative.underline}"
         logger.warn message.grey if zombies is yes
         return yes if nconf.get "watch:force"
-        return yes unless zombies
+        return yes if _.isEmpty zombies

     # Given the freshly resolved module, require it and then run the
     # collector on it to find all services it may be defining. Then


Modal: Listen window resize to set positions.

--- src/lib/components/modal/Modal.coffee
+++ src/lib/components/modal/Modal.coffee
@@ -44,6 +44,9 @@
     @createButtons_ options.buttons

     @setPosition()
+
+    goog.events.listen window, 'resize', =>
+      @setPosition()

   ###*


Need to build again after adding files. Duh.

--- test/js-test.coffee
+++ test/js-test.coffee
@@ -17,6 +17,7 @@
       /* and is this */
       var thisExample = "Another great test";
       """
+    Initially (done) -> build(done)

     Then -> expect(@result).to.contain("Another great test")
     And -> expect(@result).not.to.contain("this is a comment")


fix some binary tests

fix some binary tests

--- tests/binary.coffee
+++ tests/binary.coffee
@@ -24,8 +24,8 @@
         binaryPath = "#{remoteConfig.path}/binary"

         fs.writeFile binaryPath, 'Hello', (err) ->
-            binary.checksum binaryPath, (err, res) ->
-                err.shoud.be.equal null
+            binary.checksum binaryPath, (err, checksum) ->
+                should.not.exist err
                 checksum.should.be.equal '9770e0f54128b5e501583979e126a71268d7b54e'
                 fs.unlink binaryPath, ->
                     done()
@@ -40,12 +40,11 @@
         touch binary1Path, (err, res) ->
             pouch.db.post doc, (err, res) ->
                 binary.moveFromDoc doc, binary2Path, (err) ->
-                    err.shoud.be.equal null
+                    should.not.exist err
                     fs.existsSync(binary2Path).should.be.true
                     fs.unlink binary2Path, ->
                         pouch.db.delete res.id, res.rev, ->
                             done()

-
     it "When I upload an attachment"


corrected incorrect identation

corrected incorrect identation

--- scripts/chat.coffee
+++ scripts/chat.coffee
@@ -64,7 +64,7 @@
 		isCmd = catchCmd txt
 		isJ = catchJ txt
 # 		if !_.size isCmd
-			if _.size isJ then jtalk dict[isJ], msg, robot else mtalk txt, msg, robot
+		if _.size isJ then jtalk dict[isJ], msg, robot else mtalk txt, msg, robot

 	# greeting for when new member enters the room
 	robot.enter (res) ->


Fix for new Google layout

Fix for new Google layout

They use div.g now instead of li.g but oddly still wrap with ol

--- scripts/docs.coffee
+++ scripts/docs.coffee
@@ -33,7 +33,7 @@
       .query(q: query)
       .get() (err, res, body) ->
         $ = cheerio.load body
-        result = $('li.g').first()
+        result = $('div.g').first()
         # Jump To Link ? Main Link
         url = result.find('.st .f a').attr('href') ? result.find('h3.r a').attr('href')
         callback url if callback


Fix typo in echo script

Fix typo in echo script

--- scripts/echo.coffee
+++ scripts/echo.coffee
@@ -16,5 +16,5 @@
         # text = text.replace /!/, ""
         # text = text.replace /superbestbot /, ""
         # msg.send text
-        msg.seng msg.message.text
+        msg.send msg.message.text


fixed toFixed color test bug

fixed toFixed color test bug

--- test/color.coffee
+++ test/color.coffee
@@ -203,13 +203,13 @@
     b: -> 0
     a: -> 1

-test "toHsl returns proper values", ->
+test "#toHsl", ->
   color = Color(123, 43, 98)
   hsl = color.toHsl()

   equals hsl[0], 319
-  equals hsl[1].toFixed(2), 0.48
-  equals hsl[2].toFixed(2), 0.33
+  equals hsl[1].toFixed(2), "0.48"
+  equals hsl[2].toFixed(2), "0.33"
   equals hsl[3], 1

 test "#hslToRgb", ->


disabling assets compression for now.

disabling assets compression for now.

--- app/app.coffee
+++ app/app.coffee
@@ -38,7 +38,7 @@
 if config.env_production
   log = fs.createWriteStream config.log_file, {flags: 'w'}
   app.use logger("combined", stream: log)
-  app.use assets_manager("buildDir": "#{__dirname}/../public/assets/", "paths": config.assets)
+  app.use assets_manager("buildDir": "public/assets/", "paths": config.assets, "compress": false)

 app.get '/', routes.index
 app.get '/get_uri', routes.get_uri


Ignore empty answers in agreements

Ignore empty answers in agreements

--- src/lib/analysis.coffee
+++ src/lib/analysis.coffee
@@ -207,13 +207,15 @@
 	for person_id, person of data.persons
 		paggs = []
 		for _, my_vote of my_votes
+			my_value = my_vote.vote_value
+			# Hack to force zero to ignore the question
+			continue if not my_value
 			vote_id = "#{my_vote.vote_event_id}/#{person_id}"
 			#other_vote = getOneWhere ests,
 			#	voter_id: person_id
 			#	vote_event_id: my_vote.vote_event_id
 			other_vote = ests[vote_id]
 			continue unless other_vote?
-			my_value = my_vote.vote_value
 			other_value = other_vote.vote_value
 			continue unless other_value == other_value
 			paggs.push my_value*other_value


:racehorse: Store ids on marker index interior nodes

Signed-off-by: Nathan Sobo <2e8aa918660411855c6d44d5bb2da677aa033255@github.com>

--- src/marker-index.coffee
+++ src/marker-index.coffee
@@ -5,9 +5,11 @@

 class Node
   constructor: (@children) ->
+    @ids = new Set
     @extent = Point.zero()
     for child in @children
       @extent = @extent.traverse(child.extent)
+      child.ids.forEach (id) => @ids.add(id)

   insert: (id, start, end) ->
     # Insert the given id into all children that intersect the given range.
@@ -42,8 +44,12 @@
     if @children.length > BRANCHING_FACTOR
       splitIndex = Math.ceil(@children.length / BRANCHING_FACTOR)
       [new Node(@children.slice(0, splitIndex)), new Node(@children.slice(splitIndex))]
+    else
+      @ids.add(id)
+      return

   getStart: (id) ->
+    return unless @ids.has(id)
     childStart = Point.zero()
     for child in @children
       if startRelativeToChild = child.getStart(id)
@@ -52,6 +58,7 @@
     return

   getEnd: (id) ->
+    return unless @ids.has(id)
     childStart = Point.zero()
     for child in @children
       if endRelativeToChild = child.getEnd(id)
@@ -74,8 +81,13 @@
     indent = ""
     indent += " " for i in [0...indentLevel] by 1

+    ids = []
+    values = @ids.values()
+    until (next = values.next()).done
+      ids.push(next.value)
+
     """
-      #{indent}Node #{@extent}
+      #{indent}Node #{@extent} (#{ids.join(" ")})
       #{@children.map((c) -> c.toString(indentLevel + 2)).join("\n")}
     """


Clone menu items before merging them in in menu-helpers

--- src/menu-helpers.coffee
+++ src/menu-helpers.coffee
@@ -4,6 +4,7 @@

 merge = (menu, item, itemSpecificity=Infinity) ->
   ItemSpecificities.set(item, itemSpecificity) if itemSpecificity
+  item = cloneMenuItem(item)
   matchingItemIndex = findMatchingItemIndex(menu, item)
   matchingItem = menu[matchingItemIndex] unless matchingItemIndex is - 1


Don't modify passed in item

Don't modify passed in item

Perform a deep clone before iterating over to add items and submenus.

--- src/menu-manager.coffee
+++ src/menu-manager.coffee
@@ -42,6 +42,7 @@
   # Private: Merges an item in a submenu aware way such that new items are always
   # appended to the bottom of existing menus where possible.
   merge: (menu, item) ->
+    item = _.deepClone(item)
     if item.submenu? and match = _.find(menu, (o) -> o.submenu? and o.label == item.label)
       @merge(match.submenu, i) for i in item.submenu
     else


Make AutoVar work on server with Meteor.bindEnvironment

--- autovar.coffee
+++ autovar.coffee
@@ -47,8 +47,9 @@
         if Tracker.active then Tracker.onInvalidate => @stop()

         @_valueComp = null
-        if @onChange? then Tracker.afterFlush =>
-            if not @_valueComp? then @_setupValueComp()
+        if @onChange? then Tracker.afterFlush Meteor.bindEnvironment =>
+            if not @_valueComp?
+                @_setupValueComp()

         @_arrIndexOfDeps = {} # value: dep

@@ -64,6 +65,7 @@

     _recompute: ->
         oldValue = Tracker.nonreactive => @_deepGet()
+
         rawValue = @valueFunc.call null
         newValue =
             if @wrap and rawValue not in [@constructor._UNDEFINED, @constructor._UNDEFINED_WITHOUT_SET]
@@ -102,22 +104,24 @@
                     @_arrIndexOfDeps[i]?.changed()

-        unless @equalsFunc oldValue, newValue
-            if _.isFunction @onChange then Tracker.afterFlush =>
-                @onChange.call @, oldValue, newValue
+        if _.isFunction @onChange
+             if not @equalsFunc oldValue, newValue
+                Tracker.afterFlush Meteor.bindEnvironment =>
+                    @onChange.call @, oldValue, newValue

     _setupValueComp: ->
         @_valueComp?.stop()
-        @_valueComp = Tracker.nonreactive => Tracker.autorun (valueComp) =>
-            pos = @constructor._pending.indexOf @
-            if pos >= 0
-                @constructor._pending.splice pos, 1
+        @_valueComp = Tracker.nonreactive =>
+            Tracker.autorun Meteor.bindEnvironment (valueComp) =>
+                pos = @constructor._pending.indexOf @
+                if pos >= 0
+                    @constructor._pending.splice pos, 1

-            @_recompute()
-            valueComp.onInvalidate =>
-                unless valueComp.stopped
-                    if @ not in @constructor._pending
-                        @constructor._pending.push @
+                @_recompute()
+                valueComp.onInvalidate =>
+                    unless valueComp.stopped
+                        if @ not in @constructor._pending
+                            @constructor._pending.push @

     contains: (x) ->
         # Reactive
@@ -156,6 +160,8 @@
     set: ->
         throw new Meteor.Error "There is no AutoVar.set"

+    setDebug: (@debug) ->
+
     stop: ->
         if @active
             @active = false


model: escape serialization string closing script tag

--- src/models/index.coffee
+++ src/models/index.coffee
@@ -52,8 +52,8 @@
   getSerializationStream: =>
     @exoid.getCacheStream()
     .map (exoidCache) ->
-      string = JSON.stringify {
+      string = JSON.stringify({
         exoid: exoidCache
         expires: Date.now() + SERIALIZATION_EXPIRE_TIME_MS
-      }
+      }).replace /<\/script/gi, '<\\/script'
       "window['#{SERIALIZATION_KEY}']=#{string};"


Move debug property into cache object

Move debug property into cache object

--- src/module-cache.coffee
+++ src/module-cache.coffee
@@ -6,6 +6,7 @@
 nativeModules = process.binding('natives')

 cache =
+  debug: true
   dependencies: {}
   folders: {}
   ranges: {}
@@ -101,22 +102,21 @@

   undefined

-debug = false
-if debug
-  global.loadCount = 0
-  global.requireTime = 0
+if cache.debug
+  cache.loadCount = 0
+  cache.requireTime = 0
   global.moduleCache = cache

   originalLoad = Module::load
   Module::load = ->
-    global.loadCount++
+    cache.loadCount++
     originalLoad.apply(this, arguments)

   originalRequire = Module::require
   Module::require = ->
     startTime = Date.now()
     exports = originalRequire.apply(this, arguments)
-    global.requireTime += Date.now() - startTime
+    cache.requireTime += Date.now() - startTime
     exports

 exports.create = (modulePath) ->


Closing the dialog restores selection. Fixes #124

--- src/plugins/link.coffee
+++ src/plugins/link.coffee
@@ -102,6 +102,7 @@
           dialog.dialog('open')

           dialog.on 'dialogclose', ->
+            widget.options.editable.restoreSelection widget.lastSelection
             jQuery('label', buttonHolder).removeClass 'ui-state-active'
             do widget.options.editable.element.focus
             widget.options.editable.keepActivated false


Fix help output

Fix help output

--- src/scripts/auth.coffee
+++ src/scripts/auth.coffee
@@ -1,20 +1,21 @@
 # Auth allows you to assign roles to users which can be used by other scripts to restrict access to Hubot commands
-#
-# Environment variables:
-#   HUBOT_AUTH_ADMIN   - the user(s) who can assign roles to other users, comma-separated
-#
-# Use in your script
-#   - Call the method: robot.Auth.hasRole('<user>','<role>')
-#   - returns bool true or false
-#
-# Notes:
-#   - the 'admin' role can only be assigned through the environment variable
-#   - roles are all transformed to lower case
 #
 # <user> has <role> role - Assigns a role to a user
 # <user> doesn't have <role> role - Removes a role from a user
 # what role does <user> have - Find out what roles are assigned to a specific user
 # who has admin role - Find out who's an admin and can assign roles
+#
+# Environment variables:
+#   * HUBOT_AUTH_ADMIN
+#
+# Use in your script:
+#   * Call the method: robot.Auth.hasRole('<user>','<role>')
+#   * returns bool true or false
+#
+# Notes:
+#   * the 'admin' role can only be assigned through the environment variable
+#   * roles are all transformed to lower case
+#

 # hubot alex has role op

@@ -76,4 +77,4 @@
     msg.reply "#{name} has the following roles: " + user.roles + isAdmin + "."

   robot.respond /who has admin role\?*$/i, (msg) ->
-    msg.reply "The following people have the 'admin' role: #{admin.split(',')}"+    msg.reply "The following people have the 'admin' role: #{admin.split(',')}"


fix inline examples for commands

fix inline examples for commands

--- app/markdown.coffee
+++ app/markdown.coffee
@@ -35,7 +35,7 @@

     nested_context = @state.ctx.create_nested_context()
     value = @props.value
-    nested_context.apply_to -> @scoped_eval CoffeeScript.compile value
+    nested_context.apply_to -> Context.run_in_context @, -> @scoped_eval CoffeeScript.compile value, {bare: true}
     React.DOM.div {className: 'inline-example'}, example_component, nested_context.component

 LeadMarkdownComponent = React.createClass


Assert lock after emptying queue of operations.

--- test/queue.coffee
+++ test/queue.coffee
@@ -14,7 +14,7 @@

   afterEach teardown

-  it 'queues consecutive operations when they are not commited', calls 4, (done) -> @create =>
+  it 'queues consecutive operations when they are not commited', calls 3, (done) -> @create =>
     @createDoc @docName2
     client = @testClient.client

@@ -24,16 +24,14 @@
     # client is informed that 'Op already submitted'.
     @testClient.client.submit @cName, @docName, {v:1, op:['s1A'], seq:1, src: 'A', redisSubmitDelay: 50}, (err) ->
       throw new Error err if err
-      setTimeout ->
-        # Assert that lock is cleaned once all operations are successfully submitted.
-        assert.deepEqual client.submitMap, {}
-        done()
-      , 50
       done()

     @testClient.client.submit @cName, @docName2, {v:1, op:['s2A'], seq:2, src: 'A', redisSubmitDelay: 10}, (err) ->
       throw new Error err if err
-      done()
+      # Assert that lock is cleaned once all operations are successfully submitted.
+      process.nextTick ->
+        assert.deepEqual client.submitMap, {}
+        done()

     @testClient.client.submit @cName, @docName, {v:1, op:['s1B'], seq:1, src: 'B'}, (err) ->
       throw new Error err if err


讓捲動提示的箭頭在不需要時自動消失, resolves #4

讓捲動提示的箭頭在不需要時自動消失, resolves #4

--- source/js/styles/structures/_default_main.coffee
+++ source/js/styles/structures/_default_main.coffee
@@ -5,6 +5,7 @@

   if $v.width()*$v.length < $(window).width()
     $('.main').addClass('mini')
+    $('body .main .scrolling-hint').css 'display', 'none'
   else
     $('.main').prepend \
       '
a
'


Issue #680. @::prop versus this::prop, fixed lexing regex.


fix redirection when already connected to trello

--- src-public/login/states/trello/controller.coffee
+++ src-public/login/states/trello/controller.coffee
@@ -8,7 +8,7 @@
   NotSoShittyUser
   localStorageService
 ) ->
-  if $auth.isAuthenticated()
+  if localStorageService.get 'trello_token'
     $state.go 'tab.project'
   $scope.login = ->
     TrelloClient.authenticate()


fix mycozycloud/cozy-home#63

fix mycozycloud/cozy-home#63

--- public/login.coffee
+++ public/login.coffee
@@ -88,7 +88,7 @@
     $('#password-input').focus()

     $('#forgot-password').click (event) ->
-        client.post "login/forgot", {},
+        client.post "/login/forgot", {},
             success: ->
                 $('.alert-error').fadeOut()
                 $('.alert-success').fadeIn()


Fix inbox pagination (#4764)

Fix inbox pagination (#4764)

Always pass a page param when requesting conversations from the API.
Add the onPageChange handler to the paginator.

--- app/talk/inbox.cjsx
+++ app/talk/inbox.cjsx
@@ -76,11 +76,11 @@
     conversations: []

   componentWillMount: ->
-    @setConversations @props.user
+    @setConversations @props.user, @props.location.query.page

   componentWillReceiveProps: (nextProps) ->
     unless nextProps.user is @props.user
-      @setConversations(nextProps.user)
+      @setConversations(nextProps.user, @props.location.query.page)
     unless nextProps.location.query.page is @props.location.query.page
       @setConversations(nextProps.user, nextProps.location.query.page)

@@ -89,7 +89,7 @@
     conversationsQuery =
       user_id: user.id
       page_size: PAGE_SIZE
-      page: @props.location.query.page
+      page: page
       sort: '-updated_at'
       include: 'users'

@@ -128,7 +128,9 @@
               }
               <Paginator
                 page={+conversationsMeta.page}
-                pageCount={+conversationsMeta.page_count} />
+                pageCount={+conversationsMeta.page_count}
+                onPageChange={@onPageChange}
+              />
             </div>}

           <div>


GLRay: Fail pick_object when distance is NaN. Disable near_plane change.

--- engine/glray.coffee
+++ engine/glray.coffee
@@ -168,6 +168,9 @@
         # we do this instead of just passing depth to use the current camera position
         # TODO: move this out of this function to perform it only when it's used?
         distance = vec3.distance(point, cam.position)
+        # I don't know why does this happen
+        if isNaN distance
+            return null
         return {object, point, distance, normal: vec3.clone(point)}

     do_step: ->
@@ -183,13 +186,13 @@
         if @step == 0
             if @context._HMD
                 return
-            # Change the far plane when it's too near
-            if @pick_object(0.5,0.5)?.distance < 0.01
-                old_near = camera.near_plane
-                camera.near_plane = 0.00001
-                camera.recalculate_projection()
-                camera.near_plane = old_near
-                restore_near = true
+            # # Change the far plane when it's too near
+            # if @pick_object(0.5,0.5)?.distance < 0.01
+            #     old_near = camera.near_plane
+            #     camera.near_plane = 0.00001
+            #     camera.recalculate_projection()
+            #     camera.near_plane = old_near
+            #     restore_near = true
             gl.clearColor(1, 1, 1, 1)
             gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT)
             mat4.copy(world2cam, @context.render_manager._world2cam)


fix whitespaces of generated closure code in testcases

--- test/Transpiler.php5.coffee
+++ test/Transpiler.php5.coffee
@@ -68,7 +68,7 @@

 			expect: [[
 				'inject line',
-				'{',
+				'{',
 				[
 					['echo \'\';'],
 					['echo \'\';'],
@@ -96,7 +96,7 @@
 				]
 			]]

-			expect: 	[[ 'call_user_func(function($context) use ($data) {',
+			expect: 	[[ 'call_user_func(function ($context) use ($data) {',
 				[ [ 'echo htmlspecialchars(\'Hello \'), htmlspecialchars($data->user), htmlspecialchars(\'!\n\');' ] ],
 			'}, $data->x);' ] ],

@@ -317,14 +317,14 @@
 					]]
 				]]
 			]
-
+
 			expect: [[ 'echo \'x);' ] ],
-				'echo \'
\';'
+				'echo \'
\';'
 			]]

 		'nested elements with binding':
@@ -333,16 +333,16 @@
 					['element', [1, 23], ['div', ['test2'], undefined], ['Symbol', 'x'], []]
 				]]
 			]
-
+
 			expect: [[ 'echo \'x);' ] ],
-				'echo \'
\';'
-			]]
-
+				'echo \'
\';'
+			]]
+
 		'element bug 001':
 			input: [[ 'element', [ 1, 1 ], [ 'meta', '', undefined ], undefined,
 					[[ 'attribute', [ 1, 16 ], 'charset', '=', [ 'String', 'utf-8' ] ]


Style items now are not created on building step

--- src/styles/style.coffee
+++ src/styles/style.coffee
@@ -318,6 +318,9 @@
     createItem: ->
         assert.isNotDefined @item, "Can't create a style item, because it already exists"
         assert.isNotDefined @node.style, "Can't create a style item, because the node already has a style"
+
+        unless windowStyle
+            return

         {node} = @


Fix pinch events all being set to pinchstart

--- framer/LayerPinchable.coffee
+++ framer/LayerPinchable.coffee
@@ -5,8 +5,8 @@
 {Gestures} = require "./Gestures"

 Events.PinchStart = "pinchstart"
-Events.PinchEnd = "pinchstart"
-Events.Pinch = "pinchstart"
+Events.PinchEnd = "pinchend"
+Events.Pinch = "pinch"
 Events.RotateStart = "rotatestart"
 Events.Rotate = "rotate"
 Events.RotateEnd = "rotateend"
@@ -52,12 +52,12 @@
 		@emit(Events.PinchStart, event)
 		@emit(Events.ScaleStart, event) if @scale
 		@emit(Events.RotateStart, event) if @rotate
-
+
 	_pinch: (event) =>

 		return unless event.pointers.length is 2
 		return unless @enabled
-
+
 		pointA =
 			x: event.pointers[0].pageX
 			y: event.pointers[0].pageY
@@ -108,4 +108,4 @@
 	onRotateEnd: (cb) -> @on(Events.RotateEnd, cb)
 	onScaleStart: (cb) -> @on(Events.ScaleStart, cb)
 	onScale: (cb) -> @on(Events.Scale, cb)
-	onScaleEnd: (cb) -> @on(Events.ScaleEnd, cb)+	onScaleEnd: (cb) -> @on(Events.ScaleEnd, cb)


Properly remove setVersion...

Properly remove setVersion...

--- functions/championify.coffee
+++ functions/championify.coffee
@@ -511,6 +511,5 @@
 ###
 window.Championify = {
   run: downloadItemSets
-  setVersion: setVersion
   checkVer: checkVer
 }


Temporarily removing the mounting of landing page per application

--- src/server/application_manager.coffee
+++ src/server/application_manager.coffee
@@ -56,7 +56,7 @@
         if opts.authenticationInterface
             @addDirectory "src/server/applications/authentication_interface", opts.mountPoint + "/authenticate"
             @addDirectory "src/server/applications/password_reset", opts.mountPoint + "/password_reset"
-            @addDirectory "src/server/applications/landing_page", opts.mountPoint + "/landing_page"
+            #@addDirectory "src/server/applications/landing_page", opts.mountPoint + "/landing_page"

     # Reads the configuration files app_config.json and deployment_config.json


Modified post controller

Modified post controller

--- src/server/controllers/post/post.iced
+++ src/server/controllers/post/post.iced
@@ -5,11 +5,12 @@
 	---
 	Request body:
 		title: string
-		type: number, null
-		description: string
 		content: string
 ###

+sherlock		= require "../../sherlock"
+db					= require "../../database"
+
 module.exports = (req, res) ->
-
-	res.send 400
+	await sherlock.render req.body, defer err, post
+	res.status(400).send()


ongoing interface for events

ongoing interface for events

--- imports/ui/events.cjsx
+++ imports/ui/events.cjsx
@@ -1,7 +1,95 @@
-React = require 'react'
+{ Meteor }          = require 'meteor/meteor'
+{ createContainer } = require 'meteor/react-meteor-data'
+React               = require 'react'

-module.exports = EventsList = React.createClass
+Event = React.createClass
+  displayName: 'Event'
+  render: ->
+
+

+

+
{@props.message}

+

+        {moment(@props.timestamp).from()}
+

+

+

+

+

+

+
{@props.message}

+

+

+

+

+
+
+                {moment(@props.timestamp).from()}
+

+

+

+

+

+
+
+AppdefEvent = React.createClass
+  displayName: 'AppdefEvent'
+  propTypes: event: React.PropTypes.object.isRequired
+  render: ->
+    e = @props.event
+    txt = switch e.action
+      when 'added'   then "Application #{e.info.name}:#{e.info.version} was created."
+      when 'changed' then "Application #{e.info.name}:#{e.info.version} was edited."
+      when 'removed' then "Application #{e.info.name}:#{e.info.version} got removed."
+    <Event message=txt timestamp=e.timestamp />
+
+InstanceEvent = React.createClass
+  displayName: 'InstanceEvent'
+  propTypes: event: React.PropTypes.object.isRequired
+  render: ->
+    e = @props.event
+    txt = switch e.action
+      when 'starting' then "Instance #{e.info.name} is starting..."
+      when 'started'  then "Instance #{e.info.name} has become active."
+      when 'stopping' then "Instance #{e.info.name} is stopping..."
+      when 'stopped'  then "Instance #{e.info.name} has stopped."
+    <Event message=txt timestamp=e.timestamp />
+
+exports.EventsList = EventsList = React.createClass
   displayName: 'EventsList'
+  propTypes:
+    events: React.PropTypes.array.isRequired
+  renderEventItem: (eventItem) ->
+    switch eventItem.subject
+      when 'appdef' then <AppdefEvent event=eventItem />
+      when 'instance' then <InstanceEvent event=eventItem />
   render: ->
-    console.log 'props', @
-
Hello React!

+    console.log 'render', @props
+

+      {@props.events and @props.events.map (eventItem) =>
+        console.log eventItem
+        {@renderEventItem eventItem}
+      }
+

+
+exports.EventsListContainer = EventsListContainer = createContainer (x) ->
+  console.log 'createContainer', x
+  Meteor.subscribe 'events'
+  events = Events.find({}, sort: timestamp: -1).fetch()
+  events: events
+, EventsList
+
+exports.EventsListView = EventsListView = React.createClass
+  displayName: 'EventsListView'
+  render: ->
+

+

+        Events
+
+

+
+

+

+        <EventsListContainer />
+

+


get validation to work

get validation to work

--- src/coffee/services/validation.coffee
+++ src/coffee/services/validation.coffee
@@ -46,7 +46,6 @@
       scope.$on('valueChange', (event, data) ->
         event.stopPropagation()
         values[data.name] = data.value
-        #console.log(data.name)
         delete errors[data.name]
         dispatchResult(data.name, null)
       )


og tag

og tag

--- both/_config/seo.coffee
+++ both/_config/seo.coffee
@@ -5,5 +5,5 @@
       meta:
         description:  @Config.subtitle

-      og:
-        image: "http://manuel-schoebel.com/images/authors/manuel-schoebel.jpg"+      # og:
+      #   image: "http://manuel-schoebel.com/images/authors/manuel-schoebel.jpg"


Modified in browser at pixie.strd6.com

Modified in browser at pixie.strd6.com

--- test/engine_selector.coffee
+++ test/engine_selector.coffee
@@ -23,6 +23,6 @@
     x: 4
     y: 20

-  equals engine.first('tye')
+  equals engine.first('type=''')

 module()


adding a check for option types

adding a check for option types

--- lib/bebopt.coffee
+++ lib/bebopt.coffee
@@ -26,9 +26,8 @@
     @_short = {}
     @_half = {}
     @_parent = null
-    @__rargs = [] # raw args
-    @__pargs = [] # processed args
-    @__uargs = {} # user-ready args
+    @__options = []
+    @_raw = process.argv # XXX for the people; lol, that is this is a protected copy

   _beatError: (parent, name) ->
     switch parent
@@ -102,30 +101,103 @@
     @_parent = null
     return @

+  _sepOptArg: (opt) ->
+    if ///=///.test(opt)
+      arg = opt.replace(/.*?=(.*)/, '$1')
+    else
+      arg = undefined
+    _opt = opt.replace(/(.*)?=.*/, '$1')
+    return {
+      opt: _opt,
+      _arg: arg
+    }
+
+# processes `process.arv' producing two arrays, one containing options,
+# their indexes and any arguments passed in the `--OPTION=ARG' fashion,
+# and then another containing non-option arguments
   _gather: () =>
-    @__rargs = process.argv
-    @__pargs = @__rargs.slice(2).map((opt, ind, arr) =>
-      if /^--$/.test(opt)
-        len = opt.replace(/^(--?).*/, '$1').length
-        parent = null
-        switch len
-          when 1
-            opt = opt.replace(/^-/, '')
-            if opt.length < 2 # short
-              ref = @_short[opt]
-              parent = 'short'
-            else
-              ref = @_half[opt]
-              parent = 'half'
-          when 2
-            opt = opt.replace(/^--/, '')
-            ref = @_long[opt]
-            parent = 'long'
-        console.log opt
-        @_optError(parent, opt)
+    @_opts = []
+    @_args = []
+    optend = false
+    process.argv.slice(2).forEach((arg, ind, arr) =>
+      if /^--$/.test(arg)
+        optend = true
       else
-
-      return ref)
+        # if optend or no dashes are found in the arg,
+        # then we have an non-option argument
+        if optend or /^[^-]+/.test(arg) is true
+          @_args.push({
+            arg: arg,
+            index: ind})
+        else # else, we are working with an option
+          { opt, _arg } = @_sepOptArg(arg)
+          @_opts.push({
+            arg: opt,
+            optarg: _arg,
+            index: ind }))
+
+# validates the incoming command-line options
+# e.g. if an option that takes a required arg
+# has no arg, then it causes bebopt to exit
+# non-zero and prints an error message.
+  _optTypeError: (optName, optArg, nofDashes) =>
+    [
+      {
+        dashes: 1,
+        name: '_short',
+        minOptLen: 1
+      },
+      {
+        dashes: 2,
+        name: '_long',
+        minOptLen: 2
+      },
+      {
+        dashes: 1,
+        name: '_half',
+        minOptLen: 2
+      },
+      # `list' refers to the fact that `_long', `_short', and `_half' are
+      # the objects where the defined options are stored
+    ].forEach((list) =>
+      if nofDashes is list.dashes
+        type = @[list.name][optName].type
+        switch type
+          when 'optarg'
+            if optArg isnt undefined
+              @[list.name][optName].arg = optArg
+
+
+      when 1
+        switch @_short
+
+  _resolveOpts: () =>
+    @_opts.forEach((elem, ind) =>
+      len = elem.arg.replace(/^(--?).*/, '$1').length
+      elem.arg = elem.arg.replace(/^--?(.*)/, '$1')
+      console.log elem.arg
+      switch len
+        when 1
+          @_short(elem.arg)
+    )
+        #parent = null
+        #switch len
+          #when 1
+            #opt = opt.replace(/^-/, '')
+            #if opt.length < 2 # short
+              #ref = @_short[opt]
+              #parent = 'short'
+            #else
+              #ref = @_half[opt]
+              #parent = 'half'
+          #when 2
+            #opt = opt.replace(/^--/, '')
+            #ref = @_long[opt]
+            #parent = 'long'
+        #console.log opt
+        #@_optError(parent, opt)
+      #else
+        #return ref)

   _log: (y) ->
     console.log(util.inspect(y, { colors: true, depth: null }))
@@ -133,5 +205,6 @@
   parse: () =>
     @_gather()
     @_log(@)
+    @_resolveOpts()

 module.exports = Bebopt