edubkendo
11/14/2012 - 7:33 PM

Third point in app.js chain of entry

Third point in app.js chain of entry


app = module.exports = require('appjs')
Stream = require 'stream'

app.serveFilesFrom(__dirname + '/public')

window = app.createWindow
  width  : 980,
  height : 661,
  icons  : __dirname + '/public/icons'

window.on 'create', ->
  console.log("Window Created")
  window.frame.show()
  window.frame.center()

window.on 'ready', ->
  console.log("Window Ready")
  window.require = require
  window.process = process
  window.module = module

  F12 = (e) ->
    return e.keyIdentifier == 'F12'

  Command_Option_J = (e) ->
    return e.keyCode == 74 && e.metaKey && e.altKey

  window.addEventListener 'keydown', (e) ->
    if (F12(e) || Command_Option_J(e)) 
      window.frame.openDevTools()

  # Websocket code
  # io = require('socket.io').listen(9000)

  # io.sockets.on 'connection', (socket) ->

window.on 'close', ->
  console.log("Window Closed")