Free cookie consent management tool by TermsFeed Policy Generator

source: branches/WebApplication/MVC2/HeuristicLabWeb.PluginHost/HLWebPluginHost/Content/jQuery/jQueryPlugins/DataTables-1.7.6/media/unit_testing/tests_onhold/3_ajax/oLanguage.oPaginate.js @ 6286

Last change on this file since 6286 was 6286, checked in by dkahn, 13 years ago

#1198 Added jQuery plus plugins

File size: 2.2 KB
Line 
1// DATA_TEMPLATE: empty_table
2oTest.fnStart( "oLanguage.oPaginate" );
3
4/* Note that the paging language information only has relevence in full numbers */
5
6$(document).ready( function () {
7  /* Check the default */
8  var oTable = $('#example').dataTable( {
9    "sAjaxSource": "../../../examples/examples_support/json_source.txt",
10    "sPaginationType": "full_numbers"
11  } );
12  var oSettings = oTable.fnSettings();
13 
14  oTest.fnWaitTest(
15    "oLanguage.oPaginate defaults",
16    null,
17    function () {
18      var bReturn =
19        oSettings.oLanguage.oPaginate.sFirst == "First" &&
20        oSettings.oLanguage.oPaginate.sPrevious == "Previous" &&
21        oSettings.oLanguage.oPaginate.sNext == "Next" &&
22        oSettings.oLanguage.oPaginate.sLast == "Last";
23      return bReturn;
24    }
25  );
26 
27  oTest.fnTest(
28    "oLanguage.oPaginate defaults are in the DOM",
29    null,
30    function () {
31      var bReturn =
32        $('#example_paginate .first').html() == "First" &&
33        $('#example_paginate .previous').html() == "Previous" &&
34        $('#example_paginate .next').html() == "Next" &&
35        $('#example_paginate .last').html() == "Last";
36      return bReturn;
37    }
38  );
39 
40 
41  oTest.fnWaitTest(
42    "oLanguage.oPaginate can be defined",
43    function () {
44      oSession.fnRestore();
45      oTable = $('#example').dataTable( {
46        "sAjaxSource": "../../../examples/examples_support/json_source.txt",
47        "sPaginationType": "full_numbers",
48        "oLanguage": {
49          "oPaginate": {
50            "sFirst":    "unit1",
51            "sPrevious": "test2",
52            "sNext":     "unit3",
53            "sLast":     "test4"
54          }
55        }
56      } );
57      oSettings = oTable.fnSettings();
58    },
59    function () {
60      var bReturn =
61        oSettings.oLanguage.oPaginate.sFirst == "unit1" &&
62        oSettings.oLanguage.oPaginate.sPrevious == "test2" &&
63        oSettings.oLanguage.oPaginate.sNext == "unit3" &&
64        oSettings.oLanguage.oPaginate.sLast == "test4";
65      return bReturn;
66    }
67  );
68 
69  oTest.fnTest(
70    "oLanguage.oPaginate definitions are in the DOM",
71    null,
72    function () {
73      var bReturn =
74        $('#example_paginate .first').html() == "unit1" &&
75        $('#example_paginate .previous').html() == "test2" &&
76        $('#example_paginate .next').html() == "unit3" &&
77        $('#example_paginate .last').html() == "test4";
78      return bReturn;
79    }
80  );
81 
82 
83  oTest.fnComplete();
84} );
Note: See TracBrowser for help on using the repository browser.