PageSourceSearch

http://www.kmanual.net/custom.js

js kmanual.net collected 2026-10-08 11:30:04 UTC 8,012 bytes, 251 lines download raw bytes

1function sfield(type,field,img) {
2   if (type==1) {document.getElementById(field).style.background = '#FFFFFF';}
3   if (type==2) {
4	if (document.getElementById(field).value!='') {document.getElementById(field).style.background = '#FFFFFF';}
5	else {document.getElementById(field).style.background = '#FFFFFF url(/img/'+img+'.png) no-repeat left top';}
6   }
7}
8
9
10function fontchng (type) {
11   var curr = document.getElementById('ctext').style.fontSize;
12   curr = curr.replace(/px/g,'');
13   if (curr=='') {curr = 14;}
14   if (type=='dec') {curr--;}
15   if (type=='inc') {curr++;}
16   if (type=='def') {curr = 14;}
17   if ((curr>20)||(curr<11)) {return;}
18   var curr2 = curr - 1;
19   $('#ctext').css('font-size', curr+'px');
20   $('#ctext li').css('font-size', curr2+'px');
21   $('#ctext blockquote').css('font-size', curr2+'px');
22}
23
24function mobfontchng (type) {
25   var curr = document.getElementById('ctext').style.fontSize;
26   curr = curr.replace(/px/g,'');
27   if (curr=='') {curr = 17;}
28   if (type=='dec') {curr--;}
29   if (type=='inc') {curr++;}
30   if (type=='def') {curr = 17;}
31   if ((curr>25)||(curr<13)) {return;}
32   var curr2 = curr - 1;
33   $('#ctext').css('font-size', curr+'px');
34   $('#ctext li').css('font-size', curr2+'px');
35   $('#ctext blockquote').css('font-size', curr2+'px');
36}
37
38
39
40function modelchng (carname,action) {
41   if (action==1) {$("#"+carname).addClass(carname+"_2");}
42   else {$("#"+carname).removeClass(carname+"_2");}
43}
44
45function bgchange (field) {
46   if (document.getElementById(field).className=='warpbg1') {document.getElementById(field).className = 'warpbg2'; document.getElementById(field).title = 'Свернуть';}
47   else {document.getElementById(field).className = 'warpbg1'; document.getElementById(field).title = 'Развернуть';}
48}
49
50
51
52function trim (str,charlist) {
53   charlist = !charlist ? ' \\t\\s\xA0' : charlist.replace(/([\[\]\(\)\.\?\/\*\{\}\+\$\^\:])/g, '\$1');
54   var re = new RegExp('^[' + charlist + ']+|[' + charlist + ']+$', 'g');
55   return str.replace(re, '');
56}
57
58
59function sort (type) {
60   var form=document.sort_form;
61   document.sort_form.sort_type.value=type;
62   form.submit();
63}
64
65
66function showPic(id) {document.getElementById('pic'+id).style.visibility = "visible";}
67function hidePic(id) {document.getElementById('pic'+id).style.visibility = "hidden";}
68
69
70
71function boldText(s){return '<b>'+s+'</b>';}
72function italicText(s){return '<i>'+s+'</i>';}
73function undText(s){return '<u>'+s+'</u>';}
74function quoteText(s){return '<blockquote>'+s+'</blockquote>';}
75
76
77function showDiv(divid) {document.getElementById(divid).style.visibility = "visible";}
78function hideDiv(divid) {document.getElementById(divid).style.visibility = "hidden";}
79function showDiv2(divid) {document.getElementById(divid).style.display = "table";}
80function hideDiv2(divid) {document.getElementById(divid).style.display = "none";}
81
82
83
84function replaceSelectedText(obj,cbFunc) {
85 obj = document.getElementById(obj);
86 obj.focus();
87 
88 if (document.selection) 
89 {
90   var s = document.selection.createRange(); 
91   if (s.text)
92   {
93     eval("s.text="+cbFunc+"(s.text);");
94	 s.select();
95	 return true;
96   }
97 }
98 else if (typeof(obj.selectionStart)=="number")
99 {
100   if (obj.selectionStart!=obj.selectionEnd)
101   {
102     var start = obj.selectionStart;
103     var end = obj.selectionEnd;
104
105     eval("var rs = "+cbFunc+"(obj.value.substr(start,end-start));");
106     obj.value = obj.value.substr(0,start)+rs+obj.value.substr(end);
107     obj.setSelectionRange(end,end);
108   }
109   return true;
110 }
111
112 return false;
113}
114
115
116function strip_tags (input, allowed) {
117    allowed = (((allowed || "") + "").toLowerCase().match(/<[a-z][a-z0-9]*>/g) || []).join('');
118    var tags = /<\/?([a-z][a-z0-9]*)\b[^>]*>/gi,
119        commentsAndPhpTags = /<!--[\s\S]*?-->|<\?(?:php)?[\s\S]*?\?>/gi;
120    return input.replace(commentsAndPhpTags, '').replace(tags, function ($0, $1) {
121        return allowed.indexOf('<' + $1.toLowerCase() + '>') > -1 ? $0 : '';
122    });
123}
124
125
126function PositionSaver(target) {
127    if (document.selection && document.selection.createRange) {//IE 4.0 (win32) & Opera 8.0
128        cursor = document.selection.createRange().duplicate();
129        return;
130    }
131    if (typeof(target.selectionStart) != "undefined") {//FireFox & Mozilla
132        cursorStart = target.selectionStart;
133        cursorEnd = target.selectionEnd;
134        cursorScroll = target.scrollTop;
135        return;
136    }
137}
138
139
140InsertTag_tags = new Array();
141function InsertTag(id, open, close, type) {
142    open = trim(open);
143    var pattern = /\n/g;
144    open = open.replace(pattern, '');
145    var pattern = /<blockquote>[\s\S]*blockquote>/g;
146    open = open.replace(pattern, '');
147    open = strip_tags(open, '<i><u><b>');
148    if (type==1) {open = '<blockquote> '+open+' </blockquote>\n';}
149    if (type==2) {open = open+', ';}
150    var target = document.getElementById(id);
151    if (!window.opera) target.focus();
152    if (typeof(cursor) != "undefined") {
153        //alert("IE & Opera");
154        if (cursor.text.length) {
155            cursor.text = open + cursor.text + close;
156            cursor.moveToElementText(target);
157            cursor.collapse(false);
158        } else {
159            cursor.text = open + close;
160            cursor.moveEnd("character", -close.length);
161        }
162        cursor.select();
163        return;
164    }
165    if (typeof(cursorStart) != "undefined") {//Gecko
166        var start = target.value.substring(0, cursorStart),
167            selected = target.value.substring(cursorStart, cursorEnd),
168            end = target.value.substr(cursorEnd);
169        target.value = start + open + selected + close + end;
170        target.selectionStart = target.selectionEnd = selected.length ? target.value.length : start.length + open.length;
171        target.scrollTop = cursorScroll;
172        return;
173    }
174    if (InsertTag_tags[open + close]) {
175        target.value += close;
176        InsertTag_tags[open + close] = false;
177    } else {
178        target.value += open;
179        InsertTag_tags[open + close] = true;
180    }
181}
182
183
184$('.scrollTop').click(function(){
185    $("html, body").animate({ scrollTop: 0 }, 650);
186    return false;
187});
188
189
190function urlsel (id) {
191   for (i=1; i<4; i++) {
192	document.getElementById('url_text'+i).style.display = "none";
193	document.getElementById('url'+i).className = "free";
194	document.getElementById('url'+i).className = "free";
195   }
196   document.getElementById('url_text'+id).style.display = "inline";
197   document.getElementById('url'+id).className = "curr";
198   document.getElementById('url'+id).className = "curr";
199}
200
201
202
203function anekdot() {
204   makeRequest('http://www.kmanual.net/inc/anekdot.php','anek');
205}
206
207
208
209function makeRequest(url,divid) {
210   var http_request = false;
211   if (window.XMLHttpRequest) {
212   http_request = new XMLHttpRequest();
213   if (http_request.overrideMimeType) {http_request.overrideMimeType('text/xml');}
214   } else if (window.ActiveXObject) {
215	try {http_request = new ActiveXObject("Msxml2.XMLHTTP");}
216	catch (e) {
217	   try {
218		 http_request = new ActiveXObject("Microsoft.XMLHTTP");
219	   } catch (e) {}
220	}
221   }
222   http_request.onreadystatechange = function() {
223   if (http_request.readyState == 4) {
224   if (http_request.status == 200) {
225	document.getElementById(divid).innerHTML = http_request.responseText;
226   }
227   }
228
229   };
230	http_request.open('GET', url, true);
231	http_request.send(null);
232}
233
234
235function setcookie() {
236    document.cookie = "is_cookie"+"="+1+"; max-age=2000000; path=/; domain=kmanual.net";
237    document.querySelector(".kia_11").classList.add("hidden");
238}
239
240
241function mobsite(id) {
242    document.cookie = "mobsite"+"="+id+"; max-age=8000000; path=/; domain=kmanual.net";
243    location.reload();
244}
245
246
247function AddToBookmark() {
248    alert('Для добавления страницы в закладки нажмите Ctrl+D');
249    return false;
250}
251

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.