aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/datepicker/core.js
diff options
context:
space:
mode:
authorMichał Gołębiowski-Owczarek <m.goleb@gmail.com>2020-01-22 16:44:34 +0100
committerGitHub <noreply@github.com>2020-01-22 16:44:34 +0100
commit0c860b0d92f9959f6747f8c02e9671eb2fc561aa (patch)
treeeec1af4f3a9eead707e2674593bda620b5f7c9cb /tests/unit/datepicker/core.js
parent3481f50bfcf02865857d390a1caa511003a40c13 (diff)
downloadjquery-ui-0c860b0d92f9959f6747f8c02e9671eb2fc561aa.tar.gz
jquery-ui-0c860b0d92f9959f6747f8c02e9671eb2fc561aa.zip
All: Remove usage of jQuery positional selectors
jQuery positional selectors () have been deprecated in [jQuery 3.4.0](https://blog.jquery.com/2019/04/10/jquery-3-4-0-released/) and they'll be removed in jQuery 4.0.0. This PR removes their usage. Most of the changes were possible without changing public API. However, dropping `:even` usage required a change to the [`header` option](https://api.jqueryui.com/accordion/#option-header) of the accordion widget. I made it an optional function; this will need to be documented. The polyfill for `.even()` & `.odd()` is added for jQuery <3.5.0. There was no usage of the :odd selector in the code but the `.odd()` method is also polyfilled for completeness. Closes gh-1904
Diffstat (limited to 'tests/unit/datepicker/core.js')
-rw-r--r--tests/unit/datepicker/core.js98
1 files changed, 49 insertions, 49 deletions
diff --git a/tests/unit/datepicker/core.js b/tests/unit/datepicker/core.js
index 943a188b8..2cc89cd21 100644
--- a/tests/unit/datepicker/core.js
+++ b/tests/unit/datepicker/core.js
@@ -51,33 +51,33 @@ QUnit.test( "baseStructure", function( assert ) {
assert.ok( !dp.is( ".ui-datepicker-multi" ), "Structure - not multi-month" );
assert.equal( dp.children().length, 2, "Structure - child count" );
- header = dp.children( ":first" );
+ header = dp.children().first();
assert.ok( header.is( "div.ui-datepicker-header" ), "Structure - header division" );
assert.equal( header.children().length, 3, "Structure - header child count" );
- assert.ok( header.children( ":first" ).is( "a.ui-datepicker-prev" ) && header.children( ":first" ).html() !== "", "Structure - prev link" );
- assert.ok( header.children( ":eq(1)" ).is( "a.ui-datepicker-next" ) && header.children( ":eq(1)" ).html() !== "", "Structure - next link" );
+ assert.ok( header.children().first().is( "a.ui-datepicker-prev" ) && header.children().first().html() !== "", "Structure - prev link" );
+ assert.ok( header.children().eq( 1 ).is( "a.ui-datepicker-next" ) && header.children().eq ( 1 ).html() !== "", "Structure - next link" );
- title = header.children( ":last" );
+ title = header.children().last();
assert.ok( title.is( "div.ui-datepicker-title" ) && title.html() !== "", "Structure - title division" );
assert.equal( title.children().length, 2, "Structure - title child count" );
- assert.ok( title.children( ":first" ).is( "span.ui-datepicker-month" ) && title.children( ":first" ).text() !== "", "Structure - month text" );
- assert.ok( title.children( ":last" ).is( "span.ui-datepicker-year" ) && title.children( ":last" ).text() !== "", "Structure - year text" );
+ assert.ok( title.children().first().is( "span.ui-datepicker-month" ) && title.children().first().text() !== "", "Structure - month text" );
+ assert.ok( title.children().last().is( "span.ui-datepicker-year" ) && title.children().last().text() !== "", "Structure - year text" );
- table = dp.children( ":eq(1)" );
+ table = dp.children().eq( 1 );
assert.ok( table.is( "table.ui-datepicker-calendar" ), "Structure - month table" );
- assert.ok( table.children( ":first" ).is( "thead" ), "Structure - month table thead" );
+ assert.ok( table.children().first().is( "thead" ), "Structure - month table thead" );
- thead = table.children( ":first" ).children( ":first" );
+ thead = table.children().first().children().first();
assert.ok( thead.is( "tr" ), "Structure - month table title row" );
assert.equal( thead.find( "th" ).length, 7, "Structure - month table title cells" );
- assert.ok( table.children( ":eq(1)" ).is( "tbody" ), "Structure - month table body" );
- assert.ok( table.children( ":eq(1)" ).children( "tr" ).length >= 4, "Structure - month table week count" );
+ assert.ok( table.children().eq( 1 ).is( "tbody" ), "Structure - month table body" );
+ assert.ok( table.children().eq( 1 ).children( "tr" ).length >= 4, "Structure - month table week count" );
- week = table.children( ":eq(1)" ).children( ":first" );
+ week = table.children().eq( 1 ).children().first();
assert.ok( week.is( "tr" ), "Structure - month table week row" );
assert.equal( week.children().length, 7, "Structure - week child count" );
- assert.ok( week.children( ":first" ).is( "td.ui-datepicker-week-end" ), "Structure - month table first day cell" );
- assert.ok( week.children( ":last" ).is( "td.ui-datepicker-week-end" ), "Structure - month table second day cell" );
+ assert.ok( week.children().first().is( "td.ui-datepicker-week-end" ), "Structure - month table first day cell" );
+ assert.ok( week.children().last().is( "td.ui-datepicker-week-end" ), "Structure - month table second day cell" );
inp.datepicker( "hide" ).datepicker( "destroy" );
step2();
@@ -94,14 +94,14 @@ QUnit.test( "baseStructure", function( assert ) {
} );
testHelper.onFocus( inp, function() {
title = dp.find( "div.ui-datepicker-title" );
- assert.ok( title.children( ":first" ).is( "select.ui-datepicker-month" ), "Structure - month selector" );
- assert.ok( title.children( ":last" ).is( "select.ui-datepicker-year" ), "Structure - year selector" );
+ assert.ok( title.children().first().is( "select.ui-datepicker-month" ), "Structure - month selector" );
+ assert.ok( title.children().last().is( "select.ui-datepicker-year" ), "Structure - year selector" );
- panel = dp.children( ":last" );
+ panel = dp.children().last();
assert.ok( panel.is( "div.ui-datepicker-buttonpane" ), "Structure - button panel division" );
assert.equal( panel.children().length, 2, "Structure - button panel child count" );
- assert.ok( panel.children( ":first" ).is( "button.ui-datepicker-current" ), "Structure - today button" );
- assert.ok( panel.children( ":last" ).is( "button.ui-datepicker-close" ), "Structure - close button" );
+ assert.ok( panel.children().first().is( "button.ui-datepicker-current" ), "Structure - today button" );
+ assert.ok( panel.children().last().is( "button.ui-datepicker-close" ), "Structure - close button" );
inp.datepicker( "hide" ).datepicker( "destroy" );
step3();
@@ -116,13 +116,13 @@ QUnit.test( "baseStructure", function( assert ) {
assert.ok( dp.is( ".ui-datepicker-multi" ), "Structure multi [2] - multi-month" );
assert.equal( dp.children().length, 3, "Structure multi [2] - child count" );
- child = dp.children( ":first" );
+ child = dp.children().first();
assert.ok( child.is( "div.ui-datepicker-group" ) && child.is( "div.ui-datepicker-group-first" ), "Structure multi [2] - first month division" );
- child = dp.children( ":eq(1)" );
+ child = dp.children().eq( 1 );
assert.ok( child.is( "div.ui-datepicker-group" ) && child.is( "div.ui-datepicker-group-last" ), "Structure multi [2] - second month division" );
- child = dp.children( ":eq(2)" );
+ child = dp.children().eq( 2 );
assert.ok( child.is( "div.ui-datepicker-row-break" ), "Structure multi [2] - row break" );
assert.ok( dp.is( ".ui-datepicker-multi-2" ), "Structure multi [2] - multi-2" );
@@ -152,22 +152,22 @@ QUnit.test( "baseStructure", function( assert ) {
assert.ok( dp.is( ".ui-datepicker-multi" ), "Structure multi - multi-month" );
assert.equal( dp.children().length, 6, "Structure multi [2,2] - child count" );
- child = dp.children( ":first" );
+ child = dp.children().first();
assert.ok( child.is( "div.ui-datepicker-group" ) && child.is( "div.ui-datepicker-group-first" ), "Structure multi [2,2] - first month division" );
- child = dp.children( ":eq(1)" );
+ child = dp.children().eq( 1 );
assert.ok( child.is( "div.ui-datepicker-group" ) && child.is( "div.ui-datepicker-group-last" ), "Structure multi [2,2] - second month division" );
- child = dp.children( ":eq(2)" );
+ child = dp.children().eq( 2 );
assert.ok( child.is( "div.ui-datepicker-row-break" ), "Structure multi [2,2] - row break" );
- child = dp.children( ":eq(3)" );
+ child = dp.children().eq( 3 );
assert.ok( child.is( "div.ui-datepicker-group" ) && child.is( "div.ui-datepicker-group-first" ), "Structure multi [2,2] - third month division" );
- child = dp.children( ":eq(4)" );
+ child = dp.children().eq( 4 );
assert.ok( child.is( "div.ui-datepicker-group" ) && child.is( "div.ui-datepicker-group-last" ), "Structure multi [2,2] - fourth month division" );
- child = dp.children( ":eq(5)" );
+ child = dp.children().eq( 5 );
assert.ok( child.is( "div.ui-datepicker-row-break" ), "Structure multi [2,2] - row break" );
inp.datepicker( "hide" ).datepicker( "destroy" );
@@ -181,14 +181,14 @@ QUnit.test( "baseStructure", function( assert ) {
assert.ok( !dp.is( ".ui-datepicker-multi" ), "Structure inline - not multi-month" );
assert.equal( dp.children().length, 2, "Structure inline - child count" );
- header = dp.children( ":first" );
+ header = dp.children().first();
assert.ok( header.is( "div.ui-datepicker-header" ), "Structure inline - header division" );
assert.equal( header.children().length, 3, "Structure inline - header child count" );
- table = dp.children( ":eq(1)" );
+ table = dp.children().eq( 1 );
assert.ok( table.is( "table.ui-datepicker-calendar" ), "Structure inline - month table" );
- assert.ok( table.children( ":first" ).is( "thead" ), "Structure inline - month table thead" );
- assert.ok( table.children( ":eq(1)" ).is( "tbody" ), "Structure inline - month table body" );
+ assert.ok( table.children().first().is( "thead" ), "Structure inline - month table thead" );
+ assert.ok( table.children().eq( 1 ).is( "tbody" ), "Structure inline - month table body" );
inl.datepicker( "destroy" );
@@ -199,13 +199,13 @@ QUnit.test( "baseStructure", function( assert ) {
assert.ok( dp.is( ".ui-datepicker-inline" ) && dp.is( ".ui-datepicker-multi" ), "Structure inline multi - main div" );
assert.equal( dp.children().length, 3, "Structure inline multi - child count" );
- child = dp.children( ":first" );
+ child = dp.children().first();
assert.ok( child.is( "div.ui-datepicker-group" ) && child.is( "div.ui-datepicker-group-first" ), "Structure inline multi - first month division" );
- child = dp.children( ":eq(1)" );
+ child = dp.children().eq( 1 );
assert.ok( child.is( "div.ui-datepicker-group" ) && child.is( "div.ui-datepicker-group-last" ), "Structure inline multi - second month division" );
- child = dp.children( ":eq(2)" );
+ child = dp.children().eq( 2 );
assert.ok( child.is( "div.ui-datepicker-row-break" ), "Structure inline multi - row break" );
inl.datepicker( "destroy" );
@@ -229,17 +229,17 @@ QUnit.test( "customStructure", function( assert ) {
testHelper.onFocus( inp, function() {
assert.ok( dp.is( ".ui-datepicker-rtl" ), "Structure RTL - right-to-left" );
- header = dp.children( ":first" );
+ header = dp.children().first();
assert.ok( header.is( "div.ui-datepicker-header" ), "Structure RTL - header division" );
assert.equal( header.children().length, 3, "Structure RTL - header child count" );
- assert.ok( header.children( ":first" ).is( "a.ui-datepicker-next" ), "Structure RTL - prev link" );
- assert.ok( header.children( ":eq(1)" ).is( "a.ui-datepicker-prev" ), "Structure RTL - next link" );
+ assert.ok( header.children().first().is( "a.ui-datepicker-next" ), "Structure RTL - prev link" );
+ assert.ok( header.children().eq( 1 ).is( "a.ui-datepicker-prev" ), "Structure RTL - next link" );
- panel = dp.children( ":last" );
+ panel = dp.children().last();
assert.ok( panel.is( "div.ui-datepicker-buttonpane" ), "Structure RTL - button division" );
assert.equal( panel.children().length, 2, "Structure RTL - button panel child count" );
- assert.ok( panel.children( ":first" ).is( "button.ui-datepicker-close" ), "Structure RTL - close button" );
- assert.ok( panel.children( ":last" ).is( "button.ui-datepicker-current" ), "Structure RTL - today button" );
+ assert.ok( panel.children().first().is( "button.ui-datepicker-close" ), "Structure RTL - close button" );
+ assert.ok( panel.children().last().is( "button.ui-datepicker-current" ), "Structure RTL - today button" );
inp.datepicker( "hide" ).datepicker( "destroy" );
step2();
@@ -256,10 +256,10 @@ QUnit.test( "customStructure", function( assert ) {
inp.val( "02/10/2008" );
testHelper.onFocus( inp, function() {
- header = dp.children( ":first" );
+ header = dp.children().first();
assert.ok( header.is( "div.ui-datepicker-header" ), "Structure hide prev/next - header division" );
assert.equal( header.children().length, 1, "Structure hide prev/next - links child count" );
- assert.ok( header.children( ":first" ).is( "div.ui-datepicker-title" ), "Structure hide prev/next - title division" );
+ assert.ok( header.children().first().is( "div.ui-datepicker-title" ), "Structure hide prev/next - title division" );
inp.datepicker( "hide" ).datepicker( "destroy" );
step3();
@@ -271,10 +271,10 @@ QUnit.test( "customStructure", function( assert ) {
inp = testHelper.initNewInput( { changeMonth: true } );
testHelper.onFocus( inp, function() {
- title = dp.children( ":first" ).children( ":last" );
+ title = dp.children().first().children().last();
assert.equal( title.children().length, 2, "Structure changeable month - title child count" );
- assert.ok( title.children( ":first" ).is( "select.ui-datepicker-month" ), "Structure changeable month - month selector" );
- assert.ok( title.children( ":last" ).is( "span.ui-datepicker-year" ), "Structure changeable month - read-only year" );
+ assert.ok( title.children().first().is( "select.ui-datepicker-month" ), "Structure changeable month - month selector" );
+ assert.ok( title.children().last().is( "span.ui-datepicker-year" ), "Structure changeable month - read-only year" );
inp.datepicker( "hide" ).datepicker( "destroy" );
step4();
@@ -286,10 +286,10 @@ QUnit.test( "customStructure", function( assert ) {
inp = testHelper.initNewInput( { changeYear: true } );
testHelper.onFocus( inp, function() {
- title = dp.children( ":first" ).children( ":last" );
+ title = dp.children().first().children().last();
assert.equal( title.children().length, 2, "Structure changeable year - title child count" );
- assert.ok( title.children( ":first" ).is( "span.ui-datepicker-month" ), "Structure changeable year - read-only month" );
- assert.ok( title.children( ":last" ).is( "select.ui-datepicker-year" ), "Structure changeable year - year selector" );
+ assert.ok( title.children().first().is( "span.ui-datepicker-month" ), "Structure changeable year - read-only month" );
+ assert.ok( title.children().last().is( "select.ui-datepicker-year" ), "Structure changeable year - year selector" );
inp.datepicker( "hide" ).datepicker( "destroy" );
step5();
/stable28 Nextcloud server, a safe home for all your data: https://github.com/nextcloud/serverwww-data
aboutsummaryrefslogtreecommitdiffstats
path: root/apps/settings/l10n/lt_LT.json
blob: 773ff08b4d6b2da5cf0206c45f5e4cb9fb0ea721 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436