[TASK] Use ESLint as base for linting 84/61784/8
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Mon, 23 Sep 2019 14:20:44 +0000 (16:20 +0200)
committerFrank Nägler <frank.naegler@typo3.org>
Wed, 25 Sep 2019 07:50:11 +0000 (09:50 +0200)
TSLint is in a deprecation phase, recommending to migrate to ESLint
instead. This patch removes all TSLint packages and supplies a proper
ESLint configuration.

Also, rule violations are fixed in this patch.

Executed commands:

  yarn add --dev typescript-eslint \
    @typescript-eslint/parser \
    @typescript-eslint/eslint-plugin \
    eslint grunt-eslint

  yarn remove tslint grunt-tslint

  ./node_modules/.bin/eslint -c eslintrc.js --fix --ext .ts \
    ./Sources/TypeScript/

Resolves: #89232
Releases: master
Change-Id: I3bd4a1c30ecc27f8c334951547aff5e9352629da
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/61784
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Frank Nägler <frank.naegler@typo3.org>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Frank Nägler <frank.naegler@typo3.org>
66 files changed:
Build/Gruntfile.js
Build/Sources/TypeScript/adminpanel/Resources/Public/TypeScript/AdminPanel.ts
Build/Sources/TypeScript/backend/Resources/Public/TypeScript/ActionButton/ImmediateAction.ts
Build/Sources/TypeScript/backend/Resources/Public/TypeScript/ContextMenuActions.ts
Build/Sources/TypeScript/backend/Resources/Public/TypeScript/DocumentSaveActions.ts
Build/Sources/TypeScript/backend/Resources/Public/TypeScript/DragUploader.ts
Build/Sources/TypeScript/backend/Resources/Public/TypeScript/FormEngine/Container/InlineControlContainer.ts
Build/Sources/TypeScript/backend/Resources/Public/TypeScript/FormEngine/Element/AbstractSortableSelectItems.ts
Build/Sources/TypeScript/backend/Resources/Public/TypeScript/FormEngine/Element/Extra/SelectBoxFilter.ts
Build/Sources/TypeScript/backend/Resources/Public/TypeScript/FormEngine/Element/SlugElement.ts
Build/Sources/TypeScript/backend/Resources/Public/TypeScript/FormEngine/InlineRelation/AjaxDispatcher.ts
Build/Sources/TypeScript/backend/Resources/Public/TypeScript/FormEngineFlexForm.ts
Build/Sources/TypeScript/backend/Resources/Public/TypeScript/GridEditor.ts
Build/Sources/TypeScript/backend/Resources/Public/TypeScript/Icons.ts
Build/Sources/TypeScript/backend/Resources/Public/TypeScript/ImageManipulation.ts
Build/Sources/TypeScript/backend/Resources/Public/TypeScript/LayoutModule/DragDrop.ts
Build/Sources/TypeScript/backend/Resources/Public/TypeScript/Localization.ts
Build/Sources/TypeScript/backend/Resources/Public/TypeScript/Login.ts
Build/Sources/TypeScript/backend/Resources/Public/TypeScript/LoginRefresh.ts
Build/Sources/TypeScript/backend/Resources/Public/TypeScript/Modal.ts
Build/Sources/TypeScript/backend/Resources/Public/TypeScript/ModuleMenu.ts
Build/Sources/TypeScript/backend/Resources/Public/TypeScript/Notification.ts
Build/Sources/TypeScript/backend/Resources/Public/TypeScript/OnlineMedia.ts
Build/Sources/TypeScript/backend/Resources/Public/TypeScript/PageActions.ts
Build/Sources/TypeScript/backend/Resources/Public/TypeScript/Storage/Persistent.ts
Build/Sources/TypeScript/backend/Resources/Public/TypeScript/Toolbar/ShortcutMenu.ts
Build/Sources/TypeScript/backend/Resources/Public/TypeScript/Utility.ts
Build/Sources/TypeScript/backend/Tests/BackendExceptionTest.ts
Build/Sources/TypeScript/beuser/Resources/Public/TypeScript/Permissions.ts
Build/Sources/TypeScript/extensionmanager/Resources/Public/TypeScript/Main.ts
Build/Sources/TypeScript/filelist/Resources/Public/TypeScript/ContextMenuActions.ts
Build/Sources/TypeScript/filelist/Resources/Public/TypeScript/RenameFile.ts
Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/AbstractInteractableModule.ts
Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Environment/ImageProcessing.ts
Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Maintenance/CreateAdmin.ts
Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Maintenance/ResetBackendUserUc.ts
Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Settings/ChangeInstallToolPassword.ts
Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Settings/LocalConfiguration.ts
Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Upgrade/ExtensionCompatTester.ts
Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Upgrade/ExtensionScanner.ts
Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Upgrade/UpgradeWizards.ts
Build/Sources/TypeScript/install/Resources/Public/TypeScript/Router.ts
Build/Sources/TypeScript/lowlevel/Resources/Public/TypeScript/QueryGenerator.ts
Build/Sources/TypeScript/recycler/Resources/Public/TypeScript/Recycler.ts
Build/Sources/TypeScript/scheduler/Resources/Public/TypeScript/Scheduler.ts
Build/Sources/TypeScript/tstemplate/Resources/Public/TypeScript/TypoScriptObjectBrowser.ts
Build/Sources/TypeScript/workspaces/Resources/Public/TypeScript/Backend.ts
Build/eslintrc.js [new file with mode: 0644]
Build/package.json
Build/tslint.json [deleted file]
Build/yarn.lock
typo3/sysext/adminpanel/Resources/Public/JavaScript/AdminPanel.js
typo3/sysext/backend/Resources/Public/JavaScript/ActionButton/ImmediateAction.js
typo3/sysext/backend/Resources/Public/JavaScript/ContextMenuActions.js
typo3/sysext/backend/Resources/Public/JavaScript/DragUploader.js
typo3/sysext/backend/Resources/Public/JavaScript/ImageManipulation.js
typo3/sysext/backend/Resources/Public/JavaScript/LayoutModule/DragDrop.js
typo3/sysext/extensionmanager/Resources/Public/JavaScript/Main.js
typo3/sysext/filelist/Resources/Public/JavaScript/ContextMenuActions.js
typo3/sysext/install/Resources/Public/JavaScript/Module/Environment/ImageProcessing.js
typo3/sysext/install/Resources/Public/JavaScript/Module/Maintenance/CreateAdmin.js
typo3/sysext/install/Resources/Public/JavaScript/Module/Maintenance/ResetBackendUserUc.js
typo3/sysext/install/Resources/Public/JavaScript/Module/Settings/ChangeInstallToolPassword.js
typo3/sysext/install/Resources/Public/JavaScript/Module/Upgrade/ExtensionCompatTester.js
typo3/sysext/install/Resources/Public/JavaScript/Module/Upgrade/UpgradeWizards.js
typo3/sysext/workspaces/Resources/Public/JavaScript/Backend.js

index ab3fe4d..f655a09 100644 (file)
@@ -185,10 +185,9 @@ module.exports = function (grunt) {
       ts: ((process.platform === 'win32') ? 'node_modules\\.bin\\tsc.cmd' : './node_modules/.bin/tsc') + ' --project tsconfig.json',
       'yarn-install': 'yarn install'
     },
-    tslint: {
+    eslint: {
       options: {
-        configuration: 'tslint.json',
-        force: false
+        configFile: 'eslintrc.js'
       },
       files: {
         src: [
@@ -575,7 +574,7 @@ module.exports = function (grunt) {
   grunt.loadNpmTasks('grunt-postcss');
   grunt.loadNpmTasks('grunt-contrib-copy');
   grunt.loadNpmTasks('grunt-exec');
-  grunt.loadNpmTasks('grunt-tslint');
+  grunt.loadNpmTasks('grunt-eslint');
   grunt.loadNpmTasks('grunt-stylelint');
   grunt.loadNpmTasks('grunt-lintspaces');
   grunt.loadNpmTasks('grunt-contrib-imagemin');
@@ -595,11 +594,11 @@ module.exports = function (grunt) {
    * call "$ grunt lint"
    *
    * this task does the following things:
-   * - tslint
+   * - eslint
    * - stylelint
    * - lintspaces
    */
-  grunt.registerTask('lint', ['tslint', 'stylelint', 'lintspaces']);
+  grunt.registerTask('lint', ['eslint', 'stylelint', 'lintspaces']);
 
   /**
    * grunt format
@@ -641,11 +640,11 @@ module.exports = function (grunt) {
    * call "$ grunt scripts"
    *
    * this task does the following things:
-   * - 1) Check all TypeScript files (*.ts) with TSLint which are located in sysext/<EXTKEY>/Resources/Private/TypeScript/*.ts
+   * - 1) Check all TypeScript files (*.ts) with ESLint which are located in sysext/<EXTKEY>/Resources/Private/TypeScript/*.ts
    * - 2) Compiles all TypeScript files (*.ts) which are located in sysext/<EXTKEY>/Resources/Private/TypeScript/*.ts
    * - 3) Copy all generated JavaScript and Map files to public folders
    */
-  grunt.registerTask('scripts', ['tsconfig', 'tslint', 'tsclean', 'exec:ts', 'copy:ts_files', 'terser:typescript']);
+  grunt.registerTask('scripts', ['tsconfig', 'eslint', 'tsclean', 'exec:ts', 'copy:ts_files', 'terser:typescript']);
 
   /**
    * grunt tsclean task
index 392e424..8dab859 100644 (file)
@@ -55,7 +55,7 @@ namespace TYPO3 {
         },
       );
       this.contentSettings = this.querySelectorAll(AdminPanelSelectors.contentSettingsTriggerRole).map(
-      (contentSettingTrigger: HTMLElement) => {
+        (contentSettingTrigger: HTMLElement) => {
           const contentSettingElement = contentSettingTrigger
             .closest(AdminPanelSelectors.contentParentClass)
             .querySelector(AdminPanelSelectors.contentSettingsParentClass);
@@ -193,16 +193,16 @@ namespace TYPO3 {
     private addBackdropListener(): void {
       this.querySelectorAll('.' + AdminPanelClasses.backdrop)
         .forEach((elm: HTMLElement) =>  {
-        elm.addEventListener('click', () => {
-          this.removeBackdrop();
-          this
-            .querySelectorAll(AdminPanelSelectors.moduleTriggerRole)
-            .forEach((innerElm: HTMLElement) => {
-              innerElm.closest(AdminPanelSelectors.moduleParentClass)
-                .classList.remove(AdminPanelClasses.activeModule);
-            });
+          elm.addEventListener('click', () => {
+            this.removeBackdrop();
+            this
+              .querySelectorAll(AdminPanelSelectors.moduleTriggerRole)
+              .forEach((innerElm: HTMLElement) => {
+                innerElm.closest(AdminPanelSelectors.moduleParentClass)
+                  .classList.remove(AdminPanelClasses.activeModule);
+              });
+          });
         });
-      });
     }
   }
 
@@ -338,7 +338,7 @@ namespace TYPO3 {
     }
 
     private initializeEvents(): void {
-      this.trigger.addEventListener('click', (event: MouseEvent) => {
+      this.trigger.addEventListener('click', () => {
         this.adminPanel.removeBackdrop();
         if (this.isActive()) {
           this.disable();
index 5313db6..e4a52ff 100644 (file)
@@ -19,7 +19,7 @@ import {AbstractAction} from './AbstractAction';
 class ImmediateAction extends AbstractAction {
   protected callback: () => void;
 
-  public execute(el: HTMLElement): Promise<any> {
+  public execute(): Promise<any> {
     return this.executeCallback();
   }
 
index 765bb7c..3d4b456 100644 (file)
@@ -51,11 +51,7 @@ class ContextMenuActions {
     );
   }
 
-  /**
-   * @param {string} table
-   * @param {number} uid
-   */
-  public static viewRecord(table: string, uid: number): void {
+  public static viewRecord(): void {
     const $viewUrl = $(this).data('preview-url');
     if ($viewUrl) {
       const previewWin = window.open($viewUrl, 'newTYPO3frontendWindow');
@@ -91,11 +87,7 @@ class ContextMenuActions {
     );
   }
 
-  /**
-   * @param {string} table
-   * @param {number} uid
-   */
-  public static newContentWizard(table: string, uid: number): void {
+  public static newContentWizard(): void {
     const $me = $(this);
     let $wizardUrl = $me.data('new-wizard-url');
     if ($wizardUrl) {
@@ -139,22 +131,14 @@ class ContextMenuActions {
     ModuleMenu.App.showModule('web_list', 'id=' + pageId);
   }
 
-  /**
-   * @param {string} table
-   * @param {number} uid
-   */
-  public static pagesSort(table: string, uid: number): void {
+  public static pagesSort(): 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 {
+  public static pagesNewMultiple(): void {
     const pagesSortUrl = $(this).data('pages-new-multiple-url');
     if (pagesSortUrl) {
       Viewport.ContentContainer.setUrl(pagesSortUrl);
@@ -305,7 +289,7 @@ class ContextMenuActions {
       },
       error: (): void => {
         Notification.error(
-            'Clearing page caches went wrong on the server side.',
+          'Clearing page caches went wrong on the server side.',
         );
       },
     });
index 30a4b0c..04c3ea3 100644 (file)
@@ -18,12 +18,6 @@ class DocumentSaveActions {
   private static instance: DocumentSaveActions = null;
   private preSubmitCallbacks: Array<Function> = [];
 
-  private constructor() {
-    $((): void => {
-      this.initializeSaveHandling();
-    });
-  }
-
   public static getInstance(): DocumentSaveActions {
     if (DocumentSaveActions.instance === null) {
       DocumentSaveActions.instance = new DocumentSaveActions();
@@ -32,6 +26,12 @@ class DocumentSaveActions {
     return DocumentSaveActions.instance;
   }
 
+  private constructor() {
+    $((): void => {
+      this.initializeSaveHandling();
+    });
+  }
+
   /**
    * Adds a callback being executed before submit
    *
index c672041..bd73b7c 100644 (file)
@@ -68,6 +68,12 @@ interface DragUploaderOptions {
   outputColor?: string;
 }
 
+interface FileConflict {
+  original: UploadedFile;
+  uploaded: InternalFile;
+  action: Action;
+}
+
 class DragUploaderPlugin {
   public irreObjectUid: number;
   public $fileList: JQuery;
@@ -81,17 +87,17 @@ class DragUploaderPlugin {
   /**
    * Array of files which are asked for being overridden
    */
-  private askForOverride: Array<{ original: UploadedFile, uploaded: InternalFile, action: Action }> = [];
+  private askForOverride: Array<FileConflict> = [];
 
   private percentagePerFile: number = 1;
 
   private $body: JQuery;
-  private $element: JQuery;
-  private $dropzone: JQuery;
-  private $dropzoneMask: JQuery;
-  private fileInput: HTMLInputElement;
+  private readonly $element: JQuery;
+  private readonly $dropzone: JQuery;
+  private readonly $dropzoneMask: JQuery;
+  private readonly fileInput: HTMLInputElement;
   private browserCapabilities: { fileReader: boolean; DnD: boolean; Progress: boolean };
-  private dropZoneInsertBefore: boolean;
+  private readonly dropZoneInsertBefore: boolean;
   private queueLength: number;
   private defaultAction: string;
 
@@ -256,7 +262,7 @@ class DragUploaderPlugin {
 
     // Check for each file if is already exist before adding it to the queue
     const ajaxCalls: JQueryXHR[] = [];
-    $.each(files, (i: string, file) => {
+    $.each(files, (i: string, file: InternalFile) => {
       ajaxCalls[parseInt(i, 10)] = $.ajax({
         url: TYPO3.settings.ajaxUrls.file_exists,
         data: {
@@ -274,8 +280,7 @@ class DragUploaderPlugin {
             });
             NProgress.inc(this.percentagePerFile);
           } else {
-            // Unused var _ is necessary as "no-unused-expression" is active
-            const _ = new FileQueueItem(this, file, Action.SKIP);
+            new FileQueueItem(this, file, Action.SKIP);
           }
         },
       });
@@ -320,7 +325,7 @@ class DragUploaderPlugin {
         $.ajax({
           url: TYPO3.settings.ajaxUrls.flashmessages_render,
           cache: false,
-          success: (data) => {
+          success: (data: any) => {
             $.each(data, (index: number, flashMessage: { title: string, message: string, severity: number }) => {
               Notification.showMessage(flashMessage.title, flashMessage.message, flashMessage.severity);
             });
@@ -355,8 +360,8 @@ class DragUploaderPlugin {
       const $record = $('<tr />').append(
         $('<td />').append(
           (this.askForOverride[i].original.thumbUrl !== ''
-              ? $('<img />', {src: this.askForOverride[i].original.thumbUrl, height: 40})
-              : $(this.askForOverride[i].original.icon)
+            ? $('<img />', {src: this.askForOverride[i].original.thumbUrl, height: 40})
+            : $(this.askForOverride[i].original.icon)
           ),
         ),
         $('<td />').html(
@@ -429,7 +434,7 @@ class DragUploaderPlugin {
 
       if (value !== '') {
         // mass action was selected, apply action to every file
-        $modal.find('.t3js-actions').each((i, select) => {
+        $modal.find('.t3js-actions').each((i: number, select: HTMLSelectElement) => {
           const $select = $(select),
             index = parseInt($select.data('override'), 10);
           $select.val(value).prop('disabled', 'disabled');
@@ -447,15 +452,14 @@ class DragUploaderPlugin {
         uploader.askForOverride = [];
         Modal.dismiss();
       } else if ((<HTMLInputElement>(e.target)).name === 'continue') {
-        $.each(uploader.askForOverride, (key, fileInfo) => {
+        $.each(uploader.askForOverride, (key: number, fileInfo: FileConflict) => {
           if (fileInfo.action === Action.USE_EXISTING) {
             DragUploader.addFileToIrre(
               uploader.irreObjectUid,
               fileInfo.original,
             );
           } else if (fileInfo.action !== Action.SKIP) {
-            // Unused var _ is necessary as "no-unused-expression" is active
-            const _ = new FileQueueItem(uploader, fileInfo.uploaded, fileInfo.action);
+            new FileQueueItem(uploader, fileInfo.uploaded, fileInfo.action);
           }
         });
         uploader.askForOverride = [];
@@ -740,7 +744,6 @@ class DragUploader {
       $('.t3js-drag-uploader').dragUploader(opts);
     });
   }
-
 }
 
 /**
@@ -767,7 +770,7 @@ export const initialize = function (): void {
     && 'undefined' !== typeof TYPO3.settings.RequireJS.PostInitializationModules['TYPO3/CMS/Backend/DragUploader']
   ) {
     $.each(
-      TYPO3.settings.RequireJS.PostInitializationModules['TYPO3/CMS/Backend/DragUploader'], (pos, moduleName) => {
+      TYPO3.settings.RequireJS.PostInitializationModules['TYPO3/CMS/Backend/DragUploader'], (pos: number, moduleName: string) => {
         require([moduleName]);
       },
     );
index 75a56d5..0effa32 100644 (file)
@@ -129,8 +129,8 @@ class InlineControlContainer {
   private static registerInfoButton(e: Event): void {
     let target: HTMLElement;
     if ((target = InlineControlContainer.getDelegatedEventTarget(
-        e.target,
-        Selectors.infoWindowButton)
+      e.target,
+      Selectors.infoWindowButton)
     ) === null) {
       return;
     }
@@ -186,7 +186,7 @@ class InlineControlContainer {
    * @param {UniqueDefinitionCollection} hashmap
    */
   private static getValuesFromHashMap(hashmap: UniqueDefinitionCollection): Array<any> {
-    return Object.keys(hashmap).map(key => hashmap[key]);
+    return Object.keys(hashmap).map((key: string) => hashmap[key]);
   }
 
   private static selectOptionValueExists(selectElement: HTMLSelectElement, value: string): boolean {
@@ -374,7 +374,7 @@ class InlineControlContainer {
    */
   private handlePostMessage = (e: MessageEvent): void => {
     if (!MessageUtility.verifyOrigin(e.origin)) {
-       throw 'Denied message sent by ' + e.origin;
+      throw 'Denied message sent by ' + e.origin;
     }
 
     if (typeof e.data.objectGroup === 'undefined') {
@@ -448,8 +448,8 @@ class InlineControlContainer {
   private registerEnableDisableButton(e: Event): void {
     let target: HTMLElement;
     if ((target = InlineControlContainer.getDelegatedEventTarget(
-        e.target,
-        Selectors.enableDisableRecordButtonSelector)
+      e.target,
+      Selectors.enableDisableRecordButtonSelector)
     ) === null) {
       return;
     }
@@ -492,8 +492,8 @@ class InlineControlContainer {
   private registerDeleteButton(e: Event): void {
     let target: HTMLElement;
     if ((target = InlineControlContainer.getDelegatedEventTarget(
-        e.target,
-        Selectors.deleteRecordButtonSelector)
+      e.target,
+      Selectors.deleteRecordButtonSelector)
     ) === null) {
       return;
     }
index c7be22e..60f8da7 100644 (file)
@@ -103,10 +103,10 @@ export abstract class AbstractSortableSelectItems {
       return;
     }
 
-    aside.addEventListener('click', (e): void => {
+    aside.addEventListener('click', (e: Event): void => {
       let target: HTMLAnchorElement;
 
-      if ((target = <HTMLAnchorElement>(<Element>e.target).closest('.t3js-btn-option')) === null) {
+      if ((target = (<Element>e.target).closest('.t3js-btn-option')) === null) {
         if ((<Element>e.target).matches('.t3js-btn-option')) {
           target = <HTMLAnchorElement>e.target;
         }
index 261f095..d794fc2 100644 (file)
@@ -65,7 +65,7 @@ class SelectBoxFilter {
     this.selectElement.innerHTML = '';
     const matchFilter = new RegExp(filterText, 'i');
 
-    this.$availableOptions.each((i, el): void => {
+    this.$availableOptions.each((i: number, el: HTMLElement): void => {
       if (filterText.length === 0 || el.textContent.match(matchFilter)) {
         this.selectElement.appendChild(el);
       }
index 2b8c433..f619ff5 100644 (file)
@@ -83,7 +83,7 @@ class SlugElement {
   }
 
   private registerEvents(): void {
-    const fieldsToListenOnList = Object.keys(this.getAvailableFieldsForProposalGeneration()).map(k => this.fieldsToListenOn[k]);
+    const fieldsToListenOnList = Object.keys(this.getAvailableFieldsForProposalGeneration()).map((k: string) => this.fieldsToListenOn[k]);
 
     // Listen on 'listenerFieldNames' for new pages. This is typically the 'title' field
     // of a page to create slugs from the title when title is set / changed.
@@ -97,7 +97,7 @@ class SlugElement {
       }
 
       // Clicking the recreate button makes new slug proposal created from 'title' field
-      $(this.$fullElement).on('click', Selectors.recreateButton, (e): void => {
+      $(this.$fullElement).on('click', Selectors.recreateButton, (e: JQueryEventObject): void => {
         e.preventDefault();
         if (this.$readOnlyField.hasClass('hidden')) {
           // Switch to readonly version - similar to 'new' page where field is
@@ -122,7 +122,7 @@ class SlugElement {
     // Clicking the toggle button toggles the read only field and the input field.
     // Also set the value of either the read only or the input field to the hidden field
     // and update the value of the read only field after manual change of the input field.
-    $(this.$fullElement).on('click', Selectors.toggleButton, (e): void => {
+    $(this.$fullElement).on('click', Selectors.toggleButton, (e: JQueryEventObject): void => {
       e.preventDefault();
       const showReadOnlyField = this.$readOnlyField.hasClass('hidden');
       this.$readOnlyField.toggleClass('hidden', !showReadOnlyField);
index a0e9722..d790d8a 100644 (file)
@@ -86,7 +86,7 @@ export class AjaxDispatcher {
     // TODO: This is subject to be removed
     if (json.scriptCall && json.scriptCall.length > 0) {
       $.each(json.scriptCall, (index: number, value: string): void => {
-        // tslint:disable-next-line:no-eval
+        // eslint-disable-next-line no-eval
         eval(value);
       });
     }
index 95a94cf..786dc4e 100644 (file)
@@ -111,7 +111,7 @@ class FlexFormElement {
       this.createSortable();
 
       // allow delete of a single section
-      this.$el.off('click').on('click', this.opts.deleteIconSelector, (evt) => {
+      this.$el.off('click').on('click', this.opts.deleteIconSelector, (evt: JQueryEventObject) => {
         evt.preventDefault();
 
         const confirmTitle = TYPO3.lang['flexform.section.delete.title'] || 'Are you sure?';
@@ -129,7 +129,7 @@ class FlexFormElement {
       });
 
       // allow the toggle open/close of the main selection
-      this.$el.on('click', this.opts.sectionToggleButtonSelector, (evt) => {
+      this.$el.on('click', this.opts.sectionToggleButtonSelector, (evt: JQueryEventObject) => {
         evt.preventDefault();
         const $sectionEl = $(evt.currentTarget).closest(this.opts.sectionSelector);
         this.toggleSection($sectionEl);
@@ -171,25 +171,25 @@ class FlexFormElement {
   // hides the flexform section and shows a preview text
   // or shows the form parts
   private toggleSection($sectionEl: JQuery): void {
-   const $contentEl = $sectionEl.find(this.opts.sectionContentSelector);
-
-   // display/hide the content of this flexform section
-   $contentEl.toggle();
-
-   if ($contentEl.is(':visible')) {
-     // show the open icon, and set the hidden field for toggling to "hidden"
-     $sectionEl.find(this.opts.sectionToggleIconOpenSelector).show();
-     $sectionEl.find(this.opts.sectionToggleIconCloseSelector).hide();
-     $sectionEl.find(this.opts.sectionToggleInputFieldSelector).val(0);
-   } else {
-     // show the close icon, and set the hidden field for toggling to "1"
-     $sectionEl.find(this.opts.sectionToggleIconOpenSelector).hide();
-     $sectionEl.find(this.opts.sectionToggleIconCloseSelector).show();
-     $sectionEl.find(this.opts.sectionToggleInputFieldSelector).val(1);
-   }
-
-   // see if the preview content needs to be generated
-   this.generateSectionPreview($sectionEl);
+    const $contentEl = $sectionEl.find(this.opts.sectionContentSelector);
+
+    // display/hide the content of this flexform section
+    $contentEl.toggle();
+
+    if ($contentEl.is(':visible')) {
+      // show the open icon, and set the hidden field for toggling to "hidden"
+      $sectionEl.find(this.opts.sectionToggleIconOpenSelector).show();
+      $sectionEl.find(this.opts.sectionToggleIconCloseSelector).hide();
+      $sectionEl.find(this.opts.sectionToggleInputFieldSelector).val(0);
+    } else {
+      // show the close icon, and set the hidden field for toggling to "1"
+      $sectionEl.find(this.opts.sectionToggleIconOpenSelector).hide();
+      $sectionEl.find(this.opts.sectionToggleIconCloseSelector).show();
+      $sectionEl.find(this.opts.sectionToggleInputFieldSelector).val(1);
+    }
+
+    // see if the preview content needs to be generated
+    this.generateSectionPreview($sectionEl);
   }
 
   // function to generate the section preview in the header
@@ -225,7 +225,7 @@ class FlexFormElement {
 $.fn.t3FormEngineFlexFormElement = function(options: FlexFormElementOptions): JQuery {
   // apply all util functions to ourself (for use in templates, etc.)
   return this.each(function(this: HTMLElement): void {
-    const _ = new FlexFormElement(this, options);
+    new FlexFormElement(this, options);
   });
 };
 
@@ -259,7 +259,7 @@ $(function(): void {
         $('.t3-flex-container').t3FormEngineFlexFormElement();
         if (response.scriptCall && response.scriptCall.length > 0) {
           $.each(response.scriptCall, function(index: number, value: string): void {
-            /* tslint:disable-next-line:no-eval */
+            // eslint-disable-next-line no-eval
             eval(value);
           });
         }
index 66f8e69..6515f22 100644 (file)
@@ -565,9 +565,9 @@ export class GridEditor {
               + '<br />'
               + TYPO3.lang.grid_column + ': '
               + (typeof cell.column === 'undefined' || isNaN(cell.column)
-                  ? TYPO3.lang.grid_notSet
-                  : parseInt(cell.column, 10)
-                ),
+                ? TYPO3.lang.grid_notSet
+                : parseInt(cell.column, 10)
+              ),
             ),
         );
         if (cell.colspan > 1) {
index d0a7d03..616f514 100644 (file)
@@ -55,11 +55,13 @@ class Icons {
    * @param {MarkupIdentifiers} markupIdentifier
    * @returns {JQueryPromise<any>}
    */
-  public getIcon(identifier: string,
-                 size: Sizes,
-                 overlayIdentifier?: string,
-                 state?: string,
-                 markupIdentifier?: MarkupIdentifiers): JQueryPromise<any> {
+  public getIcon(
+    identifier: string,
+    size: Sizes,
+    overlayIdentifier?: string,
+    state?: string,
+    markupIdentifier?: MarkupIdentifiers,
+  ): JQueryPromise<any> {
 
     /**
      * Icon keys:
index 13d628d..8b3e495 100644 (file)
@@ -276,7 +276,7 @@ class ImageManipulation {
         title: modalTitle,
       });
 
-      this.currentModal.on('hide.bs.modal', (e: JQueryEventObject): void => {
+      this.currentModal.on('hide.bs.modal', (): void => {
         this.destroy();
       });
       // do not dismiss the modal when clicking beside it to avoid data loss
@@ -570,98 +570,98 @@ class ImageManipulation {
     this.focusArea = $('<div id="t3js-cropper-focus-area" class="cropper-focus-area"></div>');
     container.append(this.focusArea);
     this.focusArea
-        .draggable({
-          containment: container,
-          create: (): void => {
-            this.scaleAndMoveFocusArea(this.currentCropVariant.focusArea);
-          },
-          drag: (): void => {
-            const {left, top}: Offset = container.offset();
-            const {left: fLeft, top: fTop}: Offset = this.focusArea.offset();
-            const {focusArea, coverAreas}: {focusArea?: Area, coverAreas?: Area[]} = this.currentCropVariant;
-
-            focusArea.x = (fLeft - left) / container.width();
-            focusArea.y = (fTop - top) / container.height();
-            this.updatePreviewThumbnail(this.currentCropVariant, this.activeCropVariantTrigger);
-            if (this.checkFocusAndCoverAreasCollision(focusArea, coverAreas)) {
-              this.focusArea.addClass('has-nodrop');
-            } else {
-              this.focusArea.removeClass('has-nodrop');
-            }
-          },
-          revert: (): boolean => {
-            const revertDelay = 250;
-            const {left, top}: Offset = container.offset();
-            const {left: fLeft, top: fTop}: Offset = this.focusArea.offset();
-            const {focusArea, coverAreas}: {focusArea?: Area, coverAreas?: Area[]} = this.currentCropVariant;
+      .draggable({
+        containment: container,
+        create: (): void => {
+          this.scaleAndMoveFocusArea(this.currentCropVariant.focusArea);
+        },
+        drag: (): void => {
+          const {left, top}: Offset = container.offset();
+          const {left: fLeft, top: fTop}: Offset = this.focusArea.offset();
+          const {focusArea, coverAreas}: {focusArea?: Area, coverAreas?: Area[]} = this.currentCropVariant;
+
+          focusArea.x = (fLeft - left) / container.width();
+          focusArea.y = (fTop - top) / container.height();
+          this.updatePreviewThumbnail(this.currentCropVariant, this.activeCropVariantTrigger);
+          if (this.checkFocusAndCoverAreasCollision(focusArea, coverAreas)) {
+            this.focusArea.addClass('has-nodrop');
+          } else {
+            this.focusArea.removeClass('has-nodrop');
+          }
+        },
+        revert: (): boolean => {
+          const revertDelay = 250;
+          const {left, top}: Offset = container.offset();
+          const {left: fLeft, top: fTop}: Offset = this.focusArea.offset();
+          const {focusArea, coverAreas}: {focusArea?: Area, coverAreas?: Area[]} = this.currentCropVariant;
+
+          if (this.checkFocusAndCoverAreasCollision(focusArea, coverAreas)) {
+            this.focusArea.removeClass('has-nodrop');
+            ImageManipulation.wait((): void => {
+              focusArea.x = (fLeft - left) / container.width();
+              focusArea.y = (fTop - top) / container.height();
+              this.updateCropVariantData(this.currentCropVariant);
+            },                     revertDelay);
+            return true;
+          }
+          return false;
+        },
+        revertDuration: 200,
+        stop: (): void => {
+          const {left, top}: Offset = container.offset();
+          const {left: fLeft, top: fTop}: Offset = this.focusArea.offset();
+          const {focusArea}: {focusArea?: Area} = this.currentCropVariant;
 
-            if (this.checkFocusAndCoverAreasCollision(focusArea, coverAreas)) {
-              this.focusArea.removeClass('has-nodrop');
-              ImageManipulation.wait((): void => {
-                focusArea.x = (fLeft - left) / container.width();
-                focusArea.y = (fTop - top) / container.height();
-                this.updateCropVariantData(this.currentCropVariant);
-              },                     revertDelay);
-              return true;
-            }
-            return false;
-          },
-          revertDuration: 200,
-          stop: (): void => {
-            const {left, top}: Offset = container.offset();
-            const {left: fLeft, top: fTop}: Offset = this.focusArea.offset();
-            const {focusArea}: {focusArea?: Area} = this.currentCropVariant;
+          focusArea.x = (fLeft - left) / container.width();
+          focusArea.y = (fTop - top) / container.height();
 
-            focusArea.x = (fLeft - left) / container.width();
-            focusArea.y = (fTop - top) / container.height();
+          this.scaleAndMoveFocusArea(focusArea);
+        },
+      })
+      .resizable({
+        containment: container,
+        handles: 'all',
+        resize: (): void => {
+          const {left, top}: Offset = container.offset();
+          const {left: fLeft, top: fTop}: Offset = this.focusArea.offset();
+          const {focusArea, coverAreas}: {focusArea?: Area, coverAreas?: Area[]} = this.currentCropVariant;
+
+          focusArea.height = this.focusArea.height() / container.height();
+          focusArea.width = this.focusArea.width() / container.width();
+          focusArea.x = (fLeft - left) / container.width();
+          focusArea.y = (fTop - top) / container.height();
+          this.updatePreviewThumbnail(this.currentCropVariant, this.activeCropVariantTrigger);
+
+          if (this.checkFocusAndCoverAreasCollision(focusArea, coverAreas)) {
+            this.focusArea.addClass('has-nodrop');
+          } else {
+            this.focusArea.removeClass('has-nodrop');
+          }
 
-            this.scaleAndMoveFocusArea(focusArea);
-          },
-        })
-        .resizable({
-          containment: container,
-          handles: 'all',
-          resize: (): void => {
-            const {left, top}: Offset = container.offset();
-            const {left: fLeft, top: fTop}: Offset = this.focusArea.offset();
-            const {focusArea, coverAreas}: {focusArea?: Area, coverAreas?: Area[]} = this.currentCropVariant;
-
-            focusArea.height = this.focusArea.height() / container.height();
-            focusArea.width = this.focusArea.width() / container.width();
-            focusArea.x = (fLeft - left) / container.width();
-            focusArea.y = (fTop - top) / container.height();
-            this.updatePreviewThumbnail(this.currentCropVariant, this.activeCropVariantTrigger);
-
-            if (this.checkFocusAndCoverAreasCollision(focusArea, coverAreas)) {
-              this.focusArea.addClass('has-nodrop');
-            } else {
-              this.focusArea.removeClass('has-nodrop');
-            }
+        },
+        stop: (event: any, ui: any): void => {
+          const revertDelay = 250;
+          const {left, top}: Offset = container.offset();
+          const {left: fLeft, top: fTop}: Offset = this.focusArea.offset();
+          const {focusArea, coverAreas}: {focusArea?: Area, coverAreas?: Area[]} = this.currentCropVariant;
+
+          if (this.checkFocusAndCoverAreasCollision(focusArea, coverAreas)) {
+            ui.element.animate($.extend(ui.originalPosition, ui.originalSize), revertDelay, (): void => {
+
+              focusArea.height = this.focusArea.height() / container.height();
+              focusArea.height = this.focusArea.height() / container.height();
+              focusArea.width = this.focusArea.width() / container.width();
+              focusArea.x = (fLeft - left) / container.width();
+              focusArea.y = (fTop - top) / container.height();
 
-          },
-          stop: (event: any, ui: any): void => {
-            const revertDelay = 250;
-            const {left, top}: Offset = container.offset();
-            const {left: fLeft, top: fTop}: Offset = this.focusArea.offset();
-            const {focusArea, coverAreas}: {focusArea?: Area, coverAreas?: Area[]} = this.currentCropVariant;
-
-            if (this.checkFocusAndCoverAreasCollision(focusArea, coverAreas)) {
-              ui.element.animate($.extend(ui.originalPosition, ui.originalSize), revertDelay, (): void => {
-
-                focusArea.height = this.focusArea.height() / container.height();
-                focusArea.height = this.focusArea.height() / container.height();
-                focusArea.width = this.focusArea.width() / container.width();
-                focusArea.x = (fLeft - left) / container.width();
-                focusArea.y = (fTop - top) / container.height();
-
-                this.scaleAndMoveFocusArea(focusArea);
-                this.focusArea.removeClass('has-nodrop');
-              });
-            } else {
               this.scaleAndMoveFocusArea(focusArea);
-            }
-          },
-        });
+              this.focusArea.removeClass('has-nodrop');
+            });
+          } else {
+            this.scaleAndMoveFocusArea(focusArea);
+          }
+        },
+      });
   }
 
   /**
@@ -868,11 +868,11 @@ class ImageManipulation {
       const cropData: Area = this.convertRelativeToAbsoluteCropArea(cropVariant.cropArea, imageData);
 
       const $preview: JQuery = this.trigger
-                                   .closest('.form-group')
-                                   .find(`.t3js-image-manipulation-preview[data-crop-variant-id="${cropVariantId}"]`);
+        .closest('.form-group')
+        .find(`.t3js-image-manipulation-preview[data-crop-variant-id="${cropVariantId}"]`);
       const $previewSelectedRatio: JQuery = this.trigger
-                                                .closest('.form-group')
-                                                .find(`.t3js-image-manipulation-selected-ratio[data-crop-variant-id="${cropVariantId}"]`); // tslint:disable-line:max-line-length
+        .closest('.form-group')
+        .find(`.t3js-image-manipulation-selected-ratio[data-crop-variant-id="${cropVariantId}"]`); // tslint:disable-line:max-line-length
 
       if ($preview.length === 0) {
         return;
index fb7315a..164ebaa 100644 (file)
@@ -29,10 +29,10 @@ interface Parameters {
 }
 
 interface DroppableEventUIParam {
-    draggable: JQuery;
-    helper: JQuery;
-    position: { top: number; left: number; };
-    offset: { top: number; left: number; };
+  draggable: JQuery;
+  helper: JQuery;
+  position: { top: number; left: number; };
+  offset: { top: number; left: number; };
 }
 
 class DragDrop {
@@ -60,10 +60,10 @@ class DragDrop {
       // addClasses: 'active-drag',
       revert: 'invalid',
       zIndex: 100,
-      start: (evt: JQueryEventObject, ui: DroppableEventUIParam): void => {
+      start: (evt: JQueryEventObject): void => {
         DragDrop.onDragStart($(evt.target));
       },
-      stop: (evt: JQueryEventObject, ui: DroppableEventUIParam): void => {
+      stop: (evt: JQueryEventObject): void => {
         DragDrop.onDragStop($(evt.target));
       },
     });
index c512615..6d734e6 100644 (file)
@@ -149,8 +149,8 @@ class Localization {
                               value: languageObject.uid,
                               style: 'display: none;',
                             },
+                            ),
                           ),
-                        ),
                       ),
                     );
                   }
index ae57a5d..2761584 100644 (file)
@@ -158,7 +158,7 @@ class BackendLogin {
     }
 
     (<NodeListOf<HTMLInputElement>>document.querySelectorAll('.t3js-clearable')).forEach(
-      clearableField => clearableField.clearable(),
+      (clearableField: HTMLInputElement) => clearableField.clearable(),
     );
 
     // carousel news height transition
index 6186ffb..aad40b0 100644 (file)
@@ -21,7 +21,7 @@ enum MarkupIdentifiers {
 }
 
 // hack is required, because the Notification definition is wrong
-declare var Notification: any;
+declare let Notification: any;
 
 /**
  * Module: TYPO3/CMS/Backend/LoginRefresh
@@ -396,7 +396,7 @@ class LoginRefresh {
       url: $form.attr('action'),
       method: 'POST',
       data: postData,
-      success: (response) => {
+      success: (response: { [key: string ]: any }) => {
         if (response.login.success) {
           // User is logged in
           this.hideLoginForm();
@@ -439,7 +439,7 @@ class LoginRefresh {
    * and opens a dialog.
    */
   protected checkActiveSession = (): void => {
-    $.getJSON(TYPO3.settings.ajaxUrls.login_timedout, [], (response) => {
+    $.getJSON(TYPO3.settings.ajaxUrls.login_timedout, [], (response: { [key: string ]: any }) => {
       if (response.login.locked) {
         if (!this.backendIsLocked) {
           this.backendIsLocked = true;
index 8602deb..df8da70 100644 (file)
@@ -148,11 +148,13 @@ class Modal {
    * @param {Array<string>} additionalCssClasses Additional css classes to add to the modal
    * @returns {JQuery}
    */
-  public confirm(title: string,
-                 content: string | JQuery,
-                 severity: SeverityEnum = SeverityEnum.warning,
-                 buttons: Array<Object> = [],
-                 additionalCssClasses?: Array<string>): JQuery {
+  public confirm(
+    title: string,
+    content: string | JQuery,
+    severity: SeverityEnum = SeverityEnum.warning,
+    buttons: Array<Object> = [],
+    additionalCssClasses?: Array<string>,
+  ): JQuery {
     if (buttons.length === 0) {
       buttons.push(
         {
@@ -199,12 +201,13 @@ class Modal {
    * @param {string} target
    * @returns {JQuery}
    */
-  public loadUrl(title: string,
-                 severity: SeverityEnum = SeverityEnum.info,
-                 buttons: Array<Object>,
-                 url: string,
-                 callback?: Function,
-                 target?: string,
+  public loadUrl(
+    title: string,
+    severity: SeverityEnum = SeverityEnum.info,
+    buttons: Array<Object>,
+    url: string,
+    callback?: Function,
+    target?: string,
   ): JQuery {
     return this.advanced({
       type: Types.ajax,
@@ -226,11 +229,13 @@ class Modal {
    * @param {Array<string>} additionalCssClasses
    * @returns {JQuery}
    */
-  public show(title: string,
-              content: string | JQuery,
-              severity: SeverityEnum = SeverityEnum.info,
-              buttons?: Array<Object>,
-              additionalCssClasses?: Array<string>): JQuery {
+  public show(
+    title: string,
+    content: string | JQuery,
+    severity: SeverityEnum = SeverityEnum.info,
+    buttons?: Array<Object>,
+    additionalCssClasses?: Array<string>,
+  ): JQuery {
     return this.advanced({
       type: Types.default,
       title,
index e490d06..b4efcf7 100644 (file)
@@ -251,14 +251,14 @@ class ModuleMenu {
       this.showModule($(evt.currentTarget).attr('id'), '', evt);
     });
     $(document).on('click', '.t3js-topbar-button-modulemenu', (evt: JQueryEventObject): void => {
-        evt.preventDefault();
-        ModuleMenu.toggleMenu();
-      },
+      evt.preventDefault();
+      ModuleMenu.toggleMenu();
+    },
     );
     $(document).on('click', '.t3js-scaffold-content-overlay', (evt: JQueryEventObject): void => {
-        evt.preventDefault();
-        ModuleMenu.toggleMenu(true);
-      },
+      evt.preventDefault();
+      ModuleMenu.toggleMenu(true);
+    },
     );
     $(document).on('click', '.t3js-topbar-button-navigationcomponent', (evt: JQueryEventObject): void => {
       evt.preventDefault();
index 526e127..ab913ac 100644 (file)
@@ -96,11 +96,13 @@ class Notification {
    * @param {number} duration
    * @param {Action[]} actions
    */
-  public static showMessage(title: string,
-                            message?: string,
-                            severity: SeverityEnum = SeverityEnum.info,
-                            duration: number | string = this.duration,
-                            actions: Array<Action> = []): void {
+  public static showMessage(
+    title: string,
+    message?: string,
+    severity: SeverityEnum = SeverityEnum.info,
+    duration: number | string = this.duration,
+    actions: Array<Action> = [],
+  ): void {
     const className = Severity.getCssClass(severity);
     let icon = '';
     switch (severity) {
@@ -168,7 +170,7 @@ class Notification {
           title: action.label,
         });
         $actionButton.text(action.label);
-        $actionButton.on('click', (e): void => {
+        $actionButton.on('click', (e: JQueryEventObject): void => {
           // Remove potentially set timeout
           $box.clearQueue();
 
index 6b643d2..94b8d89 100644 (file)
@@ -101,16 +101,16 @@ class OnlineMedia {
     const allowedHelpText = $currentTarget.data('online-media-allowed-help-text') || 'Allow to embed from sources:';
 
     const $markup = $('<div>')
-        .attr('class', 'form-control-wrap')
-        .append([
-          $('<input>')
-            .attr('type', 'text')
-            .attr('class', 'form-control online-media-url')
-            .attr('placeholder', placeholder),
-          $('<div>')
-            .attr('class', 'help-block')
-            .html(this.securityUtility.encodeHtml(allowedHelpText, false) + '<br>' + allowedExtMarkup.join(' ')),
-        ]);
+      .attr('class', 'form-control-wrap')
+      .append([
+        $('<input>')
+          .attr('type', 'text')
+          .attr('class', 'form-control online-media-url')
+          .attr('placeholder', placeholder),
+        $('<div>')
+          .attr('class', 'help-block')
+          .html(this.securityUtility.encodeHtml(allowedHelpText, false) + '<br>' + allowedExtMarkup.join(' ')),
+      ]);
     const $modal = Modal.show(
       $currentTarget.attr('title'),
       $markup,
index 020d9d3..b11d5fa 100644 (file)
@@ -134,7 +134,7 @@ class PageActions {
    */
   private editPageTitle(): void {
     const $inputFieldWrap = $(
-      '<form>' +
+        '<form>' +
       '<div class="form-group">' +
       '<div class="input-group input-group-lg">' +
       '<input class="form-control t3js-title-edit-input">' +
index f783e08..70c073b 100644 (file)
@@ -151,7 +151,7 @@ class Persistent {
       data: {
         action: 'getAll',
       },
-    }).done((data) => {
+    }).done((data: any) => {
       me.data = data;
     });
   }
@@ -173,7 +173,7 @@ class Persistent {
         value,
       },
       method: 'post',
-    }).done((data): any => {
+    }).done((data: any): any => {
       me.data = data;
     });
   }
index 96a1d58..1a3183a 100644 (file)
@@ -95,9 +95,9 @@ class ShortcutMenu {
         });
         $(e.currentTarget).trigger('modal-dismiss');
       })
-      .on('confirm.button.cancel', (e: JQueryEventObject): void => {
-        $(e.currentTarget).trigger('modal-dismiss');
-      });
+        .on('confirm.button.cancel', (e: JQueryEventObject): void => {
+          $(e.currentTarget).trigger('modal-dismiss');
+        });
     }
   }
 
index f898f26..4b923db 100644 (file)
@@ -23,7 +23,7 @@ class Utility {
    * @return Array<string>
    */
   public static trimExplode(delimiter: string, string: string): Array<string> {
-    return string.split(delimiter).map((item) => item.trim()).filter((item) => item !== '');
+    return string.split(delimiter).map((item: string) => item.trim()).filter((item: string) => item !== '');
   }
 
   /**
@@ -35,7 +35,10 @@ class Utility {
    * @return Array<number>
    */
   public static intExplode(delimiter: string, string: string, excludeZeroValues: boolean = false): Array<number> {
-    return string.split(delimiter).map((item) => parseInt(item, 10)).filter((item) => !isNaN(item) || excludeZeroValues && item === 0);
+    return string
+      .split(delimiter)
+      .map((item: string) => parseInt(item, 10))
+      .filter((item: number) => !isNaN(item) || excludeZeroValues && item === 0);
   }
 
   /**
index fbf607d..5cb1e93 100644 (file)
 import {BackendException} from 'TYPO3/CMS/Backend/BackendException';
 
 describe('TYPO3/CMS/Backend/BackendException', () => {
-    it('sets exception message', () => {
-        const backendException: BackendException = new BackendException('some message');
-        expect(backendException.message).toBe('some message');
-    });
+  it('sets exception message', () => {
+    const backendException: BackendException = new BackendException('some message');
+    expect(backendException.message).toBe('some message');
+  });
 
-    it('sets exception code', () => {
-        const backendException: BackendException = new BackendException('', 12345);
-        expect(backendException.code).toBe(12345);
-    });
+  it('sets exception code', () => {
+    const backendException: BackendException = new BackendException('', 12345);
+    expect(backendException.code).toBe(12345);
+  });
 });
index 738c139..b69b428 100644 (file)
@@ -235,7 +235,7 @@ class Permissions {
   /**
    * Group-related: Update the HTML view and show the original group
    */
-public restoreGroup = ($element: JQuery): void => {
+  public restoreGroup = ($element: JQuery): void => {
     let page = $element.data('page');
     let groupname = $element.data('groupname');
     let groupnameHtml = groupname;
index 443dacd..b56d549 100644 (file)
@@ -43,6 +43,70 @@ class ExtensionManager {
   public UploadForm: ExtensionManagerUploadForm;
   public Repository: ExtensionManagerRepository;
 
+  private static getUrlVars(): any {
+    let vars: any = [];
+    let hash: Array<string>;
+    let hashes: Array<string> = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
+    for (let i = 0; i < hashes.length; i++) {
+      hash = hashes[i].split('=');
+      vars.push(hash[0]);
+      vars[hash[0]] = hash[1];
+    }
+    return vars;
+  }
+
+  /**
+   * Special sorting for the extension version column
+   */
+  private static versionCompare(a: string, b: string): number {
+    if (a === b) {
+      return 0;
+    }
+
+    const a_components = a.split('.');
+    const b_components = b.split('.');
+    const len = Math.min(a_components.length, b_components.length);
+
+    // loop while the components are equal
+    for (let i = 0; i < len; i++) {
+      // A bigger than B
+      if (parseInt(a_components[i], 10) > parseInt(b_components[i], 10)) {
+        return 1;
+      }
+
+      // B bigger than A
+      if (parseInt(a_components[i], 10) < parseInt(b_components[i], 10)) {
+        return -1;
+      }
+    }
+
+    // If one's a prefix of the other, the longer one is greaRepository.
+    if (a_components.length > b_components.length) {
+      return 1;
+    }
+
+    if (a_components.length < b_components.length) {
+      return -1;
+    }
+    // Otherwise they are the same.
+    return 0;
+  }
+
+  /**
+   * The extension name column can contain various forms of HTML that
+   * break a direct comparison of values
+   */
+  private static extensionCompare(a: string, b: string): number {
+    const div = document.createElement('div');
+    div.innerHTML = a;
+    const aStr = div.textContent || div.innerText || a;
+
+    div.innerHTML = b;
+    const bStr = div.textContent || div.innerText || b;
+
+    return aStr.trim().localeCompare(bStr.trim());
+  }
+
   constructor() {
     $(() => {
       $.fn.dataTableExt.oSort['extension-asc'] = (a: string, b: string) => {
@@ -115,28 +179,28 @@ class ExtensionManager {
   private manageExtensionListing(): DataTables.Api {
     const $searchField = $(ExtensionManagerIdentifier.searchField);
     const dataTable = $(ExtensionManagerIdentifier.extensionlist).DataTable({
-        paging: false,
-        dom: 'lrtip',
-        lengthChange: false,
-        pageLength: 15,
-        stateSave: true,
-        drawCallback: this.bindExtensionListActions,
-        columns: [
-          null,
-          null,
-          {
-            type: 'extension',
-          },
-          null,
-          {
-            type: 'version',
-          }, {
-            orderable: false,
-          },
-          null,
-          null,
-        ],
-      });
+      paging: false,
+      dom: 'lrtip',
+      lengthChange: false,
+      pageLength: 15,
+      stateSave: true,
+      drawCallback: this.bindExtensionListActions,
+      columns: [
+        null,
+        null,
+        {
+          type: 'extension',
+        },
+        null,
+        {
+          type: 'version',
+        }, {
+          orderable: false,
+        },
+        null,
+        null,
+      ],
+    });
 
     $searchField.parents('form').on('submit', () => {
       return false;
@@ -203,70 +267,6 @@ class ExtensionManager {
     });
   }
 
-  private static getUrlVars(): any {
-    let vars: any = [];
-    let hash: Array<string>;
-    let hashes: Array<string> = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
-    for (let i = 0; i < hashes.length; i++) {
-      hash = hashes[i].split('=');
-      vars.push(hash[0]);
-      vars[hash[0]] = hash[1];
-    }
-    return vars;
-  }
-
-  /**
-   * Special sorting for the extension version column
-   */
-  private static versionCompare(a: string, b: string): number {
-    if (a === b) {
-      return 0;
-    }
-
-    const a_components = a.split('.');
-    const b_components = b.split('.');
-    const len = Math.min(a_components.length, b_components.length);
-
-    // loop while the components are equal
-    for (let i = 0; i < len; i++) {
-      // A bigger than B
-      if (parseInt(a_components[i], 10) > parseInt(b_components[i], 10)) {
-        return 1;
-      }
-
-      // B bigger than A
-      if (parseInt(a_components[i], 10) < parseInt(b_components[i], 10)) {
-        return -1;
-      }
-    }
-
-    // If one's a prefix of the other, the longer one is greaRepository.
-    if (a_components.length > b_components.length) {
-      return 1;
-    }
-
-    if (a_components.length < b_components.length) {
-      return -1;
-    }
-    // Otherwise they are the same.
-    return 0;
-  }
-
-  /**
-   * The extension name column can contain various forms of HTML that
-   * break a direct comparison of values
-   */
-  private static extensionCompare(a: string, b: string): number {
-    const div = document.createElement('div');
-    div.innerHTML = a;
-    const aStr = div.textContent || div.innerText || a;
-
-    div.innerHTML = b;
-    const bStr = div.textContent || div.innerText || b;
-
-    return aStr.trim().localeCompare(bStr.trim());
-  }
-
   private updateExtension(data: any): void {
     let i = 0;
     const $form = $('<form>');
@@ -285,8 +285,8 @@ class ExtensionManager {
             comment
               .replace(/(\r\n|\n\r|\r|\n)/g, '\n')
               .split(/\n/).map((line: string): string => {
-              return securityUtility.encodeHtml(line);
-            })
+                return securityUtility.encodeHtml(line);
+              })
               .join('<br>'),
           ),
       ]);
@@ -313,27 +313,27 @@ class ExtensionManager {
             Modal.dismiss();
           },
         }, {
-        text: TYPO3.lang['button.updateExtension'],
-        btnClass: 'btn-warning',
-        trigger: (): void => {
-          $.ajax({
-            url: data.url,
-            data: {
-              tx_extensionmanager_tools_extensionmanagerextensionmanager: {
-                version: $('input:radio[name=version]:checked', Modal.currentModal).val(),
+          text: TYPO3.lang['button.updateExtension'],
+          btnClass: 'btn-warning',
+          trigger: (): void => {
+            $.ajax({
+              url: data.url,
+              data: {
+                tx_extensionmanager_tools_extensionmanagerextensionmanager: {
+                  version: $('input:radio[name=version]:checked', Modal.currentModal).val(),
+                },
               },
-            },
-            dataType: 'json',
-            beforeSend: (): void => {
-              NProgress.start();
-            },
-            complete: (): void => {
-              location.reload();
-            },
-          });
-          Modal.dismiss();
+              dataType: 'json',
+              beforeSend: (): void => {
+                NProgress.start();
+              },
+              complete: (): void => {
+                location.reload();
+              },
+            });
+            Modal.dismiss();
+          },
         },
-      },
       ],
     );
   }
index 46e7192..310a73e 100644 (file)
@@ -154,12 +154,12 @@ class ContextMenuActions {
         + '&CB[pad]=normal&redirect=' + ContextMenuActions.getReturnUrl(),
       );
     };
-    if (!$anchorElement.data('title')) {
+    if (!title) {
       performPaste();
       return;
     }
     const $modal = Modal.confirm(
-      $anchorElement.data('title'),
+      title,
       $anchorElement.data('message'),
       SeverityEnum.warning, [
         {
index a731479..66bbf5b 100644 (file)
@@ -51,7 +51,7 @@ class RenameFile {
 
         if (fileExists && originalFileName !== newFileName) {
           const description: string = TYPO3.lang['file_rename.exists.description']
-                                           .replace('{0}', originalFileName).replace('{1}', newFileName);
+            .replace('{0}', originalFileName).replace('{1}', newFileName);
 
           const modal: JQuery = Modal.confirm(
             TYPO3.lang['file_rename.exists.title'],
index 79af3a4..eabf2fb 100644 (file)
  */
 
 export abstract class AbstractInteractableModule {
+  protected currentModal: JQuery;
   private readonly selectorModalBody: string = '.t3js-modal-body';
   private readonly selectorModalContent: string = '.t3js-module-content';
   private readonly selectorModalFooter: string = '.t3js-modal-footer';
-  protected currentModal: JQuery;
-
-  abstract initialize(currentModal: JQuery): void;
 
   protected getModalBody(): JQuery {
     return this.findInModal(this.selectorModalBody);
@@ -34,4 +32,6 @@ export abstract class AbstractInteractableModule {
   protected findInModal(selector: string): JQuery {
     return this.currentModal.find(selector);
   }
+
+  public abstract initialize(currentModal: JQuery): void;
 }
index 804541b..733bb43 100644 (file)
@@ -80,7 +80,7 @@ class ImageProcessing extends AbstractInteractableModule {
           if (data.success === true) {
             $container.empty();
             if (Array.isArray(data.status)) {
-              data.status.forEach((aElement: any): void => {
+              data.status.forEach((): void => {
                 const aMessage = InfoBox.render(element.severity, element.title, element.message);
                 $container.append(aMessage);
               });
index 2c1ebc8..8010aa5 100644 (file)
@@ -33,7 +33,7 @@ class CreateAdmin extends AbstractInteractableModule {
       this.create();
     });
 
-    currentModal.on('click', '.t3-install-form-password-strength', (e: JQueryEventObject): void => {
+    currentModal.on('click', '.t3-install-form-password-strength', (): void => {
       PasswordStrength.initialize('.t3-install-form-password-strength');
     });
   }
index 2b1a0ba..9f555ae 100644 (file)
@@ -38,7 +38,7 @@ class ResetBackendUserUc implements InlineModuleInterface {
           Notification.error('Something went wrong ...');
         }
       },
-      error: (xhr: XMLHttpRequest): void => {
+      error: (): void => {
         // If reset fails on server side (typically a 500), do not crash entire install tool
         // but render an error notification instead.
         Notification.error('Resetting backend user uc failed. Please check the system for missing database fields and try again.');
index f2cb5b0..76dea41 100644 (file)
@@ -32,7 +32,7 @@ class ChangeInstallToolPassword extends AbstractInteractableModule {
       e.preventDefault();
       this.change();
     });
-    currentModal.on('click', '.t3-install-form-password-strength', (e: JQueryEventObject): void => {
+    currentModal.on('click', '.t3-install-form-password-strength', (): void => {
       PasswordStrength.initialize('.t3-install-form-password-strength');
     });
   }
index ff013a9..1d84df6 100644 (file)
@@ -57,8 +57,8 @@ class LocalConfiguration extends AbstractInteractableModule {
       if (e.ctrlKey || e.metaKey) {
         // Focus search field on ctrl-f
         if (String.fromCharCode(e.which).toLowerCase() === 'f') {
-            e.preventDefault();
-            $searchInput.focus();
+          e.preventDefault();
+          $searchInput.focus();
         }
       } else if (e.keyCode === 27) {
         // Clear search on ESC key
index 0ba53ce..3b1ae6d 100644 (file)
@@ -33,7 +33,7 @@ class ExtensionCompatTester extends AbstractInteractableModule {
     this.currentModal = currentModal;
     this.getLoadedExtensionList();
 
-    currentModal.on('click', this.selectorCheckTrigger, (e: JQueryEventObject): void => {
+    currentModal.on('click', this.selectorCheckTrigger, (): void => {
       this.findInModal(this.selectorUninstallTrigger).addClass('hidden');
       this.findInModal(this.selectorOutputContainer).empty();
       this.getLoadedExtensionList();
index e0200bd..6f2d6cc 100644 (file)
@@ -182,7 +182,7 @@ class ExtensionScanner extends AbstractInteractableModule {
    * Helper method removing duplicate entries from an array
    */
   private uniqueArray(anArray: Array<any>): Array<any> {
-    return anArray.filter((value, index, self): boolean => {
+    return anArray.filter((value: any, index: number, self: any): boolean => {
       return self.indexOf(value) === index;
     });
   }
@@ -323,20 +323,20 @@ class ExtensionScanner extends AbstractInteractableModule {
                   Notification.error('Oops, an error occurred', 'Please look at the console output for details');
                   console.error(xhr);
                 },
-                });
               });
-            } else {
-              Notification.warning('No files found', 'The extension EXT:' + extension + ' contains no files we can scan');
-            }
+            });
           } else {
-            Notification.error('Oops, an error occurred', 'Please look at the console output for details');
-            console.error(data);
+            Notification.warning('No files found', 'The extension EXT:' + extension + ' contains no files we can scan');
           }
-        },
-        error: (xhr: XMLHttpRequest): void => {
-          Router.handleAjaxError(xhr, modalContent);
-        },
+        } else {
+          Notification.error('Oops, an error occurred', 'Please look at the console output for details');
+          console.error(data);
+        }
+      },
+      error: (xhr: XMLHttpRequest): void => {
+        Router.handleAjaxError(xhr, modalContent);
       },
+    },
     );
   }
 }
index dfe3d04..27664cf 100644 (file)
@@ -50,11 +50,6 @@ class UpgradeWizards extends AbstractInteractableModule {
   private selectorWizardsInputPerform: string = '.t3js-upgradeWizards-input-perform';
   private securityUtility: SecurityUtility;
 
-  constructor() {
-    super();
-    this.securityUtility = new SecurityUtility();
-  }
-
   private static removeLoadingMessage($container: JQuery): void {
     $container.find('.alert-loading').remove();
   }
@@ -63,6 +58,11 @@ class UpgradeWizards extends AbstractInteractableModule {
     return ProgressBar.render(Severity.loading, title, '');
   }
 
+  constructor() {
+    super();
+    this.securityUtility = new SecurityUtility();
+  }
+
   public initialize(currentModal: JQuery): void {
     this.currentModal = currentModal;
 
@@ -76,12 +76,12 @@ class UpgradeWizards extends AbstractInteractableModule {
     });
 
     // Execute "fix default mysql connection db charset" blocking wizard
-    currentModal.on('click', this.selectorWizardsBlockingCharsetFix, (e: JQueryEventObject): void => {
+    currentModal.on('click', this.selectorWizardsBlockingCharsetFix, (): void => {
       this.blockingUpgradesDatabaseCharsetFix();
     });
 
     // Execute "add required fields + tables" blocking wizard
-    currentModal.on('click', this.selectorWizardsBlockingAddsExecute, (e: JQueryEventObject): void => {
+    currentModal.on('click', this.selectorWizardsBlockingAddsExecute, (): void => {
       this.blockingUpgradesDatabaseAddsExecute();
     });
 
index 87b17a2..10339a5 100644 (file)
@@ -111,14 +111,14 @@ class Router {
     $.ajax({
       url: this.getUrl('executeSilentConfigurationUpdate', 'layout'),
       cache: false,
-      success: (data): void => {
+      success: (data: { [key: string]: any }): void => {
         if (data.success === true) {
           this.executeSilentExtensionConfigurationSynchronization();
         } else {
           this.executeSilentConfigurationUpdate();
         }
       },
-      error: (xhr): void => {
+      error: (xhr: JQueryXHR): void => {
         this.handleAjaxError(xhr);
       },
     });
@@ -134,7 +134,7 @@ class Router {
     $.ajax({
       url: this.getUrl('executeSilentExtensionConfigurationSynchronization', 'layout'),
       cache: false,
-      success: (data): void => {
+      success: (data: { [key: string]: any }): void => {
         if (data.success === true) {
           this.loadMainLayout();
         } else {
@@ -142,7 +142,7 @@ class Router {
           $outputContainer.empty().append(message);
         }
       },
-      error: (xhr): void => {
+      error: (xhr: JQueryXHR): void => {
         this.handleAjaxError(xhr);
       },
     });
@@ -154,7 +154,7 @@ class Router {
     $.ajax({
       url: this.getUrl('mainLayout', 'layout'),
       cache: false,
-      success: (data): void => {
+      success: (data: { [key: string]: any }): void => {
         if (data.success === true && data.html !== 'undefined' && data.html.length > 0) {
           $outputContainer.empty().append(data.html);
           // Mark main module as active in standalone
@@ -168,7 +168,7 @@ class Router {
           $outputContainer.empty().append(message);
         }
       },
-      error: (xhr): void => {
+      error: (xhr: JQueryXHR): void => {
         this.handleAjaxError(xhr);
       },
     });
@@ -237,14 +237,14 @@ class Router {
     $.ajax({
       url: this.getUrl('checkEnableInstallToolFile'),
       cache: false,
-      success: (data): void => {
+      success: (data: { [key: string]: any }): void => {
         if (data.success === true) {
           this.checkLogin();
         } else {
           this.showEnableInstallTool();
         }
       },
-      error: (xhr): void => {
+      error: (xhr: JQueryXHR): void => {
         this.handleAjaxError(xhr);
       },
     });
@@ -254,12 +254,12 @@ class Router {
     $.ajax({
       url: this.getUrl('showEnableInstallToolFile'),
       cache: false,
-      success: (data): void => {
+      success: (data: { [key: string]: any }): void => {
         if (data.success === true) {
           $(this.selectorBody).empty().append(data.html);
         }
       },
-      error: (xhr): void => {
+      error: (xhr: JQueryXHR): void => {
         this.handleAjaxError(xhr);
       },
     });
@@ -269,14 +269,14 @@ class Router {
     $.ajax({
       url: this.getUrl('checkLogin'),
       cache: false,
-      success: (data): void => {
+      success: (data: { [key: string]: any }): void => {
         if (data.success === true) {
           this.loadMainLayout();
         } else {
           this.showLogin();
         }
       },
-      error: (xhr): void => {
+      error: (xhr: JQueryXHR): void => {
         this.handleAjaxError(xhr);
       },
     });
@@ -286,12 +286,12 @@ class Router {
     $.ajax({
       url: this.getUrl('showLogin'),
       cache: false,
-      success: (data): void => {
+      success: (data: { [key: string]: any }): void => {
         if (data.success === true) {
           $(this.selectorBody).empty().append(data.html);
         }
       },
-      error: (xhr): void => {
+      error: (xhr: JQueryXHR): void => {
         this.handleAjaxError(xhr);
       },
     });
@@ -312,7 +312,7 @@ class Router {
           'password': $('.t3-install-form-input-text').val(),
         },
       },
-      success: (data): void => {
+      success: (data: { [key: string]: any }): void => {
         if (data.success === true) {
           this.executeSilentConfigurationUpdate();
         } else {
@@ -322,7 +322,7 @@ class Router {
           });
         }
       },
-      error: (xhr): void => {
+      error: (xhr: JQueryXHR): void => {
         this.handleAjaxError(xhr);
       },
     });
@@ -332,12 +332,12 @@ class Router {
     $.ajax({
       url: this.getUrl('logout'),
       cache: false,
-      success: (data): void => {
+      success: (data: { [key: string]: any }): void => {
         if (data.success === true) {
           this.showEnableInstallTool();
         }
       },
-      error: (xhr): void => {
+      error: (xhr: JQueryXHR): void => {
         this.handleAjaxError(xhr);
       },
     });
@@ -348,7 +348,7 @@ class Router {
     $.ajax({
       url: this.getUrl('cards'),
       cache: false,
-      success: (data): void => {
+      success: (data: { [key: string]: any }): void => {
         if (data.success === true && data.html !== 'undefined' && data.html.length > 0) {
           outputContainer.empty().append(data.html);
         } else {
@@ -356,7 +356,7 @@ class Router {
           outputContainer.empty().append(message);
         }
       },
-      error: (xhr): void => {
+      error: (xhr: JQueryXHR): void => {
         this.handleAjaxError(xhr);
       },
     });
index 10337eb..f37ffe7 100644 (file)
@@ -51,7 +51,7 @@ class QueryGenerator {
       this.addValueToField($field.data('field'), $field.val());
     });
     (<NodeListOf<HTMLInputElement>>document.querySelectorAll('form[name="queryform"] .t3js-clearable')).forEach(
-      clearableField => clearableField.clearable({
+      (clearableField: HTMLInputElement) => clearableField.clearable({
         onClear: (): void => {
           this.doSubmit();
         },
index 7143a01..6d4494f 100644 (file)
@@ -299,7 +299,7 @@ class Recycler {
       success: (data: any) => {
         const tables: Array<JQuery> = [];
         this.elements.$tableSelector.children().remove();
-        $.each(data, (_, value) => {
+        $.each(data, (_: number, value: Array<string>) => {
           const tableName = value[0];
           const deletedRecords = value[1];
           const tableDescription = value[2] ? value[2] : TYPO3.lang.label_allrecordtypes;
index d46a3b7..2e24d74 100644 (file)
@@ -18,7 +18,7 @@ import DocumentSaveActions = require('TYPO3/CMS/Backend/DocumentSaveActions');
 interface TableNumberMapping {
   [s: string]: number;
 }
-declare var defaultNumberOfDays: TableNumberMapping;
+declare let defaultNumberOfDays: TableNumberMapping;
 
 /**
  * Module: TYPO3/CMS/Scheduler/Scheduler
index d6baf41..3f14702 100644 (file)
  * The TYPO3 project - inspiring people to share!
  */
 
-import {SeverityEnum} from 'TYPO3/CMS/Backend/Enum/Severity';
-import 'twbs/bootstrap-slider';
+import * as $ from 'jquery';
 import 'nprogress';
+import 'twbs/bootstrap-slider';
+import {SeverityEnum} from 'TYPO3/CMS/Backend/Enum/Severity';
 import 'TYPO3/CMS/Backend/Input/Clearable';
-import * as $ from 'jquery';
+import Workspaces from './Workspaces';
 import Modal = require('TYPO3/CMS/Backend/Modal');
 import Persistent = require('TYPO3/CMS/Backend/Storage/Persistent');
-import SecurityUtility = require('TYPO3/CMS/Core/SecurityUtility');
 import Tooltip = require('TYPO3/CMS/Backend/Tooltip');
 import Utility = require('TYPO3/CMS/Backend/Utility');
 import Viewport = require('TYPO3/CMS/Backend/Viewport');
 import Wizard = require('TYPO3/CMS/Backend/Wizard');
-import Workspaces from './Workspaces';
+import SecurityUtility = require('TYPO3/CMS/Core/SecurityUtility');
 
 enum Identifiers {
   searchForm = '#workspace-settings-form',
@@ -43,7 +43,7 @@ enum Identifiers {
 
 class Backend extends Workspaces {
   private elements: { [key: string]: JQuery } = {};
-  private settings: { [key: string]: string|number } = {
+  private settings: { [key: string]: string | number } = {
     dir: 'ASC',
     id: TYPO3.settings.Workspaces.id,
     language: TYPO3.settings.Workspaces.language,
@@ -284,13 +284,13 @@ class Backend extends Workspaces {
         }
 
         window.location.href = newUrl;
-    }).on('click', '[data-action="version"]', (e: JQueryEventObject): void => {
-      const row = <HTMLTableRowElement>e.currentTarget.closest('tr');
-      const recordUid = row.dataset.table === 'pages' ? row.dataset.t3ver_oid : row.dataset.pid;
-      window.location.href = top.TYPO3.configuration.pageModuleUrl
+      }).on('click', '[data-action="version"]', (e: JQueryEventObject): void => {
+        const row = <HTMLTableRowElement>e.currentTarget.closest('tr');
+        const recordUid = row.dataset.table === 'pages' ? row.dataset.t3ver_oid : row.dataset.pid;
+        window.location.href = top.TYPO3.configuration.pageModuleUrl
         + '&id=' + recordUid
         + '&returnUrl=' + encodeURIComponent(window.location.href);
-    }).on('click', '[data-action="remove"]', this.confirmDeleteRecordFromWorkspace)
+      }).on('click', '[data-action="remove"]', this.confirmDeleteRecordFromWorkspace)
       .on('click', '[data-action="expand"]', (e: JQueryEventObject): void => {
         const $me = $(e.currentTarget);
         const $target = this.elements.$tableBody.find($me.data('target'));
@@ -303,7 +303,7 @@ class Backend extends Workspaces {
         }
 
         $me.empty().append(this.getPreRenderedIcon(iconIdentifier));
-    });
+      });
     $(window.top.document).on('click', '.t3js-workspace-recipients-selectall', (e: JQueryEventObject): void => {
       e.preventDefault();
       $('.t3js-workspace-recipient', window.top.document).not(':disabled').prop('checked', true);
@@ -595,7 +595,7 @@ class Backend extends Workspaces {
           item.allowedAction_view,
           'preview',
           'actions-version-workspace-preview',
-          ).attr('title', TYPO3.lang['tooltip.viewElementAction']),
+        ).attr('title', TYPO3.lang['tooltip.viewElementAction']),
         this.getAction(
           item.allowedAction_edit,
           'open',
@@ -605,7 +605,7 @@ class Backend extends Workspaces {
           true,
           'version',
           'actions-version-page-open',
-          ).attr('title', TYPO3.lang['tooltip.openPage']),
+        ).attr('title', TYPO3.lang['tooltip.openPage']),
         this.getAction(
           item.allowedAction_delete,
           'remove',
@@ -904,7 +904,7 @@ class Backend extends Workspaces {
         $tr.data('table'), $tr.data('uid'),
       ]),
     ).done((response: any): void => {
-      // tslint:disable-next-line:no-eval
+      // eslint-disable-next-line no-eval
       eval(response[0].result);
     });
   }
@@ -1146,7 +1146,7 @@ class Backend extends Workspaces {
    * @param {Event} e
    */
   private sendToSpecificStageAction = (e: JQueryEventObject): void => {
-    const affectedRecords: Array<{ [key: string]: number|string }> = [];
+    const affectedRecords: Array<{ [key: string]: number | string }> = [];
     const stage = $(e.currentTarget).val();
     for (let i = 0; i < this.markedRecordsForMassAction.length; ++i) {
       const affected = this.markedRecordsForMassAction[i].split(':');
diff --git a/Build/eslintrc.js b/Build/eslintrc.js
new file mode 100644 (file)
index 0000000..ec8d402
--- /dev/null
@@ -0,0 +1,67 @@
+module.exports = {
+  "env": {
+    "browser": true,
+    "es6": true
+  },
+  "parser": "@typescript-eslint/parser",
+  "parserOptions": {
+    "project": "tsconfig.json",
+    "sourceType": "module"
+  },
+  "plugins": [
+    "@typescript-eslint"
+  ],
+  "rules": {
+    "@typescript-eslint/class-name-casing": "error",
+    "@typescript-eslint/indent": ["error", 2],
+    "@typescript-eslint/interface-name-prefix": "off",
+    "@typescript-eslint/member-ordering": ["error", {
+      "default": [
+        "public-field",
+        "protected-field",
+        "private-field",
+        'public-static-method',
+        'protected-static-method',
+        'private-static-method',
+        "constructor",
+        "public-instance-method",
+        "protected-instance-method",
+        "private-instance-method"
+      ]
+    }],
+    "@typescript-eslint/no-explicit-any": "off",
+    "@typescript-eslint/no-require-imports": "off",
+    "@typescript-eslint/no-unused-vars": ["error", {
+      vars: "all",
+      args: "none",
+      ignoreRestSiblings: false
+    }],
+    "@typescript-eslint/no-var-requires": "off",
+    "@typescript-eslint/quotes": ["error", "single"],
+    "@typescript-eslint/type-annotation-spacing": "error",
+    "@typescript-eslint/typedef": ["error", {
+        parameter: true,
+        propertyDeclaration: true,
+        memberVariableDeclaration: false
+    }],
+    "curly": "error",
+    "default-case": "error",
+    "dot-notation": "error",
+    "eol-last": "error",
+    "guard-for-in": "error",
+    "no-bitwise": "off",
+    "no-caller": "error",
+    "no-debugger": "error",
+    "no-empty": "error",
+    "no-empty-function": "error",
+    "no-eval": "error",
+    "no-fallthrough": "error",
+    "no-new-wrappers": "error",
+    "no-unused-labels": "error",
+    "no-unused-vars": "off",
+    "no-var": "error",
+    "quotes": "off",
+    "radix": "error",
+    "semi": "off"
+  }
+};
index ba41628..4bbb3de 100644 (file)
@@ -24,6 +24,9 @@
     "@types/jqueryui": "^1.11.34",
     "@types/nprogress": "^0.0.29",
     "@types/requirejs": "*",
+    "@typescript-eslint/eslint-plugin": "^2.3.1",
+    "@typescript-eslint/parser": "^2.3.1",
+    "@typescript-eslint/typescript-estree": "^2.3.0",
     "@typo3/icons": "^1.10.0",
     "autoprefixer": "^9.6",
     "autosize": "^3.0.21",
     "datatables": "^1.10.13",
     "devbridge-autocomplete": "^1.4.1",
     "eonasdan-bootstrap-datetimepicker": "^4.17.47",
+    "eslint": "^6.4.0",
     "font-awesome": "^4.7.0",
     "grunt": "~1.0.1",
     "grunt-contrib-copy": "^1.0.0",
     "grunt-contrib-imagemin": "^3.1",
     "grunt-contrib-watch": "~1.0.0",
+    "grunt-eslint": "^22.0.0",
     "grunt-exec": "^2.0.0",
     "grunt-lintspaces": "^0.8.5",
     "grunt-npm-install": "^0.3.1",
@@ -51,7 +56,6 @@
     "grunt-sass": "^3.1.0",
     "grunt-stylelint": "^0.11.0",
     "grunt-terser": "^0.1.0",
-    "grunt-tslint": "^5.0.1",
     "imagesloaded": "^4.1.1",
     "jasmine-core": "^3.5.0",
     "jquery": "^3.4",
@@ -78,8 +82,8 @@
     "stylefmt": "^6.0.0",
     "taboverride": "^4.0.3",
     "tagsort": "1.4.0",
-    "tslint": "^5.10.0",
-    "typescript": "~3.6.2"
+    "typescript": "~3.6.2",
+    "typescript-eslint": "^0.0.1-alpha.0"
   },
   "scripts": {
     "build-css": "./node_modules/.bin/grunt css",
diff --git a/Build/tslint.json b/Build/tslint.json
deleted file mode 100644 (file)
index 924bbc1..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-{
-       "rules": {
-               "align": [
-                       true,
-                       "parameters",
-                       "arguments",
-                       "statements"
-               ],
-               "ban": false,
-               "class-name": true,
-               "comment-format": [
-                       true,
-                       "check-space"
-               ],
-               "curly": false,
-               "eofline": true,
-               "forin": true,
-               "indent": [
-                       true,
-                       "spaces",
-                       2
-               ],
-               "interface-name": false,
-               "jsdoc-format": true,
-               "label-position": true,
-               "max-line-length": [
-                       true,
-                       140
-               ],
-               "member-ordering": [
-                       true,
-                       {
-                               "order": [
-                                       "public-static-field",
-                                       "public-instance-field",
-                                       "private-static-field",
-                                       "private-instance-field",
-                                       "public-constructor",
-                                       "protected-constructor",
-                                       "private-constructor",
-                                       "public-instance-method",
-                                       "protected-instance-method",
-                                       "private-instance-method"
-                               ]
-                       }
-               ],
-               "no-any": false,
-               "no-arg": true,
-               "no-bitwise": false,
-               "no-console": [
-                       true,
-                       "debug",
-                       "info",
-                       "time",
-                       "timeEnd",
-                       "trace"
-               ],
-               "no-construct": true,
-               "no-debugger": true,
-               "no-shadowed-variable": true,
-               "no-duplicate-variable": true,
-               "no-empty": true,
-               "no-eval": true,
-               "no-require-imports": false,
-               "no-string-literal": true,
-               "no-switch-case-fall-through": true,
-               "trailing-comma": [
-                       true, {
-                               "multiline": "always",
-                               "singleline": "never"
-                       }
-               ],
-               "no-trailing-whitespace": true,
-               "no-unused-expression": true,
-               "no-var-keyword": true,
-               "no-var-requires": false,
-               "one-line": [
-                       true,
-                       "check-open-brace",
-                       "check-catch",
-                       "check-else",
-                       "check-whitespace"
-               ],
-               "quotemark": [
-                       true,
-                       "single"
-               ],
-               "radix": true,
-               "semicolon": true,
-               "switch-default": true,
-               "triple-equals": [
-                       true,
-                       "allow-null-check"
-               ],
-               "typedef": [
-                       true,
-                       "call-signature",
-                       "parameter",
-                       "property-declaration",
-                       "member-variable-declaration"
-               ],
-               "typedef-whitespace": [
-                       true,
-                       {
-                               "call-signature": "nospace",
-                               "index-signature": "nospace",
-                               "parameter": "nospace",
-                               "property-declaration": "nospace",
-                               "variable-declaration": "nospace"
-                       }
-               ],
-               "use-strict": [
-                       false,
-                       "check-module",
-                       "check-function"
-               ],
-               "variable-name": false,
-               "whitespace": [
-                       true,
-                       "check-branch",
-                       "check-decl",
-                       "check-operator",
-                       "check-separator",
-                       "check-type"
-               ]
-       }
-}
index ab1dc43..9c4a508 100644 (file)
   dependencies:
     "@types/jquery" "*"
 
+"@types/eslint-visitor-keys@^1.0.0":
+  version "1.0.0"
+  resolved "https://registry.yarnpkg.com/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#1ee30d79544ca84d68d4b3cdb0af4f205663dd2d"
+  integrity sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag==
+
 "@types/filesystem@*":
   version "0.0.28"
   resolved "https://registry.yarnpkg.com/@types/filesystem/-/filesystem-0.0.28.tgz#3fd7735830f2c7413cb5ac45780bc45904697b0e"
   dependencies:
     "@types/jquery" "*"
 
+"@types/json-schema@^7.0.3":
+  version "7.0.3"
+  resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.3.tgz#bdfd69d61e464dcc81b25159c270d75a73c1a636"
+  integrity sha512-Il2DtDVRGDcqjDtE+rF8iqg1CArehSK84HZJCT7AMITlyXRBpuPhqGLDQMowraqqu1coEaimg4ZOqggt6L6L+A==
+
 "@types/nprogress@^0.0.29":
   version "0.0.29"
   resolved "https://registry.yarnpkg.com/@types/nprogress/-/nprogress-0.0.29.tgz#060bd510022a005f1840234030d3132fb9195471"
   resolved "https://registry.yarnpkg.com/@types/requirejs/-/requirejs-2.1.31.tgz#a24eaa0ee4f6b84feb8f521ca6550d48490b2bc6"
   integrity sha512-b2soeyuU76rMbcRJ4e0hEl0tbMhFwZeTC0VZnfuWlfGlk6BwWNsev6kFu/twKABPX29wkX84wU2o+cEJoXsiTw==
 
+"@typescript-eslint/eslint-plugin@^2.3.1":
+  version "2.3.1"
+  resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.3.1.tgz#b0b1e6b9b3f84b3e1afbdd338f4194c8ab92db21"
+  integrity sha512-VqVNEsvemviajlaWm03kVMabc6S3xCHGYuY0fReTrIIOZg+3WzB+wfw6fD3KYKerw5lYxmzogmHOZ0i7YKnuwA==
+  dependencies:
+    "@typescript-eslint/experimental-utils" "2.3.1"
+    eslint-utils "^1.4.2"
+    functional-red-black-tree "^1.0.1"
+    regexpp "^2.0.1"
+    tsutils "^3.17.1"
+
+"@typescript-eslint/experimental-utils@2.3.1":
+  version "2.3.1"
+  resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-2.3.1.tgz#92f2531d3e7c22e64a2cc10cfe89935deaf00f7c"
+  integrity sha512-FaZEj73o4h6Wd0Lg+R4pZiJGdR0ZYbJr+O2+RbQ1aZjX8bZcfkVDtD+qm74Dv77rfSKkDKE64UTziLBo9UYHQA==
+  dependencies:
+    "@types/json-schema" "^7.0.3"
+    "@typescript-eslint/typescript-estree" "2.3.1"
+    eslint-scope "^5.0.0"
+
+"@typescript-eslint/parser@^2.3.1":
+  version "2.3.1"
+  resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-2.3.1.tgz#f2b93b614d9b338825c44e75552a433e2ebf8c33"
+  integrity sha512-ZlWdzhCJ2iZnSp/VBAJ/sowFbyHycIux8t0UEH0JsKgQvfSf7949hLYFMwTXdCMeEnpP1zRTHimrR+YHzs8LIw==
+  dependencies:
+    "@types/eslint-visitor-keys" "^1.0.0"
+    "@typescript-eslint/experimental-utils" "2.3.1"
+    "@typescript-eslint/typescript-estree" "2.3.1"
+    eslint-visitor-keys "^1.1.0"
+
+"@typescript-eslint/typescript-estree@2.3.1", "@typescript-eslint/typescript-estree@^2.3.0":
+  version "2.3.1"
+  resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-2.3.1.tgz#62c64f149948473d06a129dc33b4fc76e6c051f9"
+  integrity sha512-9SFhUgFuePJBB6jlLkOPPhMkZNiDCr+S8Ft7yAkkP2c5x5bxPhG3pe/exMiQaF8IGyVMDW6Ul0q4/cZ+uF3uog==
+  dependencies:
+    glob "^7.1.4"
+    is-glob "^4.0.1"
+    lodash.unescape "4.0.1"
+    semver "^6.3.0"
+
 "@typo3/icons@^1.10.0":
   version "1.10.0"
   resolved "https://registry.yarnpkg.com/@typo3/icons/-/icons-1.10.0.tgz#f7e3d68d691ffd32ef73b18e8912a8d739eafd06"
@@ -258,6 +308,16 @@ accepts@~1.3.4:
     mime-types "~2.1.18"
     negotiator "0.6.1"
 
+acorn-jsx@^5.0.2:
+  version "5.0.2"
+  resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.0.2.tgz#84b68ea44b373c4f8686023a551f61a21b7c4a4f"
+  integrity sha512-tiNTrP1MP0QrChmD2DdupCr6HWSFeKVw5d/dHTu4Y7rkAkRhU/Dt7dphAfIUyxtHpl/eBVip5uTNSpQJHylpAw==
+
+acorn@^7.0.0:
+  version "7.1.0"
+  resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.1.0.tgz#949d36f2c292535da602283586c2477c57eb2d6c"
+  integrity sha512-kL5CuoXA/dgxlBbVrflsflzQ3PAas7RYZB52NOm/6839iVYJgKMJ3cQJD+t2i5+qFa8h3MDpEOJiS64E8JLnSQ==
+
 after@0.8.2:
   version "0.8.2"
   resolved "https://registry.yarnpkg.com/after/-/after-0.8.2.tgz#fedb394f9f0e02aa9768e702bda23b505fae7e1f"
@@ -292,7 +352,7 @@ ajv@^5.1.0, ajv@^5.3.0:
     fast-json-stable-stringify "^2.0.0"
     json-schema-traverse "^0.3.0"
 
-ajv@^6.0.1:
+ajv@^6.0.1, ajv@^6.10.0, ajv@^6.10.2:
   version "6.10.2"
   resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.2.tgz#d3cea04d6b017b2894ad69040fec8b623eb4bd52"
   integrity sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==
@@ -323,6 +383,11 @@ ansi-align@^2.0.0:
   dependencies:
     string-width "^2.0.0"
 
+ansi-escapes@^3.2.0:
+  version "3.2.0"
+  resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b"
+  integrity sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==
+
 ansi-regex@^2.0.0:
   version "2.1.1"
   resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df"
@@ -333,12 +398,17 @@ ansi-regex@^3.0.0:
   resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998"
   integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=
 
+ansi-regex@^4.1.0:
+  version "4.1.0"
+  resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997"
+  integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==
+
 ansi-styles@^2.2.1:
   version "2.2.1"
   resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe"
   integrity sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=
 
-ansi-styles@^3.1.0, ansi-styles@^3.2.1:
+ansi-styles@^3.1.0, ansi-styles@^3.2.0, ansi-styles@^3.2.1:
   version "3.2.1"
   resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d"
   integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==
@@ -520,6 +590,11 @@ assign-symbols@^1.0.0:
   resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367"
   integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=
 
+astral-regex@^1.0.0:
+  version "1.0.0"
+  resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9"
+  integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==
+
 async-foreach@^0.1.3:
   version "0.1.3"
   resolved "https://registry.yarnpkg.com/async-foreach/-/async-foreach-0.1.3.tgz#36121f845c0578172de419a97dbeb1d16ec34542"
@@ -602,15 +677,6 @@ aws4@^1.8.0:
   resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f"
   integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==
 
-babel-code-frame@^6.22.0:
-  version "6.26.0"
-  resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b"
-  integrity sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=
-  dependencies:
-    chalk "^1.1.3"
-    esutils "^2.0.2"
-    js-tokens "^3.0.2"
-
 backo2@1.0.2:
   version "1.0.2"
   resolved "https://registry.yarnpkg.com/backo2/-/backo2-1.0.2.tgz#31ab1ac8b129363463e35b3ebb69f4dfcfba7947"
@@ -966,7 +1032,7 @@ buffer@^5.2.1:
     base64-js "^1.0.2"
     ieee754 "^1.1.4"
 
-builtin-modules@^1.0.0, builtin-modules@^1.1.1:
+builtin-modules@^1.0.0:
   version "1.1.1"
   resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f"
   integrity sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=
@@ -1089,6 +1155,11 @@ callsite@1.0.0:
   resolved "https://registry.yarnpkg.com/callsite/-/callsite-1.0.0.tgz#280398e5d664bd74038b6f0905153e6e8af1bc20"
   integrity sha1-KAOY5dZkvXQDi28JBRU+borxvCA=
 
+callsites@^3.0.0:
+  version "3.1.0"
+  resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73"
+  integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==
+
 camelcase-keys@^2.0.0:
   version "2.1.0"
   resolved "https://registry.yarnpkg.com/camelcase-keys/-/camelcase-keys-2.1.0.tgz#308beeaffdf28119051efa1d932213c91b8f92e7"
@@ -1198,6 +1269,11 @@ chalk@~2.4.1:
     escape-string-regexp "^1.0.5"
     supports-color "^5.3.0"
 
+chardet@^0.7.0:
+  version "0.7.0"
+  resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e"
+  integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==
+
 chokidar@^3.0.0:
   version "3.1.1"
   resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.1.1.tgz#27e953f3950336efcc455fd03e240c7299062003"
@@ -1290,6 +1366,13 @@ cli-columns@^3.1.2:
     string-width "^2.0.0"
     strip-ansi "^3.0.1"
 
+cli-cursor@^2.1.0:
+  version "2.1.0"
+  resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5"
+  integrity sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=
+  dependencies:
+    restore-cursor "^2.0.0"
+
 cli-table3@^0.5.0, cli-table3@^0.5.1:
   version "0.5.1"
   resolved "https://registry.yarnpkg.com/cli-table3/-/cli-table3-0.5.1.tgz#0252372d94dfc40dbd8df06005f48f31f656f202"
@@ -1300,6 +1383,11 @@ cli-table3@^0.5.0, cli-table3@^0.5.1:
   optionalDependencies:
     colors "^1.1.2"
 
+cli-width@^2.0.0:
+  version "2.2.0"
+  resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639"
+  integrity sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=
+
 cliui@^2.1.0:
   version "2.1.0"
   resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1"
@@ -1467,11 +1555,6 @@ commander@2:
   resolved "https://registry.yarnpkg.com/commander/-/commander-2.12.2.tgz#0f5946c427ed9ec0d91a46bb9def53e54650e555"
   integrity sha512-BFnaq5ZOGcDN7FlrtBT4xxkgIToalIIxwjxLWVJ8bGTpe1LroqMiqQXdA7ygc7CRvaYS+9zfPGFnJqFSayx+AA==
 
-commander@^2.12.1:
-  version "2.13.0"
-  resolved "https://registry.yarnpkg.com/commander/-/commander-2.13.0.tgz#6964bca67685df7c1f1430c584f07d7597885b9c"
-  integrity sha512-MVuS359B+YzaWqjCL/c+22gfryv+mCBPHAv3zyVI2GN8EY6IRP8VwtasXn8jyyhvvq84R4ImN1OKRtcbIasjYA==
-
 commander@^2.19.0, commander@^2.9.0, commander@~2.20.0:
   version "2.20.0"
   resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.0.tgz#d58bb2b5c1ee8f87b0d340027e9e94e222c5a422"
@@ -1659,7 +1742,7 @@ cross-spawn@^5.0.1:
     shebang-command "^1.2.0"
     which "^1.2.9"
 
-cross-spawn@^6.0.0:
+cross-spawn@^6.0.0, cross-spawn@^6.0.5:
   version "6.0.5"
   resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4"
   integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==
@@ -2092,7 +2175,7 @@ debug@^3.2.6:
   dependencies:
     ms "^2.1.1"
 
-debug@^4.1.0, debug@^4.1.1:
+debug@^4.0.1, debug@^4.1.0, debug@^4.1.1:
   version "4.1.1"
   resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791"
   integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==
@@ -2296,6 +2379,13 @@ dir-glob@2.0.0:
     arrify "^1.0.1"
     path-type "^3.0.0"
 
+doctrine@^3.0.0:
+  version "3.0.0"
+  resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961"
+  integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==
+  dependencies:
+    esutils "^2.0.2"
+
 doiuse@^2.4.1:
   version "2.6.0"
   resolved "https://registry.yarnpkg.com/doiuse/-/doiuse-2.6.0.tgz#1892d10b61a9a356addbf2b614933e81f8bb3834"
@@ -2467,6 +2557,11 @@ electron-to-chromium@^1.2.7, electron-to-chromium@^1.3.247:
   resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.265.tgz#d69afa05a33e551b913a9798f072a6442f46b348"
   integrity sha512-ypHt5Nv1Abr27QvJqk3VC4YDNqsrrWYMCmpmR7BNfCpcgYEwmCDoi3uJpp6kvj/MIjpScQoZMCQzLqfMQGmOsg==
 
+emoji-regex@^7.0.1:
+  version "7.0.3"
+  resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156"
+  integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==
+
 encodeurl@~1.0.1:
   version "1.0.1"
   resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.1.tgz#79e3d58655346909fe6f0f45a5de68103b294d20"
@@ -2645,6 +2740,78 @@ escodegen@1.8.x:
   optionalDependencies:
     source-map "~0.2.0"
 
+eslint-scope@^5.0.0:
+  version "5.0.0"
+  resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.0.0.tgz#e87c8887c73e8d1ec84f1ca591645c358bfc8fb9"
+  integrity sha512-oYrhJW7S0bxAFDvWqzvMPRm6pcgcnWc4QnofCAqRTRfQC0JcwenzGglTtsLyIuuWFfkqDG9vz67cnttSd53djw==
+  dependencies:
+    esrecurse "^4.1.0"
+    estraverse "^4.1.1"
+
+eslint-utils@^1.4.2:
+  version "1.4.2"
+  resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.4.2.tgz#166a5180ef6ab7eb462f162fd0e6f2463d7309ab"
+  integrity sha512-eAZS2sEUMlIeCjBeubdj45dmBHQwPHWyBcT1VSYB7o9x9WRRqKxyUoiXlRjyAwzN7YEzHJlYg0NmzDRWx6GP4Q==
+  dependencies:
+    eslint-visitor-keys "^1.0.0"
+
+eslint-visitor-keys@^1.0.0, eslint-visitor-keys@^1.1.0:
+  version "1.1.0"
+  resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz#e2a82cea84ff246ad6fb57f9bde5b46621459ec2"
+  integrity sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A==
+
+eslint@^6.0.1, eslint@^6.4.0:
+  version "6.4.0"
+  resolved "https://registry.yarnpkg.com/eslint/-/eslint-6.4.0.tgz#5aa9227c3fbe921982b2eda94ba0d7fae858611a"
+  integrity sha512-WTVEzK3lSFoXUovDHEbkJqCVPEPwbhCq4trDktNI6ygs7aO41d4cDT0JFAT5MivzZeVLWlg7vHL+bgrQv/t3vA==
+  dependencies:
+    "@babel/code-frame" "^7.0.0"
+    ajv "^6.10.0"
+    chalk "^2.1.0"
+    cross-spawn "^6.0.5"
+    debug "^4.0.1"
+    doctrine "^3.0.0"
+    eslint-scope "^5.0.0"
+    eslint-utils "^1.4.2"
+    eslint-visitor-keys "^1.1.0"
+    espree "^6.1.1"
+    esquery "^1.0.1"
+    esutils "^2.0.2"
+    file-entry-cache "^5.0.1"
+    functional-red-black-tree "^1.0.1"
+    glob-parent "^5.0.0"
+    globals "^11.7.0"
+    ignore "^4.0.6"
+    import-fresh "^3.0.0"
+    imurmurhash "^0.1.4"
+    inquirer "^6.4.1"
+    is-glob "^4.0.0"
+    js-yaml "^3.13.1"
+    json-stable-stringify-without-jsonify "^1.0.1"
+    levn "^0.3.0"
+    lodash "^4.17.14"
+    minimatch "^3.0.4"
+    mkdirp "^0.5.1"
+    natural-compare "^1.4.0"
+    optionator "^0.8.2"
+    progress "^2.0.0"
+    regexpp "^2.0.1"
+    semver "^6.1.2"
+    strip-ansi "^5.2.0"
+    strip-json-comments "^3.0.1"
+    table "^5.2.3"
+    text-table "^0.2.0"
+    v8-compile-cache "^2.0.3"
+
+espree@^6.1.1:
+  version "6.1.1"
+  resolved "https://registry.yarnpkg.com/espree/-/espree-6.1.1.tgz#7f80e5f7257fc47db450022d723e356daeb1e5de"
+  integrity sha512-EYbr8XZUhWbYCqQRW0duU5LxzL5bETN6AjKBGy1302qqzPaCH10QbRg3Wvco79Z8x9WbiE8HYB4e75xl6qUYvQ==
+  dependencies:
+    acorn "^7.0.0"
+    acorn-jsx "^5.0.2"
+    eslint-visitor-keys "^1.1.0"
+
 esprima@2.7.x, esprima@^2.6.0, esprima@^2.7.1:
   version "2.7.3"
   resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581"
@@ -2655,11 +2822,30 @@ esprima@^4.0.0:
   resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71"
   integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==
 
+esquery@^1.0.1:
+  version "1.0.1"
+  resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.1.tgz#406c51658b1f5991a5f9b62b1dc25b00e3e5c708"
+  integrity sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==
+  dependencies:
+    estraverse "^4.0.0"
+
+esrecurse@^4.1.0:
+  version "4.2.1"
+  resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.1.tgz#007a3b9fdbc2b3bb87e4879ea19c92fdbd3942cf"
+  integrity sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==
+  dependencies:
+    estraverse "^4.1.0"
+
 estraverse@^1.9.1:
   version "1.9.3"
   resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-1.9.3.tgz#af67f2dc922582415950926091a4005d29c9bb44"
   integrity sha1-r2fy3JIlgkFZUJJgkaQAXSnJu0Q=
 
+estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1:
+  version "4.3.0"
+  resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d"
+  integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==
+
 esutils@^2.0.2:
   version "2.0.2"
   resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b"
@@ -2803,6 +2989,15 @@ extend@~3.0.2:
   resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa"
   integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==
 
+external-editor@^3.0.3:
+  version "3.1.0"
+  resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.1.0.tgz#cb03f740befae03ea4d283caed2741a83f335495"
+  integrity sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==
+  dependencies:
+    chardet "^0.7.0"
+    iconv-lite "^0.4.24"
+    tmp "^0.0.33"
+
 extglob@^0.3.1:
   version "0.3.2"
   resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1"
@@ -2893,6 +3088,13 @@ figures@^1.3.5:
     escape-string-regexp "^1.0.5"
     object-assign "^4.1.0"
 
+figures@^2.0.0:
+  version "2.0.0"
+  resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962"
+  integrity sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=
+  dependencies:
+    escape-string-regexp "^1.0.5"
+
 file-entry-cache@^2.0.0:
   version "2.0.0"
   resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-2.0.0.tgz#c392990c3e684783d838b8c84a45d8a048458361"
@@ -2901,6 +3103,13 @@ file-entry-cache@^2.0.0:
     flat-cache "^1.2.1"
     object-assign "^4.0.1"
 
+file-entry-cache@^5.0.1:
+  version "5.0.1"
+  resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-5.0.1.tgz#ca0f6efa6dd3d561333fb14515065c2fafdf439c"
+  integrity sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==
+  dependencies:
+    flat-cache "^2.0.1"
+
 file-sync-cmp@^0.1.0:
   version "0.1.1"
   resolved "https://registry.yarnpkg.com/file-sync-cmp/-/file-sync-cmp-0.1.1.tgz#a5e7a8ffbfa493b43b923bbd4ca89a53b63b612b"
@@ -3048,6 +3257,15 @@ flat-cache@^1.2.1:
     rimraf "~2.6.2"
     write "^0.2.1"
 
+flat-cache@^2.0.1:
+  version "2.0.1"
+  resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-2.0.1.tgz#5d296d6f04bda44a4630a301413bdbc2ec085ec0"
+  integrity sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==
+  dependencies:
+    flatted "^2.0.0"
+    rimraf "2.6.3"
+    write "1.0.3"
+
 flatted@^2.0.0:
   version "2.0.1"
   resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.1.tgz#69e57caa8f0eacbc281d2e2cb458d46fdb449e08"
@@ -3211,6 +3429,11 @@ function-bind@^1.1.1:
   resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d"
   integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==
 
+functional-red-black-tree@^1.0.1:
+  version "1.0.1"
+  resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327"
+  integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=
+
 gather-stream@^1.0.0:
   version "1.0.0"
   resolved "https://registry.yarnpkg.com/gather-stream/-/gather-stream-1.0.0.tgz#b33994af457a8115700d410f317733cbe7a0904b"
@@ -3413,7 +3636,7 @@ glob@^5.0.15, glob@~5.0.0:
     once "^1.3.0"
     path-is-absolute "^1.0.0"
 
-glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.1.3:
+glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.1.3, glob@^7.1.4:
   version "7.1.4"
   resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.4.tgz#aa608a2f6c577ad357e1ae5a5c26d9a8d1969255"
   integrity sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==
@@ -3468,7 +3691,7 @@ global-dirs@^0.1.0:
   dependencies:
     ini "^1.3.4"
 
-globals@^11.1.0:
+globals@^11.1.0, globals@^11.7.0:
   version "11.12.0"
   resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e"
   integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==
@@ -3635,6 +3858,14 @@ grunt-contrib-watch@~1.0.0:
     lodash "^4.0.0"
     tiny-lr "^0.2.1"
 
+grunt-eslint@^22.0.0:
+  version "22.0.0"
+  resolved "https://registry.yarnpkg.com/grunt-eslint/-/grunt-eslint-22.0.0.tgz#2ad0f15115f1826cb4e8e4a77d16357f618f6954"
+  integrity sha512-I7vIU4x/mb20fmA6TAmLx6Wzn7mfs8ZXeuk7LbP2ujKVFV7KZmJ3qXUyqe2wnD+v/74Rs5uYOZrLL8EoBmlG9Q==
+  dependencies:
+    chalk "^2.1.0"
+    eslint "^6.0.1"
+
 grunt-exec@^2.0.0:
   version "2.0.0"
   resolved "https://registry.yarnpkg.com/grunt-exec/-/grunt-exec-2.0.0.tgz#a575a620b1da4416c292c01df564c9296b80ab23"
@@ -3727,11 +3958,6 @@ grunt-terser@^0.1.0:
   dependencies:
     terser "^3.8.0"
 
-grunt-tslint@^5.0.1:
-  version "5.0.2"
-  resolved "https://registry.yarnpkg.com/grunt-tslint/-/grunt-tslint-5.0.2.tgz#cb6c1e2b6afbcef2ac583f0d8d5560de097871ce"
-  integrity sha512-a9aq8HiDtnwIZAsyGCUpwnqEVFWeof2HQIhj6incOMB/IUO7NQ7aNkzVX8Y+j3HaqyCZU31wUSFyDluqIEBKXA==
-
 grunt@~1.0.1:
   version "1.0.3"
   resolved "https://registry.yarnpkg.com/grunt/-/grunt-1.0.3.tgz#b3c99260c51d1b42835766e796527b60f7bba374"
@@ -4059,6 +4285,13 @@ iconv-lite@0.4.13:
   resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.13.tgz#1f88aba4ab0b1508e8312acc39345f36e992e2f2"
   integrity sha1-H4irpKsLFQjoMSrMOTRfNumS4vI=
 
+iconv-lite@^0.4.24:
+  version "0.4.24"
+  resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b"
+  integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==
+  dependencies:
+    safer-buffer ">= 2.1.2 < 3"
+
 iconv-lite@~0.4.13:
   version "0.4.23"
   resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.23.tgz#297871f63be507adcfbfca715d0cd0eed84e9a63"
@@ -4093,6 +4326,11 @@ ignore@^3.2.0, ignore@^3.3.5:
   resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.10.tgz#0a97fb876986e8081c631160f8f9f389157f0043"
   integrity sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==
 
+ignore@^4.0.6:
+  version "4.0.6"
+  resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc"
+  integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==
+
 imagemin-gifsicle@^6.0.1:
   version "6.0.1"
   resolved "https://registry.yarnpkg.com/imagemin-gifsicle/-/imagemin-gifsicle-6.0.1.tgz#6abad4e95566d52e5a104aba1c24b4f3b48581b3"
@@ -4147,6 +4385,14 @@ imagesloaded@^4.1.1:
   dependencies:
     ev-emitter "^1.0.0"
 
+import-fresh@^3.0.0:
+  version "3.1.0"
+  resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.1.0.tgz#6d33fa1dcef6df930fae003446f33415af905118"
+  integrity sha512-PpuksHKGt8rXfWEr9m9EHIpgyyaltBy8+eF6GJM0QCAxMgxCfucMF3mjecK2QsJr0amJW7gTqh5/wht0z2UhEQ==
+  dependencies:
+    parent-module "^1.0.0"
+    resolve-from "^4.0.0"
+
 import-lazy@^2.1.0:
   version "2.1.0"
   resolved "https://registry.yarnpkg.com/import-lazy/-/import-lazy-2.1.0.tgz#05698e3d45c88e8d7e9d92cb0584e77f096f3e43"
@@ -4240,6 +4486,25 @@ init-package-json@~1.9.4:
     validate-npm-package-license "^3.0.1"
     validate-npm-package-name "^3.0.0"
 
+inquirer@^6.4.1:
+  version "6.5.2"
+  resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.5.2.tgz#ad50942375d036d327ff528c08bd5fab089928ca"
+  integrity sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ==
+  dependencies:
+    ansi-escapes "^3.2.0"
+    chalk "^2.4.2"
+    cli-cursor "^2.1.0"
+    cli-width "^2.0.0"
+    external-editor "^3.0.3"
+    figures "^2.0.0"
+    lodash "^4.17.12"
+    mute-stream "0.0.7"
+    run-async "^2.2.0"
+    rxjs "^6.4.0"
+    string-width "^2.1.0"
+    strip-ansi "^5.1.0"
+    through "^2.3.6"
+
 into-stream@^3.1.0:
   version "3.1.0"
   resolved "https://registry.yarnpkg.com/into-stream/-/into-stream-3.1.0.tgz#96fb0a936c12babd6ff1752a17d05616abd094c6"
@@ -4567,6 +4832,11 @@ is-primitive@^2.0.0:
   resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575"
   integrity sha1-IHurkWOEmcB7Kt8kCkGochADRXU=
 
+is-promise@^2.1.0:
+  version "2.1.0"
+  resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa"
+  integrity sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=
+
 is-property@^1.0.0:
   version "1.0.2"
   resolved "https://registry.yarnpkg.com/is-property/-/is-property-1.0.2.tgz#57fe1c4e48474edd65b09911f26b1cd4095dda84"
@@ -4786,11 +5056,6 @@ js-base64@^2.1.8, js-base64@^2.1.9:
   resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.5.1.tgz#1efa39ef2c5f7980bb1784ade4a8af2de3291121"
   integrity sha512-M7kLczedRMYX4L8Mdh4MzyAMM9O5osx+4FcOQuTvr3A9F2D9S5JXheN0ewNbrvK2UatkTRhL5ejGmGSjNMiZuw==
 
-js-tokens@^3.0.2:
-  version "3.0.2"
-  resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b"
-  integrity sha1-mGbfOVECEw449/mWvOtlRDIJwls=
-
 js-tokens@^4.0.0:
   version "4.0.0"
   resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
@@ -4812,14 +5077,6 @@ js-yaml@^3.13.1, js-yaml@^3.4.3:
     argparse "^1.0.7"
     esprima "^4.0.0"
 
-js-yaml@^3.7.0:
-  version "3.10.0"
-  resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.10.0.tgz#2e78441646bd4682e963f22b6e92823c309c62dc"
-  integrity sha512-O2v52ffjLa9VeM43J4XocZE//WT9N0IiwDa3KSHH7Tu8CtH+1qM8SIZvnsTh6v+4yFy5KUY3BHUVwjpfAWsjIA==
-  dependencies:
-    argparse "^1.0.7"
-    esprima "^4.0.0"
-
 js-yaml@~3.5.2:
   version "3.5.5"
   resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.5.5.tgz#0377c38017cabc7322b0d1fbcd25a491641f2fbe"
@@ -4868,6 +5125,11 @@ json-schema@0.2.3:
   resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13"
   integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=
 
+json-stable-stringify-without-jsonify@^1.0.1:
+  version "1.0.1"
+  resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651"
+  integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=
+
 json-stringify-safe@~5.0.1:
   version "5.0.1"
   resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb"
@@ -5093,7 +5355,7 @@ ldjson-stream@^1.2.1:
     split2 "^0.2.1"
     through2 "^0.6.1"
 
-levn@~0.3.0:
+levn@^0.3.0, levn@~0.3.0:
   version "0.3.0"
   resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee"
   integrity sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=
@@ -5327,6 +5589,11 @@ lodash.clonedeep@^4.5.0, lodash.clonedeep@~4.5.0:
   resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef"
   integrity sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=
 
+lodash.unescape@4.0.1:
+  version "4.0.1"
+  resolved "https://registry.yarnpkg.com/lodash.unescape/-/lodash.unescape-4.0.1.tgz#bf2249886ce514cda112fae9218cdc065211fc9c"
+  integrity sha1-vyJJiGzlFM2hEvrpIYzcBlIR/Jw=
+
 lodash.union@~4.6.0:
   version "4.6.0"
   resolved "https://registry.yarnpkg.com/lodash.union/-/lodash.union-4.6.0.tgz#48bb5088409f16f1821666641c44dd1aaae3cd88"
@@ -5347,7 +5614,7 @@ lodash@^2.4.1:
   resolved "https://registry.yarnpkg.com/lodash/-/lodash-2.4.2.tgz#fadd834b9683073da179b3eae6d9c0d15053f73e"
   integrity sha1-+t2DS5aDBz2hebPq5tnA0VBT9z4=
 
-lodash@^4.0.0, lodash@^4.1.0, lodash@^4.17.11, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.4:
+lodash@^4.0.0, lodash@^4.1.0, lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.4:
   version "4.17.15"
   resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548"
   integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==
@@ -5816,7 +6083,7 @@ multimatch@^2.0.0:
     arrify "^1.0.0"
     minimatch "^3.0.0"
 
-mute-stream@~0.0.4:
+mute-stream@0.0.7, mute-stream@~0.0.4:
   version "0.0.7"
   resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab"
   integrity sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=
@@ -5843,6 +6110,11 @@ nanomatch@^1.2.9:
     snapdragon "^0.8.1"
     to-regex "^3.0.1"
 
+natural-compare@^1.4.0:
+  version "1.4.0"
+  resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"
+  integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=
+
 negotiator@0.6.1:
   version "0.6.1"
   resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9"
@@ -6514,6 +6786,13 @@ onecolor@^3.0.4:
   resolved "https://registry.yarnpkg.com/onecolor/-/onecolor-3.1.0.tgz#b72522270a49569ac20d244b3cd40fe157fda4d2"
   integrity sha512-YZSypViXzu3ul5LMu/m6XjJ9ol8qAy9S2VjHl5E6UlhUH1KGKWabyEJifn0Jjpw23bYDzC2ucKMPGiH5kfwSGQ==
 
+onetime@^2.0.0:
+  version "2.0.1"
+  resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4"
+  integrity sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=
+  dependencies:
+    mimic-fn "^1.0.0"
+
 opener@^1.5.1:
   version "1.5.1"
   resolved "https://registry.yarnpkg.com/opener/-/opener-1.5.1.tgz#6d2f0e77f1a0af0032aca716c2c1fbb8e7e8abed"
@@ -6532,7 +6811,7 @@ optimist@^0.6.1:
     minimist "~0.0.1"
     wordwrap "~0.0.2"
 
-optionator@^0.8.1:
+optionator@^0.8.1, optionator@^0.8.2:
   version "0.8.2"
   resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64"
   integrity sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=
@@ -6762,6 +7041,13 @@ parallel-transform@^1.1.0:
     inherits "^2.0.3"
     readable-stream "^2.1.5"
 
+parent-module@^1.0.0:
+  version "1.0.1"
+  resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2"
+  integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==
+  dependencies:
+    callsites "^3.0.0"
+
 parse-glob@^3.0.4:
   version "3.0.4"
   resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c"
@@ -6842,11 +7128,6 @@ path-key@^2.0.0, path-key@^2.0.1:
   resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40"
   integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=
 
-path-parse@^1.0.5:
-  version "1.0.5"
-  resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1"
-  integrity sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=
-
 path-parse@^1.0.6:
   version "1.0.6"
   resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c"
@@ -7102,6 +7383,11 @@ process-nextick-args@~2.0.0:
   resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa"
   integrity sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==
 
+progress@^2.0.0:
+  version "2.0.3"
+  resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8"
+  integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==
+
 promise-inflight@^1.0.1, promise-inflight@~1.0.1:
   version "1.0.1"
   resolved "https://registry.yarnpkg.com/promise-inflight/-/promise-inflight-1.0.1.tgz#98472870bf228132fcbdd868129bad12c3c029e3"
@@ -7529,6 +7815,11 @@ regex-not@^1.0.0, regex-not@^1.0.2:
     extend-shallow "^3.0.2"
     safe-regex "^1.1.0"
 
+regexpp@^2.0.1:
+  version "2.0.1"
+  resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f"
+  integrity sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==
+
 registry-auth-token@^3.0.1:
   version "3.3.2"
   resolved "https://registry.yarnpkg.com/registry-auth-token/-/registry-auth-token-3.3.2.tgz#851fd49038eecb586911115af845260eec983f20"
@@ -7704,13 +7995,6 @@ resolve@^1.10.0:
   dependencies:
     path-parse "^1.0.6"
 
-resolve@^1.3.2:
-  version "1.5.0"
-  resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.5.0.tgz#1f09acce796c9a762579f31b2c1cc4c3cddf9f36"
-  integrity sha512-hgoSGrc3pjzAPHNBg+KnFcK2HwlHTs/YrAGUr6qgTVUZmXv1UEXXl0bZNBKMA9fud6lRYFdPGz0xXxycPzmmiw==
-  dependencies:
-    path-parse "^1.0.5"
-
 responselike@1.0.2:
   version "1.0.2"
   resolved "https://registry.yarnpkg.com/responselike/-/responselike-1.0.2.tgz#918720ef3b631c5642be068f15ade5a46f4ba1e7"
@@ -7718,6 +8002,14 @@ responselike@1.0.2:
   dependencies:
     lowercase-keys "^1.0.0"
 
+restore-cursor@^2.0.0:
+  version "2.0.0"
+  resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf"
+  integrity sha1-n37ih/gv0ybU/RYpI9YhKe7g368=
+  dependencies:
+    onetime "^2.0.0"
+    signal-exit "^3.0.2"
+
 ret@~0.1.10:
   version "0.1.15"
   resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc"
@@ -7752,7 +8044,7 @@ rimraf@2, rimraf@^2.5.2, rimraf@^2.5.4, rimraf@^2.6.0, rimraf@^2.6.2, rimraf@~2.
   dependencies:
     glob "^7.0.5"
 
-rimraf@^2.6.3:
+rimraf@2.6.3, rimraf@^2.6.3:
   version "2.6.3"
   resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab"
   integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==
@@ -7766,6 +8058,13 @@ rimraf@~2.5.4:
   dependencies:
     glob "^7.0.5"
 
+run-async@^2.2.0:
+  version "2.3.0"
+  resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0"
+  integrity sha1-A3GrSuC91yDUFm19/aZP96RFpsA=
+  dependencies:
+    is-promise "^2.1.0"
+
 run-queue@^1.0.0, run-queue@^1.0.3:
   version "1.0.3"
   resolved "https://registry.yarnpkg.com/run-queue/-/run-queue-1.0.3.tgz#e848396f057d223f24386924618e25694161ec47"
@@ -7778,6 +8077,13 @@ rw@1:
   resolved "https://registry.yarnpkg.com/rw/-/rw-1.3.3.tgz#3f862dfa91ab766b14885ef4d01124bfda074fb4"
   integrity sha1-P4Yt+pGrdmsUiF700BEkv9oHT7Q=
 
+rxjs@^6.4.0:
+  version "6.5.3"
+  resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.5.3.tgz#510e26317f4db91a7eb1de77d9dd9ba0a4899a3a"
+  integrity sha512-wuYsAYYFdWTAnAaPoKGNhfpWwKZbJW+HgAJ+mImp+Epl7BG8oNWBCTyRM8gba9k4lk8BgWdoYm21Mo/RYhhbgA==
+  dependencies:
+    tslib "^1.9.0"
+
 safe-buffer@5.1.2, safe-buffer@^5.1.0, safe-buffer@^5.1.2:
   version "5.1.2"
   resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
@@ -7869,7 +8175,7 @@ semver@^5.5.1, semver@^5.6.0:
   resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.0.tgz#790a7cf6fea5459bac96110b29b60412dc8ff96b"
   integrity sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==
 
-semver@^6.0.0:
+semver@^6.0.0, semver@^6.1.2, semver@^6.3.0:
   version "6.3.0"
   resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d"
   integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==
@@ -7951,6 +8257,15 @@ slice-ansi@1.0.0:
   dependencies:
     is-fullwidth-code-point "^2.0.0"
 
+slice-ansi@^2.1.0:
+  version "2.1.0"
+  resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-2.1.0.tgz#cacd7693461a637a5788d92a7dd4fba068e81636"
+  integrity sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==
+  dependencies:
+    ansi-styles "^3.2.0"
+    astral-regex "^1.0.0"
+    is-fullwidth-code-point "^2.0.0"
+
 slide@^1.1.3, slide@^1.1.5, slide@^1.1.6, slide@~1.1.3, slide@~1.1.6:
   version "1.1.6"
   resolved "https://registry.yarnpkg.com/slide/-/slide-1.1.6.tgz#56eb027d65b4d2dce6cb2e2d32c4d4afc9e1d707"
@@ -8344,7 +8659,7 @@ string-width@^1.0.1, string-width@^1.0.2:
     is-fullwidth-code-point "^1.0.0"
     strip-ansi "^3.0.0"
 
-string-width@^2.0.0, string-width@^2.1.1:
+string-width@^2.0.0, string-width@^2.1.0, string-width@^2.1.1:
   version "2.1.1"
   resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e"
   integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==
@@ -8352,6 +8667,15 @@ string-width@^2.0.0, string-width@^2.1.1:
     is-fullwidth-code-point "^2.0.0"
     strip-ansi "^4.0.0"
 
+string-width@^3.0.0:
+  version "3.1.0"
+  resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961"
+  integrity sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==
+  dependencies:
+    emoji-regex "^7.0.1"
+    is-fullwidth-code-point "^2.0.0"
+    strip-ansi "^5.1.0"
+
 string_decoder@^1.1.1:
   version "1.2.0"
   resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.2.0.tgz#fe86e738b19544afe70469243b2a1ee9240eae8d"
@@ -8402,6 +8726,13 @@ strip-ansi@^4.0.0:
   dependencies:
     ansi-regex "^3.0.0"
 
+strip-ansi@^5.1.0, strip-ansi@^5.2.0:
+  version "5.2.0"
+  resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae"
+  integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==
+  dependencies:
+    ansi-regex "^4.1.0"
+
 strip-bom@^2.0.0:
   version "2.0.0"
   resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e"
@@ -8428,6 +8759,11 @@ strip-indent@^1.0.1:
   dependencies:
     get-stdin "^4.0.1"
 
+strip-json-comments@^3.0.1:
+  version "3.0.1"
+  resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.0.1.tgz#85713975a91fb87bf1b305cca77395e40d2a64a7"
+  integrity sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw==
+
 strip-json-comments@~2.0.1:
   version "2.0.1"
   resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a"
@@ -8625,6 +8961,16 @@ table@^4.0.1:
     slice-ansi "1.0.0"
     string-width "^2.1.1"
 
+table@^5.2.3:
+  version "5.4.6"
+  resolved "https://registry.yarnpkg.com/table/-/table-5.4.6.tgz#1292d19500ce3f86053b05f0e8e7e4a3bb21079e"
+  integrity sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==
+  dependencies:
+    ajv "^6.10.2"
+    lodash "^4.17.14"
+    slice-ansi "^2.1.0"
+    string-width "^3.0.0"
+
 taboverride@^4.0.3:
   version "4.0.3"
   resolved "https://registry.yarnpkg.com/taboverride/-/taboverride-4.0.3.tgz#33924012a2f3af5ee609c5f30e1bd26a75fbe6a9"
@@ -8720,7 +9066,7 @@ through2@^2.0.0:
     readable-stream "^2.1.5"
     xtend "~4.0.1"
 
-"through@>=2.2.7 <3", through@^2.3.8, through@~2.3.4:
+"through@>=2.2.7 <3", through@^2.3.6, through@^2.3.8, through@~2.3.4:
   version "2.3.8"
   resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5"
   integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=
@@ -8747,7 +9093,7 @@ tiny-relative-date@^1.3.0:
   resolved "https://registry.yarnpkg.com/tiny-relative-date/-/tiny-relative-date-1.3.0.tgz#fa08aad501ed730f31cc043181d995c39a935e07"
   integrity sha512-MOQHpzllWxDCHHaDno30hhLfbouoYlOI8YlMNtvKe1zXbjEVhbcEovQxvZrPvtiYW630GQDoMMarCnjfyfHA+A==
 
-tmp@0.0.33, tmp@0.0.x:
+tmp@0.0.33, tmp@0.0.x, tmp@^0.0.33:
   version "0.0.33"
   resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9"
   integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==
@@ -8840,40 +9186,17 @@ trim-right@^1.0.1:
   dependencies:
     glob "^7.1.2"
 
-tslib@^1.7.1:
-  version "1.8.0"
-  resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.8.0.tgz#dc604ebad64bcbf696d613da6c954aa0e7ea1eb6"
-  integrity sha512-ymKWWZJST0/CkgduC2qkzjMOWr4bouhuURNXCn/inEX0L57BnRG6FhX76o7FOnsjHazCjfU2LKeSrlS2sIKQJg==
-
-tslib@^1.8.0:
-  version "1.8.1"
-  resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.8.1.tgz#6946af2d1d651a7b1863b531d6e5afa41aa44eac"
-  integrity sha1-aUavLR1lGnsYY7Ux1uWvpBqkTqw=
-
-tslint@^5.10.0:
-  version "5.10.0"
-  resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.10.0.tgz#11e26bccb88afa02dd0d9956cae3d4540b5f54c3"
-  integrity sha1-EeJrzLiK+gLdDZlWyuPUVAtfVMM=
-  dependencies:
-    babel-code-frame "^6.22.0"
-    builtin-modules "^1.1.1"
-    chalk "^2.3.0"
-    commander "^2.12.1"
-    diff "^3.2.0"
-    glob "^7.1.1"
-    js-yaml "^3.7.0"
-    minimatch "^3.0.4"
-    resolve "^1.3.2"
-    semver "^5.3.0"
-    tslib "^1.8.0"
-    tsutils "^2.12.1"
+tslib@^1.8.1, tslib@^1.9.0:
+  version "1.10.0"
+  resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a"
+  integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==
 
-tsutils@^2.12.1:
-  version "2.12.2"
-  resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.12.2.tgz#ad58a4865d17ec3ddb6631b6ca53be14a5656ff3"
-  integrity sha1-rVikhl0X7D3bZjG2ylO+FKVlb/M=
+tsutils@^3.17.1:
+  version "3.17.1"
+  resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.17.1.tgz#ed719917f11ca0dee586272b2ac49e015a2dd759"
+  integrity sha512-kzeQ5B8H3w60nFY2g8cJIuH7JDpsALXySGtwGJ0p2LSjLgay3NdIpqq5SoOBe46bKDW2iq25irHCr8wjomUS2g==
   dependencies:
-    tslib "^1.7.1"
+    tslib "^1.8.1"
 
 tunnel-agent@^0.6.0:
   version "0.6.0"
@@ -8920,6 +9243,11 @@ typedarray@^0.0.6:
   resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
   integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
 
+typescript-eslint@^0.0.1-alpha.0:
+  version "0.0.1-alpha.0"
+  resolved "https://registry.yarnpkg.com/typescript-eslint/-/typescript-eslint-0.0.1-alpha.0.tgz#285d68a4e96588295cd436278801bcb6a6b916c1"
+  integrity sha512-1hNKM37dAWML/2ltRXupOq2uqcdRQyDFphl+341NTPXFLLLiDhErXx8VtaSLh3xP7SyHZdcCgpt9boYYVb3fQg==
+
 typescript@~3.6.2:
   version "3.6.2"
   resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.6.2.tgz#105b0f1934119dde543ac8eb71af3a91009efe54"
@@ -9143,6 +9471,11 @@ uuid@^3.3.2:
   resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131"
   integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==
 
+v8-compile-cache@^2.0.3:
+  version "2.1.0"
+  resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.1.0.tgz#e14de37b31a6d194f5690d67efc4e7f6fc6ab30e"
+  integrity sha512-usZBT3PW+LOjM25wbqIlZwPeJV+3OSz3M1k1Ws8snlW39dZyYL9lOGC5FgPVHfk0jKmjiDV8Z0mIbVQPiwFs7g==
+
 validate-npm-package-license@^3.0.1, validate-npm-package-license@^3.0.4:
   version "3.0.4"
   resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a"
@@ -9321,6 +9654,13 @@ write-file-stdout@0.0.2:
   resolved "https://registry.yarnpkg.com/write-file-stdout/-/write-file-stdout-0.0.2.tgz#c252d7c7c5b1b402897630e3453c7bfe690d9ca1"
   integrity sha1-wlLXx8WxtAKJdjDjRTx7/mkNnKE=
 
+write@1.0.3:
+  version "1.0.3"
+  resolved "https://registry.yarnpkg.com/write/-/write-1.0.3.tgz#0800e14523b923a387e415123c865616aae0f5c3"
+  integrity sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==
+  dependencies:
+    mkdirp "^0.5.1"
+
 write@^0.2.1:
   version "0.2.1"
   resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757"
index 1c863a7..1382cfb 100644 (file)
@@ -10,4 +10,4 @@
  *
  * The TYPO3 project - inspiring people to share!
  */
-"use strict";var TYPO3;!function(e){e.AdminPanelSelectors={adminPanelRole:"form[data-typo3-role=typo3-adminPanel]",moduleTriggerRole:"[data-typo3-role=typo3-adminPanel-module-trigger]",moduleParentClass:".typo3-adminPanel-module",contentTabRole:"[data-typo3-role=typo3-adminPanel-content-tab]",saveButtonRole:"[data-typo3-role=typo3-adminPanel-saveButton]",triggerRole:"[data-typo3-role=typo3-adminPanel-trigger]",popupTriggerRole:"[data-typo3-role=typo3-adminPanel-popup-trigger]",panelTriggerRole:"[data-typo3-role=typo3-adminPanel-panel-trigger]",panelParentClass:".typo3-adminPanel-panel",contentSettingsTriggerRole:"[data-typo3-role=typo3-adminPanel-content-settings]",contentSettingsParentClass:".typo3-adminPanel-content-settings",contentParentClass:".typo3-adminPanel-content",zoomTarget:"[data-typo3-zoom-target]",zoomClose:"[data-typo3-zoom-close]",currentContentRole:"[data-typo3-role=typo3-adminPanel-content]",contentPaneRole:"[data-typo3-role=typo3-adminPanel-content-pane]"},e.AdminPanelClasses={active:"active",activeModule:"typo3-adminPanel-module-active",activeContentSetting:"typo3-adminPanel-content-settings-active",backdrop:"typo3-adminPanel-backdrop",activeTab:"typo3-adminPanel-content-header-item-active",activePane:"typo3-adminPanel-content-panes-item-active",noScroll:"typo3-adminPanel-noscroll",zoomShow:"typo3-adminPanel-zoom-show"};e.AdminPanel=class{constructor(){this.adminPanel=document.querySelector(e.AdminPanelSelectors.adminPanelRole),this.modules=this.querySelectorAll(e.AdminPanelSelectors.moduleTriggerRole).map(t=>{const n=t.closest(e.AdminPanelSelectors.moduleParentClass);return new s(this,n,t)}),this.popups=this.querySelectorAll(e.AdminPanelSelectors.popupTriggerRole).map(e=>new t(this,e)),this.panels=this.querySelectorAll(e.AdminPanelSelectors.panelTriggerRole).map(t=>{const a=t.closest(e.AdminPanelSelectors.panelParentClass);return new n(a,t)}),this.contentSettings=this.querySelectorAll(e.AdminPanelSelectors.contentSettingsTriggerRole).map(t=>{const n=t.closest(e.AdminPanelSelectors.contentParentClass).querySelector(e.AdminPanelSelectors.contentSettingsParentClass);return new a(n,t)}),this.trigger=document.querySelector(e.AdminPanelSelectors.triggerRole),this.initializeEvents(),this.addBackdropListener()}disableModules(){this.modules.forEach(e=>e.disable())}disablePopups(){this.popups.forEach(e=>e.disable())}renderBackdrop(){const t=document.querySelector("#TSFE_ADMIN_PANEL_FORM"),n=document.createElement("div");document.querySelector("body").classList.add(e.AdminPanelClasses.noScroll),n.classList.add(e.AdminPanelClasses.backdrop),t.appendChild(n),this.addBackdropListener()}removeBackdrop(){const t=document.querySelector("."+e.AdminPanelClasses.backdrop);document.querySelector("body").classList.remove(e.AdminPanelClasses.noScroll),null!==t&&t.remove()}querySelectorAll(e,t=null){return null===t?Array.from(document.querySelectorAll(e)):Array.from(t.querySelectorAll(e))}initializeEvents(){this.querySelectorAll(e.AdminPanelSelectors.contentTabRole).forEach(e=>e.addEventListener("click",this.switchTab.bind(this))),this.querySelectorAll(e.AdminPanelSelectors.zoomTarget).forEach(e=>e.addEventListener("click",this.openZoom.bind(this))),this.querySelectorAll(e.AdminPanelSelectors.zoomClose).forEach(e=>e.addEventListener("click",this.closeZoom.bind(this))),this.querySelectorAll(e.AdminPanelSelectors.triggerRole).forEach(e=>e.addEventListener("click",this.toggleAdminPanelState.bind(this))),this.querySelectorAll(e.AdminPanelSelectors.saveButtonRole).forEach(e=>e.addEventListener("click",this.sendAdminPanelForm.bind(this))),this.querySelectorAll("[data-typo3-role=typo3-adminPanel-content-close]").forEach(e=>{e.addEventListener("click",()=>{this.disableModules(),this.removeBackdrop()})}),this.querySelectorAll(".typo3-adminPanel-table th, .typo3-adminPanel-table td").forEach(e=>{e.addEventListener("click",()=>{e.focus();try{document.execCommand("copy")}catch(e){}})})}switchTab(t){t.preventDefault();const n=e.AdminPanelClasses.activeTab,a=e.AdminPanelClasses.activePane,s=t.currentTarget,l=s.closest(e.AdminPanelSelectors.currentContentRole),i=this.querySelectorAll(e.AdminPanelSelectors.contentTabRole,l),o=this.querySelectorAll(e.AdminPanelSelectors.contentPaneRole,l);i.forEach(e=>e.classList.remove(n)),s.classList.add(n),o.forEach(e=>e.classList.remove(a)),document.querySelector("[data-typo3-tab-id="+s.dataset.typo3TabTarget+"]").classList.add(a)}openZoom(t){t.preventDefault();const n=t.currentTarget.getAttribute("data-typo3-zoom-target");document.querySelector("[data-typo3-zoom-id="+n+"]").classList.add(e.AdminPanelClasses.zoomShow)}closeZoom(t){t.preventDefault(),t.currentTarget.closest("[data-typo3-zoom-id]").classList.remove(e.AdminPanelClasses.zoomShow)}sendAdminPanelForm(e){e.preventDefault();const t=new FormData(this.adminPanel),n=new XMLHttpRequest;n.open("POST",this.adminPanel.dataset.typo3AjaxUrl),n.send(t),n.onload=(()=>location.reload())}toggleAdminPanelState(){const e=new XMLHttpRequest;e.open("GET",this.trigger.dataset.typo3AjaxUrl),e.send(),e.onload=(()=>location.reload())}addBackdropListener(){this.querySelectorAll("."+e.AdminPanelClasses.backdrop).forEach(t=>{t.addEventListener("click",()=>{this.removeBackdrop(),this.querySelectorAll(e.AdminPanelSelectors.moduleTriggerRole).forEach(t=>{t.closest(e.AdminPanelSelectors.moduleParentClass).classList.remove(e.AdminPanelClasses.activeModule)})})})}};class t{constructor(e,t){this.adminPanel=e,this.element=t,this.initializeEvents()}isActive(){return this.element.classList.contains(e.AdminPanelClasses.active)}enable(){this.element.classList.add(e.AdminPanelClasses.active)}disable(){this.element.classList.remove(e.AdminPanelClasses.active)}initializeEvents(){this.element.addEventListener("click",()=>{this.isActive()?this.disable():(this.adminPanel.disablePopups(),this.enable())})}}class n{constructor(e,t){this.element=e,this.trigger=t,this.initializeEvents()}isActive(){return this.element.classList.contains(e.AdminPanelClasses.active)}enable(){this.element.classList.add(e.AdminPanelClasses.active)}disable(){this.element.classList.remove(e.AdminPanelClasses.active)}initializeEvents(){this.trigger.addEventListener("click",()=>{this.isActive()?this.disable():this.enable()})}}class a{constructor(e,t){this.element=e,this.trigger=t,this.initializeEvents()}isActive(){return this.element.classList.contains(e.AdminPanelClasses.activeContentSetting)}enable(){this.element.classList.add(e.AdminPanelClasses.activeContentSetting)}disable(){this.element.classList.remove(e.AdminPanelClasses.activeContentSetting)}initializeEvents(){this.trigger.addEventListener("click",()=>{this.isActive()?this.disable():this.enable()})}}class s{constructor(e,t,n){this.adminPanel=e,this.element=t,this.trigger=n,this.initializeEvents()}isActive(){return this.element.classList.contains(e.AdminPanelClasses.activeModule)}enable(){this.element.classList.add(e.AdminPanelClasses.activeModule)}disable(){this.element.classList.remove(e.AdminPanelClasses.activeModule)}initializeEvents(){this.trigger.addEventListener("click",e=>{this.adminPanel.removeBackdrop(),this.isActive()?this.disable():(this.adminPanel.disableModules(),this.adminPanel.renderBackdrop(),this.enable())})}}}(TYPO3||(TYPO3={})),window.addEventListener("load",()=>new TYPO3.AdminPanel,!1);
\ No newline at end of file
+"use strict";var TYPO3;!function(e){e.AdminPanelSelectors={adminPanelRole:"form[data-typo3-role=typo3-adminPanel]",moduleTriggerRole:"[data-typo3-role=typo3-adminPanel-module-trigger]",moduleParentClass:".typo3-adminPanel-module",contentTabRole:"[data-typo3-role=typo3-adminPanel-content-tab]",saveButtonRole:"[data-typo3-role=typo3-adminPanel-saveButton]",triggerRole:"[data-typo3-role=typo3-adminPanel-trigger]",popupTriggerRole:"[data-typo3-role=typo3-adminPanel-popup-trigger]",panelTriggerRole:"[data-typo3-role=typo3-adminPanel-panel-trigger]",panelParentClass:".typo3-adminPanel-panel",contentSettingsTriggerRole:"[data-typo3-role=typo3-adminPanel-content-settings]",contentSettingsParentClass:".typo3-adminPanel-content-settings",contentParentClass:".typo3-adminPanel-content",zoomTarget:"[data-typo3-zoom-target]",zoomClose:"[data-typo3-zoom-close]",currentContentRole:"[data-typo3-role=typo3-adminPanel-content]",contentPaneRole:"[data-typo3-role=typo3-adminPanel-content-pane]"},e.AdminPanelClasses={active:"active",activeModule:"typo3-adminPanel-module-active",activeContentSetting:"typo3-adminPanel-content-settings-active",backdrop:"typo3-adminPanel-backdrop",activeTab:"typo3-adminPanel-content-header-item-active",activePane:"typo3-adminPanel-content-panes-item-active",noScroll:"typo3-adminPanel-noscroll",zoomShow:"typo3-adminPanel-zoom-show"};e.AdminPanel=class{constructor(){this.adminPanel=document.querySelector(e.AdminPanelSelectors.adminPanelRole),this.modules=this.querySelectorAll(e.AdminPanelSelectors.moduleTriggerRole).map(t=>{const n=t.closest(e.AdminPanelSelectors.moduleParentClass);return new s(this,n,t)}),this.popups=this.querySelectorAll(e.AdminPanelSelectors.popupTriggerRole).map(e=>new t(this,e)),this.panels=this.querySelectorAll(e.AdminPanelSelectors.panelTriggerRole).map(t=>{const a=t.closest(e.AdminPanelSelectors.panelParentClass);return new n(a,t)}),this.contentSettings=this.querySelectorAll(e.AdminPanelSelectors.contentSettingsTriggerRole).map(t=>{const n=t.closest(e.AdminPanelSelectors.contentParentClass).querySelector(e.AdminPanelSelectors.contentSettingsParentClass);return new a(n,t)}),this.trigger=document.querySelector(e.AdminPanelSelectors.triggerRole),this.initializeEvents(),this.addBackdropListener()}disableModules(){this.modules.forEach(e=>e.disable())}disablePopups(){this.popups.forEach(e=>e.disable())}renderBackdrop(){const t=document.querySelector("#TSFE_ADMIN_PANEL_FORM"),n=document.createElement("div");document.querySelector("body").classList.add(e.AdminPanelClasses.noScroll),n.classList.add(e.AdminPanelClasses.backdrop),t.appendChild(n),this.addBackdropListener()}removeBackdrop(){const t=document.querySelector("."+e.AdminPanelClasses.backdrop);document.querySelector("body").classList.remove(e.AdminPanelClasses.noScroll),null!==t&&t.remove()}querySelectorAll(e,t=null){return null===t?Array.from(document.querySelectorAll(e)):Array.from(t.querySelectorAll(e))}initializeEvents(){this.querySelectorAll(e.AdminPanelSelectors.contentTabRole).forEach(e=>e.addEventListener("click",this.switchTab.bind(this))),this.querySelectorAll(e.AdminPanelSelectors.zoomTarget).forEach(e=>e.addEventListener("click",this.openZoom.bind(this))),this.querySelectorAll(e.AdminPanelSelectors.zoomClose).forEach(e=>e.addEventListener("click",this.closeZoom.bind(this))),this.querySelectorAll(e.AdminPanelSelectors.triggerRole).forEach(e=>e.addEventListener("click",this.toggleAdminPanelState.bind(this))),this.querySelectorAll(e.AdminPanelSelectors.saveButtonRole).forEach(e=>e.addEventListener("click",this.sendAdminPanelForm.bind(this))),this.querySelectorAll("[data-typo3-role=typo3-adminPanel-content-close]").forEach(e=>{e.addEventListener("click",()=>{this.disableModules(),this.removeBackdrop()})}),this.querySelectorAll(".typo3-adminPanel-table th, .typo3-adminPanel-table td").forEach(e=>{e.addEventListener("click",()=>{e.focus();try{document.execCommand("copy")}catch(e){}})})}switchTab(t){t.preventDefault();const n=e.AdminPanelClasses.activeTab,a=e.AdminPanelClasses.activePane,s=t.currentTarget,l=s.closest(e.AdminPanelSelectors.currentContentRole),i=this.querySelectorAll(e.AdminPanelSelectors.contentTabRole,l),o=this.querySelectorAll(e.AdminPanelSelectors.contentPaneRole,l);i.forEach(e=>e.classList.remove(n)),s.classList.add(n),o.forEach(e=>e.classList.remove(a)),document.querySelector("[data-typo3-tab-id="+s.dataset.typo3TabTarget+"]").classList.add(a)}openZoom(t){t.preventDefault();const n=t.currentTarget.getAttribute("data-typo3-zoom-target");document.querySelector("[data-typo3-zoom-id="+n+"]").classList.add(e.AdminPanelClasses.zoomShow)}closeZoom(t){t.preventDefault(),t.currentTarget.closest("[data-typo3-zoom-id]").classList.remove(e.AdminPanelClasses.zoomShow)}sendAdminPanelForm(e){e.preventDefault();const t=new FormData(this.adminPanel),n=new XMLHttpRequest;n.open("POST",this.adminPanel.dataset.typo3AjaxUrl),n.send(t),n.onload=(()=>location.reload())}toggleAdminPanelState(){const e=new XMLHttpRequest;e.open("GET",this.trigger.dataset.typo3AjaxUrl),e.send(),e.onload=(()=>location.reload())}addBackdropListener(){this.querySelectorAll("."+e.AdminPanelClasses.backdrop).forEach(t=>{t.addEventListener("click",()=>{this.removeBackdrop(),this.querySelectorAll(e.AdminPanelSelectors.moduleTriggerRole).forEach(t=>{t.closest(e.AdminPanelSelectors.moduleParentClass).classList.remove(e.AdminPanelClasses.activeModule)})})})}};class t{constructor(e,t){this.adminPanel=e,this.element=t,this.initializeEvents()}isActive(){return this.element.classList.contains(e.AdminPanelClasses.active)}enable(){this.element.classList.add(e.AdminPanelClasses.active)}disable(){this.element.classList.remove(e.AdminPanelClasses.active)}initializeEvents(){this.element.addEventListener("click",()=>{this.isActive()?this.disable():(this.adminPanel.disablePopups(),this.enable())})}}class n{constructor(e,t){this.element=e,this.trigger=t,this.initializeEvents()}isActive(){return this.element.classList.contains(e.AdminPanelClasses.active)}enable(){this.element.classList.add(e.AdminPanelClasses.active)}disable(){this.element.classList.remove(e.AdminPanelClasses.active)}initializeEvents(){this.trigger.addEventListener("click",()=>{this.isActive()?this.disable():this.enable()})}}class a{constructor(e,t){this.element=e,this.trigger=t,this.initializeEvents()}isActive(){return this.element.classList.contains(e.AdminPanelClasses.activeContentSetting)}enable(){this.element.classList.add(e.AdminPanelClasses.activeContentSetting)}disable(){this.element.classList.remove(e.AdminPanelClasses.activeContentSetting)}initializeEvents(){this.trigger.addEventListener("click",()=>{this.isActive()?this.disable():this.enable()})}}class s{constructor(e,t,n){this.adminPanel=e,this.element=t,this.trigger=n,this.initializeEvents()}isActive(){return this.element.classList.contains(e.AdminPanelClasses.activeModule)}enable(){this.element.classList.add(e.AdminPanelClasses.activeModule)}disable(){this.element.classList.remove(e.AdminPanelClasses.activeModule)}initializeEvents(){this.trigger.addEventListener("click",()=>{this.adminPanel.removeBackdrop(),this.isActive()?this.disable():(this.adminPanel.disableModules(),this.adminPanel.renderBackdrop(),this.enable())})}}}(TYPO3||(TYPO3={})),window.addEventListener("load",()=>new TYPO3.AdminPanel,!1);
\ No newline at end of file
index 55ddf9f..af884b3 100644 (file)
@@ -10,4 +10,4 @@
  *
  * The TYPO3 project - inspiring people to share!
  */
-var __awaiter=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(c,i){function a(t){try{o(r.next(t))}catch(t){i(t)}}function u(t){try{o(r.throw(t))}catch(t){i(t)}}function o(t){var e;t.done?c(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(a,u)}o((r=r.apply(t,e||[])).next())})};define(["require","exports","./AbstractAction"],function(t,e,n){"use strict";return class extends n.AbstractAction{execute(t){return this.executeCallback()}executeCallback(){return __awaiter(this,void 0,void 0,function*(){return Promise.resolve(this.callback())})}}});
\ No newline at end of file
+var __awaiter=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(c,i){function a(t){try{o(r.next(t))}catch(t){i(t)}}function u(t){try{o(r.throw(t))}catch(t){i(t)}}function o(t){var e;t.done?c(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(a,u)}o((r=r.apply(t,e||[])).next())})};define(["require","exports","./AbstractAction"],function(t,e,n){"use strict";return class extends n.AbstractAction{execute(){return this.executeCallback()}executeCallback(){return __awaiter(this,void 0,void 0,function*(){return Promise.resolve(this.callback())})}}});
\ No newline at end of file
index b073ecc..869e8f8 100644 (file)
@@ -10,4 +10,4 @@
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require","exports","./Enum/Severity","jquery","./InfoWindow","./Modal","./ModuleMenu","./Viewport","TYPO3/CMS/Backend/Notification"],function(e,t,n,a,r,o,i,s,l){"use strict";class c{static getReturnUrl(){return encodeURIComponent(top.list_frame.document.location.pathname+top.list_frame.document.location.search)}static editRecord(e,t){let n="",r=a(this).data("pages-language-uid");r&&(n="&overrideVals[pages][sys_language_uid]="+r),s.ContentContainer.setUrl(top.TYPO3.settings.FormEngine.moduleUrl+"&edit["+e+"]["+t+"]=edit"+n+"&returnUrl="+c.getReturnUrl())}static viewRecord(e,t){const n=a(this).data("preview-url");if(n){window.open(n,"newTYPO3frontendWindow").focus()}}static openInfoPopUp(e,t){r.showItem(e,t)}static mountAsTreeRoot(e,t){"pages"===e&&s.NavigationContainer.PageTree.setTemporaryMountPoint(t)}static newPageWizard(e,t){s.ContentContainer.setUrl(top.TYPO3.settings.NewRecord.moduleUrl+"&id="+t+"&pagesOnly=1&returnUrl="+c.getReturnUrl())}static newContentWizard(e,t){const r=a(this);let i=r.data("new-wizard-url");i&&(i+="&returnUrl="+c.getReturnUrl(),o.advanced({title:r.data("title"),type:o.types.ajax,size:o.sizes.medium,content:i,severity:n.SeverityEnum.notice}))}static newRecord(e,t){s.ContentContainer.setUrl(top.TYPO3.settings.FormEngine.moduleUrl+"&edit["+e+"][-"+t+"]=new&returnUrl="+c.getReturnUrl())}static openHistoryPopUp(e,t){s.ContentContainer.setUrl(top.TYPO3.settings.RecordHistory.moduleUrl+"&element="+e+":"+t+"&returnUrl="+c.getReturnUrl())}static openListModule(e,t){const n="pages"===e?t:a(this).data("page-uid");i.App.showModule("web_list","id="+n)}static pagesSort(e,t){const n=a(this).data("pages-sort-url");n&&s.ContentContainer.setUrl(n)}static pagesNewMultiple(e,t){const n=a(this).data("pages-new-multiple-url");n&&s.ContentContainer.setUrl(n)}static disableRecord(e,t){s.ContentContainer.setUrl(top.TYPO3.settings.RecordCommit.moduleUrl+"&data["+e+"]["+t+"][hidden]=1&redirect="+c.getReturnUrl()).done(()=>{s.NavigationContainer.PageTree.refreshTree()})}static enableRecord(e,t){s.ContentContainer.setUrl(top.TYPO3.settings.RecordCommit.moduleUrl+"&data["+e+"]["+t+"][hidden]=0&redirect="+c.getReturnUrl()).done(()=>{s.NavigationContainer.PageTree.refreshTree()})}static deleteRecord(e,t){const r=a(this);o.confirm(r.data("title"),r.data("message"),n.SeverityEnum.warning,[{text:a(this).data("button-close-text")||TYPO3.lang["button.cancel"]||"Cancel",active:!0,btnClass:"btn-default",name:"cancel"},{text:a(this).data("button-ok-text")||TYPO3.lang["button.delete"]||"Delete",btnClass:"btn-warning",name:"delete"}]).on("button.clicked",n=>{if("delete"===n.target.getAttribute("name")){const n=top.TYPO3.settings.RecordCommit.moduleUrl+"&cmd["+e+"]["+t+"][delete]=1";a.ajax({url:n,success:()=>{if("pages"===e&&s.NavigationContainer.PageTree){if(t===top.fsMod.recentIds.web){let e=s.NavigationContainer.PageTree.getFirstNode();s.NavigationContainer.PageTree.selectNode(e)}s.NavigationContainer.PageTree.refreshTree()}}})}o.dismiss()})}static copy(e,t){const n=TYPO3.settings.ajaxUrls.contextmenu_clipboard+"&CB[el]["+e+"%7C"+t+"]=1&CB[setCopyMode]=1";a.ajax(n).always(()=>{c.triggerRefresh(s.ContentContainer.get().location.href)})}static clipboardRelease(e,t){const n=TYPO3.settings.ajaxUrls.contextmenu_clipboard+"&CB[el]["+e+"%7C"+t+"]=0";a.ajax(n).always(()=>{c.triggerRefresh(s.ContentContainer.get().location.href)})}static cut(e,t){const n=TYPO3.settings.ajaxUrls.contextmenu_clipboard+"&CB[el]["+e+"%7C"+t+"]=1&CB[setCopyMode]=0";a.ajax(n).always(()=>{c.triggerRefresh(s.ContentContainer.get().location.href)})}static triggerRefresh(e){e.includes("record%2Fedit")||s.ContentContainer.refresh()}static clearCache(e,t){a.ajax({url:TYPO3.settings.ajaxUrls.web_list_clearpagecache+"&id="+t,cache:!1,dataType:"json",success:e=>{!0===e.success?l.success(e.title,e.message,1):l.error(e.title,e.message,1)},error:()=>{l.error("Clearing page caches went wrong on the server side.")}})}static pasteAfter(e,t){c.pasteInto.bind(a(this))(e,-t)}static pasteInto(e,t){const r=a(this),i=()=>{const n="&CB[paste]="+e+"%7C"+t+"&CB[pad]=normal&redirect="+c.getReturnUrl();s.ContentContainer.setUrl(top.TYPO3.settings.RecordCommit.moduleUrl+n).done(()=>{"pages"===e&&s.NavigationContainer.PageTree&&s.NavigationContainer.PageTree.refreshTree()})};r.data("title")?o.confirm(r.data("title"),r.data("message"),n.SeverityEnum.warning,[{text:a(this).data("button-close-text")||TYPO3.lang["button.cancel"]||"Cancel",active:!0,btnClass:"btn-default",name:"cancel"},{text:a(this).data("button-ok-text")||TYPO3.lang["button.ok"]||"OK",btnClass:"btn-warning",name:"ok"}]).on("button.clicked",e=>{"ok"===e.target.getAttribute("name")&&i(),o.dismiss()}):i()}}return c});
\ No newline at end of file
+define(["require","exports","./Enum/Severity","jquery","./InfoWindow","./Modal","./ModuleMenu","./Viewport","TYPO3/CMS/Backend/Notification"],function(e,t,n,a,r,o,i,s,l){"use strict";class c{static getReturnUrl(){return encodeURIComponent(top.list_frame.document.location.pathname+top.list_frame.document.location.search)}static editRecord(e,t){let n="",r=a(this).data("pages-language-uid");r&&(n="&overrideVals[pages][sys_language_uid]="+r),s.ContentContainer.setUrl(top.TYPO3.settings.FormEngine.moduleUrl+"&edit["+e+"]["+t+"]=edit"+n+"&returnUrl="+c.getReturnUrl())}static viewRecord(){const e=a(this).data("preview-url");if(e){window.open(e,"newTYPO3frontendWindow").focus()}}static openInfoPopUp(e,t){r.showItem(e,t)}static mountAsTreeRoot(e,t){"pages"===e&&s.NavigationContainer.PageTree.setTemporaryMountPoint(t)}static newPageWizard(e,t){s.ContentContainer.setUrl(top.TYPO3.settings.NewRecord.moduleUrl+"&id="+t+"&pagesOnly=1&returnUrl="+c.getReturnUrl())}static newContentWizard(){const e=a(this);let t=e.data("new-wizard-url");t&&(t+="&returnUrl="+c.getReturnUrl(),o.advanced({title:e.data("title"),type:o.types.ajax,size:o.sizes.medium,content:t,severity:n.SeverityEnum.notice}))}static newRecord(e,t){s.ContentContainer.setUrl(top.TYPO3.settings.FormEngine.moduleUrl+"&edit["+e+"][-"+t+"]=new&returnUrl="+c.getReturnUrl())}static openHistoryPopUp(e,t){s.ContentContainer.setUrl(top.TYPO3.settings.RecordHistory.moduleUrl+"&element="+e+":"+t+"&returnUrl="+c.getReturnUrl())}static openListModule(e,t){const n="pages"===e?t:a(this).data("page-uid");i.App.showModule("web_list","id="+n)}static pagesSort(){const e=a(this).data("pages-sort-url");e&&s.ContentContainer.setUrl(e)}static pagesNewMultiple(){const e=a(this).data("pages-new-multiple-url");e&&s.ContentContainer.setUrl(e)}static disableRecord(e,t){s.ContentContainer.setUrl(top.TYPO3.settings.RecordCommit.moduleUrl+"&data["+e+"]["+t+"][hidden]=1&redirect="+c.getReturnUrl()).done(()=>{s.NavigationContainer.PageTree.refreshTree()})}static enableRecord(e,t){s.ContentContainer.setUrl(top.TYPO3.settings.RecordCommit.moduleUrl+"&data["+e+"]["+t+"][hidden]=0&redirect="+c.getReturnUrl()).done(()=>{s.NavigationContainer.PageTree.refreshTree()})}static deleteRecord(e,t){const r=a(this);o.confirm(r.data("title"),r.data("message"),n.SeverityEnum.warning,[{text:a(this).data("button-close-text")||TYPO3.lang["button.cancel"]||"Cancel",active:!0,btnClass:"btn-default",name:"cancel"},{text:a(this).data("button-ok-text")||TYPO3.lang["button.delete"]||"Delete",btnClass:"btn-warning",name:"delete"}]).on("button.clicked",n=>{if("delete"===n.target.getAttribute("name")){const n=top.TYPO3.settings.RecordCommit.moduleUrl+"&cmd["+e+"]["+t+"][delete]=1";a.ajax({url:n,success:()=>{if("pages"===e&&s.NavigationContainer.PageTree){if(t===top.fsMod.recentIds.web){let e=s.NavigationContainer.PageTree.getFirstNode();s.NavigationContainer.PageTree.selectNode(e)}s.NavigationContainer.PageTree.refreshTree()}}})}o.dismiss()})}static copy(e,t){const n=TYPO3.settings.ajaxUrls.contextmenu_clipboard+"&CB[el]["+e+"%7C"+t+"]=1&CB[setCopyMode]=1";a.ajax(n).always(()=>{c.triggerRefresh(s.ContentContainer.get().location.href)})}static clipboardRelease(e,t){const n=TYPO3.settings.ajaxUrls.contextmenu_clipboard+"&CB[el]["+e+"%7C"+t+"]=0";a.ajax(n).always(()=>{c.triggerRefresh(s.ContentContainer.get().location.href)})}static cut(e,t){const n=TYPO3.settings.ajaxUrls.contextmenu_clipboard+"&CB[el]["+e+"%7C"+t+"]=1&CB[setCopyMode]=0";a.ajax(n).always(()=>{c.triggerRefresh(s.ContentContainer.get().location.href)})}static triggerRefresh(e){e.includes("record%2Fedit")||s.ContentContainer.refresh()}static clearCache(e,t){a.ajax({url:TYPO3.settings.ajaxUrls.web_list_clearpagecache+"&id="+t,cache:!1,dataType:"json",success:e=>{!0===e.success?l.success(e.title,e.message,1):l.error(e.title,e.message,1)},error:()=>{l.error("Clearing page caches went wrong on the server side.")}})}static pasteAfter(e,t){c.pasteInto.bind(a(this))(e,-t)}static pasteInto(e,t){const r=a(this),i=()=>{const n="&CB[paste]="+e+"%7C"+t+"&CB[pad]=normal&redirect="+c.getReturnUrl();s.ContentContainer.setUrl(top.TYPO3.settings.RecordCommit.moduleUrl+n).done(()=>{"pages"===e&&s.NavigationContainer.PageTree&&s.NavigationContainer.PageTree.refreshTree()})};r.data("title")?o.confirm(r.data("title"),r.data("message"),n.SeverityEnum.warning,[{text:a(this).data("button-close-text")||TYPO3.lang["button.cancel"]||"Cancel",active:!0,btnClass:"btn-default",name:"cancel"},{text:a(this).data("button-ok-text")||TYPO3.lang["button.ok"]||"OK",btnClass:"btn-warning",name:"ok"}]).on("button.clicked",e=>{"ok"===e.target.getAttribute("name")&&i(),o.dismiss()}):i()}}return c});
\ No newline at end of file
index 371b5e6..46d4eb0 100644 (file)
@@ -10,4 +10,4 @@
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require","exports","./Enum/Severity","jquery","moment","nprogress","./Modal","./Notification","./Utility/MessageUtility"],function(e,t,i,s,a,r,o,n,l){"use strict";var d;Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.OVERRIDE="replace",e.RENAME="rename",e.SKIP="cancel",e.USE_EXISTING="useExisting"}(d||(d={}));class p{constructor(e){this.askForOverride=[],this.percentagePerFile=1,this.dragFileIntoDocument=(e=>(e.stopPropagation(),e.preventDefault(),s(e.currentTarget).addClass("drop-in-progress"),this.showDropzone(),!1)),this.dragAborted=(e=>(e.stopPropagation(),e.preventDefault(),s(e.currentTarget).removeClass("drop-in-progress"),!1)),this.ignoreDrop=(e=>(e.stopPropagation(),e.preventDefault(),this.dragAborted(e),!1)),this.handleDrop=(e=>{this.ignoreDrop(e),this.processFiles(e.originalEvent.dataTransfer.files),this.$dropzone.removeClass("drop-status-ok")}),this.fileInDropzone=(()=>{this.$dropzone.addClass("drop-status-ok")}),this.fileOutOfDropzone=(()=>{this.$dropzone.removeClass("drop-status-ok")}),this.$body=s("body"),this.$element=s(e);const t=void 0!==this.$element.data("dropzoneTrigger");this.$trigger=s(this.$element.data("dropzoneTrigger")),this.defaultAction=this.$element.data("defaultAction")||d.SKIP,this.$dropzone=s("<div />").addClass("dropzone").hide(),this.irreObjectUid=this.$element.data("fileIrreObject");const i=this.$element.data("dropzoneTarget");this.irreObjectUid&&0!==this.$element.nextAll(i).length?(this.dropZoneInsertBefore=!0,this.$dropzone.insertBefore(i)):(this.dropZoneInsertBefore=!1,this.$dropzone.insertAfter(i)),this.$dropzoneMask=s("<div />").addClass("dropzone-mask").appendTo(this.$dropzone),this.fileInput=document.createElement("input"),this.fileInput.setAttribute("type","file"),this.fileInput.setAttribute("multiple","multiple"),this.fileInput.setAttribute("name","files[]"),this.fileInput.classList.add("upload-file-picker"),this.$body.append(this.fileInput),this.$fileList=s(this.$element.data("progress-container")),this.fileListColumnCount=s("thead tr:first th",this.$fileList).length,this.filesExtensionsAllowed=this.$element.data("file-allowed"),this.fileDenyPattern=this.$element.data("file-deny-pattern")?new RegExp(this.$element.data("file-deny-pattern"),"i"):null,this.maxFileSize=parseInt(this.$element.data("max-file-size"),10),this.target=this.$element.data("target-folder"),this.browserCapabilities={fileReader:"undefined"!=typeof FileReader,DnD:"draggable"in document.createElement("span"),Progress:"upload"in new XMLHttpRequest},this.browserCapabilities.DnD?(this.$body.on("dragover",this.dragFileIntoDocument),this.$body.on("dragend",this.dragAborted),this.$body.on("drop",this.ignoreDrop),this.$dropzone.on("dragenter",this.fileInDropzone),this.$dropzoneMask.on("dragenter",this.fileInDropzone),this.$dropzoneMask.on("dragleave",this.fileOutOfDropzone),this.$dropzoneMask.on("drop",e=>this.handleDrop(e)),this.$dropzone.prepend('<div class="dropzone-hint"><div class="dropzone-hint-media"><div class="dropzone-hint-icon"></div></div><div class="dropzone-hint-body"><h3 class="dropzone-hint-title">'+TYPO3.lang["file_upload.dropzonehint.title"]+'</h3><p class="dropzone-hint-message">'+TYPO3.lang["file_upload.dropzonehint.message"]+"</p></div></div>").click(()=>{this.fileInput.click()}),s("<span />").addClass("dropzone-close").click(this.hideDropzone).appendTo(this.$dropzone),0===this.$fileList.length&&(this.$fileList=s("<table />").attr("id","typo3-filelist").addClass("table table-striped table-hover upload-queue").html("<tbody></tbody>").hide(),this.dropZoneInsertBefore?this.$fileList.insertAfter(this.$dropzone):this.$fileList.insertBefore(this.$dropzone),this.fileListColumnCount=7),this.fileInput.addEventListener("change",()=>{this.processFiles(Array.apply(null,this.fileInput.files))}),this.bindUploadButton(!0===t?this.$trigger:this.$element)):console.warn("Browser has no Drag and drop capabilities; cannot initialize DragUploader")}showDropzone(){this.$dropzone.show()}hideDropzone(e){e.stopPropagation(),e.preventDefault(),this.$dropzone.hide()}processFiles(e){this.queueLength=e.length,this.$fileList.is(":visible")||this.$fileList.show(),r.start(),this.percentagePerFile=1/e.length;const t=[];s.each(e,(e,i)=>{t[parseInt(e,10)]=s.ajax({url:TYPO3.settings.ajaxUrls.file_exists,data:{fileName:i.name,fileTarget:this.target},cache:!1,success:e=>{if(void 0!==e.uid)this.askForOverride.push({original:e,uploaded:i,action:this.irreObjectUid?d.USE_EXISTING:d.SKIP}),r.inc(this.percentagePerFile);else{new h(this,i,d.SKIP)}}})}),s.when.apply(s,t).done(()=>{this.drawOverrideModal(),r.done()}),this.fileInput.value=""}bindUploadButton(e){e.click(e=>{e.preventDefault(),this.fileInput.click(),this.showDropzone()})}decrementQueueLength(){this.queueLength>0&&(this.queueLength--,0===this.queueLength&&s.ajax({url:TYPO3.settings.ajaxUrls.flashmessages_render,cache:!1,success:e=>{s.each(e,(e,t)=>{n.showMessage(t.title,t.message,t.severity)})}}))}drawOverrideModal(){const e=Object.keys(this.askForOverride).length;if(0===e)return;const t=s("<div/>").append(s("<p/>").text(TYPO3.lang["file_upload.existingfiles.description"]),s("<table/>",{class:"table"}).append(s("<thead/>").append(s("<tr />").append(s("<th/>"),s("<th/>").text(TYPO3.lang["file_upload.header.originalFile"]),s("<th/>").text(TYPO3.lang["file_upload.header.uploadedFile"]),s("<th/>").text(TYPO3.lang["file_upload.header.action"])))));for(let i=0;i<e;++i){const e=s("<tr />").append(s("<td />").append(""!==this.askForOverride[i].original.thumbUrl?s("<img />",{src:this.askForOverride[i].original.thumbUrl,height:40}):s(this.askForOverride[i].original.icon)),s("<td />").html(this.askForOverride[i].original.name+" ("+g.fileSizeAsString(this.askForOverride[i].original.size)+")<br>"+a.unix(this.askForOverride[i].original.mtime).format("YYYY-MM-DD HH:mm")),s("<td />").html(this.askForOverride[i].uploaded.name+" ("+g.fileSizeAsString(this.askForOverride[i].uploaded.size)+")<br>"+a(this.askForOverride[i].uploaded.lastModified?this.askForOverride[i].uploaded.lastModified:this.askForOverride[i].uploaded.lastModifiedDate).format("YYYY-MM-DD HH:mm")),s("<td />").append(s("<select />",{class:"form-control t3js-actions","data-override":i}).append(this.irreObjectUid?s("<option/>").val(d.USE_EXISTING).text(TYPO3.lang["file_upload.actions.use_existing"]):"",s("<option />",{selected:this.defaultAction===d.SKIP}).val(d.SKIP).text(TYPO3.lang["file_upload.actions.skip"]),s("<option />",{selected:this.defaultAction===d.RENAME}).val(d.RENAME).text(TYPO3.lang["file_upload.actions.rename"]),s("<option />",{selected:this.defaultAction===d.OVERRIDE}).val(d.OVERRIDE).text(TYPO3.lang["file_upload.actions.override"]))));t.find("table").append("<tbody />").append(e)}const r=o.confirm(TYPO3.lang["file_upload.existingfiles.title"],t,i.SeverityEnum.warning,[{text:s(this).data("button-close-text")||TYPO3.lang["file_upload.button.cancel"]||"Cancel",active:!0,btnClass:"btn-default",name:"cancel"},{text:s(this).data("button-ok-text")||TYPO3.lang["file_upload.button.continue"]||"Continue with selected actions",btnClass:"btn-warning",name:"continue"}],["modal-inner-scroll"]);r.find(".modal-dialog").addClass("modal-lg"),r.find(".modal-footer").prepend(s("<span/>").addClass("form-inline").append(s("<label/>").text(TYPO3.lang["file_upload.actions.all.label"]),s("<select/>",{class:"form-control t3js-actions-all"}).append(s("<option/>").val("").text(TYPO3.lang["file_upload.actions.all.empty"]),this.irreObjectUid?s("<option/>").val(d.USE_EXISTING).text(TYPO3.lang["file_upload.actions.all.use_existing"]):"",s("<option/>",{selected:this.defaultAction===d.SKIP}).val(d.SKIP).text(TYPO3.lang["file_upload.actions.all.skip"]),s("<option/>",{selected:this.defaultAction===d.RENAME}).val(d.RENAME).text(TYPO3.lang["file_upload.actions.all.rename"]),s("<option/>",{selected:this.defaultAction===d.OVERRIDE}).val(d.OVERRIDE).text(TYPO3.lang["file_upload.actions.all.override"]))));const n=this;r.on("change",".t3js-actions-all",function(){const e=s(this).val();""!==e?r.find(".t3js-actions").each((t,i)=>{const a=s(i),r=parseInt(a.data("override"),10);a.val(e).prop("disabled","disabled"),n.askForOverride[r].action=a.val()}):r.find(".t3js-actions").removeProp("disabled")}).on("change",".t3js-actions",function(){const e=s(this),t=parseInt(e.data("override"),10);n.askForOverride[t].action=e.val()}).on("button.clicked",function(e){"cancel"===e.target.name?(n.askForOverride=[],o.dismiss()):"continue"===e.target.name&&(s.each(n.askForOverride,(e,t)=>{if(t.action===d.USE_EXISTING)g.addFileToIrre(n.irreObjectUid,t.original);else if(t.action!==d.SKIP){new h(n,t.uploaded,t.action)}}),n.askForOverride=[],o.dismiss())}).on("hidden.bs.modal",()=>{this.askForOverride=[]})}}class h{constructor(e,t,i){if(this.dragUploader=e,this.file=t,this.override=i,this.$row=s("<tr />").addClass("upload-queue-item uploading"),this.$iconCol=s("<td />").addClass("col-icon").appendTo(this.$row),this.$fileName=s("<td />").text(t.name).appendTo(this.$row),this.$progress=s("<td />").attr("colspan",this.dragUploader.fileListColumnCount-2).appendTo(this.$row),this.$progressContainer=s("<div />").addClass("upload-queue-progress").appendTo(this.$progress),this.$progressBar=s("<div />").addClass("upload-queue-progress-bar").appendTo(this.$progressContainer),this.$progressPercentage=s("<span />").addClass("upload-queue-progress-percentage").appendTo(this.$progressContainer),this.$progressMessage=s("<span />").addClass("upload-queue-progress-message").appendTo(this.$progressContainer),0===s("tbody tr.upload-queue-item",this.dragUploader.$fileList).length?(this.$row.prependTo(s("tbody",this.dragUploader.$fileList)),this.$row.addClass("last")):this.$row.insertBefore(s("tbody tr.upload-queue-item:first",this.dragUploader.$fileList)),this.$iconCol.html('<span class="t3-icon t3-icon-mimetypes t3-icon-other-other">&nbsp;</span>'),this.dragUploader.maxFileSize>0&&this.file.size>this.dragUploader.maxFileSize)this.updateMessage(TYPO3.lang["file_upload.maxFileSizeExceeded"].replace(/\{0\}/g,this.file.name).replace(/\{1\}/g,g.fileSizeAsString(this.dragUploader.maxFileSize))),this.$row.addClass("error");else if(this.dragUploader.fileDenyPattern&&this.file.name.match(this.dragUploader.fileDenyPattern))this.updateMessage(TYPO3.lang["file_upload.fileNotAllowed"].replace(/\{0\}/g,this.file.name)),this.$row.addClass("error");else if(this.checkAllowedExtensions()){this.updateMessage("- "+g.fileSizeAsString(this.file.size));const e=new FormData;e.append("data[upload][1][target]",this.dragUploader.target),e.append("data[upload][1][data]","1"),e.append("overwriteExistingFiles",this.override),e.append("redirect",""),e.append("upload_1",this.file);const t=s.extend(!0,{},s.ajaxSettings,{url:TYPO3.settings.ajaxUrls.file_process,contentType:!1,processData:!1,data:e,cache:!1,type:"POST",success:e=>this.uploadSuccess(e),error:e=>this.uploadError(e)});t.xhr=(()=>{const e=s.ajaxSettings.xhr();return e.upload.addEventListener("progress",e=>this.updateProgress(e)),e}),this.upload=s.ajax(t)}else this.updateMessage(TYPO3.lang["file_upload.fileExtensionExpected"].replace(/\{0\}/g,this.dragUploader.filesExtensionsAllowed)),this.$row.addClass("error")}updateMessage(e){this.$progressMessage.text(e)}removeProgress(){this.$progress&&this.$progress.remove()}uploadStart(){this.$progressPercentage.text("(0%)"),this.$progressBar.width("1%"),this.dragUploader.$trigger.trigger("uploadStart",[this])}uploadError(e){this.updateMessage(TYPO3.lang["file_upload.uploadFailed"].replace(/\{0\}/g,this.file.name));const t=s(e.responseText);t.is("t3err")?this.$progressPercentage.text(t.text()):this.$progressPercentage.text("("+e.statusText+")"),this.$row.addClass("error"),this.dragUploader.decrementQueueLength(),this.dragUploader.$trigger.trigger("uploadError",[this,e])}updateProgress(e){const t=Math.round(e.loaded/e.total*100)+"%";this.$progressBar.outerWidth(t),this.$progressPercentage.text(t),this.dragUploader.$trigger.trigger("updateProgress",[this,t,e])}uploadSuccess(e){e.upload&&(this.dragUploader.decrementQueueLength(),this.$row.removeClass("uploading"),this.$fileName.text(e.upload[0].name),this.$progressPercentage.text(""),this.$progressMessage.text("100%"),this.$progressBar.outerWidth("100%"),e.upload[0].icon&&this.$iconCol.html('<a href="#" class="t3js-contextmenutrigger" data-uid="'+e.upload[0].id+'" data-table="sys_file">'+e.upload[0].icon+"&nbsp;</span></a>"),this.dragUploader.irreObjectUid?(g.addFileToIrre(this.dragUploader.irreObjectUid,e.upload[0]),setTimeout(()=>{this.$row.remove(),0===s("tr",this.dragUploader.$fileList).length&&(this.dragUploader.$fileList.hide(),this.dragUploader.$trigger.trigger("uploadSuccess",[this,e]))},3e3)):setTimeout(()=>{this.showFileInfo(e.upload[0]),this.dragUploader.$trigger.trigger("uploadSuccess",[this,e])},3e3))}showFileInfo(e){this.removeProgress();for(let e=7;e<this.dragUploader.fileListColumnCount;e++)s("<td />").text("").appendTo(this.$row);s("<td />").text(e.extension.toUpperCase()).appendTo(this.$row),s("<td />").text(e.date).appendTo(this.$row),s("<td />").text(g.fileSizeAsString(e.size)).appendTo(this.$row);let t="";e.permissions.read&&(t+='<strong class="text-danger">'+TYPO3.lang["permissions.read"]+"</strong>"),e.permissions.write&&(t+='<strong class="text-danger">'+TYPO3.lang["permissions.write"]+"</strong>"),s("<td />").html(t).appendTo(this.$row),s("<td />").text("-").appendTo(this.$row)}checkAllowedExtensions(){if(!this.dragUploader.filesExtensionsAllowed)return!0;const e=this.file.name.split(".").pop(),t=this.dragUploader.filesExtensionsAllowed.split(",");return-1!==s.inArray(e.toLowerCase(),t)}}class g{static fileSizeAsString(e){const t=e/1024;let i="";return i=t>1024?(t/1024).toFixed(1)+" MB":t.toFixed(1)+" KB"}static addFileToIrre(e,t){const i={objectGroup:e,table:"sys_file",uid:t.uid};l.MessageUtility.send(i)}static init(){const e=this.options;s.fn.extend({dragUploader:function(e){return this.each((t,i)=>{const a=s(i);let r=a.data("DragUploaderPlugin");r||a.data("DragUploaderPlugin",r=new p(i)),"string"==typeof e&&r[e]()})}}),s(()=>{s(".t3js-drag-uploader").dragUploader(e)})}}t.initialize=function(){g.init(),void 0!==TYPO3.settings&&void 0!==TYPO3.settings.RequireJS&&void 0!==TYPO3.settings.RequireJS.PostInitializationModules&&void 0!==TYPO3.settings.RequireJS.PostInitializationModules["TYPO3/CMS/Backend/DragUploader"]&&s.each(TYPO3.settings.RequireJS.PostInitializationModules["TYPO3/CMS/Backend/DragUploader"],(t,i)=>{e([i])})},t.initialize()});
\ No newline at end of file
+define(["require","exports","./Enum/Severity","jquery","moment","nprogress","./Modal","./Notification","./Utility/MessageUtility"],function(e,t,i,s,a,r,o,n,l){"use strict";var d;Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.OVERRIDE="replace",e.RENAME="rename",e.SKIP="cancel",e.USE_EXISTING="useExisting"}(d||(d={}));class p{constructor(e){this.askForOverride=[],this.percentagePerFile=1,this.dragFileIntoDocument=(e=>(e.stopPropagation(),e.preventDefault(),s(e.currentTarget).addClass("drop-in-progress"),this.showDropzone(),!1)),this.dragAborted=(e=>(e.stopPropagation(),e.preventDefault(),s(e.currentTarget).removeClass("drop-in-progress"),!1)),this.ignoreDrop=(e=>(e.stopPropagation(),e.preventDefault(),this.dragAborted(e),!1)),this.handleDrop=(e=>{this.ignoreDrop(e),this.processFiles(e.originalEvent.dataTransfer.files),this.$dropzone.removeClass("drop-status-ok")}),this.fileInDropzone=(()=>{this.$dropzone.addClass("drop-status-ok")}),this.fileOutOfDropzone=(()=>{this.$dropzone.removeClass("drop-status-ok")}),this.$body=s("body"),this.$element=s(e);const t=void 0!==this.$element.data("dropzoneTrigger");this.$trigger=s(this.$element.data("dropzoneTrigger")),this.defaultAction=this.$element.data("defaultAction")||d.SKIP,this.$dropzone=s("<div />").addClass("dropzone").hide(),this.irreObjectUid=this.$element.data("fileIrreObject");const i=this.$element.data("dropzoneTarget");this.irreObjectUid&&0!==this.$element.nextAll(i).length?(this.dropZoneInsertBefore=!0,this.$dropzone.insertBefore(i)):(this.dropZoneInsertBefore=!1,this.$dropzone.insertAfter(i)),this.$dropzoneMask=s("<div />").addClass("dropzone-mask").appendTo(this.$dropzone),this.fileInput=document.createElement("input"),this.fileInput.setAttribute("type","file"),this.fileInput.setAttribute("multiple","multiple"),this.fileInput.setAttribute("name","files[]"),this.fileInput.classList.add("upload-file-picker"),this.$body.append(this.fileInput),this.$fileList=s(this.$element.data("progress-container")),this.fileListColumnCount=s("thead tr:first th",this.$fileList).length,this.filesExtensionsAllowed=this.$element.data("file-allowed"),this.fileDenyPattern=this.$element.data("file-deny-pattern")?new RegExp(this.$element.data("file-deny-pattern"),"i"):null,this.maxFileSize=parseInt(this.$element.data("max-file-size"),10),this.target=this.$element.data("target-folder"),this.browserCapabilities={fileReader:"undefined"!=typeof FileReader,DnD:"draggable"in document.createElement("span"),Progress:"upload"in new XMLHttpRequest},this.browserCapabilities.DnD?(this.$body.on("dragover",this.dragFileIntoDocument),this.$body.on("dragend",this.dragAborted),this.$body.on("drop",this.ignoreDrop),this.$dropzone.on("dragenter",this.fileInDropzone),this.$dropzoneMask.on("dragenter",this.fileInDropzone),this.$dropzoneMask.on("dragleave",this.fileOutOfDropzone),this.$dropzoneMask.on("drop",e=>this.handleDrop(e)),this.$dropzone.prepend('<div class="dropzone-hint"><div class="dropzone-hint-media"><div class="dropzone-hint-icon"></div></div><div class="dropzone-hint-body"><h3 class="dropzone-hint-title">'+TYPO3.lang["file_upload.dropzonehint.title"]+'</h3><p class="dropzone-hint-message">'+TYPO3.lang["file_upload.dropzonehint.message"]+"</p></div></div>").click(()=>{this.fileInput.click()}),s("<span />").addClass("dropzone-close").click(this.hideDropzone).appendTo(this.$dropzone),0===this.$fileList.length&&(this.$fileList=s("<table />").attr("id","typo3-filelist").addClass("table table-striped table-hover upload-queue").html("<tbody></tbody>").hide(),this.dropZoneInsertBefore?this.$fileList.insertAfter(this.$dropzone):this.$fileList.insertBefore(this.$dropzone),this.fileListColumnCount=7),this.fileInput.addEventListener("change",()=>{this.processFiles(Array.apply(null,this.fileInput.files))}),this.bindUploadButton(!0===t?this.$trigger:this.$element)):console.warn("Browser has no Drag and drop capabilities; cannot initialize DragUploader")}showDropzone(){this.$dropzone.show()}hideDropzone(e){e.stopPropagation(),e.preventDefault(),this.$dropzone.hide()}processFiles(e){this.queueLength=e.length,this.$fileList.is(":visible")||this.$fileList.show(),r.start(),this.percentagePerFile=1/e.length;const t=[];s.each(e,(e,i)=>{t[parseInt(e,10)]=s.ajax({url:TYPO3.settings.ajaxUrls.file_exists,data:{fileName:i.name,fileTarget:this.target},cache:!1,success:e=>{void 0!==e.uid?(this.askForOverride.push({original:e,uploaded:i,action:this.irreObjectUid?d.USE_EXISTING:d.SKIP}),r.inc(this.percentagePerFile)):new h(this,i,d.SKIP)}})}),s.when.apply(s,t).done(()=>{this.drawOverrideModal(),r.done()}),this.fileInput.value=""}bindUploadButton(e){e.click(e=>{e.preventDefault(),this.fileInput.click(),this.showDropzone()})}decrementQueueLength(){this.queueLength>0&&(this.queueLength--,0===this.queueLength&&s.ajax({url:TYPO3.settings.ajaxUrls.flashmessages_render,cache:!1,success:e=>{s.each(e,(e,t)=>{n.showMessage(t.title,t.message,t.severity)})}}))}drawOverrideModal(){const e=Object.keys(this.askForOverride).length;if(0===e)return;const t=s("<div/>").append(s("<p/>").text(TYPO3.lang["file_upload.existingfiles.description"]),s("<table/>",{class:"table"}).append(s("<thead/>").append(s("<tr />").append(s("<th/>"),s("<th/>").text(TYPO3.lang["file_upload.header.originalFile"]),s("<th/>").text(TYPO3.lang["file_upload.header.uploadedFile"]),s("<th/>").text(TYPO3.lang["file_upload.header.action"])))));for(let i=0;i<e;++i){const e=s("<tr />").append(s("<td />").append(""!==this.askForOverride[i].original.thumbUrl?s("<img />",{src:this.askForOverride[i].original.thumbUrl,height:40}):s(this.askForOverride[i].original.icon)),s("<td />").html(this.askForOverride[i].original.name+" ("+g.fileSizeAsString(this.askForOverride[i].original.size)+")<br>"+a.unix(this.askForOverride[i].original.mtime).format("YYYY-MM-DD HH:mm")),s("<td />").html(this.askForOverride[i].uploaded.name+" ("+g.fileSizeAsString(this.askForOverride[i].uploaded.size)+")<br>"+a(this.askForOverride[i].uploaded.lastModified?this.askForOverride[i].uploaded.lastModified:this.askForOverride[i].uploaded.lastModifiedDate).format("YYYY-MM-DD HH:mm")),s("<td />").append(s("<select />",{class:"form-control t3js-actions","data-override":i}).append(this.irreObjectUid?s("<option/>").val(d.USE_EXISTING).text(TYPO3.lang["file_upload.actions.use_existing"]):"",s("<option />",{selected:this.defaultAction===d.SKIP}).val(d.SKIP).text(TYPO3.lang["file_upload.actions.skip"]),s("<option />",{selected:this.defaultAction===d.RENAME}).val(d.RENAME).text(TYPO3.lang["file_upload.actions.rename"]),s("<option />",{selected:this.defaultAction===d.OVERRIDE}).val(d.OVERRIDE).text(TYPO3.lang["file_upload.actions.override"]))));t.find("table").append("<tbody />").append(e)}const r=o.confirm(TYPO3.lang["file_upload.existingfiles.title"],t,i.SeverityEnum.warning,[{text:s(this).data("button-close-text")||TYPO3.lang["file_upload.button.cancel"]||"Cancel",active:!0,btnClass:"btn-default",name:"cancel"},{text:s(this).data("button-ok-text")||TYPO3.lang["file_upload.button.continue"]||"Continue with selected actions",btnClass:"btn-warning",name:"continue"}],["modal-inner-scroll"]);r.find(".modal-dialog").addClass("modal-lg"),r.find(".modal-footer").prepend(s("<span/>").addClass("form-inline").append(s("<label/>").text(TYPO3.lang["file_upload.actions.all.label"]),s("<select/>",{class:"form-control t3js-actions-all"}).append(s("<option/>").val("").text(TYPO3.lang["file_upload.actions.all.empty"]),this.irreObjectUid?s("<option/>").val(d.USE_EXISTING).text(TYPO3.lang["file_upload.actions.all.use_existing"]):"",s("<option/>",{selected:this.defaultAction===d.SKIP}).val(d.SKIP).text(TYPO3.lang["file_upload.actions.all.skip"]),s("<option/>",{selected:this.defaultAction===d.RENAME}).val(d.RENAME).text(TYPO3.lang["file_upload.actions.all.rename"]),s("<option/>",{selected:this.defaultAction===d.OVERRIDE}).val(d.OVERRIDE).text(TYPO3.lang["file_upload.actions.all.override"]))));const n=this;r.on("change",".t3js-actions-all",function(){const e=s(this).val();""!==e?r.find(".t3js-actions").each((t,i)=>{const a=s(i),r=parseInt(a.data("override"),10);a.val(e).prop("disabled","disabled"),n.askForOverride[r].action=a.val()}):r.find(".t3js-actions").removeProp("disabled")}).on("change",".t3js-actions",function(){const e=s(this),t=parseInt(e.data("override"),10);n.askForOverride[t].action=e.val()}).on("button.clicked",function(e){"cancel"===e.target.name?(n.askForOverride=[],o.dismiss()):"continue"===e.target.name&&(s.each(n.askForOverride,(e,t)=>{t.action===d.USE_EXISTING?g.addFileToIrre(n.irreObjectUid,t.original):t.action!==d.SKIP&&new h(n,t.uploaded,t.action)}),n.askForOverride=[],o.dismiss())}).on("hidden.bs.modal",()=>{this.askForOverride=[]})}}class h{constructor(e,t,i){if(this.dragUploader=e,this.file=t,this.override=i,this.$row=s("<tr />").addClass("upload-queue-item uploading"),this.$iconCol=s("<td />").addClass("col-icon").appendTo(this.$row),this.$fileName=s("<td />").text(t.name).appendTo(this.$row),this.$progress=s("<td />").attr("colspan",this.dragUploader.fileListColumnCount-2).appendTo(this.$row),this.$progressContainer=s("<div />").addClass("upload-queue-progress").appendTo(this.$progress),this.$progressBar=s("<div />").addClass("upload-queue-progress-bar").appendTo(this.$progressContainer),this.$progressPercentage=s("<span />").addClass("upload-queue-progress-percentage").appendTo(this.$progressContainer),this.$progressMessage=s("<span />").addClass("upload-queue-progress-message").appendTo(this.$progressContainer),0===s("tbody tr.upload-queue-item",this.dragUploader.$fileList).length?(this.$row.prependTo(s("tbody",this.dragUploader.$fileList)),this.$row.addClass("last")):this.$row.insertBefore(s("tbody tr.upload-queue-item:first",this.dragUploader.$fileList)),this.$iconCol.html('<span class="t3-icon t3-icon-mimetypes t3-icon-other-other">&nbsp;</span>'),this.dragUploader.maxFileSize>0&&this.file.size>this.dragUploader.maxFileSize)this.updateMessage(TYPO3.lang["file_upload.maxFileSizeExceeded"].replace(/\{0\}/g,this.file.name).replace(/\{1\}/g,g.fileSizeAsString(this.dragUploader.maxFileSize))),this.$row.addClass("error");else if(this.dragUploader.fileDenyPattern&&this.file.name.match(this.dragUploader.fileDenyPattern))this.updateMessage(TYPO3.lang["file_upload.fileNotAllowed"].replace(/\{0\}/g,this.file.name)),this.$row.addClass("error");else if(this.checkAllowedExtensions()){this.updateMessage("- "+g.fileSizeAsString(this.file.size));const e=new FormData;e.append("data[upload][1][target]",this.dragUploader.target),e.append("data[upload][1][data]","1"),e.append("overwriteExistingFiles",this.override),e.append("redirect",""),e.append("upload_1",this.file);const t=s.extend(!0,{},s.ajaxSettings,{url:TYPO3.settings.ajaxUrls.file_process,contentType:!1,processData:!1,data:e,cache:!1,type:"POST",success:e=>this.uploadSuccess(e),error:e=>this.uploadError(e)});t.xhr=(()=>{const e=s.ajaxSettings.xhr();return e.upload.addEventListener("progress",e=>this.updateProgress(e)),e}),this.upload=s.ajax(t)}else this.updateMessage(TYPO3.lang["file_upload.fileExtensionExpected"].replace(/\{0\}/g,this.dragUploader.filesExtensionsAllowed)),this.$row.addClass("error")}updateMessage(e){this.$progressMessage.text(e)}removeProgress(){this.$progress&&this.$progress.remove()}uploadStart(){this.$progressPercentage.text("(0%)"),this.$progressBar.width("1%"),this.dragUploader.$trigger.trigger("uploadStart",[this])}uploadError(e){this.updateMessage(TYPO3.lang["file_upload.uploadFailed"].replace(/\{0\}/g,this.file.name));const t=s(e.responseText);t.is("t3err")?this.$progressPercentage.text(t.text()):this.$progressPercentage.text("("+e.statusText+")"),this.$row.addClass("error"),this.dragUploader.decrementQueueLength(),this.dragUploader.$trigger.trigger("uploadError",[this,e])}updateProgress(e){const t=Math.round(e.loaded/e.total*100)+"%";this.$progressBar.outerWidth(t),this.$progressPercentage.text(t),this.dragUploader.$trigger.trigger("updateProgress",[this,t,e])}uploadSuccess(e){e.upload&&(this.dragUploader.decrementQueueLength(),this.$row.removeClass("uploading"),this.$fileName.text(e.upload[0].name),this.$progressPercentage.text(""),this.$progressMessage.text("100%"),this.$progressBar.outerWidth("100%"),e.upload[0].icon&&this.$iconCol.html('<a href="#" class="t3js-contextmenutrigger" data-uid="'+e.upload[0].id+'" data-table="sys_file">'+e.upload[0].icon+"&nbsp;</span></a>"),this.dragUploader.irreObjectUid?(g.addFileToIrre(this.dragUploader.irreObjectUid,e.upload[0]),setTimeout(()=>{this.$row.remove(),0===s("tr",this.dragUploader.$fileList).length&&(this.dragUploader.$fileList.hide(),this.dragUploader.$trigger.trigger("uploadSuccess",[this,e]))},3e3)):setTimeout(()=>{this.showFileInfo(e.upload[0]),this.dragUploader.$trigger.trigger("uploadSuccess",[this,e])},3e3))}showFileInfo(e){this.removeProgress();for(let e=7;e<this.dragUploader.fileListColumnCount;e++)s("<td />").text("").appendTo(this.$row);s("<td />").text(e.extension.toUpperCase()).appendTo(this.$row),s("<td />").text(e.date).appendTo(this.$row),s("<td />").text(g.fileSizeAsString(e.size)).appendTo(this.$row);let t="";e.permissions.read&&(t+='<strong class="text-danger">'+TYPO3.lang["permissions.read"]+"</strong>"),e.permissions.write&&(t+='<strong class="text-danger">'+TYPO3.lang["permissions.write"]+"</strong>"),s("<td />").html(t).appendTo(this.$row),s("<td />").text("-").appendTo(this.$row)}checkAllowedExtensions(){if(!this.dragUploader.filesExtensionsAllowed)return!0;const e=this.file.name.split(".").pop(),t=this.dragUploader.filesExtensionsAllowed.split(",");return-1!==s.inArray(e.toLowerCase(),t)}}class g{static fileSizeAsString(e){const t=e/1024;let i="";return i=t>1024?(t/1024).toFixed(1)+" MB":t.toFixed(1)+" KB"}static addFileToIrre(e,t){const i={objectGroup:e,table:"sys_file",uid:t.uid};l.MessageUtility.send(i)}static init(){const e=this.options;s.fn.extend({dragUploader:function(e){return this.each((t,i)=>{const a=s(i);let r=a.data("DragUploaderPlugin");r||a.data("DragUploaderPlugin",r=new p(i)),"string"==typeof e&&r[e]()})}}),s(()=>{s(".t3js-drag-uploader").dragUploader(e)})}}t.initialize=function(){g.init(),void 0!==TYPO3.settings&&void 0!==TYPO3.settings.RequireJS&&void 0!==TYPO3.settings.RequireJS.PostInitializationModules&&void 0!==TYPO3.settings.RequireJS.PostInitializationModules["TYPO3/CMS/Backend/DragUploader"]&&s.each(TYPO3.settings.RequireJS.PostInitializationModules["TYPO3/CMS/Backend/DragUploader"],(t,i)=>{e([i])})},t.initialize()});
\ No newline at end of file
index 5d1374d..10fc5aa 100644 (file)
@@ -10,4 +10,4 @@
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require","exports","jquery","TYPO3/CMS/Backend/FormEngineValidation","./Icons","./Modal","TYPO3/CMS/Core/Contrib/imagesloaded.pkgd.min","jquery-ui/draggable","jquery-ui/resizable"],function(t,r,e,i,a,s,o){"use strict";class n{constructor(){this.cropImageContainerSelector="#t3js-crop-image-container",this.cropImageSelector="#t3js-crop-image",this.coverAreaSelector=".t3js-cropper-cover-area",this.cropInfoSelector=".t3js-cropper-info-crop",this.focusAreaSelector="#t3js-cropper-focus-area",this.defaultFocusArea={height:1/3,width:1/3,x:0,y:0},this.defaultOpts={autoCrop:!0,autoCropArea:"0.7",dragMode:"crop",guides:!0,responsive:!0,viewMode:1,zoomable:!1},this.resizeTimeout=450,this.cropBuiltHandler=(()=>{const t=this.cropper.cropper("getImageData"),r=this.currentModal.find(this.cropImageSelector);this.imageOriginalSizeFactor=r.data("originalWidth")/t.naturalWidth,this.cropVariantTriggers.each((r,i)=>{const a=e(i).attr("data-crop-variant-id"),s=this.convertRelativeToAbsoluteCropArea(this.data[a].cropArea,t),o=e.extend(!0,{},this.data[a],{cropArea:s});this.updatePreviewThumbnail(o,e(i))}),this.currentCropVariant.cropArea=this.convertRelativeToAbsoluteCropArea(this.currentCropVariant.cropArea,t),this.cropBox=this.currentModal.find(".cropper-crop-box"),this.setCropArea(this.currentCropVariant.cropArea),this.currentCropVariant.coverAreas&&this.initCoverAreas(this.cropBox,this.currentCropVariant.coverAreas),this.currentCropVariant.focusArea&&(n.isEmptyArea(this.currentCropVariant.focusArea)&&(this.currentCropVariant.focusArea=e.extend(!0,{},this.defaultFocusArea)),this.initFocusArea(this.cropBox),this.scaleAndMoveFocusArea(this.currentCropVariant.focusArea)),this.currentCropVariant.selectedRatio&&(this.setAspectRatio(this.currentCropVariant.allowedAspectRatios[this.currentCropVariant.selectedRatio]),this.setCropArea(this.currentCropVariant.cropArea),this.currentModal.find(`[data-option='${this.currentCropVariant.selectedRatio}']`).addClass("active")),this.cropperCanvas.addClass("is-visible")}),this.cropMoveHandler=(t=>{this.currentCropVariant.cropArea=e.extend(!0,this.currentCropVariant.cropArea,{height:Math.floor(t.height),width:Math.floor(t.width),x:Math.floor(t.x),y:Math.floor(t.y)}),this.updatePreviewThumbnail(this.currentCropVariant,this.activeCropVariantTrigger),this.updateCropVariantData(this.currentCropVariant);const r=Math.round(this.currentCropVariant.cropArea.width*this.imageOriginalSizeFactor),i=Math.round(this.currentCropVariant.cropArea.height*this.imageOriginalSizeFactor);this.cropInfo.text(`${r}×${i} px`)}),this.cropStartHandler=(()=>{this.currentCropVariant.focusArea&&(this.focusArea.draggable("option","disabled",!0),this.focusArea.resizable("option","disabled",!0))}),this.cropEndHandler=(()=>{this.currentCropVariant.focusArea&&(this.focusArea.draggable("option","disabled",!1),this.focusArea.resizable("option","disabled",!1))}),e(window).resize(()=>{this.cropper&&this.cropper.cropper("destroy")}),this.resizeEnd(()=>{this.cropper&&this.init()})}static isEmptyArea(t){return e.isEmptyObject(t)}static wait(t,r){window.setTimeout(t,r)}static toCssPercent(t){return`${100*t}%`}static serializeCropVariants(t){return JSON.stringify(t,(t,r)=>"id"===t||"title"===t||"allowedAspectRatios"===t||"coverAreas"===t?void 0:r)}initializeTrigger(){e(".t3js-image-manipulation-trigger").off("click").click(t=>{t.preventDefault(),this.trigger=e(t.currentTarget),this.show()})}initializeCropperModal(){const t=this.currentModal.find(this.cropImageSelector);o(t,()=>{setTimeout(()=>{this.init()},100)})}show(){const t=this.trigger.data("modalTitle"),r=this.trigger.data("buttonPreviewText"),i=this.trigger.data("buttonDismissText"),o=this.trigger.data("buttonSaveText"),n=this.trigger.data("url"),c=this.trigger.data("payload"),h=this.initializeCropperModal.bind(this);a.getIcon("spinner-circle",a.sizes.default,null,null,a.markupIdentifiers.inline).done(a=>{this.currentModal=s.advanced({additionalCssClasses:["modal-image-manipulation"],buttons:[{btnClass:"btn-default pull-left",dataAttributes:{method:"preview"},icon:"actions-view",text:r},{btnClass:"btn-default",dataAttributes:{method:"dismiss"},icon:"actions-close",text:i},{btnClass:"btn-primary",dataAttributes:{method:"save"},icon:"actions-document-save",text:o}],callback:t=>{e.post({url:n,data:c}).done(r=>{h(),t.find(".t3js-modal-body").append(r).addClass("cropper")})},content:e('<div class="modal-loading">').append(a),size:s.sizes.full,style:s.styles.dark,title:t}),this.currentModal.on("hide.bs.modal",t=>{this.destroy()}),this.currentModal.data("bs.modal").options.backdrop="static"})}init(){const t=this.currentModal.find(this.cropImageSelector),r=e(t).height(),i=e(t).width(),a=this.trigger.attr("data-crop-variants");if(!a)throw new TypeError("ImageManipulation: No cropVariants data found for image");this.data=e.isEmptyObject(this.data)?JSON.parse(a):this.data,this.currentModal.find(this.cropImageContainerSelector).css({height:r,width:i}),this.cropVariantTriggers=this.currentModal.find(".t3js-crop-variant-trigger"),this.activeCropVariantTrigger=this.currentModal.find(".t3js-crop-variant-trigger.is-active"),this.cropInfo=this.currentModal.find(this.cropInfoSelector),this.saveButton=this.currentModal.find("[data-method=save]"),this.previewButton=this.currentModal.find("[data-method=preview]"),this.dismissButton=this.currentModal.find("[data-method=dismiss]"),this.resetButton=this.currentModal.find("[data-method=reset]"),this.cropperCanvas=this.currentModal.find("#js-crop-canvas"),this.aspectRatioTrigger=this.currentModal.find("[data-method=setAspectRatio]"),this.currentCropVariant=this.data[this.activeCropVariantTrigger.attr("data-crop-variant-id")],this.cropVariantTriggers.off("click").on("click",t=>{if(e(t.currentTarget).hasClass("is-active"))return t.stopPropagation(),void t.preventDefault();this.activeCropVariantTrigger.removeClass("is-active"),e(t.currentTarget).addClass("is-active"),this.activeCropVariantTrigger=e(t.currentTarget);const r=this.data[this.activeCropVariantTrigger.attr("data-crop-variant-id")],i=this.cropper.cropper("getImageData");r.cropArea=this.convertRelativeToAbsoluteCropArea(r.cropArea,i),this.currentCropVariant=e.extend(!0,{},r),this.update(r)}),this.aspectRatioTrigger.off("click").on("click",t=>{const r=e(t.currentTarget).attr("data-option"),i=e.extend(!0,{},this.currentCropVariant),a=i.allowedAspectRatios[r];this.setAspectRatio(a),this.setCropArea(i.cropArea),this.currentCropVariant=e.extend(!0,{},i,{selectedRatio:r}),this.update(this.currentCropVariant)}),this.saveButton.off("click").on("click",()=>{this.save(this.data)}),this.trigger.attr("data-preview-url")?this.previewButton.off("click").on("click",()=>{this.openPreview(this.data)}):this.previewButton.hide(),this.dismissButton.off("click").on("click",()=>{this.currentModal.modal("hide")}),this.resetButton.off("click").on("click",t=>{const r=this.cropper.cropper("getImageData"),i=e(t.currentTarget).attr("data-crop-variant");if(t.preventDefault(),t.stopPropagation(),!i)throw new TypeError("TYPO3 Cropper: No cropVariant data attribute found on reset element.");const a=JSON.parse(i),s=this.convertRelativeToAbsoluteCropArea(a.cropArea,r);this.currentCropVariant=e.extend(!0,{},a,{cropArea:s}),this.update(this.currentCropVariant)}),n.isEmptyArea(this.currentCropVariant.cropArea)&&(this.defaultOpts=e.extend({autoCropArea:1},this.defaultOpts)),this.cropper=top.$(t).cropper(e.extend(this.defaultOpts,{built:this.cropBuiltHandler,crop:this.cropMoveHandler,cropend:this.cropEndHandler,cropstart:this.cropStartHandler,data:this.currentCropVariant.cropArea}))}update(t){const r=e.extend(!0,{},t),i=t.allowedAspectRatios[t.selectedRatio];this.currentModal.find("[data-option]").removeClass("active"),this.currentModal.find(`[data-option="${t.selectedRatio}"]`).addClass("active"),this.setAspectRatio(i),this.setCropArea(r.cropArea),this.currentCropVariant=e.extend(!0,{},r,t),this.cropBox.find(this.coverAreaSelector).remove(),this.cropBox.has(this.focusAreaSelector).length&&(this.focusArea.resizable("destroy").draggable("destroy"),this.focusArea.remove()),t.focusArea&&(n.isEmptyArea(t.focusArea)&&(this.currentCropVariant.focusArea=e.extend(!0,{},this.defaultFocusArea)),this.initFocusArea(this.cropBox),this.scaleAndMoveFocusArea(this.currentCropVariant.focusArea)),t.coverAreas&&this.initCoverAreas(this.cropBox,this.currentCropVariant.coverAreas),this.updatePreviewThumbnail(this.currentCropVariant,this.activeCropVariantTrigger)}initFocusArea(t){this.focusArea=e('<div id="t3js-cropper-focus-area" class="cropper-focus-area"></div>'),t.append(this.focusArea),this.focusArea.draggable({containment:t,create:()=>{this.scaleAndMoveFocusArea(this.currentCropVariant.focusArea)},drag:()=>{const{left:r,top:e}=t.offset(),{left:i,top:a}=this.focusArea.offset(),{focusArea:s,coverAreas:o}=this.currentCropVariant;s.x=(i-r)/t.width(),s.y=(a-e)/t.height(),this.updatePreviewThumbnail(this.currentCropVariant,this.activeCropVariantTrigger),this.checkFocusAndCoverAreasCollision(s,o)?this.focusArea.addClass("has-nodrop"):this.focusArea.removeClass("has-nodrop")},revert:()=>{const{left:r,top:e}=t.offset(),{left:i,top:a}=this.focusArea.offset(),{focusArea:s,coverAreas:o}=this.currentCropVariant;return!!this.checkFocusAndCoverAreasCollision(s,o)&&(this.focusArea.removeClass("has-nodrop"),n.wait(()=>{s.x=(i-r)/t.width(),s.y=(a-e)/t.height(),this.updateCropVariantData(this.currentCropVariant)},250),!0)},revertDuration:200,stop:()=>{const{left:r,top:e}=t.offset(),{left:i,top:a}=this.focusArea.offset(),{focusArea:s}=this.currentCropVariant;s.x=(i-r)/t.width(),s.y=(a-e)/t.height(),this.scaleAndMoveFocusArea(s)}}).resizable({containment:t,handles:"all",resize:()=>{const{left:r,top:e}=t.offset(),{left:i,top:a}=this.focusArea.offset(),{focusArea:s,coverAreas:o}=this.currentCropVariant;s.height=this.focusArea.height()/t.height(),s.width=this.focusArea.width()/t.width(),s.x=(i-r)/t.width(),s.y=(a-e)/t.height(),this.updatePreviewThumbnail(this.currentCropVariant,this.activeCropVariantTrigger),this.checkFocusAndCoverAreasCollision(s,o)?this.focusArea.addClass("has-nodrop"):this.focusArea.removeClass("has-nodrop")},stop:(r,i)=>{const{left:a,top:s}=t.offset(),{left:o,top:n}=this.focusArea.offset(),{focusArea:c,coverAreas:h}=this.currentCropVariant;this.checkFocusAndCoverAreasCollision(c,h)?i.element.animate(e.extend(i.originalPosition,i.originalSize),250,()=>{c.height=this.focusArea.height()/t.height(),c.height=this.focusArea.height()/t.height(),c.width=this.focusArea.width()/t.width(),c.x=(o-a)/t.width(),c.y=(n-s)/t.height(),this.scaleAndMoveFocusArea(c),this.focusArea.removeClass("has-nodrop")}):this.scaleAndMoveFocusArea(c)}})}initCoverAreas(t,r){r.forEach(r=>{const i=e('<div class="cropper-cover-area t3js-cropper-cover-area"></div>');t.append(i),i.css({height:n.toCssPercent(r.height),left:n.toCssPercent(r.x),top:n.toCssPercent(r.y),width:n.toCssPercent(r.width)})})}updatePreviewThumbnail(t,r){let e;const i=r.find(".t3js-cropper-preview-thumbnail-crop-area"),a=r.find(".t3js-cropper-preview-thumbnail-crop-image"),s=r.find(".t3js-cropper-preview-thumbnail-focus-area"),o=this.cropper.cropper("getImageData");i.css({height:n.toCssPercent(t.cropArea.height/o.naturalHeight),left:n.toCssPercent(t.cropArea.x/o.naturalWidth),top:n.toCssPercent(t.cropArea.y/o.naturalHeight),width:n.toCssPercent(t.cropArea.width/o.naturalWidth)}),t.focusArea&&s.css({height:n.toCssPercent(t.focusArea.height),left:n.toCssPercent(t.focusArea.x),top:n.toCssPercent(t.focusArea.y),width:n.toCssPercent(t.focusArea.width)}),e=i.css(["width","height","left","top"]),a.css({height:`${parseFloat(e.height)*(1/(t.cropArea.height/o.naturalHeight))}px`,margin:`${-1*parseFloat(e.left)}px`,marginTop:`${-1*parseFloat(e.top)}px`,width:`${parseFloat(e.width)*(1/(t.cropArea.width/o.naturalWidth))}px`})}scaleAndMoveFocusArea(t){this.focusArea.css({height:n.toCssPercent(t.height),left:n.toCssPercent(t.x),top:n.toCssPercent(t.y),width:n.toCssPercent(t.width)}),this.currentCropVariant.focusArea=t,this.updatePreviewThumbnail(this.currentCropVariant,this.activeCropVariantTrigger),this.updateCropVariantData(this.currentCropVariant)}updateCropVariantData(t){const r=this.cropper.cropper("getImageData"),i=this.convertAbsoluteToRelativeCropArea(t.cropArea,r);this.data[t.id]=e.extend(!0,{},t,{cropArea:i})}setAspectRatio(t){this.cropper.cropper("setAspectRatio",t.value)}setCropArea(t){0===this.currentCropVariant.allowedAspectRatios[this.currentCropVariant.selectedRatio].value?this.cropper.cropper("setData",{height:t.height,width:t.width,x:t.x,y:t.y}):this.cropper.cropper("setData",{height:t.height,x:t.x,y:t.y})}checkFocusAndCoverAreasCollision(t,r){return!!r&&r.some(r=>t.x<r.x+r.width&&t.x+t.width>r.x&&t.y<r.y+r.height&&t.height+t.y>r.y)}convertAbsoluteToRelativeCropArea(t,r){const{height:e,width:i,x:a,y:s}=t;return{height:e/r.naturalHeight,width:i/r.naturalWidth,x:a/r.naturalWidth,y:s/r.naturalHeight}}convertRelativeToAbsoluteCropArea(t,r){const{height:e,width:i,x:a,y:s}=t;return{height:e*r.naturalHeight,width:i*r.naturalWidth,x:a*r.naturalWidth,y:s*r.naturalHeight}}setPreviewImages(t){const r=this.cropper,i=r.cropper("getImageData");Object.keys(t).forEach(a=>{const s=t[a],o=this.convertRelativeToAbsoluteCropArea(s.cropArea,i),n=this.trigger.closest(".form-group").find(`.t3js-image-manipulation-preview[data-crop-variant-id="${a}"]`),c=this.trigger.closest(".form-group").find(`.t3js-image-manipulation-selected-ratio[data-crop-variant-id="${a}"]`);if(0===n.length)return;let h=n.width(),p=n.data("preview-height");const d=o.width/o.height,l=h/d;l>p?h=p*d:p=l,h>o.width&&(h=o.width,p=o.height);const u=h/o.width,g=e("<div />").html('<img src="'+r.attr("src")+'">'),f=this.currentModal.find(`.t3-js-ratio-title[data-ratio-id="${s.id}${s.selectedRatio}"]`);c.text(f.text()),g.addClass("cropper-preview-container"),n.empty().append(g),g.wrap('<span class="thumbnail thumbnail-status"></span>'),g.width(h).height(p).find("img").css({height:i.naturalHeight*u,left:-o.x*u,top:-o.y*u,width:i.naturalWidth*u})})}openPreview(t){const r=n.serializeCropVariants(t);let e=this.trigger.attr("data-preview-url");e=e+"&cropVariants="+encodeURIComponent(r),window.open(e,"TYPO3ImageManipulationPreview")}save(t){const r=n.serializeCropVariants(t),a=e(`#${this.trigger.attr("data-field")}`);this.trigger.attr("data-crop-variants",JSON.stringify(t)),this.setPreviewImages(t),a.val(r),i.markFieldAsChanged(a),this.currentModal.modal("hide")}destroy(){this.currentModal&&(void 0!==this.cropper&&null!==this.cropper&&this.cropper.cropper("destroy"),this.cropper=null,this.currentModal=null,this.data=null)}resizeEnd(t){let r;e(window).on("resize",()=>{clearTimeout(r),r=setTimeout(()=>{t()},this.resizeTimeout)})}}return new n});
\ No newline at end of file
+define(["require","exports","jquery","TYPO3/CMS/Backend/FormEngineValidation","./Icons","./Modal","TYPO3/CMS/Core/Contrib/imagesloaded.pkgd.min","jquery-ui/draggable","jquery-ui/resizable"],function(t,r,e,i,a,s,o){"use strict";class n{constructor(){this.cropImageContainerSelector="#t3js-crop-image-container",this.cropImageSelector="#t3js-crop-image",this.coverAreaSelector=".t3js-cropper-cover-area",this.cropInfoSelector=".t3js-cropper-info-crop",this.focusAreaSelector="#t3js-cropper-focus-area",this.defaultFocusArea={height:1/3,width:1/3,x:0,y:0},this.defaultOpts={autoCrop:!0,autoCropArea:"0.7",dragMode:"crop",guides:!0,responsive:!0,viewMode:1,zoomable:!1},this.resizeTimeout=450,this.cropBuiltHandler=(()=>{const t=this.cropper.cropper("getImageData"),r=this.currentModal.find(this.cropImageSelector);this.imageOriginalSizeFactor=r.data("originalWidth")/t.naturalWidth,this.cropVariantTriggers.each((r,i)=>{const a=e(i).attr("data-crop-variant-id"),s=this.convertRelativeToAbsoluteCropArea(this.data[a].cropArea,t),o=e.extend(!0,{},this.data[a],{cropArea:s});this.updatePreviewThumbnail(o,e(i))}),this.currentCropVariant.cropArea=this.convertRelativeToAbsoluteCropArea(this.currentCropVariant.cropArea,t),this.cropBox=this.currentModal.find(".cropper-crop-box"),this.setCropArea(this.currentCropVariant.cropArea),this.currentCropVariant.coverAreas&&this.initCoverAreas(this.cropBox,this.currentCropVariant.coverAreas),this.currentCropVariant.focusArea&&(n.isEmptyArea(this.currentCropVariant.focusArea)&&(this.currentCropVariant.focusArea=e.extend(!0,{},this.defaultFocusArea)),this.initFocusArea(this.cropBox),this.scaleAndMoveFocusArea(this.currentCropVariant.focusArea)),this.currentCropVariant.selectedRatio&&(this.setAspectRatio(this.currentCropVariant.allowedAspectRatios[this.currentCropVariant.selectedRatio]),this.setCropArea(this.currentCropVariant.cropArea),this.currentModal.find(`[data-option='${this.currentCropVariant.selectedRatio}']`).addClass("active")),this.cropperCanvas.addClass("is-visible")}),this.cropMoveHandler=(t=>{this.currentCropVariant.cropArea=e.extend(!0,this.currentCropVariant.cropArea,{height:Math.floor(t.height),width:Math.floor(t.width),x:Math.floor(t.x),y:Math.floor(t.y)}),this.updatePreviewThumbnail(this.currentCropVariant,this.activeCropVariantTrigger),this.updateCropVariantData(this.currentCropVariant);const r=Math.round(this.currentCropVariant.cropArea.width*this.imageOriginalSizeFactor),i=Math.round(this.currentCropVariant.cropArea.height*this.imageOriginalSizeFactor);this.cropInfo.text(`${r}×${i} px`)}),this.cropStartHandler=(()=>{this.currentCropVariant.focusArea&&(this.focusArea.draggable("option","disabled",!0),this.focusArea.resizable("option","disabled",!0))}),this.cropEndHandler=(()=>{this.currentCropVariant.focusArea&&(this.focusArea.draggable("option","disabled",!1),this.focusArea.resizable("option","disabled",!1))}),e(window).resize(()=>{this.cropper&&this.cropper.cropper("destroy")}),this.resizeEnd(()=>{this.cropper&&this.init()})}static isEmptyArea(t){return e.isEmptyObject(t)}static wait(t,r){window.setTimeout(t,r)}static toCssPercent(t){return`${100*t}%`}static serializeCropVariants(t){return JSON.stringify(t,(t,r)=>"id"===t||"title"===t||"allowedAspectRatios"===t||"coverAreas"===t?void 0:r)}initializeTrigger(){e(".t3js-image-manipulation-trigger").off("click").click(t=>{t.preventDefault(),this.trigger=e(t.currentTarget),this.show()})}initializeCropperModal(){const t=this.currentModal.find(this.cropImageSelector);o(t,()=>{setTimeout(()=>{this.init()},100)})}show(){const t=this.trigger.data("modalTitle"),r=this.trigger.data("buttonPreviewText"),i=this.trigger.data("buttonDismissText"),o=this.trigger.data("buttonSaveText"),n=this.trigger.data("url"),c=this.trigger.data("payload"),h=this.initializeCropperModal.bind(this);a.getIcon("spinner-circle",a.sizes.default,null,null,a.markupIdentifiers.inline).done(a=>{this.currentModal=s.advanced({additionalCssClasses:["modal-image-manipulation"],buttons:[{btnClass:"btn-default pull-left",dataAttributes:{method:"preview"},icon:"actions-view",text:r},{btnClass:"btn-default",dataAttributes:{method:"dismiss"},icon:"actions-close",text:i},{btnClass:"btn-primary",dataAttributes:{method:"save"},icon:"actions-document-save",text:o}],callback:t=>{e.post({url:n,data:c}).done(r=>{h(),t.find(".t3js-modal-body").append(r).addClass("cropper")})},content:e('<div class="modal-loading">').append(a),size:s.sizes.full,style:s.styles.dark,title:t}),this.currentModal.on("hide.bs.modal",()=>{this.destroy()}),this.currentModal.data("bs.modal").options.backdrop="static"})}init(){const t=this.currentModal.find(this.cropImageSelector),r=e(t).height(),i=e(t).width(),a=this.trigger.attr("data-crop-variants");if(!a)throw new TypeError("ImageManipulation: No cropVariants data found for image");this.data=e.isEmptyObject(this.data)?JSON.parse(a):this.data,this.currentModal.find(this.cropImageContainerSelector).css({height:r,width:i}),this.cropVariantTriggers=this.currentModal.find(".t3js-crop-variant-trigger"),this.activeCropVariantTrigger=this.currentModal.find(".t3js-crop-variant-trigger.is-active"),this.cropInfo=this.currentModal.find(this.cropInfoSelector),this.saveButton=this.currentModal.find("[data-method=save]"),this.previewButton=this.currentModal.find("[data-method=preview]"),this.dismissButton=this.currentModal.find("[data-method=dismiss]"),this.resetButton=this.currentModal.find("[data-method=reset]"),this.cropperCanvas=this.currentModal.find("#js-crop-canvas"),this.aspectRatioTrigger=this.currentModal.find("[data-method=setAspectRatio]"),this.currentCropVariant=this.data[this.activeCropVariantTrigger.attr("data-crop-variant-id")],this.cropVariantTriggers.off("click").on("click",t=>{if(e(t.currentTarget).hasClass("is-active"))return t.stopPropagation(),void t.preventDefault();this.activeCropVariantTrigger.removeClass("is-active"),e(t.currentTarget).addClass("is-active"),this.activeCropVariantTrigger=e(t.currentTarget);const r=this.data[this.activeCropVariantTrigger.attr("data-crop-variant-id")],i=this.cropper.cropper("getImageData");r.cropArea=this.convertRelativeToAbsoluteCropArea(r.cropArea,i),this.currentCropVariant=e.extend(!0,{},r),this.update(r)}),this.aspectRatioTrigger.off("click").on("click",t=>{const r=e(t.currentTarget).attr("data-option"),i=e.extend(!0,{},this.currentCropVariant),a=i.allowedAspectRatios[r];this.setAspectRatio(a),this.setCropArea(i.cropArea),this.currentCropVariant=e.extend(!0,{},i,{selectedRatio:r}),this.update(this.currentCropVariant)}),this.saveButton.off("click").on("click",()=>{this.save(this.data)}),this.trigger.attr("data-preview-url")?this.previewButton.off("click").on("click",()=>{this.openPreview(this.data)}):this.previewButton.hide(),this.dismissButton.off("click").on("click",()=>{this.currentModal.modal("hide")}),this.resetButton.off("click").on("click",t=>{const r=this.cropper.cropper("getImageData"),i=e(t.currentTarget).attr("data-crop-variant");if(t.preventDefault(),t.stopPropagation(),!i)throw new TypeError("TYPO3 Cropper: No cropVariant data attribute found on reset element.");const a=JSON.parse(i),s=this.convertRelativeToAbsoluteCropArea(a.cropArea,r);this.currentCropVariant=e.extend(!0,{},a,{cropArea:s}),this.update(this.currentCropVariant)}),n.isEmptyArea(this.currentCropVariant.cropArea)&&(this.defaultOpts=e.extend({autoCropArea:1},this.defaultOpts)),this.cropper=top.$(t).cropper(e.extend(this.defaultOpts,{built:this.cropBuiltHandler,crop:this.cropMoveHandler,cropend:this.cropEndHandler,cropstart:this.cropStartHandler,data:this.currentCropVariant.cropArea}))}update(t){const r=e.extend(!0,{},t),i=t.allowedAspectRatios[t.selectedRatio];this.currentModal.find("[data-option]").removeClass("active"),this.currentModal.find(`[data-option="${t.selectedRatio}"]`).addClass("active"),this.setAspectRatio(i),this.setCropArea(r.cropArea),this.currentCropVariant=e.extend(!0,{},r,t),this.cropBox.find(this.coverAreaSelector).remove(),this.cropBox.has(this.focusAreaSelector).length&&(this.focusArea.resizable("destroy").draggable("destroy"),this.focusArea.remove()),t.focusArea&&(n.isEmptyArea(t.focusArea)&&(this.currentCropVariant.focusArea=e.extend(!0,{},this.defaultFocusArea)),this.initFocusArea(this.cropBox),this.scaleAndMoveFocusArea(this.currentCropVariant.focusArea)),t.coverAreas&&this.initCoverAreas(this.cropBox,this.currentCropVariant.coverAreas),this.updatePreviewThumbnail(this.currentCropVariant,this.activeCropVariantTrigger)}initFocusArea(t){this.focusArea=e('<div id="t3js-cropper-focus-area" class="cropper-focus-area"></div>'),t.append(this.focusArea),this.focusArea.draggable({containment:t,create:()=>{this.scaleAndMoveFocusArea(this.currentCropVariant.focusArea)},drag:()=>{const{left:r,top:e}=t.offset(),{left:i,top:a}=this.focusArea.offset(),{focusArea:s,coverAreas:o}=this.currentCropVariant;s.x=(i-r)/t.width(),s.y=(a-e)/t.height(),this.updatePreviewThumbnail(this.currentCropVariant,this.activeCropVariantTrigger),this.checkFocusAndCoverAreasCollision(s,o)?this.focusArea.addClass("has-nodrop"):this.focusArea.removeClass("has-nodrop")},revert:()=>{const{left:r,top:e}=t.offset(),{left:i,top:a}=this.focusArea.offset(),{focusArea:s,coverAreas:o}=this.currentCropVariant;return!!this.checkFocusAndCoverAreasCollision(s,o)&&(this.focusArea.removeClass("has-nodrop"),n.wait(()=>{s.x=(i-r)/t.width(),s.y=(a-e)/t.height(),this.updateCropVariantData(this.currentCropVariant)},250),!0)},revertDuration:200,stop:()=>{const{left:r,top:e}=t.offset(),{left:i,top:a}=this.focusArea.offset(),{focusArea:s}=this.currentCropVariant;s.x=(i-r)/t.width(),s.y=(a-e)/t.height(),this.scaleAndMoveFocusArea(s)}}).resizable({containment:t,handles:"all",resize:()=>{const{left:r,top:e}=t.offset(),{left:i,top:a}=this.focusArea.offset(),{focusArea:s,coverAreas:o}=this.currentCropVariant;s.height=this.focusArea.height()/t.height(),s.width=this.focusArea.width()/t.width(),s.x=(i-r)/t.width(),s.y=(a-e)/t.height(),this.updatePreviewThumbnail(this.currentCropVariant,this.activeCropVariantTrigger),this.checkFocusAndCoverAreasCollision(s,o)?this.focusArea.addClass("has-nodrop"):this.focusArea.removeClass("has-nodrop")},stop:(r,i)=>{const{left:a,top:s}=t.offset(),{left:o,top:n}=this.focusArea.offset(),{focusArea:c,coverAreas:h}=this.currentCropVariant;this.checkFocusAndCoverAreasCollision(c,h)?i.element.animate(e.extend(i.originalPosition,i.originalSize),250,()=>{c.height=this.focusArea.height()/t.height(),c.height=this.focusArea.height()/t.height(),c.width=this.focusArea.width()/t.width(),c.x=(o-a)/t.width(),c.y=(n-s)/t.height(),this.scaleAndMoveFocusArea(c),this.focusArea.removeClass("has-nodrop")}):this.scaleAndMoveFocusArea(c)}})}initCoverAreas(t,r){r.forEach(r=>{const i=e('<div class="cropper-cover-area t3js-cropper-cover-area"></div>');t.append(i),i.css({height:n.toCssPercent(r.height),left:n.toCssPercent(r.x),top:n.toCssPercent(r.y),width:n.toCssPercent(r.width)})})}updatePreviewThumbnail(t,r){let e;const i=r.find(".t3js-cropper-preview-thumbnail-crop-area"),a=r.find(".t3js-cropper-preview-thumbnail-crop-image"),s=r.find(".t3js-cropper-preview-thumbnail-focus-area"),o=this.cropper.cropper("getImageData");i.css({height:n.toCssPercent(t.cropArea.height/o.naturalHeight),left:n.toCssPercent(t.cropArea.x/o.naturalWidth),top:n.toCssPercent(t.cropArea.y/o.naturalHeight),width:n.toCssPercent(t.cropArea.width/o.naturalWidth)}),t.focusArea&&s.css({height:n.toCssPercent(t.focusArea.height),left:n.toCssPercent(t.focusArea.x),top:n.toCssPercent(t.focusArea.y),width:n.toCssPercent(t.focusArea.width)}),e=i.css(["width","height","left","top"]),a.css({height:`${parseFloat(e.height)*(1/(t.cropArea.height/o.naturalHeight))}px`,margin:`${-1*parseFloat(e.left)}px`,marginTop:`${-1*parseFloat(e.top)}px`,width:`${parseFloat(e.width)*(1/(t.cropArea.width/o.naturalWidth))}px`})}scaleAndMoveFocusArea(t){this.focusArea.css({height:n.toCssPercent(t.height),left:n.toCssPercent(t.x),top:n.toCssPercent(t.y),width:n.toCssPercent(t.width)}),this.currentCropVariant.focusArea=t,this.updatePreviewThumbnail(this.currentCropVariant,this.activeCropVariantTrigger),this.updateCropVariantData(this.currentCropVariant)}updateCropVariantData(t){const r=this.cropper.cropper("getImageData"),i=this.convertAbsoluteToRelativeCropArea(t.cropArea,r);this.data[t.id]=e.extend(!0,{},t,{cropArea:i})}setAspectRatio(t){this.cropper.cropper("setAspectRatio",t.value)}setCropArea(t){0===this.currentCropVariant.allowedAspectRatios[this.currentCropVariant.selectedRatio].value?this.cropper.cropper("setData",{height:t.height,width:t.width,x:t.x,y:t.y}):this.cropper.cropper("setData",{height:t.height,x:t.x,y:t.y})}checkFocusAndCoverAreasCollision(t,r){return!!r&&r.some(r=>t.x<r.x+r.width&&t.x+t.width>r.x&&t.y<r.y+r.height&&t.height+t.y>r.y)}convertAbsoluteToRelativeCropArea(t,r){const{height:e,width:i,x:a,y:s}=t;return{height:e/r.naturalHeight,width:i/r.naturalWidth,x:a/r.naturalWidth,y:s/r.naturalHeight}}convertRelativeToAbsoluteCropArea(t,r){const{height:e,width:i,x:a,y:s}=t;return{height:e*r.naturalHeight,width:i*r.naturalWidth,x:a*r.naturalWidth,y:s*r.naturalHeight}}setPreviewImages(t){const r=this.cropper,i=r.cropper("getImageData");Object.keys(t).forEach(a=>{const s=t[a],o=this.convertRelativeToAbsoluteCropArea(s.cropArea,i),n=this.trigger.closest(".form-group").find(`.t3js-image-manipulation-preview[data-crop-variant-id="${a}"]`),c=this.trigger.closest(".form-group").find(`.t3js-image-manipulation-selected-ratio[data-crop-variant-id="${a}"]`);if(0===n.length)return;let h=n.width(),p=n.data("preview-height");const d=o.width/o.height,l=h/d;l>p?h=p*d:p=l,h>o.width&&(h=o.width,p=o.height);const u=h/o.width,g=e("<div />").html('<img src="'+r.attr("src")+'">'),f=this.currentModal.find(`.t3-js-ratio-title[data-ratio-id="${s.id}${s.selectedRatio}"]`);c.text(f.text()),g.addClass("cropper-preview-container"),n.empty().append(g),g.wrap('<span class="thumbnail thumbnail-status"></span>'),g.width(h).height(p).find("img").css({height:i.naturalHeight*u,left:-o.x*u,top:-o.y*u,width:i.naturalWidth*u})})}openPreview(t){const r=n.serializeCropVariants(t);let e=this.trigger.attr("data-preview-url");e=e+"&cropVariants="+encodeURIComponent(r),window.open(e,"TYPO3ImageManipulationPreview")}save(t){const r=n.serializeCropVariants(t),a=e(`#${this.trigger.attr("data-field")}`);this.trigger.attr("data-crop-variants",JSON.stringify(t)),this.setPreviewImages(t),a.val(r),i.markFieldAsChanged(a),this.currentModal.modal("hide")}destroy(){this.currentModal&&(void 0!==this.cropper&&null!==this.cropper&&this.cropper.cropper("destroy"),this.cropper=null,this.currentModal=null,this.data=null)}resizeEnd(t){let r;e(window).on("resize",()=>{clearTimeout(r),r=setTimeout(()=>{t()},this.resizeTimeout)})}}return new n});
\ No newline at end of file
index d470dd4..654afa8 100644 (file)
@@ -10,4 +10,4 @@
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require","exports","jquery","../AjaxDataHandler","jquery-ui/droppable"],function(e,t,a,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class n{static initialize(){a(n.contentIdentifier).draggable({handle:n.dragHeaderIdentifier,scope:"tt_content",cursor:"move",distance:20,revert:"invalid",zIndex:100,start:(e,t)=>{n.onDragStart(a(e.target))},stop:(e,t)=>{n.onDragStop(a(e.target))}}),a(n.dropZoneIdentifier).droppable({accept:this.contentIdentifier,scope:"tt_content",tolerance:"pointer",over:(e,t)=>{n.onDropHoverOver(a(t.draggable),a(e.target))},out:(e,t)=>{n.onDropHoverOut(a(t.draggable),a(e.target))},drop:(e,t)=>{n.onDrop(a(t.draggable),a(e.target),e)}})}static onDragStart(e){n.originalStyles=e.get(0).style.cssText,e.children(n.dragIdentifier).addClass("dragitem-shadow"),e.append('<div class="ui-draggable-copy-message">'+TYPO3.lang["dragdrop.copy.message"]+"</div>"),e.children(n.dropZoneIdentifier).addClass("drag-start"),e.closest(n.columnIdentifier).removeClass("active"),e.find(n.dropZoneIdentifier).hide(),a(n.dropZoneIdentifier).each((e,t)=>{const o=a(t);o.parent().find(".t3js-toggle-new-content-element-wizard").length?o.addClass(n.validDropZoneClass):o.closest(n.contentIdentifier).find("> "+n.addContentIdentifier+", > > "+n.addContentIdentifier).show()})}static onDragStop(e){e.children(n.dragIdentifier).removeClass("dragitem-shadow"),e.children(n.dropZoneIdentifier).removeClass("drag-start"),e.closest(n.columnIdentifier).addClass("active"),e.find(n.dropZoneIdentifier).show(),e.find(".ui-draggable-copy-message").remove(),e.get(0).style.cssText=n.originalStyles,a(n.dropZoneIdentifier+"."+n.validDropZoneClass).removeClass(n.validDropZoneClass)}static onDropHoverOver(e,t){t.hasClass(n.validDropZoneClass)&&t.addClass(n.dropPossibleHoverClass)}static onDropHoverOut(e,t){t.removeClass(n.dropPossibleHoverClass)}static onDrop(e,t,a){const o=n.getColumnPositionForElement(t);t.removeClass(n.dropPossibleHoverClass);const s=parseInt(e.data("uid"),10);if("number"==typeof s&&s>0){let r={};const i=t.closest(n.contentIdentifier).data("uid");let d=0;d=void 0===i?parseInt(a.target.offsetParent.getAttribute("data-page"),10):0-parseInt(i,10);const l=parseInt(t.closest("[data-language-uid]").data("language-uid"),10);let c=0;0!==d&&(c=o),r.cmd={tt_content:{}},r.data={tt_content:{}};const p=a&&a.originalEvent.ctrlKey||t.hasClass("t3js-paste-copy");p?(r.cmd.tt_content[s]={copy:{action:"paste",target:d,update:{colPos:c,sys_language_uid:l}}},n.ajaxAction(t,e,r,p)):(r.data.tt_content[s]={colPos:c,sys_language_uid:l},r.cmd.tt_content[s]={move:d},n.ajaxAction(t,e,r,p))}}static ajaxAction(e,t,a,s){o.process(a).done(function(a){a.hasErrors||(e.parent().hasClass(n.contentIdentifier.substring(1))?t.detach().css({top:0,left:0}).insertAfter(e.closest(n.contentIdentifier)):t.detach().css({top:0,left:0}).insertAfter(e.closest(n.dropZoneIdentifier)),s&&self.location.reload(!0))})}static getColumnPositionForElement(e){const t=e.closest("[data-colpos]");return!(!t.length||"undefined"===t.data("colpos"))&&t.data("colpos")}}n.contentIdentifier=".t3js-page-ce",n.dragIdentifier=".t3-page-ce-dragitem",n.dragHeaderIdentifier=".t3js-page-ce-draghandle",n.dropZoneIdentifier=".t3js-page-ce-dropzone-available",n.columnIdentifier=".t3js-page-column",n.validDropZoneClass="active",n.dropPossibleHoverClass="t3-page-ce-dropzone-possible",n.addContentIdentifier=".t3js-page-new-ce",n.originalStyles="",t.default=n,a(n.initialize)});
\ No newline at end of file
+define(["require","exports","jquery","../AjaxDataHandler","jquery-ui/droppable"],function(e,t,a,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class n{static initialize(){a(n.contentIdentifier).draggable({handle:n.dragHeaderIdentifier,scope:"tt_content",cursor:"move",distance:20,revert:"invalid",zIndex:100,start:e=>{n.onDragStart(a(e.target))},stop:e=>{n.onDragStop(a(e.target))}}),a(n.dropZoneIdentifier).droppable({accept:this.contentIdentifier,scope:"tt_content",tolerance:"pointer",over:(e,t)=>{n.onDropHoverOver(a(t.draggable),a(e.target))},out:(e,t)=>{n.onDropHoverOut(a(t.draggable),a(e.target))},drop:(e,t)=>{n.onDrop(a(t.draggable),a(e.target),e)}})}static onDragStart(e){n.originalStyles=e.get(0).style.cssText,e.children(n.dragIdentifier).addClass("dragitem-shadow"),e.append('<div class="ui-draggable-copy-message">'+TYPO3.lang["dragdrop.copy.message"]+"</div>"),e.children(n.dropZoneIdentifier).addClass("drag-start"),e.closest(n.columnIdentifier).removeClass("active"),e.find(n.dropZoneIdentifier).hide(),a(n.dropZoneIdentifier).each((e,t)=>{const o=a(t);o.parent().find(".t3js-toggle-new-content-element-wizard").length?o.addClass(n.validDropZoneClass):o.closest(n.contentIdentifier).find("> "+n.addContentIdentifier+", > > "+n.addContentIdentifier).show()})}static onDragStop(e){e.children(n.dragIdentifier).removeClass("dragitem-shadow"),e.children(n.dropZoneIdentifier).removeClass("drag-start"),e.closest(n.columnIdentifier).addClass("active"),e.find(n.dropZoneIdentifier).show(),e.find(".ui-draggable-copy-message").remove(),e.get(0).style.cssText=n.originalStyles,a(n.dropZoneIdentifier+"."+n.validDropZoneClass).removeClass(n.validDropZoneClass)}static onDropHoverOver(e,t){t.hasClass(n.validDropZoneClass)&&t.addClass(n.dropPossibleHoverClass)}static onDropHoverOut(e,t){t.removeClass(n.dropPossibleHoverClass)}static onDrop(e,t,a){const o=n.getColumnPositionForElement(t);t.removeClass(n.dropPossibleHoverClass);const s=parseInt(e.data("uid"),10);if("number"==typeof s&&s>0){let r={};const i=t.closest(n.contentIdentifier).data("uid");let d=0;d=void 0===i?parseInt(a.target.offsetParent.getAttribute("data-page"),10):0-parseInt(i,10);const l=parseInt(t.closest("[data-language-uid]").data("language-uid"),10);let c=0;0!==d&&(c=o),r.cmd={tt_content:{}},r.data={tt_content:{}};const p=a&&a.originalEvent.ctrlKey||t.hasClass("t3js-paste-copy");p?(r.cmd.tt_content[s]={copy:{action:"paste",target:d,update:{colPos:c,sys_language_uid:l}}},n.ajaxAction(t,e,r,p)):(r.data.tt_content[s]={colPos:c,sys_language_uid:l},r.cmd.tt_content[s]={move:d},n.ajaxAction(t,e,r,p))}}static ajaxAction(e,t,a,s){o.process(a).done(function(a){a.hasErrors||(e.parent().hasClass(n.contentIdentifier.substring(1))?t.detach().css({top:0,left:0}).insertAfter(e.closest(n.contentIdentifier)):t.detach().css({top:0,left:0}).insertAfter(e.closest(n.dropZoneIdentifier)),s&&self.location.reload(!0))})}static getColumnPositionForElement(e){const t=e.closest("[data-colpos]");return!(!t.length||"undefined"===t.data("colpos"))&&t.data("colpos")}}n.contentIdentifier=".t3js-page-ce",n.dragIdentifier=".t3-page-ce-dragitem",n.dragHeaderIdentifier=".t3js-page-ce-draghandle",n.dropZoneIdentifier=".t3js-page-ce-dropzone-available",n.columnIdentifier=".t3js-page-column",n.validDropZoneClass="active",n.dropPossibleHoverClass="t3-page-ce-dropzone-possible",n.addContentIdentifier=".t3js-page-new-ce",n.originalStyles="",t.default=n,a(n.initialize)});
\ No newline at end of file
index 1c488ed..84e232c 100644 (file)
@@ -10,4 +10,4 @@
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require","exports","jquery","nprogress","TYPO3/CMS/Backend/Modal","TYPO3/CMS/Backend/Tooltip","TYPO3/CMS/Backend/Severity","TYPO3/CMS/Core/SecurityUtility","./Repository","./Update","./UploadForm","datatables","TYPO3/CMS/Backend/Input/Clearable"],function(e,t,n,a,i,o,r,s,l,c,d){"use strict";const p=new s;var u;!function(e){e.extensionlist="#typo3-extension-list",e.searchField="#Tx_Extensionmanager_extensionkey"}(u||(u={}));class m{constructor(){this.bindExtensionListActions=(()=>{n(".removeExtension").not(".transformed").each((e,t)=>{const a=n(t);a.data("href",a.attr("href")),a.attr("href","#"),a.addClass("transformed"),a.click(()=>{i.confirm(TYPO3.lang["extensionList.removalConfirmation.title"],TYPO3.lang["extensionList.removalConfirmation.question"],r.error,[{text:TYPO3.lang["button.cancel"],active:!0,btnClass:"btn-default",trigger:()=>{i.dismiss()}},{text:TYPO3.lang["button.remove"],btnClass:"btn-danger",trigger:()=>{this.removeExtensionFromDisk(a),i.dismiss()}}])})})}),n(()=>{n.fn.dataTableExt.oSort["extension-asc"]=((e,t)=>m.extensionCompare(e,t)),n.fn.dataTableExt.oSort["extension-desc"]=((e,t)=>{return-1*m.extensionCompare(e,t)}),n.fn.dataTableExt.oSort["version-asc"]=((e,t)=>{return-1*m.versionCompare(e,t)}),n.fn.dataTableExt.oSort["version-desc"]=((e,t)=>m.versionCompare(e,t)),this.Update=new c,this.UploadForm=new d,this.Repository=new l;const e=this.manageExtensionListing();let t;n(document).on("click",".onClickMaskExtensionManager",()=>{a.start()}).on("click","a[data-action=update-extension]",e=>{e.preventDefault(),n.ajax({url:n(this).attr("href"),dataType:"json",beforeSend:()=>{a.start()},success:this.updateExtension})}).on("change","input[name=unlockDependencyIgnoreButton]",e=>{n(".t3js-dependencies").toggleClass("disabled",!n(e.currentTarget).prop("checked"))}),null!==(t=document.querySelector(u.searchField))&&t.clearable({onClear:()=>{e.search("").draw()}}),n(document).on("click",".t3-button-action-installdistribution",()=>{a.start()}),this.Repository.initDom(),this.Update.initializeEvents(),this.UploadForm.initializeEvents(),o.initialize("#typo3-extension-list [title]",{delay:{show:500,hide:100},trigger:"hover",container:"body"})})}manageExtensionListing(){const e=n(u.searchField),t=n(u.extensionlist).DataTable({paging:!1,dom:"lrtip",lengthChange:!1,pageLength:15,stateSave:!0,drawCallback:this.bindExtensionListActions,columns:[null,null,{type:"extension"},null,{type:"version"},{orderable:!1},null,null]});e.parents("form").on("submit",()=>!1);const a=m.getUrlVars(),i=a.search?a.search:t.search();return e.val(i),e.on("input",e=>{t.search(n(e.currentTarget).val()).draw()}),t}removeExtensionFromDisk(e){n.ajax({url:e.data("href"),beforeSend:()=>{a.start()},success:()=>{location.reload()},complete:()=>{a.done()}})}static getUrlVars(){let e,t=[],n=window.location.href.slice(window.location.href.indexOf("?")+1).split("&");for(let a=0;a<n.length;a++)e=n[a].split("="),t.push(e[0]),t[e[0]]=e[1];return t}static versionCompare(e,t){if(e===t)return 0;const n=e.split("."),a=t.split("."),i=Math.min(n.length,a.length);for(let e=0;e<i;e++){if(parseInt(n[e],10)>parseInt(a[e],10))return 1;if(parseInt(n[e],10)<parseInt(a[e],10))return-1}return n.length>a.length?1:n.length<a.length?-1:0}static extensionCompare(e,t){const n=document.createElement("div");n.innerHTML=e;const a=n.textContent||n.innerText||e;n.innerHTML=t;const i=n.textContent||n.innerText||t;return a.trim().localeCompare(i.trim())}updateExtension(e){let t=0;const o=n("<form>");n.each(e.updateComments,(e,a)=>{const i=n("<input>").attr({type:"radio",name:"version"}).val(e);0===t&&i.attr("checked","checked"),o.append([n("<h3>").append([i," "+p.encodeHtml(e)]),n("<div>").append(a.replace(/(\r\n|\n\r|\r|\n)/g,"\n").split(/\n/).map(e=>p.encodeHtml(e)).join("<br>"))]),t++});const s=n("<div>").append([n("<h1>").text(TYPO3.lang["extensionList.updateConfirmation.title"]),n("<h2>").text(TYPO3.lang["extensionList.updateConfirmation.message"]),o]);a.done(),i.confirm(TYPO3.lang["extensionList.updateConfirmation.questionVersionComments"],s,r.warning,[{text:TYPO3.lang["button.cancel"],active:!0,btnClass:"btn-default",trigger:()=>{i.dismiss()}},{text:TYPO3.lang["button.updateExtension"],btnClass:"btn-warning",trigger:()=>{n.ajax({url:e.url,data:{tx_extensionmanager_tools_extensionmanagerextensionmanager:{version:n("input:radio[name=version]:checked",i.currentModal).val()}},dataType:"json",beforeSend:()=>{a.start()},complete:()=>{location.reload()}}),i.dismiss()}}])}}let g=new m;return void 0===TYPO3.ExtensionManager&&(TYPO3.ExtensionManager=g),g});
\ No newline at end of file
+define(["require","exports","jquery","nprogress","TYPO3/CMS/Backend/Modal","TYPO3/CMS/Backend/Tooltip","TYPO3/CMS/Backend/Severity","TYPO3/CMS/Core/SecurityUtility","./Repository","./Update","./UploadForm","datatables","TYPO3/CMS/Backend/Input/Clearable"],function(e,t,n,a,i,o,r,s,l,c,d){"use strict";const p=new s;var u;!function(e){e.extensionlist="#typo3-extension-list",e.searchField="#Tx_Extensionmanager_extensionkey"}(u||(u={}));class m{constructor(){this.bindExtensionListActions=(()=>{n(".removeExtension").not(".transformed").each((e,t)=>{const a=n(t);a.data("href",a.attr("href")),a.attr("href","#"),a.addClass("transformed"),a.click(()=>{i.confirm(TYPO3.lang["extensionList.removalConfirmation.title"],TYPO3.lang["extensionList.removalConfirmation.question"],r.error,[{text:TYPO3.lang["button.cancel"],active:!0,btnClass:"btn-default",trigger:()=>{i.dismiss()}},{text:TYPO3.lang["button.remove"],btnClass:"btn-danger",trigger:()=>{this.removeExtensionFromDisk(a),i.dismiss()}}])})})}),n(()=>{n.fn.dataTableExt.oSort["extension-asc"]=((e,t)=>m.extensionCompare(e,t)),n.fn.dataTableExt.oSort["extension-desc"]=((e,t)=>{return-1*m.extensionCompare(e,t)}),n.fn.dataTableExt.oSort["version-asc"]=((e,t)=>{return-1*m.versionCompare(e,t)}),n.fn.dataTableExt.oSort["version-desc"]=((e,t)=>m.versionCompare(e,t)),this.Update=new c,this.UploadForm=new d,this.Repository=new l;const e=this.manageExtensionListing();let t;n(document).on("click",".onClickMaskExtensionManager",()=>{a.start()}).on("click","a[data-action=update-extension]",e=>{e.preventDefault(),n.ajax({url:n(this).attr("href"),dataType:"json",beforeSend:()=>{a.start()},success:this.updateExtension})}).on("change","input[name=unlockDependencyIgnoreButton]",e=>{n(".t3js-dependencies").toggleClass("disabled",!n(e.currentTarget).prop("checked"))}),null!==(t=document.querySelector(u.searchField))&&t.clearable({onClear:()=>{e.search("").draw()}}),n(document).on("click",".t3-button-action-installdistribution",()=>{a.start()}),this.Repository.initDom(),this.Update.initializeEvents(),this.UploadForm.initializeEvents(),o.initialize("#typo3-extension-list [title]",{delay:{show:500,hide:100},trigger:"hover",container:"body"})})}static getUrlVars(){let e,t=[],n=window.location.href.slice(window.location.href.indexOf("?")+1).split("&");for(let a=0;a<n.length;a++)e=n[a].split("="),t.push(e[0]),t[e[0]]=e[1];return t}static versionCompare(e,t){if(e===t)return 0;const n=e.split("."),a=t.split("."),i=Math.min(n.length,a.length);for(let e=0;e<i;e++){if(parseInt(n[e],10)>parseInt(a[e],10))return 1;if(parseInt(n[e],10)<parseInt(a[e],10))return-1}return n.length>a.length?1:n.length<a.length?-1:0}static extensionCompare(e,t){const n=document.createElement("div");n.innerHTML=e;const a=n.textContent||n.innerText||e;n.innerHTML=t;const i=n.textContent||n.innerText||t;return a.trim().localeCompare(i.trim())}manageExtensionListing(){const e=n(u.searchField),t=n(u.extensionlist).DataTable({paging:!1,dom:"lrtip",lengthChange:!1,pageLength:15,stateSave:!0,drawCallback:this.bindExtensionListActions,columns:[null,null,{type:"extension"},null,{type:"version"},{orderable:!1},null,null]});e.parents("form").on("submit",()=>!1);const a=m.getUrlVars(),i=a.search?a.search:t.search();return e.val(i),e.on("input",e=>{t.search(n(e.currentTarget).val()).draw()}),t}removeExtensionFromDisk(e){n.ajax({url:e.data("href"),beforeSend:()=>{a.start()},success:()=>{location.reload()},complete:()=>{a.done()}})}updateExtension(e){let t=0;const o=n("<form>");n.each(e.updateComments,(e,a)=>{const i=n("<input>").attr({type:"radio",name:"version"}).val(e);0===t&&i.attr("checked","checked"),o.append([n("<h3>").append([i," "+p.encodeHtml(e)]),n("<div>").append(a.replace(/(\r\n|\n\r|\r|\n)/g,"\n").split(/\n/).map(e=>p.encodeHtml(e)).join("<br>"))]),t++});const s=n("<div>").append([n("<h1>").text(TYPO3.lang["extensionList.updateConfirmation.title"]),n("<h2>").text(TYPO3.lang["extensionList.updateConfirmation.message"]),o]);a.done(),i.confirm(TYPO3.lang["extensionList.updateConfirmation.questionVersionComments"],s,r.warning,[{text:TYPO3.lang["button.cancel"],active:!0,btnClass:"btn-default",trigger:()=>{i.dismiss()}},{text:TYPO3.lang["button.updateExtension"],btnClass:"btn-warning",trigger:()=>{n.ajax({url:e.url,data:{tx_extensionmanager_tools_extensionmanagerextensionmanager:{version:n("input:radio[name=version]:checked",i.currentModal).val()}},dataType:"json",beforeSend:()=>{a.start()},complete:()=>{location.reload()}}),i.dismiss()}}])}}let g=new m;return void 0===TYPO3.ExtensionManager&&(TYPO3.ExtensionManager=g),g});
\ No newline at end of file
index cf33442..004da60 100644 (file)
@@ -10,4 +10,4 @@
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require","exports","TYPO3/CMS/Backend/Enum/Severity","jquery","TYPO3/CMS/Backend/Modal","TYPO3/CMS/Backend/Hashing/Md5"],function(t,e,n,o,a,r){"use strict";class s{static getReturnUrl(){return encodeURIComponent(top.list_frame.document.location.pathname+top.list_frame.document.location.search)}static renameFile(t,e){top.TYPO3.Backend.ContentContainer.setUrl(top.TYPO3.settings.FileRename.moduleUrl+"&target="+encodeURIComponent(e)+"&returnUrl="+s.getReturnUrl())}static editFile(t,e){top.TYPO3.Backend.ContentContainer.setUrl(top.TYPO3.settings.FileEdit.moduleUrl+"&target="+encodeURIComponent(e)+"&returnUrl="+s.getReturnUrl())}static editFileStorage(t,e){top.TYPO3.Backend.ContentContainer.setUrl(top.TYPO3.settings.FormEngine.moduleUrl+"&edit[sys_file_storage]["+parseInt(e,10)+"]=edit&returnUrl="+s.getReturnUrl())}static openInfoPopUp(t,e){"sys_file_storage"===t?top.TYPO3.InfoWindow.showItem(t,e):top.TYPO3.InfoWindow.showItem("_FILE",e)}static uploadFile(t,e){top.TYPO3.Backend.ContentContainer.setUrl(top.TYPO3.settings.FileUpload.moduleUrl+"&target="+encodeURIComponent(e)+"&returnUrl="+s.getReturnUrl())}static createFile(t,e){top.TYPO3.Backend.ContentContainer.setUrl(top.TYPO3.settings.FileCreate.moduleUrl+"&target="+encodeURIComponent(e)+"&returnUrl="+s.getReturnUrl())}static deleteFile(t,e){const r=o(this),i=()=>{top.TYPO3.Backend.ContentContainer.setUrl(top.TYPO3.settings.FileCommit.moduleUrl+"&data[delete][0][data]="+encodeURIComponent(e)+"&data[delete][0][redirect]="+s.getReturnUrl())};r.data("title")?a.confirm(r.data("title"),r.data("message"),n.SeverityEnum.warning,[{text:o(this).data("button-close-text")||TYPO3.lang["button.cancel"]||"Cancel",active:!0,btnClass:"btn-default",name:"cancel"},{text:o(this).data("button-ok-text")||TYPO3.lang["button.delete"]||"Delete",btnClass:"btn-warning",name:"delete"}]).on("button.clicked",t=>{"delete"===t.currentTarget.name&&i(),a.dismiss()}):i()}static copyFile(t,e){const n=r.hash(e).substring(0,10);let a=TYPO3.settings.ajaxUrls.contextmenu_clipboard;a+="&CB[el][_FILE%7C"+n+"]="+encodeURIComponent(e)+"&CB[setCopyMode]=1",o.ajax(a).always(()=>{top.TYPO3.Backend.ContentContainer.refresh(!0)})}static copyReleaseFile(t,e){const n=r.hash(e).substring(0,10);let a=TYPO3.settings.ajaxUrls.contextmenu_clipboard;a+="&CB[el][_FILE%7C"+n+"]=0&CB[setCopyMode]=1",o.ajax(a).always(()=>{top.TYPO3.Backend.ContentContainer.refresh(!0)})}static cutFile(t,e){const n=r.hash(e).substring(0,10);let a=TYPO3.settings.ajaxUrls.contextmenu_clipboard;a+="&CB[el][_FILE%7C"+n+"]="+encodeURIComponent(e),o.ajax(a).always(()=>{top.TYPO3.Backend.ContentContainer.refresh(!0)})}static cutReleaseFile(t,e){const n=r.hash(e).substring(0,10);let a=TYPO3.settings.ajaxUrls.contextmenu_clipboard;a+="&CB[el][_FILE%7C"+n+"]=0",o.ajax(a).always(()=>{top.TYPO3.Backend.ContentContainer.refresh(!0)})}static pasteFileInto(t,e){const r=o(this),i=(r.data("title"),()=>{top.TYPO3.Backend.ContentContainer.setUrl(top.TYPO3.settings.FileCommit.moduleUrl+"&CB[paste]=FILE|"+encodeURIComponent(e)+"&CB[pad]=normal&redirect="+s.getReturnUrl())});r.data("title")?a.confirm(r.data("title"),r.data("message"),n.SeverityEnum.warning,[{text:o(this).data("button-close-text")||TYPO3.lang["button.cancel"]||"Cancel",active:!0,btnClass:"btn-default",name:"cancel"},{text:o(this).data("button-ok-text")||TYPO3.lang["button.ok"]||"OK",btnClass:"btn-warning",name:"ok"}]).on("button.clicked",t=>{"ok"===t.target.name&&i(),a.dismiss()}):i()}static dropInto(t,e,n){const a=o(this).data("drop-target");top.TYPO3.Backend.ContentContainer.setUrl(top.TYPO3.settings.FileCommit.moduleUrl+"&file["+n+"][0][data]="+encodeURIComponent(e)+"&file["+n+"][0][target]="+encodeURIComponent(a)+"&redirect="+s.getReturnUrl())}static dropMoveInto(t,e){s.dropInto.bind(o(this))(t,e,"move")}static dropCopyInto(t,e){s.dropInto.bind(o(this))(t,e,"copy")}}return s});
\ No newline at end of file
+define(["require","exports","TYPO3/CMS/Backend/Enum/Severity","jquery","TYPO3/CMS/Backend/Modal","TYPO3/CMS/Backend/Hashing/Md5"],function(t,e,n,o,a,r){"use strict";class s{static getReturnUrl(){return encodeURIComponent(top.list_frame.document.location.pathname+top.list_frame.document.location.search)}static renameFile(t,e){top.TYPO3.Backend.ContentContainer.setUrl(top.TYPO3.settings.FileRename.moduleUrl+"&target="+encodeURIComponent(e)+"&returnUrl="+s.getReturnUrl())}static editFile(t,e){top.TYPO3.Backend.ContentContainer.setUrl(top.TYPO3.settings.FileEdit.moduleUrl+"&target="+encodeURIComponent(e)+"&returnUrl="+s.getReturnUrl())}static editFileStorage(t,e){top.TYPO3.Backend.ContentContainer.setUrl(top.TYPO3.settings.FormEngine.moduleUrl+"&edit[sys_file_storage]["+parseInt(e,10)+"]=edit&returnUrl="+s.getReturnUrl())}static openInfoPopUp(t,e){"sys_file_storage"===t?top.TYPO3.InfoWindow.showItem(t,e):top.TYPO3.InfoWindow.showItem("_FILE",e)}static uploadFile(t,e){top.TYPO3.Backend.ContentContainer.setUrl(top.TYPO3.settings.FileUpload.moduleUrl+"&target="+encodeURIComponent(e)+"&returnUrl="+s.getReturnUrl())}static createFile(t,e){top.TYPO3.Backend.ContentContainer.setUrl(top.TYPO3.settings.FileCreate.moduleUrl+"&target="+encodeURIComponent(e)+"&returnUrl="+s.getReturnUrl())}static deleteFile(t,e){const r=o(this),i=()=>{top.TYPO3.Backend.ContentContainer.setUrl(top.TYPO3.settings.FileCommit.moduleUrl+"&data[delete][0][data]="+encodeURIComponent(e)+"&data[delete][0][redirect]="+s.getReturnUrl())};r.data("title")?a.confirm(r.data("title"),r.data("message"),n.SeverityEnum.warning,[{text:o(this).data("button-close-text")||TYPO3.lang["button.cancel"]||"Cancel",active:!0,btnClass:"btn-default",name:"cancel"},{text:o(this).data("button-ok-text")||TYPO3.lang["button.delete"]||"Delete",btnClass:"btn-warning",name:"delete"}]).on("button.clicked",t=>{"delete"===t.currentTarget.name&&i(),a.dismiss()}):i()}static copyFile(t,e){const n=r.hash(e).substring(0,10);let a=TYPO3.settings.ajaxUrls.contextmenu_clipboard;a+="&CB[el][_FILE%7C"+n+"]="+encodeURIComponent(e)+"&CB[setCopyMode]=1",o.ajax(a).always(()=>{top.TYPO3.Backend.ContentContainer.refresh(!0)})}static copyReleaseFile(t,e){const n=r.hash(e).substring(0,10);let a=TYPO3.settings.ajaxUrls.contextmenu_clipboard;a+="&CB[el][_FILE%7C"+n+"]=0&CB[setCopyMode]=1",o.ajax(a).always(()=>{top.TYPO3.Backend.ContentContainer.refresh(!0)})}static cutFile(t,e){const n=r.hash(e).substring(0,10);let a=TYPO3.settings.ajaxUrls.contextmenu_clipboard;a+="&CB[el][_FILE%7C"+n+"]="+encodeURIComponent(e),o.ajax(a).always(()=>{top.TYPO3.Backend.ContentContainer.refresh(!0)})}static cutReleaseFile(t,e){const n=r.hash(e).substring(0,10);let a=TYPO3.settings.ajaxUrls.contextmenu_clipboard;a+="&CB[el][_FILE%7C"+n+"]=0",o.ajax(a).always(()=>{top.TYPO3.Backend.ContentContainer.refresh(!0)})}static pasteFileInto(t,e){const r=o(this),i=r.data("title"),l=()=>{top.TYPO3.Backend.ContentContainer.setUrl(top.TYPO3.settings.FileCommit.moduleUrl+"&CB[paste]=FILE|"+encodeURIComponent(e)+"&CB[pad]=normal&redirect="+s.getReturnUrl())};i?a.confirm(i,r.data("message"),n.SeverityEnum.warning,[{text:o(this).data("button-close-text")||TYPO3.lang["button.cancel"]||"Cancel",active:!0,btnClass:"btn-default",name:"cancel"},{text:o(this).data("button-ok-text")||TYPO3.lang["button.ok"]||"OK",btnClass:"btn-warning",name:"ok"}]).on("button.clicked",t=>{"ok"===t.target.name&&l(),a.dismiss()}):l()}static dropInto(t,e,n){const a=o(this).data("drop-target");top.TYPO3.Backend.ContentContainer.setUrl(top.TYPO3.settings.FileCommit.moduleUrl+"&file["+n+"][0][data]="+encodeURIComponent(e)+"&file["+n+"][0][target]="+encodeURIComponent(a)+"&redirect="+s.getReturnUrl())}static dropMoveInto(t,e){s.dropInto.bind(o(this))(t,e,"move")}static dropCopyInto(t,e){s.dropInto.bind(o(this))(t,e,"copy")}}return s});
\ No newline at end of file
index 189a844..5893eed 100644 (file)
@@ -10,4 +10,4 @@
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require","exports","../AbstractInteractableModule","jquery","../../Router","../../Renderable/InfoBox","../../Renderable/Severity","TYPO3/CMS/Backend/Modal","TYPO3/CMS/Backend/Notification","bootstrap"],function(e,t,s,r,n,a,i,o,c){"use strict";return new class extends s.AbstractInteractableModule{constructor(){super(...arguments),this.selectorExecuteTrigger=".t3js-imageProcessing-execute",this.selectorTestContainer=".t3js-imageProcessing-twinContainer",this.selectorTwinImageTemplate=".t3js-imageProcessing-twinImage-template",this.selectorCommandContainer=".t3js-imageProcessing-command",this.selectorCommandText=".t3js-imageProcessing-command-text",this.selectorTwinImages=".t3js-imageProcessing-images"}initialize(e){this.currentModal=e,this.getData(),e.on("click",this.selectorExecuteTrigger,e=>{e.preventDefault(),this.runTests()})}getData(){const e=this.getModalBody();r.ajax({url:n.getUrl("imageProcessingGetData"),cache:!1,success:t=>{!0===t.success?(e.empty().append(t.html),o.setButtons(t.buttons),this.runTests()):c.error("Something went wrong")},error:t=>{n.handleAjaxError(t,e)}})}runTests(){const e=this.getModalBody(),t=this.findInModal(this.selectorExecuteTrigger);t.addClass("disabled").prop("disabled",!0);const s=this.findInModal(this.selectorTwinImageTemplate),o=[];e.find(this.selectorTestContainer).each((t,c)=>{const l=r(c),d=l.data("test"),m=a.render(i.loading,"Loading...","");l.empty().html(m),o.push(r.ajax({url:n.getUrl(d),cache:!1,success:e=>{if(!0===e.success){l.empty(),Array.isArray(e.status)&&e.status.forEach(e=>{const t=a.render(c.severity,c.title,c.message);l.append(t)});const t=s.clone();if(t.removeClass("t3js-imageProcessing-twinImage-template"),!0===e.fileExists&&(t.find("img.reference").attr("src",e.referenceFile),t.find("img.result").attr("src",e.outputFile),t.find(this.selectorTwinImages).show()),Array.isArray(e.command)&&e.command.length>0){t.find(this.selectorCommandContainer).show();const s=[];e.command.forEach(e=>{s.push("<strong>Command:</strong>\n"+e[1]),3===e.length&&s.push("<strong>Result:</strong>\n"+e[2])}),t.find(this.selectorCommandText).html(s.join("\n"))}l.append(t)}},error:t=>{n.handleAjaxError(t,e)}}))}),r.when.apply(r,o).done(()=>{t.removeClass("disabled").prop("disabled",!1)})}}});
\ No newline at end of file
+define(["require","exports","../AbstractInteractableModule","jquery","../../Router","../../Renderable/InfoBox","../../Renderable/Severity","TYPO3/CMS/Backend/Modal","TYPO3/CMS/Backend/Notification","bootstrap"],function(e,t,s,r,n,a,i,o,c){"use strict";return new class extends s.AbstractInteractableModule{constructor(){super(...arguments),this.selectorExecuteTrigger=".t3js-imageProcessing-execute",this.selectorTestContainer=".t3js-imageProcessing-twinContainer",this.selectorTwinImageTemplate=".t3js-imageProcessing-twinImage-template",this.selectorCommandContainer=".t3js-imageProcessing-command",this.selectorCommandText=".t3js-imageProcessing-command-text",this.selectorTwinImages=".t3js-imageProcessing-images"}initialize(e){this.currentModal=e,this.getData(),e.on("click",this.selectorExecuteTrigger,e=>{e.preventDefault(),this.runTests()})}getData(){const e=this.getModalBody();r.ajax({url:n.getUrl("imageProcessingGetData"),cache:!1,success:t=>{!0===t.success?(e.empty().append(t.html),o.setButtons(t.buttons),this.runTests()):c.error("Something went wrong")},error:t=>{n.handleAjaxError(t,e)}})}runTests(){const e=this.getModalBody(),t=this.findInModal(this.selectorExecuteTrigger);t.addClass("disabled").prop("disabled",!0);const s=this.findInModal(this.selectorTwinImageTemplate),o=[];e.find(this.selectorTestContainer).each((t,c)=>{const l=r(c),d=l.data("test"),m=a.render(i.loading,"Loading...","");l.empty().html(m),o.push(r.ajax({url:n.getUrl(d),cache:!1,success:e=>{if(!0===e.success){l.empty(),Array.isArray(e.status)&&e.status.forEach(()=>{const e=a.render(c.severity,c.title,c.message);l.append(e)});const t=s.clone();if(t.removeClass("t3js-imageProcessing-twinImage-template"),!0===e.fileExists&&(t.find("img.reference").attr("src",e.referenceFile),t.find("img.result").attr("src",e.outputFile),t.find(this.selectorTwinImages).show()),Array.isArray(e.command)&&e.command.length>0){t.find(this.selectorCommandContainer).show();const s=[];e.command.forEach(e=>{s.push("<strong>Command:</strong>\n"+e[1]),3===e.length&&s.push("<strong>Result:</strong>\n"+e[2])}),t.find(this.selectorCommandText).html(s.join("\n"))}l.append(t)}},error:t=>{n.handleAjaxError(t,e)}}))}),r.when.apply(r,o).done(()=>{t.removeClass("disabled").prop("disabled",!1)})}}});
\ No newline at end of file
index a30a624..c7bc38c 100644 (file)
@@ -10,4 +10,4 @@
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require","exports","../AbstractInteractableModule","jquery","../../Router","../PasswordStrength","TYPO3/CMS/Backend/Modal","TYPO3/CMS/Backend/Notification"],function(e,t,a,s,r,n,i,d){"use strict";return new class extends a.AbstractInteractableModule{constructor(){super(...arguments),this.selectorAdminCreateButton=".t3js-createAdmin-create"}initialize(e){this.currentModal=e,this.getData(),e.on("click",this.selectorAdminCreateButton,e=>{e.preventDefault(),this.create()}),e.on("click",".t3-install-form-password-strength",e=>{n.initialize(".t3-install-form-password-strength")})}getData(){const e=this.getModalBody();s.ajax({url:r.getUrl("createAdminGetData"),cache:!1,success:t=>{!0===t.success?(e.empty().append(t.html),i.setButtons(t.buttons)):d.error("Something went wrong")},error:t=>{r.handleAjaxError(t,e)}})}create(){const e=this.getModalBody(),t=this.getModuleContent().data("create-admin-token");s.ajax({url:r.getUrl(),method:"POST",data:{install:{action:"createAdmin",token:t,userName:this.findInModal(".t3js-createAdmin-user").val(),userPassword:this.findInModal(".t3js-createAdmin-password").val(),userPasswordCheck:this.findInModal(".t3js-createAdmin-password-check").val(),userEmail:this.findInModal(".t3js-createAdmin-email").val(),userSystemMaintainer:this.findInModal(".t3js-createAdmin-system-maintainer").is(":checked")?1:0}},cache:!1,success:e=>{!0===e.success&&Array.isArray(e.status)?e.status.forEach(e=>{2===e.severity?d.error(e.message):d.success(e.title)}):d.error("Something went wrong")},error:t=>{r.handleAjaxError(t,e)}}),this.findInModal(".t3js-createAdmin-user").val(""),this.findInModal(".t3js-createAdmin-password").val(""),this.findInModal(".t3js-createAdmin-password-check").val(""),this.findInModal(".t3js-createAdmin-email").val(""),this.findInModal(".t3js-createAdmin-system-maintainer").prop("checked",!1)}}});
\ No newline at end of file
+define(["require","exports","../AbstractInteractableModule","jquery","../../Router","../PasswordStrength","TYPO3/CMS/Backend/Modal","TYPO3/CMS/Backend/Notification"],function(e,t,a,s,r,n,i,d){"use strict";return new class extends a.AbstractInteractableModule{constructor(){super(...arguments),this.selectorAdminCreateButton=".t3js-createAdmin-create"}initialize(e){this.currentModal=e,this.getData(),e.on("click",this.selectorAdminCreateButton,e=>{e.preventDefault(),this.create()}),e.on("click",".t3-install-form-password-strength",()=>{n.initialize(".t3-install-form-password-strength")})}getData(){const e=this.getModalBody();s.ajax({url:r.getUrl("createAdminGetData"),cache:!1,success:t=>{!0===t.success?(e.empty().append(t.html),i.setButtons(t.buttons)):d.error("Something went wrong")},error:t=>{r.handleAjaxError(t,e)}})}create(){const e=this.getModalBody(),t=this.getModuleContent().data("create-admin-token");s.ajax({url:r.getUrl(),method:"POST",data:{install:{action:"createAdmin",token:t,userName:this.findInModal(".t3js-createAdmin-user").val(),userPassword:this.findInModal(".t3js-createAdmin-password").val(),userPasswordCheck:this.findInModal(".t3js-createAdmin-password-check").val(),userEmail:this.findInModal(".t3js-createAdmin-email").val(),userSystemMaintainer:this.findInModal(".t3js-createAdmin-system-maintainer").is(":checked")?1:0}},cache:!1,success:e=>{!0===e.success&&Array.isArray(e.status)?e.status.forEach(e=>{2===e.severity?d.error(e.message):d.success(e.title)}):d.error("Something went wrong")},error:t=>{r.handleAjaxError(t,e)}}),this.findInModal(".t3js-createAdmin-user").val(""),this.findInModal(".t3js-createAdmin-password").val(""),this.findInModal(".t3js-createAdmin-password-check").val(""),this.findInModal(".t3js-createAdmin-email").val(""),this.findInModal(".t3js-createAdmin-system-maintainer").prop("checked",!1)}}});
\ No newline at end of file
index 109e2c1..ecdedba 100644 (file)
@@ -10,4 +10,4 @@
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require","exports","jquery","../../Router","TYPO3/CMS/Backend/Notification"],function(e,s,r,a,t){"use strict";return new class{initialize(e){r.ajax({url:a.getUrl("resetBackendUserUc"),cache:!1,beforeSend:()=>{e.addClass("disabled").prop("disabled",!0)},success:e=>{!0===e.success&&Array.isArray(e.status)?e.status.length>0&&e.status.forEach(e=>{t.success(e.message)}):t.error("Something went wrong ...")},error:e=>{t.error("Resetting backend user uc failed. Please check the system for missing database fields and try again.")},complete:()=>{e.removeClass("disabled").prop("disabled",!1)}})}}});
\ No newline at end of file
+define(["require","exports","jquery","../../Router","TYPO3/CMS/Backend/Notification"],function(e,s,r,a,t){"use strict";return new class{initialize(e){r.ajax({url:a.getUrl("resetBackendUserUc"),cache:!1,beforeSend:()=>{e.addClass("disabled").prop("disabled",!0)},success:e=>{!0===e.success&&Array.isArray(e.status)?e.status.length>0&&e.status.forEach(e=>{t.success(e.message)}):t.error("Something went wrong ...")},error:()=>{t.error("Resetting backend user uc failed. Please check the system for missing database fields and try again.")},complete:()=>{e.removeClass("disabled").prop("disabled",!1)}})}}});
\ No newline at end of file
index dd2cdf9..289625d 100644 (file)
@@ -10,4 +10,4 @@
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require","exports","../AbstractInteractableModule","jquery","../../Router","../PasswordStrength","TYPO3/CMS/Backend/Modal","TYPO3/CMS/Backend/Notification"],function(t,s,a,e,o,r,n,l){"use strict";return new class extends a.AbstractInteractableModule{constructor(){super(...arguments),this.selectorChangeButton=".t3js-changeInstallToolPassword-change"}initialize(t){this.currentModal=t,this.getData(),t.on("click",this.selectorChangeButton,t=>{t.preventDefault(),this.change()}),t.on("click",".t3-install-form-password-strength",t=>{r.initialize(".t3-install-form-password-strength")})}getData(){const t=this.getModalBody();e.ajax({url:o.getUrl("changeInstallToolPasswordGetData"),cache:!1,success:s=>{!0===s.success?(t.empty().append(s.html),n.setButtons(s.buttons)):l.error("Something went wrong")},error:s=>{o.handleAjaxError(s,t)}})}change(){const t=this.getModalBody(),s=this.getModuleContent().data("install-tool-token");e.ajax({url:o.getUrl(),method:"POST",data:{install:{action:"changeInstallToolPassword",token:s,password:this.findInModal(".t3js-changeInstallToolPassword-password").val(),passwordCheck:this.findInModal(".t3js-changeInstallToolPassword-password-check").val()}},cache:!1,success:t=>{!0===t.success&&Array.isArray(t.status)?t.status.forEach(t=>{l.showMessage("",t.message,t.severity)}):l.error("Something went wrong")},error:s=>{o.handleAjaxError(s,t)},complete:()=>{this.findInModal(".t3js-changeInstallToolPassword-password,.t3js-changeInstallToolPassword-password-check").val("")}})}}});
\ No newline at end of file
+define(["require","exports","../AbstractInteractableModule","jquery","../../Router","../PasswordStrength","TYPO3/CMS/Backend/Modal","TYPO3/CMS/Backend/Notification"],function(t,s,a,e,o,r,n,l){"use strict";return new class extends a.AbstractInteractableModule{constructor(){super(...arguments),this.selectorChangeButton=".t3js-changeInstallToolPassword-change"}initialize(t){this.currentModal=t,this.getData(),t.on("click",this.selectorChangeButton,t=>{t.preventDefault(),this.change()}),t.on("click",".t3-install-form-password-strength",()=>{r.initialize(".t3-install-form-password-strength")})}getData(){const t=this.getModalBody();e.ajax({url:o.getUrl("changeInstallToolPasswordGetData"),cache:!1,success:s=>{!0===s.success?(t.empty().append(s.html),n.setButtons(s.buttons)):l.error("Something went wrong")},error:s=>{o.handleAjaxError(s,t)}})}change(){const t=this.getModalBody(),s=this.getModuleContent().data("install-tool-token");e.ajax({url:o.getUrl(),method:"POST",data:{install:{action:"changeInstallToolPassword",token:s,password:this.findInModal(".t3js-changeInstallToolPassword-password").val(),passwordCheck:this.findInModal(".t3js-changeInstallToolPassword-password-check").val()}},cache:!1,success:t=>{!0===t.success&&Array.isArray(t.status)?t.status.forEach(t=>{l.showMessage("",t.message,t.severity)}):l.error("Something went wrong")},error:s=>{o.handleAjaxError(s,t)},complete:()=>{this.findInModal(".t3js-changeInstallToolPassword-password,.t3js-changeInstallToolPassword-password-check").val("")}})}}});
\ No newline at end of file
index 5b2fbf4..68aab37 100644 (file)
@@ -10,4 +10,4 @@
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require","exports","../AbstractInteractableModule","jquery","../../Router","../../Renderable/ProgressBar","../../Renderable/InfoBox","../../Renderable/Severity","TYPO3/CMS/Backend/Modal","TYPO3/CMS/Backend/Notification","bootstrap"],function(e,t,n,s,o,a,i,r,l,d){"use strict";return new class extends n.AbstractInteractableModule{constructor(){super(...arguments),this.selectorCheckTrigger=".t3js-extensionCompatTester-check",this.selectorUninstallTrigger=".t3js-extensionCompatTester-uninstall",this.selectorOutputContainer=".t3js-extensionCompatTester-output"}initialize(e){this.currentModal=e,this.getLoadedExtensionList(),e.on("click",this.selectorCheckTrigger,e=>{this.findInModal(this.selectorUninstallTrigger).addClass("hidden"),this.findInModal(this.selectorOutputContainer).empty(),this.getLoadedExtensionList()}),e.on("click",this.selectorUninstallTrigger,e=>{this.uninstallExtension(s(e.target).data("extension"))})}getLoadedExtensionList(){this.findInModal(this.selectorCheckTrigger).addClass("disabled").prop("disabled",!0),this.findInModal(".modal-loading").hide();const e=this.getModalBody(),t=this.getModalFooter(),n=this.findInModal(this.selectorOutputContainer),c=a.render(r.loading,"Loading...","");n.append(c),s.ajax({url:o.getUrl("extensionCompatTesterLoadedExtensionList"),cache:!1,success:n=>{e.empty().append(n.html),l.setButtons(n.buttons);const o=this.findInModal(this.selectorOutputContainer),c=a.render(r.loading,"Loading...","");if(o.append(c),!0===n.success&&Array.isArray(n.extensions)){const e=()=>{const e=[];return n.extensions.forEach(t=>{e.push(this.loadExtLocalconf(t))}),s.when.apply(s,e).done(()=>{const e=i.render(r.ok,"ext_localconf.php of all loaded extensions successfully loaded","");o.append(e)})},a=()=>{const e=[];return n.extensions.forEach(t=>{e.push(this.loadExtTables(t))}),s.when.apply(s,e).done(()=>{const e=i.render(r.ok,"ext_tables.php of all loaded extensions successfully loaded","");o.append(e)})};s.when(e(),a()).fail(e=>{const n=i.render(r.error,"Loading "+e.scope+' of extension "'+e.extension+'" failed');o.append(n),t.find(this.selectorUninstallTrigger).text('Unload extension "'+e.extension+'"').attr("data-extension",e.extension).removeClass("hidden")}).always(()=>{o.find(".alert-loading").remove(),this.findInModal(this.selectorCheckTrigger).removeClass("disabled").prop("disabled",!1)})}else d.error("Something went wrong")},error:t=>{o.handleAjaxError(t,e)}})}loadExtLocalconf(e){const t=this.getModuleContent().data("extension-compat-tester-load-ext_localconf-token");return s.ajax({url:o.getUrl(),method:"POST",cache:!1,data:{install:{action:"extensionCompatTesterLoadExtLocalconf",token:t,extension:e}}}).promise().then(null,()=>{throw{scope:"ext_localconf.php",extension:e}})}loadExtTables(e){const t=this.getModuleContent().data("extension-compat-tester-load-ext_tables-token");return s.ajax({url:o.getUrl(),method:"POST",cache:!1,data:{install:{action:"extensionCompatTesterLoadExtTables",token:t,extension:e}}}).promise().then(null,()=>{throw{scope:"ext_tables.php",extension:e}})}uninstallExtension(e){const t=this.getModuleContent().data("extension-compat-tester-uninstall-extension-token"),n=this.getModalBody(),l=s(this.selectorOutputContainer),c=a.render(r.loading,"Loading...","");l.append(c),s.ajax({url:o.getUrl(),cache:!1,method:"POST",data:{install:{action:"extensionCompatTesterUninstallExtension",token:t,extension:e}},success:e=>{e.success?(Array.isArray(e.status)&&e.status.forEach(e=>{const t=i.render(e.severity,e.title,e.message);n.find(this.selectorOutputContainer).empty().append(t)}),this.findInModal(this.selectorUninstallTrigger).addClass("hidden"),this.getLoadedExtensionList()):d.error("Something went wrong")},error:e=>{o.handleAjaxError(e,n)}})}}});
\ No newline at end of file
+define(["require","exports","../AbstractInteractableModule","jquery","../../Router","../../Renderable/ProgressBar","../../Renderable/InfoBox","../../Renderable/Severity","TYPO3/CMS/Backend/Modal","TYPO3/CMS/Backend/Notification","bootstrap"],function(e,t,n,s,o,a,i,r,l,d){"use strict";return new class extends n.AbstractInteractableModule{constructor(){super(...arguments),this.selectorCheckTrigger=".t3js-extensionCompatTester-check",this.selectorUninstallTrigger=".t3js-extensionCompatTester-uninstall",this.selectorOutputContainer=".t3js-extensionCompatTester-output"}initialize(e){this.currentModal=e,this.getLoadedExtensionList(),e.on("click",this.selectorCheckTrigger,()=>{this.findInModal(this.selectorUninstallTrigger).addClass("hidden"),this.findInModal(this.selectorOutputContainer).empty(),this.getLoadedExtensionList()}),e.on("click",this.selectorUninstallTrigger,e=>{this.uninstallExtension(s(e.target).data("extension"))})}getLoadedExtensionList(){this.findInModal(this.selectorCheckTrigger).addClass("disabled").prop("disabled",!0),this.findInModal(".modal-loading").hide();const e=this.getModalBody(),t=this.getModalFooter(),n=this.findInModal(this.selectorOutputContainer),c=a.render(r.loading,"Loading...","");n.append(c),s.ajax({url:o.getUrl("extensionCompatTesterLoadedExtensionList"),cache:!1,success:n=>{e.empty().append(n.html),l.setButtons(n.buttons);const o=this.findInModal(this.selectorOutputContainer),c=a.render(r.loading,"Loading...","");if(o.append(c),!0===n.success&&Array.isArray(n.extensions)){const e=()=>{const e=[];return n.extensions.forEach(t=>{e.push(this.loadExtLocalconf(t))}),s.when.apply(s,e).done(()=>{const e=i.render(r.ok,"ext_localconf.php of all loaded extensions successfully loaded","");o.append(e)})},a=()=>{const e=[];return n.extensions.forEach(t=>{e.push(this.loadExtTables(t))}),s.when.apply(s,e).done(()=>{const e=i.render(r.ok,"ext_tables.php of all loaded extensions successfully loaded","");o.append(e)})};s.when(e(),a()).fail(e=>{const n=i.render(r.error,"Loading "+e.scope+' of extension "'+e.extension+'" failed');o.append(n),t.find(this.selectorUninstallTrigger).text('Unload extension "'+e.extension+'"').attr("data-extension",e.extension).removeClass("hidden")}).always(()=>{o.find(".alert-loading").remove(),this.findInModal(this.selectorCheckTrigger).removeClass("disabled").prop("disabled",!1)})}else d.error("Something went wrong")},error:t=>{o.handleAjaxError(t,e)}})}loadExtLocalconf(e){const t=this.getModuleContent().data("extension-compat-tester-load-ext_localconf-token");return s.ajax({url:o.getUrl(),method:"POST",cache:!1,data:{install:{action:"extensionCompatTesterLoadExtLocalconf",token:t,extension:e}}}).promise().then(null,()=>{throw{scope:"ext_localconf.php",extension:e}})}loadExtTables(e){const t=this.getModuleContent().data("extension-compat-tester-load-ext_tables-token");return s.ajax({url:o.getUrl(),method:"POST",cache:!1,data:{install:{action:"extensionCompatTesterLoadExtTables",token:t,extension:e}}}).promise().then(null,()=>{throw{scope:"ext_tables.php",extension:e}})}uninstallExtension(e){const t=this.getModuleContent().data("extension-compat-tester-uninstall-extension-token"),n=this.getModalBody(),l=s(this.selectorOutputContainer),c=a.render(r.loading,"Loading...","");l.append(c),s.ajax({url:o.getUrl(),cache:!1,method:"POST",data:{install:{action:"extensionCompatTesterUninstallExtension",token:t,extension:e}},success:e=>{e.success?(Array.isArray(e.status)&&e.status.forEach(e=>{const t=i.render(e.severity,e.title,e.message);n.find(this.selectorOutputContainer).empty().append(t)}),this.findInModal(this.selectorUninstallTrigger).addClass("hidden"),this.getLoadedExtensionList()):d.error("Something went wrong")},error:e=>{o.handleAjaxError(e,n)}})}}});
\ No newline at end of file
index 070d476..1c4bc9b 100644 (file)
@@ -10,4 +10,4 @@
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require","exports","../AbstractInteractableModule","jquery","../../Router","../../Renderable/Severity","../../Renderable/ProgressBar","../../Renderable/InfoBox","../../Renderable/FlashMessage","TYPO3/CMS/Backend/Notification","TYPO3/CMS/Core/SecurityUtility","bootstrap"],function(e,t,s,r,a,i,d,o,n,l,c){"use strict";class p extends s.AbstractInteractableModule{constructor(){super(),this.selectorOutputWizardsContainer=".t3js-upgradeWizards-wizards-output",this.selectorOutputDoneContainer=".t3js-upgradeWizards-done-output",this.selectorWizardsBlockingAddsTemplate=".t3js-upgradeWizards-blocking-adds-template",this.selectorWizardsBlockingAddsRows=".t3js-upgradeWizards-blocking-adds-rows",this.selectorWizardsBlockingAddsExecute=".t3js-upgradeWizards-blocking-adds-execute",this.selectorWizardsBlockingCharsetTemplate=".t3js-upgradeWizards-blocking-charset-template",this.selectorWizardsBlockingCharsetFix=".t3js-upgradeWizards-blocking-charset-fix",this.selectorWizardsDoneBodyTemplate=".t3js-upgradeWizards-done-body-template",this.selectorWizardsDoneRows=".t3js-upgradeWizards-done-rows",this.selectorWizardsDoneRowTemplate=".t3js-upgradeWizards-done-row-template table tr",this.selectorWizardsDoneRowMarkUndone=".t3js-upgradeWizards-done-markUndone",this.selectorWizardsDoneRowTitle=".t3js-upgradeWizards-done-title",this.selectorWizardsListTemplate=".t3js-upgradeWizards-list-template",this.selectorWizardsListRows=".t3js-upgradeWizards-list-rows",this.selectorWizardsListRowTemplate=".t3js-upgradeWizards-list-row-template",this.selectorWizardsListRowTitle=".t3js-upgradeWizards-list-row-title",this.selectorWizardsListRowExplanation=".t3js-upgradeWizards-list-row-explanation",this.selectorWizardsListRowExecute=".t3js-upgradeWizards-list-row-execute",this.selectorWizardsInputTemplate=".t3js-upgradeWizards-input",this.selectorWizardsInputTitle=".t3js-upgradeWizards-input-title",this.selectorWizardsInputHtml=".t3js-upgradeWizards-input-html",this.selectorWizardsInputPerform=".t3js-upgradeWizards-input-perform",this.securityUtility=new c}static removeLoadingMessage(e){e.find(".alert-loading").remove()}static renderProgressBar(e){return d.render(i.loading,e,"")}initialize(e){this.currentModal=e,this.getData().done(()=>{this.doneUpgrades()}),e.on("click",this.selectorWizardsDoneRowMarkUndone,e=>{this.markUndone(e.target.dataset.identifier)}),e.on("click",this.selectorWizardsBlockingCharsetFix,e=>{this.blockingUpgradesDatabaseCharsetFix()}),e.on("click",this.selectorWizardsBlockingAddsExecute,e=>{this.blockingUpgradesDatabaseAddsExecute()}),e.on("click",this.selectorWizardsListRowExecute,e=>{this.wizardInput(e.target.dataset.identifier,e.target.dataset.title)}),e.on("click",this.selectorWizardsInputPerform,e=>{this.wizardExecute(e.target.dataset.identifier,e.target.dataset.title)})}getData(){const e=this.getModalBody();return r.ajax({url:a.getUrl("upgradeWizardsGetData"),cache:!1,success:t=>{!0===t.success?(e.empty().append(t.html),this.blockingUpgradesDatabaseCharsetTest()):l.error("Something went wrong")},error:e=>{a.handleAjaxError(e)}})}blockingUpgradesDatabaseCharsetTest(){const e=this.getModalBody(),t=this.findInModal(this.selectorOutputWizardsContainer);t.empty().html(p.renderProgressBar("Checking database charset...")),r.ajax({url:a.getUrl("upgradeWizardsBlockingDatabaseCharsetTest"),cache:!1,success:s=>{p.removeLoadingMessage(t),!0===s.success&&(!0===s.needsUpdate?e.find(this.selectorOutputWizardsContainer).append(e.find(this.selectorWizardsBlockingCharsetTemplate)).clone():this.blockingUpgradesDatabaseAdds())},error:e=>{a.handleAjaxError(e,t)}})}blockingUpgradesDatabaseCharsetFix(){const e=r(this.selectorOutputWizardsContainer);e.empty().html(p.renderProgressBar("Setting database charset to UTF-8...")),r.ajax({url:a.getUrl("upgradeWizardsBlockingDatabaseCharsetFix"),cache:!1,success:t=>{if(p.removeLoadingMessage(e),!0===t.success)Array.isArray(t.status)&&t.status.length>0&&t.status.forEach(t=>{const s=o.render(t.severity,t.title,t.message);e.append(s)});else{const t=n.render(i.error,"Something went wrong","");p.removeLoadingMessage(e),e.append(t)}},error:t=>{a.handleAjaxError(t,e)}})}blockingUpgradesDatabaseAdds(){const e=this.getModalBody(),t=this.findInModal(this.selectorOutputWizardsContainer);t.empty().html(p.renderProgressBar("Check for missing mandatory database tables and fields...")),r.ajax({url:a.getUrl("upgradeWizardsBlockingDatabaseAdds"),cache:!1,success:s=>{if(p.removeLoadingMessage(t),!0===s.success)if(!0===s.needsUpdate){const t=e.find(this.selectorWizardsBlockingAddsTemplate).clone();"object"==typeof s.adds.tables&&s.adds.tables.forEach(e=>{const s="Table: "+this.securityUtility.encodeHtml(e.table);t.find(this.selectorWizardsBlockingAddsRows).append(s,"<br>")}),"object"==typeof s.adds.columns&&s.adds.columns.forEach(e=>{const s="Table: "+this.securityUtility.encodeHtml(e.table)+", Field: "+this.securityUtility.encodeHtml(e.field);t.find(this.selectorWizardsBlockingAddsRows).append(s,"<br>")}),"object"==typeof s.adds.indexes&&s.adds.indexes.forEach(e=>{const s="Table: "+this.securityUtility.encodeHtml(e.table)+", Index: "+this.securityUtility.encodeHtml(e.index);t.find(this.selectorWizardsBlockingAddsRows).append(s,"<br>")}),e.find(this.selectorOutputWizardsContainer).append(t)}else this.wizardsList();else l.error("Something went wrong")},error:e=>{a.handleAjaxError(e,t)}})}blockingUpgradesDatabaseAddsExecute(){const e=this.findInModal(this.selectorOutputWizardsContainer);e.empty().html(p.renderProgressBar("Adding database tables and fields...")),r.ajax({url:a.getUrl("upgradeWizardsBlockingDatabaseExecute"),cache:!1,success:t=>{if(p.removeLoadingMessage(e),!0===t.success)Array.isArray(t.status)&&t.status.length>0&&(t.status.forEach(t=>{const s=o.render(t.severity,t.title,t.message);e.append(s)}),this.wizardsList());else{const t=n.render(i.error,"Something went wrong","");p.removeLoadingMessage(e),e.append(t)}},error:t=>{a.handleAjaxError(t,e)}})}wizardsList(){const e=this.getModalBody(),t=this.findInModal(this.selectorOutputWizardsContainer);t.append(p.renderProgressBar("Loading upgrade wizards...")),r.ajax({url:a.getUrl("upgradeWizardsList"),cache:!1,success:s=>{p.removeLoadingMessage(t);const r=e.find(this.selectorWizardsListTemplate).clone();if(r.removeClass("t3js-upgradeWizards-list-template"),!0===s.success){let t=0,a=0;Array.isArray(s.wizards)&&s.wizards.length>0&&(a=s.wizards.length,s.wizards.forEach(s=>{if(!0===s.shouldRenderWizard){const a=e.find(this.selectorWizardsListRowTemplate).clone();t+=1,a.removeClass("t3js-upgradeWizards-list-row-template"),a.find(this.selectorWizardsListRowTitle).empty().text(s.title),a.find(this.selectorWizardsListRowExplanation).empty().text(s.explanation),a.find(this.selectorWizardsListRowExecute).attr("data-identifier",s.identifier).attr("data-title",s.title),r.find(this.selectorWizardsListRows).append(a)}}),r.find(this.selectorWizardsListRows+" hr:last").remove());let i=100;const d=r.find(".progress-bar");t>0?i=Math.round((a-t)/s.wizards.length*100):d.removeClass("progress-bar-info").addClass("progress-bar-success"),d.removeClass("progress-bar-striped").css("width",i+"%").attr("aria-valuenow",i).find("span").text(i+"%"),e.find(this.selectorOutputWizardsContainer).append(r),this.findInModal(this.selectorWizardsDoneRowMarkUndone).prop("disabled",!1)}else l.error("Something went wrong")},error:e=>{a.handleAjaxError(e,t)}})}wizardInput(e,t){const s=this.getModuleContent().data("upgrade-wizards-input-token"),i=this.getModalBody(),d=this.findInModal(this.selectorOutputWizardsContainer);d.empty().html(p.renderProgressBar('Loading "'+t+'"...')),i.animate({scrollTop:i.scrollTop()-Math.abs(i.find(".t3js-upgrade-status-section").position().top)},250),r.ajax({url:a.getUrl(),method:"POST",data:{install:{action:"upgradeWizardsInput",token:s,identifier:e}},cache:!1,success:e=>{d.empty();const t=i.find(this.selectorWizardsInputTemplate).clone();t.removeClass("t3js-upgradeWizards-input"),!0===e.success&&(Array.isArray(e.status)&&e.status.forEach(e=>{const t=n.render(e.severity,e.title,e.message);d.append(t)}),e.userInput.wizardHtml.length>0&&t.find(this.selectorWizardsInputHtml).html(e.userInput.wizardHtml),t.find(this.selectorWizardsInputTitle).text(e.userInput.title),t.find(this.selectorWizardsInputPerform).attr("data-identifier",e.userInput.identifier).attr("data-title",e.userInput.title)),i.find(this.selectorOutputWizardsContainer).append(t)},error:e=>{a.handleAjaxError(e,d)}})}wizardExecute(e,t){const s=this.getModuleContent().data("upgrade-wizards-execute-token"),i=this.getModalBody(),d={"install[action]":"upgradeWizardsExecute","install[token]":s,"install[identifier]":e};r(this.findInModal(this.selectorOutputWizardsContainer+" form").serializeArray()).each((e,t)=>{d[t.name]=t.value});const n=this.findInModal(this.selectorOutputWizardsContainer);n.empty().html(p.renderProgressBar('Executing "'+t+'"...')),this.findInModal(this.selectorWizardsDoneRowMarkUndone).prop("disabled",!0),r.ajax({method:"POST",data:d,url:a.getUrl(),cache:!1,success:e=>{n.empty(),!0===e.success?(Array.isArray(e.status)&&e.status.forEach(e=>{const t=o.render(e.severity,e.title,e.message);n.append(t)}),this.wizardsList(),i.find(this.selectorOutputDoneContainer).empty(),this.doneUpgrades()):l.error("Something went wrong")},error:e=>{a.handleAjaxError(e,n)}})}doneUpgrades(){const e=this.getModalBody(),t=e.find(this.selectorOutputDoneContainer);t.empty().html(p.renderProgressBar("Loading executed upgrade wizards...")),r.ajax({url:a.getUrl("upgradeWizardsDoneUpgrades"),cache:!1,success:s=>{if(p.removeLoadingMessage(t),!0===s.success){Array.isArray(s.status)&&s.status.length>0&&s.status.forEach(e=>{const s=o.render(e.severity,e.title,e.message);t.append(s)});const r=e.find(this.selectorWizardsDoneBodyTemplate).clone(),a=r.find(this.selectorWizardsDoneRows);let i=!1;Array.isArray(s.wizardsDone)&&s.wizardsDone.length>0&&s.wizardsDone.forEach(t=>{i=!0;const s=e.find(this.selectorWizardsDoneRowTemplate).clone();s.find(this.selectorWizardsDoneRowMarkUndone).attr("data-identifier",t.identifier),s.find(this.selectorWizardsDoneRowTitle).text(t.title),a.append(s)}),Array.isArray(s.rowUpdatersDone)&&s.rowUpdatersDone.length>0&&s.rowUpdatersDone.forEach(t=>{i=!0;const s=e.find(this.selectorWizardsDoneRowTemplate).clone();s.find(this.selectorWizardsDoneRowMarkUndone).attr("data-identifier",t.identifier),s.find(this.selectorWizardsDoneRowTitle).text(t.title),a.append(s)}),i&&(e.find(this.selectorOutputDoneContainer).append(r),this.findInModal(this.selectorWizardsDoneRowMarkUndone).prop("disabled",!0))}else l.error("Something went wrong")},error:e=>{a.handleAjaxError(e,t)}})}markUndone(e){const t=this.getModuleContent().data("upgrade-wizards-mark-undone-token"),s=this.getModalBody(),i=this.findInModal(this.selectorOutputDoneContainer);i.empty().html(p.renderProgressBar("Marking upgrade wizard as undone...")),r.ajax({url:a.getUrl(),method:"POST",data:{install:{action:"upgradeWizardsMarkUndone",token:t,identifier:e}},cache:!1,success:e=>{i.empty(),s.find(this.selectorOutputDoneContainer).empty(),!0===e.success&&Array.isArray(e.status)?e.status.forEach(e=>{l.success(e.message),this.doneUpgrades(),this.blockingUpgradesDatabaseCharsetTest()}):l.error("Something went wrong")},error:e=>{a.handleAjaxError(e,i)}})}}return new p});
\ No newline at end of file
+define(["require","exports","../AbstractInteractableModule","jquery","../../Router","../../Renderable/Severity","../../Renderable/ProgressBar","../../Renderable/InfoBox","../../Renderable/FlashMessage","TYPO3/CMS/Backend/Notification","TYPO3/CMS/Core/SecurityUtility","bootstrap"],function(e,t,s,r,a,i,d,o,n,l,c){"use strict";class p extends s.AbstractInteractableModule{constructor(){super(),this.selectorOutputWizardsContainer=".t3js-upgradeWizards-wizards-output",this.selectorOutputDoneContainer=".t3js-upgradeWizards-done-output",this.selectorWizardsBlockingAddsTemplate=".t3js-upgradeWizards-blocking-adds-template",this.selectorWizardsBlockingAddsRows=".t3js-upgradeWizards-blocking-adds-rows",this.selectorWizardsBlockingAddsExecute=".t3js-upgradeWizards-blocking-adds-execute",this.selectorWizardsBlockingCharsetTemplate=".t3js-upgradeWizards-blocking-charset-template",this.selectorWizardsBlockingCharsetFix=".t3js-upgradeWizards-blocking-charset-fix",this.selectorWizardsDoneBodyTemplate=".t3js-upgradeWizards-done-body-template",this.selectorWizardsDoneRows=".t3js-upgradeWizards-done-rows",this.selectorWizardsDoneRowTemplate=".t3js-upgradeWizards-done-row-template table tr",this.selectorWizardsDoneRowMarkUndone=".t3js-upgradeWizards-done-markUndone",this.selectorWizardsDoneRowTitle=".t3js-upgradeWizards-done-title",this.selectorWizardsListTemplate=".t3js-upgradeWizards-list-template",this.selectorWizardsListRows=".t3js-upgradeWizards-list-rows",this.selectorWizardsListRowTemplate=".t3js-upgradeWizards-list-row-template",this.selectorWizardsListRowTitle=".t3js-upgradeWizards-list-row-title",this.selectorWizardsListRowExplanation=".t3js-upgradeWizards-list-row-explanation",this.selectorWizardsListRowExecute=".t3js-upgradeWizards-list-row-execute",this.selectorWizardsInputTemplate=".t3js-upgradeWizards-input",this.selectorWizardsInputTitle=".t3js-upgradeWizards-input-title",this.selectorWizardsInputHtml=".t3js-upgradeWizards-input-html",this.selectorWizardsInputPerform=".t3js-upgradeWizards-input-perform",this.securityUtility=new c}static removeLoadingMessage(e){e.find(".alert-loading").remove()}static renderProgressBar(e){return d.render(i.loading,e,"")}initialize(e){this.currentModal=e,this.getData().done(()=>{this.doneUpgrades()}),e.on("click",this.selectorWizardsDoneRowMarkUndone,e=>{this.markUndone(e.target.dataset.identifier)}),e.on("click",this.selectorWizardsBlockingCharsetFix,()=>{this.blockingUpgradesDatabaseCharsetFix()}),e.on("click",this.selectorWizardsBlockingAddsExecute,()=>{this.blockingUpgradesDatabaseAddsExecute()}),e.on("click",this.selectorWizardsListRowExecute,e=>{this.wizardInput(e.target.dataset.identifier,e.target.dataset.title)}),e.on("click",this.selectorWizardsInputPerform,e=>{this.wizardExecute(e.target.dataset.identifier,e.target.dataset.title)})}getData(){const e=this.getModalBody();return r.ajax({url:a.getUrl("upgradeWizardsGetData"),cache:!1,success:t=>{!0===t.success?(e.empty().append(t.html),this.blockingUpgradesDatabaseCharsetTest()):l.error("Something went wrong")},error:e=>{a.handleAjaxError(e)}})}blockingUpgradesDatabaseCharsetTest(){const e=this.getModalBody(),t=this.findInModal(this.selectorOutputWizardsContainer);t.empty().html(p.renderProgressBar("Checking database charset...")),r.ajax({url:a.getUrl("upgradeWizardsBlockingDatabaseCharsetTest"),cache:!1,success:s=>{p.removeLoadingMessage(t),!0===s.success&&(!0===s.needsUpdate?e.find(this.selectorOutputWizardsContainer).append(e.find(this.selectorWizardsBlockingCharsetTemplate)).clone():this.blockingUpgradesDatabaseAdds())},error:e=>{a.handleAjaxError(e,t)}})}blockingUpgradesDatabaseCharsetFix(){const e=r(this.selectorOutputWizardsContainer);e.empty().html(p.renderProgressBar("Setting database charset to UTF-8...")),r.ajax({url:a.getUrl("upgradeWizardsBlockingDatabaseCharsetFix"),cache:!1,success:t=>{if(p.removeLoadingMessage(e),!0===t.success)Array.isArray(t.status)&&t.status.length>0&&t.status.forEach(t=>{const s=o.render(t.severity,t.title,t.message);e.append(s)});else{const t=n.render(i.error,"Something went wrong","");p.removeLoadingMessage(e),e.append(t)}},error:t=>{a.handleAjaxError(t,e)}})}blockingUpgradesDatabaseAdds(){const e=this.getModalBody(),t=this.findInModal(this.selectorOutputWizardsContainer);t.empty().html(p.renderProgressBar("Check for missing mandatory database tables and fields...")),r.ajax({url:a.getUrl("upgradeWizardsBlockingDatabaseAdds"),cache:!1,success:s=>{if(p.removeLoadingMessage(t),!0===s.success)if(!0===s.needsUpdate){const t=e.find(this.selectorWizardsBlockingAddsTemplate).clone();"object"==typeof s.adds.tables&&s.adds.tables.forEach(e=>{const s="Table: "+this.securityUtility.encodeHtml(e.table);t.find(this.selectorWizardsBlockingAddsRows).append(s,"<br>")}),"object"==typeof s.adds.columns&&s.adds.columns.forEach(e=>{const s="Table: "+this.securityUtility.encodeHtml(e.table)+", Field: "+this.securityUtility.encodeHtml(e.field);t.find(this.selectorWizardsBlockingAddsRows).append(s,"<br>")}),"object"==typeof s.adds.indexes&&s.adds.indexes.forEach(e=>{const s="Table: "+this.securityUtility.encodeHtml(e.table)+", Index: "+this.securityUtility.encodeHtml(e.index);t.find(this.selectorWizardsBlockingAddsRows).append(s,"<br>")}),e.find(this.selectorOutputWizardsContainer).append(t)}else this.wizardsList();else l.error("Something went wrong")},error:e=>{a.handleAjaxError(e,t)}})}blockingUpgradesDatabaseAddsExecute(){const e=this.findInModal(this.selectorOutputWizardsContainer);e.empty().html(p.renderProgressBar("Adding database tables and fields...")),r.ajax({url:a.getUrl("upgradeWizardsBlockingDatabaseExecute"),cache:!1,success:t=>{if(p.removeLoadingMessage(e),!0===t.success)Array.isArray(t.status)&&t.status.length>0&&(t.status.forEach(t=>{const s=o.render(t.severity,t.title,t.message);e.append(s)}),this.wizardsList());else{const t=n.render(i.error,"Something went wrong","");p.removeLoadingMessage(e),e.append(t)}},error:t=>{a.handleAjaxError(t,e)}})}wizardsList(){const e=this.getModalBody(),t=this.findInModal(this.selectorOutputWizardsContainer);t.append(p.renderProgressBar("Loading upgrade wizards...")),r.ajax({url:a.getUrl("upgradeWizardsList"),cache:!1,success:s=>{p.removeLoadingMessage(t);const r=e.find(this.selectorWizardsListTemplate).clone();if(r.removeClass("t3js-upgradeWizards-list-template"),!0===s.success){let t=0,a=0;Array.isArray(s.wizards)&&s.wizards.length>0&&(a=s.wizards.length,s.wizards.forEach(s=>{if(!0===s.shouldRenderWizard){const a=e.find(this.selectorWizardsListRowTemplate).clone();t+=1,a.removeClass("t3js-upgradeWizards-list-row-template"),a.find(this.selectorWizardsListRowTitle).empty().text(s.title),a.find(this.selectorWizardsListRowExplanation).empty().text(s.explanation),a.find(this.selectorWizardsListRowExecute).attr("data-identifier",s.identifier).attr("data-title",s.title),r.find(this.selectorWizardsListRows).append(a)}}),r.find(this.selectorWizardsListRows+" hr:last").remove());let i=100;const d=r.find(".progress-bar");t>0?i=Math.round((a-t)/s.wizards.length*100):d.removeClass("progress-bar-info").addClass("progress-bar-success"),d.removeClass("progress-bar-striped").css("width",i+"%").attr("aria-valuenow",i).find("span").text(i+"%"),e.find(this.selectorOutputWizardsContainer).append(r),this.findInModal(this.selectorWizardsDoneRowMarkUndone).prop("disabled",!1)}else l.error("Something went wrong")},error:e=>{a.handleAjaxError(e,t)}})}wizardInput(e,t){const s=this.getModuleContent().data("upgrade-wizards-input-token"),i=this.getModalBody(),d=this.findInModal(this.selectorOutputWizardsContainer);d.empty().html(p.renderProgressBar('Loading "'+t+'"...')),i.animate({scrollTop:i.scrollTop()-Math.abs(i.find(".t3js-upgrade-status-section").position().top)},250),r.ajax({url:a.getUrl(),method:"POST",data:{install:{action:"upgradeWizardsInput",token:s,identifier:e}},cache:!1,success:e=>{d.empty();const t=i.find(this.selectorWizardsInputTemplate).clone();t.removeClass("t3js-upgradeWizards-input"),!0===e.success&&(Array.isArray(e.status)&&e.status.forEach(e=>{const t=n.render(e.severity,e.title,e.message);d.append(t)}),e.userInput.wizardHtml.length>0&&t.find(this.selectorWizardsInputHtml).html(e.userInput.wizardHtml),t.find(this.selectorWizardsInputTitle).text(e.userInput.title),t.find(this.selectorWizardsInputPerform).attr("data-identifier",e.userInput.identifier).attr("data-title",e.userInput.title)),i.find(this.selectorOutputWizardsContainer).append(t)},error:e=>{a.handleAjaxError(e,d)}})}wizardExecute(e,t){const s=this.getModuleContent().data("upgrade-wizards-execute-token"),i=this.getModalBody(),d={"install[action]":"upgradeWizardsExecute","install[token]":s,"install[identifier]":e};r(this.findInModal(this.selectorOutputWizardsContainer+" form").serializeArray()).each((e,t)=>{d[t.name]=t.value});const n=this.findInModal(this.selectorOutputWizardsContainer);n.empty().html(p.renderProgressBar('Executing "'+t+'"...')),this.findInModal(this.selectorWizardsDoneRowMarkUndone).prop("disabled",!0),r.ajax({method:"POST",data:d,url:a.getUrl(),cache:!1,success:e=>{n.empty(),!0===e.success?(Array.isArray(e.status)&&e.status.forEach(e=>{const t=o.render(e.severity,e.title,e.message);n.append(t)}),this.wizardsList(),i.find(this.selectorOutputDoneContainer).empty(),this.doneUpgrades()):l.error("Something went wrong")},error:e=>{a.handleAjaxError(e,n)}})}doneUpgrades(){const e=this.getModalBody(),t=e.find(this.selectorOutputDoneContainer);t.empty().html(p.renderProgressBar("Loading executed upgrade wizards...")),r.ajax({url:a.getUrl("upgradeWizardsDoneUpgrades"),cache:!1,success:s=>{if(p.removeLoadingMessage(t),!0===s.success){Array.isArray(s.status)&&s.status.length>0&&s.status.forEach(e=>{const s=o.render(e.severity,e.title,e.message);t.append(s)});const r=e.find(this.selectorWizardsDoneBodyTemplate).clone(),a=r.find(this.selectorWizardsDoneRows);let i=!1;Array.isArray(s.wizardsDone)&&s.wizardsDone.length>0&&s.wizardsDone.forEach(t=>{i=!0;const s=e.find(this.selectorWizardsDoneRowTemplate).clone();s.find(this.selectorWizardsDoneRowMarkUndone).attr("data-identifier",t.identifier),s.find(this.selectorWizardsDoneRowTitle).text(t.title),a.append(s)}),Array.isArray(s.rowUpdatersDone)&&s.rowUpdatersDone.length>0&&s.rowUpdatersDone.forEach(t=>{i=!0;const s=e.find(this.selectorWizardsDoneRowTemplate).clone();s.find(this.selectorWizardsDoneRowMarkUndone).attr("data-identifier",t.identifier),s.find(this.selectorWizardsDoneRowTitle).text(t.title),a.append(s)}),i&&(e.find(this.selectorOutputDoneContainer).append(r),this.findInModal(this.selectorWizardsDoneRowMarkUndone).prop("disabled",!0))}else l.error("Something went wrong")},error:e=>{a.handleAjaxError(e,t)}})}markUndone(e){const t=this.getModuleContent().data("upgrade-wizards-mark-undone-token"),s=this.getModalBody(),i=this.findInModal(this.selectorOutputDoneContainer);i.empty().html(p.renderProgressBar("Marking upgrade wizard as undone...")),r.ajax({url:a.getUrl(),method:"POST",data:{install:{action:"upgradeWizardsMarkUndone",token:t,identifier:e}},cache:!1,success:e=>{i.empty(),s.find(this.selectorOutputDoneContainer).empty(),!0===e.success&&Array.isArray(e.status)?e.status.forEach(e=>{l.success(e.message),this.doneUpgrades(),this.blockingUpgradesDatabaseCharsetTest()}):l.error("Something went wrong")},error:e=>{a.handleAjaxError(e,i)}})}}return new p});
\ No newline at end of file
index 39ee7e2..cc977f2 100644 (file)
@@ -10,4 +10,4 @@
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require","exports","TYPO3/CMS/Backend/Enum/Severity","jquery","TYPO3/CMS/Backend/Modal","TYPO3/CMS/Backend/Storage/Persistent","TYPO3/CMS/Core/SecurityUtility","TYPO3/CMS/Backend/Tooltip","TYPO3/CMS/Backend/Utility","TYPO3/CMS/Backend/Viewport","TYPO3/CMS/Backend/Wizard","./Workspaces","twbs/bootstrap-slider","nprogress","TYPO3/CMS/Backend/Input/Clearable"],function(require,exports,Severity_1,$,Modal,Persistent,SecurityUtility,Tooltip,Utility,Viewport,Wizard,Workspaces_1){"use strict";var Identifiers;!function(e){e.searchForm="#workspace-settings-form",e.searchTextField='#workspace-settings-form input[name="search-text"]',e.searchSubmitBtn='#workspace-settings-form button[type="submit"]',e.depthSelector='#workspace-settings-form [name="depth"]',e.languageSelector='#workspace-settings-form select[name="languages"]',e.chooseStageAction='#workspace-actions-form [name="stage-action"]',e.chooseSelectionAction='#workspace-actions-form [name="selection-action"]',e.chooseMassAction='#workspace-actions-form [name="mass-action"]',e.container="#workspace-panel",e.actionIcons="#workspace-action-icons",e.toggleAll=".t3js-toggle-all",e.previewLinksButton=".t3js-preview-link",e.pagination="#workspace-pagination"}(Identifiers||(Identifiers={}));class Backend extends Workspaces_1.default{constructor(){super(),this.elements={},this.settings={dir:"ASC",id:TYPO3.settings.Workspaces.id,language:TYPO3.settings.Workspaces.language,limit:30,query:"",sort:"label_Live",start:0,filterTxt:""},this.paging={currentPage:1,totalPages:1,totalItems:0},this.allToggled=!1,this.latestPath="",this.markedRecordsForMassAction=[],this.indentationPadding=26,this.handleCheckboxChange=(e=>{const t=$(e.currentTarget),a=t.parents("tr"),s=a.data("table")+":"+a.data("uid")+":"+a.data("t3ver_oid");if(t.prop("checked"))this.markedRecordsForMassAction.push(s),a.addClass("warning");else{const e=this.markedRecordsForMassAction.indexOf(s);e>-1&&this.markedRecordsForMassAction.splice(e,1),a.removeClass("warning")}this.elements.$chooseStageAction.prop("disabled",0===this.markedRecordsForMassAction.length),this.elements.$chooseSelectionAction.prop("disabled",0===this.markedRecordsForMassAction.length),this.elements.$chooseMassAction.prop("disabled",this.markedRecordsForMassAction.length>0)}),this.viewChanges=(e=>{e.preventDefault();const t=$(e.currentTarget).closest("tr");this.sendRemoteRequest(this.generateRemotePayload("getRowDetails",{stage:t.data("stage"),t3ver_oid:t.data("t3ver_oid"),table:t.data("table"),uid:t.data("uid")})).done(e=>{const a=e[0].result.data[0],s=$("<div />"),n=$("<ul />",{class:"nav nav-tabs",role:"tablist"}),i=$("<div />",{class:"tab-content"}),o=[];s.append($("<p />").html(TYPO3.lang.path.replace("{0}",a.path_Live)),$("<p />").html(TYPO3.lang.current_step.replace("{0}",a.label_Stage).replace("{1}",a.stage_position).replace("{2}",a.stage_count))),a.diff.length>0&&(n.append($("<li />",{role:"presentation"}).append($("<a />",{href:"#workspace-changes","aria-controls":"workspace-changes",role:"tab","data-toggle":"tab"}).text(TYPO3.lang["window.recordChanges.tabs.changeSummary"]))),i.append($("<div />",{role:"tabpanel",class:"tab-pane",id:"workspace-changes"}).append($("<div />",{class:"form-section"}).append(Backend.generateDiffView(a.diff))))),a.comments.length>0&&(n.append($("<li />",{role:"presentation"}).append($("<a />",{href:"#workspace-comments","aria-controls":"workspace-comments",role:"tab","data-toggle":"tab"}).html(TYPO3.lang["window.recordChanges.tabs.comments"]+"&nbsp;").append($("<span />",{class:"badge"}).text(a.comments.length)))),i.append($("<div />",{role:"tabpanel",class:"tab-pane",id:"workspace-comments"}).append($("<div />",{class:"form-section"}).append(Backend.generateCommentView(a.comments))))),a.history.total>0&&(n.append($("<li />",{role:"presentation"}).append($("<a />",{href:"#workspace-history","aria-controls":"workspace-history",role:"tab","data-toggle":"tab"}).text(TYPO3.lang["window.recordChanges.tabs.history"]))),i.append($("<div />",{role:"tabpanel",class:"tab-pane",id:"workspace-history"}).append($("<div />",{class:"form-section"}).append(Backend.generateHistoryView(a.history.data))))),n.find("li").first().addClass("active"),i.find(".tab-pane").first().addClass("active"),s.append($("<div />").append(n,i)),t.data("stage")!==t.data("prevStage")&&o.push({text:a.label_PrevStage.title,active:!0,btnClass:"btn-default",name:"prevstage",trigger:()=>{Modal.currentModal.trigger("modal-dismiss"),this.sendToStage(t,"prev")}}),o.push({text:a.label_NextStage.title,active:!0,btnClass:"btn-default",name:"nextstage",trigger:()=>{Modal.currentModal.trigger("modal-dismiss"),this.sendToStage(t,"next")}}),o.push({text:TYPO3.lang.close,active:!0,btnClass:"btn-info",name:"cancel",trigger:()=>{Modal.currentModal.trigger("modal-dismiss")}}),Modal.advanced({type:Modal.types.default,title:TYPO3.lang["window.recordInformation"].replace("{0}",$.trim(t.find(".t3js-title-live").text())),content:s,severity:Severity_1.SeverityEnum.info,buttons:o,size:Modal.sizes.medium})})}),this.openPreview=(e=>{const $tr=$(e.currentTarget).closest("tr");this.sendRemoteRequest(this.generateRemoteActionsPayload("viewSingleRecord",[$tr.data("table"),$tr.data("uid")])).done(response=>{eval(response[0].result)})}),this.confirmDeleteRecordFromWorkspace=(e=>{const t=$(e.target).closest("tr"),a=Modal.confirm(TYPO3.lang["window.discard.title"],TYPO3.lang["window.discard.message"],Severity_1.SeverityEnum.warning,[{text:TYPO3.lang.cancel,active:!0,btnClass:"btn-default",name:"cancel",trigger:()=>{a.modal("hide")}},{text:TYPO3.lang.ok,btnClass:"btn-warning",name:"ok"}]);a.on("button.clicked",e=>{"ok"===e.target.name&&this.sendRemoteRequest([this.generateRemoteActionsPayload("deleteSingleRecord",[t.data("table"),t.data("uid")])]).done(()=>{a.modal("hide"),this.getWorkspaceInfos(),Backend.refreshPageTree()})})}),this.runSelectionAction=(()=>{const e=this.elements.$chooseSelectionAction.val(),t="discard"!==e;if(0===e.length)return;const a=[];for(let e=0;e<this.markedRecordsForMassAction.length;++e){const t=this.markedRecordsForMassAction[e].split(":");a.push({table:t[0],liveId:t[2],versionId:t[1]})}t?this.checkIntegrity({selection:a,type:"selection"}).done(t=>{Wizard.setForceSelection(!1),"warning"===t[0].result.result&&this.addIntegrityCheckWarningToWizard(),this.renderSelectionActionWizard(e,a)}):(Wizard.setForceSelection(!1),this.renderSelectionActionWizard(e,a))}),this.addIntegrityCheckWarningToWizard=(()=>{Wizard.addSlide("integrity-warning","Warning",TYPO3.lang["integrity.hasIssuesDescription"]+"<br>"+TYPO3.lang["integrity.hasIssuesQuestion"],Severity_1.SeverityEnum.warning)}),this.runMassAction=(()=>{const e=this.elements.$chooseMassAction.val(),t="discard"!==e;0!==e.length&&(t?this.checkIntegrity({language:this.settings.language,type:e}).done(t=>{Wizard.setForceSelection(!1),"warning"===t[0].result.result&&this.addIntegrityCheckWarningToWizard(),this.renderMassActionWizard(e)}):(Wizard.setForceSelection(!1),this.renderMassActionWizard(e)))}),this.sendToSpecificStageAction=(e=>{const t=[],a=$(e.currentTarget).val();for(let e=0;e<this.markedRecordsForMassAction.length;++e){const a=this.markedRecordsForMassAction[e].split(":");t.push({table:a[0],uid:a[1],t3ver_oid:a[2]})}this.sendRemoteRequest(this.generateRemoteActionsPayload("sendToSpecificStageWindow",[a,t])).done(e=>{const s=this.renderSendToStageWindow(e);s.on("button.clicked",e=>{if("ok"===e.target.name){const n=Utility.convertFormToObject(e.currentTarget.querySelector("form"));n.affects={elements:t,nextStage:a},this.sendRemoteRequest([this.generateRemoteActionsPayload("sendToSpecificStageExecute",[n]),this.generateRemotePayload("getWorkspaceInfos",this.settings)]).done(e=>{s.modal("hide"),this.renderWorkspaceInfos(e[1].result),Backend.refreshPageTree()})}}).on("modal-destroyed",()=>{this.elements.$chooseStageAction.val("")})})}),this.generatePreviewLinks=(()=>{this.sendRemoteRequest(this.generateRemoteActionsPayload("generateWorkspacePreviewLinksForAllLanguages",[this.settings.id])).done(e=>{const t=e[0].result,a=$("<dl />");$.each(t,(e,t)=>{a.append($("<dt />").text(e),$("<dd />").append($("<a />",{href:t,target:"_blank"}).text(t)))}),Modal.show(TYPO3.lang.previewLink,a,Severity_1.SeverityEnum.info,[{text:TYPO3.lang.ok,active:!0,btnClass:"btn-info",name:"ok",trigger:()=>{Modal.currentModal.trigger("modal-dismiss")}}],["modal-inner-scroll"])})}),$(()=>{let e;this.getElements(),this.registerEvents(),Persistent.isset("this.Module.depth")?(e=Persistent.get("this.Module.depth"),this.elements.$depthSelector.val(e),this.settings.depth=e):this.settings.depth=TYPO3.settings.Workspaces.depth,this.loadWorkspaceComponents()})}static refreshPageTree(){Viewport.NavigationContainer&&Viewport.NavigationContainer.PageTree&&Viewport.NavigationContainer.PageTree.refreshTree()}static generateDiffView(e){const t=$("<div />",{class:"diff"});for(let a=0;a<e.length;++a)t.append($("<div />",{class:"diff-item"}).append($("<div />",{class:"diff-item-title"}).text(e[a].label),$("<div />",{class:"diff-item-result diff-item-result-inline"}).html(e[a].content)));return t}static generateCommentView(e){const t=$("<div />");for(let a=0;a<e.length;++a){const s=$("<div />",{class:"panel panel-default"});e[a].user_comment.length>0&&s.append($("<div />",{class:"panel-body"}).html(e[a].user_comment)),s.append($("<div />",{class:"panel-footer"}).append($("<span />",{class:"label label-success"}).text(e[a].stage_title),$("<span />",{class:"label label-info"}).text(e[a].tstamp))),t.append($("<div />",{class:"media"}).append($("<div />",{class:"media-left text-center"}).text(e[a].user_username).prepend($("<div />").html(e[a].user_avatar)),$("<div />",{class:"media-body"}).append(s)))}return t}static generateHistoryView(e){const t=$("<div />");for(let a=0;a<e.length;++a){const s=$("<div />",{class:"panel panel-default"});let n;if("object"==typeof e[a].differences){if(0===e[a].differences.length)continue;n=$("<div />",{class:"diff"});for(let t=0;t<e[a].differences.length;++t)n.append($("<div />",{class:"diff-item"}).append($("<div />",{class:"diff-item-title"}).text(e[a].differences[t].label),$("<div />",{class:"diff-item-result diff-item-result-inline"}).html(e[a].differences[t].html)));s.append($("<div />").append(n))}else s.append($("<div />",{class:"panel-body"}).text(e[a].differences));s.append($("<div />",{class:"panel-footer"}).append($("<span />",{class:"label label-info"}).text(e[a].datetime))),t.append($("<div />",{class:"media"}).append($("<div />",{class:"media-left text-center"}).text(e[a].user).prepend($("<div />").html(e[a].user_avatar)),$("<div />",{class:"media-body"}).append(s)))}return t}getElements(){this.elements.$searchForm=$(Identifiers.searchForm),this.elements.$searchTextField=$(Identifiers.searchTextField),this.elements.$searchSubmitBtn=$(Identifiers.searchSubmitBtn),this.elements.$depthSelector=$(Identifiers.depthSelector),this.elements.$languageSelector=$(Identifiers.languageSelector),this.elements.$container=$(Identifiers.container),this.elements.$tableBody=this.elements.$container.find("tbody"),this.elements.$actionIcons=$(Identifiers.actionIcons),this.elements.$toggleAll=$(Identifiers.toggleAll),this.elements.$chooseStageAction=$(Identifiers.chooseStageAction),this.elements.$chooseSelectionAction=$(Identifiers.chooseSelectionAction),this.elements.$chooseMassAction=$(Identifiers.chooseMassAction),this.elements.$previewLinksButton=$(Identifiers.previewLinksButton),this.elements.$pagination=$(Identifiers.pagination)}registerEvents(){$(document).on("click",'[data-action="swap"]',e=>{const t=e.target.closest("tr");this.checkIntegrity({selection:[{liveId:t.dataset.uid,versionId:t.dataset.t3ver_oid,table:t.dataset.table}],type:"selection"}).done(e=>{"warning"===e[0].result.result&&this.addIntegrityCheckWarningToWizard(),Wizard.setForceSelection(!1),Wizard.addSlide("swap-confirm","Swap",TYPO3.lang["window.swap.message"],Severity_1.SeverityEnum.info),Wizard.addFinalProcessingSlide(()=>{this.sendRemoteRequest(this.generateRemoteActionsPayload("swapSingleRecord",[t.dataset.table,t.dataset.t3ver_oid,t.dataset.uid])).done(()=>{Wizard.dismiss(),this.getWorkspaceInfos(),Backend.refreshPageTree()})}).done(()=>{Wizard.show()})})}).on("click",'[data-action="prevstage"]',e=>{this.sendToStage($(e.currentTarget).closest("tr"),"prev")}).on("click",'[data-action="nextstage"]',e=>{this.sendToStage($(e.currentTarget).closest("tr"),"next")}).on("click",'[data-action="changes"]',this.viewChanges).on("click",'[data-action="preview"]',this.openPreview).on("click",'[data-action="open"]',e=>{const t=e.currentTarget.closest("tr");let a=TYPO3.settings.FormEngine.moduleUrl+"&returnUrl="+encodeURIComponent(document.location.href)+"&id="+TYPO3.settings.Workspaces.id+"&edit["+t.dataset.table+"]["+t.dataset.uid+"]=edit";TYPO3.settings.Workspaces.allView&&(a+="&workspace="+t.dataset.t3ver_wsid),window.location.href=a}).on("click",'[data-action="version"]',e=>{const t=e.currentTarget.closest("tr"),a="pages"===t.dataset.table?t.dataset.t3ver_oid:t.dataset.pid;window.location.href=top.TYPO3.configuration.pageModuleUrl+"&id="+a+"&returnUrl="+encodeURIComponent(window.location.href)}).on("click",'[data-action="remove"]',this.confirmDeleteRecordFromWorkspace).on("click",'[data-action="expand"]',e=>{const t=$(e.currentTarget);let a;a="true"===this.elements.$tableBody.find(t.data("target")).first().attr("aria-expanded")?"apps-pagetree-expand":"apps-pagetree-collapse",t.empty().append(this.getPreRenderedIcon(a))}),$(window.top.document).on("click",".t3js-workspace-recipients-selectall",e=>{e.preventDefault(),$(".t3js-workspace-recipient",window.top.document).not(":disabled").prop("checked",!0)}).on("click",".t3js-workspace-recipients-deselectall",e=>{e.preventDefault(),$(".t3js-workspace-recipient",window.top.document).not(":disabled").prop("checked",!1)}),this.elements.$searchForm.on("submit",e=>{e.preventDefault(),this.settings.filterTxt=this.elements.$searchTextField.val(),this.getWorkspaceInfos()}),this.elements.$searchTextField.on("keyup",e=>{""!==e.target.value?this.elements.$searchSubmitBtn.removeClass("disabled"):(this.elements.$searchSubmitBtn.addClass("disabled"),this.getWorkspaceInfos())}),this.elements.$searchTextField.get(0).clearable({onClear:()=>{this.elements.$searchSubmitBtn.addClass("disabled"),this.settings.filterTxt="",this.getWorkspaceInfos()}}),this.elements.$toggleAll.on("click",()=>{this.allToggled=!this.allToggled,this.elements.$tableBody.find('input[type="checkbox"]').prop("checked",this.allToggled).trigger("change")}),this.elements.$tableBody.on("change","tr input[type=checkbox]",this.handleCheckboxChange),this.elements.$depthSelector.on("change",e=>{const t=e.target.value;Persistent.set("this.Module.depth",t),this.settings.depth=t,this.getWorkspaceInfos()}),this.elements.$previewLinksButton.on("click",this.generatePreviewLinks),this.elements.$languageSelector.on("change",e=>{const t=$(e.target);this.settings.language=t.val(),this.sendRemoteRequest([this.generateRemoteActionsPayload("saveLanguageSelection",[t.val()]),this.generateRemotePayload("getWorkspaceInfos",this.settings)]).done(e=>{this.elements.$languageSelector.prev().html(t.find(":selected").data("icon")),this.renderWorkspaceInfos(e[1].result)})}),this.elements.$chooseStageAction.on("change",this.sendToSpecificStageAction),this.elements.$chooseSelectionAction.on("change",this.runSelectionAction),this.elements.$chooseMassAction.on("change",this.runMassAction),this.elements.$pagination.on("click","a[data-action]",e=>{e.preventDefault();const t=$(e.currentTarget);let a=!1;switch(t.data("action")){case"previous":this.paging.currentPage>1&&(this.paging.currentPage--,a=!0);break;case"next":this.paging.currentPage<this.paging.totalPages&&(this.paging.currentPage++,a=!0);break;case"page":this.paging.currentPage=parseInt(t.data("page"),10),a=!0;break;default:throw'Unknown action "'+t.data("action")+'"'}a&&(this.settings.start=parseInt(this.settings.limit.toString(),10)*(this.paging.currentPage-1),this.getWorkspaceInfos())})}sendToStage(e,t){let a,s,n;if("next"===t)a=e.data("nextStage"),s="sendToNextStageWindow",n="sendToNextStageExecute";else{if("prev"!==t)throw"Invalid direction given.";a=e.data("prevStage"),s="sendToPrevStageWindow",n="sendToPrevStageExecute"}this.sendRemoteRequest(this.generateRemoteActionsPayload(s,[e.data("uid"),e.data("table"),e.data("t3ver_oid")])).done(t=>{const s=this.renderSendToStageWindow(t);s.on("button.clicked",t=>{if("ok"===t.target.name){const i=Utility.convertFormToObject(t.currentTarget.querySelector("form"));i.affects={table:e.data("table"),nextStage:a,t3ver_oid:e.data("t3ver_oid"),uid:e.data("uid"),elements:[]},this.sendRemoteRequest([this.generateRemoteActionsPayload(n,[i]),this.generateRemotePayload("getWorkspaceInfos",this.settings)]).done(e=>{s.modal("hide"),this.renderWorkspaceInfos(e[1].result),Backend.refreshPageTree()})}})})}loadWorkspaceComponents(){this.sendRemoteRequest([this.generateRemotePayload("getWorkspaceInfos",this.settings),this.generateRemotePayload("getStageActions",{}),this.generateRemoteMassActionsPayload("getMassStageActions",{}),this.generateRemotePayload("getSystemLanguages",{pageUid:this.elements.$container.data("pageUid")})]).done(e=>{this.elements.$depthSelector.prop("disabled",!1),this.renderWorkspaceInfos(e[0].result);const t=e[1].result.data;let a;for(a=0;a<t.length;++a)this.elements.$chooseStageAction.append($("<option />").val(t[a].uid).text(t[a].title));const s=e[2].result.data;for(a=0;a<s.length;++a)this.elements.$chooseSelectionAction.append($("<option />").val(s[a].action).text(s[a].title)),this.elements.$chooseMassAction.append($("<option />").val(s[a].action).text(s[a].title));const n=e[3].result.data;for(a=0;a<n.length;++a){const e=$("<option />").val(n[a].uid).text(n[a].title).data("icon",n[a].icon);String(n[a].uid)===String(TYPO3.settings.Workspaces.language)&&(e.prop("selected",!0),this.elements.$languageSelector.prev().html(n[a].icon)),this.elements.$languageSelector.append(e)}this.elements.$languageSelector.prop("disabled",!1)})}getWorkspaceInfos(){this.sendRemoteRequest(this.generateRemotePayload("getWorkspaceInfos",this.settings)).done(e=>{this.renderWorkspaceInfos(e[0].result)})}renderWorkspaceInfos(e){this.elements.$tableBody.children().remove(),this.allToggled=!1,this.elements.$chooseStageAction.prop("disabled",!0),this.elements.$chooseSelectionAction.prop("disabled",!0),this.elements.$chooseMassAction.prop("disabled",0===e.data.length),this.buildPagination(e.total);for(let t=0;t<e.data.length;++t){const a=e.data[t],s=$("<div />",{class:"btn-group"});let n;s.append(this.getAction(a.Workspaces_CollectionChildren>0&&""!==a.Workspaces_CollectionCurrent,"expand","apps-pagetree-collapse").attr("title",TYPO3.lang["tooltip.expand"]).attr("data-target",'[data-collection="'+a.Workspaces_CollectionCurrent+'"]').attr("data-toggle","collapse"),$("<button />",{class:"btn btn-default","data-action":"changes","data-toggle":"tooltip",title:TYPO3.lang["tooltip.showChanges"]}).append(this.getPreRenderedIcon("actions-document-info")),this.getAction(a.allowedAction_swap&&""===a.Workspaces_CollectionParent,"swap","actions-version-swap-version").attr("title",TYPO3.lang["tooltip.swap"]),this.getAction(a.allowedAction_view,"preview","actions-version-workspace-preview").attr("title",TYPO3.lang["tooltip.viewElementAction"]),this.getAction(a.allowedAction_edit,"open","actions-open").attr("title",TYPO3.lang["tooltip.editElementAction"]),this.getAction(!0,"version","actions-version-page-open").attr("title",TYPO3.lang["tooltip.openPage"]),this.getAction(a.allowedAction_delete,"remove","actions-version-document-remove").attr("title",TYPO3.lang["tooltip.discardVersion"])),""!==a.integrity.messages&&(n=$(TYPO3.settings.Workspaces.icons[a.integrity.status])).attr("data-toggle","tooltip").attr("data-placement","top").attr("data-html","true").attr("title",a.integrity.messages),this.latestPath!==a.path_Workspace&&(this.latestPath=a.path_Workspace,this.elements.$tableBody.append($("<tr />").append($("<th />"),$("<th />",{colspan:6}).text(this.latestPath))));const i=$("<label />",{class:"btn btn-default btn-checkbox"}).append($("<input />",{type:"checkbox"}),$("<span />",{class:"t3-icon fa"})),o={"data-uid":a.uid,"data-pid":a.livepid,"data-t3ver_oid":a.t3ver_oid,"data-t3ver_wsid":a.t3ver_wsid,"data-table":a.table,"data-next-stage":a.value_nextStage,"data-prev-stage":a.value_prevStage,"data-stage":a.stage};""!==a.Workspaces_CollectionParent&&(o["data-collection"]=a.Workspaces_CollectionParent,o.class="collapse"),this.elements.$tableBody.append($("<tr />",o).append($("<td />").empty().append(i),$("<td />",{class:"t3js-title-workspace",style:a.Workspaces_CollectionLevel>0?"padding-left: "+this.indentationPadding*a.Workspaces_CollectionLevel+"px":""}).html(a.icon_Workspace+'&nbsp;<a href="#" data-action="changes"><span class="item-state-'+a.state_Workspace+'">'+a.label_Workspace+"</span></a>"),$("<td />",{class:"t3js-title-live"}).html(a.icon_Live+"&nbsp;"+a.label_Live),$("<td />").text(a.label_Stage),$("<td />").empty().append(n),$("<td />").html(a.language.icon),$("<td />",{class:"text-right nowrap"}).append(s))),Tooltip.initialize('[data-toggle="tooltip"]',{delay:{show:500,hide:100},trigger:"hover",container:"body"})}}buildPagination(e){if(0===e)return void this.elements.$pagination.contents().remove();if(this.paging.totalItems=e,this.paging.totalPages=Math.ceil(e/parseInt(this.settings.limit.toString(),10)),1===this.paging.totalPages)return void this.elements.$pagination.contents().remove();const t=$("<ul />",{class:"pagination pagination-block"}),a=[],s=$("<li />").append($("<a />",{"data-action":"previous"}).append($("<span />",{class:"t3-icon fa fa-arrow-left"}))),n=$("<li />").append($("<a />",{"data-action":"next"}).append($("<span />",{class:"t3-icon fa fa-arrow-right"})));1===this.paging.currentPage&&s.disablePagingAction(),this.paging.currentPage===this.paging.totalPages&&n.disablePagingAction();for(let e=1;e<=this.paging.totalPages;e++){const t=$("<li />",{class:this.paging.currentPage===e?"active":""});t.append($("<a />",{"data-action":"page","data-page":e}).append($("<span />").text(e))),a.push(t)}t.append(s,a,n),this.elements.$pagination.empty().append(t)}renderSelectionActionWizard(e,t){Wizard.addSlide("mass-action-confirmation",TYPO3.lang["window.selectionAction.title"],"<p>"+(new SecurityUtility).encodeHtml(TYPO3.lang["tooltip."+e+"Selected"])+"</p>",Severity_1.SeverityEnum.warning),Wizard.addFinalProcessingSlide(()=>{this.sendRemoteRequest(this.generateRemoteActionsPayload("executeSelectionAction",{action:e,selection:t})).done(()=>{this.getWorkspaceInfos(),Wizard.dismiss(),Backend.refreshPageTree()})}).done(()=>{Wizard.show(),Wizard.getComponent().on("wizard-dismissed",()=>{this.elements.$chooseSelectionAction.val("")})})}renderMassActionWizard(e){let t,a=!1;switch(e){case"publish":t="publishWorkspace";break;case"swap":t="publishWorkspace",a=!0;break;case"discard":t="flushWorkspace";break;default:throw"Invalid mass action "+e+" called."}const s=new SecurityUtility;Wizard.setForceSelection(!1),Wizard.addSlide("mass-action-confirmation",TYPO3.lang["window.massAction.title"],"<p>"+s.encodeHtml(TYPO3.lang["tooltip."+e+"All"])+"<br><br>"+s.encodeHtml(TYPO3.lang["tooltip.affectWholeWorkspace"])+"</p>",Severity_1.SeverityEnum.warning);const n=e=>{const a=e[0].result;a.processed<a.total?this.sendRemoteRequest(this.generateRemoteMassActionsPayload(t,a)).done(n):(this.getWorkspaceInfos(),Wizard.dismiss())};Wizard.addFinalProcessingSlide(()=>{this.sendRemoteRequest(this.generateRemoteMassActionsPayload(t,{init:!0,total:0,processed:0,language:this.settings.language,swap:a})).done(n)}).done(()=>{Wizard.show(),Wizard.getComponent().on("wizard-dismissed",()=>{this.elements.$chooseMassAction.val("")})})}getAction(e,t,a){return e?$("<button />",{class:"btn btn-default","data-action":t,"data-toggle":"tooltip"}).append(this.getPreRenderedIcon(a)):$("<span />",{class:"btn btn-default disabled"}).append(this.getPreRenderedIcon("empty-empty"))}getPreRenderedIcon(e){return this.elements.$actionIcons.find('[data-identifier="'+e+'"]').clone()}}return new Backend});
\ No newline at end of file
+define(["require","exports","jquery","TYPO3/CMS/Backend/Enum/Severity","./Workspaces","TYPO3/CMS/Backend/Modal","TYPO3/CMS/Backend/Storage/Persistent","TYPO3/CMS/Backend/Tooltip","TYPO3/CMS/Backend/Utility","TYPO3/CMS/Backend/Viewport","TYPO3/CMS/Backend/Wizard","TYPO3/CMS/Core/SecurityUtility","nprogress","twbs/bootstrap-slider","TYPO3/CMS/Backend/Input/Clearable"],function(require,exports,$,Severity_1,Workspaces_1,Modal,Persistent,Tooltip,Utility,Viewport,Wizard,SecurityUtility){"use strict";var Identifiers;!function(e){e.searchForm="#workspace-settings-form",e.searchTextField='#workspace-settings-form input[name="search-text"]',e.searchSubmitBtn='#workspace-settings-form button[type="submit"]',e.depthSelector='#workspace-settings-form [name="depth"]',e.languageSelector='#workspace-settings-form select[name="languages"]',e.chooseStageAction='#workspace-actions-form [name="stage-action"]',e.chooseSelectionAction='#workspace-actions-form [name="selection-action"]',e.chooseMassAction='#workspace-actions-form [name="mass-action"]',e.container="#workspace-panel",e.actionIcons="#workspace-action-icons",e.toggleAll=".t3js-toggle-all",e.previewLinksButton=".t3js-preview-link",e.pagination="#workspace-pagination"}(Identifiers||(Identifiers={}));class Backend extends Workspaces_1.default{constructor(){super(),this.elements={},this.settings={dir:"ASC",id:TYPO3.settings.Workspaces.id,language:TYPO3.settings.Workspaces.language,limit:30,query:"",sort:"label_Live",start:0,filterTxt:""},this.paging={currentPage:1,totalPages:1,totalItems:0},this.allToggled=!1,this.latestPath="",this.markedRecordsForMassAction=[],this.indentationPadding=26,this.handleCheckboxChange=(e=>{const t=$(e.currentTarget),a=t.parents("tr"),s=a.data("table")+":"+a.data("uid")+":"+a.data("t3ver_oid");if(t.prop("checked"))this.markedRecordsForMassAction.push(s),a.addClass("warning");else{const e=this.markedRecordsForMassAction.indexOf(s);e>-1&&this.markedRecordsForMassAction.splice(e,1),a.removeClass("warning")}this.elements.$chooseStageAction.prop("disabled",0===this.markedRecordsForMassAction.length),this.elements.$chooseSelectionAction.prop("disabled",0===this.markedRecordsForMassAction.length),this.elements.$chooseMassAction.prop("disabled",this.markedRecordsForMassAction.length>0)}),this.viewChanges=(e=>{e.preventDefault();const t=$(e.currentTarget).closest("tr");this.sendRemoteRequest(this.generateRemotePayload("getRowDetails",{stage:t.data("stage"),t3ver_oid:t.data("t3ver_oid"),table:t.data("table"),uid:t.data("uid")})).done(e=>{const a=e[0].result.data[0],s=$("<div />"),n=$("<ul />",{class:"nav nav-tabs",role:"tablist"}),i=$("<div />",{class:"tab-content"}),o=[];s.append($("<p />").html(TYPO3.lang.path.replace("{0}",a.path_Live)),$("<p />").html(TYPO3.lang.current_step.replace("{0}",a.label_Stage).replace("{1}",a.stage_position).replace("{2}",a.stage_count))),a.diff.length>0&&(n.append($("<li />",{role:"presentation"}).append($("<a />",{href:"#workspace-changes","aria-controls":"workspace-changes",role:"tab","data-toggle":"tab"}).text(TYPO3.lang["window.recordChanges.tabs.changeSummary"]))),i.append($("<div />",{role:"tabpanel",class:"tab-pane",id:"workspace-changes"}).append($("<div />",{class:"form-section"}).append(Backend.generateDiffView(a.diff))))),a.comments.length>0&&(n.append($("<li />",{role:"presentation"}).append($("<a />",{href:"#workspace-comments","aria-controls":"workspace-comments",role:"tab","data-toggle":"tab"}).html(TYPO3.lang["window.recordChanges.tabs.comments"]+"&nbsp;").append($("<span />",{class:"badge"}).text(a.comments.length)))),i.append($("<div />",{role:"tabpanel",class:"tab-pane",id:"workspace-comments"}).append($("<div />",{class:"form-section"}).append(Backend.generateCommentView(a.comments))))),a.history.total>0&&(n.append($("<li />",{role:"presentation"}).append($("<a />",{href:"#workspace-history","aria-controls":"workspace-history",role:"tab","data-toggle":"tab"}).text(TYPO3.lang["window.recordChanges.tabs.history"]))),i.append($("<div />",{role:"tabpanel",class:"tab-pane",id:"workspace-history"}).append($("<div />",{class:"form-section"}).append(Backend.generateHistoryView(a.history.data))))),n.find("li").first().addClass("active"),i.find(".tab-pane").first().addClass("active"),s.append($("<div />").append(n,i)),t.data("stage")!==t.data("prevStage")&&o.push({text:a.label_PrevStage.title,active:!0,btnClass:"btn-default",name:"prevstage",trigger:()=>{Modal.currentModal.trigger("modal-dismiss"),this.sendToStage(t,"prev")}}),o.push({text:a.label_NextStage.title,active:!0,btnClass:"btn-default",name:"nextstage",trigger:()=>{Modal.currentModal.trigger("modal-dismiss"),this.sendToStage(t,"next")}}),o.push({text:TYPO3.lang.close,active:!0,btnClass:"btn-info",name:"cancel",trigger:()=>{Modal.currentModal.trigger("modal-dismiss")}}),Modal.advanced({type:Modal.types.default,title:TYPO3.lang["window.recordInformation"].replace("{0}",$.trim(t.find(".t3js-title-live").text())),content:s,severity:Severity_1.SeverityEnum.info,buttons:o,size:Modal.sizes.medium})})}),this.openPreview=(e=>{const $tr=$(e.currentTarget).closest("tr");this.sendRemoteRequest(this.generateRemoteActionsPayload("viewSingleRecord",[$tr.data("table"),$tr.data("uid")])).done(response=>{eval(response[0].result)})}),this.confirmDeleteRecordFromWorkspace=(e=>{const t=$(e.target).closest("tr"),a=Modal.confirm(TYPO3.lang["window.discard.title"],TYPO3.lang["window.discard.message"],Severity_1.SeverityEnum.warning,[{text:TYPO3.lang.cancel,active:!0,btnClass:"btn-default",name:"cancel",trigger:()=>{a.modal("hide")}},{text:TYPO3.lang.ok,btnClass:"btn-warning",name:"ok"}]);a.on("button.clicked",e=>{"ok"===e.target.name&&this.sendRemoteRequest([this.generateRemoteActionsPayload("deleteSingleRecord",[t.data("table"),t.data("uid")])]).done(()=>{a.modal("hide"),this.getWorkspaceInfos(),Backend.refreshPageTree()})})}),this.runSelectionAction=(()=>{const e=this.elements.$chooseSelectionAction.val(),t="discard"!==e;if(0===e.length)return;const a=[];for(let e=0;e<this.markedRecordsForMassAction.length;++e){const t=this.markedRecordsForMassAction[e].split(":");a.push({table:t[0],liveId:t[2],versionId:t[1]})}t?this.checkIntegrity({selection:a,type:"selection"}).done(t=>{Wizard.setForceSelection(!1),"warning"===t[0].result.result&&this.addIntegrityCheckWarningToWizard(),this.renderSelectionActionWizard(e,a)}):(Wizard.setForceSelection(!1),this.renderSelectionActionWizard(e,a))}),this.addIntegrityCheckWarningToWizard=(()=>{Wizard.addSlide("integrity-warning","Warning",TYPO3.lang["integrity.hasIssuesDescription"]+"<br>"+TYPO3.lang["integrity.hasIssuesQuestion"],Severity_1.SeverityEnum.warning)}),this.runMassAction=(()=>{const e=this.elements.$chooseMassAction.val(),t="discard"!==e;0!==e.length&&(t?this.checkIntegrity({language:this.settings.language,type:e}).done(t=>{Wizard.setForceSelection(!1),"warning"===t[0].result.result&&this.addIntegrityCheckWarningToWizard(),this.renderMassActionWizard(e)}):(Wizard.setForceSelection(!1),this.renderMassActionWizard(e)))}),this.sendToSpecificStageAction=(e=>{const t=[],a=$(e.currentTarget).val();for(let e=0;e<this.markedRecordsForMassAction.length;++e){const a=this.markedRecordsForMassAction[e].split(":");t.push({table:a[0],uid:a[1],t3ver_oid:a[2]})}this.sendRemoteRequest(this.generateRemoteActionsPayload("sendToSpecificStageWindow",[a,t])).done(e=>{const s=this.renderSendToStageWindow(e);s.on("button.clicked",e=>{if("ok"===e.target.name){const n=Utility.convertFormToObject(e.currentTarget.querySelector("form"));n.affects={elements:t,nextStage:a},this.sendRemoteRequest([this.generateRemoteActionsPayload("sendToSpecificStageExecute",[n]),this.generateRemotePayload("getWorkspaceInfos",this.settings)]).done(e=>{s.modal("hide"),this.renderWorkspaceInfos(e[1].result),Backend.refreshPageTree()})}}).on("modal-destroyed",()=>{this.elements.$chooseStageAction.val("")})})}),this.generatePreviewLinks=(()=>{this.sendRemoteRequest(this.generateRemoteActionsPayload("generateWorkspacePreviewLinksForAllLanguages",[this.settings.id])).done(e=>{const t=e[0].result,a=$("<dl />");$.each(t,(e,t)=>{a.append($("<dt />").text(e),$("<dd />").append($("<a />",{href:t,target:"_blank"}).text(t)))}),Modal.show(TYPO3.lang.previewLink,a,Severity_1.SeverityEnum.info,[{text:TYPO3.lang.ok,active:!0,btnClass:"btn-info",name:"ok",trigger:()=>{Modal.currentModal.trigger("modal-dismiss")}}],["modal-inner-scroll"])})}),$(()=>{let e;this.getElements(),this.registerEvents(),Persistent.isset("this.Module.depth")?(e=Persistent.get("this.Module.depth"),this.elements.$depthSelector.val(e),this.settings.depth=e):this.settings.depth=TYPO3.settings.Workspaces.depth,this.loadWorkspaceComponents()})}static refreshPageTree(){Viewport.NavigationContainer&&Viewport.NavigationContainer.PageTree&&Viewport.NavigationContainer.PageTree.refreshTree()}static generateDiffView(e){const t=$("<div />",{class:"diff"});for(let a=0;a<e.length;++a)t.append($("<div />",{class:"diff-item"}).append($("<div />",{class:"diff-item-title"}).text(e[a].label),$("<div />",{class:"diff-item-result diff-item-result-inline"}).html(e[a].content)));return t}static generateCommentView(e){const t=$("<div />");for(let a=0;a<e.length;++a){const s=$("<div />",{class:"panel panel-default"});e[a].user_comment.length>0&&s.append($("<div />",{class:"panel-body"}).html(e[a].user_comment)),s.append($("<div />",{class:"panel-footer"}).append($("<span />",{class:"label label-success"}).text(e[a].stage_title),$("<span />",{class:"label label-info"}).text(e[a].tstamp))),t.append($("<div />",{class:"media"}).append($("<div />",{class:"media-left text-center"}).text(e[a].user_username).prepend($("<div />").html(e[a].user_avatar)),$("<div />",{class:"media-body"}).append(s)))}return t}static generateHistoryView(e){const t=$("<div />");for(let a=0;a<e.length;++a){const s=$("<div />",{class:"panel panel-default"});let n;if("object"==typeof e[a].differences){if(0===e[a].differences.length)continue;n=$("<div />",{class:"diff"});for(let t=0;t<e[a].differences.length;++t)n.append($("<div />",{class:"diff-item"}).append($("<div />",{class:"diff-item-title"}).text(e[a].differences[t].label),$("<div />",{class:"diff-item-result diff-item-result-inline"}).html(e[a].differences[t].html)));s.append($("<div />").append(n))}else s.append($("<div />",{class:"panel-body"}).text(e[a].differences));s.append($("<div />",{class:"panel-footer"}).append($("<span />",{class:"label label-info"}).text(e[a].datetime))),t.append($("<div />",{class:"media"}).append($("<div />",{class:"media-left text-center"}).text(e[a].user).prepend($("<div />").html(e[a].user_avatar)),$("<div />",{class:"media-body"}).append(s)))}return t}getElements(){this.elements.$searchForm=$(Identifiers.searchForm),this.elements.$searchTextField=$(Identifiers.searchTextField),this.elements.$searchSubmitBtn=$(Identifiers.searchSubmitBtn),this.elements.$depthSelector=$(Identifiers.depthSelector),this.elements.$languageSelector=$(Identifiers.languageSelector),this.elements.$container=$(Identifiers.container),this.elements.$tableBody=this.elements.$container.find("tbody"),this.elements.$actionIcons=$(Identifiers.actionIcons),this.elements.$toggleAll=$(Identifiers.toggleAll),this.elements.$chooseStageAction=$(Identifiers.chooseStageAction),this.elements.$chooseSelectionAction=$(Identifiers.chooseSelectionAction),this.elements.$chooseMassAction=$(Identifiers.chooseMassAction),this.elements.$previewLinksButton=$(Identifiers.previewLinksButton),this.elements.$pagination=$(Identifiers.pagination)}registerEvents(){$(document).on("click",'[data-action="swap"]',e=>{const t=e.target.closest("tr");this.checkIntegrity({selection:[{liveId:t.dataset.uid,versionId:t.dataset.t3ver_oid,table:t.dataset.table}],type:"selection"}).done(e=>{"warning"===e[0].result.result&&this.addIntegrityCheckWarningToWizard(),Wizard.setForceSelection(!1),Wizard.addSlide("swap-confirm","Swap",TYPO3.lang["window.swap.message"],Severity_1.SeverityEnum.info),Wizard.addFinalProcessingSlide(()=>{this.sendRemoteRequest(this.generateRemoteActionsPayload("swapSingleRecord",[t.dataset.table,t.dataset.t3ver_oid,t.dataset.uid])).done(()=>{Wizard.dismiss(),this.getWorkspaceInfos(),Backend.refreshPageTree()})}).done(()=>{Wizard.show()})})}).on("click",'[data-action="prevstage"]',e=>{this.sendToStage($(e.currentTarget).closest("tr"),"prev")}).on("click",'[data-action="nextstage"]',e=>{this.sendToStage($(e.currentTarget).closest("tr"),"next")}).on("click",'[data-action="changes"]',this.viewChanges).on("click",'[data-action="preview"]',this.openPreview).on("click",'[data-action="open"]',e=>{const t=e.currentTarget.closest("tr");let a=TYPO3.settings.FormEngine.moduleUrl+"&returnUrl="+encodeURIComponent(document.location.href)+"&id="+TYPO3.settings.Workspaces.id+"&edit["+t.dataset.table+"]["+t.dataset.uid+"]=edit";TYPO3.settings.Workspaces.allView&&(a+="&workspace="+t.dataset.t3ver_wsid),window.location.href=a}).on("click",'[data-action="version"]',e=>{const t=e.currentTarget.closest("tr"),a="pages"===t.dataset.table?t.dataset.t3ver_oid:t.dataset.pid;window.location.href=top.TYPO3.configuration.pageModuleUrl+"&id="+a+"&returnUrl="+encodeURIComponent(window.location.href)}).on("click",'[data-action="remove"]',this.confirmDeleteRecordFromWorkspace).on("click",'[data-action="expand"]',e=>{const t=$(e.currentTarget);let a;a="true"===this.elements.$tableBody.find(t.data("target")).first().attr("aria-expanded")?"apps-pagetree-expand":"apps-pagetree-collapse",t.empty().append(this.getPreRenderedIcon(a))}),$(window.top.document).on("click",".t3js-workspace-recipients-selectall",e=>{e.preventDefault(),$(".t3js-workspace-recipient",window.top.document).not(":disabled").prop("checked",!0)}).on("click",".t3js-workspace-recipients-deselectall",e=>{e.preventDefault(),$(".t3js-workspace-recipient",window.top.document).not(":disabled").prop("checked",!1)}),this.elements.$searchForm.on("submit",e=>{e.preventDefault(),this.settings.filterTxt=this.elements.$searchTextField.val(),this.getWorkspaceInfos()}),this.elements.$searchTextField.on("keyup",e=>{""!==e.target.value?this.elements.$searchSubmitBtn.removeClass("disabled"):(this.elements.$searchSubmitBtn.addClass("disabled"),this.getWorkspaceInfos())}),this.elements.$searchTextField.get(0).clearable({onClear:()=>{this.elements.$searchSubmitBtn.addClass("disabled"),this.settings.filterTxt="",this.getWorkspaceInfos()}}),this.elements.$toggleAll.on("click",()=>{this.allToggled=!this.allToggled,this.elements.$tableBody.find('input[type="checkbox"]').prop("checked",this.allToggled).trigger("change")}),this.elements.$tableBody.on("change","tr input[type=checkbox]",this.handleCheckboxChange),this.elements.$depthSelector.on("change",e=>{const t=e.target.value;Persistent.set("this.Module.depth",t),this.settings.depth=t,this.getWorkspaceInfos()}),this.elements.$previewLinksButton.on("click",this.generatePreviewLinks),this.elements.$languageSelector.on("change",e=>{const t=$(e.target);this.settings.language=t.val(),this.sendRemoteRequest([this.generateRemoteActionsPayload("saveLanguageSelection",[t.val()]),this.generateRemotePayload("getWorkspaceInfos",this.settings)]).done(e=>{this.elements.$languageSelector.prev().html(t.find(":selected").data("icon")),this.renderWorkspaceInfos(e[1].result)})}),this.elements.$chooseStageAction.on("change",this.sendToSpecificStageAction),this.elements.$chooseSelectionAction.on("change",this.runSelectionAction),this.elements.$chooseMassAction.on("change",this.runMassAction),this.elements.$pagination.on("click","a[data-action]",e=>{e.preventDefault();const t=$(e.currentTarget);let a=!1;switch(t.data("action")){case"previous":this.paging.currentPage>1&&(this.paging.currentPage--,a=!0);break;case"next":this.paging.currentPage<this.paging.totalPages&&(this.paging.currentPage++,a=!0);break;case"page":this.paging.currentPage=parseInt(t.data("page"),10),a=!0;break;default:throw'Unknown action "'+t.data("action")+'"'}a&&(this.settings.start=parseInt(this.settings.limit.toString(),10)*(this.paging.currentPage-1),this.getWorkspaceInfos())})}sendToStage(e,t){let a,s,n;if("next"===t)a=e.data("nextStage"),s="sendToNextStageWindow",n="sendToNextStageExecute";else{if("prev"!==t)throw"Invalid direction given.";a=e.data("prevStage"),s="sendToPrevStageWindow",n="sendToPrevStageExecute"}this.sendRemoteRequest(this.generateRemoteActionsPayload(s,[e.data("uid"),e.data("table"),e.data("t3ver_oid")])).done(t=>{const s=this.renderSendToStageWindow(t);s.on("button.clicked",t=>{if("ok"===t.target.name){const i=Utility.convertFormToObject(t.currentTarget.querySelector("form"));i.affects={table:e.data("table"),nextStage:a,t3ver_oid:e.data("t3ver_oid"),uid:e.data("uid"),elements:[]},this.sendRemoteRequest([this.generateRemoteActionsPayload(n,[i]),this.generateRemotePayload("getWorkspaceInfos",this.settings)]).done(e=>{s.modal("hide"),this.renderWorkspaceInfos(e[1].result),Backend.refreshPageTree()})}})})}loadWorkspaceComponents(){this.sendRemoteRequest([this.generateRemotePayload("getWorkspaceInfos",this.settings),this.generateRemotePayload("getStageActions",{}),this.generateRemoteMassActionsPayload("getMassStageActions",{}),this.generateRemotePayload("getSystemLanguages",{pageUid:this.elements.$container.data("pageUid")})]).done(e=>{this.elements.$depthSelector.prop("disabled",!1),this.renderWorkspaceInfos(e[0].result);const t=e[1].result.data;let a;for(a=0;a<t.length;++a)this.elements.$chooseStageAction.append($("<option />").val(t[a].uid).text(t[a].title));const s=e[2].result.data;for(a=0;a<s.length;++a)this.elements.$chooseSelectionAction.append($("<option />").val(s[a].action).text(s[a].title)),this.elements.$chooseMassAction.append($("<option />").val(s[a].action).text(s[a].title));const n=e[3].result.data;for(a=0;a<n.length;++a){const e=$("<option />").val(n[a].uid).text(n[a].title).data("icon",n[a].icon);String(n[a].uid)===String(TYPO3.settings.Workspaces.language)&&(e.prop("selected",!0),this.elements.$languageSelector.prev().html(n[a].icon)),this.elements.$languageSelector.append(e)}this.elements.$languageSelector.prop("disabled",!1)})}getWorkspaceInfos(){this.sendRemoteRequest(this.generateRemotePayload("getWorkspaceInfos",this.settings)).done(e=>{this.renderWorkspaceInfos(e[0].result)})}renderWorkspaceInfos(e){this.elements.$tableBody.children().remove(),this.allToggled=!1,this.elements.$chooseStageAction.prop("disabled",!0),this.elements.$chooseSelectionAction.prop("disabled",!0),this.elements.$chooseMassAction.prop("disabled",0===e.data.length),this.buildPagination(e.total);for(let t=0;t<e.data.length;++t){const a=e.data[t],s=$("<div />",{class:"btn-group"});let n;s.append(this.getAction(a.Workspaces_CollectionChildren>0&&""!==a.Workspaces_CollectionCurrent,"expand","apps-pagetree-collapse").attr("title",TYPO3.lang["tooltip.expand"]).attr("data-target",'[data-collection="'+a.Workspaces_CollectionCurrent+'"]').attr("data-toggle","collapse"),$("<button />",{class:"btn btn-default","data-action":"changes","data-toggle":"tooltip",title:TYPO3.lang["tooltip.showChanges"]}).append(this.getPreRenderedIcon("actions-document-info")),this.getAction(a.allowedAction_swap&&""===a.Workspaces_CollectionParent,"swap","actions-version-swap-version").attr("title",TYPO3.lang["tooltip.swap"]),this.getAction(a.allowedAction_view,"preview","actions-version-workspace-preview").attr("title",TYPO3.lang["tooltip.viewElementAction"]),this.getAction(a.allowedAction_edit,"open","actions-open").attr("title",TYPO3.lang["tooltip.editElementAction"]),this.getAction(!0,"version","actions-version-page-open").attr("title",TYPO3.lang["tooltip.openPage"]),this.getAction(a.allowedAction_delete,"remove","actions-version-document-remove").attr("title",TYPO3.lang["tooltip.discardVersion"])),""!==a.integrity.messages&&(n=$(TYPO3.settings.Workspaces.icons[a.integrity.status])).attr("data-toggle","tooltip").attr("data-placement","top").attr("data-html","true").attr("title",a.integrity.messages),this.latestPath!==a.path_Workspace&&(this.latestPath=a.path_Workspace,this.elements.$tableBody.append($("<tr />").append($("<th />"),$("<th />",{colspan:6}).text(this.latestPath))));const i=$("<label />",{class:"btn btn-default btn-checkbox"}).append($("<input />",{type:"checkbox"}),$("<span />",{class:"t3-icon fa"})),o={"data-uid":a.uid,"data-pid":a.livepid,"data-t3ver_oid":a.t3ver_oid,"data-t3ver_wsid":a.t3ver_wsid,"data-table":a.table,"data-next-stage":a.value_nextStage,"data-prev-stage":a.value_prevStage,"data-stage":a.stage};""!==a.Workspaces_CollectionParent&&(o["data-collection"]=a.Workspaces_CollectionParent,o.class="collapse"),this.elements.$tableBody.append($("<tr />",o).append($("<td />").empty().append(i),$("<td />",{class:"t3js-title-workspace",style:a.Workspaces_CollectionLevel>0?"padding-left: "+this.indentationPadding*a.Workspaces_CollectionLevel+"px":""}).html(a.icon_Workspace+'&nbsp;<a href="#" data-action="changes"><span class="item-state-'+a.state_Workspace+'">'+a.label_Workspace+"</span></a>"),$("<td />",{class:"t3js-title-live"}).html(a.icon_Live+"&nbsp;"+a.label_Live),$("<td />").text(a.label_Stage),$("<td />").empty().append(n),$("<td />").html(a.language.icon),$("<td />",{class:"text-right nowrap"}).append(s))),Tooltip.initialize('[data-toggle="tooltip"]',{delay:{show:500,hide:100},trigger:"hover",container:"body"})}}buildPagination(e){if(0===e)return void this.elements.$pagination.contents().remove();if(this.paging.totalItems=e,this.paging.totalPages=Math.ceil(e/parseInt(this.settings.limit.toString(),10)),1===this.paging.totalPages)return void this.elements.$pagination.contents().remove();const t=$("<ul />",{class:"pagination pagination-block"}),a=[],s=$("<li />").append($("<a />",{"data-action":"previous"}).append($("<span />",{class:"t3-icon fa fa-arrow-left"}))),n=$("<li />").append($("<a />",{"data-action":"next"}).append($("<span />",{class:"t3-icon fa fa-arrow-right"})));1===this.paging.currentPage&&s.disablePagingAction(),this.paging.currentPage===this.paging.totalPages&&n.disablePagingAction();for(let e=1;e<=this.paging.totalPages;e++){const t=$("<li />",{class:this.paging.currentPage===e?"active":""});t.append($("<a />",{"data-action":"page","data-page":e}).append($("<span />").text(e))),a.push(t)}t.append(s,a,n),this.elements.$pagination.empty().append(t)}renderSelectionActionWizard(e,t){Wizard.addSlide("mass-action-confirmation",TYPO3.lang["window.selectionAction.title"],"<p>"+(new SecurityUtility).encodeHtml(TYPO3.lang["tooltip."+e+"Selected"])+"</p>",Severity_1.SeverityEnum.warning),Wizard.addFinalProcessingSlide(()=>{this.sendRemoteRequest(this.generateRemoteActionsPayload("executeSelectionAction",{action:e,selection:t})).done(()=>{this.getWorkspaceInfos(),Wizard.dismiss(),Backend.refreshPageTree()})}).done(()=>{Wizard.show(),Wizard.getComponent().on("wizard-dismissed",()=>{this.elements.$chooseSelectionAction.val("")})})}renderMassActionWizard(e){let t,a=!1;switch(e){case"publish":t="publishWorkspace";break;case"swap":t="publishWorkspace",a=!0;break;case"discard":t="flushWorkspace";break;default:throw"Invalid mass action "+e+" called."}const s=new SecurityUtility;Wizard.setForceSelection(!1),Wizard.addSlide("mass-action-confirmation",TYPO3.lang["window.massAction.title"],"<p>"+s.encodeHtml(TYPO3.lang["tooltip."+e+"All"])+"<br><br>"+s.encodeHtml(TYPO3.lang["tooltip.affectWholeWorkspace"])+"</p>",Severity_1.SeverityEnum.warning);const n=e=>{const a=e[0].result;a.processed<a.total?this.sendRemoteRequest(this.generateRemoteMassActionsPayload(t,a)).done(n):(this.getWorkspaceInfos(),Wizard.dismiss())};Wizard.addFinalProcessingSlide(()=>{this.sendRemoteRequest(this.generateRemoteMassActionsPayload(t,{init:!0,total:0,processed:0,language:this.settings.language,swap:a})).done(n)}).done(()=>{Wizard.show(),Wizard.getComponent().on("wizard-dismissed",()=>{this.elements.$chooseMassAction.val("")})})}getAction(e,t,a){return e?$("<button />",{class:"btn btn-default","data-action":t,"data-toggle":"tooltip"}).append(this.getPreRenderedIcon(a)):$("<span />",{class:"btn btn-default disabled"}).append(this.getPreRenderedIcon("empty-empty"))}getPreRenderedIcon(e){return this.elements.$actionIcons.find('[data-identifier="'+e+'"]').clone()}}return new Backend});
\ No newline at end of file