-
Notifications
You must be signed in to change notification settings - Fork 168
document extending the new menu in files app #1839
Conversation
7fac1ba
to
8b3ab9d
Compare
Nice, thanks 👍 |
}); | ||
} | ||
}; | ||
OC.Plugins.register('OCA.Files.NewFileMenu', myNewFileEntry); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
may I suggest renaming this to myFileMenuPlugin
instead ?
Because at this point you can add several entries.
Optionally you could also hack/override/extend the existing function classes to make them do additional stuff.
@PVince81 done :P |
Great 👍 |
OC.Plugins.register('OCA.Files.NewFileMenu', myFileMenuPlugin); | ||
|
||
This will register a new menu entry in the "New" menu of the files app. The | ||
method ``attach()`` is called once the menu is build. This usually happens right |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/build/built/
Looks perty. |
document extending the new menu in files app
OC.Plugins.register('OCA.Files.NewFileMenu', myFileMenuPlugin); | ||
|
||
This will register a new menu entry in the "New" menu of the files app. The | ||
method ``attach()`` is called once the menu is built. This usually happens right |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it called once, or everytime the button is pressed? might be interesting to know
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @PVince81
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The menu is created when first clicking the "+" button. Then it is reused for subsequent clicks.
This means that the plugin is only called once.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe saying "is called once when the menu is built" will get that across.
I'm trying to get this functionality working in 9.0. I've added the code above to my |
@devuan2 see how the text editor adds its entry: https://github.com/owncloud/files_texteditor/blob/master/js/editor.js#L606 |
Ah, perfect. Thank you. |
cc @PVince81 @otetard
Ref owncloud/core#20051