annotate DataTables-1.9.4/media/unit_testing/tests_onhold/6_delayed_rendering/oLanguage.sUrl.js @ 7:0f2b740536fb draft

Uploaded
author saskia-hiltemann
date Mon, 21 Aug 2017 09:16:07 -0400
parents ac5f9272033b
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
1 // DATA_TEMPLATE: empty_table
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
2 oTest.fnStart( "oLanguage.sUrl" );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
3
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
4 /* Note that we only test the internal storage of language information pulled form a file here
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
5 * as the other language tests will check it goes into the DOM correctly
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
6 */
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
7
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
8 $(document).ready( function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
9 /* Check the default */
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
10 var oTable = $('#example').dataTable( {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
11 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
12 "bDeferRender": true
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
13 } );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
14 var oSettings = oTable.fnSettings();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
15
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
16 oTest.fnTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
17 "sUrl is blank by default",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
18 null,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
19 function () { return oSettings.oLanguage.sUrl == ""; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
20 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
21
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
22
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
23 oTest.fnWaitTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
24 "Loading of German file loads language information",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
25 function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
26 oSession.fnRestore();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
27 oTable = $('#example').dataTable( {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
28 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
29 "bDeferRender": true,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
30 "oLanguage": {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
31 "sUrl": "../../../examples/examples_support/de_DE.txt"
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
32 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
33 } );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
34 oSettings = oTable.fnSettings();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
35 },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
36 function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
37 var bReturn =
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
38 oSettings.oLanguage.sProcessing == "Bitte warten..." &&
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
39 oSettings.oLanguage.sLengthMenu == "_MENU_ Einträge anzeigen" &&
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
40 oSettings.oLanguage.sZeroRecords == "Keine Einträge vorhanden." &&
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
41 oSettings.oLanguage.sInfo == "_START_ bis _END_ von _TOTAL_ Einträgen" &&
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
42 oSettings.oLanguage.sInfoEmpty == "0 bis 0 von 0 Einträgen" &&
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
43 oSettings.oLanguage.sInfoFiltered == "(gefiltert von _MAX_ Einträgen)" &&
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
44 oSettings.oLanguage.sInfoPostFix == "" &&
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
45 oSettings.oLanguage.sSearch == "Suchen" &&
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
46 oSettings.oLanguage.oPaginate.sFirst == "Erster" &&
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
47 oSettings.oLanguage.oPaginate.sPrevious == "Zurück" &&
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
48 oSettings.oLanguage.oPaginate.sNext == "Nächster" &&
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
49 oSettings.oLanguage.oPaginate.sLast == "Letzter";
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
50
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
51 return bReturn;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
52 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
53 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
54
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
55 /* One DOM check just to ensure that they go into the DOM */
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
56 oTest.fnTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
57 "Loaded language goes into the DOM",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
58 null,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
59 function () { return document.getElementById('example_info').innerHTML = "1 bis 10 von 57 Einträgen"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
60 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
61
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
62
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
63 oTest.fnComplete();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
64 } );