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

Contents of /misc/horsensspejder-web/jquery/DataTables-1.9.4/media/unit_testing/tests_onhold/5_ajax_objects/oLanguage.sUrl.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, 2 months ago) by torben
File MIME type: application/javascript
File size: 2411 byte(s)
initial import
1 // DATA_TEMPLATE: empty_table
2 oTest.fnStart( "oLanguage.sUrl" );
3
4 /* Note that we only test the internal storage of language information pulled form a file here
5 * as the other language tests will check it goes into the DOM correctly
6 */
7
8 $(document).ready( function () {
9 /* Check the default */
10 var oTable = $('#example').dataTable( {
11 "sAjaxSource": "../../../examples/ajax/sources/objects.txt",
12 "aoColumns": [
13 { "mData": "engine" },
14 { "mData": "browser" },
15 { "mData": "platform" },
16 { "mData": "version" },
17 { "mData": "grade" }
18 ]
19 } );
20 var oSettings = oTable.fnSettings();
21
22 oTest.fnTest(
23 "sUrl is blank by default",
24 null,
25 function () { return oSettings.oLanguage.sUrl == ""; }
26 );
27
28
29 oTest.fnWaitTest(
30 "Loading of German file loads language information",
31 function () {
32 oSession.fnRestore();
33 oTable = $('#example').dataTable( {
34 "sAjaxSource": "../../../examples/ajax/sources/objects.txt",
35 "aoColumnDefs": [
36 { "mData": "engine", "aTargets": [0] },
37 { "mData": "browser", "aTargets": [1] },
38 { "mData": "platform", "aTargets": [2] },
39 { "mData": "version", "aTargets": [3] },
40 { "mData": "grade", "aTargets": [4] }
41 ],
42 "oLanguage": {
43 "sUrl": "../../../examples/examples_support/de_DE.txt"
44 }
45 } );
46 oSettings = oTable.fnSettings();
47 },
48 function () {
49 var bReturn =
50 oSettings.oLanguage.sProcessing == "Bitte warten..." &&
51 oSettings.oLanguage.sLengthMenu == "_MENU_ Einträge anzeigen" &&
52 oSettings.oLanguage.sZeroRecords == "Keine Einträge vorhanden." &&
53 oSettings.oLanguage.sInfo == "_START_ bis _END_ von _TOTAL_ Einträgen" &&
54 oSettings.oLanguage.sInfoEmpty == "0 bis 0 von 0 Einträgen" &&
55 oSettings.oLanguage.sInfoFiltered == "(gefiltert von _MAX_ Einträgen)" &&
56 oSettings.oLanguage.sInfoPostFix == "" &&
57 oSettings.oLanguage.sSearch == "Suchen" &&
58 oSettings.oLanguage.oPaginate.sFirst == "Erster" &&
59 oSettings.oLanguage.oPaginate.sPrevious == "Zurück" &&
60 oSettings.oLanguage.oPaginate.sNext == "Nächster" &&
61 oSettings.oLanguage.oPaginate.sLast == "Letzter";
62
63 return bReturn;
64 }
65 );
66
67 /* One DOM check just to ensure that they go into the DOM */
68 oTest.fnTest(
69 "Loaded language goes into the DOM",
70 null,
71 function () { return document.getElementById('example_info').innerHTML = "1 bis 10 von 57 Einträgen"; }
72 );
73
74
75 oTest.fnComplete();
76 } );

  ViewVC Help
Powered by ViewVC 1.1.20