PageSourceSearch

https://www.anoh.net/comm/js/jquery.format.js

js anoh.net collected 2026-10-07 05:50:13 UTC 2,838 bytes, 145 lines download raw bytes

1(function($){
2
3	$.fn.alphanumeric = function(p) { 
4
5		p = $.extend({
6			ichars: "!@#$%^&*()+=[]\\\';,/{}|\":<>?~`.- ",
7			nchars: "",
8			allow: ""
9		  }, p);	
10
11		return this.each
12			(
13				function() 
14				{
15
16					if (p.nocaps) p.nchars += "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
17					if (p.allcaps) p.nchars += "abcdefghijklmnopqrstuvwxyz";
18					
19					s = p.allow.split('');
20					for ( i=0;i<s.length;i++) if (p.ichars.indexOf(s[i]) != -1) s[i] = "\\" + s[i];
21					p.allow = s.join('|');
22					
23					var reg = new RegExp(p.allow,'gi');
24					var ch = p.ichars + p.nchars;
25					ch = ch.replace(reg,'');
26
27					$(this).keypress
28						(
29							function (e)
30								{
31								
32									if (!e.charCode) k = String.fromCharCode(e.which);
33										else k = String.fromCharCode(e.charCode);
34										
35									if (ch.indexOf(k) != -1) e.preventDefault();
36									if (e.ctrlKey&&k=='v') e.preventDefault();
37									
38								}
39								
40						);
41						
42					$(this).bind('contextmenu',function () {return false});
43									
44				}
45			);
46
47	};
48
49	$.fn.alphanumeric2 = function(p) { 
50
51		p = $.extend({
52			ichars: "!@#$%^&*()+=[]\\\';,/{}|\":<>?~`. ",
53			nchars: "",
54			allow: ""
55		  }, p);	
56
57		return this.each
58			(
59				function() 
60				{
61
62					if (p.nocaps) p.nchars += "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
63					if (p.allcaps) p.nchars += "abcdefghijklmnopqrstuvwxyz";
64					
65					s = p.allow.split('');
66					for ( i=0;i<s.length;i++) if (p.ichars.indexOf(s[i]) != -1) s[i] = "\\" + s[i];
67					p.allow = s.join('|');
68					
69					var reg = new RegExp(p.allow,'gi');
70					var ch = p.ichars + p.nchars;
71					ch = ch.replace(reg,'');
72
73					$(this).keypress
74						(
75							function (e)
76								{
77								
78									if (!e.charCode) k = String.fromCharCode(e.which);
79										else k = String.fromCharCode(e.charCode);
80										
81									if (ch.indexOf(k) != -1) e.preventDefault();
82									if (e.ctrlKey&&k=='v') e.preventDefault();
83									
84								}
85								
86						);
87						
88					$(this).bind('contextmenu',function () {return false});
89									
90				}
91			);
92
93	};
94
95	$.fn.numeric = function(p) {
96	
97		var az = "abcdefghijklmnopqrstuvwxyz";
98		az += az.toUpperCase();
99
100		p = $.extend({
101			nchars: az
102		  }, p);	
103		  	
104		return this.each (function()
105			{
106				$(this).alphanumeric(p);
107			}
108		);
109			
110	};
111	
112	$.fn.numeric2 = function(p) {
113	
114		var az = "abcdefghijklmnopqrstuvwxyz";
115		az += az.toUpperCase();
116
117		p = $.extend({
118			nchars: az
119		  }, p);	
120		  	
121		return this.each (function()
122			{
123				$(this).alphanumeric2(p);
124			}
125		);
126			
127	};
128	
129	$.fn.alpha = function(p) {
130
131		var nm = "1234567890";
132
133		p = $.extend({
134			nchars: nm
135		  }, p);	
136
137		return this.each (function()
138			{
139				$(this).alphanumeric(p);
140			}
141		);
142			
143	};	
144
145})(jQuery);

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.