Update plugin.

Update plugin.


Corrige escopo em algumas funcoes (seta gorda)

--- src/coffee/portal-minicart.coffee
+++ src/coffee/portal-minicart.coffee
@@ -34,11 +34,11 @@
 		@getOrderFormURL() + @cartData.orderFormId + "/items/update/"

 	bindEvents: =>
-		@hoverContext.on 'mouseover', ->
+		@hoverContext.on 'mouseover', =>
 			$(window).trigger "minicartMouseOver"
 			@context.trigger 'vtex.cart.mouseOver'

-		@hoverContext.on 'mouseout', ->
+		@hoverContext.on 'mouseout', =>
 			$(window).trigger "minicartMouseOut"
 			@context.trigger 'vtex.cart.mouseOut'

@@ -112,7 +112,7 @@
 			@context.find(".vtexsc-cart").slideUp()
 		else
 			@context.find(".vtexsc-cart").slideDown()
-			@timeoutToHide = setTimeout ->
+			@timeoutToHide = setTimeout =>
 				@context.find(".vtexsc-cart").stop(true, true).slideUp()
 			, 3000


fixes #73

fixes #73

--- src/leaf.coffee
+++ src/leaf.coffee
@@ -21,10 +21,14 @@
     return @formats

   deleteText: (offset, length) ->
+    return unless length > 0
     @text = @text.slice(0, offset) + @text.slice(offset + length)
     @length = @text.length
-    targetNode = @node.firstChild or @node
-    DOM.setText(targetNode, @text)
+    if DOM.EMBED_TAGS[@node.tagName]?
+      textNode = @node.ownerDocument.createTextNode(@text)
+      @node = DOM.replaceNode(textNode, @node)
+    else
+      DOM.setText(@node, @text)

   insertText: (offset, text) ->
     @text = @text.slice(0, offset) + text + @text.slice(offset)


fix bounding box calculation for spherical points

--- src/math3d.coffee
+++ src/math3d.coffee
@@ -469,7 +469,7 @@
         material.color.setRGB opts.texture.color...

         mesh = new THREE.Mesh geometry, material
-        mesh.position.set opts.loc...
+        mesh.position = @vector opts.loc...
         mesh.rotation.set opts.rotation...

         geometry.computeBoundingBox()
@@ -540,7 +540,7 @@
             material.opacity          = opts.texture.opacity

         sphere = new THREE.Mesh geometry, material
-        sphere.position.set opts.loc...
+        sphere.position = @vector opts.loc...

         if opts.in_frame
             @updateBoundingBox sphere
@@ -579,8 +579,12 @@
             if not @_points?
                 @_points = []

+            in_frame = opts.in_frame
+            loc = opts.loc
+
             opts.radius = opts.size/400
             opts._basic_material = true
+            opts.in_frame = false

             delete opts.size
             delete opts.use_cloud
@@ -589,6 +593,13 @@

             @_points.push point

+            if in_frame
+                if not @_pointHelper?
+                    @_pointHelper = new THREE.Mesh()
+                    @_pointHelper.geometry.vertices.push undefined
+
+                @_pointHelper.geometry.vertices[0] = @vector loc...
+                @updateBoundingBox @_pointHelper
             return point

     addIndexFaceSet: (opts) ->


shorten ipcsend

shorten ipcsend

--- src/main.coffee
+++ src/main.coffee
@@ -47,6 +47,9 @@
     # away if we must do auth.
     loadAppWindow()

+    # short hand
+    ipcsend = (as...) ->  mainWindow.webContents.send as...
+
     # callback for credentials
     creds = ->
         prom = login(mainWindow)
@@ -60,26 +63,26 @@
     .done()

     # sends the init structures to the client
-    sendInit = -> mainWindow.webContents.send 'init',
+    sendInit = -> ipcsend 'init',
         init: client.init
         recorded: recorded

     # propagate stuff client does
     ipc.on 'sendchatmessage', (ev, {conv_id, segs, client_generated_id, image_id, otr}) ->
         client.sendchatmessage(conv_id, segs, image_id, otr, client_generated_id).then (r) ->
-            mainWindow.webContents.send 'sendchatmessage:result', r
+            ipcsend 'sendchatmessage:result', r

     ipc.on 'setpresence', -> client.setpresence(true)
     ipc.on 'updatewatermark', (ev, conv_id, time) ->
         client.updatewatermark conv_id, time
     ipc.on 'getentity', (ev, ids) -> client.getentitybyid(ids).then (r) ->
-        mainWindow.webContents.send 'getentity:result', r
+        ipcsend 'getentity:result', r

     # propagate these events to the renderer
     require('./ui/events').forEach (n) ->
         client.on n, (e) ->
           recorded.push [n, e]
-          mainWindow.webContents.send n, e
+          ipcsend n, e

     # Emitted when the window is closed.


Update tub.coffee

Update tub.coffee

:bug: Fix bug where tub_config.yml was being made as <tub>tub_config.yml instead of <tub>/tub_config.yml

--- src/tub.coffee
+++ src/tub.coffee
@@ -6,7 +6,7 @@
     # body...
     @dir = appdir
     @tub = tub
-    @file = "#{@dir}/.jakhu/#{@tub}tub_config.yml"
+    @file = "#{@dir}/.jakhu/#{@tub}/tub_config.yml"
     @yml = yml
     @yaml = {}
     fs.openSync @file, 'w+'


get to 200 easier

get to 200 easier

--- src/player.coffee
+++ src/player.coffee
@@ -51,7 +51,7 @@
       return sendBet bet

     if communityCards.length == 0
-      if value > 0.5 and me.bet < 200
+      if value >= 0.3 and me.bet < 200
         return sendBet 200 - (me?.bet ? 0)
       unless value < 0.1
         return sendBet maxBet


s/Rivets.View/Rivets.Binding.

s/Rivets.View/Rivets.Binding.

--- src/rivets.coffee
+++ src/rivets.coffee
@@ -158,7 +158,7 @@
 # Rivets.ComponentBinding
 # -----------------------

-# A component view encapsulated in a binding within it's parent view.
+# A component view encapsulated as a binding within it's parent view.
 class Rivets.ComponentBinding extends Rivets.Binding
   # Initializes a component binding for the specified view. The raw component
   # element is passed in along with the component type. Attributes and scope
@@ -174,7 +174,7 @@
       else
         @inflections[attribute.name] = attribute.value

-  # Intercepts `Rivets.View::sync` since component bindings are not bound to a
+  # Intercepts `Rivets.Binding::sync` since component bindings are not bound to a
   # particular model to update it's value.
   sync: ->

@@ -186,12 +186,12 @@

     result

-  # Intercepts `Rivets.View::update` to be called on `@componentView` with a
+  # Intercepts `Rivets.Binding::update` to be called on `@componentView` with a
   # localized map of the models.
   update: (models) =>
     @componentView?.update @locals models

-  # Intercepts `Rivets.View::bind` to build `@componentView` with a localized
+  # Intercepts `Rivets.Binding::bind` to build `@componentView` with a localized
   # map of models from the root view. Bind `@componentView` on subsequent calls.
   bind: =>
     if @componentView?
@@ -201,7 +201,7 @@
       (@componentView = new Rivets.View(el, @locals(), @view.options)).bind()
       @el.parentNode.replaceChild el, @el

-  # Intercept `Rivets.View::unbind` to be called on `@componentView`.
+  # Intercept `Rivets.Binding::unbind` to be called on `@componentView`.
   unbind: =>
     @componentView?.unbind()


runner does not start a new browser onError after the last test was failed

--- src/runner.coffee
+++ src/runner.coffee
@@ -49,7 +49,7 @@
         @logger.info "TestCase finished in #{do @_timer.getTime} sec"

         return true if not @_errorHandler.errorIsOccured()
-        do @_createNewContext if @_config.onError.startNewBrowser
+        do @_createNewContext if @_config.onError.startNewBrowser and @_fileIndex < @_files.length
       .then @runNextTest

     return undefined


remove old comment

remove old comment

--- src/helpers.iced
+++ src/helpers.iced
@@ -85,7 +85,7 @@
         cb(new Error("Shop configuration is corrupt, you may need to delete 'quickshot.json', and run 'quickshot configure' again."))
       success: (data) ->
         if !data.configVersion? or data.configVersion < CONFIGVERSION
-          cb(new Error("Shop configuration is from an older incompatible version of quickshot. You need to run 'quickshot configure' again."))
+          cb(new Error("Shop configuration is from an older incompatible version of quickshot. You need to run 'quickshot configure' again."), data)
         cb(null, data)
     )

@@ -143,28 +143,6 @@

     return cb(null, pages)

-  # getShopProducts: (target, cb) ->
-  #   chunkSize = 250
-  #   page = 1
-  #   products = []
-  #   productsBody = {
-  #     products: [0]
-  #   }
-  #
-  #   while productsBody.products.length isnt 0
-  #     await @shopifyRequest({
-  #       method: 'get'
-  #       url: "https://#{target.api_key}:#{target.password}@#{target.domain}.myshopify.com/admin/products.json?limit=#{chunkSize}&page=#{page}"
-  #     }, defer(err, res, productsBody))
-  #     if err? then return cb(err)
-  #
-  #     products = products.concat(productsBody.products)
-  #     page += 1
-  #
-  #     console.log "Products downloaded: #{products.length}"
-  #
-  #   return cb(null, products)
-
   ts: ->
     return moment().format('hh:mm:ss a')


Run again when done and catch and log errors

--- src/index.coffee
+++ src/index.coffee
@@ -69,13 +69,17 @@
       wif.encode(0x80, decryptedKey.privateKey, decryptedKey.compressed)

-module.exports = ->
+run = ->
   require('inquirer').prompt((v for k,v of questions)).then((a) ->

     if a.operation is 'Encrypt' and a.pass_first isnt a.pass_second
-      console.log("Error: The supplied passphrases do not match")
-      return
+      throw new Error("The supplied passphrases do not match")

     output = engines[a.method][a.operation](a.input, a.pass_first)
     console.log("\n" + output + "\n")
+    run()
+  ).catch((error) ->
+    console.log "Error: #{error.message}".yellow
   )
+
+module.exports = run


Removed index-file

Removed index-file

--- src/index.coffee
+++ src/index.coffee
@@ -1,9 +0,0 @@
-Z = require './constructor'
-
-module.exports = Z.creator({
-  log: (value) ->
-    if console?.log?
-      console.log(value)
-    else if alert?
-      alert(value)
-})


Do filtering by default, but provide an option to optout (eg. for search)

--- src/index.coffee
+++ src/index.coffee
@@ -55,39 +55,43 @@
     @registerEventListeners()
     @registerRobotResponses()

-  send: (context, message) ->
-    unless _(message).isString()
-      unless @shouldIncludeAttachmentForTicketKey _(context).extend message
-        message.attachments = []
-
+  send: (context, message, filter=yes) ->
+    message = @filterAttachmentsForPreviousMentions context, message if filter
     @adapter.send context, message

-  shouldIncludeAttachmentForTicketKey: (msg) ->
-    should = yes
-    return should unless @mentions?
-    return should unless msg.attachments?.length > 0
-    key = msg.attachments[0].author_name?.trim().toUpperCase()
-    return should unless Config.ticket.regex.test key
-    room = msg.message.room
-
-    if @mentions[room]
-      if time = @mentions[room].tickets[key]
-        should = moment().isAfter time
-    else
-      @mentions[room] = tickets: {}
-    @mentions[room].tickets[key] = moment().add 5, 'minutes' if should
-
-    #Cleanup other mention expiries
-    for r, obj of @mentions
-      for k, t of @mentions[r].tickets
-        if moment().isAfter t
-          delete @mentions[r].tickets[k]
-
-    @robot.brain.set JiraBot.JIRA_ROOM_TICKET_MENTIONS, @mentions
-    @robot.brain.save()
-
-    @robot.logger.info "Supressing ticket attachment for #{key} in #{room}" unless should
-    return should
+  filterAttachmentsForPreviousMentions: (context, message) ->
+    return message if _(message).isString()
+    return message unless @mentions?
+    return message unless message.attachments?.length > 0
+    room = context.message.room
+
+    removals = []
+    for attachment in message.attachments
+      keep = yes
+      key = attachment.author_name?.trim().toUpperCase()
+      continue unless Config.ticket.regex.test key
+      if @mentions[room]
+        if time = @mentions[room].tickets[key]
+          keep = moment().isAfter time
+      else
+        @mentions[room] = tickets: {}
+      @mentions[room].tickets[key] = moment().add 5, 'minutes' if keep
+
+      #Cleanup other mention expiries
+      for r, obj of @mentions
+        for k, t of @mentions[r].tickets
+          if moment().isAfter t
+            delete @mentions[r].tickets[k]
+
+      @robot.brain.set JiraBot.JIRA_ROOM_TICKET_MENTIONS, @mentions
+      @robot.brain.save()
+
+      unless keep
+        @robot.logger.info "Supressing ticket attachment for #{key} in #{room}"
+        removals.push attachment
+
+    message.attachments = _(message.attachments).difference removals
+    return message

   matchJiraTicket: (message) ->
     if message.match?
@@ -324,6 +328,7 @@
         @send msg,
           text: results.text
           attachments: attachments
+        , no
       .catch (error) =>
         @send msg, "Unable to search for `#{query}` :sadpanda:"
         @robot.logger.error error.stack


hm. moving things around

hm. moving things around

--- src/index.coffee
+++ src/index.coffee
@@ -39,10 +39,8 @@
     sClients = studentsOnline()
     nickPairs = []
     nickPairs.push (idNickPairForClient client) for client in sClients
-    console.log nickPairs
     return {clients:sClients.length, idNickPairs:nickPairs}

-gdata = {clients:0}
 io.sockets.manager.settings.blacklist = []

 io.of('/student')
@@ -61,12 +59,10 @@
         io.of('/teacher').emit 'render', onlineData()

     socket.on 'edit', (data) ->
-        gdata.text = data.text
         idDataVals = {id:socket.id, text:data.text}
-        console.log "RECEIVED EDIT: BORADCASTING: ID: "+idDataVals.id" TEXT:"+idDataVals.text
+        console.log idDataVals
+        socket.emit 'online', onlineData()
         io.of("/teacher").emit 'edit', idDataVals
-        socket.emit 'online', onlineData()
-        return

     socket.on 'disconnect', (data) ->
         online = onlineData()


sarting server with different port if port is busy

--- src/index.coffee
+++ src/index.coffee
@@ -33,34 +33,49 @@

 			# starting server, unless host given
 			unless @host
-				@host = 'http://localhost:1823/'
-				@server = exec "http-server -p 1823 #{@public}", (error, stdout, stderr) =>
-					if error
-						@server.kill()
-						return error
-					console.log '[static-renderer] ' + stdout if stdout
-					console.log '[static-renderer] err: ' + stderr if stderr
-				console.log '[static-renderer] starting webserver and serving ' + @public + ' on port 1823'
+				@startServer @render
 			else
 				@host += '/' unless @host.match /\/$/
-				console.log '[static-renderer] loading paths form ' + @host
+				console.log '[static-renderer]: rendering ' + @host

-			@render =>
-				@server.kill() if @server
+				@render()

 			return

-	render: (fn)->
+	startServer: (port, fn) ->
+		if typeof port is 'function'
+			fn = port
+			port = 1823
+
+		@host = "http://localhost:#{port}/"
+		args = ['-p', port, @public]
+		@server = exec "http-server #{args.join(' ')}", (error, stdout, stderr) =>
+			if error
+				unless error.killed
+					@startServer port + 1, fn
+				return
+
+		@server.stdout.on 'data', (data) =>
+			if fn
+				console.log "[static-renderer]: rendering #{@public} hosted on #{@host}"
+				fn.call(this)
+			fn = null
+
+	render: ->
 		procs = []
 		_.each @loadPaths, (path) =>
 			# calling the renderer for each path
-			filename = path + '/index.html'
+			filename = sysPath.join path, 'index.html'
 			proc = exec "phantomjs node_modules/static-phantom-renderer-brunch/lib/renderer.js #{@host}##{path} #{@public} #{filename}", (error, stdout, stderr) ->
-				console.log '[static-renderer] ' + stdout if stdout
-				console.log '[static-renderer] err: ' + stderr if stderr
-				console.log 'exec error: ' + error if error
+				console.log '[static-renderer]: ' + stdout if stdout
+				console.error '[static-renderer]: ' + stderr if stderr
+				console.error error if error
 			procs.push proc
+
 			proc.on 'close', =>
 				procs.pop()
 				if procs.length is 0
-					fn.call() if fn
+					@afterRender()
+
+	afterRender: ->
+		@server.kill() if @server


Fix require

Fix require

--- src/index.coffee
+++ src/index.coffee
@@ -1,4 +1,4 @@
-meroboto = require 'meroboto/lib/'
+meroboto = require 'meroboto'
 weather = require 'weather-js'
 debug = true if process.env.WEATHER_ROBOT_DEBUG is 'true'

@@ -26,4 +26,4 @@
         catch error
           @fn false
         finally
-          super()+          super()


add additional argument to folioConsoleInitRedactor

--- app/assets/javascripts/folio/console/redactor/_init.coffee
+++ app/assets/javascripts/folio/console/redactor/_init.coffee
@@ -19,10 +19,10 @@
   lang: document.documentElement.lang
   formatting: ['p', 'h2', 'h3', 'h4']

-window.folioConsoleInitRedactor = (node, options = {}) ->
+window.folioConsoleInitRedactor = (node, options = {}, additional = {}) ->
   return if node.classList.contains('redactor-source')
   opts = if options.advanced then ADVANCED_OPTIONS else OPTIONS
-  $R(node, opts)
+  $R(node, $.extend({}, opts, additional))

 window.folioConsoleDestroyRedactor = (node) ->
   $R(node, 'destroy')


fix where error when referencing this inside of concatenation

--- app/assets/javascripts/hanuman/conditional-logic.js.coffee
+++ app/assets/javascripts/hanuman/conditional-logic.js.coffee
@@ -158,7 +158,8 @@
       $(this).trigger("chosen:updated") if $(this).hasClass('chosen')
     multiselects = container.find("select[multiple]")
     multiselects.each ->
-      $('#' + $this.attr('id') + ' option:selected').removeAttr("selected")
+      id = $(this).attr('id')
+      $('#' + id + ' option:selected').removeAttr("selected")
       $(this).trigger("chosen:updated") if $(this).hasClass('chosen-multiselect')
     # uncheck all checkboxes
     checkboxes = container.find(":checkbox")


fix students seeing teacher/admin options for outcome groups

fixes CNVS-25372

test plan:
- as a student, go to the outcomes page
- you should not see any admin options (Move Outcome, etc)
  for outcomes or outcome groups
- as a teacher, go to the same page
- there should be no changes in appearance or functionality

Change-Id: I226605a184486e4478aeed62d42e4bee6fc738ca
Reviewed-on: https://gerrit.instructure.com/68450
Reviewed-by: Ryan Taylor <2eafa1f6bf34395b543d6ca7f438461b0774d24f@instructure.com>
Reviewed-by: John Corrigan <3d73713d0cc718326e4fd7c06c64e067ad6e2270@instructure.com>
QA-Review: Rajkumar Kethavath <943d80ed9dc95d434849fae8b8fb2a95a056374d@instructure.com>
Tested-by: Jenkins
Product-Review: Matt Berns <e53c8988cd428dde240324ce2797c8eb7073560f@instructure.com>

--- app/coffeescripts/views/outcomes/OutcomeContentBase.coffee
+++ app/coffeescripts/views/outcomes/OutcomeContentBase.coffee
@@ -191,7 +191,7 @@
         @$('input:first').focus()

     readOnly: ->
-      @_readOnly
+      @_readOnly || !@model.get('can_edit')

     updateTitle: (e) =>
       @model.set 'title', e.currentTarget.value


Issue #2267: Removed duplicates from TreemaData

--- app/views/editor/level/components/ComponentsTabView.coffee
+++ app/views/editor/level/components/ComponentsTabView.coffee
@@ -51,6 +51,10 @@
       res = [(if comp.count then 0 else 1), component.get('system'), component.get('name')]
       return res

+    res = {}
+    res[treemaData[key].original] = treemaData[key] for key in [0..treemaData.length-1]
+    treemaData = (value for key, value of res)  # Removing duplicates from treemaData
+
     treemaOptions =
       supermodel: @supermodel
       schema: {type: 'array', items: {type: 'object', format: 'level-component'}}


trying to fix unexpected terminator bug...dafuq

--- src/lobby.coffee
+++ src/lobby.coffee
@@ -111,11 +111,12 @@
   'koth_pro_viaduct_rc4'
 ]

-exports.filterMaps = (desired, mapList) ->
+filterMaps = ((desired, mapList) ->

   mapList.filter((map) -> map.indexOf(desired) isnt -1)
-
-exports.newLobby = (map, principal, server) ->
+)
+
+newLobby = ((map, principal, server) ->
   {
     createdAt: (new Date()).toJSON()
     map: map
@@ -124,8 +125,9 @@
     participants: {}
     finalising: false
   }
-
-exports.finalising = (robot, msg) ->
+)
+
+finalising = ((robot, msg) ->
   lobby = robot.brain.get('lobby')
   server = servers[lobby.server]

@@ -168,8 +170,9 @@
     lobby.finalising = false
     robot.brain.set('lobby', lobby)
     return msg.send("#{msg.random(responses.mistake)}  it looks like we didn't find enough players in time. but never fear! tfbot is here to comfort you while you cry yourself to sleep.")
-
-exports.onLeave = (robot, msg) ->
+)
+
+exports.onLeave = ((robot, msg) ->
   lobby = robot.brain.get('lobby')
   return unless lobby?

@@ -180,8 +183,9 @@
     delete lobby.participants[user]
     robot.brain.set('lobby', lobby)
     return msg.send("|| #{lobby.server} | #{lobby.map} | #{players.length}/12 | [ #{players.join(', ')} ] ||")
-
-exports.rconSay = (robot, msg) ->
+)
+
+exports.rconSay = ((robot, msg) ->
   user = msg.message.user.id

   server = servers[msg.match[3].toLowerCase()]
@@ -199,8 +203,9 @@
     return msg.reply("#{msg.random(responses.mistake)} that's not a valid server...")

   return msg.reply("#{msg.random(responses.mistake)} you can't to do that...")
-
-exports.rconRoster = (robot, msg) ->
+)
+
+exports.rconRoster = ((robot, msg) ->
   user = msg.message.user.id

   if robot.auth.hasRole(msg.envelope.user, 'rcon')
@@ -219,8 +224,9 @@
     return msg.reply("#{msg.random(responses.mistake)} there's no previous game data. creepy...")

   return msg.reply("#{msg.random(responses.mistake)} you can't to do that...")
-
-exports.rconMap = (robot, msg) ->
+)
+
+exports.rconMap = ((robot, msg) ->
   user = msg.message.user.id
   server = servers[msg.match[2].toLowerCase()]
   map = msg.match[3].toLowerCase()
@@ -239,8 +245,9 @@
     return msg.reply("#{msg.random(responses.mistake)} i don't know that map...")

   return msg.reply("#{msg.random(responses.mistake)} you can't to do that...")
-
-exports.sg = (robot, msg) ->
+)
+
+exports.sg = ((robot, msg) ->
   user = msg.message.user.id

   if robot.auth.hasRole(msg.envelope.user, 'officer')
@@ -264,8 +271,9 @@
     return msg.send("|| #{created.map} | #{Object.keys(created.participants).length}/12 | [  ] ||")

   return msg.send("#{msg.random(responses.mistake)} you can't to do that...")
-
-exports.cg = (robot, msg) ->
+)
+
+exports.cg = ((robot, msg) ->
   user = msg.message.user.id

   if robot.auth.hasRole(msg.envelope.user, 'officer')
@@ -277,8 +285,9 @@
     return msg.send("#{msg.random(responses.negative)}, pickup cancelled...")

   return msg.send("#{msg.random(responses.negative)}, you can't to do that...")
-
-exports.add = (robot, msg) ->
+)
+
+exports.add = ((robot, msg) ->
   user = msg.message.user.id
   lobby = robot.brain.get('lobby')
   target = if msg.match[1] is 'me' then user else msg.match[1].trim()
@@ -307,8 +316,9 @@
     return msg.reply("#{msg.random(responses.mistake)} the pickup is already full...")

   return msg.reply("#{msg.random(responses.mistake)} you can't to do that...")
-
-exports.rem = (robot, msg) ->
+)
+
+exports.rem = ((robot, msg) ->
   user = msg.message.user.id
   target = if msg.match[1] is 'me' then user else msg.match[1]

@@ -327,8 +337,9 @@
     return msg.reply("#{if msg.match[1] is 'me' then 'you\'re not' else target + '\'s not'} added to the pickup...")

   return msg.reply("#{msg.random(responses.mistake)} you can't do that...")
-
-exports.map = (robot, msg) ->
+)
+
+exports.map = ((robot, msg) ->
   user = msg.message.user.id

   if robot.auth.hasRole(msg.envelope.user, 'officer')
@@ -352,14 +363,14 @@
     return msg.reply("#{msg.random(responses.affirmative)} changing map to #{map}...")

   return msg.reply("#{msg.random(responses.mistake)} you can't do that...")
-
-exports.server = (robot, msg) ->
+)
+
+exports.server = ((robot, msg) ->
   user = msg.message.user.id

   if robot.auth.hasRole(msg.envelope.user, 'officer')

     lobby = robot.brain.get('lobby')
-
     return msg.reply("#{msg.random(responses.mistake)} there\'s no pickup filling...") unless lobby?

     if msg.match[1] in serverList
@@ -370,21 +381,22 @@
     return msg.reply("#{msg.random(responses.mistake)} #{msg.match[1]} isn't a valid server...")

   return msg.reply("#{msg.random(responses.mistake)} you can't do that...")
-
-exports.status = (robot, msg) ->
+)
+
+exports.status = ((robot, msg) ->
   lobby = robot.brain.get('lobby')
-
   return msg.reply("#{msg.random(responses.mistake)} there\'s currently no pickup...") unless lobby?
-
   players = Object.keys(lobby.participants)
   return msg.send("|| #{lobby.server} | #{lobby.map} | #{players.length}/12 | [ #{players.join(', ')} ] ||")
-
-exports.previous = (robot, msg) ->
+)
+
+exports.previous = ((robot, msg) ->
   previous = robot.brain.get('previous')
   return msg.send("#{msg.random(responses.negative)}, no previous match data...") unless previous?
   return msg.send("|| #{previous.principal} | #{previous.server} | #{previous.map} | [ #{Object.keys(previous.participants).join(', ')} ] | #{new Date(previous.createdAt).toString()} ||")
-
-exports.top = (robot, msg) ->
+)
+
+exports.top = ((robot, msg) ->
   today = robot.brain.get('today')

   return msg.send("#{msg.random(responses.negative)}, i haven't captured any daily data yet...") unless today?
@@ -396,15 +408,14 @@
     if not Object.keys(today.maps).length
       return msg.send("#{msg.random(responses.negative)}, i haven't captured any daily map data yet...")

-    for map, played of today.maps
-      response += " #{map}: #{played} |"
+    response += " #{map}: #{played} |" for map, played of today.maps

   else

     if not Object.keys(today.players).length
       return msg.send("#{msg.random(responses.negative)}, i haven't captured any daily player data yet...")

-    for player, played of today.players
-      response += " #{player}: #{played} |"
+    response += " #{player}: #{played} |" for player, played of today.players

   return msg.send("#{response}|")
+)


Comment noise

Comment noise

--- public/app/game.coffee
+++ public/app/game.coffee
@@ -6,7 +6,8 @@
             @entities = []
             @camera = {x: 0, y: 0, vx: 0, vy: 0}

-            ## Store the game globally
+            ## Store the game globally,
+            ## Start the clock and load misc
             window.$game = @
             $e.Ticker.addListener @
             @init_stats()