Commit 0bb4e8f0 authored by Frank Nägler's avatar Frank Nägler Committed by Andreas Fernandez
Browse files

[TASK] Migrate TYPO3/CMS/Impexp/* to TypeScript

Resolves: #87915
Releases: master
Change-Id: I4a7fa727c47b85bfae728f0a1dab0e6e833063ce
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/60250


Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: default avatarSteffen Frese <steffenf14@gmail.com>
Tested-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: default avatarSteffen Frese <steffenf14@gmail.com>
Reviewed-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
parent b597dfe7
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
/**
* Module: TYPO3/CMS/Impexp/ContextMenuActions
*
* JavaScript to handle import/export actions from context menu
* @exports TYPO3/CMS/Impexp/ContextMenuActions
*/
class ContextMenuActions {
public exportT3d(table: string, uid: number): void {
if (table === 'pages') {
top.TYPO3.Backend.ContentContainer.setUrl(
top.TYPO3.settings.ImportExport.moduleUrl +
'&tx_impexp[action]=export&' +
'id=0&tx_impexp[pagetree][id]=' + uid +
'&tx_impexp[pagetree][levels]=0' +
'&tx_impexp[pagetree][tables][]=_ALL',
);
} else {
top.TYPO3.Backend.ContentContainer.setUrl(
top.TYPO3.settings.ImportExport.moduleUrl +
'&tx_impexp[action]=export' +
'&tx_impexp[record][]=' + table + ':' + uid +
'&tx_impexp[external_ref][tables][]=_ALL',
);
}
}
public importT3d(table: string, uid: number): void {
top.TYPO3.Backend.ContentContainer.setUrl(
top.TYPO3.settings.ImportExport.moduleUrl +
'&id=' + uid +
'&table=' + table + '&tx_impexp[action]=import',
);
}
}
export = new ContextMenuActions();
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
import * as $ from 'jquery';
import Modal = require('TYPO3/CMS/Backend/Modal');
/**
* Module: TYPO3/CMS/Impexp/ImportExport
* JavaScript to handle confirm windows in the Import/Export module
* @exports TYPO3/CMS/Impexp/ImportExport
*/
class ImportExport {
constructor() {
$((): void => {
$(document).on('click', '.t3js-confirm-trigger', (e: JQueryEventObject): void => {
const $button = $(e.currentTarget);
Modal.confirm($button.data('title'), $button.data('message'))
.on('confirm.button.ok', (): void => {
$('#t3js-submit-field')
.attr('name', $button.attr('name'))
.closest('form').submit();
Modal.currentModal.trigger('modal-dismiss');
})
.on('confirm.button.cancel', (): void => {
Modal.currentModal.trigger('modal-dismiss');
});
});
$('.t3js-impexp-toggledisabled').on('click', (): void => {
const $checkboxes = $('table.t3js-impexp-preview tr[data-active="hidden"] input.t3js-exclude-checkbox');
if ($checkboxes.length) {
const $firstCheckbox = $checkboxes.get(0) as HTMLInputElement;
$checkboxes.prop('checked', !$firstCheckbox.checked);
}
});
});
}
}
export = new ImportExport();
......@@ -10,47 +10,4 @@
*
* The TYPO3 project - inspiring people to share!
*/
/**
* Module: TYPO3/CMS/Impexp/ContextMenuActions
*
* JavaScript to handle import/export actions from context menu
* @exports TYPO3/CMS/Impexp/ContextMenuActions
*/
define(function() {
'use strict';
/**
* @exports TYPO3/CMS/Impexp/ContextMenuActions
*/
var ContextMenuActions = {};
ContextMenuActions.exportT3d = function(table, uid) {
if (table === 'pages') {
top.TYPO3.Backend.ContentContainer.setUrl(
top.TYPO3.settings.ImportExport.moduleUrl +
'&tx_impexp[action]=export&' +
'id=0&tx_impexp[pagetree][id]=' + uid +
'&tx_impexp[pagetree][levels]=0' +
'&tx_impexp[pagetree][tables][]=_ALL'
);
} else {
top.TYPO3.Backend.ContentContainer.setUrl(
top.TYPO3.settings.ImportExport.moduleUrl +
'&tx_impexp[action]=export' +
'&tx_impexp[record][]=' + table + ':' + uid +
'&tx_impexp[external_ref][tables][]=_ALL'
);
}
};
ContextMenuActions.importT3d = function(table, uid) {
top.TYPO3.Backend.ContentContainer.setUrl(
top.TYPO3.settings.ImportExport.moduleUrl +
'&id=' + uid +
'&table=' + table + '&tx_impexp[action]=import'
);
};
return ContextMenuActions;
});
define(["require","exports"],function(t,e){"use strict";return new(function(){function t(){}return t.prototype.exportT3d=function(t,e){"pages"===t?top.TYPO3.Backend.ContentContainer.setUrl(top.TYPO3.settings.ImportExport.moduleUrl+"&tx_impexp[action]=export&id=0&tx_impexp[pagetree][id]="+e+"&tx_impexp[pagetree][levels]=0&tx_impexp[pagetree][tables][]=_ALL"):top.TYPO3.Backend.ContentContainer.setUrl(top.TYPO3.settings.ImportExport.moduleUrl+"&tx_impexp[action]=export&tx_impexp[record][]="+t+":"+e+"&tx_impexp[external_ref][tables][]=_ALL")},t.prototype.importT3d=function(t,e){top.TYPO3.Backend.ContentContainer.setUrl(top.TYPO3.settings.ImportExport.moduleUrl+"&id="+e+"&table="+t+"&tx_impexp[action]=import")},t}())});
\ No newline at end of file
......@@ -10,35 +10,4 @@
*
* The TYPO3 project - inspiring people to share!
*/
/**
* Module: TYPO3/CMS/Impexp/ImportExport
* JavaScript to handle confirm windows in the Import/Export module
* @exports TYPO3/CMS/Impexp/ImportExport
*/
define(['jquery', 'TYPO3/CMS/Backend/Modal'], function($, Modal) {
'use strict';
$(function() {
$(document).on('click', '.t3js-confirm-trigger', function() {
var $button = $(this);
Modal.confirm($button.data('title'), $button.data('message'))
.on('confirm.button.ok', function() {
$('#t3js-submit-field')
.attr('name', $button.attr('name'))
.closest('form').submit();
Modal.currentModal.trigger('modal-dismiss');
})
.on('confirm.button.cancel', function() {
Modal.currentModal.trigger('modal-dismiss');
});
});
$('.t3js-impexp-toggledisabled').on('click', function() {
var $checkboxes = $('table.t3js-impexp-preview tr[data-active="hidden"] input.t3js-exclude-checkbox');
if ($checkboxes.length) {
$checkboxes.prop('checked', !$checkboxes.get(0).checked);
}
});
});
});
define(["require","exports","jquery","TYPO3/CMS/Backend/Modal"],function(t,e,n,i){"use strict";return new function(){n(function(){n(document).on("click",".t3js-confirm-trigger",function(t){var e=n(t.currentTarget);i.confirm(e.data("title"),e.data("message")).on("confirm.button.ok",function(){n("#t3js-submit-field").attr("name",e.attr("name")).closest("form").submit(),i.currentModal.trigger("modal-dismiss")}).on("confirm.button.cancel",function(){i.currentModal.trigger("modal-dismiss")})}),n(".t3js-impexp-toggledisabled").on("click",function(){var t=n('table.t3js-impexp-preview tr[data-active="hidden"] input.t3js-exclude-checkbox');if(t.length){var e=t.get(0);t.prop("checked",!e.checked)}})})}});
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment