javascript - Elfinder如何自定义菜单

标签 javascript jquery elfinder

您好,我正在使用 elfinder,我想删除删除和清空文件夹选项。我该如何删除它。这是我的代码。

<script>
        $(function() {
            $('#elfinder').elfinder({   // 1st Arg - options
                    cssAutoLoad : false,// Disable CSS auto loading
                    baseUrl : './',// Base URL to css/*, js/*
                    url : 'php/connector.minimal.php',// Connector URL
                    getFileCallback : function(file) {/* ... */},// Callback when a file is double-clicked
                    width: '100%',
                    height: $(window).height() - 20                                                            
                });
        });</script>

最佳答案

试试这个代码:

<script>
$(function() {
    $('#elfinder').elfinder(
    // 1st Arg - options
    {
        // Disable CSS auto loading
        cssAutoLoad: false,
        // Base URL to css/*, js/*
        baseUrl: './',
        // Connector URL
        url: 'php/connector.minimal.php',
        // Callback when a file is double-clicked
        getFileCallback: function(file) {
            // ...
        },
        uiOptions: {
            // toolbar configuration
            toolbar: [
                ['home', 'back', 'forward', 'up', 'reload'],
                ['mkdir', 'mkfile', 'upload'],
                ['open', 'download', 'getfile'],
                ['undo', 'redo'],
                ['copy', 'cut', 'paste'],
                ['duplicate', 'rename', 'edit', 'resize', 'chmod'],
                ['selectall', 'selectnone', 'selectinvert'],
                ['quicklook', 'info'],
                ['extract', 'archive'],
                ['search'],
                ['view', 'sort'],
                ['fullscreen']
            ]
        },
        contextmenu: {
            // navbarfolder menu
            navbar: ['open', 'download', '|', 'upload', 'mkdir', '|', 'copy', 'cut', 'paste', 'duplicate', '|', '|', 'rename', '|', 'places', 'info', 'chmod', 'netunmount'],
            // current directory menu
            cwd: ['undo', 'redo', '|', 'back', 'up', 'reload', '|', 'upload', 'mkdir', 'mkfile', 'paste', '|', '|', 'view', 'sort', 'selectall', 'colwidth', '|', 'info', '|', 'fullscreen', '|'],
            // current directory file menu
            files: ['getfile', '|', 'open', 'download', 'opendir', 'quicklook', '|', 'upload', 'mkdir', '|', 'copy', 'cut', 'paste', 'duplicate', '|', 'empty', '|', 'rename', 'edit', 'resize', '|', 'archive', 'extract', '|', 'selectall', 'selectinvert', '|', 'places', 'info', 'chmod', 'netunmount']
        },
        width: '100%',
        height: $(window).height() - 20
    });
});
</script>

您还可以从 elFinder.options.js 文件自定义菜单。已经在 client configuration 中提到了所有内容查看...!!!

关于javascript - Elfinder如何自定义菜单,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46234378/

相关文章:

javascript - 模态对话框中的 CKEditor 和 elFinder

javascript - 计算器的脚本计算范围错误

javascript - 如何将 Backbone 函数作为参数传递

javascript - 带有 javascript onclick 的多个 DOM 操作函数

javascript - 按主行展开/折叠行分组?

javascript - 在 elFinder 中禁用多个文件选择

jquery - Elfinder:Dev 工作,但 'identical' Live 不会将内容 blob 输入 MySQL

javascript - 无法显示 WEB-INF 中的 html 页面

javascript - 我如何告诉 CSS 重新计算 :first-of-type after DOM dynamically changes?

javascript - Angular JS,如何将URL参数传递给angularJS中的$resource?