Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added ACE's font size and theme variables #1276

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nerun
Copy link
Contributor

@nerun nerun commented Jan 27, 2025

Setting the font size and theme every single time I edit a file is annoying. This PR address issue #1171.

That issue was about adding global variables to change the ACE editor theme and font size in config.php, the same way it happens in other configurations. PR #1200 only partially solved the issue of the font size not changing when editing tinyfilemanager.php directly.

With this PR I added global constants defined right after the inclusion of the config.php file. Their values ​​are conditional, and depend on whether or not there are variables defined in config.php. The code is super short, and easy to understand, it only changes 4 lines.

If you want to set custom values, just include these lines in config.php:

$ace_fontsize = 18;
$ace_theme = 'dracula';

Default values are 12 and textmate.

I tried using normal global variables instead of using constants, but it didn't work. For some reason when I add <?php echo $variable; ?> to set font size and theme it doesn't work, but when I use constant it works: <?php echo CONSTANT; ?>.

I'm open to suggestions, it's always good to learn.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants