9bbc831f621befe6dcba57ba46cafd90586c4011
[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'], function($) {
19
20 $('a.filelist-file-title').click(function(event) {
21 event.preventDefault();
22
23 var url = $(this).attr('data-url');
24 window.location.href=url;
25 });
26
27 $('a.btn.filelist-file-edit').click(function(event) {
28 event.preventDefault();
29
30 var url = $(this).attr('data-url');
31 top.content.list_frame.location.href=url;
32 });
33
34 $('a.btn.filelist-file-view').click(function(event) {
35 event.preventDefault();
36
37 var url = $(this).attr('data-url');
38 top.openUrlInWindow(url, 'WebFile')
39 });
40
41 $('a.btn.filelist-file-replace').click(function(event) {
42 event.preventDefault();
43
44 var url = $(this).attr('data-url');
45 top.content.list_frame.location.href=url;
46 });
47
48 $('a.btn.filelist-file-rename').click(function(event) {
49 event.preventDefault();
50
51 var url = $(this).attr('data-url');
52 top.content.list_frame.location.href=url;
53 });
54
55 $('a.btn.filelist-file-info').click(function(event) {
56 event.preventDefault();
57
58 var identifier = $(this).attr('data-identifier');
59 openFileInfoPopup(identifier);
60 });
61
62 $('a.filelist-file-references').click(function(event) {
63 event.preventDefault();
64
65 var identifier = $(this).attr('data-identifier');
66 openFileInfoPopup(identifier);
67 });
68
69 /**
70 * @param identifier
71 */
72 function openFileInfoPopup(identifier) {
73 top.launchView('_FILE', identifier);
74 }
75
76 });