PageSourceSearch

https://mskit.ru/js/bbcode.js

js mskit.ru collected 2026-10-02 08:04:40 UTC 704 bytes, 28 lines download raw bytes

1function addBBCodes(obj_name, code)
2{
3 obj = document.getElementById(obj_name);
4 obj.focus();
5 
6 if (document.selection) 
7 {
8   var s = document.selection.createRange(); 
9   if (s.text) {
10     s.text="[" + code + "]" + s.text + "[/" + code + "]";
11     return true;
12   }
13 }
14 else if (typeof(obj.selectionStart)=="number")
15 {
16   if (obj.selectionStart!=obj.selectionEnd) {
17     var start = obj.selectionStart;
18     var end = obj.selectionEnd;
19
20     var rs = "[" + code + "]" + obj.value.substr(start,end-start) + "[/" + code + "]";
21     obj.value = obj.value.substr(0,start)+rs+obj.value.substr(end);
22     obj.setSelectionRange(end,end);
23   }
24   return true;
25 }
26
27 return false;
28}

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.