Commit Graph

57 Commits

Author SHA1 Message Date
Nathan Sobo
a010c8e3c6 Add window.bindMenuItem, which adds a menu item that invokes a given function.
Every menu item is created with a path (File > Save). The functions are stored in a hash from (menu item path -> action) on the window. When an AtomMenuItem is selected, it looks up the action on the current window based on its path.
2011-12-26 13:12:27 -06:00
Nathan Sobo
ae4fdf8812 Add Native.resetMainMenu and call it in global afterEach
This method removes any AtomMenuItems that aren't marked as 'global'. It ignores menu items that aren't instances of our custom subclass. This is needed by specs to clear any menu items added during tests. It will also be needed when a window loses focus and we want to remove any non-global menus associated with the window.
2011-12-23 12:43:32 -06:00
Corey Johnson
ee0bf2e553 Rename open and new methods. 2011-12-22 14:58:06 -08:00
Corey Johnson
66b066fbaf Trim Menu down to new/open/quit/run specs.
Implement those methods in AtomApp.
2011-12-22 14:04:39 -08:00
Corey Johnson
cf18c4b550 Autorun tests if AUTO-RUN env is set. 2011-12-19 13:10:02 -08:00
Nathan Sobo
ff57cbc8f6 Make "Run Specs" menu item w/ key equivalent. 2011-12-16 16:30:55 -08:00
Nathan Sobo
79fbc0118c WebView re-initializes JSCocoa on reload. 2011-12-16 16:30:49 -08:00
Nathan Sobo
ca9e26882a Bypass key equivalents on keydown until web view has a chance to process events.
Move refresh handling to keyDown: method on AtomController. Eliminate custom handleInputEvent method.

NSApplication-sendEvent calls performKeyEquivalents on keydown events. Here I override sendEvent for keydown and forward the event to its window. This allows the web view to receive Command-H etc without key equivalents interfering. If the web view short-circuits the event, then the key equivalent will not be invoked. But it can let the event pass through and it ends up invoking the key equivalent anyway via a mechanism I don't fully understand. Apparently Cocoa tries to execute key equivalents after the web view finishes with the event? But it works great.
2011-12-15 19:10:58 -08:00
Corey Johnson & Nathan Sobo
b3ce89d294 Events go on Keyup, duh. 2011-12-15 16:01:41 -08:00
Corey Johnson & Nathan Sobo
dd1c9de381 When opening a new window, block until web view loads. 2011-12-15 10:42:33 -08:00
Corey Johnson & Nathan Sobo
3309549dc5 💄 2011-12-15 10:01:11 -08:00
Corey Johnson
583d0d749c 💄 2011-12-15 09:34:09 -08:00
Corey Johnson
2a01ef757b The method call was still bugging because it is only called once and is one line long. How about we make it a local var? 2011-12-15 09:19:02 -08:00
Corey Johnson
4a2081e88d Capture window.close calls (from JS) in AtomController 2011-12-14 18:28:06 -08:00
Corey Johnson
fbb3efacf4 wii - gettings specs on App.open. Window closing not working quite right. 2011-12-14 16:24:30 -08:00
Corey Johnson
507341e714 Use correct method names. 2011-12-14 11:47:09 -08:00
Corey Johnson
725ca308c3 Rename Startup to Bootstrap. 2011-12-14 11:29:11 -08:00
Corey Johnson
89c00ec8a6 Teardown and recreate WebView (not the entire controller) on reload. 2011-12-14 10:46:57 -08:00
Corey Johnson & Nathan Sobo
ee681562d0 Make controllers array a property. 2011-12-12 15:05:29 -08:00
Corey Johnson & Nathan Sobo
5daabb3241 Add facility for running specs… still don't have any yet.
Use property accessors instead of raw ivars.
2011-12-12 13:04:46 -08:00
Corey Johnson
1bd966d956 :lipstick" 2011-12-05 14:27:19 -05:00
Corey Johnson
60f062acd3 Remember to close the window, Corey. 2011-12-01 12:55:39 -05:00
Corey Johnson
f31cb275ca Closing the controller removes it from NSApp 2011-11-29 16:56:58 -05:00
Corey Johnson
40472537cc 💄 2011-11-29 16:56:34 -05:00
Corey Johnson
221bfa7f92 Remove windowController calls the window:close event. 2011-11-29 16:56:01 -05:00
Corey Johnson
1c985bd899 Give JS access to the project dir so we can automate that shit. 2011-11-29 15:22:14 -05:00
Corey Johnson
55e0f72aa2 Window reloading is handled completely by objective-c now.
This should be a never-do-this-again thing. It's just so we can reload when the app crashes instead of having to use Xcode.
2011-11-29 13:50:24 -05:00
Corey Johnson
2de76e35f1 Moving the logic of window reloading to objective-c. 2011-11-29 13:50:24 -05:00
Chris Wanstrath
8455c780c4 ~/.atomicity => ~/.atom f'real 2011-11-25 22:21:36 -08:00
Corey Johnson
307610d9d5 don't assume the url is a file path! 2011-11-21 21:28:09 -08:00
Corey Johnson
2512b48293 Corey, Corey, Corey... 2011-11-11 14:14:09 -08:00
Corey Johnson
d78d124d69 📝 2011-11-11 13:09:45 -08:00
Corey Johnson
fff3e19a50 Awesome shit. 2011-11-10 16:31:53 -08:00
Corey Johnson
0e0d0905b9 No more compiler warnings. 2011-11-10 14:53:55 -08:00
Corey Johnson
bccd592310 Got rid of everything on the Objective-C side that we don't need. 2011-11-10 14:50:31 -08:00
Corey Johnson
8a18296c50 nobody cares about that 2011-11-10 14:12:02 -08:00
Corey Johnson
41b9b954b5 Not using these. #technicaldebt 2011-11-10 13:57:35 -08:00
Chris Wanstrath
4aa8bf392a not ready for this yet. focusing on one window for now. 2011-11-10 11:21:28 -08:00
Chris Wanstrath
d5516c1ee5 whitespace 2011-11-09 12:13:12 -08:00
Chris Wanstrath
cf41bdddff don't show console on load 2011-11-09 12:13:05 -08:00
Corey Johnson
7a567dab69 wip 2011-11-09 10:38:25 -08:00
Corey Johnson
d0ac88ae64 scandir_b 2011-11-08 13:52:35 -08:00
Corey Johnson
be9078a92e updating a file from outside the app is ACTUALLY reflected in atom now 2011-11-07 16:25:46 -08:00
Corey Johnson
3df83d10d8 Save window size and position. Fixes #45 2011-11-07 15:52:52 -08:00
Corey Johnson
4e9a73cebc atomController is now known as $atomController. 2011-11-07 14:56:22 -08:00
Chris Wanstrath
834528e25a hwhat 2011-11-06 20:05:15 -08:00
Chris Wanstrath
92eff75ab5 fullscreen in lion
https://img.skitch.com/20111107-8eadm7srjcxtnjyck8tqgsrk21.png
2011-11-06 20:03:51 -08:00
Corey Johnson
7c41747c20 changed some webview xib settings 2011-11-06 14:26:11 -08:00
Corey Johnson
2eb019c5a6 Turn events back on! 2011-11-04 18:07:02 -07:00
Corey Johnson
750ede4f2c handle storage on the objective-c side. 2011-11-04 17:43:15 -07:00