PageSourceSearch

https://www.wysilab.com/forum/Themes/GamingNation/scripts/theme.js?fin20

js wysilab.com collected 2026-10-04 02:42:46 UTC 4,821 bytes, 126 lines download raw bytes

1// The purpose of this code is to fix the height of overflow: auto blocks, because some browsers can't figure it out for themselves.
2function smf_codeBoxFix()
3{
4	var codeFix = document.getElementsByTagName('code');
5	for (var i = codeFix.length - 1; i >= 0; i--)
6	{
7		if (is_webkit && codeFix[i].offsetHeight < 20)
8			codeFix[i].style.height = (codeFix[i].offsetHeight + 20) + 'px';
9
10		else if (is_ff && (codeFix[i].scrollWidth > codeFix[i].clientWidth || codeFix[i].clientWidth == 0))
11			codeFix[i].style.overflow = 'scroll';
12
13		else if ('currentStyle' in codeFix[i] && codeFix[i].currentStyle.overflow == 'auto' && (codeFix[i].currentStyle.height == '' || codeFix[i].currentStyle.height == 'auto') && (codeFix[i].scrollWidth > codeFix[i].clientWidth || codeFix[i].clientWidth == 0) && (codeFix[i].offsetHeight != 0))
14			codeFix[i].style.height = (codeFix[i].offsetHeight + 24) + 'px';
15	}
16}
17
18// Add a fix for code stuff?
19if ((is_ie && !is_ie4) || is_webkit || is_ff)
20	addLoadEvent(smf_codeBoxFix);
21
22// Toggles the element height and width styles of an image.
23function smc_toggleImageDimensions()
24{
25	var oImages = document.getElementsByTagName('IMG');
26	for (oImage in oImages)
27	{
28		// Not a resized image? Skip it.
29		if (oImages[oImage].className == undefined || oImages[oImage].className.indexOf('bbc_img resized') == -1)
30			continue;
31
32		oImages[oImage].style.cursor = 'pointer';
33		oImages[oImage].onclick = function() {
34			this.style.width = this.style.height = this.style.width == 'auto' ? null : 'auto';
35		};
36	}
37}
38
39// Add a load event for the function above.
40addLoadEvent(smc_toggleImageDimensions);
41
42// Adds a button to a certain button strip.
43function smf_addButton(sButtonStripId, bUseImage, oOptions)
44{
45	var oButtonStrip = document.getElementById(sButtonStripId);
46	var aItems = oButtonStrip.getElementsByTagName('span');
47
48	// Remove the 'last' class from the last item.
49	if (aItems.length > 0)
50	{
51		var oLastSpan = aItems[aItems.length - 1];
52		oLastSpan.className = oLastSpan.className.replace(/\s*last/, 'position_holder');
53	}
54
55	// Add the button.
56	var oButtonStripList = oButtonStrip.getElementsByTagName('ul')[0];
57	var oNewButton = document.createElement('li');
58	setInnerHTML(oNewButton, '<a href="' + oOptions.sUrl + '" ' + ('sCustom' in oOptions ? oOptions.sCustom : '') + '><span class="last"' + ('sId' in oOptions ? ' id="' + oOptions.sId + '"': '') + '>' + oOptions.sText + '</span></a>');
59
60	oButtonStripList.appendChild(oNewButton);
61}
62
63// Adds hover events to list items. Used for a versions of IE that don't support this by default.
64var smf_addListItemHoverEvents = function()
65{
66	var cssRule, newSelector;
67
68	// Add a rule for the list item hover event to every stylesheet.
69	for (var iStyleSheet = 0; iStyleSheet < document.styleSheets.length; iStyleSheet ++)
70		for (var iRule = 0; iRule < document.styleSheets[iStyleSheet].rules.length; iRule ++)
71		{
72			oCssRule = document.styleSheets[iStyleSheet].rules[iRule];
73			if (oCssRule.selectorText.indexOf('LI:hover') != -1)
74			{
75				sNewSelector = oCssRule.selectorText.replace(/LI:hover/gi, 'LI.iehover');
76				document.styleSheets[iStyleSheet].addRule(sNewSelector, oCssRule.style.cssText);
77			}
78		}
79
80	// Now add handling for these hover events.
81	var oListItems = document.getElementsByTagName('LI');
82	for (oListItem in oListItems)
83	{
84		oListItems[oListItem].onmouseover = function() {
85			this.className += ' iehover';
86		};
87
88		oListItems[oListItem].onmouseout = function() {
89			this.className = this.className.replace(new RegExp(' iehover\\b'), '');
90		};
91	}
92}
93
94// Add hover events to list items if the browser requires it.
95if (is_ie7down && 'attachEvent' in window)
96	window.attachEvent('onload', smf_addListItemHoverEvents);
97
98$(document).ready(function(){
99	$("input[type=button],.button_submit").attr("class", "btn btn-sm btn-primary");
100	$("img[alt=\'"+txtnew+"'], img.new_posts").replaceWith("<span class=\'btn btn-primary btn-xs\'> "+txtnew+"</span>");
101	$("#profile_success").removeAttr("id").removeClass("windowbg").addClass("alert alert-success");
102	$("#profile_error").removeAttr("id").removeClass("windowbg").addClass("alert alert-danger");
103	if ($(window).width() >= 767)
104		$('[data-toggle="dropdown"]').bootstrapDropdownHover();
105	if ($('#gobacktotop').length) {
106	    var scrollTrigger = 100, // px
107	        backToTop = function () {
108	            var scrollTop = $(window).scrollTop();
109	            if (scrollTop > scrollTrigger) {
110	                $('#back-to-top').addClass('show');
111	            } else {
112	                $('#back-to-top').removeClass('show');
113	            }
114	        };
115	    backToTop();
116	    $(window).on('scroll', function () {
117	        backToTop();
118	    });
119	    $('#back-to-top').on('click', function (e) {
120	        e.preventDefault();
121	        $('html,body').animate({
122	            scrollTop: 0
123	        }, 700);
124	    });
125	}
126});

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.