Commit Graph

66 Commits

Author SHA1 Message Date
Nathan Sobo
fb5d826d84 Force native event handler to be registered for activation commands
We use onWillDispatch internally to manage activation commands,
activating packages *before* the activation command starts dispatching.
This means we need to explicitly tell the command registry to subscribe
to the command in question.
2014-10-08 11:56:50 -07:00
Nathan Sobo
cdb4ed1327 Integrate jQuery::on and ::trigger with command registry dispatch 2014-10-08 11:56:50 -07:00
Nathan Sobo
740778e129 Auto-detect context menu items in the old format 2014-09-30 12:06:26 -06:00
Ben Ogle
f57dbfd9f5 Deprecate configDefaults in packages. 2014-09-29 16:08:03 -07:00
Ben Ogle
fc3ba775c8 Support schemas in packages 2014-09-29 16:08:03 -07: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
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
Kevin Sawicki
8c2bcf3943 Catch and log deactivate errors
Closes #3538
2014-09-15 08:34:54 -07:00
Ben Ogle
f8b17b6b3c Add Returns line to all the event subscription methods 2014-09-10 17:07:21 -07:00
Ben Ogle
6a0a842de4 Update section comments 2014-09-10 11:52:57 -07:00
Ben Ogle
2e219f288d Add sections for docs clarity 2014-09-09 15:55:47 -07:00
Ben Ogle
0afd8a1392 Add Package::onDidDeactivate 2014-09-09 15:09:18 -07:00
Kevin Sawicki
18016ae9df 💄 Use unless instead of if not 2014-07-31 08:33:36 -07:00
Maximilian Schüßler
62b52cb70a In devmode do not load incompatible from cache 2014-07-31 16:24:29 +02:00
Kevin Sawicki
9dc59b9807 💄 2014-07-25 17:12:03 -07:00
Kevin Sawicki
15689ebfb5 📝 2014-07-25 17:11:33 -07:00
Kevin Sawicki
6250419fcb containsNativeModule -> isNativeModule 2014-07-25 17:09:46 -07:00
Kevin Sawicki
70621afe62 📝 2014-07-25 17:08:10 -07:00
Kevin Sawicki
7b07d7116b Store string in local storage 2014-07-25 16:06:35 -07:00
Kevin Sawicki
f175086865 Always return boolean from Package::isCompatible 2014-07-25 15:56:09 -07:00
Kevin Sawicki
c6071a9802 Don't throw incompatible error, log instead 2014-07-25 15:49:34 -07:00
Kevin Sawicki
ac138c1dc8 Throw error when activating incompatible package 2014-07-25 15:46:35 -07:00
Kevin Sawicki
d47348e8f9 Cache incompatible modules in local storage 2014-07-25 15:34:03 -07:00
Kevin Sawicki
1ea909d4db Check installed packages for working native modules
Test require each native module in each installed package to make sure
it can be required successfully in Atom.
2014-07-25 15:19:16 -07:00
Ben Ogle
bbe02fc6b0 Load packages with the fallback variables 2014-07-11 14:07:48 -07:00
Kevin Sawicki
0369d77c85 Ensure grammars are only activated once 2014-06-24 16:21:56 -07:00
Kevin Sawicki
5529f13cc6 Only create grammar load promise once 2014-06-23 17:33:05 -07:00
Kevin Sawicki
6aeca79d1b Return empty promise when already loaded 2014-06-23 16:13:13 -07:00
Kevin Sawicki
e76b24f8ad Catch error 2014-06-23 16:04:25 -07:00
Kevin Sawicki
968ab0e41d Remove unused methods 2014-06-23 16:02:45 -07:00
Kevin Sawicki
f3d87b1653 Set packageName property on Grammar objects 2014-06-23 15:58:06 -07:00
Ben Ogle
0dadce1047 Serialize all included grammar scopes 2014-06-20 17:04:21 -07:00
Ben Ogle
8c3bfaa3a2 Return when grammars are already loaded 2014-06-20 17:04:21 -07:00
Ben Ogle
f8b8b22b75 Preload grammars on deserialization 2014-06-20 17:04:21 -07:00
Nathan Sobo
f10076c87d Prevent activation events from bubbling
The react editor is wrapped in another div with the class of .editor for
backward compatibility. This prevents activation events registered on
the .editor selector from being triggered twice.
2014-04-22 17:10:21 -06:00
Kevin Sawicki
690fc7180a Defer requiring of $ in Package
This is needed in the case that the package manager is being used
in the browser process to open a URL.

Closes #1869
2014-04-17 13:53:00 -07:00
Nathan Sobo
65564e2012 Rename atom.keymap to atom.keymaps 2014-03-31 16:28:55 -06:00
Kevin Sawicki
8cb66895f0 Check that activations events are present
Having an empty array, object, or string will now be treated
as no activation events.

This was reported as being confusing since people were just clearing
the array generated by the package generator but their packages weren't
activating.
2014-03-11 16:15:30 -07:00
Kevin Sawicki
b4e8d5480c Use Q.all 2014-02-17 14:07:18 -08:00
Kevin Sawicki
a149056408 Remove unnecessary rejection 2014-02-17 13:12:38 -08:00
Kevin Sawicki
94f26b99cc grammarsPromise not grammarPromise 2014-02-17 13:00:29 -08:00
Kevin Sawicki
3f8d9a4c47 Combine AtomPackage and Package 2014-02-17 12:59:03 -08:00
Kevin Sawicki
eb885357e6 Memoize AtomPackage/ThemePackage 2014-02-17 12:10:49 -08:00
Kevin Sawicki
95e68c8c2b Store metadata in Package constructor 2014-02-17 11:31:20 -08:00
Kevin Sawicki
3f5cd19ddc Add missing path. prefix 2014-02-17 11:29:29 -08:00
Kevin Sawicki
d0dd0a9882 Rename e variables to error 2014-02-17 11:29:11 -08:00
Kevin Sawicki
2d52f3deac Rename path variables to packagePath 2014-02-17 11:28:55 -08:00
Kevin Sawicki
fa376d9543 Remove TextMatePackage 2014-02-17 11:26:58 -08:00