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
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions tinyfilemanager.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@
@include($config_file);
}

define('ACE_FONTSIZE', $ace_fontsize ?? 12);
define('ACE_THEME', $ace_theme ?? 'textmate');

// External CDN resources that can be used in the HTML (replace for GDPR compliance)
$external = array(
'css-bootstrap' => '<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">',
Expand Down Expand Up @@ -5164,7 +5167,7 @@ function confirmDailog(e, id = 0, title = "Action", content = "", action = null)
path: "ace/mode/<?php echo $ext; ?>",
inline: true
});
//editor.setTheme("ace/theme/twilight"); // Dark Theme
editor.setTheme("ace/theme/<?php echo ACE_THEME; ?>"); // Dark Theme
editor.setShowPrintMargin(false); // Hide the vertical ruler
function ace_commend(cmd) {
editor.commands.exec(cmd, editor);
Expand Down Expand Up @@ -5424,7 +5427,7 @@ function renderThemeMode() {
$themeEl.val(editor.getTheme());
$(function() {
//set default font size in drop down
$fontSizeEl.val(12).change();
$fontSizeEl.val(<?php echo ACE_FONTSIZE; ?>).change();
});
}

Expand Down