PageSourceSearch

https://rmrb.online/js/core/tab.js

js rmrb.online collected 2026-10-06 06:15:39 UTC 1,847 bytes, 65 lines download raw bytes

1function showTabs(id,select,element,css){
2	var o = getObj(id);
3	var t = o.getElementsByTagName(element);
4	for (var i=0;i<t.length;i++) {
5		if (t[i].id) {
6			var oo = getObj(t[i].id);
7			if (t[i].id == select) {
8				getObj(t[i].id).className = css;
9				getObj('info_'+t[i].id).style.display = '';
10			} else {
11				getObj(t[i].id).className = '';
12				getObj('info_'+t[i].id).style.display = 'none';
13			}
14		}
15	}
16	if (getObj('info_type')) {
17		getObj('info_type').value=select;
18	}
19	return false;
20}
21
22function pwTab(tabId, tabpre, infopre, cookie, tagname, css) {
23	this.css = (typeof css == 'undefined' || css == '') ? 'current' : css;
24	this.tagname = (typeof tagname == 'undefined' || tagname == '') ? 'li' : tagname;
25	this.cookie = (typeof cookie == 'undefined' || cookie == '') ? '' : cookie;
26	this.tab = getObj(tabId);
27	this.tabpre = tabpre;
28	this.infopre = infopre;
29	this.init();
30}
31
32pwTab.prototype.init = function() {
33	var tags = this.tab.getElementsByTagName(this.tagname);
34	var its = this;
35	for (var i = 0; i < tags.length; i++) {
36		if (this.checkId(tags[i].id)) {
37			tags[i].onclick = function() {
38				its.show(this.id);
39			}
40		}
41	}
42}
43
44pwTab.prototype.checkId = function(id) {
45	return (id && id.substr(0, this.tabpre.length) == this.tabpre);
46}
47
48pwTab.prototype.show = function(id) {
49	if (typeof id == 'undefined' || !id || id == 'null') {
50		return;
51	}
52	var tags = this.tab.getElementsByTagName(this.tagname);
53	for (var i = 0; i < tags.length; i++) {
54		if (this.checkId(tags[i].id)) {
55			tags[i].className = (tags[i].id == id) ? this.css : '';
56			var key = tags[i].id.substr(this.tabpre.length);
57			if (IsElement(this.infopre + key)) {
58				getObj(this.infopre + key).style.display = (tags[i].id == id) ? '' : 'none';
59			}
60		}
61	}
62	if (this.cookie) {
63		SetCookie(this.cookie, id);
64	}
65}

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.