/** This file is part of KCFinder project * * @desc Miscellaneous functionality * @package KCFinder * @version 3.12 * @author Pavel Tzonkov <sunhater@sunhater.com> * @copyright 2010-2014 KCFinder Project * @license http://opensource.org/licenses/GPL-3.0 GPLv3 * @license http://opensource.org/licenses/LGPL-3.0 LGPLv3 * @link http://kcfinder.sunhater.com */ _.orderFiles = function(callBack, selected) { var order = $.$.kuki.get('order'), desc = ($.$.kuki.get('orderDesc') == "on"), a1, b1, arr; if (!_.files || !_.files.sort) _.files = []; _.files = _.files.sort(function(a, b) { if (!order) order = "name"; if (order == "date") { a1 = a.mtime; b1 = b.mtime; } else if (order == "type") { a1 = $.$.getFileExtension(a.name); b1 = $.$.getFileExtension(b.name); } else if (order == "size") { a1 = a.size; b1 = b.size; } else { a1 = a[order].toLowerCase(); b1 = b[order].toLowerCase(); } if ((order == "size") || (order == "date")) { if (a1 < b1) return desc ? 1 : -1; if (a1 > b1) return desc ? -1 : 1; } if (a1 == b1) { a1 = a.name.toLowerCase(); b1 = b.name.toLowerCase(); arr = [a1, b1]; arr = arr.sort(); return (arr[0] == a1) ? -1 : 1; } arr = [a1, b1]; arr = arr.sort(); if (arr[0] == a1) return desc ? 1 : -1; return desc ? -1 : 1; }); _.showFiles(callBack, selected); _.initFiles(); }; _.humanSize = function(size) { if (size < 1024) { size = size.toString() + " B"; } else if (size < 1048576) { size /= 1024; size = parseInt(size).toString() + " KB"; } else if (size < 1073741824) { size /= 1048576; size = parseInt(size).toString() + " MB"; } else if (size < 1099511627776) { size /= 1073741824; size = parseInt(size).toString() + " GB"; } else { size /= 1099511627776; size = parseInt(size).toString() + " TB"; } return size; }; _.getURL = function(act) { var url = "browse.php?type=" + encodeURIComponent(_.type) + "&lng=" + encodeURIComponent(_.lang); if (_.opener.name) url += "&opener=" + encodeURIComponent(_.opener.name); if (act) url += "&act=" + encodeURIComponent(act); if (_.cms) url += "&cms=" + encodeURIComponent(_.cms); return url; }; _.label = function(index, data) { var label = _.labels[index] ? _.labels[index] : index; if (data) $.each(data, function(key, val) { label = label.replace("{" + key + "}", val); }); return label; }; _.check4errors = function(data) { if (!data.error) return false; var msg = data.error.join ? data.error.join("\n") : data.error; _.alert(msg); return true; }; _.post = function(url, data) { var html = '<form id="postForm" method="post" action="' + url + '">'; $.each(data, function(key, val) { if ($.isArray(val)) $.each(val, function(i, aval) { html += '<input type="hidden" name="' + $.$.htmlValue(key) + '[]" value="' + $.$.htmlValue(aval) + '" />'; }); else html += '<input type="hidden" name="' + $.$.htmlValue(key) + '" value="' + $.$.htmlValue(val) + '" />'; }); html += '</form>'; $('#menu').html(html).show(); $('#postForm').get(0).submit(); }; _.fadeFiles = function() { $('#files > div').css({ opacity: "0.4", filter: "alpha(opacity=40)" }); };
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
000._jquery.js | File | 94.12 KB | 0644 |
|
002._jqueryui.js | File | 223.18 KB | 0644 |
|
006.jquery.transForm.js | File | 36.02 KB | 0644 |
|
006.jquery.uniform.js | File | 35.26 KB | 0644 |
|
010.jquery.fixes.js | File | 2.29 KB | 0644 |
|
020.jquery.rightClick.js | File | 812 B | 0644 |
|
021.jquery.taphold.js | File | 4.55 KB | 0644 |
|
022.jquery.shDropUpload.js | File | 13.03 KB | 0644 |
|
029.jquery.agent.js | File | 2.96 KB | 0644 |
|
030.jquery.helper.js | File | 8.91 KB | 0644 |
|
031.jquery.md5.js | File | 9.27 KB | 0644 |
|
040.object.js | File | 569 B | 0644 |
|
041.dialogs.js | File | 5.89 KB | 0644 |
|
050.init.js | File | 8.73 KB | 0644 |
|
060.toolbar.js | File | 10.33 KB | 0644 |
|
070.settings.js | File | 2.61 KB | 0644 |
|
080.files.js | File | 8.08 KB | 0644 |
|
090.folders.js | File | 6.86 KB | 0644 |
|
091.menus.js | File | 20.67 KB | 0644 |
|
091.viewImage.js | File | 5.85 KB | 0644 |
|
100.clipboard.js | File | 6.2 KB | 0644 |
|
110.dropUpload.js | File | 8.42 KB | 0644 |
|
120.misc.js | File | 3.66 KB | 0644 |
|
index.php | File | 552 B | 0644 |
|