mirror of
https://github.com/discourse/discourse.git
synced 2026-08-09 21:45:25 +08:00
This has been a no-op since 8f2f9e6afa in 2020, when we removed the JS
polyfill of `<details>`
28 lines
701 B
JavaScript
Vendored
28 lines
701 B
JavaScript
Vendored
import { withPluginApi } from "discourse/lib/plugin-api";
|
|
import { i18n } from "discourse-i18n";
|
|
import richEditorExtension from "../lib/rich-editor-extension";
|
|
|
|
function initializeDetails(api) {
|
|
api.addComposerToolbarPopupMenuOption({
|
|
action: function (toolbarEvent) {
|
|
toolbarEvent.applySurround(
|
|
"\n" + `[details="${i18n("composer.details_title")}"]` + "\n",
|
|
"\n[/details]\n",
|
|
"details_text",
|
|
{ multiline: false }
|
|
);
|
|
},
|
|
icon: "angle-right",
|
|
label: "details.title",
|
|
});
|
|
|
|
api.registerRichEditorExtension(richEditorExtension);
|
|
}
|
|
|
|
export default {
|
|
name: "apply-details",
|
|
|
|
initialize() {
|
|
withPluginApi(initializeDetails);
|
|
},
|
|
};
|