EnlighterJS / Plugin.TinyMCE

:pencil: Official EnlighterJS Plugin for TinyMCE
https://tinymce.enlighterjs.org
Mozilla Public License 2.0
11 stars 6 forks source link

TinyMCE plugin feedback #10

Closed ajtruckle closed 4 years ago

ajtruckle commented 4 years ago

Please see:

Window

  1. Theme. Is it possible for me to omit the Theme option from the window? Not all themes are displaying good in my support forum and if possible I would like to lock down the theme that anyone uses to Atomic.

  2. Linennumber offset There are two issues here:

    • It has a typo error because it should be Line number offset or maybe Start with line number.
    • It makes sense that this control comes before the Point out Lines control.
  3. Show Linennumbers This has a typo. It should really be Show Line numbers.

  4. Point out Lines I wonder if it is better to phrase this option as "Lines to highlight".

To me, I reckon:

It is obviously entirely your decision but there are two typos and it makes sense to swap the two controls around I think.

AndiDittrich commented 4 years ago

HI @ajtruckle ,

thanks for your feedback.

ajtruckle commented 4 years ago

Thanks. Looking at the documentation then I would use something like this to remove all unwanted themes:

// add a custom filter to modify the theme list
add_filter('enlighter_themes', function($themes){
    // DEBUG: just display the dataset - uncomment the following line to debug issues
    // echo '<pre>', print_r($themes, true), '</pre>';

    // unset the theme
    unset($themes['godzilla']);

    return $themes;
});

I assume that Standard (Atomic) will automatically show.

AndiDittrich commented 4 years ago

just return an array with 1 entry..thats more solid/future proof

ajtruckle commented 4 years ago

Ah, like:

// add a custom filter to modify the theme list
add_filter('enlighter_themes', function ($themes){
    // DEBUG: just display the dataset - uncomment the following line to debug issues
    // echo '<pre>', print_r($themes, true), '</pre>';

    // just show the Classic + Enlighter Theme 
    // Add a new custom theme named my_c_theme - shown as 'MyCustom Lalala Themes' in select boxes
    // Note: Custom themes CSS has to be loaded separately
    return array(
        'atomic' => 'Atomic',
     );
});
AndiDittrich commented 4 years ago

an empty array should also work in TinyMCE => theme not set => defaults are used

AndiDittrich commented 4 years ago

image

ajtruckle commented 4 years ago

Looks good!

Get Outlook for iOShttps://aka.ms/o0ukef


From: Andi Dittrich notifications@github.com Sent: Friday, April 17, 2020 10:51:08 AM To: EnlighterJS/Plugin.TinyMCE Plugin.TinyMCE@noreply.github.com Cc: ajtruckle truckleaj-software@hotmail.co.uk; Author author@noreply.github.com Subject: Re: [EnlighterJS/Plugin.TinyMCE] TinyMCE plugin feedback (#10)

[image]https://eur05.safelinks.protection.outlook.com/?url=https%3A%2F%2Fuser-images.githubusercontent.com%2F1474107%2F79556667-ae43f280-80a1-11ea-9928-f0583a1ff017.png&data=02%7C01%7C%7C4d4e99a2bf914870f80908d7e2b4daf7%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637227138695033474&sdata=3478NLIAJB1xhwTlfA3nEV70DKIXl6TkKkrOe8vEq5k%3D&reserved=0

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://eur05.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FEnlighterJS%2FPlugin.TinyMCE%2Fissues%2F10%23issuecomment-615154570&data=02%7C01%7C%7C4d4e99a2bf914870f80908d7e2b4daf7%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637227138695043466&sdata=SqPUUflOEbcEYs3R2q9Gl5eZhDF14iEtvaDOHMb9iOs%3D&reserved=0, or unsubscribehttps://eur05.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAB45RM2YA5VL2YOLIQMSLRTRNARAZANCNFSM4MKTANWQ&data=02%7C01%7C%7C4d4e99a2bf914870f80908d7e2b4daf7%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637227138695043466&sdata=i9LMmlg2qr8LqCUQrAR1dLXCXqXJhbWxcZtxAxShFdU%3D&reserved=0.

ajtruckle commented 4 years ago

an empty array should also work in TinyMCE => theme not set => defaults are used

That works great!