Commit Graph

75 Commits

Author SHA1 Message Date
Ross Allen
28f157acd9 Document MenuItem enabled and visible
The Electron MenuItem[1] `enabled` and `visible` options are exposed to
Atom context menus in menu_helpers.coffee[2] but are not yet documented.
Both options are passed through to Electron.

[1] http://electron.atom.io/docs/v0.31.0/api/menu-item/
[2] https://github.com/atom/atom/blob/v1.0.7/src/menu-helpers.coffee#L49
2015-08-26 09:00:23 -07:00
Lee Dohm
5884525648 📝 Add returns Disposable to ContextMenuManager.add 2015-05-31 05:27:38 -07:00
Ivan Zuzak
46ab8e7f63 Link to section in API docs for ContextMenuManager::add 2015-04-26 11:23:13 +02:00
Kevin Sawicki
84bab1c67b Use selector validator provided by clear-cut 2015-04-13 18:03:14 -07:00
Kevin Sawicki
4c6722832b ⬆️ clear-cut@2.0 2015-04-13 18:01:40 -07:00
Kevin Sawicki
5449658011 Remove specificity caching now handled by clear-cut 2015-04-13 17:47:25 -07:00
Kevin Sawicki
80787ef1e2 Remove try/catch around package.json requiring
No other requires are ever guarded against and the package.json should
be assumed to be valid JSON.
2015-04-08 09:30:40 -07:00
Kevin Sawicki
ca67d33ebe Use inlined context menu from package.json when available 2015-04-08 09:16:56 -07:00
Kevin Sawicki
7d592c8b78 includeDeprecations -> includeDeprecatedAPIs 2015-04-03 11:29:16 -07:00
Kevin Sawicki
23d1c72a5f Remove unused imports 2015-04-03 11:29:14 -07:00
Kevin Sawicki
4884e32a3d Conditionally include deprecations in ContextMenuManager 2015-04-03 11:29:11 -07:00
Kevin Sawicki
590a4b0fd5 Add explicit return after for loop 2015-03-19 11:48:40 -07:00
Kevin Sawicki
ce33e63532 selector-parser -> selector-validator 2015-03-04 10:02:04 -08:00
Kevin Sawicki
1bb011deed 🎨 2015-03-04 10:02:04 -08:00
Kevin Sawicki
c172f78ab5 Use consistent selector error 2015-03-04 10:02:03 -08:00
Kevin Sawicki
5902bc42e9 Throw error when adding context menu with invalid selector 2015-03-04 10:02:03 -08:00
Max Brunsfeld
02a6ed554d Make ContextMenuManager::showForEvent private
Signed-off-by: Nathan Sobo <nathan@github.com>
2015-01-09 15:47:30 -08:00
Ben Ogle
a47782ddd8 Fix context menu docs Closes #4963 2015-01-09 13:28:57 -08:00
Ben Ogle
3b5bb1501c 💄 2015-01-06 17:09:59 -08:00
Ben Ogle
8c4c15c17a Fix colons in examples 2015-01-06 17:03:29 -08:00
Ben Ogle
f7f2f4497b Add docs for cson format to menu manager 2015-01-06 16:51:15 -08:00
Ben Ogle
d4c4ab58b1 More information in the context menu docs 2015-01-06 16:45:31 -08:00
Nathan Sobo
6770570f13 Don't call Grim.deprecate for undefined context menus
This preserves the original behavior, in which passing undefined to
atom.contextMenu.add was a no-op that returned a no-op disposable.

Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2014-11-11 16:24:02 -07:00
Nathan Sobo
1eb3d8bf99 Use ‘atom-text-editor’ custom tag name for TextEditorElement 2014-10-09 07:39:14 -07:00
Nathan Sobo
8941b97ed2 Use ‘atom-workspace’ custom tag name for WorkspaceElement 2014-10-09 07:39:14 -07:00
Nathan Sobo
6b9345a97d Avoid double clone of menu item now that helper does it 2014-10-08 15:56:13 -07:00
Nathan Sobo
6ce5356505 Fix handling of submenus in conversion of legacy context menu format 2014-10-02 10:47:03 -06:00
Nathan Sobo
b2cc28fb5b Rename commandOptions to commandDetail on context menu items 2014-09-30 12:15:56 -06:00
Nathan Sobo
eb929cb7a2 Honor item specificity while still preserving addition order
Rather than using order to specify item precedence, we now construct
a set of menu items for each element traversing upward from the target.
When merging items for a given element, we pass the specificity to the
merge function, which uses it to decide whether or not to clobber
existing items. When assembling the overall menu, we don’t ever clobber
to ensure that items added for elements closer to the target always win
over items matching further up the tree.
2014-09-30 12:06:27 -06:00
Nathan Sobo
cf80b92f9a Remove logging 2014-09-30 12:06:27 -06:00
Nathan Sobo
36d5359ef4 Restore original context menu ordering
Previously I used CSS specificity to order the most specific / recently
added menu items for a given element *first* when building up the
context menu. When a duplicate label was found for a given menu I would
refrain from inserting it. Now instead I order things the opposite way.
The most specific / recently added items come later and items with the
same label are clobbered by later items.
2014-09-30 12:06:26 -06:00
Nathan Sobo
915cfe15f5 Clear context menus between specs 2014-09-30 12:06:26 -06:00
Nathan Sobo
f9bf42db64 Remove commented line 2014-09-30 12:06:26 -06:00
Nathan Sobo
ff76e36f7d Only display ‘Inspect Element’ item in dev mode 2014-09-30 12:06:26 -06:00
Nathan Sobo
740778e129 Auto-detect context menu items in the old format 2014-09-30 12:06:26 -06:00
Nathan Sobo
483e746439 Use new format for platform menus 2014-09-30 12:06:26 -06:00
Nathan Sobo
aec6df828e fixup! Call context menu item ::created hooks with the click event 2014-09-30 12:06:09 -06:00
Nathan Sobo
703197bcca Deprecate old style calls to ContextMenuManager::add 2014-09-30 12:06:09 -06:00
Nathan Sobo
2142c8e63e :public: Document new ContextMenuManager::add API 2014-09-30 12:06:09 -06:00
Nathan Sobo
782f9c609e Add shouldDisplay hook for context menu items
If present, if a falsy value is returned from this function for a given
context menu invocation, the item will not be displayed.
2014-09-30 12:06:09 -06:00
Nathan Sobo
3a567b3c5b Call context menu item ::created hooks with the click event 2014-09-30 12:06:08 -06:00
Nathan Sobo
c5b395579b Add devMode flag to individual items 2014-09-30 12:06:08 -06:00
Nathan Sobo
f8225a6441 Make arguments atom.contextMenu.add consistent with atom.menu.add 2014-09-30 12:06:08 -06:00
Ben Ogle
6379f87b8a ContextMenuManager is Extended 2014-09-16 13:40:37 -07:00
Ben Ogle
70e1d14f96 Add KeymapManager::onDidLoadBundledKeymaps 2014-09-10 17:28:47 -07:00
Ivan Žužak
a00b3b2cc9 Merge pull request #3394 from atom/iz-builtin-context-menu-commands
Add cut/copy/paste built-in context menu items
2014-08-28 20:41:21 +02:00
Ivan Zuzak
096255f283 Support built-in context menu items 2014-08-27 13:54:55 +02:00
Ben Ogle
a296364e53 Fixup doc strings that don’t parse correctly
We can’t have a huge indent on the second line of a list item. Markdown
parses it as a code block. :(
2014-08-26 10:47:36 -07:00
Kevin Sawicki
af67671f60 📝 Convert ContextMenuManager docs 2014-08-25 15:08:45 -07:00
Ivan Zuzak
cd1a17fb0a Support multiple separators in context menu 2014-07-14 17:10:13 -07:00