window, start on fullscreen

This commit is contained in:
Chris Wanstrath
2011-08-19 01:09:47 -07:00
parent 9e6d9e3cf4
commit 605757c274
2 changed files with 18 additions and 4 deletions

View File

@@ -13,7 +13,7 @@ save = ->
File.write filename, editor.getSession().getValue()
setMode()
open = ->
App.window.title = _.last filename.split('/')
Chrome.title _.last filename.split('/')
editor.getSession().setValue File.read filename
setMode()
setMode = ->
@@ -24,7 +24,7 @@ setMode = ->
saveAs = ->
if file = Chrome.savePanel()
filename = file
App.window.title = _.last filename.split('/')
Chrome.title _.last filename.split('/')
save()
Chrome.bindKey 'open', 'Command-O', (env, args, request) ->
@@ -64,8 +64,14 @@ Chrome.bindKey 'deleteword', 'Alt-D', (env) ->
Chrome.bindKey 'selectwordright', 'Alt-B', (env) ->
env.editor.navigateWordLeft()
Chrome.bindKey 'fullscreen', 'Command-Return', (env) ->
OSX.NSLog 'coming soon'
Chrome.bindKey 'home', 'Alt-Shift-<', (env) ->
env.editor.navigateFileStart()
Chrome.bindKey 'end', 'Alt-Shift->', (env) ->
env.editor.navigateFileEnd()
Chrome.bindKey 'fullscreen', 'Command-Shift-Return', (env) ->
Chrome.fullscreen()

View File

@@ -39,6 +39,14 @@ Chrome =
win: null
mac: shortcut
sender: 'editor'
title: (text) ->
App.mainWindow.title = text
fullscreen: ->
OSX.NSMenu.setMenuBarVisible not OSX.NSMenu.menuBarVisible
App.mainWindow.orderOut(null)
#if mainWindow.screen.isEqual(OSX.NSScreen.screens.objectAtIndex(0)
# Handles the file system