PageSourceSearch

https://meyas.pt/js/util.js

js meyas.pt collected 2026-10-06 10:41:33 UTC 1,980 bytes, 60 lines download raw bytes

1// Avoid `console` errors in browsers that lack a console.
2(function() {
3  var method;
4  var noop = function () {};
5  var methods = [
6    'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error',
7    'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log',
8    'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd',
9    'timeline', 'timelineEnd', 'timeStamp', 'trace', 'warn'
10  ];
11  var length = methods.length;
12  var console = (window.console = window.console || {});
13
14  while (length--) {
15    method = methods[length];
16
17    // Only stub undefined methods.
18    if (!console[method]) {
19      console[method] = noop;
20    }
21  }
22}());
23
24// Place any jQuery/helper plugins in here.
25
26(function($) {
27
28	$('table tr td:first-child').on('click touch', function() {
29	  $(this).parent().toggleClass('active');
30	  $(this).parent().siblings().removeClass('active');
31	})
32
33	var tables = document.getElementsByTagName('table');
34	for (i = 0; i < tables.length; i++) {
35	  var headers = tables[i].getElementsByTagName('th'),
36	    rows = tables[i].getElementsByTagName('tr'),
37	    header = [];
38	  for (h = 0; h < headers.length; h++) {
39	    header.push(headers[h].textContent);
40	  }
41	  for (r = 0; r < rows.length; r++) {
42	    var cells = rows[r].getElementsByTagName('td');
43	    for (c = 0; c < cells.length; c++) {
44	      if (cells[c].getAttribute('data-header') == undefined && header[c] !== undefined) {
45	        cells[c].setAttribute('data-header', header[c]);
46	      }
47	      if (cells[c].innerHTML.trim() == 'Yes') {
48	      	cells[c].innerHTML = '<i class="fa fa-check" aria-hidden="true" style="color:green"></i>';
49	      }
50	      if (cells[c].innerHTML.trim() == 'Free') {
51	      	cells[c].innerHTML = '<i class="fa fa-check" aria-hidden="true" style="color:green"></i>';
52	      }
53	      if (cells[c].innerHTML.trim() == 'No') {
54	      	cells[c].innerHTML = '<i class="fa fa-times" aria-hidden="true" style="color:red"></i>';
55	      }
56	    }
57	  }
58	}
59
60})(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.