cf00409596645a3d2f21e7ae2180cfc93893eb99
1 TYPO3
.DocumentationApplication
= {
3 // Utility method to retrieve query parameters
4 getUrlVars
: function getUrlVars() {
6 var hashes
= window
.location
.href
.slice(window
.location
.href
.indexOf('?') + 1).split('&');
7 for(var i
= 0; i
< hashes
.length
; i
++) {
8 hash
= hashes
[i
].split('=');
10 vars
[hash
[0]] = hash
[1];
14 // Initializes the data table, depending on the current view
15 initializeView: function() {
16 var getVars
= this.getUrlVars();
17 // getVars[1] contains the name of the action key
18 // List view is the default view
19 if (getVars
[getVars
[1]] == 'download') {
20 this.documentationDownloadView(getVars
);
22 this.documentationListView(getVars
);
25 // Initializes the list view
26 documentationListView: function(getVars
) {
27 this.datatable
= jQuery('#typo3-documentation-list').dataTable({
30 'bLengthChange': false,
33 "fnCookieCallback": function (sNameFile
, oData
, sExpires
, sPath
) {
34 // append mod.php to cookiePath to avoid sending cookie-data to images etc. without reason
35 return sNameFile
+ "=" + encodeURIComponent($.fn
.dataTableExt
.oApi
._fnJsonString(oData
)) + "; expires=" + sExpires
+"; path=" + sPath
+ "mod.php";
40 if (this.datatable
.length
&& getVars
['search']) {
41 this.datatable
.fnFilter(getVars
['search']);
44 // Initializes the download view
45 documentationDownloadView: function(getVars
) {
46 this.datatable
= jQuery('#typo3-documentation-download').dataTable({
49 'bLengthChange': false,
52 'aaSorting': [[ 1, 'asc' ]],
53 "fnCookieCallback": function (sNameFile
, oData
, sExpires
, sPath
) {
54 // append mod.php to cookiePath to avoid sending cookie-data to images etc. without reason
55 return sNameFile
+ "=" + encodeURIComponent($.fn
.dataTableExt
.oApi
._fnJsonString(oData
)) + "; expires=" + sExpires
+"; path=" + sPath
+ "mod.php";
60 if (this.datatable
.length
&& getVars
['search']) {
61 this.datatable
.fnFilter(getVars
['search']);
66 // IIFE for faster access to $ and save $ use
69 $(document
).ready(function() {
70 // Initialize the view
71 TYPO3
.DocumentationApplication
.initializeView();
73 // Make the data table filter react to the clearing of the filter field
74 $('.dataTables_wrapper .dataTables_filter input').clearable({
76 TYPO3
.DocumentationApplication
.datatable
.fnFilter('');