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