PageSourceSearch

https://www.autohuset-hoersholm.dk/designs/general/portals/themes/light/js/car-list.js

js autohuset-hoersholm.dk collected 2026-10-08 16:17:33 UTC 2,035 bytes, 65 lines download raw bytes

1/**
2 *  car-list.js
3 *
4 *  Handles used cars list (table) on small displays
5 *
6 */
7 (function($) {
8
9	$.fn.ResponsiveCarList = function(options) {
10 		var $tables = this,
11 		defaults = {id:'stacktable',hideOriginal:false},
12 		settings = $.extend({}, defaults, options),
13 		stacktable;
14
15 		return $tables.each(function() {
16 			var $container = $('<div class="car-list-container"></div>');
17 			var $carList = $('<table class="'+ settings.id +' table"></table>'),
18 			classes = "";
19
20 			if (typeof settings.myClass !== undefined) $carList.addClass(settings.myClass);
21 			var markup = '';
22 			$table = $(this);
23
24 			// build the table
25        	markup += '<tbody>';
26
27	        	$table.find('tbody tr').each(function(index,value) {
28
29	        		// copy the classes
30	        		classes = $(this).closest('tr').attr('class');
31
32	        		markup += '<tr class="' + classes + '">';
33	        			markup += '<td>';
34
35			                // image / thumbnail
36			                markup += $(this).find('.car-image').parent().html();
37			                // model text
38			                markup += '<a class="car-model" href="' + $(this).find('.car-model').attr('href') + '">' + $(this).find('.car-model').html() + '</a>';
39
40			                markup += '<ul>'
41				                // year
42				                markup += '<li class="car-year"><span>Modelår</span> ' + $(this).find('.car-year').html() + '</li>';
43				                // km
44				                markup += '<li class="car-milage"><span>Km</span> ' + $(this).find('.car-milage').html() + '</li>';
45				                // price
46				                markup += '<li class="car-price"><span>Pris</span> ' + $(this).find('.car-price').html() + '</li>';
47			                markup += '</ul>'
48
49						markup += '</td>';
50					markup += '</tr>';
51		    	});
52
53			markup += '</tbody>';
54
55
56			$carList.append($(markup));
57			$container.append($carList);
58
59			
60			$table.before($container);
61			if (settings.hideOriginal) $table.hide();
62		});
63	};
64
65}(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.