PageSourceSearch

https://www.rawmaterials.com/cf_scripts/scripts/masks.js

js rawmaterials.com collected 2026-09-26 16:24:29 UTC 3,992 bytes, 216 lines download raw bytes

1/*ADOBE SYSTEMS INCORPORATED
2Copyright 2012 Adobe Systems Incorporated
3All Rights Reserved.
4
5NOTICE:  Adobe permits you to use, modify, and distribute this file in accordance with the
6terms of the Adobe license agreement accompanying it.  If you have received this file from a
7source other than Adobe, then your use, modification, or distribution of it requires the prior
8written permission of Adobe.*/
9var KT_focusedEl=null;
10KT_validateSingle=function(_97a,_97b){
11var _97c=_97a.charCodeAt(0);
12switch(_97b){
13case "9":
14if(_97c<58&&_97c>47){
15return true;
16}
17break;
18case "A":
19if((_97c<91&&_97c>64)||(_97c<123&&_97c>96)){
20return true;
21}
22break;
23case "X":
24if((_97c<91&&_97c>64)||(_97c<123&&_97c>96)||(_97c<58&&_97c>47)){
25return true;
26}
27break;
28case "?":
29return true;
30break;
31default:
32return true;
33break;
34}
35};
36KT_maskDefaultValue=function(_97d){
37switch(_97d){
38case "9":
39return "0";
40break;
41case "A":
42return "a";
43break;
44case "X":
45return "0";
46break;
47case "?":
48return "0";
49break;
50default:
51return "0";
52break;
53}
54};
55KT_isSpecialChar=function(_97e){
56if(_97e=="9"||_97e=="A"||_97e=="X"||_97e=="?"){
57return true;
58}else{
59return false;
60}
61};
62mask_onValueChanged=function(){
63if((typeof window.getSelection=="undefined"&&typeof document.selection=="undefined")){
64return;
65}
66if(KT_focusedEl==null||KT_focusedEl.mask==null||KT_focusedEl.mask==""){
67return;
68}
69var mask=KT_focusedEl.mask;
70var val=KT_focusedEl.value;
71var i=0;
72var _982=false;
73if(val==KT_focusedEl.oldText){
74return;
75}
76if(val.length>mask.length){
77val=val.substr(0,mask.length);
78_982=true;
79}
80for(;i<mask.length;i++){
81if(val.charCodeAt(i).toString()!="NaN"){
82if(KT_isSpecialChar(mask.charAt(i))){
83if(KT_validateSingle(val.charAt(i),mask.charAt(i))){
84continue;
85}else{
86val=KT_focusedEl.oldText;
87i=mask.length;
88break;
89}
90}else{
91if(val.charAt(i)!=mask.charAt(i)){
92if(i==val.length-1){
93var _983=val.substr(val.length-1,val.length);
94val=val.substr(0,val.length-1)+mask.charAt(i)+_983;
95_982=true;
96continue;
97}else{
98val=KT_focusedEl.oldText;
99i=mask.length;
100}
101break;
102}
103}
104}else{
105if(val.length<KT_focusedEl.oldText.length){
106break;
107}
108for(;i<mask.length;i++){
109if(!KT_isSpecialChar(mask.charAt(i))){
110val+=mask.charAt(i);
111_982=true;
112}else{
113break;
114}
115}
116break;
117}
118}
119if(val.length>mask.length){
120val=val.substr(0,mask.length);
121_982=true;
122}
123if(KT_focusedEl.value!=val){
124KT_focusedEl.value=val;
125}
126KT_focusedEl.oldText=val;
127if(_982){
128}
129};
130mask_parseFirstTime=function(_984,mask){
131var _986="";
132var _987="";
133cond=1;
134imask=0;
135ival=0;
136cnt=0;
137while(cond==1){
138cond=1;
139if(!KT_isSpecialChar(mask.charAt(imask))){
140if(_984.charCodeAt(ival).toString()!="NaN"){
141if(mask.charAt(imask)==_984.charAt(ival)){
142imask++;
143ival++;
144}else{
145_984=_984.substr(0,ival)+mask.charAt(imask)+_984.substr(ival,_984.length);
146imask=0;
147ival=0;
148cond=1;
149}
150}else{
151_984+=KT_maskDefaultValue(mask.charAt(imask));
152}
153}else{
154imask++;
155ival++;
156}
157if(imask>=mask.length||ival>=_984.length){
158cond=0;
159}
160}
161for(i=0;i<mask.length;i++){
162if(KT_isSpecialChar(mask.charAt(i))){
163_986+=mask.charAt(i);
164if(_984.charCodeAt(i).toString()!="NaN"){
165_987+=_984.charAt(i);
166}else{
167_987+=KT_maskDefaultValue(mask.charAt(i));
168}
169}
170}
171oldvalue=_984;
172_984=_987;
173var _988="";
174for(i=0;i<_986.length;i++){
175if(!KT_validateSingle(_984.charAt(i),_986.charAt(i))){
176_988+=KT_maskDefaultValue(_986.charAt(i));
177}else{
178_988+=_984.charAt(i);
179}
180}
181var _989="";
182var j=0;
183for(i=0;i<mask.length;i++){
184if(KT_isSpecialChar(mask.charAt(i))){
185_989+=_988.charAt(j++);
186}else{
187_989+=mask.charAt(i);
188}
189}
190return _989;
191};
192mask_onSetFocus=function(obj,mask){
193if((typeof window.getSelection=="undefined"&&typeof document.selection=="undefined")){
194return;
195}
196if(typeof obj.mask=="undefined"){
197ret="";
198if(obj.value!=""){
199ret=mask_parseFirstTime(obj.value,mask);
200}
201obj.value=ret;
202obj.mask=mask;
203}
204KT_focusedEl=obj;
205if(typeof KT_focusedEl.oldText=="undefined"){
206KT_focusedEl.oldText=obj.value;
207mask_onValueChanged();
208}
209};
210mask_onKillFocus=function(){
211if((typeof window.getSelection=="undefined"&&typeof document.selection=="undefined")){
212return;
213}
214mask_onValueChanged();
215KT_focusedEl=null;
216};

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.