当我点击elfinder中的自定义命令时,如何打开文件对话框进行上传

时间:2015-03-03 14:03:04

标签: javascript jquery elfinder

请帮帮我。我正在使用elfinder,我遇到了问题。

当我点击我的自定义命令时,我想打开'打开对话框'(用于上传)。我想实现自定义上传,怎么做?

这是我的代码:     

$().ready(function() {
//   elFinder.prototype.i18.en.messages['cmdeditimage'] = 'Edit Image';          
//    elFinder.prototype.i18.de.messages['cmdeditimage'] = 'Bild bearbeiten';
      elFinder.prototype._options.commands.push('My_command');
      elFinder.prototype.commands.My_command = function() {
        this.exec = function(hashes) {
          //request from server
        }
        this.getstate = function() {
            //return 0 to enable, -1 to disable icon access
            return 0;
        }
    }

    var elf = $('#elfinder').elfinder({
        resizable: false,
        lang: 'en',             // language (OPTIONAL)
        url : 'assets/elfinder/php/connector.php',  //connector URL
        width:'100%',
        uiOptions : {
            // toolbar configuration
            toolbar : [
                ['back', 'forward'],
                ['reload'],
                ['home', 'up'],
                ['mkdir', 'mkfile', 'upload'],
                ['open', 'download', 'getfile'],
                ['info'],
                ['quicklook'],
                ['copy', 'cut', 'paste'],
                ['rm'],
                ['duplicate', 'rename', 'edit', 'resize'],
                ['extract', 'archive'],
                ['search'],
                ['view'],
                ['help'],
                ['My_command']
            ]

            // directories tree options
        }
    }).elfinder('instance');
   });

</script>

0 个答案:

没有答案