mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 09:41:29 +08:00
913fd3a7b3
Why this change? Previously just using the `addToolbarPopupMenuOptionsCallback` plugin API itself was insufficient because it required the return object to include an `action` key which only accepted a name of the action function as a string. This was highly problematic because the action function had to be defined on the `composer` service which means using the `modifyClass` API to add the action function. This made the API awkward to use leading to poor developer experiencec. What does this change do? This commit introduces a couple of improvemnts to the API. 1. First the API has been renamed to `addComposerToolbarPopupMenuOption` because the API no longer accepts a callback function which was quite redundant. Instead, it now accepts an Object. The `addToolbarPopupMenuOptionsCallback` API function is deprecated and will be dropped in Discourse 3.3. Note that passing the API a function is still supported but will be dropped when the `addToolbarPopupMenuOptionsCallback` is removed. 2. The `action` key in the Object passed to the function can now be a function and is passed the `toolbarEvent` object when called. 3. The `condition` on key in the Object passed to the function can now be a function and is passed the `composer` service when called. |
||
---|---|---|
.. | ||
assets | ||
config | ||
spec/components | ||
test/javascripts | ||
LICENSE | ||
plugin.rb | ||
README.md |
discourse-details
HTML 5.1 <details>
polyfill for Discourse.
NOTE: Does not work on IE9, but we don't support IE9 as of Jan 1 2016.
Usage
In your posts, surround text with [details=your summary]
... [/details]
.
For example:
I watched the murder mystery on TV last night. [details=Who did it?]The butler did it[/details].
Installation
Follow our Install a Plugin howto, using
git clone https://github.com/discourse/discourse-details.git
as the plugin command.
Issues
If you have issues or suggestions for the plugin, please bring them up on Discourse Meta.
License
MIT