MD Composer 附加内容

Just in case anyone wants to hide ALL the buttons from non-staff users, here is my code:

body:not(.staff) .d-editor-button-bar {
    /* Hide specific buttons */
    button {    
        /* Inline buttons */
        &.align_justify_button, 
        &.align_right_button,
        &.align_center_button,
        &.subscript_button,
        &.superscript_button,
        &.strikethrough_button,
        &.underline_button
        {
            display: none;
        }
        
        /* Popup menu */
        &.toolbar-popup-menu-options {
            [data-name="Float left"],
            /* ... */ {
                display: none;
            }
        }
    }
}
2 个赞

I’m now getting a display bug where the extra dropdown “gear” button doesn’t display anything other than a loading bar when I have this theme component installed. This seems to only happen on mobile

1 个赞

NVIDIA_Share_vDawBTzSO5

It seems I completely forgot to update the API for mobile in my previous PR. :man_facepalming:

I will make a new PR ASAP.

2 个赞

Sorry for the wait – I had forgotten about that. :derp:


@piffy
Thanks to Steven, the PR has been merged. :clap:

5 个赞

Any chance we could also add buttons for hightlight?

<mark>hightlight</mark>

Our staff uses that frequently and would like to have a composer button for that

You could try Composer Highlighted Button

1 个赞

Oh sweet, that’s even better! Thx for sharing

1 个赞

@Steven it looks like this TC has disappeared from GitHub, was this deliberate?

https://github.com/iunctis/md-composer-extras has gone 404

1 个赞

I messed up this week and had to recreate the componant on github and it lost the redirection

This link should work

https://github.com/MonDiscourse/md-composer-extras

2 个赞

This theme component seems to break (here) on 3.5.0.beta8-dev

Uncaught (in promise) TypeError: e.getModel() is undefined
    default api-setup.js:129
    eZ plugin-api.gjs:232
    Ember 2
    _decorateCookedElement composer-editor.gjs:546
    previewUpdated composer-editor.gjs:937
    18150 decorated-html.gjs:28
    Z Ember
    18150 decorated-html.gjs:28
    compute helper-fn.js:41
    Ember 73
2 个赞

Thanks for the report, I think it was an old code, that didn’t serve any purpose. I’ve deleted this part, updated the component and it works fine

3 个赞