annotate DataTables-1.9.4/media/unit_testing/tests_onhold/6_delayed_rendering/oLanguage.oPaginate.js @ 7:0f2b740536fb draft

Uploaded
author saskia-hiltemann
date Mon, 21 Aug 2017 09:16:07 -0400
parents ac5f9272033b
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
1 // DATA_TEMPLATE: empty_table
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
2 oTest.fnStart( "oLanguage.oPaginate" );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
3
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
4 /* Note that the paging language information only has relevence in full numbers */
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
5
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
6 $(document).ready( function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
7 /* Check the default */
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
8 var oTable = $('#example').dataTable( {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
9 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
10 "bDeferRender": true,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
11 "sPaginationType": "full_numbers"
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
12 } );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
13 var oSettings = oTable.fnSettings();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
14
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
15 oTest.fnWaitTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
16 "oLanguage.oPaginate defaults",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
17 null,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
18 function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
19 var bReturn =
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
20 oSettings.oLanguage.oPaginate.sFirst == "First" &&
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
21 oSettings.oLanguage.oPaginate.sPrevious == "Previous" &&
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
22 oSettings.oLanguage.oPaginate.sNext == "Next" &&
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
23 oSettings.oLanguage.oPaginate.sLast == "Last";
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
24 return bReturn;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
25 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
26 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
27
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
28 oTest.fnTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
29 "oLanguage.oPaginate defaults are in the DOM",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
30 null,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
31 function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
32 var bReturn =
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
33 $('#example_paginate .first').html() == "First" &&
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
34 $('#example_paginate .previous').html() == "Previous" &&
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
35 $('#example_paginate .next').html() == "Next" &&
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
36 $('#example_paginate .last').html() == "Last";
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
37 return bReturn;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
38 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
39 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
40
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
41
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
42 oTest.fnWaitTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
43 "oLanguage.oPaginate can be defined",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
44 function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
45 oSession.fnRestore();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
46 oTable = $('#example').dataTable( {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
47 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
48 "bDeferRender": true,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
49 "sPaginationType": "full_numbers",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
50 "oLanguage": {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
51 "oPaginate": {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
52 "sFirst": "unit1",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
53 "sPrevious": "test2",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
54 "sNext": "unit3",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
55 "sLast": "test4"
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
56 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
57 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
58 } );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
59 oSettings = oTable.fnSettings();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
60 },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
61 function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
62 var bReturn =
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
63 oSettings.oLanguage.oPaginate.sFirst == "unit1" &&
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
64 oSettings.oLanguage.oPaginate.sPrevious == "test2" &&
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
65 oSettings.oLanguage.oPaginate.sNext == "unit3" &&
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
66 oSettings.oLanguage.oPaginate.sLast == "test4";
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
67 return bReturn;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
68 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
69 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
70
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
71 oTest.fnTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
72 "oLanguage.oPaginate definitions are in the DOM",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
73 null,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
74 function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
75 var bReturn =
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
76 $('#example_paginate .first').html() == "unit1" &&
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
77 $('#example_paginate .previous').html() == "test2" &&
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
78 $('#example_paginate .next').html() == "unit3" &&
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
79 $('#example_paginate .last').html() == "test4";
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
80 return bReturn;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
81 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
82 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
83
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
84
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
85 oTest.fnComplete();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
86 } );