Commit Graph

24013 Commits

Author SHA1 Message Date
Cheng Zhao
177ac5687f Use atom-shell's "shell.beep()" to replace "$native.beep()" 2013-05-20 09:49:34 +08:00
Cheng Zhao
1301eb0fa4 Use atom-shell's API for pasteboard operations. 2013-05-20 09:43:19 +08:00
Cheng Zhao
62caaf01d7 💄 2013-05-18 15:06:35 +08:00
Cheng Zhao
160c9b9d8e Add Edit menu. 2013-05-18 12:28:17 +08:00
Cheng Zhao
c8891c1008 Adopt to API change of dialog.showMessageBox. 2013-05-18 12:21:25 +08:00
probablycorey
153668db56 Opening a folder works! 2013-05-17 15:51:11 -07:00
Kevin Sawicki
276c6c1725 Add --silent flag to apm/npm commands 2013-05-17 15:37:26 -07:00
Kevin Sawicki
5859ae6ba7 Upgrade apm 2013-05-17 15:37:21 -07:00
probablycorey
1594231b4f Refactor AtomWindow code 2013-05-17 14:21:43 -07:00
probablycorey
f9acde8c55 AtomApplication takes resourcePath as a parameter 2013-05-17 14:14:27 -07:00
probablycorey
6bdfe65bf2 💄 2013-05-17 14:10:03 -07:00
probablycorey
5fd6c1c5ab Move windows var to AtomApplication 2013-05-17 14:09:54 -07:00
probablycorey
bab80e0089 AtomApplication creates the initial AtomWindow 2013-05-17 13:59:03 -07:00
probablycorey
be2cfb3252 Rename BrowserMain to AtomApplication 2013-05-17 13:54:08 -07:00
probablycorey
49bc53c6d2 Moving bootstrap methods out of BrowserWindow
The file is going pretty hairy, so I'm going to split the classes
into new files
2013-05-17 11:47:58 -07:00
probablycorey
067bbb966d 💄
This is a totally subjective style change. I just prefer keeping code
that is rarely changed tight and dense. Another option would be to 
move the menu templates into a separate file.
2013-05-17 10:51:12 -07:00
Kevin Sawicki
75508fe9e8 Allow more than 3 back ticks for fenced code blocks 2013-05-17 10:00:14 -07:00
Kevin Sawicki
49afce5f68 Register javascript fence names 2013-05-17 08:51:25 -07:00
Cheng Zhao
6260d350ac Should always show devtools instead of toggling when getting error. 2013-05-17 23:07:34 +08:00
Cheng Zhao
26c89f71b2 Use BrowserWindow's 'close' event instead of 'beforeunload' to control closing.
Ideally both window closing and reloading should use 'beforeunload' to
control whether the unloading should continue, however since the save as
dialog is asynchronous, we have to prevent unloading first and then
continue after user's confirmation. And since we can not distinguish
whether the window is reloading or closing in the 'beforeunload'
handler, we do not know what to continue after user's confirmation. So I
have to rely on BrowserWindow's 'close' event to let user decide whether
window should be closed.
2013-05-17 22:30:14 +08:00
Cheng Zhao
2d14f6e768 Replace default menu with custom built menu. 2013-05-17 22:14:09 +08:00
Cheng Zhao
b27cd33116 Implement atom.confirm with atom-shell's dialog API.
Note that the dialog.showMessageBox is blocking, so we don't need to use
the '@presentModal'.
2013-05-17 20:39:37 +08:00
Cheng Zhao
f0448ba231 Trigger 'window:close' command in the 'beforeunload' event handler.
When user wants to close the window, the 'beforeunload' event would be
called, then the closing would be cancelled and the 'window:close'
command would be triggered. In the 'window:close' handler, a confirm
dialog could be showed if there are unsaved contents, and if the window
is really meant to be closed, the window would be tried to be closed
again and this time 'beforeunload' handler wont't prevent it.
2013-05-17 20:17:06 +08:00
Cheng Zhao
acf5e21f50 Do unload work in 'unload' event handler instead of 'beforeunload'.
In Atom, the 'beforeunload' event never prevents window from closing so
it in fact has the same effect with 'unload' event, I guess using
'beforeunload' instead of 'unload' is because the 'beforeunload' is
guarrenteed to happen when window is closing or application is quiting.
However in Atom Shell the 'unload' event is guarrenteed to happen on
both conditions, just like the 'beforeunload' in Atom, so it's safe to
replace the 'beforeunload' with 'unload' here.

And in Atom Shell, the 'beforeunload' event is mainly used for
preventing window from closing, just like the 'window:close' command in
Atom.
2013-05-17 20:17:03 +08:00
Cheng Zhao
d1ca0a8f8f Use toggleDevTools instead of showDevTools. Fixes atom/atom-shell#8.
Currently the toggleDevTools of atom-shell is simulated by keeping state
of devtools, because there is no way to know the state of devtools in
brightray, so it could not behave correctly sometimes.

This problem will be solved when brightray is patched and atom-shel gets
updated.
2013-05-17 19:02:03 +08:00
Cheng Zhao
e7b35d27e7 Revert ae7dce4575.
Now require('package') won't wrong resolve to the package.json, so
reverting previous workaround.
2013-05-17 18:48:02 +08:00
Cheng Zhao
02e3f4cd9c Enable harmony collections, also revert previous WeakMap hack.
Fixed atom/atom-shell#7.
2013-05-17 16:21:01 +08:00
probablycorey
8487536280 Store parsed command line args in BrowserMain 2013-05-16 17:33:12 -07:00
Kevin Sawicki
84753e55a7 Add enable/disable helpers to jquery extensions 2013-05-16 17:29:48 -07:00
probablycorey
0c96b30053 Move setupNodePaths method to BrowserMain 2013-05-16 17:28:54 -07:00
probablycorey
27bd476b12 Moving logic into BrowserMain class 2013-05-16 17:25:39 -07:00
Kevin Sawicki
ed69dc12ab Serialize logged in username with view 2013-05-16 17:16:44 -07:00
Kevin Sawicki
e05b443a69 Tweak service name and warning text 2013-05-16 16:46:25 -07:00
Kevin Sawicki
a4455d2c5f Use released version of space-pen 2013-05-16 16:42:12 -07:00
probablycorey
8f17889f7f Open dialog creates new atom window 2013-05-16 16:38:47 -07:00
Kevin Sawicki
a965cb684c Add some commas to the paths loaded badge 2013-05-16 16:22:53 -07:00
probablycorey
f713429674 Remove unused params 2013-05-16 16:21:29 -07:00
Kevin Sawicki
392ffce8c7 Remove unused requires v0.10.0 2013-05-16 15:54:10 -07:00
Kevin Sawicki
d7a238b5ec Guard against possibly null event handler 2013-05-16 15:49:53 -07:00
probablycorey
92ec78cd8a Show dev tools when toggleDevTools is triggered
Eventually want make toggle work as expected. Related to https://github.com/atom/atom-shell/issues/8
2013-05-16 15:14:50 -07:00
probablycorey
889ccdb58d Throw error when sendMessageToBrowserProcess is called 2013-05-16 15:13:31 -07:00
Kevin Sawicki & Nathan Sobo
a29015551c Extract link click callback to method 2013-05-16 15:04:30 -07:00
Kevin Sawicki & Nathan Sobo
83e6a4a57e Rely on core:focus-next/previous in sign in view 2013-05-16 15:01:23 -07:00
Kevin Sawicki & Nathan Sobo
001183245e Add core:focus-next/focus-previous
Focus now cycles between elements with a positive tabindex on
tab and shift-tab.
2013-05-16 15:00:55 -07:00
probablycorey
09ab319328 Atom.show no longer used
The window is shown automatically when it is created.
2013-05-16 14:19:53 -07:00
Kevin Sawicki & Nathan Sobo
76e7161608 Extract window event handling into separate class 2013-05-16 14:18:57 -07:00
probablycorey
bc854afead Make messageIdCounter an instance var of window.atom 2013-05-16 13:48:16 -07:00
probablycorey
1e0b734734 Add hacked interface for WeakMap
We need to add the `--harmony_collections` flag to atom-shell.
Related to issue https://github.com/atom/atom-shell/issues/7
2013-05-16 13:46:17 -07:00
Kevin Sawicki & Nathan Sobo
848ce7936f DRY up subscribe and subscribeToCommand
subscribeToCommand now supports unsubscribing by object.
2013-05-16 13:43:18 -07:00
Kevin Sawicki & Nathan Sobo
d76d0a030f Forward all subscribe arguments from Subscriber to EventEmitter 2013-05-16 13:36:51 -07:00