annotate DataTables-1.9.4/media/unit_testing/tests_onhold/6_delayed_rendering/oLanguage.sInfo.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.sInfo" );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
3
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
4 $(document).ready( function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
5 /* Check the default */
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
6 var oTable = $('#example').dataTable( {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
7 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
8 "bDeferRender": true
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
9 } );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
10 var oSettings = oTable.fnSettings();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
11
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
12 oTest.fnWaitTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
13 "Info language is 'Showing _START_ to _END_ of _TOTAL_ entries' by default",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
14 null,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
15 function () { return oSettings.oLanguage.sInfo == "Showing _START_ to _END_ of _TOTAL_ entries"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
16 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
17
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
18 oTest.fnTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
19 "Info language default is in the DOM",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
20 null,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
21 function () { return document.getElementById('example_info').innerHTML = "Showing 1 to 10 of 57 entries"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
22 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
23
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
24
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
25 oTest.fnWaitTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
26 "Info language can be defined - without any macros",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
27 function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
28 oSession.fnRestore();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
29 oTable = $('#example').dataTable( {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
30 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
31 "bDeferRender": true,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
32 "oLanguage": {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
33 "sInfo": "unit test"
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
34 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
35 } );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
36 oSettings = oTable.fnSettings();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
37 },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
38 function () { return oSettings.oLanguage.sInfo == "unit test"; }
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 oTest.fnTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
42 "Info language definition is in the DOM",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
43 null,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
44 function () { return document.getElementById('example_info').innerHTML = "unit test"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
45 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
46
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
47 oTest.fnWaitTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
48 "Info language can be defined - with macro _START_ only",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
49 function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
50 oSession.fnRestore();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
51 $('#example').dataTable( {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
52 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
53 "bDeferRender": true,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
54 "oLanguage": {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
55 "sInfo": "unit _START_ test"
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 function () { return document.getElementById('example_info').innerHTML = "unit 1 test"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
60 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
61
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
62 oTest.fnWaitTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
63 "Info language can be defined - with macro _END_ only",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
64 function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
65 oSession.fnRestore();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
66 $('#example').dataTable( {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
67 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
68 "bDeferRender": true,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
69 "oLanguage": {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
70 "sInfo": "unit _END_ test"
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
71 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
72 } );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
73 },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
74 function () { return document.getElementById('example_info').innerHTML = "unit 10 test"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
75 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
76
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
77 oTest.fnWaitTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
78 "Info language can be defined - with macro _TOTAL_ only",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
79 function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
80 oSession.fnRestore();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
81 $('#example').dataTable( {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
82 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
83 "bDeferRender": true,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
84 "oLanguage": {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
85 "sInfo": "unit _END_ test"
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
86 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
87 } );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
88 },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
89 function () { return document.getElementById('example_info').innerHTML = "unit 57 test"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
90 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
91
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
92 oTest.fnWaitTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
93 "Info language can be defined - with macros _START_ and _END_",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
94 function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
95 oSession.fnRestore();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
96 $('#example').dataTable( {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
97 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
98 "bDeferRender": true,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
99 "oLanguage": {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
100 "sInfo": "unit _START_ _END_ test"
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
101 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
102 } );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
103 },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
104 function () { return document.getElementById('example_info').innerHTML = "unit 1 10 test"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
105 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
106
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
107 oTest.fnWaitTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
108 "Info language can be defined - with macros _START_, _END_ and _TOTAL_",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
109 function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
110 oSession.fnRestore();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
111 $('#example').dataTable( {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
112 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
113 "bDeferRender": true,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
114 "oLanguage": {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
115 "sInfo": "unit _START_ _END_ _TOTAL_ test"
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
116 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
117 } );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
118 },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
119 function () { return document.getElementById('example_info').innerHTML = "unit 1 10 57 test"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
120 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
121
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
122
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
123 oTest.fnComplete();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
124 } );