1/** 2 * Dropfiles 3 * 4 * We developed this code with our hearts and passion. 5 * We hope you found it useful, easy to understand and to customize. 6 * Otherwise, please feel free to contact us at [email protected] * 7 * @package Dropfiles 8 * @copyright Copyright (C) 2013 JoomUnited (http://www.joomunited.com). All rights reserved. 9 * @copyright Copyright (C) 2013 Damien Barrère (http://www.crac-design.com). All rights reserved. 10 * @license GNU General Public License version 2 or later; http://www.gnu.org/licenses/gpl-2.0.html 11 * 12 */ 13 14bytesToSize = function(bytes) { 15 var sizes = [Joomla.JText._('COM_DROPFILES_FIELD_FILE_BYTE','b'),Joomla.JText._('COM_DROPFILES_FIELD_FILE_KILOBYTE','kb'),Joomla.JText._('COM_DROPFILES_FIELD_FILE_MEGABYTE','mb'),Joomla.JText._('COM_DROPFILES_FIELD_FILE_GIGABYTE','gb'),Joomla.JText._('COM_DROPFILES_FIELD_FILE_TERRABYTE','tb'),Joomla.JText._('COM_DROPFILES_FIELD_FILE_PETABYTE','tb') ]; 16 if (bytes == 0) return 'n/a'; 17 var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024))); 18 return Math.round(bytes / Math.pow(1024, i), 2) + ' ' + sizes[i]; 19};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.