PageSourceSearch

https://haktuts.github.io/js/main.js

js haktuts.github.io collected 2026-10-03 09:16:19 UTC 2,074 bytes, 67 lines download raw bytes

1
2function wb_form_validateForm(formId, values, errors) {
3	var form = $("input[name='wb_form_id'][value='" + formId + "']").parent();
4	if (!form || form.length === 0 || !errors) return;
5	
6	form.find("input[name],textarea[name]").css({backgroundColor: ""});
7	
8	if (errors.required) {
9		for (var i = 0; i < errors.required.length; i++) {
10			var name = errors.required[i];
11			var elem = form.find("input[name='" + name + "'],textarea[name='" + name + "'],select[name='" + name + "']");
12			elem.css({backgroundColor: "#ff8c8c"});
13		}
14	}
15	
16	if (errors.length) {
17		for (var k in values) {
18			var elem = form.find("input[name='" + k + "'],textarea[name='" + k + "'],select[name='" + k + "']");
19			elem.val(values[k]);
20		}
21	}
22}
23
24$(function() {
25	var comboBoxes = $('.wb-combobox-controll');
26	if (comboBoxes.length) {
27		comboBoxes.each(function() {
28			var thisCombo = $(this);
29			var clickFunc = function() {
30				var w = thisCombo.find('input').outerWidth();
31				var mw = (menu = thisCombo.find('.dropdown-menu')).width();
32				var ew = thisCombo.parent().outerWidth();
33				if (mw < ew) menu.width(ew);
34				menu.css({ marginLeft: (-w) + 'px' });
35				thisCombo.find('.btn-group').toggleClass('open');
36			};
37			$(this).find('input').bind('click', clickFunc);
38			$(this).find('.dropdown-toggle').bind('click', clickFunc);
39		});
40		
41		$(document).bind('click', function(e) {
42			var t = $(e.target);
43			if (!t.is('.wb-combobox-controll')) {
44				t = t.parents('.wb-combobox-controll');
45				$.each($('.wb-combobox-controll'), function() {
46					if (t.get(0) !== $(this).get(0)) {
47						$(this).find('.btn-group').removeClass('open');
48					}
49				});
50			}
51		});
52	}
53	
54	if (currLang) {
55		$('.lang-selector').each(function() {
56			var thisElem = $(this);
57			var type = thisElem.attr('data-type');
58			if (type == 'flags') {
59				thisElem.find('a[data-lang="' + currLang + '"]').addClass('active');
60			} else if (type == 'select') {
61				var actLi = thisElem.find('li[data-lang="' + currLang + '"]');
62				actLi.addClass('active');
63				thisElem.find('input').val(actLi.find('a').html());
64			}
65		});
66	}
67});

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.