mirror of
https://github.com/discourse/discourse.git
synced 2026-08-14 13:58:53 +08:00
This change affects any caret icon across the app to be converted to an angle icon. **Before** <img width="462" height="150" alt="CleanShot 2026-02-04 at 15 53 10@2x" src="https://github.com/user-attachments/assets/adf52ce6-b958-4650-bf99-836203884640" /> **After** <img width="454" height="136" alt="CleanShot 2026-02-04 at 15 50 22@2x" src="https://github.com/user-attachments/assets/eea2f844-fdc7-4fa7-98f5-af393ae835b8" />
34 lines
853 B
JavaScript
Vendored
34 lines
853 B
JavaScript
Vendored
/* eslint-disable ember/no-jquery */
|
|
import $ from "jquery";
|
|
import { withPluginApi } from "discourse/lib/plugin-api";
|
|
import { i18n } from "discourse-i18n";
|
|
import richEditorExtension from "../lib/rich-editor-extension";
|
|
|
|
function initializeDetails(api) {
|
|
api.decorateCooked(($elem) => $("details", $elem), {
|
|
id: "discourse-details",
|
|
});
|
|
|
|
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);
|
|
},
|
|
};
|