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

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/wp-conte.../plugins/wp-file-.../lib/js/extras
File: editors.default.js
},
[2000] Fix | Delete
save : function(textarea, instance) {
[2001] Fix | Delete
instance && instance.save();
[2002] Fix | Delete
},
[2003] Fix | Delete
focus : function(textarea, instance) {
[2004] Fix | Delete
instance && instance.focus();
[2005] Fix | Delete
},
[2006] Fix | Delete
resize : function(textarea, instance, e, data) {
[2007] Fix | Delete
// fit height to base node on dialog resize
[2008] Fix | Delete
instance && textarea._setHeight();
[2009] Fix | Delete
}
[2010] Fix | Delete
},
[2011] Fix | Delete
{
[2012] Fix | Delete
info : {
[2013] Fix | Delete
id : 'zohoeditor',
[2014] Fix | Delete
name : 'Zoho Editor',
[2015] Fix | Delete
iconImg : 'img/editor-icons.png 0 -32',
[2016] Fix | Delete
cmdCheck : 'ZohoOffice',
[2017] Fix | Delete
preventGet: true,
[2018] Fix | Delete
hideButtons: true,
[2019] Fix | Delete
syncInterval : 15000,
[2020] Fix | Delete
canMakeEmpty: true,
[2021] Fix | Delete
integrate: {
[2022] Fix | Delete
title: 'Zoho Office API',
[2023] Fix | Delete
link: 'https://www.zoho.com/officeapi/'
[2024] Fix | Delete
}
[2025] Fix | Delete
},
[2026] Fix | Delete
mimes : [
[2027] Fix | Delete
'application/msword',
[2028] Fix | Delete
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
[2029] Fix | Delete
//'application/pdf',
[2030] Fix | Delete
'application/vnd.oasis.opendocument.text',
[2031] Fix | Delete
'application/rtf',
[2032] Fix | Delete
'text/html',
[2033] Fix | Delete
'application/vnd.ms-excel',
[2034] Fix | Delete
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
[2035] Fix | Delete
'application/vnd.oasis.opendocument.spreadsheet',
[2036] Fix | Delete
'application/vnd.sun.xml.calc',
[2037] Fix | Delete
'text/csv',
[2038] Fix | Delete
'text/tab-separated-values',
[2039] Fix | Delete
'application/vnd.ms-powerpoint',
[2040] Fix | Delete
'application/vnd.openxmlformats-officedocument.presentationml.presentation',
[2041] Fix | Delete
'application/vnd.openxmlformats-officedocument.presentationml.slideshow',
[2042] Fix | Delete
'application/vnd.oasis.opendocument.presentation',
[2043] Fix | Delete
'application/vnd.sun.xml.impress'
[2044] Fix | Delete
],
[2045] Fix | Delete
html : '<iframe style="width:100%;max-height:100%;border:none;"></iframe>',
[2046] Fix | Delete
// setup on elFinder bootup
[2047] Fix | Delete
setup : function(opts, fm) {
[2048] Fix | Delete
if (fm.UA.Mobile || fm.UA.ltIE8) {
[2049] Fix | Delete
this.disabled = true;
[2050] Fix | Delete
}
[2051] Fix | Delete
},
[2052] Fix | Delete
// Prepare on before show dialog
[2053] Fix | Delete
prepare : function(base, dialogOpts, file) {
[2054] Fix | Delete
var elfNode = base.editor.fm.getUI();
[2055] Fix | Delete
jQuery(base).height(elfNode.height());
[2056] Fix | Delete
dialogOpts.width = Math.max(dialogOpts.width || 0, elfNode.width() * 0.8);
[2057] Fix | Delete
},
[2058] Fix | Delete
// Initialization of editing node (this: this editors HTML node)
[2059] Fix | Delete
init : function(id, file, dum, fm) {
[2060] Fix | Delete
var ta = this,
[2061] Fix | Delete
ifm = jQuery(this).hide(),
[2062] Fix | Delete
uiToast = fm.getUI('toast'),
[2063] Fix | Delete
spnr = jQuery('<div class="elfinder-edit-spinner elfinder-edit-zohoeditor"></div>')
[2064] Fix | Delete
.html('<span class="elfinder-spinner-text">' + fm.i18n('nowLoading') + '</span><span class="elfinder-spinner"></span>')
[2065] Fix | Delete
.appendTo(ifm.parent()),
[2066] Fix | Delete
cdata = function() {
[2067] Fix | Delete
var data = '';
[2068] Fix | Delete
jQuery.each(fm.customData, function(key, val) {
[2069] Fix | Delete
data += '&' + encodeURIComponent(key) + '=' + encodeURIComponent(val);
[2070] Fix | Delete
});
[2071] Fix | Delete
return data;
[2072] Fix | Delete
};
[2073] Fix | Delete
[2074] Fix | Delete
jQuery(ta).data('xhr', fm.request({
[2075] Fix | Delete
data: {
[2076] Fix | Delete
cmd: 'editor',
[2077] Fix | Delete
name: ta.editor.confObj.info.cmdCheck,
[2078] Fix | Delete
method: 'init',
[2079] Fix | Delete
'args[target]': file.hash,
[2080] Fix | Delete
'args[lang]' : fm.lang,
[2081] Fix | Delete
'args[cdata]' : cdata()
[2082] Fix | Delete
},
[2083] Fix | Delete
preventDefault : true
[2084] Fix | Delete
}).done(function(data) {
[2085] Fix | Delete
var opts;
[2086] Fix | Delete
if (data.zohourl) {
[2087] Fix | Delete
opts = {
[2088] Fix | Delete
css: {
[2089] Fix | Delete
height: '100%'
[2090] Fix | Delete
}
[2091] Fix | Delete
};
[2092] Fix | Delete
// trigger event 'editEditorPrepare'
[2093] Fix | Delete
ta.editor.trigger('Prepare', {
[2094] Fix | Delete
node: ta,
[2095] Fix | Delete
editorObj: void(0),
[2096] Fix | Delete
instance: ifm,
[2097] Fix | Delete
opts: opts
[2098] Fix | Delete
});
[2099] Fix | Delete
[2100] Fix | Delete
ifm.attr('src', data.zohourl).show().css(opts.css);
[2101] Fix | Delete
if (data.warning) {
[2102] Fix | Delete
uiToast.appendTo(ta.closest('.ui-dialog'));
[2103] Fix | Delete
fm.toast({
[2104] Fix | Delete
msg: fm.i18n(data.warning),
[2105] Fix | Delete
mode: 'warning',
[2106] Fix | Delete
timeOut: 0,
[2107] Fix | Delete
onHidden: function() {
[2108] Fix | Delete
uiToast.children().length === 1 && uiToast.appendTo(fm.getUI());
[2109] Fix | Delete
},
[2110] Fix | Delete
button: {
[2111] Fix | Delete
text: 'btnYes'
[2112] Fix | Delete
}
[2113] Fix | Delete
});
[2114] Fix | Delete
}
[2115] Fix | Delete
} else {
[2116] Fix | Delete
data.error && fm.error(data.error);
[2117] Fix | Delete
ta.elfinderdialog('destroy');
[2118] Fix | Delete
}
[2119] Fix | Delete
}).fail(function(error) {
[2120] Fix | Delete
error && fm.error(error);
[2121] Fix | Delete
ta.elfinderdialog('destroy');
[2122] Fix | Delete
}).always(function() {
[2123] Fix | Delete
spnr.remove();
[2124] Fix | Delete
}));
[2125] Fix | Delete
},
[2126] Fix | Delete
load : function() {},
[2127] Fix | Delete
getContent : function() {},
[2128] Fix | Delete
save : function() {},
[2129] Fix | Delete
// Before dialog close
[2130] Fix | Delete
beforeclose : iframeClose,
[2131] Fix | Delete
// On dialog closed
[2132] Fix | Delete
close : function(ta) {
[2133] Fix | Delete
var fm = this.fm,
[2134] Fix | Delete
xhr = jQuery(ta).data('xhr');
[2135] Fix | Delete
if (xhr.state() === 'pending') {
[2136] Fix | Delete
xhr.reject();
[2137] Fix | Delete
}
[2138] Fix | Delete
}
[2139] Fix | Delete
},
[2140] Fix | Delete
{
[2141] Fix | Delete
// Zip Archive with FlySystem
[2142] Fix | Delete
info : {
[2143] Fix | Delete
id : 'ziparchive',
[2144] Fix | Delete
name : 'btnMount',
[2145] Fix | Delete
iconImg : 'img/toolbar.png 0 -416',
[2146] Fix | Delete
cmdCheck : 'ZipArchive',
[2147] Fix | Delete
edit : function(file, editor) {
[2148] Fix | Delete
var fm = this,
[2149] Fix | Delete
dfrd = jQuery.Deferred();
[2150] Fix | Delete
fm.request({
[2151] Fix | Delete
data:{
[2152] Fix | Delete
cmd: 'netmount',
[2153] Fix | Delete
protocol: 'ziparchive',
[2154] Fix | Delete
host: file.hash,
[2155] Fix | Delete
path: file.phash
[2156] Fix | Delete
},
[2157] Fix | Delete
preventFail: true,
[2158] Fix | Delete
notify : {type : 'netmount', cnt : 1, hideCnt : true}
[2159] Fix | Delete
}).done(function(data) {
[2160] Fix | Delete
var pdir;
[2161] Fix | Delete
if (data.added && data.added.length) {
[2162] Fix | Delete
if (data.added[0].phash) {
[2163] Fix | Delete
if (pdir = fm.file(data.added[0].phash)) {
[2164] Fix | Delete
if (! pdir.dirs) {
[2165] Fix | Delete
pdir.dirs = 1;
[2166] Fix | Delete
fm.change({ changed: [ pdir ] });
[2167] Fix | Delete
}
[2168] Fix | Delete
}
[2169] Fix | Delete
}
[2170] Fix | Delete
fm.one('netmountdone', function() {
[2171] Fix | Delete
fm.exec('open', data.added[0].hash);
[2172] Fix | Delete
fm.one('opendone', function() {
[2173] Fix | Delete
data.toast && fm.toast(data.toast);
[2174] Fix | Delete
});
[2175] Fix | Delete
});
[2176] Fix | Delete
}
[2177] Fix | Delete
dfrd.resolve();
[2178] Fix | Delete
})
[2179] Fix | Delete
.fail(function(error) {
[2180] Fix | Delete
dfrd.reject(error);
[2181] Fix | Delete
});
[2182] Fix | Delete
return dfrd;
[2183] Fix | Delete
}
[2184] Fix | Delete
},
[2185] Fix | Delete
mimes : ['application/zip'],
[2186] Fix | Delete
load : function() {},
[2187] Fix | Delete
save : function(){}
[2188] Fix | Delete
},
[2189] Fix | Delete
{
[2190] Fix | Delete
// Simple Text (basic textarea editor)
[2191] Fix | Delete
info : {
[2192] Fix | Delete
id : 'textarea',
[2193] Fix | Delete
name : 'TextArea',
[2194] Fix | Delete
useTextAreaEvent : true
[2195] Fix | Delete
},
[2196] Fix | Delete
load : function(textarea) {
[2197] Fix | Delete
// trigger event 'editEditorPrepare'
[2198] Fix | Delete
this.trigger('Prepare', {
[2199] Fix | Delete
node: textarea,
[2200] Fix | Delete
editorObj: void(0),
[2201] Fix | Delete
instance: void(0),
[2202] Fix | Delete
opts: {}
[2203] Fix | Delete
});
[2204] Fix | Delete
textarea.setSelectionRange && textarea.setSelectionRange(0, 0);
[2205] Fix | Delete
jQuery(textarea).trigger('focus').show();
[2206] Fix | Delete
},
[2207] Fix | Delete
save : function(){}
[2208] Fix | Delete
},
[2209] Fix | Delete
{
[2210] Fix | Delete
// File converter with online-convert.com
[2211] Fix | Delete
info : {
[2212] Fix | Delete
id : 'onlineconvert',
[2213] Fix | Delete
name : 'Online Convert',
[2214] Fix | Delete
iconImg : 'img/editor-icons.png 0 -144',
[2215] Fix | Delete
cmdCheck : 'OnlineConvert',
[2216] Fix | Delete
preventGet: true,
[2217] Fix | Delete
hideButtons: true,
[2218] Fix | Delete
single: true,
[2219] Fix | Delete
converter: true,
[2220] Fix | Delete
canMakeEmpty: false,
[2221] Fix | Delete
integrate: {
[2222] Fix | Delete
title: 'ONLINE-CONVERT.COM',
[2223] Fix | Delete
link: 'https://online-convert.com'
[2224] Fix | Delete
}
[2225] Fix | Delete
},
[2226] Fix | Delete
mimes : ['*'],
[2227] Fix | Delete
html : '<div style="width:100%;max-height:100%;"></div>',
[2228] Fix | Delete
// setup on elFinder bootup
[2229] Fix | Delete
setup : function(opts, fm) {
[2230] Fix | Delete
var mOpts = opts.extraOptions.onlineConvert || {maxSize:100,showLink:true};
[2231] Fix | Delete
if (mOpts.maxSize) {
[2232] Fix | Delete
this.info.maxSize = mOpts.maxSize * 1048576;
[2233] Fix | Delete
}
[2234] Fix | Delete
this.set = Object.assign({
[2235] Fix | Delete
url : 'https://%s.online-convert.com%s?external_url=',
[2236] Fix | Delete
conv : {
[2237] Fix | Delete
Archive: {'7Z':{}, 'BZ2':{ext:'bz'}, 'GZ':{}, 'ZIP':{}},
[2238] Fix | Delete
Audio: {'MP3':{}, 'OGG':{ext:'oga'}, 'WAV':{}, 'WMA':{}, 'AAC':{}, 'AIFF':{ext:'aif'}, 'FLAC':{}, 'M4A':{}, 'MMF':{}, 'OPUS':{ext:'oga'}},
[2239] Fix | Delete
Document: {'DOC':{}, 'DOCX':{}, 'HTML':{}, 'ODT':{}, 'PDF':{}, 'PPT':{}, 'PPTX':{}, 'RTF':{}, 'SWF':{}, 'TXT':{}},
[2240] Fix | Delete
eBook: {'AZW3':{ext:'azw'}, 'ePub':{}, 'FB2':{ext:'xml'}, 'LIT':{}, 'LRF':{}, 'MOBI':{}, 'PDB':{}, 'PDF':{},'PDF-eBook':{ext:'pdf'}, 'TCR':{}},
[2241] Fix | Delete
Hash: {'Adler32':{}, 'Apache-htpasswd':{}, 'Blowfish':{}, 'CRC32':{}, 'CRC32B':{}, 'Gost':{}, 'Haval128':{},'MD4':{}, 'MD5':{}, 'RIPEMD128':{}, 'RIPEMD160':{}, 'SHA1':{}, 'SHA256':{}, 'SHA384':{}, 'SHA512':{}, 'Snefru':{}, 'Std-DES':{}, 'Tiger128':{}, 'Tiger128-calculator':{}, 'Tiger128-converter':{}, 'Tiger160':{}, 'Tiger192':{}, 'Whirlpool':{}},
[2242] Fix | Delete
Image: {'BMP':{}, 'EPS':{ext:'ai'}, 'GIF':{}, 'EXR':{}, 'ICO':{}, 'JPG':{}, 'PNG':{}, 'SVG':{}, 'TGA':{}, 'TIFF':{ext:'tif'}, 'WBMP':{}, 'WebP':{}},
[2243] Fix | Delete
Video: {'3G2':{}, '3GP':{}, 'AVI':{}, 'FLV':{}, 'HLS':{ext:'m3u8'}, 'MKV':{}, 'MOV':{}, 'MP4':{}, 'MPEG-1':{ext:'mpeg'}, 'MPEG-2':{ext:'mpeg'}, 'OGG':{ext:'ogv'}, 'OGV':{}, 'WebM':{}, 'WMV':{}, 'Android':{link:'/convert-video-for-%s',ext:'mp4'}, 'Blackberry':{link:'/convert-video-for-%s',ext:'mp4'}, 'DPG':{link:'/convert-video-for-%s',ext:'avi'}, 'iPad':{link:'/convert-video-for-%s',ext:'mp4'}, 'iPhone':{link:'/convert-video-for-%s',ext:'mp4'}, 'iPod':{link:'/convert-video-for-%s',ext:'mp4'}, 'Nintendo-3DS':{link:'/convert-video-for-%s',ext:'avi'}, 'Nintendo-DS':{link:'/convert-video-for-%s',ext:'avi'}, 'PS3':{link:'/convert-video-for-%s',ext:'mp4'}, 'Wii':{link:'/convert-video-for-%s',ext:'avi'}, 'Xbox':{link:'/convert-video-for-%s',ext:'wmv'}}
[2244] Fix | Delete
},
[2245] Fix | Delete
catExts : {
[2246] Fix | Delete
Hash: 'txt'
[2247] Fix | Delete
},
[2248] Fix | Delete
link : '<div class="elfinder-edit-onlineconvert-link"><a href="https://www.online-convert.com" target="_blank"><span class="elfinder-button-icon"></span>ONLINE-CONVERT.COM</a></div>',
[2249] Fix | Delete
useTabs : (jQuery.fn.tabs && !fm.UA.iOS)? true : false // Can't work on iOS, I don't know why.
[2250] Fix | Delete
}, mOpts);
[2251] Fix | Delete
},
[2252] Fix | Delete
// Prepare on before show dialog
[2253] Fix | Delete
prepare : function(base, dialogOpts, file) {
[2254] Fix | Delete
var elfNode = base.editor.fm.getUI();
[2255] Fix | Delete
jQuery(base).height(elfNode.height());
[2256] Fix | Delete
dialogOpts.width = Math.max(dialogOpts.width || 0, elfNode.width() * 0.8);
[2257] Fix | Delete
},
[2258] Fix | Delete
// Initialization of editing node (this: this editors HTML node)
[2259] Fix | Delete
init : function(id, file, dum, fm) {
[2260] Fix | Delete
var ta = this,
[2261] Fix | Delete
confObj = ta.editor.confObj,
[2262] Fix | Delete
set = confObj.set,
[2263] Fix | Delete
uiToast = fm.getUI('toast'),
[2264] Fix | Delete
idxs = {},
[2265] Fix | Delete
allowZip = fm.uploadMimeCheck('application/zip', file.phash),
[2266] Fix | Delete
selfUrl = jQuery('base').length? document.location.href.replace(/#.*$/, '') : '',
[2267] Fix | Delete
getExt = function(cat, con) {
[2268] Fix | Delete
var c;
[2269] Fix | Delete
if (set.catExts[cat]) {
[2270] Fix | Delete
return set.catExts[cat];
[2271] Fix | Delete
}
[2272] Fix | Delete
if (set.conv[cat] && (c = set.conv[cat][con])) {
[2273] Fix | Delete
return (c.ext || con).toLowerCase();
[2274] Fix | Delete
}
[2275] Fix | Delete
return con.toLowerCase();
[2276] Fix | Delete
},
[2277] Fix | Delete
setOptions = function(cat, done) {
[2278] Fix | Delete
var type, dfdInit, dfd;
[2279] Fix | Delete
if (typeof confObj.api === 'undefined') {
[2280] Fix | Delete
dfdInit = fm.request({
[2281] Fix | Delete
data: {
[2282] Fix | Delete
cmd: 'editor',
[2283] Fix | Delete
name: 'OnlineConvert',
[2284] Fix | Delete
method: 'init'
[2285] Fix | Delete
},
[2286] Fix | Delete
preventDefault : true
[2287] Fix | Delete
});
[2288] Fix | Delete
} else {
[2289] Fix | Delete
dfdInit = jQuery.Deferred().resolve({api: confObj.api});
[2290] Fix | Delete
}
[2291] Fix | Delete
cat = cat.toLowerCase();
[2292] Fix | Delete
dfdInit.done(function(data) {
[2293] Fix | Delete
confObj.api = data.api;
[2294] Fix | Delete
if (confObj.api) {
[2295] Fix | Delete
if (cat) {
[2296] Fix | Delete
type = '?category=' + cat;
[2297] Fix | Delete
} else {
[2298] Fix | Delete
type = '';
[2299] Fix | Delete
cat = 'all';
[2300] Fix | Delete
}
[2301] Fix | Delete
if (!confObj.conversions) {
[2302] Fix | Delete
confObj.conversions = {};
[2303] Fix | Delete
}
[2304] Fix | Delete
if (!confObj.conversions[cat]) {
[2305] Fix | Delete
dfd = jQuery.getJSON('https://api2.online-convert.com/conversions' + type);
[2306] Fix | Delete
} else {
[2307] Fix | Delete
dfd = jQuery.Deferred().resolve(confObj.conversions[cat]);
[2308] Fix | Delete
}
[2309] Fix | Delete
dfd.done(function(d) {
[2310] Fix | Delete
confObj.conversions[cat] = d;
[2311] Fix | Delete
jQuery.each(d, function(i, o) {
[2312] Fix | Delete
btns[set.useTabs? 'children' : 'find']('.onlineconvert-category-' + o.category).children('.onlineconvert-' + o.target).trigger('makeoption', o);
[2313] Fix | Delete
});
[2314] Fix | Delete
done && done();
[2315] Fix | Delete
});
[2316] Fix | Delete
}
[2317] Fix | Delete
});
[2318] Fix | Delete
},
[2319] Fix | Delete
btns = (function() {
[2320] Fix | Delete
var btns = jQuery('<div></div>').on('click', 'button', function() {
[2321] Fix | Delete
var b = jQuery(this),
[2322] Fix | Delete
opts = b.data('opts') || null,
[2323] Fix | Delete
cat = b.closest('.onlineconvert-category').data('cname'),
[2324] Fix | Delete
con = b.data('conv');
[2325] Fix | Delete
if (confObj.api === true) {
[2326] Fix | Delete
api({
[2327] Fix | Delete
category: cat,
[2328] Fix | Delete
convert: con,
[2329] Fix | Delete
options: opts
[2330] Fix | Delete
});
[2331] Fix | Delete
}
[2332] Fix | Delete
}).on('change', function(e) {
[2333] Fix | Delete
var t = jQuery(e.target),
[2334] Fix | Delete
p = t.parent(),
[2335] Fix | Delete
b = t.closest('.elfinder-edit-onlineconvert-button').children('button:first'),
[2336] Fix | Delete
o = b.data('opts') || {},
[2337] Fix | Delete
v = p.data('type') === 'boolean'? t.is(':checked') : t.val();
[2338] Fix | Delete
e.stopPropagation();
[2339] Fix | Delete
if (v) {
[2340] Fix | Delete
if (p.data('type') === 'integer') {
[2341] Fix | Delete
v = parseInt(v);
[2342] Fix | Delete
}
[2343] Fix | Delete
if (p.data('pattern')) {
[2344] Fix | Delete
var reg = new RegExp(p.data('pattern'));
[2345] Fix | Delete
if (!reg.test(v)) {
[2346] Fix | Delete
requestAnimationFrame(function() {
[2347] Fix | Delete
fm.error('"' + fm.escape(v) + '" is not match to "/' + fm.escape(p.data('pattern')) + '/"');
[2348] Fix | Delete
});
[2349] Fix | Delete
v = null;
[2350] Fix | Delete
}
[2351] Fix | Delete
}
[2352] Fix | Delete
}
[2353] Fix | Delete
if (v) {
[2354] Fix | Delete
o[t.parent().data('optkey')] = v;
[2355] Fix | Delete
} else {
[2356] Fix | Delete
delete o[p.data('optkey')];
[2357] Fix | Delete
}
[2358] Fix | Delete
b.data('opts', o);
[2359] Fix | Delete
}),
[2360] Fix | Delete
ul = jQuery('<ul></ul>'),
[2361] Fix | Delete
oform = function(n, o) {
[2362] Fix | Delete
var f = jQuery('<p></p>').data('optkey', n).data('type', o.type),
[2363] Fix | Delete
checked = '',
[2364] Fix | Delete
disabled = '',
[2365] Fix | Delete
nozip = false,
[2366] Fix | Delete
opts, btn, elm;
[2367] Fix | Delete
if (o.description) {
[2368] Fix | Delete
f.attr('title', fm.i18n(o.description));
[2369] Fix | Delete
}
[2370] Fix | Delete
if (o.pattern) {
[2371] Fix | Delete
f.data('pattern', o.pattern);
[2372] Fix | Delete
}
[2373] Fix | Delete
f.append(jQuery('<span></span>').text(fm.i18n(n) + ' : '));
[2374] Fix | Delete
if (o.type === 'boolean') {
[2375] Fix | Delete
if (o['default'] || (nozip = (n === 'allow_multiple_outputs' && !allowZip))) {
[2376] Fix | Delete
checked = ' checked';
[2377] Fix | Delete
if (nozip) {
[2378] Fix | Delete
disabled = ' disabled';
[2379] Fix | Delete
}
[2380] Fix | Delete
btn = this.children('button:first');
[2381] Fix | Delete
opts = btn.data('opts') || {};
[2382] Fix | Delete
opts[n] = true;
[2383] Fix | Delete
btn.data('opts', opts);
[2384] Fix | Delete
}
[2385] Fix | Delete
f.append(jQuery('<input type="checkbox" value="true"'+checked+disabled+'/>'));
[2386] Fix | Delete
} else if (o['enum']){
[2387] Fix | Delete
elm = jQuery('<select></select>').append(jQuery('<option value=""></option>').text('Select...'));
[2388] Fix | Delete
jQuery.each(o['enum'], function(i, v) {
[2389] Fix | Delete
elm.append(jQuery('<option value="'+v+'"></option>').text(v));
[2390] Fix | Delete
});
[2391] Fix | Delete
f.append(elm);
[2392] Fix | Delete
} else {
[2393] Fix | Delete
f.append(jQuery('<input type="text" value=""/>'));
[2394] Fix | Delete
}
[2395] Fix | Delete
return f;
[2396] Fix | Delete
},
[2397] Fix | Delete
makeOption = function(o) {
[2398] Fix | Delete
var elm = this,
[2399] Fix | Delete
b = jQuery('<span class="elfinder-button-icon elfinder-button-icon-preference"></span>').on('click', function() {
[2400] Fix | Delete
f.toggle();
[2401] Fix | Delete
}),
[2402] Fix | Delete
f = jQuery('<div class="elfinder-edit-onlinconvert-options"></div>').hide();
[2403] Fix | Delete
if (o.options) {
[2404] Fix | Delete
jQuery.each(o.options, function(k, v) {
[2405] Fix | Delete
k !== 'download_password' && f.append(oform.call(elm, k, v));
[2406] Fix | Delete
});
[2407] Fix | Delete
}
[2408] Fix | Delete
elm.append(b, f);
[2409] Fix | Delete
},
[2410] Fix | Delete
ts = (+new Date()),
[2411] Fix | Delete
i = 0;
[2412] Fix | Delete
[2413] Fix | Delete
if (!confObj.ext2mime) {
[2414] Fix | Delete
confObj.ext2mime = Object.assign(fm.arrayFlip(fm.mimeTypes), ext2mime);
[2415] Fix | Delete
}
[2416] Fix | Delete
jQuery.each(set.conv, function(t, c) {
[2417] Fix | Delete
var cname = t.toLowerCase(),
[2418] Fix | Delete
id = 'elfinder-edit-onlineconvert-' + cname + ts,
[2419] Fix | Delete
type = jQuery('<div id="' + id + '" class="onlineconvert-category onlineconvert-category-'+cname+'"></div>').data('cname', t),
[2420] Fix | Delete
cext;
[2421] Fix | Delete
jQuery.each(c, function(n, o) {
[2422] Fix | Delete
var nl = n.toLowerCase(),
[2423] Fix | Delete
ext = getExt(t, n);
[2424] Fix | Delete
if (!confObj.ext2mime[ext]) {
[2425] Fix | Delete
if (cname === 'audio' || cname === 'image' || cname === 'video') {
[2426] Fix | Delete
confObj.ext2mime[ext] = cname + '/x-' + nl;
[2427] Fix | Delete
} else {
[2428] Fix | Delete
confObj.ext2mime[ext] = 'application/octet-stream';
[2429] Fix | Delete
}
[2430] Fix | Delete
}
[2431] Fix | Delete
if (fm.uploadMimeCheck(confObj.ext2mime[ext], file.phash)) {
[2432] Fix | Delete
type.append(jQuery('<div class="elfinder-edit-onlineconvert-button onlineconvert-'+nl+'"></div>').on('makeoption', function(e, data) {
[2433] Fix | Delete
var elm = jQuery(this);
[2434] Fix | Delete
if (!elm.children('.elfinder-button-icon-preference').length) {
[2435] Fix | Delete
makeOption.call(elm, data);
[2436] Fix | Delete
}
[2437] Fix | Delete
}).append(jQuery('<button></button>').text(n).data('conv', n)));
[2438] Fix | Delete
}
[2439] Fix | Delete
});
[2440] Fix | Delete
if (type.children().length) {
[2441] Fix | Delete
ul.append(jQuery('<li></li>').append(jQuery('<a></a>').attr('href', selfUrl + '#' + id).text(t)));
[2442] Fix | Delete
btns.append(type);
[2443] Fix | Delete
idxs[cname] = i++;
[2444] Fix | Delete
}
[2445] Fix | Delete
});
[2446] Fix | Delete
if (set.useTabs) {
[2447] Fix | Delete
btns.prepend(ul).tabs({
[2448] Fix | Delete
beforeActivate: function(e, ui) {
[2449] Fix | Delete
setOptions(ui.newPanel.data('cname'));
[2450] Fix | Delete
}
[2451] Fix | Delete
});
[2452] Fix | Delete
} else {
[2453] Fix | Delete
jQuery.each(set.conv, function(t) {
[2454] Fix | Delete
var tl = t.toLowerCase();
[2455] Fix | Delete
btns.append(jQuery('<fieldset class="onlineconvert-fieldset-' + tl + '"></fieldset>').append(jQuery('<legend></legend>').text(t)).append(btns.children('.onlineconvert-category-' + tl)));
[2456] Fix | Delete
});
[2457] Fix | Delete
}
[2458] Fix | Delete
return btns;
[2459] Fix | Delete
})(),
[2460] Fix | Delete
select = jQuery(this)
[2461] Fix | Delete
.append(
[2462] Fix | Delete
btns,
[2463] Fix | Delete
(set.showLink? jQuery(set.link) : null)
[2464] Fix | Delete
),
[2465] Fix | Delete
spnr = jQuery('<div class="elfinder-edit-spinner elfinder-edit-onlineconvert"></div>')
[2466] Fix | Delete
.hide()
[2467] Fix | Delete
.html('<span class="elfinder-spinner-text">' + fm.i18n('nowLoading') + '</span><span class="elfinder-spinner"></span>')
[2468] Fix | Delete
.appendTo(select.parent()),
[2469] Fix | Delete
prog = jQuery('<div class="elfinder-quicklook-info-progress"></div>').appendTo(spnr),
[2470] Fix | Delete
_url = null,
[2471] Fix | Delete
url = function() {
[2472] Fix | Delete
var onetime;
[2473] Fix | Delete
if (_url) {
[2474] Fix | Delete
return jQuery.Deferred().resolve(_url);
[2475] Fix | Delete
} else {
[2476] Fix | Delete
spnr.show();
[2477] Fix | Delete
return fm.forExternalUrl(file.hash, { progressBar: prog }).done(function(url) {
[2478] Fix | Delete
_url = url;
[2479] Fix | Delete
}).fail(function(error) {
[2480] Fix | Delete
error && fm.error(error);
[2481] Fix | Delete
ta.elfinderdialog('destroy');
[2482] Fix | Delete
}).always(function() {
[2483] Fix | Delete
spnr.hide();
[2484] Fix | Delete
});
[2485] Fix | Delete
}
[2486] Fix | Delete
},
[2487] Fix | Delete
api = function(opts) {
[2488] Fix | Delete
jQuery(ta).data('dfrd', url().done(function(url) {
[2489] Fix | Delete
select.fadeOut();
[2490] Fix | Delete
setStatus({info: 'Start conversion request.'});
[2491] Fix | Delete
fm.request({
[2492] Fix | Delete
data: {
[2493] Fix | Delete
cmd: 'editor',
[2494] Fix | Delete
name: 'OnlineConvert',
[2495] Fix | Delete
method: 'api',
[2496] Fix | Delete
'args[category]' : opts.category.toLowerCase(),
[2497] Fix | Delete
'args[convert]' : opts.convert.toLowerCase(),
[2498] Fix | Delete
'args[options]' : JSON.stringify(opts.options),
[2499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function