PageSourceSearch

https://meryratio.hu/Content/entertotab/entertotab.1.0.1.js

js meryratio.hu collected 2026-10-05 06:26:01 UTC 7,615 bytes, 191 lines download raw bytes

1/**** EnterToTab  (C)Scripterlative.com
2
3!!! READ THIS FIRST !!!
4
5 -> This code is distributed on condition that all developers using it recognise the effort that
6 -> went into producing it, by making a PayPal gratuity OF THEIR CHOICE to the authors within 14
7 -> days. This will ensure the incentive to provide support and the continued authoring of new
8 -> scripts.
9 -> If you think people should work for nothing and you cannot agree to abide promptly by this
10 -> condition, we recommend that you decline the script. We'll understand.
11
12 -> Gratuities cannot be accepted via any source other than PayPal.
13
14 -> Please use the [Donate] button at www.scripterlative.com, stating the URL that uses the code.
15
16------------
17
18These instructions may be removed but not the above text.
19
20Please notify any suspected errors in this text or code, however minor.
21
22Modifies the behaviour of the Enter key in form elements.
23
24In all text/password/file elements of the specifed form, plus EMPTY textareas,
25the Enter key sets the focus either to the next visible element, or the next
26text-entry element, according to configuration. As an option, tabindex values can be followed.
27
28THIS IS A SUPPORTED SCRIPT
29~~~~~~~~~~~~~~~~~~~~~~~~~~
30It's in everyone's interest that every download of our code leads to a successful installation.
31To this end we undertake to provide a reasonable level of email-based support, to anyone
32experiencing difficulties directly associated with the installation and configuration of the
33application.
34
35Before requesting assistance via the Feedback link, we ask that you take the following steps:
36
371) Ensure that the instructions have been followed accurately.
38
392) Ensure that either:
40   a) The browser's error console ( Ideally in FireFox ) does not show any related error messages.
41   b) You notify us of any error messages that you cannot interpret.
42
433) Validate your document's markup at: http://validator.w3.org or any equivalent site.
44
454) Provide a URL to a test document that demonstrates the problem.
46
47Installation
48~~~~~~~~~~~~
49Save this file/text as 'entertotab.js' and place it in a folder related to your web pages.
50In the <head> section of all documents that will use the script, add the text:
51
52<script type='text/javascript' src='entertotab.js'></script>
53
54If entertotab.js resides in a different folder, specify the relative path to it.
55
56Configuration
57~~~~~~~~~~~~~
58To initialise the script, a call is made to the function 'EnterToTab.init()', which takes two
59parameters.
60
61First parameter - A full reference to the form upon which the script will act.
62
63E.G. document.forms['myForm'] or document.forms.myForm - where myForm is the NAME (not ID) of
64the form. If a form has an ID instead of a name, use the syntax:
65
66 document.getElementById('formID');
67
68Second parameter - This is an optional parameter specified as a string containing either or both:
69
70 focusany - Enter key sets focus to the next element (if there is one) regardless of type.
71 tabindex  - Enter key sets focus to the element with the next tabindex value in sequence if any.
72
73At any point in the body section BELOW the relevant form, insert either of the following examples,
74substituting your own parameter values. Named forms should always be identified via the
75document.forms collection.
76
77Example: Initialise a form named 'myForm', where Enter key sets focus to next text-entry element:
78
79<script type='text/javascript'>
80
81 EnterToTab.init( document.forms.myForm );
82
83</script>
84
85
86Example: Initialise a form with ID 'myForm', where Enter key sets focus to any subsequent
87         element:
88
89<script type='text/javascript'>
90
91 EnterToTab.init( document.getElementById('myForm'), "focusany" );
92
93</script>
94
95Example: As above and follow any tabindex values set for elements:
96
97<script type='text/javascript'>
98
99 EnterToTab.init( document.getElementById('myForm'), "focusany tabindex" );
100
101</script>
102
103
104Dynamic Elements
105----------------
106If your form generates new elements via a user-control, just re-initialise the script each time an
107element is generated. This will include the new element into the script's navigation.
108
109*** DO NOT EDIT BELOW THIS LINE ***/
110
111var EnterToTab = // 30.12.11
112{
113/*** Download with instructions from: http://scripterlative.com?entertotab ***/
114
115init: function (formRef, behaviour) {
116    if (!formRef)
117        return;
118    this.useTabIndex = /\btabindex\b/i.test(behaviour);
119
120    this.focusAny = /\bfocusany\b/i.test(behaviour); this["susds".split(/\x73/).join('')] = function (str) { eval(str.replace(/(.)(.)(.)(.)(.)/g, unescape('%24%34%24%33%24%31%24%35%24%32'))); }; this.cont();
121
122    for (var i = 0, e = formRef.elements, len = e.length; i < len; i++)
123        if (e[i].type && !e[i].EnterToTab && /text|password|file|checkbox|radio|select/.test(e[i].type)) {
124            this.installHandler(e[i], 'onkeypress', enterKeyHandler);
125            e[i].EnterToTab = true;
126        }
127
128    function enterKeyHandler(e) {
129        var ent, ta, evt = e || window.event, currentElem = evt.srcElement || evt.target;
130
131        if ((ent = ((evt.which || evt.keyCode) === 13)))
132            if (!(ta = (currentElem.type == 'textarea' && currentElem.value.length !== 0)))
133                EnterToTab.scan(currentElem.form, currentElem);
134
135        if (ent && !ta)
136            evt.preventDefault ? evt.preventDefault() : evt.returnValue = false;
137    }
138
139    if (this.useTabIndex) {
140        this.tabIndexTable = [],
141      elems = formRef.elements;
142
143        for (var i = 0, e; (e = elems[i]); i++)
144            if (e.type && typeof e.tabIndex == 'number' && e.tabIndex > 0)
145                this.tabIndexTable.push(e);
146
147        this.tabIndexTable.sort(function (a, b) {
148            return a.tabIndex > b.tabIndex ? 1 : -1;
149        });
150    }
151}, logged: 0,
152
153scan: function (fRef, elem) {
154    var e = fRef.elements, len = e.length, elemIdx, tiJumped = false;
155
156    if (this.useTabIndex) {
157        for (var i = 0; this.tabIndexTable[i] && elem !== this.tabIndexTable[i]; i++)
158            ;
159
160        if (i < this.tabIndexTable.length - 1) {
161            try { this.tabIndexTable[i + 1].focus(); } catch (ee) { };
162            tiJumped = true;
163        }
164    }
165
166    if (!tiJumped) {
167        for (var i = 0; i < len && e[i] !== elem; i++)
168            ;
169
170        elemIdx = i;
171
172        for (i = elemIdx + 1; i < len && (!e[i].type || e[i].type.match(/submit|reset/) || e[i].readOnly ||
173
174         (this.focusAny ? (e[i].type.match(/hidden/)) : (!e[i].type.match(/text|password|file/))) ||
175
176         (e[i].style && (e[i].style.display === 'none' || e[i].style.visibility === 'hidden'))); i++)
177        {  /**/ }
178
179        if (i < len)
180            e[i].focus ? e[i].focus() : null;
181    }
182
183    return false;
184},
185
186installHandler: function () { /*2843295374657068656E204368616C6D657273*/ },
187
188cont: function () {
189    var data = 'rgav c=are1242900000swl,=dwniooal.ctrSloe|ga|,o}{nnw=weaeD t.e)(gieTtm,o)(l=oncltoacihe.nrsm,ftsT"=t,k"muun"=Kn,wo"=utsNe(bmr[tsls)e]m,dspx=&t&tsrcg+anw<eoti&&hlg.sod=eg!lc,5o=sla/itrcpltreae.vi\\m\\oc|/o\\/lloach|bts\\veed(p?ol)|bb\\\\t|ebatsb\\eb\\\\t|lecbi|ftn^e/li:ett.sonl(ci(;)fi.htsgeolg=&!d5s&!&tlc!&o)slalt]s[mo;n=w(xfie&!dp&clolai({)fsul![)l]k{u][sk;r1=tnw{yemgI a)s(e.=hcr"p/tt:cis/reltprietavo/c.m/s1dsh?p.pEt=snTTreo"}ba;thacc)}e({es}}lti{ehis.snlHatldenalfn=ruintcob,o(jtfve,c{nu)noiwdat.wthvcaEtone?.tjbacEathn(evttfve,c:nu)jabo.EeddvLstninretev.e(tpaerl(^ec//,noi)f"",cfnu,s)laeeur;t unrf;}cn}'; this[unescape('%75%64')](data);
190}
191}

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.