Add datatables-1.9.4 and jquery-1.10.2 libraries
[proteocache.git] / webapp / resources / datatables-1.9.4 / media / unit_testing / tests_onhold / 4_server-side / oLanguage.sInfoPostFix.js
1 // DATA_TEMPLATE: empty_table
2 oTest.fnStart( "oLanguage.sInfoPostFix" );
3
4 $(document).ready( function () {
5         /* Check the default */
6         var oTable = $('#example').dataTable( {
7                 "bServerSide": true,
8                 "sAjaxSource": "../../../examples/server_side/scripts/server_processing.php"
9         } );
10         var oSettings = oTable.fnSettings();
11         
12         oTest.fnWaitTest( 
13                 "Info post fix language is '' (blank) by default",
14                 null,
15                 function () { return oSettings.oLanguage.sInfoPostFix == ""; }
16         );
17         
18         oTest.fnTest( 
19                 "Width no post fix, the basic info shows",
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 post fix language can be defined",
27                 function () {
28                         oSession.fnRestore();
29                         oTable = $('#example').dataTable( {
30                                 "bServerSide": true,
31                 "sAjaxSource": "../../../examples/server_side/scripts/server_processing.php",
32                                 "oLanguage": {
33                                         "sInfoPostFix": "unit test"
34                                 }
35                         } );
36                         oSettings = oTable.fnSettings();
37                 },
38                 function () { return oSettings.oLanguage.sInfoPostFix == "unit test"; }
39         );
40         
41         oTest.fnTest( 
42                 "Info empty language default is in the DOM",
43                 null,
44                 function () { return document.getElementById('example_info').innerHTML = "Showing 1 to 10 of 57 entries unit test"; }
45         );
46         
47         
48         oTest.fnWaitTest( 
49                 "Macros have no effect in the post fix",
50                 function () {
51                         oSession.fnRestore();
52                         oTable = $('#example').dataTable( {
53                                 "bServerSide": true,
54                 "sAjaxSource": "../../../examples/server_side/scripts/server_processing.php",
55                                 "oLanguage": {
56                                         "sInfoPostFix": "unit _START_ _END_ _TOTAL_ test"
57                                 }
58                         } );
59                 },
60                 function () { return document.getElementById('example_info').innerHTML = "Showing 1 to 10 of 57 entries unit _START_ _END_ _TOTAL_ test"; }
61         );
62         
63         
64         oTest.fnWaitTest( 
65                 "Post fix is applied after fintering info",
66                 function () {
67                         oSession.fnRestore();
68                         oTable = $('#example').dataTable( {
69                                 "bServerSide": true,
70                 "sAjaxSource": "../../../examples/server_side/scripts/server_processing.php",
71                                 "oLanguage": {
72                                         "sInfoPostFix": "unit test"
73                                 }
74                         } );
75                         oTable.fnFilter("nothinghere");
76                 },
77                 function () { return document.getElementById('example_info').innerHTML = "Showing 0 to 0 of 0 entries unit (filtered from 57 total entries) test"; }
78         );
79         
80         
81         oTest.fnComplete();
82 } );