From 605757c274bd6d6308e2f8cb55eb100461f877a6 Mon Sep 17 00:00:00 2001 From: Chris Wanstrath Date: Fri, 19 Aug 2011 01:09:47 -0700 Subject: [PATCH] window, start on fullscreen --- HTML/atomicity.coffee | 14 ++++++++++---- HTML/osx.coffee | 8 ++++++++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/HTML/atomicity.coffee b/HTML/atomicity.coffee index 35a1e0b6c..b71eb30fd 100644 --- a/HTML/atomicity.coffee +++ b/HTML/atomicity.coffee @@ -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() diff --git a/HTML/osx.coffee b/HTML/osx.coffee index a5236b384..521bf0285 100644 --- a/HTML/osx.coffee +++ b/HTML/osx.coffee @@ -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