Skip to content

Commit

Permalink
fixes Studio-42#63, elFinder.prototype.options renamed into elFinder.…
Browse files Browse the repository at this point in the history
…prototype._options to avoid overwrite while init elFinder
  • Loading branch information
dio-el-claire committed Jul 14, 2011
1 parent f94af37 commit 9c48e74
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 10 deletions.
1 change: 1 addition & 0 deletions css/toolbar.css
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
.elfinder-button-icon-view-list { background-position: 0 -464px; }
.elfinder-button-icon-help { background-position: 0 -480px; }
.elfinder-button-icon-resize { background-position: 0 -512px; }
.elfinder-button-icon-search { background-position: 0 -561px; }


/* button with dropdown menu*/
Expand Down
13 changes: 12 additions & 1 deletion elfinder.src.html
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,18 @@
// fm.error('All your base belongs to us >_<')
}
},
lang : 'ru'
lang : 'ru',
// ui : ['tree', 'toolbar'],
// commands : [],
// commandsOptions : {
// getfile : {
// onlyURL : true,
// multiple : true
// }
// },
// uiOptions : {
// toolbar : [['help']]
// }
})

// $('#finder2').elfinder({
Expand Down
Binary file modified img/src/toolbar.pxm
Binary file not shown.
Binary file modified img/toolbar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 17 additions & 3 deletions js/elFinder.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,22 @@ window.elFinder = function(node, opts) {
*
* @type Object
**/
this.options = $.extend(true, {}, this.options, opts||{});
this.options = $.extend(true, {}, this._options, opts||{});

if (opts.ui) {
this.options.ui = opts.ui;
}

if (opts.commands) {
this.options.commands = opts.commands;
}

if (opts.uiOptions && opts.uiOptions.toolbar) {
this.options.uiOptions.toolbar = opts.uiOptions.toolbar;
}

$.extend(this.options.contextmenu, opts.contextmenu);


/**
* Ajax request type
Expand Down Expand Up @@ -1435,7 +1449,7 @@ window.elFinder = function(node, opts) {
this.options.commands = [];
}
// check required commands
$.each(['open', 'reload', 'back', 'forward', 'up', 'home', 'info', 'search', 'quicklook', 'getfile', 'help'], function(i, cmd) {
$.each(['open', 'reload', 'back', 'forward', 'up', 'home', 'info', 'quicklook', 'getfile', 'help'], function(i, cmd) {
$.inArray(cmd, self.options.commands) === -1 && self.options.commands.push(cmd);
});

Expand Down Expand Up @@ -1483,7 +1497,7 @@ window.elFinder = function(node, opts) {
title : '&nbsp;',
width : 280
}),
statusbar : $('<div class="ui-widget-header ui-helper-clearfix ui-corner-bottom elfinder-statusbar"/>').appendTo(node)
statusbar : $('<div class="ui-widget-header ui-helper-clearfix ui-corner-bottom elfinder-statusbar"/>').hide().appendTo(node)
}

// load required ui
Expand Down
4 changes: 2 additions & 2 deletions js/elFinder.options.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @type Object
* @autor Dmitry (dio) Levashov
*/
elFinder.prototype.options = {
elFinder.prototype._options = {
/**
* Connector url. Required!
*
Expand Down Expand Up @@ -328,7 +328,7 @@ elFinder.prototype.options = {
// navbarfolder menu
navbar : ['open', '|', 'copy', 'cut', 'paste', 'duplicate', '|', 'rm', '|', 'info'],
// current directory menu
cwd : ['reload', 'back', '|', 'upload', 'mkdir', 'mkfile', 'paste', '|', 'search', '|', 'info'],
cwd : ['reload', 'back', '|', 'upload', 'mkdir', 'mkfile', 'paste', '|', 'info'],
// current directory file menu
files : ['getfile', '|','open', 'quicklook', '|', 'download', '|', 'copy', 'cut', 'paste', 'duplicate', '|', 'rm', '|', 'edit', 'rename', '|', 'archive', 'extract', '|', 'info']
},
Expand Down
4 changes: 2 additions & 2 deletions js/ui/contexmenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ $.fn.elfindercontextmenu = function(fm) {
}),
subpos = fm.direction == 'ltr' ? 'left' : 'right',
types = $.extend({}, fm.options.contextmenu),
tpl = '<div class="elfinder-contextmenu-item"><span class="elfinder-button-icon {icon} elfinder-contextmenu-icon"/><span>{label}</span></div>',
tpl = '<div class="elfinder-contextmenu-item"><span class="elfinder-button-icon {icon} elfinder-contextmenu-icon"/><span>{label} {icon}</span></div>',
item = function(label, icon, callback) {
return $(tpl.replace('{icon}', icon ? 'elfinder-button-icon-'+icon : '').replace('{label}', label))
return $(tpl.replace('{icon}', icon ? 'elfinder-button-icon-'+icon : '').replace('{icon}', icon).replace('{label}', label))
.click(function(e) {
e.stopPropagation();
e.stopPropagation();
Expand Down
2 changes: 1 addition & 1 deletion php/connector.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function debug($o) {
print_r($o);
}

// exit();
// exit('{"api":"2.0","uplMaxSize":"16M","options":{"archives":{"create":[],"extract":[]},"copyOverwrite":true,"disabled":[],"path":"Home","separator":"/","tmbUrl":"/files/","url":"/files/tmb/"},"cwd":{"path":"Home","thumbUrl":"/files/","filesUrl":"/files/tmb/","dirs":1,"date":"14.07.2011","mime":"directory","hash":"SG9tZQ==","phash":"","name":"Home","read":1,"write":0,"rm":0},"files":[{"dirs":1,"date":"14.07.2011","mime":"directory","hash":"SG9tZQ==","phash":"","name":"Home","read":1,"write":0,"rm":0}]}');
/**
* Simple logger function.
* Demonstrate how to work with elFinder event api.
Expand Down
2 changes: 1 addition & 1 deletion php/elFinderVolumeDriver.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ public function options($hash) {
'path' => $this->path($hash),
'url' => $this->URL,
'tmbUrl' => $this->tmbURL,
'disabled' => array(), //$this->disabled,
'disabled' => $this->disabled,
'separator' => $this->separator,
'copyOverwrite' => intval($this->options['copyOverwrite']),
'archivers' => array(
Expand Down

0 comments on commit 9c48e74

Please sign in to comment.