mirror of
https://github.com/atom/atom.git
synced 2026-02-05 20:25:04 -05:00
36 lines
766 B
CoffeeScript
36 lines
766 B
CoffeeScript
Keymap = require 'keymap'
|
|
fs = require 'fs'
|
|
|
|
$ = require 'jquery'
|
|
_ = require 'underscore'
|
|
require 'underscore-extensions'
|
|
|
|
module.exports =
|
|
class Atom
|
|
keymap: null
|
|
windows: null
|
|
userConfigurationPath: null
|
|
|
|
constructor: (@loadPath, nativeMethods)->
|
|
@windows = []
|
|
@setUpKeymap()
|
|
@userConfigurationPath = fs.absolute "~/.atom/atom.coffee"
|
|
|
|
setUpKeymap: ->
|
|
@keymap = new Keymap()
|
|
@handleKeyEvent = (e) => @keymap.handleKeyEvent(e)
|
|
$(document).on 'keydown', @handleKeyEvent
|
|
@keymap.bindDefaultKeys()
|
|
|
|
open: (path) ->
|
|
$native.open path
|
|
|
|
quit: ->
|
|
$native.terminate null
|
|
|
|
windowOpened: (window) ->
|
|
@windows.push(window) unless _.contains(@windows, window)
|
|
|
|
windowClosed: (window) ->
|
|
_.remove(@windows, window)
|