장비 편집기 메뉴에 왜 이렇게 많은 옵션이 있나요?

안녕하세요,

이렇게 하면 터치 기기에 새로운 사전 포맷된 텍스트(Preformatted text) 버튼을 추가할 수 있습니다.

새로운 컴포넌트 Common/Header 섹션에 다음 내용을 추가하세요.

<script type="text/discourse-plugin" version="0.8">
  const container = Discourse.__container__;
  this.capabilities = container.lookup("capabilities:main");

  if (this.capabilities.touch) {
    api.onToolbarCreate(function(toolbar) {
      toolbar.addButton({
        id: "code",
        group: "insertions",
        preventFocus: true,
        trimLeading: true,
        action: "formatCode",
      });
    });
  }
</script>

Common/CSS 섹션에 이것을 추가하세요. 이렇게 하면 팝업 메뉴에서 사전 포맷된 텍스트 버튼이 숨겨집니다.

.select-kit.dropdown-select-box.toolbar-popup-menu-options {
  li[data-value="applyFormatCode"] {
    display: none;
  }
}

4개의 좋아요