PageSourceSearch

https://www.viversano.net/wp-content/plugins/append-link-on-copy/js/append_link.js?ver=7.1

js viversano.net collected 2026-10-02 07:16:54 UTC 1,197 bytes, 51 lines download raw bytes

1// original function by c. bavota at: http://bavotasan.com/2010/add-a-copyright-notice-to-copied-text/
2function addLink() {
3	var body_element = document.getElementsByTagName('body')[0];
4	var selection;
5	selection = window.getSelection();
6	var linebreaks = '';
7	var link_name;
8
9
10	for (i = 0; i < append_link.prepend_break; i++) {
11		linebreaks = linebreaks + '<br />';
12	}
13
14	if (append_link.use_title == 'true') {
15		link_name = append_link.page_title;
16	}
17	else {
18		link_name = document.URL
19	}
20
21	if (append_link.add_site_name == 'true') {
22		link_name += ' | ' + append_link.site_name;
23	}
24
25	if (append_link.always_link_site == true) {
26		link_url = append_link.site_url;
27	}
28	else {
29		link_url = document.URL;
30	}
31
32	var pagelink =
33		linebreaks
34		+ ' ' + append_link.read_more + ' ';
35
36	pagelink = pagelink.replace('%link%', ' ' + link_url + ' ');
37
38	var copytext = selection + pagelink;
39	var newdiv = document.createElement('div');
40
41	newdiv.style.position='absolute';
42	newdiv.style.left='-99999px';
43	body_element.appendChild(newdiv);
44	newdiv.innerHTML = copytext;
45	selection.selectAllChildren(newdiv);
46	window.setTimeout(function() {
47		body_element.removeChild(newdiv);
48	},0);
49}
50
51document.oncopy = addLink;

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.