diff --git a/Build/types/TYPO3/index.d.ts b/Build/types/TYPO3/index.d.ts index b0577d9ceb0f..d5c2ec10887e 100644 --- a/Build/types/TYPO3/index.d.ts +++ b/Build/types/TYPO3/index.d.ts @@ -50,6 +50,8 @@ interface Window { inline: { delayedImportElement: (objectId: number, table: string, uid: number, type: string) => void }; + rawurlencode: Function; + list_frame: Window; } /** diff --git a/typo3/sysext/backend/Resources/Private/TypeScript/ContextMenuActions.ts b/typo3/sysext/backend/Resources/Private/TypeScript/ContextMenuActions.ts new file mode 100644 index 000000000000..caeffc1158c6 --- /dev/null +++ b/typo3/sysext/backend/Resources/Private/TypeScript/ContextMenuActions.ts @@ -0,0 +1,334 @@ +/* + * 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 InfoWindow = require('./InfoWindow'); +import Modal = require('./Modal'); +import Severity = require('./Severity'); +import Viewport = require('./Viewport'); + +/** + * @exports TYPO3/CMS/Backend/ContextMenuActions + */ +class ContextMenuActions { + /** + * @returns {string} + */ + public static getReturnUrl(): string { + return top.rawurlencode(top.list_frame.document.location.pathname + top.list_frame.document.location.search); + } + + /** + * @param {string} table + * @param {number} uid + */ + public static editRecord(table: string, uid: number): void { + Viewport.ContentContainer.setUrl( + top.TYPO3.settings.FormEngine.moduleUrl + '&edit[' + table + '][' + uid + ']=edit&returnUrl=' + ContextMenuActions.getReturnUrl() + ); + } + + /** + * @param {string} table + * @param {number} uid + */ + public static viewRecord(table: string, uid: number): void { + const $viewUrl = $(this).data('preview-url'); + if ($viewUrl) { + const previewWin = window.open($viewUrl, 'newTYPO3frontendWindow'); + previewWin.focus(); + } + } + + /** + * @param {string} table + * @param {number} uid + */ + public static openInfoPopUp(table: string, uid: number): void { + InfoWindow.showItem(table, uid); + } + + /** + * @param {string} table + * @param {number} uid + */ + public static mountAsTreeRoot(table: string, uid: number): void { + if (table === 'pages') { + Viewport.NavigationContainer.PageTree.setTemporaryMountPoint(uid); + } + } + + /** + * @param {string} table + * @param {number} uid + */ + public static newPageWizard(table: string, uid: number): void { + Viewport.ContentContainer.setUrl( + top.TYPO3.settings.NewRecord.moduleUrl + '&id=' + uid + '&pagesOnly=1&returnUrl=' + ContextMenuActions.getReturnUrl() + ); + } + + /** + * @param {string} table + * @param {number} uid + */ + public static newContentWizard(table: string, uid: number): void { + let $wizardUrl = $(this).data('new-wizard-url'); + if ($wizardUrl) { + $wizardUrl += '&returnUrl=' + ContextMenuActions.getReturnUrl(); + Viewport.ContentContainer.setUrl($wizardUrl); + } + } + + /** + * @param {string} table + * @param {number} uid + */ + public static newRecord(table: string, uid: number): void { + Viewport.ContentContainer.setUrl( + top.TYPO3.settings.FormEngine.moduleUrl + '&edit[' + table + '][-' + uid + ']=new&returnUrl=' + ContextMenuActions.getReturnUrl() + ); + } + + /** + * @param {string} table + * @param {number} uid + */ + public static openHistoryPopUp(table: string, uid: number): void { + Viewport.ContentContainer.setUrl( + top.TYPO3.settings.RecordHistory.moduleUrl + '&element=' + table + ':' + uid + '&returnUrl=' + ContextMenuActions.getReturnUrl() + ); + } + + /** + * @param {string} table + * @param {number} uid + */ + public static openListModule(table: string, uid: number): void { + const pageId = table === 'pages' ? uid : $(this).data('page-uid'); + top.TYPO3.ModuleMenu.App.showModule('web_list', 'id=' + pageId); + } + + /** + * @param {string} table + * @param {number} uid + */ + public static pagesSort(table: string, uid: number): void { + const pagesSortUrl = $(this).data('pages-sort-url'); + if (pagesSortUrl) { + Viewport.ContentContainer.setUrl(pagesSortUrl); + } + } + + /** + * @param {string} table + * @param {number} uid + */ + public static pagesNewMultiple(table: string, uid: number): void { + const pagesSortUrl = $(this).data('pages-new-multiple-url'); + if (pagesSortUrl) { + Viewport.ContentContainer.setUrl(pagesSortUrl); + } + } + + /** + * @param {string} table + * @param {number} uid + */ + public static disableRecord(table: string, uid: number): void { + Viewport.ContentContainer.setUrl( + top.TYPO3.settings.RecordCommit.moduleUrl + + '&data[' + table + '][' + uid + '][hidden]=1' + + '&redirect=' + ContextMenuActions.getReturnUrl() + ).done((): void => { + Viewport.NavigationContainer.PageTree.refreshTree(); + }); + } + + /** + * @param {string} table + * @param {number} uid + */ + public static enableRecord(table: string, uid: number): void { + Viewport.ContentContainer.setUrl( + top.TYPO3.settings.RecordCommit.moduleUrl + + '&data[' + table + '][' + uid + '][hidden]=0' + + '&redirect=' + ContextMenuActions.getReturnUrl() + ).done((): void => { + Viewport.NavigationContainer.PageTree.refreshTree(); + }); + } + + /** + * @param {string} table + * @param {number} uid + */ + public static deleteRecord(table: string, uid: number): void { + const $anchorElement = $(this); + const $modal = Modal.confirm( + $anchorElement.data('title'), + $anchorElement.data('message'), + Severity.warning, [ + { + text: $(this).data('button-close-text') || TYPO3.lang['button.cancel'] || 'Cancel', + active: true, + btnClass: 'btn-default', + name: 'cancel' + }, + { + text: $(this).data('button-ok-text') || TYPO3.lang['button.delete'] || 'Delete', + btnClass: 'btn-warning', + name: 'delete' + } + ]); + + $modal.on('button.clicked', (e: JQueryEventObject): void => { + if (e.target.getAttribute('name') === 'delete') { + Viewport.ContentContainer.setUrl( + top.TYPO3.settings.RecordCommit.moduleUrl + + '&redirect=' + ContextMenuActions.getReturnUrl() + + '&cmd[' + table + '][' + uid + '][delete]=1' + ).done((): void => { + if (table === 'pages' && Viewport.NavigationContainer.PageTree) { + Viewport.NavigationContainer.PageTree.refreshTree(); + } + }); + } + Modal.dismiss(); + }); + } + + /** + * @param {string} table + * @param {number} uid + */ + public static copy(table: string, uid: number): void { + const url = TYPO3.settings.ajaxUrls.contextmenu_clipboard + + '&CB[el][' + table + '%7C' + uid + ']=1' + + '&CB[setCopyMode]=1'; + + $.ajax(url).always((): void => { + ContextMenuActions.triggerRefresh(Viewport.ContentContainer.get().location.href); + }); + } + + /** + * @param {string} table + * @param {number} uid + */ + public static clipboardRelease(table: string, uid: number): void { + const url = TYPO3.settings.ajaxUrls.contextmenu_clipboard + + '&CB[el][' + table + '%7C' + uid + ']=0'; + + $.ajax(url).always((): void => { + ContextMenuActions.triggerRefresh(Viewport.ContentContainer.get().location.href); + }); + } + + /** + * @param {string} table + * @param {number} uid + */ + public static cut(table: string, uid: number): void { + const url = TYPO3.settings.ajaxUrls.contextmenu_clipboard + + '&CB[el][' + table + '%7C' + uid + ']=1' + + '&CB[setCopyMode]=0'; + + $.ajax(url).always((): void => { + ContextMenuActions.triggerRefresh(Viewport.ContentContainer.get().location.href); + }); + } + + /** + * @param {string} iframeUrl + */ + public static triggerRefresh(iframeUrl: string): void { + if (iframeUrl.indexOf('record%2Fedit') === -1) { + Viewport.ContentContainer.refresh(true); + } + } + + /** + * Clear cache for given page uid + * + * @param {string} table pages table + * @param {number} uid uid of the page + */ + public static clearCache(table: string, uid: number): void { + const url = top.TYPO3.settings.WebLayout.moduleUrl + + '&id=' + uid + '&clear_cache=1'; + $.ajax(url); + } + + /** + * Paste db record after another + * + * @param {string} table any db table except sys_file + * @param {number} uid uid of the record after which record from the cliboard will be pasted + */ + public static pasteAfter(table: string, uid: number): void { + ContextMenuActions.pasteInto.bind($(this))(table, -uid); + } + + /** + * Paste page into another page + * + * @param {string} table any db table except sys_file + * @param {number} uid uid of the record after which record from the cliboard will be pasted + */ + public static pasteInto(table: string, uid: number): void { + const $anchorElement = $(this); + const performPaste = (): void => { + const url = '&CB[paste]=' + table + '%7C' + uid + + '&CB[pad]=normal' + + '&redirect=' + ContextMenuActions.getReturnUrl(); + + Viewport.ContentContainer.setUrl( + top.TYPO3.settings.RecordCommit.moduleUrl + url + ).done((): void => { + if (table === 'pages' && Viewport.NavigationContainer.PageTree) { + Viewport.NavigationContainer.PageTree.refreshTree(); + } + }); + }; + if (!$anchorElement.data('title')) { + performPaste(); + return; + } + const $modal = Modal.confirm( + $anchorElement.data('title'), + $anchorElement.data('message'), + Severity.warning, [ + { + text: $(this).data('button-close-text') || TYPO3.lang['button.cancel'] || 'Cancel', + active: true, + btnClass: 'btn-default', + name: 'cancel' + }, + { + text: $(this).data('button-ok-text') || TYPO3.lang['button.ok'] || 'OK', + btnClass: 'btn-warning', + name: 'ok' + } + ]); + + $modal.on('button.clicked', (e: JQueryEventObject): void => { + if (e.target.getAttribute('name') === 'ok') { + performPaste(); + } + Modal.dismiss(); + }); + } +} + +export = ContextMenuActions; diff --git a/typo3/sysext/backend/Resources/Public/JavaScript/ContextMenuActions.js b/typo3/sysext/backend/Resources/Public/JavaScript/ContextMenuActions.js index 3f7b2a2f9dcb..4767995e0413 100644 --- a/typo3/sysext/backend/Resources/Public/JavaScript/ContextMenuActions.js +++ b/typo3/sysext/backend/Resources/Public/JavaScript/ContextMenuActions.js @@ -10,244 +10,4 @@ * * The TYPO3 project - inspiring people to share! */ - -/** - * Module: TYPO3/CMS/Backend/ContextMenuActions - * Click menu actions for db records including tt_content and pages - */ -define(['jquery', 'TYPO3/CMS/Backend/Modal', 'TYPO3/CMS/Backend/Severity'], function($, Modal, Severity) { - /** - * - * @exports TYPO3/CMS/Backend/ContextMenuActions - */ - var ContextMenuActions = {}; - - ContextMenuActions.getReturnUrl = function() { - return top.rawurlencode(top.list_frame.document.location.pathname + top.list_frame.document.location.search); - }; - - ContextMenuActions.editRecord = function(table, uid) { - top.TYPO3.Backend.ContentContainer.setUrl( - top.TYPO3.settings.FormEngine.moduleUrl + '&edit[' + table + '][' + uid + ']=edit&returnUrl=' + ContextMenuActions.getReturnUrl() - ); - }; - - ContextMenuActions.viewRecord = function(table, uid) { - var $viewUrl = $(this).data('preview-url'); - if ($viewUrl) { - var previewWin = window.open($viewUrl, 'newTYPO3frontendWindow'); - previewWin.focus(); - } - }; - - ContextMenuActions.openInfoPopUp = function(table, uid) { - top.TYPO3.InfoWindow.showItem(table, uid); - }; - - ContextMenuActions.mountAsTreeRoot = function(table, uid) { - if (table === 'pages') { - top.TYPO3.Backend.NavigationContainer.PageTree.setTemporaryMountPoint(uid); - } - }; - - ContextMenuActions.newPageWizard = function(table, uid) { - top.TYPO3.Backend.ContentContainer.setUrl( - top.TYPO3.settings.NewRecord.moduleUrl + '&id=' + uid + '&pagesOnly=1&returnUrl=' + ContextMenuActions.getReturnUrl() - ); - }; - - ContextMenuActions.newContentWizard = function(table, uid) { - var $wizardUrl = $(this).data('new-wizard-url'); - if ($wizardUrl) { - $wizardUrl += '&returnUrl=' + ContextMenuActions.getReturnUrl(); - top.TYPO3.Backend.ContentContainer.setUrl($wizardUrl); - } - }; - - ContextMenuActions.newRecord = function(table, uid) { - top.TYPO3.Backend.ContentContainer.setUrl( - top.TYPO3.settings.FormEngine.moduleUrl + '&edit[' + table + '][-' + uid + ']=new&returnUrl=' + ContextMenuActions.getReturnUrl() - ); - }; - - ContextMenuActions.openHistoryPopUp = function(table, uid) { - top.TYPO3.Backend.ContentContainer.setUrl( - top.TYPO3.settings.RecordHistory.moduleUrl + '&element=' + table + ':' + uid + '&returnUrl=' + ContextMenuActions.getReturnUrl() - ); - }; - - ContextMenuActions.openListModule = function(table, uid) { - var pageId = table === 'pages' ? uid : $(this).data('page-uid'); - top.TYPO3.ModuleMenu.App.showModule('web_list', 'id='.pageId); - }; - - ContextMenuActions.pagesSort = function(table, uid) { - var pagesSortUrl = $(this).data('pages-sort-url'); - if (pagesSortUrl) { - top.TYPO3.Backend.ContentContainer.setUrl(pagesSortUrl); - } - }; - - ContextMenuActions.pagesNewMultiple = function(table, uid) { - var pagesSortUrl = $(this).data('pages-new-multiple-url'); - if (pagesSortUrl) { - top.TYPO3.Backend.ContentContainer.setUrl(pagesSortUrl); - } - }; - - ContextMenuActions.disableRecord = function(table, uid) { - top.TYPO3.Backend.ContentContainer.setUrl( - top.TYPO3.settings.RecordCommit.moduleUrl + '&data[' + table + '][' + uid + '][hidden]=1&redirect=' + ContextMenuActions.getReturnUrl() - ).done(function() { - top.TYPO3.Backend.NavigationContainer.PageTree.refreshTree(); - }); - }; - - ContextMenuActions.enableRecord = function(table, uid) { - top.TYPO3.Backend.ContentContainer.setUrl( - top.TYPO3.settings.RecordCommit.moduleUrl + '&data[' + table + '][' + uid + '][hidden]=0&redirect=' + ContextMenuActions.getReturnUrl() - ).done(function() { - top.TYPO3.Backend.NavigationContainer.PageTree.refreshTree(); - }); - }; - - ContextMenuActions.deleteRecord = function(table, uid) { - var $anchorElement = $(this); - var $modal = Modal.confirm( - $anchorElement.data('title'), - $anchorElement.data('message'), - Severity.warning, [ - { - text: $(this).data('button-close-text') || TYPO3.lang['button.cancel'] || 'Cancel', - active: true, - btnClass: 'btn-default', - name: 'cancel' - }, - { - text: $(this).data('button-ok-text') || TYPO3.lang['button.delete'] || 'Delete', - btnClass: 'btn-warning', - name: 'delete' - } - ]); - - $modal.on('button.clicked', function(e) { - if (e.target.name === 'delete') { - top.TYPO3.Backend.ContentContainer.setUrl( - top.TYPO3.settings.RecordCommit.moduleUrl + '&redirect=' + ContextMenuActions.getReturnUrl() + '&cmd[' + table + '][' + uid + '][delete]=1' - ).done(function() { - if (table === 'pages' && top.TYPO3.Backend.NavigationContainer.PageTree) { - top.TYPO3.Backend.NavigationContainer.PageTree.refreshTree(); - } - }); - - } - Modal.dismiss(); - }); - }; - - ContextMenuActions.copy = function(table, uid) { - var url = TYPO3.settings.ajaxUrls['contextmenu_clipboard']; - url += '&CB[el][' + table + '%7C' + uid + ']=1' + '&CB[setCopyMode]=1'; - $.ajax(url).always(function() { - ContextMenuActions.triggerRefresh(top.TYPO3.Backend.ContentContainer.get().location.href); - }); - }; - - ContextMenuActions.clipboardRelease = function(table, uid) { - var url = TYPO3.settings.ajaxUrls['contextmenu_clipboard']; - url += '&CB[el][' + table + '%7C' + uid + ']=0'; - $.ajax(url).always(function() { - ContextMenuActions.triggerRefresh(top.TYPO3.Backend.ContentContainer.get().location.href); - }); - }; - - ContextMenuActions.cut = function(table, uid) { - var url = TYPO3.settings.ajaxUrls['contextmenu_clipboard']; - url += '&CB[el][' + table + '%7C' + uid + ']=1' + '&CB[setCopyMode]=0'; - $.ajax(url).always(function() { - ContextMenuActions.triggerRefresh(top.TYPO3.Backend.ContentContainer.get().location.href); - }); - }; - - ContextMenuActions.triggerRefresh = function (iframeUrl) { - if (iframeUrl.indexOf("record%2Fedit") === -1) { - top.TYPO3.Backend.ContentContainer.refresh(true); - } - }; - - /** - * Clear cache for given page uid - * - * @param {string} table pages table - * @param {int} uid of the page - */ - ContextMenuActions.clearCache = function(table, uid) { - var url = top.TYPO3.settings.WebLayout.moduleUrl; - url += '&id=' + uid + '&clear_cache=1'; - $.ajax(url); - }; - - /** - * Paste db record after another - * - * @param {string} table any db table except sys_file - * @param {int} uid of the record after which record from the cliboard will be pasted - */ - ContextMenuActions.pasteAfter = function(table, uid) { - ContextMenuActions.pasteInto.bind($(this))(table, -uid); - }; - - /** - * Paste page into another page - * - * @param {string} table any db table except sys_file - * @param {int} uid of the record after which record from the cliboard will be pasted - */ - ContextMenuActions.pasteInto = function(table, uid) { - var $anchorElement = $(this); - var title = $anchorElement.data('title'); - var performPaste = function() { - var url = '&CB[paste]=' + table + '%7C' + uid - + '&CB[pad]=normal' - + '&redirect=' + ContextMenuActions.getReturnUrl(); - - top.TYPO3.Backend.ContentContainer.setUrl( - top.TYPO3.settings.RecordCommit.moduleUrl + url - ).done(function() { - if (table === 'pages' && top.TYPO3.Backend.NavigationContainer.PageTree) { - top.TYPO3.Backend.NavigationContainer.PageTree.refreshTree(); - } - }); - }; - if (!$anchorElement.data('title')) { - performPaste(); - return; - } - var $modal = Modal.confirm( - $anchorElement.data('title'), - $anchorElement.data('message'), - Severity.warning, [ - { - text: $(this).data('button-close-text') || TYPO3.lang['button.cancel'] || 'Cancel', - active: true, - btnClass: 'btn-default', - name: 'cancel' - }, - { - text: $(this).data('button-ok-text') || TYPO3.lang['button.ok'] || 'OK', - btnClass: 'btn-warning', - name: 'ok' - } - ]); - - $modal.on('button.clicked', function(e) { - if (e.target.name === 'ok') { - performPaste(); - } - Modal.dismiss(); - }); - - }; - - return ContextMenuActions; -}); +define(["require","exports","jquery","./InfoWindow","./Modal","./Severity","./Viewport"],function(t,e,n,o,r,a,i){"use strict";return function(){function t(){}return t.getReturnUrl=function(){return top.rawurlencode(top.list_frame.document.location.pathname+top.list_frame.document.location.search)},t.editRecord=function(e,n){i.ContentContainer.setUrl(top.TYPO3.settings.FormEngine.moduleUrl+"&edit["+e+"]["+n+"]=edit&returnUrl="+t.getReturnUrl())},t.viewRecord=function(t,e){var o=n(this).data("preview-url");o&&window.open(o,"newTYPO3frontendWindow").focus()},t.openInfoPopUp=function(t,e){o.showItem(t,e)},t.mountAsTreeRoot=function(t,e){"pages"===t&&i.NavigationContainer.PageTree.setTemporaryMountPoint(e)},t.newPageWizard=function(e,n){i.ContentContainer.setUrl(top.TYPO3.settings.NewRecord.moduleUrl+"&id="+n+"&pagesOnly=1&returnUrl="+t.getReturnUrl())},t.newContentWizard=function(e,o){var r=n(this).data("new-wizard-url");r&&(r+="&returnUrl="+t.getReturnUrl(),i.ContentContainer.setUrl(r))},t.newRecord=function(e,n){i.ContentContainer.setUrl(top.TYPO3.settings.FormEngine.moduleUrl+"&edit["+e+"][-"+n+"]=new&returnUrl="+t.getReturnUrl())},t.openHistoryPopUp=function(e,n){i.ContentContainer.setUrl(top.TYPO3.settings.RecordHistory.moduleUrl+"&element="+e+":"+n+"&returnUrl="+t.getReturnUrl())},t.openListModule=function(t,e){var o="pages"===t?e:n(this).data("page-uid");top.TYPO3.ModuleMenu.App.showModule("web_list","id="+o)},t.pagesSort=function(t,e){var o=n(this).data("pages-sort-url");o&&i.ContentContainer.setUrl(o)},t.pagesNewMultiple=function(t,e){var o=n(this).data("pages-new-multiple-url");o&&i.ContentContainer.setUrl(o)},t.disableRecord=function(e,n){i.ContentContainer.setUrl(top.TYPO3.settings.RecordCommit.moduleUrl+"&data["+e+"]["+n+"][hidden]=1&redirect="+t.getReturnUrl()).done(function(){i.NavigationContainer.PageTree.refreshTree()})},t.enableRecord=function(e,n){i.ContentContainer.setUrl(top.TYPO3.settings.RecordCommit.moduleUrl+"&data["+e+"]["+n+"][hidden]=0&redirect="+t.getReturnUrl()).done(function(){i.NavigationContainer.PageTree.refreshTree()})},t.deleteRecord=function(e,o){var l=n(this);r.confirm(l.data("title"),l.data("message"),a.warning,[{text:n(this).data("button-close-text")||TYPO3.lang["button.cancel"]||"Cancel",active:!0,btnClass:"btn-default",name:"cancel"},{text:n(this).data("button-ok-text")||TYPO3.lang["button.delete"]||"Delete",btnClass:"btn-warning",name:"delete"}]).on("button.clicked",function(n){"delete"===n.target.getAttribute("name")&&i.ContentContainer.setUrl(top.TYPO3.settings.RecordCommit.moduleUrl+"&redirect="+t.getReturnUrl()+"&cmd["+e+"]["+o+"][delete]=1").done(function(){"pages"===e&&i.NavigationContainer.PageTree&&i.NavigationContainer.PageTree.refreshTree()}),r.dismiss()})},t.copy=function(e,o){var r=TYPO3.settings.ajaxUrls.contextmenu_clipboard+"&CB[el]["+e+"%7C"+o+"]=1&CB[setCopyMode]=1";n.ajax(r).always(function(){t.triggerRefresh(i.ContentContainer.get().location.href)})},t.clipboardRelease=function(e,o){var r=TYPO3.settings.ajaxUrls.contextmenu_clipboard+"&CB[el]["+e+"%7C"+o+"]=0";n.ajax(r).always(function(){t.triggerRefresh(i.ContentContainer.get().location.href)})},t.cut=function(e,o){var r=TYPO3.settings.ajaxUrls.contextmenu_clipboard+"&CB[el]["+e+"%7C"+o+"]=1&CB[setCopyMode]=0";n.ajax(r).always(function(){t.triggerRefresh(i.ContentContainer.get().location.href)})},t.triggerRefresh=function(t){-1===t.indexOf("record%2Fedit")&&i.ContentContainer.refresh(!0)},t.clearCache=function(t,e){var o=top.TYPO3.settings.WebLayout.moduleUrl+"&id="+e+"&clear_cache=1";n.ajax(o)},t.pasteAfter=function(e,o){t.pasteInto.bind(n(this))(e,-o)},t.pasteInto=function(e,o){var l=n(this),s=function(){var n="&CB[paste]="+e+"%7C"+o+"&CB[pad]=normal&redirect="+t.getReturnUrl();i.ContentContainer.setUrl(top.TYPO3.settings.RecordCommit.moduleUrl+n).done(function(){"pages"===e&&i.NavigationContainer.PageTree&&i.NavigationContainer.PageTree.refreshTree()})};l.data("title")?r.confirm(l.data("title"),l.data("message"),a.warning,[{text:n(this).data("button-close-text")||TYPO3.lang["button.cancel"]||"Cancel",active:!0,btnClass:"btn-default",name:"cancel"},{text:n(this).data("button-ok-text")||TYPO3.lang["button.ok"]||"OK",btnClass:"btn-warning",name:"ok"}]).on("button.clicked",function(t){"ok"===t.target.getAttribute("name")&&s(),r.dismiss()}):s()},t}()}); \ No newline at end of file