2 * This file is part of the TYPO3 CMS project.
4 * It is free software; you can redistribute it and/or modify it under
5 * the terms of the GNU General Public License, either version 2
6 * of the License, or any later version.
8 * For the full copyright and license information, please read the
9 * LICENSE.txt file that was distributed with this source code.
11 * The TYPO3 project - inspiring people to share!
15 * Module: TYPO3/CMS/Filelist/Filelist
16 * @exports TYPO3/CMS/Filelist/Filelist
18 define(['jquery', 'TYPO3/CMS/Backend/InfoWindow'], function($, InfoWindow
) {
21 $('a.filelist-file-title').click(function(event
) {
22 event
.preventDefault();
24 var url
= $(this).attr('data-url');
25 window
.location
.href
= url
;
28 $('a.btn.filelist-file-edit').click(function(event
) {
29 event
.preventDefault();
31 var url
= $(this).attr('data-url');
32 top
.list_frame
.location
.href
= url
;
35 $('a.btn.filelist-file-view').click(function(event
) {
36 event
.preventDefault();
38 var url
= $(this).attr('data-url');
39 top
.openUrlInWindow(url
, 'WebFile')
42 $('a.btn.filelist-file-replace').click(function(event
) {
43 event
.preventDefault();
45 var url
= $(this).attr('data-url');
46 top
.list_frame
.location
.href
= url
;
49 $('a.btn.filelist-file-rename').click(function(event
) {
50 event
.preventDefault();
52 var url
= $(this).attr('data-url');
53 top
.list_frame
.location
.href
= url
;
56 $('a.btn.filelist-file-info').click(function(event
) {
57 event
.preventDefault();
59 var identifier
= $(this).attr('data-identifier');
60 openFileInfoPopup(identifier
);
63 $('a.filelist-file-references').click(function(event
) {
64 event
.preventDefault();
66 var identifier
= $(this).attr('data-identifier');
67 openFileInfoPopup(identifier
);
70 $('a.btn.filelist-file-copy').click(function(event
) {
71 event
.preventDefault();
73 var url
= $(this).attr('data-url');
74 var redirectUrl
= $(this).attr('data-url');
76 redirectUrl
= top
.rawurlencode(redirectUrl
);
78 redirectUrl
= top
.rawurlencode(top
.list_frame
.document
.location
.pathname
+ top
.list_frame
.document
.location
.search
);
80 top
.list_frame
.location
.href
= url
+ '&redirect=' + redirectUrl
;
83 $('a.btn.filelist-file-cut').click(function(event
) {
84 event
.preventDefault();
86 var url
= $(this).attr('data-url');
87 top
.list_frame
.location
.href
= url
;
95 function openFileInfoPopup(identifier
) {
96 InfoWindow
.showItem('_FILE', identifier
);