Nathan Sobo
756a389ccf
Don't require Workspace in WorkspaceView
2014-09-25 21:28:09 -06:00
Nathan Sobo
06e0919597
Revert "Make $::view return __spacePenView from the first element if present"
...
This reverts commit edaf1e2ced .
2014-09-25 20:45:18 -06:00
Nathan Sobo
0afe2a55e9
Handle direct construction of WorkspaceView in a better way
2014-09-25 20:40:11 -06:00
Nathan Sobo
039d87caa0
Allow WorkspaceView to be instantiated directly for compatibility
2014-09-25 20:17:04 -06:00
Nathan Sobo
edaf1e2ced
Make $::view return __spacePenView from the first element if present
2014-09-25 20:16:40 -06:00
Nathan Sobo
4b746deb73
Move shell command installation entirely into CommandInstaller
2014-09-25 13:11:15 -06:00
Nathan Sobo
4207752a08
Rename deprecatedViewEvents to deprecateViewEvents
2014-09-25 12:42:12 -06:00
Nathan Sobo
a5781d65c3
Remove methods carried over from old view
2014-09-25 12:36:44 -06:00
Nathan Sobo
9d2bb71109
More cleanup
2014-09-25 12:35:08 -06:00
Nathan Sobo
eaa90e6158
Clean up debugging
2014-09-25 12:33:05 -06:00
Nathan Sobo
187e300167
Apply workaround for clearing of focus upon loading of window
...
After the first window focus event, the focus is getting cleared back
to document.body regardless of the prior active element. Refocusing
workspace on a delay after the first window focus event works around
the problem.
2014-09-25 11:56:29 -06:00
Nathan Sobo
670f3e4946
Add WorkspaceElement
2014-09-25 11:41:09 -06:00
Nathan Sobo
ae488fc7fe
Update document edited status in workspace model
...
This also fixes a previous oversight where the status wasn’t updated
when switching between pane items with different modified status.
2014-09-24 17:00:25 -06:00
Nathan Sobo
28deb9dec5
Maintain document.title in the workspace model, not the view
2014-09-24 16:26:54 -06:00
Nathan Sobo
1c58438124
Move PaneContainerView::confirmClose to the model layer
2014-09-24 15:46:01 -06:00
Nathan Sobo
3e0477ffcb
Move shell command installation to workspace model
2014-09-24 15:28:35 -06:00
Nathan Sobo
368ef59b85
Remove stray log
2014-09-24 15:28:34 -06:00
Nathan Sobo
465d2afd95
Remove the old root view properly
2014-09-24 15:28:34 -06:00
Nathan Sobo
32f0eb4f76
Don’t emit repeated attached events for the same PaneView
2014-09-24 15:28:34 -06:00
Nathan Sobo
60a551b308
Only dispose PaneElement subscriptions when pane is destroyed
...
Not when the element is detached, because it might be reattached.
2014-09-24 15:28:34 -06:00
Nathan Sobo
da87f321e8
Add PaneAxisElement
2014-09-24 15:28:34 -06:00
Nathan Sobo
2cc6c9e4c0
💄
2014-09-24 15:28:34 -06:00
Nathan Sobo
887a7bcaf4
Restore $.fn.element property
...
We define element in certain space-pen views, but this makes it
available for all jQuery objects. Can’t remove it from the prototype.
2014-09-24 15:28:34 -06:00
Nathan Sobo
df37d77895
Remove Pane::getViewClass as we now use a view provider
2014-09-24 15:28:34 -06:00
Nathan Sobo
cf8dc29cc5
Use Pane::onDidAddItem instead of ::observeItems
...
The former includes the index at which the item was added and the latter
does not.
2014-09-24 15:28:33 -06:00
Nathan Sobo
de29ca6906
Keep existing PaneView SpacePen API working as before
...
We will eventually deprecate all access to views via
`atom.workspaceView`, which is the only way to get a reference to
instances of PaneView. Draining the swamp!
2014-09-24 15:28:33 -06:00
Nathan Sobo
4ba3162f3e
Handle pane commands on PaneElement via command registry
2014-09-24 15:28:33 -06:00
Nathan Sobo
2710c06313
WIP: First stab at custom element for panes
...
Still need to create a SpacePen shim for access via `atom.workspaceView`
property so we’re backward compatible with packages, but it basically
works.
2014-09-24 15:28:33 -06:00
Nathan Sobo
7d71eeedf4
Break command dispatch as soon as currentTarget is null
2014-09-24 15:28:02 -06:00
Nathan Sobo
6d55bab4c8
Fix CommandRegistry::get/restoreSnapshot
...
I didn’t realize that deepClone was not handling functions correctly.
I’ve implemented clone manually to the exact depth needed instead.
2014-09-24 15:26:38 -06:00
Nathan Sobo
d506ccbaad
Merge pull request #3611 from atom/ns-activation-commands
...
Activation commands
2014-09-24 15:06:52 -06:00
Kevin Sawicki
8275ddd882
Catch errors thrown watching config file
...
Closes #3617
2014-09-24 13:54:27 -07:00
Nathan Sobo
b7765d9416
Process commands invoked with jQuery trigger in CommandRegistry
...
Especially in specs, trigger has been used to invoke events. jQuery does
not invoke native listeners in this situation, so we use ::on to listen
for them instead. If we didn’t handle the event with a native capture
handler, we’ll still support invoking via trigger.
2014-09-24 14:34:29 -06:00
Nathan Sobo
63181a17c8
Support activationCommands field in package.json
...
This field mandates selectors in its structure and closely matches the
API of `atom.commands.add`. It will supplant `activationEvents` moving
forward.
2014-09-24 14:34:28 -06:00
Nathan Sobo
c71457e9d4
Default selector to .workspace when subscribing to activation events
2014-09-24 14:34:28 -06:00
Nathan Sobo
7d31b17273
Use the CommandRegistry to register activation event listeners
...
Commands registered with the command registry will always be handled
first, so as long as we disable any listeners in the registry that were
already invoked for the current command, we don’t need to disable jQuery
methods before replaying the command after activating the package.
This commit adds the ability to call .disableInvokedListeners on the
event passed to the command listeners. This returns a function which
can be called to reenable them.
2014-09-24 14:34:28 -06:00
Nathan Sobo
066f6bf03c
Forward stop[Immediate]Propagation to original event in CommandRegistry
...
Previously, stopping propagation would work on the synthetic bubbling
phase of the command registry itself, but the original event would
continue to propagate which is counterintuitive.
2014-09-24 14:34:28 -06:00
Nathan Sobo
40f8b990d0
Handle dispatching non-existent commands
2014-09-24 14:34:28 -06:00
Nathan Sobo
a492596f7f
Allow atom.commands to participate in activationEvents
...
* Activation events can be handled via atom.commands
* Pre-existing listeners registered via atom.commands are disabled when
replaying events for the activated package.
2014-09-24 14:34:28 -06:00
Nathan Sobo
2df5957f9b
Restore commands after each spec
...
This commit adds the ability to get and restore snapshots of command
listeners. Whatever commands are installed before specs begin are
preserved, but commands added during specs are always cleared away.
2014-09-24 14:34:28 -06:00
Nathan Sobo
09b5ac887a
Return whether a dispatched command matched a listener
2014-09-24 14:34:28 -06:00
Nathan Sobo
67ff8f4382
Don’t clear commands after specs
...
Commands are typically registered once at eval time. Clearing them
means that commands aren’t available except in the first spec.
2014-09-24 14:34:27 -06:00
Nathan Sobo
0c9fd46030
Add CommandRegistry::dispatch for tests
2014-09-24 14:34:27 -06:00
Kevin Sawicki
371e25af69
Disable deprecations unless in dev/spec mode
...
These are currently adding ~200ms to startup so temporarily disable
until the grim performance is improved and/or core and bundled packages
are updated to not call deprecated APIs.
2014-09-24 10:24:27 -07:00
Kevin Sawicki
00f67122c4
📝 Mark atom.commands experimental
...
The CommandRegistry class is still experimental and 404-ing in the
API docs on atom.io
2014-09-23 14:19:10 -07:00
Nathan Sobo
3dbaa0679b
Merge pull request #3587 from atom/ns-workspace-view-providers
...
Add view provider API to Workspace
2014-09-23 13:08:00 -06:00
Ben Ogle
3bc115a7a0
Merge pull request #3606 from atom/bo-model-placeholder-text
...
Model EditorView::setPlaceholderText
2014-09-23 11:20:23 -07:00
Ben Ogle
d4f7e710f4
Reorder properties by usage
2014-09-22 17:28:20 -07:00
Ben Ogle
4606ce2d50
Model setPlaceholderText
...
Less dependence on the editorView!
2014-09-22 17:21:42 -07:00
Ben Ogle
021208d933
Update Cursor::onDidChangePosition doc string
2014-09-22 16:12:51 -07:00