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
  • Loading branch information
dio-el-claire committed Feb 27, 2013
2 parents 12ec5c8 + 24eee26 commit c5a49d4
Show file tree
Hide file tree
Showing 16 changed files with 443 additions and 39 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ Features
* Local file system, MySQL, FTP volume storage drivers
* Background file upload with Drag & Drop HTML5 support
* List and Icons view
* Kayboard shortcuts
* Standart methods of file/group selection using mouse or keyboard
* Keyboard shortcuts
* Standard methods of file/group selection using mouse or keyboard
* Move/Copy files with Drag & Drop
* Archives create/extract (zip, rar, 7z, tar, gzip, bzip2)
* Rich context menu and toolbar
Expand Down
7 changes: 6 additions & 1 deletion css/dialog.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
/*********************************************/

/* common dialogs class */
.std42-dialog { padding:0; }
.std42-dialog {
padding:0;
position:absolute;
left:auto;
right:auto;
}

/* titlebar */
.std42-dialog .ui-dialog-titlebar {
Expand Down
1 change: 1 addition & 0 deletions elfinder.src.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
<script src="js/i18n/elfinder.ca.js"></script>
<script src="js/i18n/elfinder.cs.js"></script>
<script src="js/i18n/elfinder.de.js"></script>
<script src="js/i18n/elfinder.el.js"></script>
<script src="js/i18n/elfinder.en.js"></script>
<script src="js/i18n/elfinder.es.js"></script>
<script src="js/i18n/elfinder.fa.js"></script>
Expand Down
4 changes: 2 additions & 2 deletions js/commands/download.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ elFinder.prototype.commands.download = function() {
var sel = this.fm.selected(),
cnt = sel.length;

return !this._disabled && cnt && (!$.browser.msie || cnt == 1) && cnt == filter(sel).length ? 0 : -1;
return !this._disabled && cnt && (!fm.UA.IE || cnt == 1) && cnt == filter(sel).length ? 0 : -1;
}

this.exec = function(hashes) {
Expand Down Expand Up @@ -58,7 +58,7 @@ elFinder.prototype.commands.download = function() {
$(iframes).each(function() {
$('#' + $(this).attr('id')).remove();
});
}, $.browser.mozilla? (20000 + (10000 * i)) : 1000); // give mozilla 20 sec + 10 sec for each file to be saved
}, fm.UA.Firefox? (20000 + (10000 * i)) : 1000); // give mozilla 20 sec + 10 sec for each file to be saved
});
fm.trigger('download', {files : files});
return dfrd.resolve(hashes);
Expand Down
2 changes: 1 addition & 1 deletion js/commands/quicklook.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ elFinder.prototype.commands.quicklook = function() {
*
* @type Number
**/
// keydown = $.browser.mozilla || $.browser.opera ? 'keypress' : 'keydown',
// keydown = fm.UA.Firefox || fm.UA.Opera ? 'keypress' : 'keydown',
/**
* navbar icon class
*
Expand Down
2 changes: 1 addition & 1 deletion js/commands/quicklook.plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ elFinder.prototype.commands.quicklook.plugins = [
preview = ql.preview,
active = false;

if (($.browser.safari && navigator.platform.indexOf('Mac') != -1) || $.browser.msie) {
if ((fm.UA.Safari && fm.OS == 'mac') || fm.UA.IE) {
active = true;
} else {
$.each(navigator.plugins, function(i, plugins) {
Expand Down
14 changes: 7 additions & 7 deletions js/commands/resize.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ elFinder.prototype.commands.resize = function() {
if (typeof animate == 'undefined') {
animate = true;
}
if (! animate || $.browser.opera || ($.browser.msie && parseInt($.browser.version) < 9)) {
if (! animate || fm.UA.Opera || fm.UA.ltIE8) {
imgr.rotate(value);
} else {
imgr.animate({rotate: value + 'deg'});
Expand Down Expand Up @@ -364,7 +364,7 @@ elFinder.prototype.commands.resize = function() {
resizable = function(destroy) {
if ($.fn.resizable) {
if (destroy) {
rhandle.resizable('destroy');
rhandle.filter(':ui-resizable').resizable('destroy');
rhandle.hide();
}
else {
Expand All @@ -381,8 +381,8 @@ elFinder.prototype.commands.resize = function() {
croppable = function(destroy) {
if ($.fn.draggable && $.fn.resizable) {
if (destroy) {
rhandlec.resizable('destroy');
rhandlec.draggable('destroy');
rhandlec.filter(':ui-resizable').resizable('destroy');
rhandlec.filter(':ui-draggable').draggable('destroy');
basec.hide();
}
else {
Expand Down Expand Up @@ -579,7 +579,7 @@ elFinder.prototype.commands.resize = function() {
}).attr('id', id);

// for IE < 9 dialog mising at open second+ time.
if ($.browser.msie && parseInt($.browser.version) < 9) {
if (fm.UA.ltIE8) {
$('.elfinder-dialog').css('filter', '');
}

Expand Down Expand Up @@ -666,7 +666,7 @@ elFinder.prototype.commands.resize = function() {

$.fn.rotate = function(val) {
if (typeof val == 'undefined') {
if ($.browser.opera) {
if (!!window.opera) {
var r = this.css('transform').match(/rotate\((.*?)\)/);
return ( r && r[1])?
Math.round(parseFloat(r[1]) * 180 / Math.PI) : 0;
Expand All @@ -688,7 +688,7 @@ elFinder.prototype.commands.resize = function() {
$(fx.elem).rotate(fx.now);
};

if ($.browser.msie && parseInt($.browser.version) < 9) {
if (typeof window.addEventListener == "undefined" && typeof document.getElementsByClassName == "undefined") { // IE & IE<9
var GetAbsoluteXY = function(element) {
var pnode = element;
var x = pnode.offsetLeft;
Expand Down
33 changes: 29 additions & 4 deletions js/elFinder.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,31 @@ window.elFinder = function(node, opts) {
**/
this.OS = navigator.userAgent.indexOf('Mac') !== -1 ? 'mac' : navigator.userAgent.indexOf('Win') !== -1 ? 'win' : 'other';

/**
* User browser UA.
* jQuery.browser: version deprecated: 1.3, removed: 1.9
*
* @type Object
**/
this.UA = (function(){
var webkit = !document.uniqueID && !window.opera && !window.sidebar && window.localStorage && typeof window.orientation == "undefined";
return {
// Browser IE <= IE 6
ltIE6:typeof window.addEventListener == "undefined" && typeof document.documentElement.style.maxHeight == "undefined",
// Browser IE <= IE 7
ltIE7:typeof window.addEventListener == "undefined" && typeof document.querySelectorAll == "undefined",
// Browser IE <= IE 8
ltIE8:typeof window.addEventListener == "undefined" && typeof document.getElementsByClassName == "undefined",
IE:document.uniqueID,
Firefox:window.sidebar,
Opera:window.opera,
Webkit:webkit,
Chrome:webkit && window.chrome,
Safari:webkit && !window.chrome,
Mobile:typeof window.orientation != "undefined"
}
})();

/**
* Configuration options
*
Expand Down Expand Up @@ -458,7 +483,7 @@ window.elFinder = function(node, opts) {
}
})();

this.viewType = this.storage('view') || this.options.defaultView || 'icons',
this.viewType = this.storage('view') || this.options.defaultView || 'icons';

this.sortType = this.storage('sortType') || this.options.sortType || 'name';

Expand Down Expand Up @@ -750,7 +775,7 @@ window.elFinder = function(node, opts) {
var file = files[hash],
url = file && file.tmb && file.tmb != 1 ? cwdOptions['tmbUrl'] + file.tmb : '';

if (url && ($.browser.opera || $.browser.msie)) {
if (url && (this.UA.Opera || this.UA.IE)) {
url += '?_=' + new Date().getTime();
}
return url;
Expand Down Expand Up @@ -1959,7 +1984,7 @@ elFinder.prototype = {
}),
name = 'iframe-'+self.namespace+(++self.iframeCnt),
form = $('<form action="'+self.uploadURL+'" method="post" enctype="multipart/form-data" encoding="multipart/form-data" target="'+name+'" style="display:none"><input type="hidden" name="cmd" value="upload" /></form>'),
msie = $.browser.msie,
msie = this.UA.IE,
// clear timeouts, close notification dialog, remove form/iframe
onload = function() {
abortto && clearTimeout(abortto);
Expand Down Expand Up @@ -2141,7 +2166,7 @@ elFinder.prototype = {

xhr.send(formData);

if (!$.browser.safari || !data.files) {
if (!this.UA.Safari || !data.files) {
notifyto = startNotify();
}

Expand Down
Loading

0 comments on commit c5a49d4

Please sign in to comment.