1/*! 2 * jQuery AutoColumnList Plugin 3 * Version: 1.2.0 (02/26/2017) 4 * Requires: jQuery v1.8 or later 5 * Repository: https://github.com/Neolot/jQuery.AutoColumnList 6 * License: MIT, http://www.opensource.org/licenses/mit-license.php 7 * Copyright (c) 2011-2017 Yuriy Pokhylko 8 * Author URI: https://neolot.com 9 */ 10 11(function($) { 12 var defaults = { 13 columns: 4, 14 classname: 'column', 15 min: 1 16 }; 17 18 $.fn.autocolumnlist = function(params){ 19 var options = $.extend({}, defaults, params); 20 return this.each(function() { 21 var data_parameters = $(this).data(); 22 if ( data_parameters ) { 23 $.each(data_parameters, function (key, value) { 24 options[key] = value; 25 }); 26 } 27 28 var els = $(this).find('> li'); 29 var dimension = els.length; 30 if (dimension > 0) { 31 var elCol = Math.ceil(dimension/options.columns); 32 if (elCol < options.min) { 33 elCol = options.min; 34 } 35 var start = 0; 36 var end = elCol; 37 38 for (i=0; i<options.columns; i++) { 39 if ((i + 1) == options.columns) { 40 els.slice(start, end).wrapAll('<div class="'+options.classname+' last" />'); 41 } else { 42 els.slice(start, end).wrapAll('<div class="'+options.classname+'" />'); 43 } 44 start = start+elCol; 45 end = end+elCol; 46 } 47 } 48 }); 49 }; 50})(jQuery);
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.