1 | // DATA_TEMPLATE: empty_table |
---|
2 | oTest.fnStart( "oLanguage.sInfoEmpty" ); |
---|
3 | |
---|
4 | $(document).ready( function () { |
---|
5 | /* Check the default */ |
---|
6 | var oTable = $('#example').dataTable( { |
---|
7 | "sAjaxSource": "../../../examples/examples_support/json_source.txt" |
---|
8 | } ); |
---|
9 | var oSettings = oTable.fnSettings(); |
---|
10 | |
---|
11 | oTest.fnWaitTest( |
---|
12 | "Info empty language is 'Showing 0 to 0 of 0 entries' by default", |
---|
13 | function () { oTable.fnFilter("nothinghere"); }, |
---|
14 | function () { return oSettings.oLanguage.sInfoEmpty == "Showing 0 to 0 of 0 entries"; } |
---|
15 | ); |
---|
16 | |
---|
17 | oTest.fnTest( |
---|
18 | "Info empty language default is in the DOM", |
---|
19 | null, |
---|
20 | function () { |
---|
21 | var bReturn = document.getElementById('example_info').innerHTML.replace( |
---|
22 | ' '+oSettings.oLanguage.sInfoFiltered.replace( '_MAX_', '57' ), "" ) == |
---|
23 | "Showing 0 to 0 of 0 entries"; |
---|
24 | return bReturn; |
---|
25 | } |
---|
26 | ); |
---|
27 | |
---|
28 | |
---|
29 | oTest.fnWaitTest( |
---|
30 | "Info empty language can be defined", |
---|
31 | function () { |
---|
32 | oSession.fnRestore(); |
---|
33 | oTable = $('#example').dataTable( { |
---|
34 | "sAjaxSource": "../../../examples/examples_support/json_source.txt", |
---|
35 | "oLanguage": { |
---|
36 | "sInfoEmpty": "unit test" |
---|
37 | } |
---|
38 | } ); |
---|
39 | oSettings = oTable.fnSettings(); |
---|
40 | oTable.fnFilter("nothinghere"); |
---|
41 | }, |
---|
42 | function () { return oSettings.oLanguage.sInfoEmpty == "unit test"; } |
---|
43 | ); |
---|
44 | |
---|
45 | oTest.fnTest( |
---|
46 | "Info empty language default is in the DOM", |
---|
47 | null, |
---|
48 | function () { |
---|
49 | var bReturn = document.getElementById('example_info').innerHTML.replace( |
---|
50 | ' '+oSettings.oLanguage.sInfoFiltered.replace( '_MAX_', '57' ), "" ) == |
---|
51 | "unit test"; |
---|
52 | return bReturn; |
---|
53 | } |
---|
54 | ); |
---|
55 | |
---|
56 | |
---|
57 | oTest.fnWaitTest( |
---|
58 | "Macro's not replaced", |
---|
59 | function () { |
---|
60 | oSession.fnRestore(); |
---|
61 | oTable = $('#example').dataTable( { |
---|
62 | "sAjaxSource": "../../../examples/examples_support/json_source.txt", |
---|
63 | "oLanguage": { |
---|
64 | "sInfoEmpty": "unit _START_ _END_ _TOTAL_ test" |
---|
65 | } |
---|
66 | } ); |
---|
67 | oTable.fnFilter("nothinghere"); |
---|
68 | }, |
---|
69 | function () { |
---|
70 | var bReturn = document.getElementById('example_info').innerHTML.replace( |
---|
71 | ' '+oSettings.oLanguage.sInfoFiltered.replace( '_MAX_', '57' ), "" ) == |
---|
72 | "unit _START_ _END_ _TOTAL_ test"; |
---|
73 | return bReturn; |
---|
74 | } |
---|
75 | ); |
---|
76 | |
---|
77 | |
---|
78 | oTest.fnComplete(); |
---|
79 | } ); |
---|