[BUGFIX] Add missing copy and cut button in file list search result
[Packages/TYPO3.CMS.git] / typo3 / sysext / filelist / Resources / Public / JavaScript / FileList.js
1 /*
2 * This file is part of the TYPO3 CMS project.
3 *
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.
7 *
8 * For the full copyright and license information, please read the
9 * LICENSE.txt file that was distributed with this source code.
10 *
11 * The TYPO3 project - inspiring people to share!
12 */
13
14 /**
15 * Module: TYPO3/CMS/Filelist/Filelist
16 * @exports TYPO3/CMS/Filelist/Filelist
17 */
18 define(['jquery', 'TYPO3/CMS/Backend/InfoWindow'], function($, InfoWindow) {
19
20 $(function() {
21 $('a.filelist-file-title').click(function(event) {
22 event.preventDefault();
23
24 var url = $(this).attr('data-url');
25 window.location.href = url;
26 });
27
28 $('a.btn.filelist-file-edit').click(function(event) {
29 event.preventDefault();
30
31 var url = $(this).attr('data-url');
32 top.list_frame.location.href = url;
33 });
34
35 $('a.btn.filelist-file-view').click(function(event) {
36 event.preventDefault();
37
38 var url = $(this).attr('data-url');
39 top.openUrlInWindow(url, 'WebFile')
40 });
41
42 $('a.btn.filelist-file-replace').click(function(event) {
43 event.preventDefault();
44
45 var url = $(this).attr('data-url');
46 top.list_frame.location.href = url;
47 });
48
49 $('a.btn.filelist-file-rename').click(function(event) {
50 event.preventDefault();
51
52 var url = $(this).attr('data-url');
53 top.list_frame.location.href = url;
54 });
55
56 $('a.btn.filelist-file-info').click(function(event) {
57 event.preventDefault();
58
59 var identifier = $(this).attr('data-identifier');
60 openFileInfoPopup(identifier);
61 });
62
63 $('a.filelist-file-references').click(function(event) {
64 event.preventDefault();
65
66 var identifier = $(this).attr('data-identifier');
67 openFileInfoPopup(identifier);
68 });
69
70 $('a.btn.filelist-file-copy').click(function(event) {
71 event.preventDefault();
72
73 var url = $(this).attr('data-url');
74 var redirectUrl = $(this).attr('data-url');
75 if (redirectUrl) {
76 redirectUrl = top.rawurlencode(redirectUrl);
77 } else {
78 redirectUrl = top.rawurlencode(top.list_frame.document.location.pathname + top.list_frame.document.location.search);
79 }
80 top.list_frame.location.href = url + '&redirect=' + redirectUrl;
81 });
82
83 $('a.btn.filelist-file-cut').click(function(event) {
84 event.preventDefault();
85
86 var url = $(this).attr('data-url');
87 top.list_frame.location.href = url;
88 });
89
90 });
91
92 /**
93 * @param identifier
94 */
95 function openFileInfoPopup(identifier) {
96 InfoWindow.showItem('_FILE', identifier);
97 }
98
99 });