/[projects]/misc/horsensspejder-web/jquery/DataTables-1.9.4/media/unit_testing/tests_onhold/5_ajax_objects/oLanguage.sInfoPostFix.js
ViewVC logotype

Contents of /misc/horsensspejder-web/jquery/DataTables-1.9.4/media/unit_testing/tests_onhold/5_ajax_objects/oLanguage.sInfoPostFix.js

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2125 - (show annotations) (download) (as text)
Wed Mar 12 19:30:05 2014 UTC (10 years, 3 months ago) by torben
File MIME type: application/javascript
File size: 3088 byte(s)
initial import
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 "sAjaxSource": "../../../examples/ajax/sources/objects.txt",
8 "aoColumns": [
9 { "mData": "engine" },
10 { "mData": "browser" },
11 { "mData": "platform" },
12 { "mData": "version" },
13 { "mData": "grade" }
14 ]
15 } );
16 var oSettings = oTable.fnSettings();
17
18 oTest.fnWaitTest(
19 "Info post fix language is '' (blank) by default",
20 null,
21 function () { return oSettings.oLanguage.sInfoPostFix == ""; }
22 );
23
24 oTest.fnTest(
25 "Width no post fix, the basic info shows",
26 null,
27 function () { return document.getElementById('example_info').innerHTML = "Showing 1 to 10 of 57 entries"; }
28 );
29
30
31 oTest.fnWaitTest(
32 "Info post fix language can be defined",
33 function () {
34 oSession.fnRestore();
35 oTable = $('#example').dataTable( {
36 "sAjaxSource": "../../../examples/ajax/sources/objects.txt",
37 "aoColumnDefs": [
38 { "mData": "engine", "aTargets": [0] },
39 { "mData": "browser", "aTargets": [1] },
40 { "mData": "platform", "aTargets": [2] },
41 { "mData": "version", "aTargets": [3] },
42 { "mData": "grade", "aTargets": [4] }
43 ],
44 "oLanguage": {
45 "sInfoPostFix": "unit test"
46 }
47 } );
48 oSettings = oTable.fnSettings();
49 },
50 function () { return oSettings.oLanguage.sInfoPostFix == "unit test"; }
51 );
52
53 oTest.fnTest(
54 "Info empty language default is in the DOM",
55 null,
56 function () { return document.getElementById('example_info').innerHTML = "Showing 1 to 10 of 57 entries unit test"; }
57 );
58
59
60 oTest.fnWaitTest(
61 "Macros have no effect in the post fix",
62 function () {
63 oSession.fnRestore();
64 oTable = $('#example').dataTable( {
65 "sAjaxSource": "../../../examples/ajax/sources/objects.txt",
66 "aoColumnDefs": [
67 { "mData": "engine", "aTargets": [0] },
68 { "mData": "browser", "aTargets": [1] },
69 { "mData": "platform", "aTargets": [2] },
70 { "mData": "version", "aTargets": [3] },
71 { "mData": "grade", "aTargets": [4] }
72 ],
73 "oLanguage": {
74 "sInfoPostFix": "unit _START_ _END_ _TOTAL_ test"
75 }
76 } );
77 },
78 function () { return document.getElementById('example_info').innerHTML = "Showing 1 to 10 of 57 entries unit _START_ _END_ _TOTAL_ test"; }
79 );
80
81
82 oTest.fnWaitTest(
83 "Post fix is applied after fintering info",
84 function () {
85 oSession.fnRestore();
86 oTable = $('#example').dataTable( {
87 "sAjaxSource": "../../../examples/ajax/sources/objects.txt",
88 "aoColumnDefs": [
89 { "mData": "engine", "aTargets": [0] },
90 { "mData": "browser", "aTargets": [1] },
91 { "mData": "platform", "aTargets": [2] },
92 { "mData": "version", "aTargets": [3] },
93 { "mData": "grade", "aTargets": [4] }
94 ],
95 "oLanguage": {
96 "sInfoPostFix": "unit test"
97 }
98 } );
99 oTable.fnFilter("nothinghere");
100 },
101 function () { return document.getElementById('example_info').innerHTML = "Showing 0 to 0 of 0 entries unit (filtered from 57 total entries) test"; }
102 );
103
104
105 oTest.fnComplete();
106 } );

  ViewVC Help
Powered by ViewVC 1.1.20