Skip to content

Commit

Permalink
Merge branch '2.x' of github.com:Studio-42/elFinder into 2.x
Browse files Browse the repository at this point in the history
Conflicts:
	js/i18n/elfinder.LANG.js
  • Loading branch information
troex committed Jul 9, 2011
2 parents d878b15 + 7aabd28 commit 9d43cb0
Show file tree
Hide file tree
Showing 9 changed files with 187 additions and 48 deletions.
38 changes: 34 additions & 4 deletions css/dialog.css
Expand Up @@ -24,6 +24,9 @@
.std42-dialog .ui-dialog-titlebar-close,
.std42-dialog .ui-dialog-titlebar-close:hover { padding:1px; }

.elfinder-rtl .elfinder-dialog .ui-dialog-titlebar { text-align:right; }
.elfinder-rtl .elfinder-dialog .ui-dialog-titlebar .ui-dialog-titlebar-close { right:auto; left:.3em; }

/* content */
.std42-dialog .ui-dialog-content {
padding:.3em .5em;
Expand Down Expand Up @@ -57,11 +60,18 @@
background:url("../img/dialogs.png") 0 0 no-repeat;
}

.elfinder-rtl .elfinder-dialog-icon { left:auto; right:12px;}



/*********************** ERROR DIALOG **************************/

.elfinder-dialog-error .ui-dialog-content,
.elfinder-dialog-confirm .ui-dialog-content { padding-left: 56px; min-height:35px; }

.elfinder-rtl .elfinder-dialog-error .ui-dialog-content,
.elfinder-rtl .elfinder-dialog-confirm .ui-dialog-content { padding-left:0; padding-right: 56px; }

/*********************** NOTIFY DIALOG **************************/

.elfinder-dialog-notify .ui-dialog-titlebar-close { display:none; }
Expand All @@ -72,11 +82,14 @@
border-bottom:1px solid #ccc;
position:relative;
padding:.5em;
padding-left:30px;

text-align:center;
overflow:hidden;
}

.elfinder-ltr .elfinder-notify { padding-left:30px; }
.elfinder-rtl .elfinder-notify { padding-right:30px; }

.elfinder-notify:last-child { border:0 solid; }

/* progressbar */
Expand Down Expand Up @@ -199,11 +212,28 @@
}


/* dialog for elFinder itself */
.dialogelfinder .dialogelfinder-drag {
border-left:0 solid;
border-top:0 solid;
border-right:0 solid;
font-weight:normal;
font-size:.9em;
padding:2px 12px;
cursor:move;
position:relative;
text-align:left;
}

.elfinder-rtl .dialogelfinder-drag { text-align:right;}

.dialogelfinder-drag-close {
position: absolute;
top:50%;
margin-top:-8px;
}




.elfinder-ltr .dialogelfinder-drag-close { right:12px; }
.elfinder-rtl .dialogelfinder-drag-close { left:12px; }


38 changes: 17 additions & 21 deletions elfinder.src.html
Expand Up @@ -86,8 +86,10 @@

<script src="js/i18n/elfinder.en.js" type="text/javascript" charset="utf-8"></script>
<script src="js/i18n/elfinder.ru.js" type="text/javascript" charset="utf-8"></script>
<script src="js/i18n/elfinder.ar.js" type="text/javascript" charset="utf-8"></script>

<script src="js/proxy/elFinderSupportVer1.js" type="text/javascript" charset="utf-8"></script>
<script src="js/jquery.dialogelfinder.js" type="text/javascript" charset="utf-8"></script>


<style type="text/css">
Expand Down Expand Up @@ -118,30 +120,19 @@
$().ready(function() {


var f1 = $('#finder').elfinder({
$('#finder').elfinder({
url : 'php/connector.php',
// transport : new elFinderSupportVer1(),
getFileCallback : function(files, fm) {
console.log(files);
// fm.destroy()
},
handlers : {
load : function(e, fm) {
// fm.error('All your base belongs to us >_<')
}
// open : function(e, fm) {
// // console.log(e)
// // console.log(fm)
// var d = fm.exec('upload').fail(function(error) {
// // fm.log('fail '+error)
// }).done(function(data) {
// // fm.log(data)
// })
// }
},
// width:650,
lang : 'ru'
}).elfinder('instance')
})

// $('#finder2').elfinder({
// url : 'connectors/php/connector.php',
Expand Down Expand Up @@ -170,16 +161,21 @@
})

$('#dialog').click(function() {
var f = $('<div/>'),
opts = {

$('<div/>').dialogelfinder({
url : 'php/connector.php',
_getFileCallback : function(files) {
console.log(this)
// this.destroy()
// f.elfinder('destory')
lang : 'en',
width : 840,
getFileCallback : function(files, fm) {
console.log(files);
},
commandsOptions : {
getfile : {
oncomplete : 'destroy',
folders : true
}
}
}
f.elfinder(opts).dialog()
})

})

Expand Down
22 changes: 16 additions & 6 deletions js/elFinder.js
Expand Up @@ -6,6 +6,7 @@
**/
window.elFinder = function(node, opts) {
this.time('load');

var self = this,

/**
Expand Down Expand Up @@ -173,15 +174,15 @@ window.elFinder = function(node, opts) {
* @type String
* @default "auto"
**/
width = this.options.width || 'auto',
width = 'auto',

/**
* elFinder node height
*
* @type Number
* @default 300
* @default 400
**/
height = parseInt(this.options.height) || 300,
height = 400,

beeper = $(document.createElement('audio')).hide().appendTo('body')[0],

Expand Down Expand Up @@ -1190,6 +1191,7 @@ window.elFinder = function(node, opts) {
*/
this.resize = function(w, h) {
node.css('width', w).height(h).trigger('resize');
this.trigger('resize', {width : node.width(), height : node.height()});
}

/**
Expand Down Expand Up @@ -1244,7 +1246,7 @@ window.elFinder = function(node, opts) {
if (!this.options.url) {
return alert(this.i18n('errURL'));
}

$.extend($.ui.keyCode, {
'F1' : 112,
'F2' : 113,
Expand Down Expand Up @@ -1507,8 +1509,16 @@ window.elFinder = function(node, opts) {
minHeight : 200
});

// update size
this.resize(width, height);
if (this.options.width) {
width = this.options.width;
}

if (this.options.height) {
height = parseInt(this.options.height);
}

// update size
self.resize(width, height);

// attach events to document
$(document)
Expand Down
35 changes: 26 additions & 9 deletions js/elFinder.options.js
@@ -1,6 +1,8 @@
/**
* Default elFinder config
*
* @type Object
* @autor Dmitry (dio) Levashov
*/
elFinder.prototype.options = {
/**
Expand Down Expand Up @@ -28,21 +30,38 @@ elFinder.prototype.options = {
* @default null
* @example
* transport : {
* init : function(elfinderInstance) { },
* send : function(options) {
* var dfrd = $.Deferred();
* // connect to backend ...
* return dfrd;
* },
* upload : function(data) {
* var dfrd = $.Deferred();
* // upload ...
* return dfrd;
* }
*
* }
**/
transport : {
// init : function(o) { console.log(o) }
// upload : 'iframe'
},
transport : {},

/**
* Allow to drag and drop to upload files
*
* @type Boolean|String
* @default 'auto'
*/
dragUploadAllow : 'auto',

/**
* Timeout for upload using iframe
*
* @type Number
* @default 0 - no timeout
*/
iframeTimeout : 0,

/**
* Data to append to all requests and to upload files
*
Expand Down Expand Up @@ -86,8 +105,6 @@ elFinder.prototype.options = {
'cut', 'paste', 'edit', 'extract', 'archive', 'search', 'info', 'view', 'help'
],

// commands : ['edit'],

/**
* Commands options.
*
Expand Down Expand Up @@ -204,7 +221,7 @@ elFinder.prototype.options = {
* @type Number
* @default "auto"
*/
height : 415,
height : 400,

/**
* Make elFinder resizable if jquery ui resizable available
Expand Down Expand Up @@ -313,8 +330,8 @@ elFinder.prototype.options = {
/**
* Debug config
*
* @type Array|Boolen
* @type Array|Boolean
*/
// debug : true
debug : ['error', 'warning', 'backend-debug_', 'event-viewchange']
debug : ['error', 'warning']
}
2 changes: 1 addition & 1 deletion js/i18n/elfinder.LANG.js
Expand Up @@ -4,7 +4,7 @@
* use this file to create new translation
**/
if (elFinder && elFinder.prototype && typeof(elFinder.prototype.i18) == 'object') {
elFinder.prototype.i18.XX = {
elFinder.prototype.i18.LANG = {
translator : 'Translator name &lt;translator@email.tld&gt;',
language : 'Language of translation',
direction : 'ltr',
Expand Down
2 changes: 1 addition & 1 deletion js/i18n/elfinder.ar.js
@@ -1,6 +1,6 @@
"use strict"
if (elFinder && elFinder.prototype && typeof(elFinder.prototype.i18) == 'object') {
elFinder.prototype.i18.en = {
elFinder.prototype.i18.ar = {
translator : 'Tawfek Daghistani &lt;tawfekov@gmail.com&gt;',
language : 'Arabic', /** Syrian Localization , it may differ if you aren't from Syria or any Country in Middle East**/
direction : 'rtl',
Expand Down

0 comments on commit 9d43cb0

Please sign in to comment.