[TASK] Replace confirm in import / export module
[Packages/TYPO3.CMS.git] / typo3 / sysext / impexp / Resources / Public / JavaScript / ImportExport.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 * JavaScript to handle confirm windows in the Import/Export module
16 */
17 define('TYPO3/CMS/Impexp/ImportExport', ['jquery'], function ($) {
18 $(function() {
19 $(document).on('click', '.t3js-confirm-trigger', function() {
20 $button = $(this);
21 top.TYPO3.Modal.confirm($button.data('title'), $button.data('message'))
22 .on('confirm.button.ok', function() {
23 $('#t3js-submit-field')
24 .attr('name', $button.attr('name'))
25 .closest('form').submit();
26 top.TYPO3.Modal.currentModal.trigger('modal-dismiss');
27 })
28 .on('confirm.button.cancel', function() {
29 top.TYPO3.Modal.currentModal.trigger('modal-dismiss');
30 });
31 });
32 });
33 });