Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/wp-conte.../plugins/wp-file-.../lib/js/ui
File: dialog.js
/**
[0] Fix | Delete
* @class elFinder dialog
[1] Fix | Delete
*
[2] Fix | Delete
* @author Dmitry (dio) Levashov
[3] Fix | Delete
**/
[4] Fix | Delete
jQuery.fn.elfinderdialog = function(opts, fm) {
[5] Fix | Delete
"use strict";
[6] Fix | Delete
var platformWin = (window.navigator.platform.indexOf('Win') != -1),
[7] Fix | Delete
delta = {},
[8] Fix | Delete
syncSize = { enabled: false, width: false, height: false, defaultSize: null },
[9] Fix | Delete
fitSize = function(dialog) {
[10] Fix | Delete
var opts, node;
[11] Fix | Delete
if (syncSize.enabled) {
[12] Fix | Delete
node = fm.options.dialogContained? elfNode : jQuery(window);
[13] Fix | Delete
opts = {
[14] Fix | Delete
maxWidth : syncSize.width? node.width() - delta.width : null,
[15] Fix | Delete
maxHeight: syncSize.height? node.height() - delta.height : null
[16] Fix | Delete
};
[17] Fix | Delete
Object.assign(restoreStyle, opts);
[18] Fix | Delete
dialog.css(opts).trigger('resize');
[19] Fix | Delete
if (dialog.data('hasResizable') && (dialog.resizable('option', 'maxWidth') < opts.maxWidth || dialog.resizable('option', 'maxHeight') < opts.maxHeight)) {
[20] Fix | Delete
dialog.resizable('option', opts);
[21] Fix | Delete
}
[22] Fix | Delete
}
[23] Fix | Delete
},
[24] Fix | Delete
syncFunc = function(e) {
[25] Fix | Delete
var dialog = e.data;
[26] Fix | Delete
syncTm && cancelAnimationFrame(syncTm);
[27] Fix | Delete
syncTm = requestAnimationFrame(function() {
[28] Fix | Delete
var opts, offset;
[29] Fix | Delete
if (syncSize.enabled) {
[30] Fix | Delete
fitSize(dialog);
[31] Fix | Delete
}
[32] Fix | Delete
});
[33] Fix | Delete
},
[34] Fix | Delete
checkEditing = function() {
[35] Fix | Delete
var cldialog = 'elfinder-dialog',
[36] Fix | Delete
dialogs = elfNode.children('.' + cldialog + '.' + fm.res('class', 'editing') + ':visible');
[37] Fix | Delete
fm[dialogs.length? 'disable' : 'enable']();
[38] Fix | Delete
},
[39] Fix | Delete
propagationEvents = {},
[40] Fix | Delete
syncTm, dialog, elfNode, restoreStyle;
[41] Fix | Delete
[42] Fix | Delete
if (fm && fm.ui) {
[43] Fix | Delete
elfNode = fm.getUI();
[44] Fix | Delete
} else {
[45] Fix | Delete
elfNode = this.closest('.elfinder');
[46] Fix | Delete
if (! fm) {
[47] Fix | Delete
fm = elfNode.elfinder('instance');
[48] Fix | Delete
}
[49] Fix | Delete
}
[50] Fix | Delete
[51] Fix | Delete
if (typeof opts === 'string') {
[52] Fix | Delete
if ((dialog = this.closest('.ui-dialog')).length) {
[53] Fix | Delete
if (opts === 'open') {
[54] Fix | Delete
if (dialog.css('display') === 'none') {
[55] Fix | Delete
// Need dialog.show() and hide() to detect elements size in open() callbacks
[56] Fix | Delete
dialog.trigger('posinit').show().trigger('open').hide();
[57] Fix | Delete
dialog.fadeIn(120, function() {
[58] Fix | Delete
fm.trigger('dialogopened', {dialog: dialog});
[59] Fix | Delete
});
[60] Fix | Delete
}
[61] Fix | Delete
} else if (opts === 'close' || opts === 'destroy') {
[62] Fix | Delete
dialog.stop(true);
[63] Fix | Delete
if (dialog.is(':visible') || elfNode.is(':hidden')) {
[64] Fix | Delete
dialog.trigger('close');
[65] Fix | Delete
fm.trigger('dialogclosed', {dialog: dialog});
[66] Fix | Delete
}
[67] Fix | Delete
if (opts === 'destroy') {
[68] Fix | Delete
dialog.remove();
[69] Fix | Delete
fm.trigger('dialogremoved', {dialog: dialog});
[70] Fix | Delete
} else if (dialog.data('minimized')) {
[71] Fix | Delete
dialog.data('minimized').close();
[72] Fix | Delete
}
[73] Fix | Delete
} else if (opts === 'toTop') {
[74] Fix | Delete
dialog.trigger('totop');
[75] Fix | Delete
fm.trigger('dialogtotoped', {dialog: dialog});
[76] Fix | Delete
} else if (opts === 'posInit') {
[77] Fix | Delete
dialog.trigger('posinit');
[78] Fix | Delete
fm.trigger('dialogposinited', {dialog: dialog});
[79] Fix | Delete
} else if (opts === 'tabstopsInit') {
[80] Fix | Delete
dialog.trigger('tabstopsInit');
[81] Fix | Delete
fm.trigger('dialogtabstopsinited', {dialog: dialog});
[82] Fix | Delete
} else if (opts === 'checkEditing') {
[83] Fix | Delete
checkEditing();
[84] Fix | Delete
}
[85] Fix | Delete
}
[86] Fix | Delete
return this;
[87] Fix | Delete
}
[88] Fix | Delete
[89] Fix | Delete
opts = Object.assign({}, jQuery.fn.elfinderdialog.defaults, opts);
[90] Fix | Delete
[91] Fix | Delete
if (opts.allowMinimize && opts.allowMinimize === 'auto') {
[92] Fix | Delete
opts.allowMinimize = this.find('textarea,input').length? true : false;
[93] Fix | Delete
}
[94] Fix | Delete
opts.openMaximized = opts.allowMinimize && opts.openMaximized;
[95] Fix | Delete
if (opts.headerBtnPos && opts.headerBtnPos === 'auto') {
[96] Fix | Delete
opts.headerBtnPos = platformWin? 'right' : 'left';
[97] Fix | Delete
}
[98] Fix | Delete
if (opts.headerBtnOrder && opts.headerBtnOrder === 'auto') {
[99] Fix | Delete
opts.headerBtnOrder = platformWin? 'close:maximize:minimize' : 'close:minimize:maximize';
[100] Fix | Delete
}
[101] Fix | Delete
[102] Fix | Delete
if (opts.modal && opts.allowMinimize) {
[103] Fix | Delete
opts.allowMinimize = false;
[104] Fix | Delete
}
[105] Fix | Delete
[106] Fix | Delete
if (fm.options.dialogContained) {
[107] Fix | Delete
syncSize.width = syncSize.height = syncSize.enabled = true;
[108] Fix | Delete
} else {
[109] Fix | Delete
syncSize.width = (opts.maxWidth === 'window');
[110] Fix | Delete
syncSize.height = (opts.maxHeight === 'window');
[111] Fix | Delete
if (syncSize.width || syncSize.height) {
[112] Fix | Delete
syncSize.enabled = true;
[113] Fix | Delete
}
[114] Fix | Delete
}
[115] Fix | Delete
[116] Fix | Delete
propagationEvents = fm.arrayFlip(opts.propagationEvents, true);
[117] Fix | Delete
[118] Fix | Delete
this.filter(':not(.ui-dialog-content)').each(function() {
[119] Fix | Delete
var self = jQuery(this).addClass('ui-dialog-content ui-widget-content'),
[120] Fix | Delete
clactive = 'elfinder-dialog-active',
[121] Fix | Delete
cldialog = 'elfinder-dialog',
[122] Fix | Delete
clnotify = 'elfinder-dialog-notify',
[123] Fix | Delete
clhover = 'ui-state-hover',
[124] Fix | Delete
cltabstop = 'elfinder-tabstop',
[125] Fix | Delete
cl1stfocus = 'elfinder-focus',
[126] Fix | Delete
clmodal = 'elfinder-dialog-modal',
[127] Fix | Delete
id = parseInt(Math.random()*1000000),
[128] Fix | Delete
titlebar = jQuery('<div class="ui-dialog-titlebar ui-widget-header ui-corner-top ui-helper-clearfix"><span class="elfinder-dialog-title">'+opts.title+'</span></div>'),
[129] Fix | Delete
buttonset = jQuery('<div class="ui-dialog-buttonset"></div>'),
[130] Fix | Delete
buttonpane = jQuery('<div class=" ui-helper-clearfix ui-dialog-buttonpane ui-widget-content"></div>')
[131] Fix | Delete
.append(buttonset),
[132] Fix | Delete
btnWidth = 0,
[133] Fix | Delete
btnCnt = 0,
[134] Fix | Delete
tabstops = jQuery(),
[135] Fix | Delete
evCover = jQuery('<div style="width:100%;height:100%;position:absolute;top:0px;left:0px;"></div>').hide(),
[136] Fix | Delete
numberToTel = function() {
[137] Fix | Delete
if (opts.optimizeNumber) {
[138] Fix | Delete
dialog.find('input[type=number]').each(function() {
[139] Fix | Delete
jQuery(this).attr('inputmode', 'numeric');
[140] Fix | Delete
jQuery(this).attr('pattern', '[0-9]*');
[141] Fix | Delete
});
[142] Fix | Delete
}
[143] Fix | Delete
},
[144] Fix | Delete
tabstopsInit = function() {
[145] Fix | Delete
tabstops = dialog.find('.'+cltabstop);
[146] Fix | Delete
if (tabstops.length) {
[147] Fix | Delete
tabstops.attr('tabindex', '-1');
[148] Fix | Delete
if (! tabstops.filter('.'+cl1stfocus).length) {
[149] Fix | Delete
buttonset.children('.'+cltabstop+':'+(platformWin? 'first' : 'last')).addClass(cl1stfocus);
[150] Fix | Delete
}
[151] Fix | Delete
}
[152] Fix | Delete
},
[153] Fix | Delete
tabstopNext = function(cur) {
[154] Fix | Delete
var elms = tabstops.filter(':visible:enabled'),
[155] Fix | Delete
node = cur? null : elms.filter('.'+cl1stfocus+':first');
[156] Fix | Delete
[157] Fix | Delete
if (! node || ! node.length) {
[158] Fix | Delete
node = elms.first();
[159] Fix | Delete
}
[160] Fix | Delete
if (cur) {
[161] Fix | Delete
jQuery.each(elms, function(i, elm) {
[162] Fix | Delete
if (elm === cur && elms[i+1]) {
[163] Fix | Delete
node = elms.eq(i+1);
[164] Fix | Delete
return false;
[165] Fix | Delete
}
[166] Fix | Delete
});
[167] Fix | Delete
}
[168] Fix | Delete
return node;
[169] Fix | Delete
},
[170] Fix | Delete
tabstopPrev = function(cur) {
[171] Fix | Delete
var elms = tabstops.filter(':visible:enabled'),
[172] Fix | Delete
node = elms.last();
[173] Fix | Delete
jQuery.each(elms, function(i, elm) {
[174] Fix | Delete
if (elm === cur && elms[i-1]) {
[175] Fix | Delete
node = elms.eq(i-1);
[176] Fix | Delete
return false;
[177] Fix | Delete
}
[178] Fix | Delete
});
[179] Fix | Delete
return node;
[180] Fix | Delete
},
[181] Fix | Delete
makeHeaderBtn = function() {
[182] Fix | Delete
jQuery.each(opts.headerBtnOrder.split(':').reverse(), function(i, v) {
[183] Fix | Delete
headerBtns[v] && headerBtns[v]();
[184] Fix | Delete
});
[185] Fix | Delete
if (platformWin) {
[186] Fix | Delete
titlebar.children('.elfinder-titlebar-button').addClass('elfinder-titlebar-button-right');
[187] Fix | Delete
}
[188] Fix | Delete
},
[189] Fix | Delete
headerBtns = {
[190] Fix | Delete
close: function() {
[191] Fix | Delete
titlebar.prepend(jQuery('<span class="ui-widget-header ui-dialog-titlebar-close ui-corner-all elfinder-titlebar-button"><span class="ui-icon ui-icon-closethick"></span></span>')
[192] Fix | Delete
.on('mousedown touchstart', function(e) {
[193] Fix | Delete
e.preventDefault();
[194] Fix | Delete
e.stopPropagation();
[195] Fix | Delete
self.elfinderdialog('close');
[196] Fix | Delete
})
[197] Fix | Delete
);
[198] Fix | Delete
},
[199] Fix | Delete
maximize: function() {
[200] Fix | Delete
if (opts.allowMaximize) {
[201] Fix | Delete
dialog.on('resize', function(e, data) {
[202] Fix | Delete
var full, elm;
[203] Fix | Delete
e.preventDefault();
[204] Fix | Delete
e.stopPropagation();
[205] Fix | Delete
if (data && data.maximize) {
[206] Fix | Delete
elm = titlebar.find('.elfinder-titlebar-full');
[207] Fix | Delete
full = (data.maximize === 'on');
[208] Fix | Delete
elm.children('span.ui-icon')
[209] Fix | Delete
.toggleClass('ui-icon-plusthick', ! full)
[210] Fix | Delete
.toggleClass('ui-icon-arrowreturnthick-1-s', full);
[211] Fix | Delete
if (full) {
[212] Fix | Delete
try {
[213] Fix | Delete
dialog.hasClass('ui-draggable') && dialog.draggable('disable');
[214] Fix | Delete
dialog.hasClass('ui-resizable') && dialog.resizable('disable');
[215] Fix | Delete
} catch(e) {}
[216] Fix | Delete
self.css('width', '100%').css('height', dialog.height() - dialog.children('.ui-dialog-titlebar').outerHeight(true) - buttonpane.outerHeight(true));
[217] Fix | Delete
} else {
[218] Fix | Delete
self.attr('style', elm.data('style'));
[219] Fix | Delete
elm.removeData('style');
[220] Fix | Delete
posCheck();
[221] Fix | Delete
try {
[222] Fix | Delete
dialog.hasClass('ui-draggable') && dialog.draggable('enable');
[223] Fix | Delete
dialog.hasClass('ui-resizable') && dialog.resizable('enable');
[224] Fix | Delete
} catch(e) {}
[225] Fix | Delete
}
[226] Fix | Delete
dialog.trigger('resize', {init: true});
[227] Fix | Delete
}
[228] Fix | Delete
});
[229] Fix | Delete
}
[230] Fix | Delete
[231] Fix | Delete
},
[232] Fix | Delete
minimize: function() {
[233] Fix | Delete
var btn, mnode, doffset;
[234] Fix | Delete
if (opts.allowMinimize) {
[235] Fix | Delete
btn = jQuery('<span class="ui-widget-header ui-corner-all elfinder-titlebar-button elfinder-titlebar-minimize"><span class="ui-icon ui-icon-minusthick"></span></span>')
[236] Fix | Delete
.on('mousedown touchstart', function(e) {
[237] Fix | Delete
var $this = jQuery(this),
[238] Fix | Delete
tray = fm.getUI('bottomtray'),
[239] Fix | Delete
dumStyle = { width: 70, height: 24 },
[240] Fix | Delete
dum = jQuery('<div></div>').css(dumStyle).addClass(dialog.get(0).className + ' elfinder-dialog-minimized'),
[241] Fix | Delete
close = function() {
[242] Fix | Delete
mnode.remove();
[243] Fix | Delete
dialog.removeData('minimized').show();
[244] Fix | Delete
self.elfinderdialog('close');
[245] Fix | Delete
},
[246] Fix | Delete
pos = {};
[247] Fix | Delete
[248] Fix | Delete
e.preventDefault();
[249] Fix | Delete
e.stopPropagation();
[250] Fix | Delete
if (!dialog.data('minimized')) {
[251] Fix | Delete
// minimize
[252] Fix | Delete
doffset = dialog.data('minimized', {
[253] Fix | Delete
dialog : function() { return mnode; },
[254] Fix | Delete
show : function() { mnode.show(); },
[255] Fix | Delete
hide : function() { mnode.hide(); },
[256] Fix | Delete
close : close,
[257] Fix | Delete
title : function(v) { mnode.children('.ui-dialog-titlebar').children('.elfinder-dialog-title').text(v); }
[258] Fix | Delete
}).position();
[259] Fix | Delete
mnode = dialog.clone().on('mousedown', function() {
[260] Fix | Delete
$this.trigger('mousedown');
[261] Fix | Delete
}).removeClass('ui-draggable ui-resizable elfinder-frontmost');
[262] Fix | Delete
tray.append(dum);
[263] Fix | Delete
Object.assign(pos, dum.offset(), dumStyle);
[264] Fix | Delete
dum.remove();
[265] Fix | Delete
mnode.height(dialog.height()).children('.ui-dialog-content:first').empty();
[266] Fix | Delete
fm.toHide(dialog.before(mnode));
[267] Fix | Delete
mnode.children('.ui-dialog-content:first,.ui-dialog-buttonpane,.ui-resizable-handle').remove();
[268] Fix | Delete
mnode.find('.elfinder-titlebar-minimize,.elfinder-titlebar-full').remove();
[269] Fix | Delete
mnode.find('.ui-dialog-titlebar-close').on('mousedown', function(e) {
[270] Fix | Delete
e.stopPropagation();
[271] Fix | Delete
e.preventDefault();
[272] Fix | Delete
close();
[273] Fix | Delete
});
[274] Fix | Delete
mnode.animate(pos, function() {
[275] Fix | Delete
mnode.attr('style', '')
[276] Fix | Delete
.css({ maxWidth: dialog.width() })
[277] Fix | Delete
.addClass('elfinder-dialog-minimized')
[278] Fix | Delete
.appendTo(tray);
[279] Fix | Delete
checkEditing();
[280] Fix | Delete
typeof(opts.minimize) === 'function' && opts.minimize.call(self[0]);
[281] Fix | Delete
});
[282] Fix | Delete
} else {
[283] Fix | Delete
//restore
[284] Fix | Delete
dialog.removeData('minimized').before(mnode.css(Object.assign({'position': 'absolute'}, mnode.offset())));
[285] Fix | Delete
fm.toFront(mnode);
[286] Fix | Delete
mnode.animate(Object.assign({ width: dialog.width(), height: dialog.height() }, doffset), function() {
[287] Fix | Delete
dialog.show();
[288] Fix | Delete
fm.toFront(dialog);
[289] Fix | Delete
mnode.remove();
[290] Fix | Delete
posCheck();
[291] Fix | Delete
checkEditing();
[292] Fix | Delete
dialog.trigger('resize', {init: true});
[293] Fix | Delete
typeof(opts.minimize) === 'function' && opts.minimize.call(self[0]);
[294] Fix | Delete
});
[295] Fix | Delete
}
[296] Fix | Delete
});
[297] Fix | Delete
titlebar.on('dblclick', function(e) {
[298] Fix | Delete
jQuery(this).children('.elfinder-titlebar-minimize').trigger('mousedown');
[299] Fix | Delete
}).prepend(btn);
[300] Fix | Delete
dialog.on('togleminimize', function() {
[301] Fix | Delete
btn.trigger('mousedown');
[302] Fix | Delete
});
[303] Fix | Delete
}
[304] Fix | Delete
}
[305] Fix | Delete
},
[306] Fix | Delete
dialog = jQuery('<div class="ui-front ui-dialog ui-widget ui-widget-content ui-corner-all ui-draggable std42-dialog touch-punch '+cldialog+' '+opts.cssClass+'"></div>')
[307] Fix | Delete
.hide()
[308] Fix | Delete
.append(self)
[309] Fix | Delete
.appendTo(elfNode)
[310] Fix | Delete
.draggable({
[311] Fix | Delete
containment : fm.options.dialogContained? elfNode : null,
[312] Fix | Delete
handle : '.ui-dialog-titlebar',
[313] Fix | Delete
start : function() {
[314] Fix | Delete
evCover.show();
[315] Fix | Delete
},
[316] Fix | Delete
drag : function(e, ui) {
[317] Fix | Delete
var top = ui.offset.top,
[318] Fix | Delete
left = ui.offset.left;
[319] Fix | Delete
if (top < 0) {
[320] Fix | Delete
ui.position.top = ui.position.top - top;
[321] Fix | Delete
}
[322] Fix | Delete
if (left < 0) {
[323] Fix | Delete
ui.position.left = ui.position.left - left;
[324] Fix | Delete
}
[325] Fix | Delete
if (fm.options.dialogContained) {
[326] Fix | Delete
ui.position.top < 0 && (ui.position.top = 0);
[327] Fix | Delete
ui.position.left < 0 && (ui.position.left = 0);
[328] Fix | Delete
}
[329] Fix | Delete
},
[330] Fix | Delete
stop : function(e, ui) {
[331] Fix | Delete
evCover.hide();
[332] Fix | Delete
dialog.css({height : opts.height});
[333] Fix | Delete
self.data('draged', true);
[334] Fix | Delete
}
[335] Fix | Delete
})
[336] Fix | Delete
.css({
[337] Fix | Delete
width : opts.width,
[338] Fix | Delete
height : opts.height,
[339] Fix | Delete
minWidth : opts.minWidth,
[340] Fix | Delete
minHeight : opts.minHeight,
[341] Fix | Delete
maxWidth : opts.maxWidth,
[342] Fix | Delete
maxHeight : opts.maxHeight
[343] Fix | Delete
})
[344] Fix | Delete
.on('touchstart touchmove touchend click dblclick mouseup mouseenter mouseleave mouseout mouseover mousemove', function(e) {
[345] Fix | Delete
// stopPropagation of user action events
[346] Fix | Delete
!propagationEvents[e.type] && e.stopPropagation();
[347] Fix | Delete
})
[348] Fix | Delete
.on('mousedown', function(e) {
[349] Fix | Delete
!propagationEvents[e.type] && e.stopPropagation();
[350] Fix | Delete
requestAnimationFrame(function() {
[351] Fix | Delete
if (dialog.is(':visible') && !dialog.hasClass('elfinder-frontmost')) {
[352] Fix | Delete
toFocusNode = jQuery(':focus');
[353] Fix | Delete
if (!toFocusNode.length) {
[354] Fix | Delete
toFocusNode = void(0);
[355] Fix | Delete
}
[356] Fix | Delete
dialog.trigger('totop');
[357] Fix | Delete
}
[358] Fix | Delete
});
[359] Fix | Delete
})
[360] Fix | Delete
.on('open', function() {
[361] Fix | Delete
dialog.data('margin-y', self.outerHeight(true) - self.height());
[362] Fix | Delete
if (syncSize.enabled) {
[363] Fix | Delete
if (opts.height && opts.height !== 'auto') {
[364] Fix | Delete
dialog.trigger('resize', {init: true});
[365] Fix | Delete
}
[366] Fix | Delete
if (!syncSize.defaultSize) {
[367] Fix | Delete
syncSize.defaultSize = { width: self.width(), height: self.height() };
[368] Fix | Delete
}
[369] Fix | Delete
fitSize(dialog);
[370] Fix | Delete
dialog.trigger('resize').trigger('posinit');
[371] Fix | Delete
elfNode.on('resize.'+fm.namespace, dialog, syncFunc);
[372] Fix | Delete
}
[373] Fix | Delete
[374] Fix | Delete
if (!dialog.hasClass(clnotify)) {
[375] Fix | Delete
elfNode.children('.'+cldialog+':visible:not(.'+clnotify+')').each(function() {
[376] Fix | Delete
var d = jQuery(this),
[377] Fix | Delete
top = parseInt(d.css('top')),
[378] Fix | Delete
left = parseInt(d.css('left')),
[379] Fix | Delete
_top = parseInt(dialog.css('top')),
[380] Fix | Delete
_left = parseInt(dialog.css('left')),
[381] Fix | Delete
ct = Math.abs(top - _top) < 10,
[382] Fix | Delete
cl = Math.abs(left - _left) < 10;
[383] Fix | Delete
[384] Fix | Delete
if (d[0] != dialog[0] && (ct || cl)) {
[385] Fix | Delete
dialog.css({
[386] Fix | Delete
top : ct ? (top + 10) : _top,
[387] Fix | Delete
left : cl ? (left + 10) : _left
[388] Fix | Delete
});
[389] Fix | Delete
}
[390] Fix | Delete
});
[391] Fix | Delete
}
[392] Fix | Delete
[393] Fix | Delete
if (dialog.data('modal')) {
[394] Fix | Delete
dialog.addClass(clmodal);
[395] Fix | Delete
fm.getUI('overlay').elfinderoverlay('show');
[396] Fix | Delete
}
[397] Fix | Delete
[398] Fix | Delete
dialog.trigger('totop');
[399] Fix | Delete
[400] Fix | Delete
opts.openMaximized && fm.toggleMaximize(dialog);
[401] Fix | Delete
[402] Fix | Delete
fm.trigger('dialogopen', {dialog: dialog});
[403] Fix | Delete
[404] Fix | Delete
typeof(opts.open) == 'function' && jQuery.proxy(opts.open, self[0])();
[405] Fix | Delete
[406] Fix | Delete
if (opts.closeOnEscape) {
[407] Fix | Delete
jQuery(document).on('keydown.'+id, function(e) {
[408] Fix | Delete
if (e.keyCode == jQuery.ui.keyCode.ESCAPE && dialog.hasClass('elfinder-frontmost')) {
[409] Fix | Delete
self.elfinderdialog('close');
[410] Fix | Delete
}
[411] Fix | Delete
});
[412] Fix | Delete
}
[413] Fix | Delete
dialog.hasClass(fm.res('class', 'editing')) && checkEditing();
[414] Fix | Delete
})
[415] Fix | Delete
.on('close', function(e) {
[416] Fix | Delete
var dialogs, dfd;
[417] Fix | Delete
[418] Fix | Delete
if (opts.beforeclose && typeof opts.beforeclose === 'function') {
[419] Fix | Delete
dfd = opts.beforeclose();
[420] Fix | Delete
if (!dfd || !dfd.promise) {
[421] Fix | Delete
dfd = !dfd? jQuery.Deferred().reject() : jQuery.Deferred().resolve();
[422] Fix | Delete
}
[423] Fix | Delete
} else {
[424] Fix | Delete
dfd = jQuery.Deferred().resolve();
[425] Fix | Delete
}
[426] Fix | Delete
[427] Fix | Delete
dfd.done(function() {
[428] Fix | Delete
syncSize.enabled && elfNode.off('resize.'+fm.namespace, syncFunc);
[429] Fix | Delete
[430] Fix | Delete
if (opts.closeOnEscape) {
[431] Fix | Delete
jQuery(document).off('keyup.'+id);
[432] Fix | Delete
}
[433] Fix | Delete
[434] Fix | Delete
if (opts.allowMaximize) {
[435] Fix | Delete
fm.toggleMaximize(dialog, false);
[436] Fix | Delete
}
[437] Fix | Delete
[438] Fix | Delete
fm.toHide(dialog);
[439] Fix | Delete
dialog.data('modal') && fm.getUI('overlay').elfinderoverlay('hide');
[440] Fix | Delete
[441] Fix | Delete
if (typeof(opts.close) == 'function') {
[442] Fix | Delete
jQuery.proxy(opts.close, self[0])();
[443] Fix | Delete
}
[444] Fix | Delete
if (opts.destroyOnClose && dialog.parent().length) {
[445] Fix | Delete
dialog.hide().remove();
[446] Fix | Delete
}
[447] Fix | Delete
[448] Fix | Delete
// get focus to next dialog
[449] Fix | Delete
dialogs = elfNode.children('.'+cldialog+':visible');
[450] Fix | Delete
[451] Fix | Delete
dialog.hasClass(fm.res('class', 'editing')) && checkEditing();
[452] Fix | Delete
});
[453] Fix | Delete
})
[454] Fix | Delete
.on('totop frontmost', function() {
[455] Fix | Delete
var s = fm.storage('autoFocusDialog');
[456] Fix | Delete
[457] Fix | Delete
dialog.data('focusOnMouseOver', s? (s > 0) : fm.options.uiOptions.dialog.focusOnMouseOver);
[458] Fix | Delete
[459] Fix | Delete
if (dialog.data('minimized')) {
[460] Fix | Delete
titlebar.children('.elfinder-titlebar-minimize').trigger('mousedown');
[461] Fix | Delete
}
[462] Fix | Delete
[463] Fix | Delete
if (!dialog.data('modal') && fm.getUI('overlay').is(':visible')) {
[464] Fix | Delete
fm.getUI('overlay').before(dialog);
[465] Fix | Delete
} else {
[466] Fix | Delete
fm.toFront(dialog);
[467] Fix | Delete
}
[468] Fix | Delete
elfNode.children('.'+cldialog+':not(.'+clmodal+')').removeClass(clactive);
[469] Fix | Delete
dialog.addClass(clactive);
[470] Fix | Delete
[471] Fix | Delete
! fm.UA.Mobile && (toFocusNode || tabstopNext()).trigger('focus');
[472] Fix | Delete
[473] Fix | Delete
toFocusNode = void(0);
[474] Fix | Delete
})
[475] Fix | Delete
.on('posinit', function() {
[476] Fix | Delete
var css = opts.position,
[477] Fix | Delete
nodeOffset, minTop, minLeft, outerSize, win, winSize, nodeFull;
[478] Fix | Delete
if (dialog.hasClass('elfinder-maximized')) {
[479] Fix | Delete
return;
[480] Fix | Delete
}
[481] Fix | Delete
if (! css && ! dialog.data('resizing')) {
[482] Fix | Delete
nodeFull = elfNode.hasClass('elfinder-fullscreen') || fm.options.enableAlways;
[483] Fix | Delete
dialog.css(nodeFull? {
[484] Fix | Delete
maxWidth : '100%',
[485] Fix | Delete
maxHeight : '100%',
[486] Fix | Delete
overflow : 'auto'
[487] Fix | Delete
} : restoreStyle);
[488] Fix | Delete
if (fm.UA.Mobile && !nodeFull && dialog.data('rotated') === fm.UA.Rotated) {
[489] Fix | Delete
return;
[490] Fix | Delete
}
[491] Fix | Delete
dialog.data('rotated', fm.UA.Rotated);
[492] Fix | Delete
win = jQuery(window);
[493] Fix | Delete
nodeOffset = elfNode.offset();
[494] Fix | Delete
outerSize = {
[495] Fix | Delete
width : dialog.outerWidth(true),
[496] Fix | Delete
height: dialog.outerHeight(true)
[497] Fix | Delete
};
[498] Fix | Delete
outerSize.right = nodeOffset.left + outerSize.width;
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function