tinyfilemanager icon indicating copy to clipboard operation
tinyfilemanager copied to clipboard

Config theme and font size [enhancement]

Open nerun opened this issue 1 year ago • 4 comments

I know that i can change default theme in TFM 2.5.3 by editing line 4168.

lines 4165-9:

<script>
    var editor = ace.edit("editor");
    editor.getSession().setMode( {path:"ace/mode/<?php echo $ext; ?>", inline:true} );
    //editor.setTheme("ace/theme/twilight"); //Dark Theme
    editor.setShowPrintMargin(false); // Hide the vertical ruler

And to change default font size, edit line 4183:

    $themeEl.val( editor.getTheme() );
    $fontSizeEl.val(12).change(); //set default font size in drop down
}

PS.: change default font size do not render in the new size, but always in font 12. If you set to 18, ace will open in 12, but shows 18.

It works well, but would be better if there is a variable to change in config.php for both default theme and font size.

nerun avatar May 06 '24 14:05 nerun

Thank you, @nerun, for your suggestion. We will take it into consideration for inclusion in a future release.

prasathmani avatar May 07 '24 02:05 prasathmani

@nerun to adjust the font size, please use the following updated code:

Replace this: $fontSizeEl.val(12).change(); // set default font size in dropdown with this: $(function() { $fontSizeEl.val(18).change(); }); //set default font size in drop down

@prasathmani I have submitted a pull request https://github.com/prasathmani/tinyfilemanager/pull/1200. Please review it at your earliest convenience. Thank you!

awais300 avatar Jun 23 '24 15:06 awais300

Works like a charm

nerun avatar Jun 23 '24 16:06 nerun

Please, reopen it

This issue is about add variables to change theme and font size in config.php, the same way that happens in other settings. PR #1200 just resolve font size not changing when editing tinyfilemanager.php directly. For example, if i could add these to config.php:

$EDITOR_FONTSIZE = 12;
$EDITOR_THEME = "ace/theme/textmate";

Would be easier.

nerun avatar Jun 24 '24 12:06 nerun