PageSourceSearch

https://newbiely.com/javascripts/newbiely.js?t=1790154187

js newbiely.com collected 2026-09-25 19:22:08 UTC 4,475 bytes, 183 lines download raw bytes

1window.Clipboard = (function(window, document, navigator) {
2	var textArea,
3		copy;
4
5	function isOS() {
6		return navigator.userAgent.match(/ipad|iphone/i);
7	}
8
9	function createTextArea(text) {
10		textArea = document.createElement('textArea');
11		textArea.value = text;
12		document.body.appendChild(textArea);
13	}
14
15	function selectText() {
16		var range,
17			selection;
18
19		if (isOS()) {
20			range = document.createRange();
21			range.selectNodeContents(textArea);
22			selection = window.getSelection();
23			selection.removeAllRanges();
24			selection.addRange(range);
25			textArea.setSelectionRange(0, 999999);
26		} else {
27			textArea.select();
28		}
29	}
30
31	function copyToClipboard() {
32		document.execCommand('copy');
33		document.body.removeChild(textArea);
34	}
35
36	copy = function(text) {
37		createTextArea(text);
38		selectText();
39		copyToClipboard();
40	};
41
42	return {
43		copy: copy
44	};
45})(window, document, navigator);
46
47var copy_clicked = false;
48
49function copy(code_id)
50{
51	var text = document.getElementById("code_" + code_id).innerText;
52	Clipboard.copy(text);
53
54	copy_clicked = true;
55
56	$('#code_copy_toast_' + code_id).html('Copied to clipboard');
57	$('#code_copy_toast_' + code_id).addClass('show');
58
59	setTimeout(function(){
60		$('#code_copy_toast_' + code_id).removeClass('show');
61		copy_clicked = false;
62	}, 3000);
63}
64
65function onMouseOverCopy(code_id)
66{
67	if(copy_clicked)
68		return;
69
70	$('#code_copy_toast_' + code_id).html('Click to copy');
71	$('#code_copy_toast_' + code_id).addClass('show');
72}
73
74function onMouseOutCopy(code_id)
75{
76	if(copy_clicked)
77		return;
78
79	$('#code_copy_toast_' + code_id).removeClass('show');
80}
81
82var lastHash = "";
83
84$(document).ready(function () {
85	$(window).scroll(function () {
86		var scrollTop = $(window).scrollTop();
87
88		if (scrollTop >= 100) {
89			$('#header').addClass('header-scrolled');
90			$('#nav_vertical').addClass('nav-y-scrolled');
91			//$('#bookmark_container').addClass('nav-y-scrolled');
92			$('body').addClass('body-scrolled');
93		} else if (scrollTop < 80) {
94			$('#header').removeClass('header-scrolled');
95			$('#nav_vertical').removeClass('nav-y-scrolled');
96			//$('#bookmark_container').removeClass('nav-y-scrolled');
97			$('body').removeClass('body-scrolled');
98		}
99
100		if($('.bookmark').length > 0)
101		{
102			var firstId = $('.bookmark' ).first().attr("href");
103
104			if(($(firstId ).position().top - 55) > scrollTop) {
105				$('.bookmark' ).first().addClass('bookmark-active');
106			} else {
107				$('.bookmark' ).each(function(index) {
108					var refId = $(this).attr("href");
109
110					var refTop = $(refId).position().top;
111					var refBottom = refTop + $(refId).outerHeight();
112					if((refTop - 150) <= scrollTop && (refBottom - 150) > scrollTop) {
113						$(this).addClass('bookmark-active');
114						lastHash = $(this).attr("href");
115						isFound = true;
116					} else {
117						$(this).removeClass('bookmark-active');
118					}
119				});
120			}
121		}
122	});
123
124	$('.bookmark').on("click", function(e) {
125		if(lastHash == $(this).attr("href"))
126			e.preventDefault();
127		else
128		{
129			$('.bookmark' ).each(function(index) {
130				$(this).removeClass('bookmark-active');
131			});
132		}
133	});
134
135	if(window.location.hash) {
136		setTimeout(function(){$(window).trigger('hashchange');}, 500);
137	} else {
138		if($('.bookmark').length > 0)
139		{
140			$('.bookmark' ).first().addClass('bookmark-active');
141		}
142	}
143
144	$(window).on( 'hashchange', function( e ) {
145		if(window.location.hash !== "") {
146			var offset = $(':target').offset();
147			var scrollto = offset.top - 90; // minus fixed header height
148			$('html, body').animate({scrollTop:scrollto}, 0);
149
150			lastHash = window.location.hash;
151		}
152	});
153
154	$('#burger_nav_y').click(function(){
155		$('#burger_nav_x').removeClass('open');
156		$('#nav_x').removeClass('open');
157		$('#burger_nav_y').toggleClass('open');
158		$('#nav_y').toggleClass('open');
159	});
160
161	$('#burger_nav_x').on('click', function () {
162		$('#burger_nav_y').removeClass('open');
163		$('#nav_y').removeClass('open');
164		$('#burger_nav_x').toggleClass('open');
165		$('#nav_x').toggleClass('open');
166	});
167
168
169	$('.image-zoomable' ).each(function() {
170		$(this).on("click", function(){
171			$('#modal_image').attr('src', $(this).attr('src'));
172			$('#modal_container').show();
173		});
174	});
175
176	$('#modal_close').on("click", function(){
177		$('#modal_container').hide();
178	});
179
180	$('#modal_container').on("click", function(){
181		$('#modal_container').hide();
182	});
183});

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.