PageSourceSearch

https://mijn.firemultimedia.nl/klantenpaneel/custom/assets/js/utils.js

js firemultimedia.nl collected 2026-09-25 22:51:28 UTC 4,283 bytes, 192 lines download raw bytes

1'use strict';
2
3window.chartColors = {
4	red: 'rgb(255, 99, 132)',
5	orange: 'rgb(255, 159, 64)',
6	yellow: 'rgb(255, 205, 86)',
7	green: 'rgb(75, 192, 192)',
8	blue: 'rgb(54, 162, 235)',
9	purple: 'rgb(153, 102, 255)',
10	grey: 'rgb(201, 203, 207)'
11};
12
13(function(global) {
14	var MONTHS = [
15		'January',
16		'February',
17		'March',
18		'April',
19		'May',
20		'June',
21		'July',
22		'August',
23		'September',
24		'October',
25		'November',
26		'December'
27	];
28
29	var COLORS = [
30		'#4dc9f6',
31		'#f67019',
32		'#f53794',
33		'#537bc4',
34		'#acc236',
35		'#166a8f',
36		'#00a950',
37		'#58595b',
38		'#8549ba'
39	];
40
41	var Samples = global.Samples || (global.Samples = {});
42	var Color = global.Color;
43
44	Samples.utils = {
45		// Adapted from http://indiegamr.com/generate-repeatable-random-numbers-in-js/
46		srand: function(seed) {
47			this._seed = seed;
48		},
49
50		rand: function(min, max) {
51			var seed = this._seed;
52			min = min === undefined ? 0 : min;
53			max = max === undefined ? 1 : max;
54			this._seed = (seed * 9301 + 49297) % 233280;
55			return min + (this._seed / 233280) * (max - min);
56		},
57
58		numbers: function(config) {
59			var cfg = config || {};
60			var min = cfg.min || 0;
61			var max = cfg.max || 1;
62			var from = cfg.from || [];
63			var count = cfg.count || 8;
64			var decimals = cfg.decimals || 8;
65			var continuity = cfg.continuity || 1;
66			var dfactor = Math.pow(10, decimals) || 0;
67			var data = [];
68			var i, value;
69
70			for (i = 0; i < count; ++i) {
71				value = (from[i] || 0) + this.rand(min, max);
72				if (this.rand() <= continuity) {
73					data.push(Math.round(dfactor * value) / dfactor);
74				} else {
75					data.push(null);
76				}
77			}
78
79			return data;
80		},
81
82		labels: function(config) {
83			var cfg = config || {};
84			var min = cfg.min || 0;
85			var max = cfg.max || 100;
86			var count = cfg.count || 8;
87			var step = (max - min) / count;
88			var decimals = cfg.decimals || 8;
89			var dfactor = Math.pow(10, decimals) || 0;
90			var prefix = cfg.prefix || '';
91			var values = [];
92			var i;
93
94			for (i = min; i < max; i += step) {
95				values.push(prefix + Math.round(dfactor * i) / dfactor);
96			}
97
98			return values;
99		},
100
101		months: function(config) {
102			var cfg = config || {};
103			var count = cfg.count || 12;
104			var section = cfg.section;
105			var values = [];
106			var i, value;
107
108			for (i = 0; i < count; ++i) {
109				value = MONTHS[Math.ceil(i) % 12];
110				values.push(value.substring(0, section));
111			}
112
113			return values;
114		},
115
116		color: function(index) {
117			return COLORS[index % COLORS.length];
118		},
119
120		transparentize: function(color, opacity) {
121			var alpha = opacity === undefined ? 0.5 : 1 - opacity;
122			return Color(color).alpha(alpha).rgbString();
123		}
124	};
125
126	// DEPRECATED
127	window.randomScalingFactor = function() {
128		return Math.round(Samples.utils.rand(-100, 100));
129	};
130
131	// INITIALIZATION
132
133	Samples.utils.srand(Date.now());
134
135	// Google Analytics
136	/* eslint-disable */
137	if (document.location.hostname.match(/^(www\.)?chartjs\.org$/)) {
vendor: 338 bytes, lines 137-142
137
138		(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
139		(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
140		m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
141		})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
142		ga('create', '
142UA-28909194-3
vendor: 39 bytes, lines 142-144
142', 'auto');
143		ga('send', 'pageview');
144	
144}
145	/* eslint-enable */
146
147}(this));
148
149$(function () {
150	switchRowsAndCols("table", 767);
151});
152
153function switchRowsAndCols(thisTable, resolution) {
154	if ($(window).width() < resolution) {
155		switchRowsAndColsInnerFun(thisTable);
156	}
157	$(window).resize(function () {
158		if ($(window).width() < resolution) {
159			switchRowsAndColsInnerFun(thisTable);
160		}else{
161			switchRowsAndColsRemove(thisTable);
162		}
163	});
164};
165
166function switchRowsAndColsRemove(thisTable) {
167	$("tr > *", thisTable).css({
168		height: 'auto'
169	});
170};
171
172function switchRowsAndColsInnerFun(thisTable) {
173	var maxRow = $("tr:first-child() > *", thisTable).length;
174
175	for (var i = maxRow; i >= 0; i--) {
176
177		$("tr > *:nth-child(" + i + ")", thisTable).css({
178			height: 'auto'
179		});
180
181		var maxHeight = 0;
182
183		$("tr > *:nth-child(" + i + ")", thisTable).each(function () {
184			var h = $(this).height();
185			maxHeight = h > maxHeight ? h : maxHeight;
186		});
187
188		$("tr > *:nth-child(" + i + ")", thisTable).each(function () {
189			$(this).height(maxHeight);
190		});
191	};
192};

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.