PageSourceSearch

https://piratbooks.ru/wp-content/plugins/add-link-to-copied-text/assets/add_link.js?ver=6.9.1

js piratbooks.ru collected 2026-10-03 01:28:23 UTC 3,132 bytes, 81 lines download raw bytes

1function addLinkEntityEncode(str) {
2	str = str.replace(/(<br \/>|<br\/>|<br>)/gim, '::br::');
3	str = new Option(str).innerHTML;
4	return str.replace(/"/g, '&quot;').replace(/::br::/g, '<br />');
5}
6
7function addLinkCopiedContent() {
8    var body_element = document.getElementsByTagName("body")[0],
9    	breaks = "",
10    	params = astx_add_link_copied_text,
11		site_name = Array(),
12		site_url = params.addlinktosite ? params.siteurl : document.URL,
13		selection = window.getSelection ? window.getSelection() : document.selection,
14		selection1 = selection;    
15    for (var i = 0; i < params.breaks; i++) 
16		breaks = breaks + "<br />";
17    if (params.usetitle) 
18		site_name.push(addLinkEntityEncode(params.pagetitle));
19    if (params.addsitename) 
20		site_name.push(addLinkEntityEncode(params.sitename));	
21    if (site_name.length == 0) 
22		site_name.push(site_url);
23    var pagelink = breaks + " " + addLinkEntityEncode(params.readmore) + " " + "<a href='" + site_url + "' ";
24    if (params.target) 
25		pagelink += " target = '_blank'";
26	if (params.reloption == 'canonical' || params.reloption == 'nofollow') 
27		pagelink += " rel = '" + params.reloption + "'";
28    pagelink += ">";
29    if (!params.addlinktosite && params.usesitenameaslink && !params.frontpage) {
30        site_name.push(addLinkEntityEncode(params.sitename));
31        pagelink += site_name[0] + "</a> | <a href='" + params.siteurl + "'";
32        if (params.target) 
33			pagelink += " target = '_blank'";
34		if (params.reloption == 'canonical' || params.reloption == 'nofollow') 
35			pagelink += " rel = '" + params.reloption + "'";
36        pagelink += " >" + site_name[1] + "</a>";
37    } 
38	else 
39		pagelink += site_name.join(" | ") + "</a>";
40    
41    if (params.cleartext || params.replaced_text.length) {
42        selection1 = "";
43        if (window.getSelection) 
44			selection.removeAllRanges();
45        else 
46			window.clipboardData.clearData();
47        if (params.cleartext) 
48			return;
49    }
50    if (params.replaced_text.length) 
51		selection1 = addLinkEntityEncode(params.replaced_text);
52    var copytext = selection1 + pagelink;
53    var appendeddiv = document.createElement("div");
54    appendeddiv.style.position = "absolute";
55    appendeddiv.style.left = "-99999px";
56    body_element.appendChild(appendeddiv);
57    appendeddiv.innerHTML = copytext;
58    var d = function() {
59        var r = document.body.createTextRange();
60        r.moveToElementText(appendeddiv);
61        r.select();
62    };
63    if (!params.cleartext && params.replaced_text.length == 0)
64        if (window.getSelection) 
65			selection.selectAllChildren(appendeddiv);
66        else 
67			d();
68    else if (window.getSelection) 
69		selection.selectAllChildren(appendeddiv);
70    else 
71		d();
72    window.setTimeout(function() {
73        body_element.removeChild(appendeddiv);
74    }, 0);
75}
76if (document.addEventListener) 
77	document.addEventListener("copy", addLinkCopiedContent, true);
78else if (document.attachEvent) 
79	document.documentElement.attachEvent("oncopy", addLinkCopiedContent);
80else 
81	document.oncopy = addLinkCopiedContent;

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.