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