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

enabling ace editor live autocomplete feature #1072

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
9 changes: 9 additions & 0 deletions tinyfilemanager.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@
'css-font-awesome' => '<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" crossorigin="anonymous">',
'css-highlightjs' => '<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.6.0/styles/' . $highlightjs_style . '.min.css">',
'js-ace' => '<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.13.1/ace.js"></script>',
'js-aceext-language_tools' => '<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.4.12/ext-language_tools.js"></script>',
'js-bootstrap' => '<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-OERcA2EqjJCMA+/3y+gxIOqMEjwtxJY7qPCqsdltbNJuaOe923+mo//f6V8Qbsw3" crossorigin="anonymous"></script>',
'js-dropzone' => '<script src="https://cdnjs.cloudflare.com/ajax/libs/dropzone/5.9.3/min/dropzone.min.js"></script>',
'js-jquery' => '<script src="https://code.jquery.com/jquery-3.6.1.min.js" integrity="sha256-o88AwQnZB+VDvE9tvIXrMQaPlFFSUTR+nldQm1LuPXQ=" crossorigin="anonymous"></script>',
Expand Down Expand Up @@ -4163,10 +4164,18 @@ function confirmDailog(e, id = 0, title = "Action", content = "", action = null)
$ext = $ext == "js" ? "javascript" : $ext;
?>
<?php print_external('js-ace'); ?>
<?php print_external('js-aceext-language_tools'); ?>
<script>
ace.require("ace/ext/language_tools");
var editor = ace.edit("editor");
editor.getSession().setMode( {path:"ace/mode/<?php echo $ext; ?>", inline:true} );
//editor.setTheme("ace/theme/twilight"); //Dark Theme
// enable autocompletion and snippets
editor.setOptions({
enableBasicAutocompletion: true,
enableSnippets: true,
enableLiveAutocompletion: true
});
editor.setShowPrintMargin(false); // Hide the vertical ruler
function ace_commend (cmd) { editor.commands.exec(cmd, editor); }
editor.commands.addCommands([{
Expand Down