[TASK] Install Tool: Move common code into abstract class 97/60897/9
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Fri, 7 Jun 2019 11:51:49 +0000 (13:51 +0200)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Tue, 18 Jun 2019 18:42:18 +0000 (20:42 +0200)
All modules of the Install Tool used in modal windows now share a common
abstract class that contains some boilerplate code required for most
modules.

Resolves: #88518
Releases: master
Change-Id: I0c2f03f098c731e5a0c499ce91400c22a8c1f890
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/60897
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Jonas Eberle <flightvision@googlemail.com>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Simon Gilli <typo3@gilbertsoft.org>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
54 files changed:
Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/AbstractInteractableModule.ts [new file with mode: 0644]
Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/ChangeInstallToolPassword.ts
Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/ClearTables.ts
Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/ClearTypo3tempFiles.ts
Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/CoreUpdate.ts
Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/CreateAdmin.ts
Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/DatabaseAnalyzer.ts
Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/EnvironmentCheck.ts
Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/ExtensionCompatTester.ts
Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/ExtensionConfiguration.ts
Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/ExtensionScanner.ts
Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Features.ts
Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/FolderStructure.ts
Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/ImageProcessing.ts
Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/InteractableModuleInterface.ts [deleted file]
Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/LanguagePacks.ts
Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/LocalConfiguration.ts
Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/MailTest.ts
Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/PhpInfo.ts
Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Presets.ts
Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/SystemInformation.ts
Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/SystemMaintainer.ts
Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/TcaExtTablesCheck.ts
Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/TcaMigrationsCheck.ts
Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/UpgradeDocs.ts
Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/UpgradeWizards.ts
Build/Sources/TypeScript/install/Resources/Public/TypeScript/Router.ts
typo3/sysext/install/Resources/Private/Templates/Settings/FeaturesGetContent.html
typo3/sysext/install/Resources/Private/Templates/Settings/PresetsGetContent.html
typo3/sysext/install/Resources/Public/JavaScript/Module/AbstractInteractableModule.js [new file with mode: 0644]
typo3/sysext/install/Resources/Public/JavaScript/Module/ChangeInstallToolPassword.js
typo3/sysext/install/Resources/Public/JavaScript/Module/ClearTables.js
typo3/sysext/install/Resources/Public/JavaScript/Module/ClearTypo3tempFiles.js
typo3/sysext/install/Resources/Public/JavaScript/Module/CoreUpdate.js
typo3/sysext/install/Resources/Public/JavaScript/Module/CreateAdmin.js
typo3/sysext/install/Resources/Public/JavaScript/Module/DatabaseAnalyzer.js
typo3/sysext/install/Resources/Public/JavaScript/Module/EnvironmentCheck.js
typo3/sysext/install/Resources/Public/JavaScript/Module/ExtensionCompatTester.js
typo3/sysext/install/Resources/Public/JavaScript/Module/ExtensionConfiguration.js
typo3/sysext/install/Resources/Public/JavaScript/Module/ExtensionScanner.js
typo3/sysext/install/Resources/Public/JavaScript/Module/Features.js
typo3/sysext/install/Resources/Public/JavaScript/Module/FolderStructure.js
typo3/sysext/install/Resources/Public/JavaScript/Module/ImageProcessing.js
typo3/sysext/install/Resources/Public/JavaScript/Module/LanguagePacks.js
typo3/sysext/install/Resources/Public/JavaScript/Module/LocalConfiguration.js
typo3/sysext/install/Resources/Public/JavaScript/Module/MailTest.js
typo3/sysext/install/Resources/Public/JavaScript/Module/PhpInfo.js
typo3/sysext/install/Resources/Public/JavaScript/Module/Presets.js
typo3/sysext/install/Resources/Public/JavaScript/Module/SystemInformation.js
typo3/sysext/install/Resources/Public/JavaScript/Module/SystemMaintainer.js
typo3/sysext/install/Resources/Public/JavaScript/Module/TcaExtTablesCheck.js
typo3/sysext/install/Resources/Public/JavaScript/Module/TcaMigrationsCheck.js
typo3/sysext/install/Resources/Public/JavaScript/Module/UpgradeDocs.js
typo3/sysext/install/Resources/Public/JavaScript/Module/UpgradeWizards.js

diff --git a/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/AbstractInteractableModule.ts b/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/AbstractInteractableModule.ts
new file mode 100644 (file)
index 0000000..d1a6076
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+export abstract class AbstractInteractableModule {
+  private readonly selectorModalBody: string = '.t3js-modal-body';
+  private readonly selectorModalContent: string = '.t3js-module-content';
+  protected currentModal: JQuery;
+
+  abstract initialize(currentModal: JQuery): void;
+
+  protected getModalBody(): JQuery {
+    return this.findInModal(this.selectorModalBody);
+  }
+
+  protected getModuleContent(): JQuery {
+    return this.findInModal(this.selectorModalContent);
+  }
+
+  protected findInModal(selector: string): JQuery {
+    return this.currentModal.find(selector);
+  }
+}
index f873ca6..45b8cd0 100644 (file)
@@ -11,7 +11,7 @@
  * The TYPO3 project - inspiring people to share!
  */
 
-import {InteractableModuleInterface} from './InteractableModuleInterface';
+import {AbstractInteractableModule} from './AbstractInteractableModule';
 import * as $ from 'jquery';
 import Router = require('../Router');
 import PasswordStrength = require('./PasswordStrength');
@@ -20,11 +20,8 @@ import Notification = require('TYPO3/CMS/Backend/Notification');
 /**
  * Module: TYPO3/CMS/Install/Module/ChangeInstallToolPassword
  */
-class ChangeInstallToolPassword implements InteractableModuleInterface {
-  private selectorModalBody: string = '.t3js-modal-body';
-  private selectorModuleContent: string = '.t3js-module-content';
+class ChangeInstallToolPassword extends AbstractInteractableModule {
   private selectorChangeForm: string = '#t3js-changeInstallToolPassword-form';
-  private currentModal: any = {};
 
   public initialize(currentModal: JQuery): void {
     this.currentModal = currentModal;
@@ -40,7 +37,7 @@ class ChangeInstallToolPassword implements InteractableModuleInterface {
   }
 
   private getData(): void {
-    const modalContent = this.currentModal.find(this.selectorModalBody);
+    const modalContent = this.getModalBody();
     $.ajax({
       url: Router.getUrl('changeInstallToolPasswordGetData'),
       cache: false,
@@ -58,8 +55,8 @@ class ChangeInstallToolPassword implements InteractableModuleInterface {
   }
 
   private change(): void {
-    const modalContent = this.currentModal.find(this.selectorModalBody);
-    const executeToken = this.currentModal.find(this.selectorModuleContent).data('install-tool-token');
+    const modalContent = this.getModalBody();
+    const executeToken = this.getModuleContent().data('install-tool-token');
     $.ajax({
       url: Router.getUrl(),
       method: 'POST',
@@ -67,8 +64,8 @@ class ChangeInstallToolPassword implements InteractableModuleInterface {
         'install': {
           'action': 'changeInstallToolPassword',
           'token': executeToken,
-          'password': this.currentModal.find('.t3js-changeInstallToolPassword-password').val(),
-          'passwordCheck': this.currentModal.find('.t3js-changeInstallToolPassword-password-check').val(),
+          'password': this.findInModal('.t3js-changeInstallToolPassword-password').val(),
+          'passwordCheck': this.findInModal('.t3js-changeInstallToolPassword-password-check').val(),
         },
       },
       cache: false,
@@ -85,7 +82,7 @@ class ChangeInstallToolPassword implements InteractableModuleInterface {
         Router.handleAjaxError(xhr, modalContent);
       },
       complete: (): void => {
-        this.currentModal.find('.t3js-changeInstallToolPassword-password,.t3js-changeInstallToolPassword-password-check').val('');
+        this.findInModal('.t3js-changeInstallToolPassword-password,.t3js-changeInstallToolPassword-password-check').val('');
       },
     });
   }
index 8575e0b..8b499f8 100644 (file)
@@ -11,7 +11,7 @@
  * The TYPO3 project - inspiring people to share!
  */
 
-import {InteractableModuleInterface} from './InteractableModuleInterface';
+import {AbstractInteractableModule} from './AbstractInteractableModule';
 import * as $ from 'jquery';
 import Router = require('../Router');
 import Notification = require('TYPO3/CMS/Backend/Notification');
@@ -19,9 +19,7 @@ import Notification = require('TYPO3/CMS/Backend/Notification');
 /**
  * Module: TYPO3/CMS/Install/Module/ClearTables
  */
-class ClearTables implements InteractableModuleInterface {
-  private selectorModalBody: string = '.t3js-modal-body';
-  private selectorModuleContent: string = '.t3js-module-content';
+class ClearTables extends AbstractInteractableModule {
   private selectorClearTrigger: string = '.t3js-clearTables-clear';
   private selectorStatsTrigger: string = '.t3js-clearTables-stats';
   private selectorOutputContainer: string = '.t3js-clearTables-output';
@@ -30,7 +28,6 @@ class ClearTables implements InteractableModuleInterface {
   private selectorStatDescription: string = '.t3js-clearTables-stat-description';
   private selectorStatRows: string = '.t3js-clearTables-stat-rows';
   private selectorStatName: string = '.t3js-clearTables-stat-name';
-  private currentModal: any = {};
 
   public initialize(currentModal: any): void {
     this.currentModal = currentModal;
@@ -50,7 +47,7 @@ class ClearTables implements InteractableModuleInterface {
   }
 
   private getStats(): void {
-    const modalContent: JQuery = this.currentModal.find(this.selectorModalBody);
+    const modalContent: JQuery = this.getModalBody();
     $.ajax({
       url: Router.getUrl('clearTablesStats'),
       cache: false,
@@ -80,8 +77,8 @@ class ClearTables implements InteractableModuleInterface {
   }
 
   private clear(table: string): void {
-    const modalContent = this.currentModal.find(this.selectorModalBody);
-    const executeToken = this.currentModal.find(this.selectorModuleContent).data('clear-tables-clear-token');
+    const modalContent = this.getModalBody();
+    const executeToken = this.getModuleContent().data('clear-tables-clear-token');
     $.ajax({
       url: Router.getUrl(),
       method: 'POST',
index 0c95aae..7cd52e0 100644 (file)
@@ -11,7 +11,7 @@
  * The TYPO3 project - inspiring people to share!
  */
 
-import {InteractableModuleInterface} from './InteractableModuleInterface';
+import {AbstractInteractableModule} from './AbstractInteractableModule';
 import * as $ from 'jquery';
 import Router = require('../Router');
 import Notification = require('TYPO3/CMS/Backend/Notification');
@@ -19,9 +19,7 @@ import Notification = require('TYPO3/CMS/Backend/Notification');
 /**
  * Module: TYPO3/CMS/Install/Module/ClearTypo3tempFiles
  */
-class ClearTypo3tempFiles implements InteractableModuleInterface {
-  private selectorModalBody: string = '.t3js-modal-body';
-  private selectorModuleContent: string = '.t3js-module-content';
+class ClearTypo3tempFiles extends AbstractInteractableModule {
   private selectorDeleteTrigger: string = '.t3js-clearTypo3temp-delete';
   private selectorOutputContainer: string = '.t3js-clearTypo3temp-output';
   private selectorStatContainer: string = '.t3js-clearTypo3temp-stat-container';
@@ -29,7 +27,6 @@ class ClearTypo3tempFiles implements InteractableModuleInterface {
   private selectorStatTemplate: string = '.t3js-clearTypo3temp-stat-template';
   private selectorStatNumberOfFiles: string = '.t3js-clearTypo3temp-stat-numberOfFiles';
   private selectorStatDirectory: string = '.t3js-clearTypo3temp-stat-directory';
-  private currentModal: JQuery;
 
   public initialize(currentModal: JQuery): void {
     this.currentModal = currentModal;
@@ -49,7 +46,7 @@ class ClearTypo3tempFiles implements InteractableModuleInterface {
   }
 
   private getStats(): void {
-    const modalContent = this.currentModal.find(this.selectorModalBody);
+    const modalContent = this.getModalBody();
     $.ajax({
       url: Router.getUrl('clearTypo3tempFilesStats'),
       cache: false,
@@ -79,8 +76,8 @@ class ClearTypo3tempFiles implements InteractableModuleInterface {
   }
 
   private delete(folder: string, storageUid: number): void {
-    const modalContent = this.currentModal.find(this.selectorModalBody);
-    const executeToken = this.currentModal.find(this.selectorModuleContent).data('clear-typo3temp-delete-token');
+    const modalContent = this.getModalBody();
+    const executeToken = this.getModuleContent().data('clear-typo3temp-delete-token');
     $.ajax({
       method: 'POST',
       url: Router.getUrl(),
index e3e4d3f..313e249 100644 (file)
@@ -11,7 +11,7 @@
  * The TYPO3 project - inspiring people to share!
  */
 
-import {InteractableModuleInterface} from './InteractableModuleInterface';
+import {AbstractInteractableModule} from './AbstractInteractableModule';
 import * as $ from 'jquery';
 import Router = require('../Router');
 import FlashMessage = require('../Renderable/FlashMessage');
@@ -28,7 +28,7 @@ interface ActionQueue {
   [k: string]: ActionItem;
 }
 
-class CoreUpdate implements InteractableModuleInterface {
+class CoreUpdate extends AbstractInteractableModule {
   private actionQueue: ActionQueue = {
     coreUpdateIsUpdateAvailable: {
       loadingMessage: 'Checking for possible regular or security update',
@@ -67,7 +67,6 @@ class CoreUpdate implements InteractableModuleInterface {
     },
   };
 
-  private selectorModalBody: string = '.t3js-modal-body';
   private selectorOutput: string = '.t3js-coreUpdate-output';
   private selectorTemplate: string = '.t3js-coreUpdate-buttonTemplate';
 
@@ -76,8 +75,6 @@ class CoreUpdate implements InteractableModuleInterface {
    */
   private buttonTemplate: any = null;
 
-  private currentModal: JQuery = null;
-
   /**
    * Fetching the templates out of the DOM
    */
@@ -100,7 +97,7 @@ class CoreUpdate implements InteractableModuleInterface {
   }
 
   private getData(): JQueryXHR {
-    const modalContent = this.currentModal.find(this.selectorModalBody);
+    const modalContent = this.getModalBody();
     return $.ajax({
       url: Router.getUrl('coreUpdateGetData'),
       cache: false,
@@ -177,7 +174,7 @@ class CoreUpdate implements InteractableModuleInterface {
         }
       },
       error: (xhr: XMLHttpRequest): void => {
-        Router.handleAjaxError(xhr, this.currentModal.find(this.selectorModalBody));
+        Router.handleAjaxError(xhr, this.getModalBody());
       },
     });
   }
@@ -208,14 +205,14 @@ class CoreUpdate implements InteractableModuleInterface {
    */
   private addLoadingMessage(messageTitle: string): void {
     const domMessage = FlashMessage.render(Severity.loading, messageTitle);
-    this.currentModal.find(this.selectorOutput).append(domMessage);
+    this.findInModal(this.selectorOutput).append(domMessage);
   }
 
   /**
    * Remove an enabled loading message
    */
   private removeLoadingMessage(): void {
-    this.currentModal.find(this.selectorOutput).find('.alert-loading').remove();
+    this.findInModal(this.selectorOutput).find('.alert-loading').remove();
   }
 
   /**
@@ -259,7 +256,7 @@ class CoreUpdate implements InteractableModuleInterface {
     if (title) {
       domButton.text(title);
     }
-    this.currentModal.find(this.selectorOutput).append(domButton);
+    this.findInModal(this.selectorOutput).append(domButton);
   }
 
   /**
@@ -267,7 +264,7 @@ class CoreUpdate implements InteractableModuleInterface {
    */
   private addMessage(severity: number, title: string, message?: string): void {
     const domMessage = FlashMessage.render(severity, title, message);
-    this.currentModal.find(this.selectorOutput).append(domMessage);
+    this.findInModal(this.selectorOutput).append(domMessage);
   }
 }
 
index 1d4768f..24cd295 100644 (file)
@@ -11,7 +11,7 @@
  * The TYPO3 project - inspiring people to share!
  */
 
-import {InteractableModuleInterface} from './InteractableModuleInterface';
+import {AbstractInteractableModule} from './AbstractInteractableModule';
 import * as $ from 'jquery';
 import Router = require('../Router');
 import PasswordStrength = require('./PasswordStrength');
@@ -20,11 +20,8 @@ import Notification = require('TYPO3/CMS/Backend/Notification');
 /**
  * Module: TYPO3/CMS/Install/Module/CreateAdmin
  */
-class CreateAdmin implements InteractableModuleInterface {
-  private selectorModalBody: string = '.t3js-modal-body';
-  private selectorModuleContent: string = '.t3js-module-content';
+class CreateAdmin extends AbstractInteractableModule {
   private selectorCreateForm: string = '#t3js-createAdmin-form';
-  private currentModal: JQuery;
 
   public initialize(currentModal: JQuery): void {
     this.currentModal = currentModal;
@@ -41,7 +38,7 @@ class CreateAdmin implements InteractableModuleInterface {
   }
 
   private getData(): void {
-    const modalContent = this.currentModal.find(this.selectorModalBody);
+    const modalContent = this.getModalBody();
     $.ajax({
       url: Router.getUrl('createAdminGetData'),
       cache: false,
@@ -59,8 +56,8 @@ class CreateAdmin implements InteractableModuleInterface {
   }
 
   private create(): void {
-    const modalContent = this.currentModal.find(this.selectorModalBody);
-    const executeToken = this.currentModal.find(this.selectorModuleContent).data('create-admin-token');
+    const modalContent = this.getModalBody();
+    const executeToken = this.getModuleContent().data('create-admin-token');
     $.ajax({
       url: Router.getUrl(),
       method: 'POST',
@@ -68,10 +65,10 @@ class CreateAdmin implements InteractableModuleInterface {
         'install': {
           'action': 'createAdmin',
           'token': executeToken,
-          'userName': this.currentModal.find('.t3js-createAdmin-user').val(),
-          'userPassword': this.currentModal.find('.t3js-createAdmin-password').val(),
-          'userPasswordCheck': this.currentModal.find('.t3js-createAdmin-password-check').val(),
-          'userSystemMaintainer': (this.currentModal.find('.t3js-createAdmin-system-maintainer').is(':checked')) ? 1 : 0,
+          'userName': this.findInModal('.t3js-createAdmin-user').val(),
+          'userPassword': this.findInModal('.t3js-createAdmin-password').val(),
+          'userPasswordCheck': this.findInModal('.t3js-createAdmin-password-check').val(),
+          'userSystemMaintainer': (this.findInModal('.t3js-createAdmin-system-maintainer').is(':checked')) ? 1 : 0,
         },
       },
       cache: false,
@@ -92,10 +89,10 @@ class CreateAdmin implements InteractableModuleInterface {
         Router.handleAjaxError(xhr, modalContent);
       },
     });
-    this.currentModal.find('.t3js-createAdmin-user').val('');
-    this.currentModal.find('.t3js-createAdmin-password').val('');
-    this.currentModal.find('.t3js-createAdmin-password-check').val('');
-    this.currentModal.find('.t3js-createAdmin-system-maintainer').prop('checked', false);
+    this.findInModal('.t3js-createAdmin-user').val('');
+    this.findInModal('.t3js-createAdmin-password').val('');
+    this.findInModal('.t3js-createAdmin-password-check').val('');
+    this.findInModal('.t3js-createAdmin-system-maintainer').prop('checked', false);
   }
 }
 
index ec1dd6d..b1eeef1 100644 (file)
@@ -11,7 +11,7 @@
  * The TYPO3 project - inspiring people to share!
  */
 
-import {InteractableModuleInterface} from './InteractableModuleInterface';
+import {AbstractInteractableModule} from './AbstractInteractableModule';
 import * as $ from 'jquery';
 import Router = require('../Router');
 import ProgressBar = require('../Renderable/ProgressBar');
@@ -22,16 +22,13 @@ import Notification = require('TYPO3/CMS/Backend/Notification');
 /**
  * Module: TYPO3/CMS/Install/Module/DatabaseAnalyzer
  */
-class DatabaseAnalyzer implements InteractableModuleInterface {
-  private selectorModalBody: string = '.t3js-modal-body';
-  private selectorModuleContent: string = '.t3js-module-content';
+class DatabaseAnalyzer extends AbstractInteractableModule {
   private selectorAnalyzeTrigger: string = '.t3js-databaseAnalyzer-analyze';
   private selectorExecuteTrigger: string = '.t3js-databaseAnalyzer-execute';
   private selectorOutputContainer: string = '.t3js-databaseAnalyzer-output';
   private selectorSuggestionBlock: string = '.t3js-databaseAnalyzer-suggestion-block';
   private selectorSuggestionList: string = '.t3js-databaseAnalyzer-suggestion-list';
   private selectorSuggestionLineTemplate: string = '.t3js-databaseAnalyzer-suggestion-line-template';
-  private currentModal: JQuery;
 
   public initialize(currentModal: JQuery): void {
     this.currentModal = currentModal;
@@ -53,7 +50,7 @@ class DatabaseAnalyzer implements InteractableModuleInterface {
   }
 
   private getData(): void {
-    const modalContent = this.currentModal.find(this.selectorModalBody);
+    const modalContent = this.getModalBody();
     $.ajax({
       url: Router.getUrl('databaseAnalyzer'),
       cache: false,
@@ -72,7 +69,7 @@ class DatabaseAnalyzer implements InteractableModuleInterface {
   }
 
   private analyze(): void {
-    const modalContent = this.currentModal.find(this.selectorModalBody);
+    const modalContent = this.getModalBody();
     const outputContainer = modalContent.find(this.selectorOutputContainer);
     const executeTrigger = modalContent.find(this.selectorExecuteTrigger);
     const analyzeTrigger = modalContent.find(this.selectorAnalyzeTrigger);
@@ -151,8 +148,8 @@ class DatabaseAnalyzer implements InteractableModuleInterface {
   }
 
   private execute(): void {
-    const modalContent = this.currentModal.find(this.selectorModalBody);
-    const executeToken = this.currentModal.find(this.selectorModuleContent).data('database-analyzer-execute-token');
+    const modalContent = this.getModalBody();
+    const executeToken = this.getModuleContent().data('database-analyzer-execute-token');
     const outputContainer = modalContent.find(this.selectorOutputContainer);
     const selectedHashes: Array<any> = [];
 
index 37dad42..93cbe89 100644 (file)
@@ -11,7 +11,7 @@
  * The TYPO3 project - inspiring people to share!
  */
 
-import {InteractableModuleInterface} from './InteractableModuleInterface';
+import {AbstractInteractableModule} from './AbstractInteractableModule';
 import * as $ from 'jquery';
 import 'bootstrap';
 import Router = require('../Router');
@@ -23,12 +23,10 @@ import Notification = require('TYPO3/CMS/Backend/Notification');
 /**
  * Module: TYPO3/CMS/Install/EnvironmentCheck
  */
-class EnvironmentCheck implements InteractableModuleInterface {
-  private selectorModalBody: string = '.t3js-modal-body';
+class EnvironmentCheck extends AbstractInteractableModule {
   private selectorGridderBadge: string = '.t3js-environmentCheck-badge';
   private selectorExecuteTrigger: string = '.t3js-environmentCheck-execute';
   private selectorOutputContainer: string = '.t3js-environmentCheck-output';
-  private currentModal: JQuery;
 
   public initialize(currentModal: JQuery): void {
     this.currentModal = currentModal;
@@ -43,7 +41,7 @@ class EnvironmentCheck implements InteractableModuleInterface {
   }
 
   private runTests(): void {
-    const modalContent = this.currentModal.find(this.selectorModalBody);
+    const modalContent = this.getModalBody();
     const $errorBadge = $(this.selectorGridderBadge);
     $errorBadge.text('').hide();
     const message = ProgressBar.render(Severity.loading, 'Loading...', '');
index 9fbe2cd..71e3e7f 100644 (file)
@@ -11,7 +11,7 @@
  * The TYPO3 project - inspiring people to share!
  */
 
-import {InteractableModuleInterface} from './InteractableModuleInterface';
+import {AbstractInteractableModule} from './AbstractInteractableModule';
 import * as $ from 'jquery';
 import 'bootstrap';
 import Router = require('../Router');
@@ -23,13 +23,10 @@ import Notification = require('TYPO3/CMS/Backend/Notification');
 /**
  * Module: TYPO3/CMS/Install/Module/ExtensionCompatTester
  */
-class ExtensionCompatTester implements InteractableModuleInterface {
-  private selectorModalBody: string = '.t3js-modal-body';
-  private selectorModuleContent: string = '.t3js-module-content';
+class ExtensionCompatTester extends AbstractInteractableModule {
   private selectorCheckTrigger: string = '.t3js-extensionCompatTester-check';
   private selectorUninstallTrigger: string = '.t3js-extensionCompatTester-uninstall';
   private selectorOutputContainer: string = '.t3js-extensionCompatTester-output';
-  private currentModal: JQuery;
 
   public initialize(currentModal: JQuery): void {
     this.currentModal = currentModal;
@@ -46,10 +43,10 @@ class ExtensionCompatTester implements InteractableModuleInterface {
   }
 
   private getLoadedExtensionList(): void {
-    this.currentModal.find(this.selectorCheckTrigger).prop('disabled', true);
-    this.currentModal.find('.modal-loading').hide();
-    const modalContent = this.currentModal.find(this.selectorModalBody);
-    const $outputContainer = this.currentModal.find(this.selectorOutputContainer);
+    this.findInModal(this.selectorCheckTrigger).prop('disabled', true);
+    this.findInModal('.modal-loading').hide();
+    const modalContent = this.getModalBody();
+    const $outputContainer = this.findInModal(this.selectorOutputContainer);
     const message = ProgressBar.render(Severity.loading, 'Loading...', '');
     $outputContainer.append(message);
 
@@ -58,7 +55,7 @@ class ExtensionCompatTester implements InteractableModuleInterface {
       cache: false,
       success: (data: any): void => {
         modalContent.empty().append(data.html);
-        const $innerOutputContainer: JQuery = this.currentModal.find(this.selectorOutputContainer);
+        const $innerOutputContainer: JQuery = this.findInModal(this.selectorOutputContainer);
         const progressBar = ProgressBar.render(Severity.loading, 'Loading...', '');
         $innerOutputContainer.append(progressBar);
 
@@ -97,7 +94,7 @@ class ExtensionCompatTester implements InteractableModuleInterface {
               .show();
           }).always((): void => {
             $innerOutputContainer.find('.alert-loading').remove();
-            this.currentModal.find(this.selectorCheckTrigger).prop('disabled', false);
+            this.findInModal(this.selectorCheckTrigger).prop('disabled', false);
           });
         } else {
           Notification.error('Something went wrong');
@@ -110,7 +107,7 @@ class ExtensionCompatTester implements InteractableModuleInterface {
   }
 
   private loadExtLocalconf(extension: string): JQueryPromise<{}> {
-    const executeToken = this.currentModal.find(this.selectorModuleContent).data('extension-compat-tester-load-ext_localconf-token');
+    const executeToken = this.getModuleContent().data('extension-compat-tester-load-ext_localconf-token');
     const $ajax = $.ajax({
       url: Router.getUrl(),
       method: 'POST',
@@ -133,7 +130,7 @@ class ExtensionCompatTester implements InteractableModuleInterface {
   }
 
   private loadExtTables(extension: string): JQueryPromise<{}> {
-    const executeToken = this.currentModal.find(this.selectorModuleContent).data('extension-compat-tester-load-ext_tables-token');
+    const executeToken = this.getModuleContent().data('extension-compat-tester-load-ext_tables-token');
     const $ajax = $.ajax({
       url: Router.getUrl(),
       method: 'POST',
@@ -161,8 +158,8 @@ class ExtensionCompatTester implements InteractableModuleInterface {
    * @param extension string of extension(s) - may be comma separated
    */
   private uninstallExtension(extension: string): void {
-    const executeToken = this.currentModal.find(this.selectorModuleContent).data('extension-compat-tester-uninstall-extension-token');
-    const modalContent = this.currentModal.find(this.selectorModalBody);
+    const executeToken = this.getModuleContent().data('extension-compat-tester-uninstall-extension-token');
+    const modalContent = this.getModalBody();
     const $outputContainer = $(this.selectorOutputContainer);
     const message = ProgressBar.render(Severity.loading, 'Loading...', '');
     $outputContainer.append(message);
index f0c4da5..6071c94 100644 (file)
@@ -11,7 +11,7 @@
  * The TYPO3 project - inspiring people to share!
  */
 
-import {InteractableModuleInterface} from './InteractableModuleInterface';
+import {AbstractInteractableModule} from './AbstractInteractableModule';
 import * as $ from 'jquery';
 import 'bootstrap';
 import Router = require('../Router');
@@ -20,12 +20,9 @@ import Notification = require('TYPO3/CMS/Backend/Notification');
 /**
  * Module: TYPO3/CMS/Install/Module/ExtensionConfiguration
  */
-class ExtensionConfiguration implements InteractableModuleInterface {
-  private selectorModalBody: string = '.t3js-modal-body';
-  private selectorModuleContent: string = '.t3js-module-content';
+class ExtensionConfiguration extends AbstractInteractableModule {
   private selectorFormListener: string = '.t3js-extensionConfiguration-form';
   private selectorSearchInput: string = '.t3js-extensionConfiguration-search';
-  private currentModal: JQuery;
 
   public initialize(currentModal: JQuery): void {
     this.currentModal = currentModal;
@@ -73,7 +70,7 @@ class ExtensionConfiguration implements InteractableModuleInterface {
   }
 
   private getContent(): void {
-    const modalContent = this.currentModal.find(this.selectorModalBody);
+    const modalContent = this.getModalBody();
     $.ajax({
       url: Router.getUrl('extensionConfigurationGetContent'),
       cache: false,
@@ -100,8 +97,8 @@ class ExtensionConfiguration implements InteractableModuleInterface {
    * @param {JQuery} $form The form of the current extension
    */
   private write($form: JQuery): void {
-    const modalContent = this.currentModal.find(this.selectorModalBody);
-    const executeToken = this.currentModal.find(this.selectorModuleContent).data('extension-configuration-write-token');
+    const modalContent = this.getModalBody();
+    const executeToken = this.getModuleContent().data('extension-configuration-write-token');
     const extensionConfiguration: any = {};
     $.each($form.serializeArray(), (index: number, element: any): void => {
       extensionConfiguration[element.name] = element.value;
@@ -139,7 +136,7 @@ class ExtensionConfiguration implements InteractableModuleInterface {
    * configuration properties
    */
   private initializeWrap(): void {
-    this.currentModal.find('.t3js-emconf-offset').each((index: number, element: any): void => {
+    this.findInModal('.t3js-emconf-offset').each((index: number, element: any): void => {
       const $me = $(element);
       const $parent = $me.parent();
       const id = $me.attr('id');
@@ -182,7 +179,7 @@ class ExtensionConfiguration implements InteractableModuleInterface {
       });
     });
 
-    this.currentModal.find('.t3js-emconf-wrap').each((index: number, element: any): void => {
+    this.findInModal('.t3js-emconf-wrap').each((index: number, element: any): void => {
       const $me = $(element);
       const $parent = $me.parent();
       const id = $me.attr('id');
index 722ef90..602d563 100644 (file)
@@ -11,7 +11,7 @@
  * The TYPO3 project - inspiring people to share!
  */
 
-import {InteractableModuleInterface} from './InteractableModuleInterface';
+import {AbstractInteractableModule} from './AbstractInteractableModule';
 import * as $ from 'jquery';
 import 'bootstrap';
 import AjaxQueue = require('../Ajax/AjaxQueue');
@@ -45,14 +45,11 @@ interface RestFile {
   file_hash: string;
 }
 
-class ExtensionScanner implements InteractableModuleInterface {
-  private selectorModalBody: string = '.t3js-modal-body';
-  private selectorModuleContent: string = '.t3js-module-content';
+class ExtensionScanner extends AbstractInteractableModule {
   private listOfAffectedRestFileHashes: Array<any> = [];
   private selectorExtensionContainer: string = '.t3js-extensionScanner-extension';
   private selectorNumberOfFiles: string = '.t3js-extensionScanner-number-of-files';
   private selectorScanSingleTrigger: string = '.t3js-extensionScanner-scan-single';
-  private currentModal: JQuery;
 
   public initialize(currentModal: JQuery): void {
     this.currentModal = currentModal;
@@ -80,7 +77,7 @@ class ExtensionScanner implements InteractableModuleInterface {
   }
 
   private getData(): void {
-    const modalContent = this.currentModal.find(this.selectorModalBody);
+    const modalContent = this.getModalBody();
     AjaxQueue.add({
       url: Router.getUrl('extensionScannerGetData'),
       cache: false,
@@ -102,7 +99,7 @@ class ExtensionScanner implements InteractableModuleInterface {
   }
 
   private scanAll($extensions: JQuery): void {
-    this.currentModal.find(this.selectorExtensionContainer)
+    this.findInModal(this.selectorExtensionContainer)
       .removeClass('panel-danger panel-warning panel-success')
       .find('.panel-progress-bar')
       .css('width', 0)
@@ -119,14 +116,14 @@ class ExtensionScanner implements InteractableModuleInterface {
   }
 
   private setStatusMessageForScan(extension: string, doneFiles: number, numberOfFiles: number): void {
-    this.currentModal.find(this.getExtensionSelector(extension))
+    this.findInModal(this.getExtensionSelector(extension))
       .find(this.selectorNumberOfFiles)
       .text('Checked ' + doneFiles + ' of ' + numberOfFiles + ' files');
   }
 
   private setProgressForScan(extension: string, doneFiles: number, numberOfFiles: number): void {
     const percent = (doneFiles / numberOfFiles) * 100;
-    this.currentModal.find(this.getExtensionSelector(extension))
+    this.findInModal(this.getExtensionSelector(extension))
       .find('.panel-progress-bar')
       .css('width', percent + '%')
       .attr('aria-valuenow', percent)
@@ -135,17 +132,17 @@ class ExtensionScanner implements InteractableModuleInterface {
   }
 
   private setProgressForAll(): void {
-    const numberOfExtensions: number = this.currentModal.find(this.selectorExtensionContainer).length;
-    const numberOfSuccess: number = this.currentModal.find(this.selectorExtensionContainer
+    const numberOfExtensions: number = this.findInModal(this.selectorExtensionContainer).length;
+    const numberOfSuccess: number = this.findInModal(this.selectorExtensionContainer
       + '.t3js-extensionscan-finished.panel-success').length;
-    const numberOfWarning: number = this.currentModal.find(this.selectorExtensionContainer
+    const numberOfWarning: number = this.findInModal(this.selectorExtensionContainer
       + '.t3js-extensionscan-finished.panel-warning').length;
-    const numberOfError: number = this.currentModal.find(this.selectorExtensionContainer
+    const numberOfError: number = this.findInModal(this.selectorExtensionContainer
       + '.t3js-extensionscan-finished.panel-danger').length;
     const numberOfScannedExtensions: number = numberOfSuccess + numberOfWarning + numberOfError;
     const percent: number = (numberOfScannedExtensions / numberOfExtensions) * 100;
-    const modalContent: JQuery = this.currentModal.find(this.selectorModalBody);
-    this.currentModal.find('.t3js-extensionScanner-progress-all-extension .progress-bar')
+    const modalContent: JQuery = this.getModalBody();
+    this.findInModal('.t3js-extensionScanner-progress-all-extension .progress-bar')
       .css('width', percent + '%')
       .attr('aria-valuenow', percent)
       .find('span')
@@ -159,7 +156,7 @@ class ExtensionScanner implements InteractableModuleInterface {
         data: {
           'install': {
             'action': 'extensionScannerMarkFullyScannedRestFiles',
-            'token': this.currentModal.find(this.selectorModuleContent).data('extension-scanner-mark-fully-scanned-rest-files-token'),
+            'token': this.getModuleContent().data('extension-scanner-mark-fully-scanned-rest-files-token'),
             'hashes': this.uniqueArray(this.listOfAffectedRestFileHashes),
           },
         },
@@ -189,9 +186,9 @@ class ExtensionScanner implements InteractableModuleInterface {
    * Handle a single extension scan
    */
   private scanSingleExtension(extension: string): void {
-    const executeToken = this.currentModal.find(this.selectorModuleContent).data('extension-scanner-files-token');
-    const modalContent = this.currentModal.find(this.selectorModalBody);
-    const $extensionContainer = this.currentModal.find(this.getExtensionSelector(extension));
+    const executeToken = this.getModuleContent().data('extension-scanner-files-token');
+    const modalContent = this.getModalBody();
+    const $extensionContainer = this.findInModal(this.getExtensionSelector(extension));
     const hitTemplate = '#t3js-extensionScanner-file-hit-template';
     const restTemplate = '#t3js-extensionScanner-file-hit-rest-template';
     let hitFound = false;
@@ -226,7 +223,7 @@ class ExtensionScanner implements InteractableModuleInterface {
                 data: {
                   'install': {
                     'action': 'extensionScannerScanFile',
-                    'token': this.currentModal.find(this.selectorModuleContent).data('extension-scanner-scan-file-token'),
+                    'token': this.getModuleContent().data('extension-scanner-scan-file-token'),
                     'extension': extension,
                     'file': file,
                   },
index 74eb35d..5959251 100644 (file)
@@ -11,7 +11,7 @@
  * The TYPO3 project - inspiring people to share!
  */
 
-import {InteractableModuleInterface} from './InteractableModuleInterface';
+import {AbstractInteractableModule} from './AbstractInteractableModule';
 import * as $ from 'jquery';
 import Router = require('../Router');
 import Notification = require('TYPO3/CMS/Backend/Notification');
@@ -19,11 +19,8 @@ import Notification = require('TYPO3/CMS/Backend/Notification');
 /**
  * Module: TYPO3/CMS/Install/Module/Features
  */
-class Features implements InteractableModuleInterface {
-  private selectorModalBody: string = '.t3js-modal-body';
-  private selectorModuleContent: string = '.t3js-features-content';
+class Features extends AbstractInteractableModule {
   private selectorSaveTrigger: string = '.t3js-features-save';
-  private currentModal: any;
 
   public initialize(currentModal: any): void {
     this.currentModal = currentModal;
@@ -36,7 +33,7 @@ class Features implements InteractableModuleInterface {
   }
 
   private getContent(): void {
-    const modalContent = this.currentModal.find(this.selectorModalBody);
+    const modalContent = this.getModalBody();
     $.ajax({
       url: Router.getUrl('featuresGetContent'),
       cache: false,
@@ -54,10 +51,10 @@ class Features implements InteractableModuleInterface {
   }
 
   private save(): void {
-    const modalContent = this.currentModal.find(this.selectorModalBody);
-    const executeToken = this.currentModal.find(this.selectorModuleContent).data('features-save-token');
+    const modalContent = this.getModalBody();
+    const executeToken = this.getModuleContent().data('features-save-token');
     const postData: any = {};
-    $(this.currentModal.find(this.selectorModuleContent + ' form').serializeArray()).each((index: number, element: any): void => {
+    $(this.findInModal('form').serializeArray()).each((index: number, element: any): void => {
       postData[element.name] = element.value;
     });
     postData['install[action]'] = 'featuresSave';
index 13a5d54..aca340f 100644 (file)
@@ -11,7 +11,7 @@
  * The TYPO3 project - inspiring people to share!
  */
 
-import {InteractableModuleInterface} from './InteractableModuleInterface';
+import {AbstractInteractableModule} from './AbstractInteractableModule';
 import * as $ from 'jquery';
 import 'bootstrap';
 import Router = require('../Router');
@@ -23,8 +23,7 @@ import Notification = require('TYPO3/CMS/Backend/Notification');
 /**
  * Module: TYPO3/CMS/Install/Module/FolderStructure
  */
-class FolderStructure implements InteractableModuleInterface {
-  private selectorModalBody: string = '.t3js-modal-body';
+class FolderStructure extends AbstractInteractableModule {
   private selectorGridderBadge: string = '.t3js-folderStructure-badge';
   private selectorOutputContainer: string = '.t3js-folderStructure-output';
   private selectorErrorContainer: string = '.t3js-folderStructure-errors';
@@ -33,7 +32,6 @@ class FolderStructure implements InteractableModuleInterface {
   private selectorOkContainer: string = '.t3js-folderStructure-ok';
   private selectorOkList: string = '.t3js-folderStructure-ok-list';
   private selectorPermissionContainer: string = '.t3js-folderStructure-permissions';
-  private currentModal: JQuery;
 
   private static removeLoadingMessage($container: JQuery): void {
     $container.find('.alert-loading').remove();
@@ -52,7 +50,7 @@ class FolderStructure implements InteractableModuleInterface {
   }
 
   private getStatus(): void {
-    const modalContent = this.currentModal.find(this.selectorModalBody);
+    const modalContent = this.getModalBody();
     const $errorBadge = $(this.selectorGridderBadge);
     $errorBadge.text('').hide();
     modalContent.find(this.selectorOutputContainer).empty().append(
@@ -106,8 +104,8 @@ class FolderStructure implements InteractableModuleInterface {
   }
 
   private fix(): void {
-    const modalContent: JQuery = this.currentModal.find(this.selectorModalBody);
-    const $outputContainer: JQuery = this.currentModal.find(this.selectorOutputContainer);
+    const modalContent: JQuery = this.getModalBody();
+    const $outputContainer: JQuery = this.findInModal(this.selectorOutputContainer);
     const message: any = ProgressBar.render(Severity.loading, 'Loading...', '');
     $outputContainer.empty().html(message);
     $.ajax({
index 4c5e289..ff7f4c7 100644 (file)
@@ -11,7 +11,7 @@
  * The TYPO3 project - inspiring people to share!
  */
 
-import {InteractableModuleInterface} from './InteractableModuleInterface';
+import {AbstractInteractableModule} from './AbstractInteractableModule';
 import * as $ from 'jquery';
 import 'bootstrap';
 import Router = require('../Router');
@@ -22,15 +22,13 @@ import Notification = require('TYPO3/CMS/Backend/Notification');
 /**
  * Module: TYPO3/CMS/Install/Module/ImageProcessing
  */
-class ImageProcessing implements InteractableModuleInterface {
-  private selectorModalBody: string = '.t3js-modal-body';
+class ImageProcessing extends AbstractInteractableModule {
   private selectorExecuteTrigger: string = '.t3js-imageProcessing-execute';
   private selectorTestContainer: string = '.t3js-imageProcessing-twinContainer';
   private selectorTwinImageTemplate: string = '.t3js-imageProcessing-twinImage-template';
   private selectorCommandContainer: string = '.t3js-imageProcessing-command';
   private selectorCommandText: string = '.t3js-imageProcessing-command-text';
   private selectorTwinImages: string = '.t3js-imageProcessing-images';
-  private currentModal: JQuery;
 
   public initialize(currentModal: JQuery): void {
     this.currentModal = currentModal;
@@ -43,7 +41,7 @@ class ImageProcessing implements InteractableModuleInterface {
   }
 
   private getData(): void {
-    const modalContent = this.currentModal.find(this.selectorModalBody);
+    const modalContent = this.getModalBody();
     $.ajax({
       url: Router.getUrl('imageProcessingGetData'),
       cache: false,
@@ -62,8 +60,8 @@ class ImageProcessing implements InteractableModuleInterface {
   }
 
   private runTests(): void {
-    const modalContent = this.currentModal.find(this.selectorModalBody);
-    const $twinImageTemplate = this.currentModal.find(this.selectorTwinImageTemplate);
+    const modalContent = this.getModalBody();
+    const $twinImageTemplate = this.findInModal(this.selectorTwinImageTemplate);
     modalContent.find(this.selectorTestContainer).each((index: number, element: any): void => {
       const $container: JQuery = $(element);
       const testType: string = $container.data('test');
diff --git a/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/InteractableModuleInterface.ts b/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/InteractableModuleInterface.ts
deleted file mode 100644 (file)
index 6e3a790..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-export interface InteractableModuleInterface {
-  initialize(currentModal: JQuery): void;
-}
index 1d7a38b..a83dd72 100644 (file)
@@ -11,7 +11,7 @@
  * The TYPO3 project - inspiring people to share!
  */
 
-import {InteractableModuleInterface} from './InteractableModuleInterface';
+import {AbstractInteractableModule} from './AbstractInteractableModule';
 import * as $ from 'jquery';
 import 'bootstrap';
 import Router = require('../Router');
@@ -23,9 +23,7 @@ import Severity = require('../Renderable/Severity');
 /**
  * Module: TYPO3/CMS/Install/Module/LanguagePacks
  */
-class LanguagePacks implements InteractableModuleInterface {
-  private selectorModalBody: string = '.t3js-modal-body';
-  private selectorModuleContent: string = '.t3js-module-content';
+class LanguagePacks extends AbstractInteractableModule {
   private selectorOutputContainer: string = '.t3js-languagePacks-output';
   private selectorContentContainer: string = '.t3js-languagePacks-mainContent';
   private selectorActivateLanguage: string = '.t3js-languagePacks-activateLanguage';
@@ -39,8 +37,6 @@ class LanguagePacks implements InteractableModuleInterface {
   private selectorExtensionPackMissesIcon: string = '#t3js-languagePacks-extensionPack-misses-icon';
   private selectorNotifications: string = '.t3js-languagePacks-notifications';
 
-  private currentModal: JQuery;
-
   private activeLanguages: Array<any> = [];
   private activeExtensions: Array<any> = [];
 
@@ -85,7 +81,7 @@ class LanguagePacks implements InteractableModuleInterface {
   }
 
   private getData(): void {
-    const modalContent = this.currentModal.find(this.selectorModalBody);
+    const modalContent = this.getModalBody();
     $.ajax({
       url: Router.getUrl('languagePacksGetData'),
       cache: false,
@@ -113,8 +109,8 @@ class LanguagePacks implements InteractableModuleInterface {
   }
 
   private activateLanguage(iso: string): void {
-    const modalContent = this.currentModal.find(this.selectorModalBody);
-    const $outputContainer = this.currentModal.find(this.selectorOutputContainer);
+    const modalContent = this.getModalBody();
+    const $outputContainer = this.findInModal(this.selectorOutputContainer);
     const message = ProgressBar.render(Severity.loading, 'Loading...', '');
     $outputContainer.empty().append(message);
 
@@ -125,7 +121,7 @@ class LanguagePacks implements InteractableModuleInterface {
       data: {
         'install': {
           'action': 'languagePacksActivateLanguage',
-          'token': this.currentModal.find(this.selectorModuleContent).data('language-packs-activate-language-token'),
+          'token': this.getModuleContent().data('language-packs-activate-language-token'),
           'iso': iso,
         },
       },
@@ -153,8 +149,8 @@ class LanguagePacks implements InteractableModuleInterface {
   }
 
   private deactivateLanguage(iso: string): void {
-    const modalContent = this.currentModal.find(this.selectorModalBody);
-    const $outputContainer = this.currentModal.find(this.selectorOutputContainer);
+    const modalContent = this.getModalBody();
+    const $outputContainer = this.findInModal(this.selectorOutputContainer);
     const message = ProgressBar.render(Severity.loading, 'Loading...', '');
     $outputContainer.empty().append(message);
     $.ajax({
@@ -164,7 +160,7 @@ class LanguagePacks implements InteractableModuleInterface {
       data: {
         'install': {
           'action': 'languagePacksDeactivateLanguage',
-          'token': this.currentModal.find(this.selectorModuleContent).data('language-packs-deactivate-language-token'),
+          'token': this.getModuleContent().data('language-packs-deactivate-language-token'),
           'iso': iso,
         },
       },
@@ -192,8 +188,8 @@ class LanguagePacks implements InteractableModuleInterface {
   }
 
   private updatePacks(iso: string, extension: string): void {
-    const $outputContainer = this.currentModal.find(this.selectorOutputContainer);
-    const $contentContainer = this.currentModal.find(this.selectorContentContainer);
+    const $outputContainer = this.findInModal(this.selectorOutputContainer);
+    const $contentContainer = this.findInModal(this.selectorContentContainer);
     const isos = iso === undefined ? this.activeLanguages : [ iso ];
     let updateIsoTimes = true;
     let extensions = this.activeExtensions;
@@ -234,7 +230,7 @@ class LanguagePacks implements InteractableModuleInterface {
           data: {
             'install': {
               'action': 'languagePacksUpdatePack',
-              'token': this.currentModal.find(this.selectorModuleContent).data('language-packs-update-pack-token'),
+              'token': this.getModuleContent().data('language-packs-update-pack-token'),
               'iso': isoCode,
               'extension': extensionKey,
             },
@@ -271,8 +267,8 @@ class LanguagePacks implements InteractableModuleInterface {
   }
 
   private packUpdateDone(updateIsoTimes: boolean, isos: Array<any>): void {
-    const modalContent = this.currentModal.find(this.selectorModalBody);
-    const $outputContainer = this.currentModal.find(this.selectorOutputContainer);
+    const modalContent = this.getModalBody();
+    const $outputContainer = this.findInModal(this.selectorOutputContainer);
     if (this.packsUpdateDetails.handled === this.packsUpdateDetails.toHandle) {
       // All done - create summary, update 'last update' of iso list, render main view
       const message = InfoBox.render(
@@ -291,7 +287,7 @@ class LanguagePacks implements InteractableModuleInterface {
           data: {
             'install': {
               'action': 'languagePacksUpdateIsoTimes',
-              'token': this.currentModal.find(this.selectorModuleContent).data('language-packs-update-iso-times-token'),
+              'token': this.getModuleContent().data('language-packs-update-iso-times-token'),
               'isos': isos,
             },
           },
@@ -323,9 +319,9 @@ class LanguagePacks implements InteractableModuleInterface {
   }
 
   private languageMatrixHtml(data: any): string {
-    const activateIcon = this.currentModal.find(this.selectorActivateLanguageIcon).html();
-    const deactivateIcon = this.currentModal.find(this.selectorDeactivateLanguageIcon).html();
-    const updateIcon = this.currentModal.find(this.selectorLanguageUpdateIcon).html();
+    const activateIcon = this.findInModal(this.selectorActivateLanguageIcon).html();
+    const deactivateIcon = this.findInModal(this.selectorDeactivateLanguageIcon).html();
+    const updateIcon = this.findInModal(this.selectorLanguageUpdateIcon).html();
     const $markupContainer = $('<div>');
 
     const $tbody = $('<tbody>');
@@ -401,8 +397,8 @@ class LanguagePacks implements InteractableModuleInterface {
   }
 
   private extensionMatrixHtml(data: any): any {
-    const packMissesIcon: string = this.currentModal.find(this.selectorExtensionPackMissesIcon).html();
-    const updateIcon: string = this.currentModal.find(this.selectorLanguageUpdateIcon).html();
+    const packMissesIcon: string = this.findInModal(this.selectorExtensionPackMissesIcon).html();
+    const updateIcon: string = this.findInModal(this.selectorLanguageUpdateIcon).html();
     let tooltip: string = '';
     let extensionTitle: JQuery;
     let allPackagesExist: boolean = true;
@@ -500,7 +496,7 @@ class LanguagePacks implements InteractableModuleInterface {
   }
 
   private getNotificationBox(): JQuery {
-    return this.currentModal.find(this.selectorNotifications);
+    return this.findInModal(this.selectorNotifications);
   }
 
   private addNotification(notification: any): void {
index a5d8382..de0dbcf 100644 (file)
@@ -11,7 +11,7 @@
  * The TYPO3 project - inspiring people to share!
  */
 
-import {InteractableModuleInterface} from './InteractableModuleInterface';
+import {AbstractInteractableModule} from './AbstractInteractableModule';
 import * as $ from 'jquery';
 import 'bootstrap';
 import Router = require('../Router');
@@ -20,13 +20,10 @@ import Notification = require('TYPO3/CMS/Backend/Notification');
 /**
  * Module: TYPO3/CMS/Install/Module/LocalConfiguration
  */
-class LocalConfiguration implements InteractableModuleInterface {
-  private selectorModalBody: string = '.t3js-modal-body';
-  private selectorModuleContent: string = '.t3js-module-content';
+class LocalConfiguration extends AbstractInteractableModule {
   private selectorToggleAllTrigger: string = '.t3js-localConfiguration-toggleAll';
   private selectorWriteTrigger: string = '.t3js-localConfiguration-write';
   private selectorSearchTrigger: string = '.t3js-localConfiguration-search';
-  private currentModal: JQuery;
 
   public initialize(currentModal: JQuery): void {
     this.currentModal = currentModal;
@@ -39,7 +36,7 @@ class LocalConfiguration implements InteractableModuleInterface {
 
     // Expand / collapse "Toggle all" button
     currentModal.on('click', this.selectorToggleAllTrigger, (): void => {
-      const modalContent = this.currentModal.find(this.selectorModalBody);
+      const modalContent = this.getModalBody();
       const panels = modalContent.find('.panel-collapse');
       const action = (panels.eq(0).hasClass('in')) ? 'hide' : 'show';
       panels.collapse(action);
@@ -89,7 +86,7 @@ class LocalConfiguration implements InteractableModuleInterface {
   }
 
   private getContent(): void {
-    const modalContent = this.currentModal.find(this.selectorModalBody);
+    const modalContent = this.getModalBody();
     $.ajax({
       url: Router.getUrl('localConfigurationGetContent'),
       cache: false,
@@ -110,10 +107,10 @@ class LocalConfiguration implements InteractableModuleInterface {
   }
 
   private write(): void {
-    const modalContent: JQuery = this.currentModal.find(this.selectorModalBody);
-    const executeToken: JQuery = this.currentModal.find(this.selectorModuleContent).data('local-configuration-write-token');
+    const modalContent: JQuery = this.getModalBody();
+    const executeToken: JQuery = this.getModuleContent().data('local-configuration-write-token');
     const configurationValues: any = {};
-    this.currentModal.find('.t3js-localConfiguration-pathValue').each((i: number, element: any): void => {
+    this.findInModal('.t3js-localConfiguration-pathValue').each((i: number, element: any): void => {
       const $element: JQuery = $(element);
       if ($element.attr('type') === 'checkbox') {
         if (element.checked) {
index 18a5f69..8673389 100644 (file)
@@ -11,7 +11,7 @@
  * The TYPO3 project - inspiring people to share!
  */
 
-import {InteractableModuleInterface} from './InteractableModuleInterface';
+import {AbstractInteractableModule} from './AbstractInteractableModule';
 import * as $ from 'jquery';
 import 'bootstrap';
 import Router = require('../Router');
@@ -23,12 +23,9 @@ import Notification = require('TYPO3/CMS/Backend/Notification');
 /**
  * Module: TYPO3/CMS/Install/Module/CreateAdmin
  */
-class MailTest implements InteractableModuleInterface {
-  private selectorModalBody: string = '.t3js-modal-body';
-  private selectorModuleContent: string = '.t3js-module-content';
+class MailTest extends AbstractInteractableModule {
   private selectorForm: string = '#t3js-mailTest-form';
   private selectorOutputContainer: string = '.t3js-mailTest-output';
-  private currentModal: JQuery;
 
   public initialize(currentModal: JQuery): void {
     this.currentModal = currentModal;
@@ -40,7 +37,7 @@ class MailTest implements InteractableModuleInterface {
   }
 
   private getData(): void {
-    const modalContent = this.currentModal.find(this.selectorModalBody);
+    const modalContent = this.getModalBody();
     $.ajax({
       url: Router.getUrl('mailTestGetData'),
       cache: false,
@@ -58,8 +55,8 @@ class MailTest implements InteractableModuleInterface {
   }
 
   private send(): void {
-    const executeToken: string = this.currentModal.find(this.selectorModuleContent).data('mail-test-token');
-    const $outputContainer: JQuery = this.currentModal.find(this.selectorOutputContainer);
+    const executeToken: string = this.getModuleContent().data('mail-test-token');
+    const $outputContainer: JQuery = this.findInModal(this.selectorOutputContainer);
     const message: any = ProgressBar.render(Severity.loading, 'Loading...', '');
     $outputContainer.empty().html(message);
     $.ajax({
@@ -69,7 +66,7 @@ class MailTest implements InteractableModuleInterface {
         'install': {
           'action': 'mailTest',
           'token': executeToken,
-          'email': this.currentModal.find('.t3js-mailTest-email').val(),
+          'email': this.findInModal('.t3js-mailTest-email').val(),
         },
       },
       cache: false,
index a08fb90..537b852 100644 (file)
@@ -11,7 +11,7 @@
  * The TYPO3 project - inspiring people to share!
  */
 
-import {InteractableModuleInterface} from './InteractableModuleInterface';
+import {AbstractInteractableModule} from './AbstractInteractableModule';
 import * as $ from 'jquery';
 import Router = require('../Router');
 import Notification = require('TYPO3/CMS/Backend/Notification');
@@ -19,17 +19,14 @@ import Notification = require('TYPO3/CMS/Backend/Notification');
 /**
  * Module: TYPO3/CMS/Install/Module/PhpInfo
  */
-class PhpInfo implements InteractableModuleInterface {
-  private selectorModalBody: string = '.t3js-modal-body';
-  private currentModal: any = {};
-
+class PhpInfo extends AbstractInteractableModule {
   public initialize(currentModal: any): void {
     this.currentModal = currentModal;
     this.getData();
   }
 
   private getData(): void {
-    const modalContent = this.currentModal.find(this.selectorModalBody);
+    const modalContent = this.getModalBody();
     $.ajax({
       url: Router.getUrl('phpInfoGetData'),
       cache: false,
index 23c8b9f..9e24cd9 100644 (file)
@@ -11,7 +11,7 @@
  * The TYPO3 project - inspiring people to share!
  */
 
-import {InteractableModuleInterface} from './InteractableModuleInterface';
+import {AbstractInteractableModule} from './AbstractInteractableModule';
 import * as $ from 'jquery';
 import 'bootstrap';
 import Router = require('../Router');
@@ -20,13 +20,10 @@ import Notification = require('TYPO3/CMS/Backend/Notification');
 /**
  * Module: TYPO3/CMS/Install/Module/Presets
  */
-class Presets implements InteractableModuleInterface {
-  private selectorModalBody: string = '.t3js-modal-body';
-  private selectorModuleContent: string = '.t3js-presets-content';
+class Presets extends AbstractInteractableModule {
   private selectorActivateTrigger: string = '.t3js-presets-activate';
   private selectorImageExecutable: string = '.t3js-presets-image-executable';
   private selectorImageExecutableTrigger: string = '.t3js-presets-image-executable-trigger';
-  private currentModal: JQuery;
 
   public initialize(currentModal: JQuery): void {
     this.currentModal = currentModal;
@@ -51,7 +48,7 @@ class Presets implements InteractableModuleInterface {
   }
 
   private getContent(): void {
-    const modalContent = this.currentModal.find(this.selectorModalBody);
+    const modalContent = this.getModalBody();
     $.ajax({
       url: Router.getUrl('presetsGetContent'),
       cache: false,
@@ -69,8 +66,8 @@ class Presets implements InteractableModuleInterface {
   }
 
   private getCustomImagePathContent(): void {
-    const modalContent = this.currentModal.find(this.selectorModalBody);
-    const presetsContentToken = this.currentModal.find(this.selectorModuleContent).data('presets-content-token');
+    const modalContent = this.getModalBody();
+    const presetsContentToken = this.getModuleContent().data('presets-content-token');
     $.ajax({
       url: Router.getUrl(),
       method: 'POST',
@@ -80,7 +77,7 @@ class Presets implements InteractableModuleInterface {
           'action': 'presetsGetContent',
           'values': {
             'Image': {
-              'additionalSearchPath': this.currentModal.find(this.selectorImageExecutable).val(),
+              'additionalSearchPath': this.findInModal(this.selectorImageExecutable).val(),
             },
           },
         },
@@ -100,10 +97,10 @@ class Presets implements InteractableModuleInterface {
   }
 
   private activate(): void {
-    const modalContent: JQuery = this.currentModal.find(this.selectorModalBody);
-    const executeToken: string = this.currentModal.find(this.selectorModuleContent).data('presets-activate-token');
+    const modalContent: JQuery = this.getModalBody();
+    const executeToken: string = this.getModuleContent().data('presets-activate-token');
     const postData: any = {};
-    $(this.currentModal.find(this.selectorModuleContent + ' form').serializeArray()).each((index: number, element: any): void => {
+    $(this.findInModal('form').serializeArray()).each((index: number, element: any): void => {
       postData[element.name] = element.value;
     });
     postData['install[action]'] = 'presetsActivate';
index 4e8560b..508291e 100644 (file)
@@ -11,7 +11,7 @@
  * The TYPO3 project - inspiring people to share!
  */
 
-import {InteractableModuleInterface} from './InteractableModuleInterface';
+import {AbstractInteractableModule} from './AbstractInteractableModule';
 import * as $ from 'jquery';
 import Router = require('../Router');
 import Notification = require('TYPO3/CMS/Backend/Notification');
@@ -19,17 +19,14 @@ import Notification = require('TYPO3/CMS/Backend/Notification');
 /**
  * Module: TYPO3/CMS/Install/Module/SystemInformation
  */
-class SystemInformation implements InteractableModuleInterface {
-  private selectorModalBody: string = '.t3js-modal-body';
-  private currentModal: any = {};
-
+class SystemInformation extends AbstractInteractableModule {
   public initialize(currentModal: any): void {
     this.currentModal = currentModal;
     this.getData();
   }
 
   private getData(): void {
-    const modalContent = this.currentModal.find(this.selectorModalBody);
+    const modalContent = this.getModalBody();
     $.ajax({
       url: Router.getUrl('systemInformationGetData'),
       cache: false,
index c02a293..9fcd657 100644 (file)
@@ -11,7 +11,7 @@
  * The TYPO3 project - inspiring people to share!
  */
 
-import {InteractableModuleInterface} from './InteractableModuleInterface';
+import {AbstractInteractableModule} from './AbstractInteractableModule';
 import * as $ from 'jquery';
 import 'bootstrap';
 import Router = require('../Router');
@@ -20,13 +20,10 @@ import Notification = require('TYPO3/CMS/Backend/Notification');
 /**
  * Module: TYPO3/CMS/Install/Module/SystemMaintainer
  */
-class SystemMaintainer implements InteractableModuleInterface {
-  private selectorModalBody: string = '.t3js-modal-body';
-  private selectorModuleContent: string = '.t3js-module-content';
+class SystemMaintainer extends AbstractInteractableModule {
   private selectorWriteTrigger: string = '.t3js-systemMaintainer-write';
   private selectorChosenContainer: string = '.t3js-systemMaintainer-chosen';
   private selectorChosenField: string = '.t3js-systemMaintainer-chosen-select';
-  private currentModal: JQuery;
 
   public initialize(currentModal: JQuery): void {
     this.currentModal = currentModal;
@@ -48,7 +45,7 @@ class SystemMaintainer implements InteractableModuleInterface {
   }
 
   private getList(): void {
-    const modalContent = this.currentModal.find(this.selectorModalBody);
+    const modalContent = this.getModalBody();
     $.ajax({
       url: Router.getUrl('systemMaintainerGetList'),
       cache: false,
@@ -96,9 +93,9 @@ class SystemMaintainer implements InteractableModuleInterface {
   }
 
   private write(): void {
-    const modalContent = this.currentModal.find(this.selectorModalBody);
-    const executeToken = this.currentModal.find(this.selectorModuleContent).data('system-maintainer-write-token');
-    const selectedUsers = this.currentModal.find(this.selectorChosenField).val();
+    const modalContent = this.getModalBody();
+    const executeToken = this.getModuleContent().data('system-maintainer-write-token');
+    const selectedUsers = this.findInModal(this.selectorChosenField).val();
     $.ajax({
       method: 'POST',
       url: Router.getUrl(),
index afbbf64..360c71d 100644 (file)
@@ -11,7 +11,7 @@
  * The TYPO3 project - inspiring people to share!
  */
 
-import {InteractableModuleInterface} from './InteractableModuleInterface';
+import {AbstractInteractableModule} from './AbstractInteractableModule';
 import * as $ from 'jquery';
 import Router = require('../Router');
 import ProgressBar = require('../Renderable/ProgressBar');
@@ -22,11 +22,9 @@ import Notification = require('TYPO3/CMS/Backend/Notification');
 /**
  * Module: TYPO3/CMS/Install/Module/TcaExtTablesCheck
  */
-class TcaExtTablesCheck implements InteractableModuleInterface {
-  private selectorModalBody: string = '.t3js-modal-body';
+class TcaExtTablesCheck extends AbstractInteractableModule {
   private selectorCheckTrigger: string = '.t3js-tcaExtTablesCheck-check';
   private selectorOutputContainer: string = '.t3js-tcaExtTablesCheck-output';
-  private currentModal: JQuery;
 
   public initialize(currentModal: JQuery): void {
     this.currentModal = currentModal;
@@ -38,7 +36,7 @@ class TcaExtTablesCheck implements InteractableModuleInterface {
   }
 
   private check(): void {
-    const modalContent = this.currentModal.find(this.selectorModalBody);
+    const modalContent = this.getModalBody();
     const $outputContainer = $(this.selectorOutputContainer);
     const m: any = ProgressBar.render(Severity.loading, 'Loading...', '');
     $outputContainer.empty().html(m);
index fe1e314..5ee2629 100644 (file)
@@ -11,7 +11,7 @@
  * The TYPO3 project - inspiring people to share!
  */
 
-import {InteractableModuleInterface} from './InteractableModuleInterface';
+import {AbstractInteractableModule} from './AbstractInteractableModule';
 import * as $ from 'jquery';
 import Router = require('../Router');
 import ProgressBar = require('../Renderable/ProgressBar');
@@ -22,11 +22,9 @@ import InfoBox = require('../Renderable/InfoBox');
 /**
  * Module: TYPO3/CMS/Install/Module/TcaMigrationsCheck
  */
-class TcaMigrationsCheck implements InteractableModuleInterface {
-  private selectorModalBody: string = '.t3js-modal-body';
+class TcaMigrationsCheck extends AbstractInteractableModule {
   private selectorCheckTrigger: string = '.t3js-tcaMigrationsCheck-check';
   private selectorOutputContainer: string = '.t3js-tcaMigrationsCheck-output';
-  private currentModal: JQuery;
 
   public initialize(currentModal: JQuery): void {
     this.currentModal = currentModal;
@@ -39,7 +37,7 @@ class TcaMigrationsCheck implements InteractableModuleInterface {
 
   private check(): void {
     const $outputContainer: JQuery = $(this.selectorOutputContainer);
-    const modalContent: JQuery = this.currentModal.find(this.selectorModalBody);
+    const modalContent: JQuery = this.getModalBody();
     const message: any = ProgressBar.render(Severity.loading, 'Loading...', '');
     $outputContainer.empty().html(message);
     $.ajax({
index 3f24f87..f52c32a 100644 (file)
@@ -11,7 +11,7 @@
  * The TYPO3 project - inspiring people to share!
  */
 
-import {InteractableModuleInterface} from './InteractableModuleInterface';
+import {AbstractInteractableModule} from './AbstractInteractableModule';
 import * as $ from 'jquery';
 import 'bootstrap';
 import Router = require('../Router');
@@ -20,16 +20,13 @@ import Notification = require('TYPO3/CMS/Backend/Notification');
 /**
  * Module: TYPO3/CMS/Install/Module/UpgradeDocs
  */
-class UpgradeDocs implements InteractableModuleInterface {
-  private selectorModalBody: string = '.t3js-modal-body';
-  private selectorModuleContent: string = '.t3js-module-content';
+class UpgradeDocs extends AbstractInteractableModule {
   private selectorRestFileItem: string = '.upgrade_analysis_item_to_filter';
   private selectorFulltextSearch: string = '.t3js-upgradeDocs-fulltext-search';
   private selectorChosenField: string = '.t3js-upgradeDocs-chosen-select';
   private selectorChangeLogsForVersionContainer: string = '.t3js-version-changes';
   private selectorChangeLogsForVersion: string = '.t3js-changelog-list';
 
-  private currentModal: JQuery;
   private chosenField: JQuery;
   private fulltextSearchField: JQuery;
 
@@ -81,7 +78,7 @@ class UpgradeDocs implements InteractableModuleInterface {
   }
 
   private getContent(): void {
-    const modalContent = this.currentModal.find(this.selectorModalBody);
+    const modalContent = this.getModalBody();
     $.ajax({
       url: Router.getUrl('upgradeDocsGetContent'),
       cache: false,
@@ -102,8 +99,8 @@ class UpgradeDocs implements InteractableModuleInterface {
 
   private loadChangelogs(): void {
     const promises: Array<any> = [];
-    const modalContent = this.currentModal.find(this.selectorModalBody);
-    this.currentModal.find(this.selectorChangeLogsForVersionContainer).each((index: number, el: any): void => {
+    const modalContent = this.getModalBody();
+    this.findInModal(this.selectorChangeLogsForVersionContainer).each((index: number, el: any): void => {
       const $request = $.ajax({
         url: Router.getUrl('upgradeDocsGetChangelogForVersion'),
         cache: false,
@@ -141,7 +138,7 @@ class UpgradeDocs implements InteractableModuleInterface {
   }
 
   private initializeFullTextSearch(): void {
-    this.fulltextSearchField = this.currentModal.find(this.selectorFulltextSearch);
+    this.fulltextSearchField = this.findInModal(this.selectorFulltextSearch);
     this.fulltextSearchField.clearable().focus();
     this.initializeChosenSelector();
     this.fulltextSearchField.on('keyup', (): void => {
@@ -150,7 +147,7 @@ class UpgradeDocs implements InteractableModuleInterface {
   }
 
   private initializeChosenSelector(): void {
-    this.chosenField = this.currentModal.find(this.selectorModalBody).find(this.selectorChosenField);
+    this.chosenField = this.getModalBody().find(this.selectorChosenField);
 
     const config: any = {
       '.chosen-select': {width: '100%', placeholder_text_multiple: 'tags'},
@@ -161,7 +158,7 @@ class UpgradeDocs implements InteractableModuleInterface {
     };
     for (const selector in config) {
       if (config.hasOwnProperty(selector)) {
-        this.currentModal.find(selector).chosen(config[selector]);
+        this.findInModal(selector).chosen(config[selector]);
       }
     }
     this.chosenField.on('change', (): void => {
@@ -174,7 +171,7 @@ class UpgradeDocs implements InteractableModuleInterface {
    */
   private appendItemsToChosenSelector(): void {
     let tagString = '';
-    $(this.currentModal.find(this.selectorRestFileItem)).each((index: number, element: any): void => {
+    $(this.findInModal(this.selectorRestFileItem)).each((index: number, element: any): void => {
       tagString += $(element).data('item-tags') + ',';
     });
     const tagArray = UpgradeDocs.trimExplodeAndUnique(',', tagString).sort((a: string, b: string): number => {
@@ -189,7 +186,7 @@ class UpgradeDocs implements InteractableModuleInterface {
   }
 
   private combinedFilterSearch(): boolean {
-    const modalContent = this.currentModal.find(this.selectorModalBody);
+    const modalContent = this.getModalBody();
     const $items = modalContent.find('div.item');
     if (this.chosenField.val().length < 1 && this.fulltextSearchField.val().length < 1) {
       $('.panel-version:not(:first) > .panel-collapse').collapse('hide');
@@ -270,17 +267,17 @@ class UpgradeDocs implements InteractableModuleInterface {
    * Moves all documents that are either read or not affected
    */
   private moveNotRelevantDocuments($container: JQuery): void {
-    $container.find('[data-item-state="read"]').appendTo(this.currentModal.find('.panel-body-read'));
-    $container.find('[data-item-state="notAffected"]').appendTo(this.currentModal.find('.panel-body-not-affected'));
+    $container.find('[data-item-state="read"]').appendTo(this.findInModal('.panel-body-read'));
+    $container.find('[data-item-state="notAffected"]').appendTo(this.findInModal('.panel-body-not-affected'));
   }
 
   private markRead(element: any): void {
-    const modalContent = this.currentModal.find(this.selectorModalBody);
-    const executeToken = this.currentModal.find(this.selectorModuleContent).data('upgrade-docs-mark-read-token');
+    const modalContent = this.getModalBody();
+    const executeToken = this.getModuleContent().data('upgrade-docs-mark-read-token');
     const $button = $(element).closest('a');
     $button.toggleClass('t3js-upgradeDocs-unmarkRead t3js-upgradeDocs-markRead');
     $button.find('i').toggleClass('fa-check fa-ban');
-    $button.closest('.panel').appendTo(this.currentModal.find('.panel-body-read'));
+    $button.closest('.panel').appendTo(this.findInModal('.panel-body-read'));
     $.ajax({
       method: 'POST',
       url: Router.getUrl(),
@@ -298,13 +295,13 @@ class UpgradeDocs implements InteractableModuleInterface {
   }
 
   private unmarkRead(element: any): void {
-    const modalContent = this.currentModal.find(this.selectorModalBody);
-    const executeToken = this.currentModal.find(this.selectorModuleContent).data('upgrade-docs-unmark-read-token');
+    const modalContent = this.getModalBody();
+    const executeToken = this.getModuleContent().data('upgrade-docs-unmark-read-token');
     const $button = $(element).closest('a');
     const version = $button.closest('.panel').data('item-version');
     $button.toggleClass('t3js-upgradeDocs-markRead t3js-upgradeDocs-unmarkRead');
     $button.find('i').toggleClass('fa-check fa-ban');
-    $button.closest('.panel').appendTo(this.currentModal.find('*[data-group-version="' + version + '"] .panel-body'));
+    $button.closest('.panel').appendTo(this.findInModal('*[data-group-version="' + version + '"] .panel-body'));
     $.ajax({
       method: 'POST',
       url: Router.getUrl(),
index 2763bd5..0ba7bad 100644 (file)
@@ -11,7 +11,7 @@
  * The TYPO3 project - inspiring people to share!
  */
 
-import {InteractableModuleInterface} from './InteractableModuleInterface';
+import {AbstractInteractableModule} from './AbstractInteractableModule';
 import * as $ from 'jquery';
 import 'bootstrap';
 import Router = require('../Router');
@@ -25,9 +25,7 @@ import SecurityUtility = require('TYPO3/CMS/Core/SecurityUtility');
 /**
  * Module: TYPO3/CMS/Install/Module/UpgradeWizards
  */
-class UpgradeWizards implements InteractableModuleInterface {
-  private selectorModalBody: string = '.t3js-modal-body';
-  private selectorModuleContent: string = '.t3js-module-content';
+class UpgradeWizards extends AbstractInteractableModule {
   private selectorOutputWizardsContainer: string = '.t3js-upgradeWizards-wizards-output';
   private selectorOutputDoneContainer: string = '.t3js-upgradeWizards-done-output';
   private selectorWizardsBlockingAddsTemplate: string = '.t3js-upgradeWizards-blocking-adds-template';
@@ -50,10 +48,10 @@ class UpgradeWizards implements InteractableModuleInterface {
   private selectorWizardsInputTitle: string = '.t3js-upgradeWizards-input-title';
   private selectorWizardsInputHtml: string = '.t3js-upgradeWizards-input-html';
   private selectorWizardsInputPerform: string = '.t3js-upgradeWizards-input-perform';
-  private currentModal: JQuery;
   private securityUtility: SecurityUtility;
 
   constructor() {
+    super();
     this.securityUtility = new SecurityUtility();
   }
 
@@ -99,7 +97,7 @@ class UpgradeWizards implements InteractableModuleInterface {
   }
 
   private getData(): JQueryPromise<any> {
-    const modalContent = this.currentModal.find(this.selectorModalBody);
+    const modalContent = this.getModalBody();
     return $.ajax({
       url: Router.getUrl('upgradeWizardsGetData'),
       cache: false,
@@ -118,8 +116,8 @@ class UpgradeWizards implements InteractableModuleInterface {
   }
 
   private blockingUpgradesDatabaseCharsetTest(): void {
-    const modalContent = this.currentModal.find(this.selectorModalBody);
-    const $outputContainer = this.currentModal.find(this.selectorOutputWizardsContainer);
+    const modalContent = this.getModalBody();
+    const $outputContainer = this.findInModal(this.selectorOutputWizardsContainer);
     $outputContainer.empty().html(UpgradeWizards.renderProgressBar('Checking database charset...'));
     $.ajax({
       url: Router.getUrl('upgradeWizardsBlockingDatabaseCharsetTest'),
@@ -169,8 +167,8 @@ class UpgradeWizards implements InteractableModuleInterface {
   }
 
   private blockingUpgradesDatabaseAdds(): void {
-    const modalContent = this.currentModal.find(this.selectorModalBody);
-    const $outputContainer = this.currentModal.find(this.selectorOutputWizardsContainer);
+    const modalContent = this.getModalBody();
+    const $outputContainer = this.findInModal(this.selectorOutputWizardsContainer);
     $outputContainer.empty().html(UpgradeWizards.renderProgressBar('Check for missing mandatory database tables and fields...'));
     $.ajax({
       url: Router.getUrl('upgradeWizardsBlockingDatabaseAdds'),
@@ -215,7 +213,7 @@ class UpgradeWizards implements InteractableModuleInterface {
   }
 
   private blockingUpgradesDatabaseAddsExecute(): void {
-    const $outputContainer = this.currentModal.find(this.selectorOutputWizardsContainer);
+    const $outputContainer = this.findInModal(this.selectorOutputWizardsContainer);
     $outputContainer.empty().html(UpgradeWizards.renderProgressBar('Adding database tables and fields...'));
     $.ajax({
       url: Router.getUrl('upgradeWizardsBlockingDatabaseExecute'),
@@ -243,8 +241,8 @@ class UpgradeWizards implements InteractableModuleInterface {
   }
 
   private wizardsList(): void {
-    const modalContent = this.currentModal.find(this.selectorModalBody);
-    const $outputContainer = this.currentModal.find(this.selectorOutputWizardsContainer);
+    const modalContent = this.getModalBody();
+    const $outputContainer = this.findInModal(this.selectorOutputWizardsContainer);
     $outputContainer.append(UpgradeWizards.renderProgressBar('Loading upgrade wizards...'));
 
     $.ajax({
@@ -288,7 +286,7 @@ class UpgradeWizards implements InteractableModuleInterface {
             .find('span')
             .text(percent + '%');
           modalContent.find(this.selectorOutputWizardsContainer).append(list);
-          this.currentModal.find(this.selectorWizardsDoneRowMarkUndone).prop('disabled', false);
+          this.findInModal(this.selectorWizardsDoneRowMarkUndone).prop('disabled', false);
         } else {
           Notification.error('Something went wrong');
         }
@@ -300,9 +298,9 @@ class UpgradeWizards implements InteractableModuleInterface {
   }
 
   private wizardInput(identifier: string, title: string): void {
-    const executeToken = this.currentModal.find(this.selectorModuleContent).data('upgrade-wizards-input-token');
-    const modalContent = this.currentModal.find(this.selectorModalBody);
-    const $outputContainer = this.currentModal.find(this.selectorOutputWizardsContainer);
+    const executeToken = this.getModuleContent().data('upgrade-wizards-input-token');
+    const modalContent = this.getModalBody();
+    const $outputContainer = this.findInModal(this.selectorOutputWizardsContainer);
     $outputContainer.empty().html(UpgradeWizards.renderProgressBar('Loading "' + title + '"...'));
 
     modalContent.animate(
@@ -351,20 +349,20 @@ class UpgradeWizards implements InteractableModuleInterface {
   }
 
   private wizardExecute(identifier: string, title: string): void {
-    const executeToken = this.currentModal.find(this.selectorModuleContent).data('upgrade-wizards-execute-token');
-    const modalContent = this.currentModal.find(this.selectorModalBody);
+    const executeToken = this.getModuleContent().data('upgrade-wizards-execute-token');
+    const modalContent = this.getModalBody();
     const postData: any = {
       'install[action]': 'upgradeWizardsExecute',
       'install[token]': executeToken,
       'install[identifier]': identifier,
     };
-    $(this.currentModal.find(this.selectorOutputWizardsContainer + ' form').serializeArray()).each((index: number, element: any): void => {
+    $(this.findInModal(this.selectorOutputWizardsContainer + ' form').serializeArray()).each((index: number, element: any): void => {
       postData[element.name] = element.value;
     });
-    const $outputContainer = this.currentModal.find(this.selectorOutputWizardsContainer);
+    const $outputContainer = this.findInModal(this.selectorOutputWizardsContainer);
     // modalContent.find(this.selectorOutputWizardsContainer).empty();
     $outputContainer.empty().html(UpgradeWizards.renderProgressBar('Executing "' + title + '"...'));
-    this.currentModal.find(this.selectorWizardsDoneRowMarkUndone).prop('disabled', true);
+    this.findInModal(this.selectorWizardsDoneRowMarkUndone).prop('disabled', true);
     $.ajax({
       method: 'POST',
       data: postData,
@@ -393,7 +391,7 @@ class UpgradeWizards implements InteractableModuleInterface {
   }
 
   private doneUpgrades(): void {
-    const modalContent = this.currentModal.find(this.selectorModalBody);
+    const modalContent = this.getModalBody();
     const $outputContainer = modalContent.find(this.selectorOutputDoneContainer);
     $outputContainer.empty().html(UpgradeWizards.renderProgressBar('Loading executed upgrade wizards...'));
 
@@ -432,7 +430,7 @@ class UpgradeWizards implements InteractableModuleInterface {
           }
           if (hasBodyContent) {
             modalContent.find(this.selectorOutputDoneContainer).append(body);
-            this.currentModal.find(this.selectorWizardsDoneRowMarkUndone).prop('disabled', true);
+            this.findInModal(this.selectorWizardsDoneRowMarkUndone).prop('disabled', true);
           }
         } else {
           Notification.error('Something went wrong');
@@ -445,9 +443,9 @@ class UpgradeWizards implements InteractableModuleInterface {
   }
 
   private markUndone(identifier: string): void {
-    const executeToken = this.currentModal.find(this.selectorModuleContent).data('upgrade-wizards-mark-undone-token');
-    const modalContent = this.currentModal.find(this.selectorModalBody);
-    const $outputContainer = this.currentModal.find(this.selectorOutputDoneContainer);
+    const executeToken = this.getModuleContent().data('upgrade-wizards-mark-undone-token');
+    const modalContent = this.getModalBody();
+    const $outputContainer = this.findInModal(this.selectorOutputDoneContainer);
     $outputContainer.empty().html(UpgradeWizards.renderProgressBar('Marking upgrade wizard as undone...'));
     $.ajax({
       url: Router.getUrl(),
index 66e605c..87b17a2 100644 (file)
@@ -12,7 +12,7 @@
  */
 
 import {InlineModuleInterface} from './Module/InlineModuleInterface';
-import {InteractableModuleInterface} from './Module/InteractableModuleInterface';
+import {AbstractInteractableModule} from './Module/AbstractInteractableModule';
 import * as $ from 'jquery';
 import InfoBox = require('./Renderable/InfoBox');
 import Severity = require('./Renderable/Severity');
@@ -65,7 +65,7 @@ class Router {
             content: $('<div class="modal-loading">').append(icon),
             additionalCssClasses: ['install-tool-modal'],
             callback: (currentModal: any): void => {
-              require([requireModule], (aModule: InteractableModuleInterface): void => {
+              require([requireModule], (aModule: AbstractInteractableModule): void => {
                 aModule.initialize(currentModal);
               });
             },
index a983031..7a28d90 100644 (file)
@@ -6,7 +6,7 @@
     can still use the old behaviour.
 </p>
 
-<div class="t3js-features-content" data-features-save-token="{featuresSaveToken}">
+<div class="t3js-module-content" data-features-save-token="{featuresSaveToken}">
     <strong>Available features:</strong>
     <form method="post" class="form-horizontal">
         <f:for each="{features}" as="feature">
index 66ea761..6e3d1a9 100644 (file)
@@ -10,7 +10,7 @@
     Changed values are written to LocalConfiguration.php. The optional file AdditionalConfiguration.php is not controlled by the TYPO3’s core and may override certain settings. Administrators must maintain AdditionalConfiguration.php manually and should be used with caution.
 </p>
 
-<div class="t3js-presets-content" data-presets-activate-token="{presetsActivateToken}" data-presets-content-token="{presetsGetContentToken}">
+<div class="t3js-module-content" data-presets-activate-token="{presetsActivateToken}" data-presets-content-token="{presetsGetContentToken}">
     <form method="post" class="form-horizontal">
         <div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
             <f:for each="{presetFeatures}" as="feature">
diff --git a/typo3/sysext/install/Resources/Public/JavaScript/Module/AbstractInteractableModule.js b/typo3/sysext/install/Resources/Public/JavaScript/Module/AbstractInteractableModule.js
new file mode 100644 (file)
index 0000000..fc43996
--- /dev/null
@@ -0,0 +1,13 @@
+/*
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+define(["require","exports"],function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(){this.selectorModalBody=".t3js-modal-body",this.selectorModalContent=".t3js-module-content"}return t.prototype.getModalBody=function(){return this.findInModal(this.selectorModalBody)},t.prototype.getModuleContent=function(){return this.findInModal(this.selectorModalContent)},t.prototype.findInModal=function(t){return this.currentModal.find(t)},t}();e.AbstractInteractableModule=o});
\ No newline at end of file
index c341971..41ceed3 100644 (file)
@@ -10,4 +10,4 @@
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require","exports","jquery","../Router","./PasswordStrength","TYPO3/CMS/Backend/Notification"],function(t,o,s,e,n,r){"use strict";return new(function(){function t(){this.selectorModalBody=".t3js-modal-body",this.selectorModuleContent=".t3js-module-content",this.selectorChangeForm="#t3js-changeInstallToolPassword-form",this.currentModal={}}return t.prototype.initialize=function(t){var o=this;this.currentModal=t,this.getData(),t.on("submit",this.selectorChangeForm,function(t){t.preventDefault(),o.change()}),t.on("click",".t3-install-form-password-strength",function(t){n.initialize(".t3-install-form-password-strength")})},t.prototype.getData=function(){var t=this.currentModal.find(this.selectorModalBody);s.ajax({url:e.getUrl("changeInstallToolPasswordGetData"),cache:!1,success:function(o){!0===o.success?t.empty().append(o.html):r.error("Something went wrong")},error:function(o){e.handleAjaxError(o,t)}})},t.prototype.change=function(){var t=this,o=this.currentModal.find(this.selectorModalBody),n=this.currentModal.find(this.selectorModuleContent).data("install-tool-token");s.ajax({url:e.getUrl(),method:"POST",data:{install:{action:"changeInstallToolPassword",token:n,password:this.currentModal.find(".t3js-changeInstallToolPassword-password").val(),passwordCheck:this.currentModal.find(".t3js-changeInstallToolPassword-password-check").val()}},cache:!1,success:function(t){!0===t.success&&Array.isArray(t.status)?t.status.forEach(function(t){r.showMessage("",t.message,t.severity)}):r.error("Something went wrong")},error:function(t){e.handleAjaxError(t,o)},complete:function(){t.currentModal.find(".t3js-changeInstallToolPassword-password,.t3js-changeInstallToolPassword-password-check").val("")}})},t}())});
\ No newline at end of file
+var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,o){t.__proto__=o}||function(t,o){for(var n in o)o.hasOwnProperty(n)&&(t[n]=o[n])};return function(o,n){function e(){this.constructor=o}t(o,n),o.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}();define(["require","exports","./AbstractInteractableModule","jquery","../Router","./PasswordStrength","TYPO3/CMS/Backend/Notification"],function(t,o,n,e,s,r,a){"use strict";return new(function(t){function o(){var o=null!==t&&t.apply(this,arguments)||this;return o.selectorChangeForm="#t3js-changeInstallToolPassword-form",o}return __extends(o,t),o.prototype.initialize=function(t){var o=this;this.currentModal=t,this.getData(),t.on("submit",this.selectorChangeForm,function(t){t.preventDefault(),o.change()}),t.on("click",".t3-install-form-password-strength",function(t){r.initialize(".t3-install-form-password-strength")})},o.prototype.getData=function(){var t=this.getModalBody();e.ajax({url:s.getUrl("changeInstallToolPasswordGetData"),cache:!1,success:function(o){!0===o.success?t.empty().append(o.html):a.error("Something went wrong")},error:function(o){s.handleAjaxError(o,t)}})},o.prototype.change=function(){var t=this,o=this.getModalBody(),n=this.getModuleContent().data("install-tool-token");e.ajax({url:s.getUrl(),method:"POST",data:{install:{action:"changeInstallToolPassword",token:n,password:this.findInModal(".t3js-changeInstallToolPassword-password").val(),passwordCheck:this.findInModal(".t3js-changeInstallToolPassword-password-check").val()}},cache:!1,success:function(t){!0===t.success&&Array.isArray(t.status)?t.status.forEach(function(t){a.showMessage("",t.message,t.severity)}):a.error("Something went wrong")},error:function(t){s.handleAjaxError(t,o)},complete:function(){t.findInModal(".t3js-changeInstallToolPassword-password,.t3js-changeInstallToolPassword-password-check").val("")}})},o}(n.AbstractInteractableModule))});
\ No newline at end of file
index 39dd1ab..7237d77 100644 (file)
@@ -10,4 +10,4 @@
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require","exports","jquery","../Router","TYPO3/CMS/Backend/Notification"],function(t,e,r,a,s){"use strict";return new(function(){function t(){this.selectorModalBody=".t3js-modal-body",this.selectorModuleContent=".t3js-module-content",this.selectorClearTrigger=".t3js-clearTables-clear",this.selectorStatsTrigger=".t3js-clearTables-stats",this.selectorOutputContainer=".t3js-clearTables-output",this.selectorStatContainer=".t3js-clearTables-stat-container",this.selectorStatTemplate=".t3js-clearTables-stat-template",this.selectorStatDescription=".t3js-clearTables-stat-description",this.selectorStatRows=".t3js-clearTables-stat-rows",this.selectorStatName=".t3js-clearTables-stat-name",this.currentModal={}}return t.prototype.initialize=function(t){var e=this;this.currentModal=t,this.getStats(),t.on("click",this.selectorStatsTrigger,function(t){t.preventDefault(),r(e.selectorOutputContainer).empty(),e.getStats()}),t.on("click",this.selectorClearTrigger,function(t){var a=r(t.target).closest(e.selectorClearTrigger).data("table");t.preventDefault(),e.clear(a)})},t.prototype.getStats=function(){var t=this,e=this.currentModal.find(this.selectorModalBody);r.ajax({url:a.getUrl("clearTablesStats"),cache:!1,success:function(r){!0===r.success?(e.empty().append(r.html),Array.isArray(r.stats)&&r.stats.length>0&&r.stats.forEach(function(r){if(r.rowCount>0){var a=e.find(t.selectorStatTemplate).clone();a.find(t.selectorStatDescription).text(r.description),a.find(t.selectorStatName).text(r.name),a.find(t.selectorStatRows).text(r.rowCount),a.find(t.selectorClearTrigger).attr("data-table",r.name),e.find(t.selectorStatContainer).append(a.html())}})):s.error("Something went wrong")},error:function(t){a.handleAjaxError(t,e)}})},t.prototype.clear=function(t){var e=this,o=this.currentModal.find(this.selectorModalBody),n=this.currentModal.find(this.selectorModuleContent).data("clear-tables-clear-token");r.ajax({url:a.getUrl(),method:"POST",context:this,data:{install:{action:"clearTablesClear",token:n,table:t}},cache:!1,success:function(t){!0===t.success&&Array.isArray(t.status)?t.status.forEach(function(t){s.success(t.message)}):s.error("Something went wrong"),e.getStats()},error:function(t){a.handleAjaxError(t,o)}})},t}())});
\ No newline at end of file
+var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function a(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(a.prototype=r.prototype,new a)}}();define(["require","exports","./AbstractInteractableModule","jquery","../Router","TYPO3/CMS/Backend/Notification"],function(t,e,r,a,s,o){"use strict";return new(function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.selectorClearTrigger=".t3js-clearTables-clear",e.selectorStatsTrigger=".t3js-clearTables-stats",e.selectorOutputContainer=".t3js-clearTables-output",e.selectorStatContainer=".t3js-clearTables-stat-container",e.selectorStatTemplate=".t3js-clearTables-stat-template",e.selectorStatDescription=".t3js-clearTables-stat-description",e.selectorStatRows=".t3js-clearTables-stat-rows",e.selectorStatName=".t3js-clearTables-stat-name",e}return __extends(e,t),e.prototype.initialize=function(t){var e=this;this.currentModal=t,this.getStats(),t.on("click",this.selectorStatsTrigger,function(t){t.preventDefault(),a(e.selectorOutputContainer).empty(),e.getStats()}),t.on("click",this.selectorClearTrigger,function(t){var r=a(t.target).closest(e.selectorClearTrigger).data("table");t.preventDefault(),e.clear(r)})},e.prototype.getStats=function(){var t=this,e=this.getModalBody();a.ajax({url:s.getUrl("clearTablesStats"),cache:!1,success:function(r){!0===r.success?(e.empty().append(r.html),Array.isArray(r.stats)&&r.stats.length>0&&r.stats.forEach(function(r){if(r.rowCount>0){var a=e.find(t.selectorStatTemplate).clone();a.find(t.selectorStatDescription).text(r.description),a.find(t.selectorStatName).text(r.name),a.find(t.selectorStatRows).text(r.rowCount),a.find(t.selectorClearTrigger).attr("data-table",r.name),e.find(t.selectorStatContainer).append(a.html())}})):o.error("Something went wrong")},error:function(t){s.handleAjaxError(t,e)}})},e.prototype.clear=function(t){var e=this,r=this.getModalBody(),n=this.getModuleContent().data("clear-tables-clear-token");a.ajax({url:s.getUrl(),method:"POST",context:this,data:{install:{action:"clearTablesClear",token:n,table:t}},cache:!1,success:function(t){!0===t.success&&Array.isArray(t.status)?t.status.forEach(function(t){o.success(t.message)}):o.error("Something went wrong"),e.getStats()},error:function(t){s.handleAjaxError(t,r)}})},e}(r.AbstractInteractableModule))});
\ No newline at end of file
index d7d7a9d..074e368 100644 (file)
@@ -10,4 +10,4 @@
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require","exports","jquery","../Router","TYPO3/CMS/Backend/Notification"],function(t,e,r,o,s){"use strict";return new(function(){function t(){this.selectorModalBody=".t3js-modal-body",this.selectorModuleContent=".t3js-module-content",this.selectorDeleteTrigger=".t3js-clearTypo3temp-delete",this.selectorOutputContainer=".t3js-clearTypo3temp-output",this.selectorStatContainer=".t3js-clearTypo3temp-stat-container",this.selectorStatsTrigger=".t3js-clearTypo3temp-stats",this.selectorStatTemplate=".t3js-clearTypo3temp-stat-template",this.selectorStatNumberOfFiles=".t3js-clearTypo3temp-stat-numberOfFiles",this.selectorStatDirectory=".t3js-clearTypo3temp-stat-directory"}return t.prototype.initialize=function(t){var e=this;this.currentModal=t,this.getStats(),t.on("click",this.selectorStatsTrigger,function(t){t.preventDefault(),r(e.selectorOutputContainer).empty(),e.getStats()}),t.on("click",this.selectorDeleteTrigger,function(t){var o=r(t.currentTarget).data("folder"),s=r(t.currentTarget).data("storage-uid");t.preventDefault(),e.delete(o,s)})},t.prototype.getStats=function(){var t=this,e=this.currentModal.find(this.selectorModalBody);r.ajax({url:o.getUrl("clearTypo3tempFilesStats"),cache:!1,success:function(r){!0===r.success?(e.empty().append(r.html),Array.isArray(r.stats)&&r.stats.length>0&&r.stats.forEach(function(r){if(r.numberOfFiles>0){var o=e.find(t.selectorStatTemplate).clone();o.find(t.selectorStatNumberOfFiles).text(r.numberOfFiles),o.find(t.selectorStatDirectory).text(r.directory),o.find(t.selectorDeleteTrigger).attr("data-folder",r.directory),o.find(t.selectorDeleteTrigger).attr("data-storage-uid",r.storageUid),e.find(t.selectorStatContainer).append(o.html())}})):s.error("Something went wrong")},error:function(t){o.handleAjaxError(t,e)}})},t.prototype.delete=function(t,e){var a=this,i=this.currentModal.find(this.selectorModalBody),n=this.currentModal.find(this.selectorModuleContent).data("clear-typo3temp-delete-token");r.ajax({method:"POST",url:o.getUrl(),context:this,data:{install:{action:"clearTypo3tempFiles",token:n,folder:t,storageUid:e}},cache:!1,success:function(t){!0===t.success&&Array.isArray(t.status)?(t.status.forEach(function(t){s.success(t.message)}),a.getStats()):s.error("Something went wrong")},error:function(t){o.handleAjaxError(t,i)}})},t}())});
\ No newline at end of file
+var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function o(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}();define(["require","exports","./AbstractInteractableModule","jquery","../Router","TYPO3/CMS/Backend/Notification"],function(t,e,r,o,a,n){"use strict";return new(function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.selectorDeleteTrigger=".t3js-clearTypo3temp-delete",e.selectorOutputContainer=".t3js-clearTypo3temp-output",e.selectorStatContainer=".t3js-clearTypo3temp-stat-container",e.selectorStatsTrigger=".t3js-clearTypo3temp-stats",e.selectorStatTemplate=".t3js-clearTypo3temp-stat-template",e.selectorStatNumberOfFiles=".t3js-clearTypo3temp-stat-numberOfFiles",e.selectorStatDirectory=".t3js-clearTypo3temp-stat-directory",e}return __extends(e,t),e.prototype.initialize=function(t){var e=this;this.currentModal=t,this.getStats(),t.on("click",this.selectorStatsTrigger,function(t){t.preventDefault(),o(e.selectorOutputContainer).empty(),e.getStats()}),t.on("click",this.selectorDeleteTrigger,function(t){var r=o(t.currentTarget).data("folder"),a=o(t.currentTarget).data("storage-uid");t.preventDefault(),e.delete(r,a)})},e.prototype.getStats=function(){var t=this,e=this.getModalBody();o.ajax({url:a.getUrl("clearTypo3tempFilesStats"),cache:!1,success:function(r){!0===r.success?(e.empty().append(r.html),Array.isArray(r.stats)&&r.stats.length>0&&r.stats.forEach(function(r){if(r.numberOfFiles>0){var o=e.find(t.selectorStatTemplate).clone();o.find(t.selectorStatNumberOfFiles).text(r.numberOfFiles),o.find(t.selectorStatDirectory).text(r.directory),o.find(t.selectorDeleteTrigger).attr("data-folder",r.directory),o.find(t.selectorDeleteTrigger).attr("data-storage-uid",r.storageUid),e.find(t.selectorStatContainer).append(o.html())}})):n.error("Something went wrong")},error:function(t){a.handleAjaxError(t,e)}})},e.prototype.delete=function(t,e){var r=this,s=this.getModalBody(),c=this.getModuleContent().data("clear-typo3temp-delete-token");o.ajax({method:"POST",url:a.getUrl(),context:this,data:{install:{action:"clearTypo3tempFiles",token:c,folder:t,storageUid:e}},cache:!1,success:function(t){!0===t.success&&Array.isArray(t.status)?(t.status.forEach(function(t){n.success(t.message)}),r.getStats()):n.error("Something went wrong")},error:function(t){a.handleAjaxError(t,s)}})},e}(r.AbstractInteractableModule))});
\ No newline at end of file
index 54d029d..903d078 100644 (file)
@@ -10,4 +10,4 @@
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require","exports","jquery","../Router","../Renderable/FlashMessage","../Renderable/Severity","TYPO3/CMS/Backend/Notification"],function(e,t,o,a,n,i,s){"use strict";return new(function(){function e(){this.actionQueue={coreUpdateIsUpdateAvailable:{loadingMessage:"Checking for possible regular or security update",finishMessage:void 0,nextActionName:void 0},coreUpdateCheckPreConditions:{loadingMessage:"Checking if update is possible",finishMessage:"System can be updated",nextActionName:"coreUpdateDownload"},coreUpdateDownload:{loadingMessage:"Downloading new core",finishMessage:void 0,nextActionName:"coreUpdateVerifyChecksum"},coreUpdateVerifyChecksum:{loadingMessage:"Verifying checksum of downloaded core",finishMessage:void 0,nextActionName:"coreUpdateUnpack"},coreUpdateUnpack:{loadingMessage:"Unpacking core",finishMessage:void 0,nextActionName:"coreUpdateMove"},coreUpdateMove:{loadingMessage:"Moving core",finishMessage:void 0,nextActionName:"coreUpdateActivate"},coreUpdateActivate:{loadingMessage:"Activating core",finishMessage:"Core updated - please reload your browser",nextActionName:void 0}},this.selectorModalBody=".t3js-modal-body",this.selectorOutput=".t3js-coreUpdate-output",this.selectorTemplate=".t3js-coreUpdate-buttonTemplate",this.buttonTemplate=null,this.currentModal=null}return e.prototype.initialize=function(t){var a=this;this.currentModal=t,this.getData().done(function(){var e=t.find(a.selectorTemplate);a.buttonTemplate=e.children().clone()}),t.on("click",".t3js-coreUpdate-init",function(n){n.preventDefault();var i=o(n.target).attr("data-action");t.find(a.selectorOutput).empty(),e.call(i)})},e.prototype.getData=function(){var e=this.currentModal.find(this.selectorModalBody);return o.ajax({url:a.getUrl("coreUpdateGetData"),cache:!1,success:function(t){!0===t.success?e.empty().append(t.html):s.error("Something went wrong")},error:function(t){a.handleAjaxError(t,e)}})},e.prototype.checkForUpdate=function(){this.callAction("coreUpdateIsUpdateAvailable")},e.prototype.updateDevelopment=function(){this.update("development")},e.prototype.updateRegular=function(){this.update("regular")},e.prototype.update=function(e){"development"!==e&&(e="regular"),this.callAction("coreUpdateCheckPreConditions",e)},e.prototype.callAction=function(e,t){var n=this,i={install:{action:e}};void 0!==t&&(i.install.type=t),this.addLoadingMessage(this.actionQueue[e].loadingMessage),o.ajax({url:a.getUrl(),data:i,cache:!1,success:function(o){!0===n.handleResult(o,n.actionQueue[e].finishMessage)&&void 0!==n.actionQueue[e].nextActionName&&n.callAction(n.actionQueue[e].nextActionName,t)},error:function(e){a.handleAjaxError(e,n.currentModal.find(n.selectorModalBody))}})},e.prototype.handleResult=function(e,t){var o=e.success;return this.removeLoadingMessage(),e.status&&"object"==typeof e.status&&this.showStatusMessages(e.status),e.action&&"object"==typeof e.action&&this.showActionButton(e.action),t&&this.addMessage(i.ok,t),o},e.prototype.addLoadingMessage=function(e){var t=n.render(i.loading,e);this.currentModal.find(this.selectorOutput).append(t)},e.prototype.removeLoadingMessage=function(){this.currentModal.find(this.selectorOutput).find(".alert-loading").remove()},e.prototype.showStatusMessages=function(e){var t=this;o.each(e,function(e,o){var a="",n="",i=o.severity;o.title&&(a=o.title),o.message&&(n=o.message),t.addMessage(i,a,n)})},e.prototype.showActionButton=function(e){var t=!1,o=!1;e.title&&(t=e.title),e.action&&(o=e.action);var a=this.buttonTemplate;o&&a.attr("data-action",o),t&&a.text(t),this.currentModal.find(this.selectorOutput).append(a)},e.prototype.addMessage=function(e,t,o){var a=n.render(e,t,o);this.currentModal.find(this.selectorOutput).append(a)},e}())});
\ No newline at end of file
+var __extends=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])};return function(t,o){function a(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(a.prototype=o.prototype,new a)}}();define(["require","exports","./AbstractInteractableModule","jquery","../Router","../Renderable/FlashMessage","../Renderable/Severity","TYPO3/CMS/Backend/Notification"],function(e,t,o,a,n,i,s,r){"use strict";return new(function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.actionQueue={coreUpdateIsUpdateAvailable:{loadingMessage:"Checking for possible regular or security update",finishMessage:void 0,nextActionName:void 0},coreUpdateCheckPreConditions:{loadingMessage:"Checking if update is possible",finishMessage:"System can be updated",nextActionName:"coreUpdateDownload"},coreUpdateDownload:{loadingMessage:"Downloading new core",finishMessage:void 0,nextActionName:"coreUpdateVerifyChecksum"},coreUpdateVerifyChecksum:{loadingMessage:"Verifying checksum of downloaded core",finishMessage:void 0,nextActionName:"coreUpdateUnpack"},coreUpdateUnpack:{loadingMessage:"Unpacking core",finishMessage:void 0,nextActionName:"coreUpdateMove"},coreUpdateMove:{loadingMessage:"Moving core",finishMessage:void 0,nextActionName:"coreUpdateActivate"},coreUpdateActivate:{loadingMessage:"Activating core",finishMessage:"Core updated - please reload your browser",nextActionName:void 0}},t.selectorOutput=".t3js-coreUpdate-output",t.selectorTemplate=".t3js-coreUpdate-buttonTemplate",t.buttonTemplate=null,t}return __extends(t,e),t.prototype.initialize=function(e){var o=this;this.currentModal=e,this.getData().done(function(){var t=e.find(o.selectorTemplate);o.buttonTemplate=t.children().clone()}),e.on("click",".t3js-coreUpdate-init",function(n){n.preventDefault();var i=a(n.target).attr("data-action");e.find(o.selectorOutput).empty(),t.call(i)})},t.prototype.getData=function(){var e=this.getModalBody();return a.ajax({url:n.getUrl("coreUpdateGetData"),cache:!1,success:function(t){!0===t.success?e.empty().append(t.html):r.error("Something went wrong")},error:function(t){n.handleAjaxError(t,e)}})},t.prototype.checkForUpdate=function(){this.callAction("coreUpdateIsUpdateAvailable")},t.prototype.updateDevelopment=function(){this.update("development")},t.prototype.updateRegular=function(){this.update("regular")},t.prototype.update=function(e){"development"!==e&&(e="regular"),this.callAction("coreUpdateCheckPreConditions",e)},t.prototype.callAction=function(e,t){var o=this,i={install:{action:e}};void 0!==t&&(i.install.type=t),this.addLoadingMessage(this.actionQueue[e].loadingMessage),a.ajax({url:n.getUrl(),data:i,cache:!1,success:function(a){!0===o.handleResult(a,o.actionQueue[e].finishMessage)&&void 0!==o.actionQueue[e].nextActionName&&o.callAction(o.actionQueue[e].nextActionName,t)},error:function(e){n.handleAjaxError(e,o.getModalBody())}})},t.prototype.handleResult=function(e,t){var o=e.success;return this.removeLoadingMessage(),e.status&&"object"==typeof e.status&&this.showStatusMessages(e.status),e.action&&"object"==typeof e.action&&this.showActionButton(e.action),t&&this.addMessage(s.ok,t),o},t.prototype.addLoadingMessage=function(e){var t=i.render(s.loading,e);this.findInModal(this.selectorOutput).append(t)},t.prototype.removeLoadingMessage=function(){this.findInModal(this.selectorOutput).find(".alert-loading").remove()},t.prototype.showStatusMessages=function(e){var t=this;a.each(e,function(e,o){var a="",n="",i=o.severity;o.title&&(a=o.title),o.message&&(n=o.message),t.addMessage(i,a,n)})},t.prototype.showActionButton=function(e){var t=!1,o=!1;e.title&&(t=e.title),e.action&&(o=e.action);var a=this.buttonTemplate;o&&a.attr("data-action",o),t&&a.text(t),this.findInModal(this.selectorOutput).append(a)},t.prototype.addMessage=function(e,t,o){var a=i.render(e,t,o);this.findInModal(this.selectorOutput).append(a)},t}(o.AbstractInteractableModule))});
\ No newline at end of file
index 7d85165..c38d792 100644 (file)
@@ -10,4 +10,4 @@
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require","exports","jquery","../Router","./PasswordStrength","TYPO3/CMS/Backend/Notification"],function(t,e,r,n,s,a){"use strict";return new(function(){function t(){this.selectorModalBody=".t3js-modal-body",this.selectorModuleContent=".t3js-module-content",this.selectorCreateForm="#t3js-createAdmin-form"}return t.prototype.initialize=function(t){var e=this;this.currentModal=t,this.getData(),t.on("submit",this.selectorCreateForm,function(t){t.preventDefault(),e.create()}),t.on("click",".t3-install-form-password-strength",function(t){s.initialize(".t3-install-form-password-strength")})},t.prototype.getData=function(){var t=this.currentModal.find(this.selectorModalBody);r.ajax({url:n.getUrl("createAdminGetData"),cache:!1,success:function(e){!0===e.success?t.empty().append(e.html):a.error("Something went wrong")},error:function(e){n.handleAjaxError(e,t)}})},t.prototype.create=function(){var t=this.currentModal.find(this.selectorModalBody),e=this.currentModal.find(this.selectorModuleContent).data("create-admin-token");r.ajax({url:n.getUrl(),method:"POST",data:{install:{action:"createAdmin",token:e,userName:this.currentModal.find(".t3js-createAdmin-user").val(),userPassword:this.currentModal.find(".t3js-createAdmin-password").val(),userPasswordCheck:this.currentModal.find(".t3js-createAdmin-password-check").val(),userSystemMaintainer:this.currentModal.find(".t3js-createAdmin-system-maintainer").is(":checked")?1:0}},cache:!1,success:function(t){!0===t.success&&Array.isArray(t.status)?t.status.forEach(function(t){2===t.severity?a.error(t.message):a.success(t.title)}):a.error("Something went wrong")},error:function(e){n.handleAjaxError(e,t)}}),this.currentModal.find(".t3js-createAdmin-user").val(""),this.currentModal.find(".t3js-createAdmin-password").val(""),this.currentModal.find(".t3js-createAdmin-password-check").val(""),this.currentModal.find(".t3js-createAdmin-system-maintainer").prop("checked",!1)},t}())});
\ No newline at end of file
+var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();define(["require","exports","./AbstractInteractableModule","jquery","../Router","./PasswordStrength","TYPO3/CMS/Backend/Notification"],function(t,e,r,n,a,s,o){"use strict";return new(function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.selectorCreateForm="#t3js-createAdmin-form",e}return __extends(e,t),e.prototype.initialize=function(t){var e=this;this.currentModal=t,this.getData(),t.on("submit",this.selectorCreateForm,function(t){t.preventDefault(),e.create()}),t.on("click",".t3-install-form-password-strength",function(t){s.initialize(".t3-install-form-password-strength")})},e.prototype.getData=function(){var t=this.getModalBody();n.ajax({url:a.getUrl("createAdminGetData"),cache:!1,success:function(e){!0===e.success?t.empty().append(e.html):o.error("Something went wrong")},error:function(e){a.handleAjaxError(e,t)}})},e.prototype.create=function(){var t=this.getModalBody(),e=this.getModuleContent().data("create-admin-token");n.ajax({url:a.getUrl(),method:"POST",data:{install:{action:"createAdmin",token:e,userName:this.findInModal(".t3js-createAdmin-user").val(),userPassword:this.findInModal(".t3js-createAdmin-password").val(),userPasswordCheck:this.findInModal(".t3js-createAdmin-password-check").val(),userSystemMaintainer:this.findInModal(".t3js-createAdmin-system-maintainer").is(":checked")?1:0}},cache:!1,success:function(t){!0===t.success&&Array.isArray(t.status)?t.status.forEach(function(t){2===t.severity?o.error(t.message):o.success(t.title)}):o.error("Something went wrong")},error:function(e){a.handleAjaxError(e,t)}}),this.findInModal(".t3js-createAdmin-user").val(""),this.findInModal(".t3js-createAdmin-password").val(""),this.findInModal(".t3js-createAdmin-password-check").val(""),this.findInModal(".t3js-createAdmin-system-maintainer").prop("checked",!1)},e}(r.AbstractInteractableModule))});
\ No newline at end of file
index 86fcc72..4b12f88 100644 (file)
@@ -10,4 +10,4 @@
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require","exports","jquery","../Router","../Renderable/ProgressBar","../Renderable/InfoBox","../Renderable/Severity","TYPO3/CMS/Backend/Notification"],function(e,t,a,n,s,r,o,i){"use strict";return new(function(){function e(){this.selectorModalBody=".t3js-modal-body",this.selectorModuleContent=".t3js-module-content",this.selectorAnalyzeTrigger=".t3js-databaseAnalyzer-analyze",this.selectorExecuteTrigger=".t3js-databaseAnalyzer-execute",this.selectorOutputContainer=".t3js-databaseAnalyzer-output",this.selectorSuggestionBlock=".t3js-databaseAnalyzer-suggestion-block",this.selectorSuggestionList=".t3js-databaseAnalyzer-suggestion-list",this.selectorSuggestionLineTemplate=".t3js-databaseAnalyzer-suggestion-line-template"}return e.prototype.initialize=function(e){var t=this;this.currentModal=e,this.getData(),e.on("click",".t3js-databaseAnalyzer-suggestion-block-checkbox",function(e){var t=a(e.currentTarget);t.closest("fieldset").find(":checkbox").prop("checked",t.get(0).checked)}),e.on("click",this.selectorAnalyzeTrigger,function(e){e.preventDefault(),t.analyze()}),e.on("click",this.selectorExecuteTrigger,function(e){e.preventDefault(),t.execute()})},e.prototype.getData=function(){var e=this,t=this.currentModal.find(this.selectorModalBody);a.ajax({url:n.getUrl("databaseAnalyzer"),cache:!1,success:function(a){!0===a.success?(t.empty().append(a.html),e.analyze()):i.error("Something went wrong")},error:function(e){n.handleAjaxError(e,t)}})},e.prototype.analyze=function(){var e=this,t=this.currentModal.find(this.selectorModalBody),l=t.find(this.selectorOutputContainer),c=t.find(this.selectorExecuteTrigger),d=t.find(this.selectorAnalyzeTrigger);l.empty().append(s.render(o.loading,"Analyzing current database schema...","")),d.prop("disabled",!0),c.prop("disabled",!0),l.on("change",'input[type="checkbox"]',function(){var e=l.find(":checked").length>0;c.prop("disabled",!e)}),a.ajax({url:n.getUrl("databaseAnalyzerAnalyze"),cache:!1,success:function(a){if(!0===a.success){if(Array.isArray(a.status)&&(l.find(".alert-loading").remove(),a.status.forEach(function(e){var t=r.render(e.severity,e.title,e.message);l.append(t)})),Array.isArray(a.suggestions)){a.suggestions.forEach(function(a){var n=t.find(e.selectorSuggestionBlock).clone();n.removeClass(e.selectorSuggestionBlock.substr(1));var s=a.key;n.find(".t3js-databaseAnalyzer-suggestion-block-legend").text(a.label),n.find(".t3js-databaseAnalyzer-suggestion-block-checkbox").attr("id","t3-install-"+s+"-checkbox"),a.enabled&&n.find(".t3js-databaseAnalyzer-suggestion-block-checkbox").attr("checked","checked"),n.find(".t3js-databaseAnalyzer-suggestion-block-label").attr("for","t3-install-"+s+"-checkbox"),a.children.forEach(function(s){var r=t.find(e.selectorSuggestionLineTemplate).children().clone(),o=s.hash,i=r.find(".t3js-databaseAnalyzer-suggestion-line-checkbox");i.attr("id","t3-install-db-"+o).attr("data-hash",o),a.enabled&&i.attr("checked","checked"),r.find(".t3js-databaseAnalyzer-suggestion-line-label").attr("for","t3-install-db-"+o),r.find(".t3js-databaseAnalyzer-suggestion-line-statement").text(s.statement),void 0!==s.current&&(r.find(".t3js-databaseAnalyzer-suggestion-line-current-value").text(s.current),r.find(".t3js-databaseAnalyzer-suggestion-line-current").show()),void 0!==s.rowCount&&(r.find(".t3js-databaseAnalyzer-suggestion-line-count-value").text(s.rowCount),r.find(".t3js-databaseAnalyzer-suggestion-line-count").show()),n.find(e.selectorSuggestionList).append(r)}),l.append(n.html())});var n=0===l.find(":checked").length;d.prop("disabled",!1),c.prop("disabled",n)}0===a.suggestions.length&&0===a.status.length&&l.append(r.render(o.ok,"Database schema is up to date. Good job!",""))}else i.error("Something went wrong")},error:function(e){n.handleAjaxError(e,t)}})},e.prototype.execute=function(){var e=this,t=this.currentModal.find(this.selectorModalBody),r=this.currentModal.find(this.selectorModuleContent).data("database-analyzer-execute-token"),l=t.find(this.selectorOutputContainer),c=[];l.find(".t3js-databaseAnalyzer-suggestion-line input:checked").each(function(e,t){c.push(a(t).data("hash"))}),l.empty().append(s.render(o.loading,"Executing database updates...","")),t.find(this.selectorExecuteTrigger).prop("disabled",!0),t.find(this.selectorAnalyzeTrigger).prop("disabled",!0),a.ajax({url:n.getUrl(),method:"POST",data:{install:{action:"databaseAnalyzerExecute",token:r,hashes:c}},cache:!1,success:function(t){!0===t.success&&Array.isArray(t.status)&&t.status.forEach(function(e){i.showMessage(e.title,e.message,e.severity)}),e.analyze()},error:function(e){n.handleAjaxError(e,t)}})},e}())});
\ No newline at end of file
+var __extends=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var a in t)t.hasOwnProperty(a)&&(e[a]=t[a])};return function(t,a){function n(){this.constructor=t}e(t,a),t.prototype=null===a?Object.create(a):(n.prototype=a.prototype,new n)}}();define(["require","exports","./AbstractInteractableModule","jquery","../Router","../Renderable/ProgressBar","../Renderable/InfoBox","../Renderable/Severity","TYPO3/CMS/Backend/Notification"],function(e,t,a,n,s,r,o,i,c){"use strict";return new(function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.selectorAnalyzeTrigger=".t3js-databaseAnalyzer-analyze",t.selectorExecuteTrigger=".t3js-databaseAnalyzer-execute",t.selectorOutputContainer=".t3js-databaseAnalyzer-output",t.selectorSuggestionBlock=".t3js-databaseAnalyzer-suggestion-block",t.selectorSuggestionList=".t3js-databaseAnalyzer-suggestion-list",t.selectorSuggestionLineTemplate=".t3js-databaseAnalyzer-suggestion-line-template",t}return __extends(t,e),t.prototype.initialize=function(e){var t=this;this.currentModal=e,this.getData(),e.on("click",".t3js-databaseAnalyzer-suggestion-block-checkbox",function(e){var t=n(e.currentTarget);t.closest("fieldset").find(":checkbox").prop("checked",t.get(0).checked)}),e.on("click",this.selectorAnalyzeTrigger,function(e){e.preventDefault(),t.analyze()}),e.on("click",this.selectorExecuteTrigger,function(e){e.preventDefault(),t.execute()})},t.prototype.getData=function(){var e=this,t=this.getModalBody();n.ajax({url:s.getUrl("databaseAnalyzer"),cache:!1,success:function(a){!0===a.success?(t.empty().append(a.html),e.analyze()):c.error("Something went wrong")},error:function(e){s.handleAjaxError(e,t)}})},t.prototype.analyze=function(){var e=this,t=this.getModalBody(),a=t.find(this.selectorOutputContainer),l=t.find(this.selectorExecuteTrigger),d=t.find(this.selectorAnalyzeTrigger);a.empty().append(r.render(i.loading,"Analyzing current database schema...","")),d.prop("disabled",!0),l.prop("disabled",!0),a.on("change",'input[type="checkbox"]',function(){var e=a.find(":checked").length>0;l.prop("disabled",!e)}),n.ajax({url:s.getUrl("databaseAnalyzerAnalyze"),cache:!1,success:function(n){if(!0===n.success){if(Array.isArray(n.status)&&(a.find(".alert-loading").remove(),n.status.forEach(function(e){var t=o.render(e.severity,e.title,e.message);a.append(t)})),Array.isArray(n.suggestions)){n.suggestions.forEach(function(n){var s=t.find(e.selectorSuggestionBlock).clone();s.removeClass(e.selectorSuggestionBlock.substr(1));var r=n.key;s.find(".t3js-databaseAnalyzer-suggestion-block-legend").text(n.label),s.find(".t3js-databaseAnalyzer-suggestion-block-checkbox").attr("id","t3-install-"+r+"-checkbox"),n.enabled&&s.find(".t3js-databaseAnalyzer-suggestion-block-checkbox").attr("checked","checked"),s.find(".t3js-databaseAnalyzer-suggestion-block-label").attr("for","t3-install-"+r+"-checkbox"),n.children.forEach(function(a){var r=t.find(e.selectorSuggestionLineTemplate).children().clone(),o=a.hash,i=r.find(".t3js-databaseAnalyzer-suggestion-line-checkbox");i.attr("id","t3-install-db-"+o).attr("data-hash",o),n.enabled&&i.attr("checked","checked"),r.find(".t3js-databaseAnalyzer-suggestion-line-label").attr("for","t3-install-db-"+o),r.find(".t3js-databaseAnalyzer-suggestion-line-statement").text(a.statement),void 0!==a.current&&(r.find(".t3js-databaseAnalyzer-suggestion-line-current-value").text(a.current),r.find(".t3js-databaseAnalyzer-suggestion-line-current").show()),void 0!==a.rowCount&&(r.find(".t3js-databaseAnalyzer-suggestion-line-count-value").text(a.rowCount),r.find(".t3js-databaseAnalyzer-suggestion-line-count").show()),s.find(e.selectorSuggestionList).append(r)}),a.append(s.html())});var s=0===a.find(":checked").length;d.prop("disabled",!1),l.prop("disabled",s)}0===n.suggestions.length&&0===n.status.length&&a.append(o.render(i.ok,"Database schema is up to date. Good job!",""))}else c.error("Something went wrong")},error:function(e){s.handleAjaxError(e,t)}})},t.prototype.execute=function(){var e=this,t=this.getModalBody(),a=this.getModuleContent().data("database-analyzer-execute-token"),o=t.find(this.selectorOutputContainer),l=[];o.find(".t3js-databaseAnalyzer-suggestion-line input:checked").each(function(e,t){l.push(n(t).data("hash"))}),o.empty().append(r.render(i.loading,"Executing database updates...","")),t.find(this.selectorExecuteTrigger).prop("disabled",!0),t.find(this.selectorAnalyzeTrigger).prop("disabled",!0),n.ajax({url:s.getUrl(),method:"POST",data:{install:{action:"databaseAnalyzerExecute",token:a,hashes:l}},cache:!1,success:function(t){!0===t.success&&Array.isArray(t.status)&&t.status.forEach(function(e){c.showMessage(e.title,e.message,e.severity)}),e.analyze()},error:function(e){s.handleAjaxError(e,t)}})},t}(a.AbstractInteractableModule))});
\ No newline at end of file
index 4c97fe3..0b6d93e 100644 (file)
@@ -10,4 +10,4 @@
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require","exports","jquery","../Router","../Renderable/ProgressBar","../Renderable/InfoBox","../Renderable/Severity","TYPO3/CMS/Backend/Notification","bootstrap"],function(e,t,r,n,s,o,i,a){"use strict";return new(function(){function e(){this.selectorModalBody=".t3js-modal-body",this.selectorGridderBadge=".t3js-environmentCheck-badge",this.selectorExecuteTrigger=".t3js-environmentCheck-execute",this.selectorOutputContainer=".t3js-environmentCheck-output"}return e.prototype.initialize=function(e){var t=this;this.currentModal=e,this.runTests(),e.on("click",this.selectorExecuteTrigger,function(e){e.preventDefault(),t.runTests()})},e.prototype.runTests=function(){var e=this,t=this.currentModal.find(this.selectorModalBody),c=r(this.selectorGridderBadge);c.text("").hide();var l=s.render(i.loading,"Loading...","");t.find(this.selectorOutputContainer).empty().append(l),r.ajax({url:n.getUrl("environmentCheckGetStatus"),cache:!1,success:function(n){t.empty().append(n.html);var s=0,i=0;!0===n.success&&"object"==typeof n.status?(r.each(n.status,function(r,n){Array.isArray(n)&&n.length>0&&n.forEach(function(r){1===r.severity&&s++,2===r.severity&&i++;var n=o.render(r.severity,r.title,r.message);t.find(e.selectorOutputContainer).append(n)})}),i>0?c.removeClass("label-warning").addClass("label-danger").text(i).show():s>0&&c.removeClass("label-error").addClass("label-warning").text(s).show()):a.error("Something went wrong")},error:function(e){n.handleAjaxError(e,t)}})},e}())});
\ No newline at end of file
+var __extends=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();define(["require","exports","./AbstractInteractableModule","jquery","../Router","../Renderable/ProgressBar","../Renderable/InfoBox","../Renderable/Severity","TYPO3/CMS/Backend/Notification","bootstrap"],function(e,t,r,n,o,s,a,i,c){"use strict";return new(function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.selectorGridderBadge=".t3js-environmentCheck-badge",t.selectorExecuteTrigger=".t3js-environmentCheck-execute",t.selectorOutputContainer=".t3js-environmentCheck-output",t}return __extends(t,e),t.prototype.initialize=function(e){var t=this;this.currentModal=e,this.runTests(),e.on("click",this.selectorExecuteTrigger,function(e){e.preventDefault(),t.runTests()})},t.prototype.runTests=function(){var e=this,t=this.getModalBody(),r=n(this.selectorGridderBadge);r.text("").hide();var u=s.render(i.loading,"Loading...","");t.find(this.selectorOutputContainer).empty().append(u),n.ajax({url:o.getUrl("environmentCheckGetStatus"),cache:!1,success:function(o){t.empty().append(o.html);var s=0,i=0;!0===o.success&&"object"==typeof o.status?(n.each(o.status,function(r,n){Array.isArray(n)&&n.length>0&&n.forEach(function(r){1===r.severity&&s++,2===r.severity&&i++;var n=a.render(r.severity,r.title,r.message);t.find(e.selectorOutputContainer).append(n)})}),i>0?r.removeClass("label-warning").addClass("label-danger").text(i).show():s>0&&r.removeClass("label-error").addClass("label-warning").text(s).show()):c.error("Something went wrong")},error:function(e){o.handleAjaxError(e,t)}})},t}(r.AbstractInteractableModule))});
\ No newline at end of file
index f0ef31c..c2b7c46 100644 (file)
@@ -10,4 +10,4 @@
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require","exports","jquery","../Router","../Renderable/ProgressBar","../Renderable/InfoBox","../Renderable/Severity","TYPO3/CMS/Backend/Notification","bootstrap"],function(e,t,n,o,r,i,s,a){"use strict";return new(function(){function e(){this.selectorModalBody=".t3js-modal-body",this.selectorModuleContent=".t3js-module-content",this.selectorCheckTrigger=".t3js-extensionCompatTester-check",this.selectorUninstallTrigger=".t3js-extensionCompatTester-uninstall",this.selectorOutputContainer=".t3js-extensionCompatTester-output"}return e.prototype.initialize=function(e){var t=this;this.currentModal=e,this.getLoadedExtensionList(),e.on("click",this.selectorCheckTrigger,function(n){e.find(t.selectorUninstallTrigger).hide(),e.find(t.selectorOutputContainer).empty(),t.getLoadedExtensionList()}),e.on("click",this.selectorUninstallTrigger,function(e){t.uninstallExtension(n(e.target).data("extension"))})},e.prototype.getLoadedExtensionList=function(){var e=this;this.currentModal.find(this.selectorCheckTrigger).prop("disabled",!0),this.currentModal.find(".modal-loading").hide();var t=this.currentModal.find(this.selectorModalBody),l=this.currentModal.find(this.selectorOutputContainer),d=r.render(s.loading,"Loading...","");l.append(d),n.ajax({url:o.getUrl("extensionCompatTesterLoadedExtensionList"),cache:!1,success:function(o){t.empty().append(o.html);var l,d,c=e.currentModal.find(e.selectorOutputContainer),u=r.render(s.loading,"Loading...","");if(c.append(u),!0===o.success&&Array.isArray(o.extensions)){n.when((d=[],o.extensions.forEach(function(t){d.push(e.loadExtLocalconf(t))}),n.when.apply(n,d).done(function(){var e=i.render(s.ok,"ext_localconf.php of all loaded extensions successfully loaded","");c.append(e)})),(l=[],o.extensions.forEach(function(t){l.push(e.loadExtTables(t))}),n.when.apply(n,l).done(function(){var e=i.render(s.ok,"ext_tables.php of all loaded extensions successfully loaded","");c.append(e)}))).fail(function(n){var o=i.render(s.error,"Loading "+n.scope+' of extension "'+n.extension+'" failed');c.append(o),t.find(e.selectorUninstallTrigger).text('Unload extension "'+n.extension+'"').attr("data-extension",n.extension).show()}).always(function(){c.find(".alert-loading").remove(),e.currentModal.find(e.selectorCheckTrigger).prop("disabled",!1)})}else a.error("Something went wrong")},error:function(e){o.handleAjaxError(e,t)}})},e.prototype.loadExtLocalconf=function(e){var t=this.currentModal.find(this.selectorModuleContent).data("extension-compat-tester-load-ext_localconf-token");return n.ajax({url:o.getUrl(),method:"POST",cache:!1,data:{install:{action:"extensionCompatTesterLoadExtLocalconf",token:t,extension:e}}}).promise().then(null,function(){throw{scope:"ext_localconf.php",extension:e}})},e.prototype.loadExtTables=function(e){var t=this.currentModal.find(this.selectorModuleContent).data("extension-compat-tester-load-ext_tables-token");return n.ajax({url:o.getUrl(),method:"POST",cache:!1,data:{install:{action:"extensionCompatTesterLoadExtTables",token:t,extension:e}}}).promise().then(null,function(){throw{scope:"ext_tables.php",extension:e}})},e.prototype.uninstallExtension=function(e){var t=this,l=this.currentModal.find(this.selectorModuleContent).data("extension-compat-tester-uninstall-extension-token"),d=this.currentModal.find(this.selectorModalBody),c=n(this.selectorOutputContainer),u=r.render(s.loading,"Loading...","");c.append(u),n.ajax({url:o.getUrl(),cache:!1,method:"POST",data:{install:{action:"extensionCompatTesterUninstallExtension",token:l,extension:e}},success:function(e){e.success?(Array.isArray(e.status)&&e.status.forEach(function(e){var n=i.render(e.severity,e.title,e.message);d.find(t.selectorOutputContainer).empty().append(n)}),n(t.selectorUninstallTrigger).hide(),t.getLoadedExtensionList()):a.error("Something went wrong")},error:function(e){o.handleAjaxError(e,d)}})},e}())});
\ No newline at end of file
+var __extends=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function o(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}();define(["require","exports","./AbstractInteractableModule","jquery","../Router","../Renderable/ProgressBar","../Renderable/InfoBox","../Renderable/Severity","TYPO3/CMS/Backend/Notification","bootstrap"],function(e,t,n,o,r,a,i,s,l){"use strict";return new(function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.selectorCheckTrigger=".t3js-extensionCompatTester-check",t.selectorUninstallTrigger=".t3js-extensionCompatTester-uninstall",t.selectorOutputContainer=".t3js-extensionCompatTester-output",t}return __extends(t,e),t.prototype.initialize=function(e){var t=this;this.currentModal=e,this.getLoadedExtensionList(),e.on("click",this.selectorCheckTrigger,function(n){e.find(t.selectorUninstallTrigger).hide(),e.find(t.selectorOutputContainer).empty(),t.getLoadedExtensionList()}),e.on("click",this.selectorUninstallTrigger,function(e){t.uninstallExtension(o(e.target).data("extension"))})},t.prototype.getLoadedExtensionList=function(){var e=this;this.findInModal(this.selectorCheckTrigger).prop("disabled",!0),this.findInModal(".modal-loading").hide();var t=this.getModalBody(),n=this.findInModal(this.selectorOutputContainer),c=a.render(s.loading,"Loading...","");n.append(c),o.ajax({url:r.getUrl("extensionCompatTesterLoadedExtensionList"),cache:!1,success:function(n){t.empty().append(n.html);var r,c,d=e.findInModal(e.selectorOutputContainer),p=a.render(s.loading,"Loading...","");if(d.append(p),!0===n.success&&Array.isArray(n.extensions)){o.when((c=[],n.extensions.forEach(function(t){c.push(e.loadExtLocalconf(t))}),o.when.apply(o,c).done(function(){var e=i.render(s.ok,"ext_localconf.php of all loaded extensions successfully loaded","");d.append(e)})),(r=[],n.extensions.forEach(function(t){r.push(e.loadExtTables(t))}),o.when.apply(o,r).done(function(){var e=i.render(s.ok,"ext_tables.php of all loaded extensions successfully loaded","");d.append(e)}))).fail(function(n){var o=i.render(s.error,"Loading "+n.scope+' of extension "'+n.extension+'" failed');d.append(o),t.find(e.selectorUninstallTrigger).text('Unload extension "'+n.extension+'"').attr("data-extension",n.extension).show()}).always(function(){d.find(".alert-loading").remove(),e.findInModal(e.selectorCheckTrigger).prop("disabled",!1)})}else l.error("Something went wrong")},error:function(e){r.handleAjaxError(e,t)}})},t.prototype.loadExtLocalconf=function(e){var t=this.getModuleContent().data("extension-compat-tester-load-ext_localconf-token");return o.ajax({url:r.getUrl(),method:"POST",cache:!1,data:{install:{action:"extensionCompatTesterLoadExtLocalconf",token:t,extension:e}}}).promise().then(null,function(){throw{scope:"ext_localconf.php",extension:e}})},t.prototype.loadExtTables=function(e){var t=this.getModuleContent().data("extension-compat-tester-load-ext_tables-token");return o.ajax({url:r.getUrl(),method:"POST",cache:!1,data:{install:{action:"extensionCompatTesterLoadExtTables",token:t,extension:e}}}).promise().then(null,function(){throw{scope:"ext_tables.php",extension:e}})},t.prototype.uninstallExtension=function(e){var t=this,n=this.getModuleContent().data("extension-compat-tester-uninstall-extension-token"),c=this.getModalBody(),d=o(this.selectorOutputContainer),p=a.render(s.loading,"Loading...","");d.append(p),o.ajax({url:r.getUrl(),cache:!1,method:"POST",data:{install:{action:"extensionCompatTesterUninstallExtension",token:n,extension:e}},success:function(e){e.success?(Array.isArray(e.status)&&e.status.forEach(function(e){var n=i.render(e.severity,e.title,e.message);c.find(t.selectorOutputContainer).empty().append(n)}),o(t.selectorUninstallTrigger).hide(),t.getLoadedExtensionList()):l.error("Something went wrong")},error:function(e){r.handleAjaxError(e,c)}})},t}(n.AbstractInteractableModule))});
\ No newline at end of file
index 6d66046..3373470 100644 (file)
@@ -10,4 +10,4 @@
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require","exports","jquery","../Router","TYPO3/CMS/Backend/Notification","bootstrap"],function(t,e,a,r,n){"use strict";return new(function(){function e(){this.selectorModalBody=".t3js-modal-body",this.selectorModuleContent=".t3js-module-content",this.selectorFormListener=".t3js-extensionConfiguration-form",this.selectorSearchInput=".t3js-extensionConfiguration-search"}return e.prototype.initialize=function(e){var r=this;this.currentModal=e,this.getContent(),e.on("keydown",function(t){var a=e.find(r.selectorSearchInput);t.ctrlKey||t.metaKey?"f"===String.fromCharCode(t.which).toLowerCase()&&(t.preventDefault(),a.focus()):27===t.keyCode&&(t.preventDefault(),a.val("").focus())}),e.on("keyup",this.selectorSearchInput,function(n){var i=a(n.target).val(),o=e.find(r.selectorSearchInput);e.find(".search-item").each(function(t,e){var r=a(e);a(":contains("+i+")",r).length>0||a('input[value*="'+i+'"]',r).length>0?r.removeClass("hidden").addClass("searchhit"):r.removeClass("searchhit").addClass("hidden")}),e.find(".searchhit").collapse("show"),t(["jquery.clearable"],function(){o.clearable().focus()})}),e.on("submit",this.selectorFormListener,function(t){t.preventDefault(),r.write(a(t.currentTarget))})},e.prototype.getContent=function(){var t=this,e=this.currentModal.find(this.selectorModalBody);a.ajax({url:r.getUrl("extensionConfigurationGetContent"),cache:!1,success:function(a){!0===a.success&&(Array.isArray(a.status)&&a.status.forEach(function(t){n.success(t.title,t.message)}),e.html(a.html),t.initializeWrap())},error:function(t){r.handleAjaxError(t,e)}})},e.prototype.write=function(t){var e=this.currentModal.find(this.selectorModalBody),i=this.currentModal.find(this.selectorModuleContent).data("extension-configuration-write-token"),o={};a.each(t.serializeArray(),function(t,e){o[e.name]=e.value}),a.ajax({url:r.getUrl(),method:"POST",data:{install:{token:i,action:"extensionConfigurationWrite",extensionKey:t.attr("data-extensionKey"),extensionConfiguration:o}},success:function(t){!0===t.success&&Array.isArray(t.status)?t.status.forEach(function(t){n.showMessage(t.title,t.message,t.severity)}):n.error("Something went wrong")},error:function(t){r.handleAjaxError(t,e)}}).always(function(){})},e.prototype.initializeWrap=function(){this.currentModal.find(".t3js-emconf-offset").each(function(t,e){var r=a(e),n=r.parent(),i=r.attr("id"),o=r.attr("value").split(",");r.attr("data-offsetfield-x","#"+i+"_offset_x").attr("data-offsetfield-y","#"+i+"_offset_y").wrap('<div class="hidden"></div>');var s=a("<div>",{class:"form-multigroup-item"}).append(a("<div>",{class:"input-group"}).append(a("<div>",{class:"input-group-addon"}).text("x"),a("<input>",{id:i+"_offset_x",class:"form-control t3js-emconf-offsetfield","data-target":"#"+i,value:a.trim(o[0])}))),d=a("<div>",{class:"form-multigroup-item"}).append(a("<div>",{class:"input-group"}).append(a("<div>",{class:"input-group-addon"}).text("y"),a("<input>",{id:i+"_offset_y",class:"form-control t3js-emconf-offsetfield","data-target":"#"+i,value:a.trim(o[1])}))),f=a("<div>",{class:"form-multigroup-wrap"}).append(s,d);n.append(f),n.find(".t3js-emconf-offsetfield").keyup(function(t){var e=n.find(a(t.currentTarget).data("target"));e.val(n.find(e.data("offsetfield-x")).val()+","+n.find(e.data("offsetfield-y")).val())})}),this.currentModal.find(".t3js-emconf-wrap").each(function(t,e){var r=a(e),n=r.parent(),i=r.attr("id"),o=r.attr("value").split("|");r.attr("data-wrapfield-start","#"+i+"_wrap_start").attr("data-wrapfield-end","#"+i+"_wrap_end").wrap('<div class="hidden"></div>');var s=a("<div>",{class:"form-multigroup-wrap"}).append(a("<div>",{class:"form-multigroup-item"}).append(a("<input>",{id:i+"_wrap_start",class:"form-control t3js-emconf-wrapfield","data-target":"#"+i,value:a.trim(o[0])})),a("<div>",{class:"form-multigroup-item"}).append(a("<input>",{id:i+"_wrap_end",class:"form-control t3js-emconf-wrapfield","data-target":"#"+i,value:a.trim(o[1])})));n.append(s),n.find(".t3js-emconf-wrapfield").keyup(function(t){var e=n.find(a(t.currentTarget).data("target"));e.val(n.find(e.data("wrapfield-start")).val()+"|"+n.find(e.data("wrapfield-end")).val())})})},e}())});
\ No newline at end of file
+var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)e.hasOwnProperty(a)&&(t[a]=e[a])};return function(e,a){function n(){this.constructor=e}t(e,a),e.prototype=null===a?Object.create(a):(n.prototype=a.prototype,new n)}}();define(["require","exports","./AbstractInteractableModule","jquery","../Router","TYPO3/CMS/Backend/Notification","bootstrap"],function(t,e,a,n,r,i){"use strict";return new(function(e){function a(){var t=null!==e&&e.apply(this,arguments)||this;return t.selectorFormListener=".t3js-extensionConfiguration-form",t.selectorSearchInput=".t3js-extensionConfiguration-search",t}return __extends(a,e),a.prototype.initialize=function(e){var a=this;this.currentModal=e,this.getContent(),e.on("keydown",function(t){var n=e.find(a.selectorSearchInput);t.ctrlKey||t.metaKey?"f"===String.fromCharCode(t.which).toLowerCase()&&(t.preventDefault(),n.focus()):27===t.keyCode&&(t.preventDefault(),n.val("").focus())}),e.on("keyup",this.selectorSearchInput,function(r){var i=n(r.target).val(),o=e.find(a.selectorSearchInput);e.find(".search-item").each(function(t,e){var a=n(e);n(":contains("+i+")",a).length>0||n('input[value*="'+i+'"]',a).length>0?a.removeClass("hidden").addClass("searchhit"):a.removeClass("searchhit").addClass("hidden")}),e.find(".searchhit").collapse("show"),t(["jquery.clearable"],function(){o.clearable().focus()})}),e.on("submit",this.selectorFormListener,function(t){t.preventDefault(),a.write(n(t.currentTarget))})},a.prototype.getContent=function(){var t=this,e=this.getModalBody();n.ajax({url:r.getUrl("extensionConfigurationGetContent"),cache:!1,success:function(a){!0===a.success&&(Array.isArray(a.status)&&a.status.forEach(function(t){i.success(t.title,t.message)}),e.html(a.html),t.initializeWrap())},error:function(t){r.handleAjaxError(t,e)}})},a.prototype.write=function(t){var e=this.getModalBody(),a=this.getModuleContent().data("extension-configuration-write-token"),o={};n.each(t.serializeArray(),function(t,e){o[e.name]=e.value}),n.ajax({url:r.getUrl(),method:"POST",data:{install:{token:a,action:"extensionConfigurationWrite",extensionKey:t.attr("data-extensionKey"),extensionConfiguration:o}},success:function(t){!0===t.success&&Array.isArray(t.status)?t.status.forEach(function(t){i.showMessage(t.title,t.message,t.severity)}):i.error("Something went wrong")},error:function(t){r.handleAjaxError(t,e)}}).always(function(){})},a.prototype.initializeWrap=function(){this.findInModal(".t3js-emconf-offset").each(function(t,e){var a=n(e),r=a.parent(),i=a.attr("id"),o=a.attr("value").split(",");a.attr("data-offsetfield-x","#"+i+"_offset_x").attr("data-offsetfield-y","#"+i+"_offset_y").wrap('<div class="hidden"></div>');var s=n("<div>",{class:"form-multigroup-item"}).append(n("<div>",{class:"input-group"}).append(n("<div>",{class:"input-group-addon"}).text("x"),n("<input>",{id:i+"_offset_x",class:"form-control t3js-emconf-offsetfield","data-target":"#"+i,value:n.trim(o[0])}))),f=n("<div>",{class:"form-multigroup-item"}).append(n("<div>",{class:"input-group"}).append(n("<div>",{class:"input-group-addon"}).text("y"),n("<input>",{id:i+"_offset_y",class:"form-control t3js-emconf-offsetfield","data-target":"#"+i,value:n.trim(o[1])}))),c=n("<div>",{class:"form-multigroup-wrap"}).append(s,f);r.append(c),r.find(".t3js-emconf-offsetfield").keyup(function(t){var e=r.find(n(t.currentTarget).data("target"));e.val(r.find(e.data("offsetfield-x")).val()+","+r.find(e.data("offsetfield-y")).val())})}),this.findInModal(".t3js-emconf-wrap").each(function(t,e){var a=n(e),r=a.parent(),i=a.attr("id"),o=a.attr("value").split("|");a.attr("data-wrapfield-start","#"+i+"_wrap_start").attr("data-wrapfield-end","#"+i+"_wrap_end").wrap('<div class="hidden"></div>');var s=n("<div>",{class:"form-multigroup-wrap"}).append(n("<div>",{class:"form-multigroup-item"}).append(n("<input>",{id:i+"_wrap_start",class:"form-control t3js-emconf-wrapfield","data-target":"#"+i,value:n.trim(o[0])})),n("<div>",{class:"form-multigroup-item"}).append(n("<input>",{id:i+"_wrap_end",class:"form-control t3js-emconf-wrapfield","data-target":"#"+i,value:n.trim(o[1])})));r.append(s),r.find(".t3js-emconf-wrapfield").keyup(function(t){var e=r.find(n(t.currentTarget).data("target"));e.val(r.find(e.data("wrapfield-start")).val()+"|"+r.find(e.data("wrapfield-end")).val())})})},a}(a.AbstractInteractableModule))});
\ No newline at end of file
index a7f902a..40cc055 100644 (file)
@@ -10,4 +10,4 @@
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require","exports","jquery","../Ajax/AjaxQueue","../Router","TYPO3/CMS/Backend/Notification","bootstrap"],function(e,n,t,s,i,a){"use strict";return new(function(){function e(){this.selectorModalBody=".t3js-modal-body",this.selectorModuleContent=".t3js-module-content",this.listOfAffectedRestFileHashes=[],this.selectorExtensionContainer=".t3js-extensionScanner-extension",this.selectorNumberOfFiles=".t3js-extensionScanner-number-of-files",this.selectorScanSingleTrigger=".t3js-extensionScanner-scan-single"}return e.prototype.initialize=function(e){var n=this;this.currentModal=e,this.getData(),e.on("show.bs.collapse",this.selectorExtensionContainer,function(e){var s=t(e.currentTarget);if(void 0===s.data("scanned")){var i=s.data("extension");n.scanSingleExtension(i),s.data("scanned",!0)}}).on("click",this.selectorScanSingleTrigger,function(e){e.preventDefault();var s=t(e.currentTarget).closest(n.selectorExtensionContainer).data("extension");n.scanSingleExtension(s)}).on("click",".t3js-extensionScanner-scan-all",function(t){t.preventDefault();var s=e.find(n.selectorExtensionContainer);n.scanAll(s)})},e.prototype.getData=function(){var e=this.currentModal.find(this.selectorModalBody);s.add({url:i.getUrl("extensionScannerGetData"),cache:!1,success:function(n){!0===n.success?e.empty().append(n.html):a.error("Something went wrong")},error:function(n){i.handleAjaxError(n,e)}})},e.prototype.getExtensionSelector=function(e){return this.selectorExtensionContainer+"-"+e},e.prototype.scanAll=function(e){var n=this;this.currentModal.find(this.selectorExtensionContainer).removeClass("panel-danger panel-warning panel-success").find(".panel-progress-bar").css("width",0).attr("aria-valuenow",0).find("span").text("0%"),this.setProgressForAll(),e.each(function(e,s){var i=t(s),a=i.data("extension");n.scanSingleExtension(a),i.data("scanned",!0)})},e.prototype.setStatusMessageForScan=function(e,n,t){this.currentModal.find(this.getExtensionSelector(e)).find(this.selectorNumberOfFiles).text("Checked "+n+" of "+t+" files")},e.prototype.setProgressForScan=function(e,n,t){var s=n/t*100;this.currentModal.find(this.getExtensionSelector(e)).find(".panel-progress-bar").css("width",s+"%").attr("aria-valuenow",s).find("span").text(s+"%")},e.prototype.setProgressForAll=function(){var e=this.currentModal.find(this.selectorExtensionContainer).length,n=this.currentModal.find(this.selectorExtensionContainer+".t3js-extensionscan-finished.panel-success").length+this.currentModal.find(this.selectorExtensionContainer+".t3js-extensionscan-finished.panel-warning").length+this.currentModal.find(this.selectorExtensionContainer+".t3js-extensionscan-finished.panel-danger").length,t=n/e*100,o=this.currentModal.find(this.selectorModalBody);this.currentModal.find(".t3js-extensionScanner-progress-all-extension .progress-bar").css("width",t+"%").attr("aria-valuenow",t).find("span").text(n+" of "+e+" scanned"),n===e&&(a.success("Scan finished","All extensions have been scanned"),s.add({url:i.getUrl(),method:"POST",data:{install:{action:"extensionScannerMarkFullyScannedRestFiles",token:this.currentModal.find(this.selectorModuleContent).data("extension-scanner-mark-fully-scanned-rest-files-token"),hashes:this.uniqueArray(this.listOfAffectedRestFileHashes)}},cache:!1,success:function(e){!0===e.success&&a.success("Marked not affected files","Marked "+e.markedAsNotAffected+" ReST files as not affected.")},error:function(e){i.handleAjaxError(e,o)}}))},e.prototype.uniqueArray=function(e){return e.filter(function(e,n,t){return t.indexOf(e)===n})},e.prototype.scanSingleExtension=function(e){var n=this,o=this.currentModal.find(this.selectorModuleContent).data("extension-scanner-files-token"),r=this.currentModal.find(this.selectorModalBody),l=this.currentModal.find(this.getExtensionSelector(e)),c=!1;l.removeClass("panel-danger panel-warning panel-success t3js-extensionscan-finished"),l.data("hasRun","true"),l.find(".t3js-extensionScanner-scan-single").text("Scanning...").attr("disabled","disabled"),l.find(".t3js-extensionScanner-extension-body-loc").empty().text("0"),l.find(".t3js-extensionScanner-extension-body-ignored-files").empty().text("0"),l.find(".t3js-extensionScanner-extension-body-ignored-lines").empty().text("0"),this.setProgressForAll(),s.add({url:i.getUrl(),method:"POST",data:{install:{action:"extensionScannerFiles",token:o,extension:e}},cache:!1,success:function(o){if(!0===o.success&&Array.isArray(o.files)){var d=o.files.length;if(d>0){n.setStatusMessageForScan(e,0,d),l.find(".t3js-extensionScanner-extension-body").text("");var f=0;o.files.forEach(function(o){s.add({method:"POST",data:{install:{action:"extensionScannerScanFile",token:n.currentModal.find(n.selectorModuleContent).data("extension-scanner-scan-file-token"),extension:e,file:o}},url:i.getUrl(),cache:!1,success:function(s){if(f++,n.setStatusMessageForScan(e,f,d),n.setProgressForScan(e,f,d),s.success&&t.isArray(s.matches)&&s.matches.forEach(function(e){c=!0;var s=r.find("#t3js-extensionScanner-file-hit-template").clone();s.find(".t3js-extensionScanner-hit-file-panel-head").attr("href","#collapse"+e.uniqueId),s.find(".t3js-extensionScanner-hit-file-panel-body").attr("id","collapse"+e.uniqueId),s.find(".t3js-extensionScanner-hit-filename").text(o),s.find(".t3js-extensionScanner-hit-message").text(e.message),"strong"===e.indicator?s.find(".t3js-extensionScanner-hit-file-panel-head .badges").append('<span class="badge" title="Reliable match, false positive unlikely">strong</span>'):s.find(".t3js-extensionScanner-hit-file-panel-head .badges").append('<span class="badge" title="Probable match, but can be a false positive">weak</span>'),!0===e.silenced&&s.find(".t3js-extensionScanner-hit-file-panel-head .badges").append('<span class="badge" title="Match has been annotated by extension author as false positive match">silenced</span>'),s.find(".t3js-extensionScanner-hit-file-lineContent").empty().text(e.lineContent),s.find(".t3js-extensionScanner-hit-file-line").empty().text(e.line+": "),t.isArray(e.restFiles)&&e.restFiles.forEach(function(e){var t=r.find("#t3js-extensionScanner-file-hit-rest-template").clone();t.find(".t3js-extensionScanner-hit-rest-panel-head").attr("href","#collapse"+e.uniqueId),t.find(".t3js-extensionScanner-hit-rest-panel-head .badge").empty().text(e.version),t.find(".t3js-extensionScanner-hit-rest-panel-body").attr("id","collapse"+e.uniqueId),t.find(".t3js-extensionScanner-hit-rest-headline").text(e.headline),t.find(".t3js-extensionScanner-hit-rest-body").text(e.content),t.addClass("panel-"+e.class),s.find(".t3js-extensionScanner-hit-file-rest-container").append(t),n.listOfAffectedRestFileHashes.push(e.file_hash)});var i=s.find(".panel-breaking",".t3js-extensionScanner-hit-file-rest-container").length>0?"panel-danger":"panel-warning";s.addClass(i),l.find(".t3js-extensionScanner-extension-body").removeClass("hide").append(s),"panel-danger"===i&&l.removeClass("panel-warning").addClass(i),"panel-warning"!==i||l.hasClass("panel-danger")||l.addClass(i)}),s.success){var i=parseInt(l.find(".t3js-extensionScanner-extension-body-loc").text(),10);if(l.find(".t3js-extensionScanner-extension-body-loc").empty().text(i+s.effectiveCodeLines),s.isFileIgnored){var a=parseInt(l.find(".t3js-extensionScanner-extension-body-ignored-files").text(),10);l.find(".t3js-extensionScanner-extension-body-ignored-files").empty().text(a+1)}var h=parseInt(l.find(".t3js-extensionScanner-extension-body-ignored-lines").text(),10);l.find(".t3js-extensionScanner-extension-body-ignored-lines").empty().text(h+s.ignoredLines)}f===d&&(c||l.addClass("panel-success"),l.addClass("t3js-extensionscan-finished"),n.setProgressForAll(),l.find(".t3js-extensionScanner-scan-single").text("Rescan").attr("disabled",null))},error:function(t){f+=1,n.setStatusMessageForScan(e,f,d),n.setProgressForScan(e,f,d),n.setProgressForAll(),a.error("Oops, an error occurred","Please look at the console output for details"),console.error(t)}})})}else a.warning("No files found","The extension EXT:"+e+" contains no files we can scan")}else a.error("Oops, an error occurred","Please look at the console output for details"),console.error(o)},error:function(e){i.handleAjaxError(e,r)}})},e}())});
\ No newline at end of file
+var __extends=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)n.hasOwnProperty(t)&&(e[t]=n[t])};return function(n,t){function s(){this.constructor=n}e(n,t),n.prototype=null===t?Object.create(t):(s.prototype=t.prototype,new s)}}();define(["require","exports","./AbstractInteractableModule","jquery","../Ajax/AjaxQueue","../Router","TYPO3/CMS/Backend/Notification","bootstrap"],function(e,n,t,s,i,a,o){"use strict";return new(function(e){function n(){var n=null!==e&&e.apply(this,arguments)||this;return n.listOfAffectedRestFileHashes=[],n.selectorExtensionContainer=".t3js-extensionScanner-extension",n.selectorNumberOfFiles=".t3js-extensionScanner-number-of-files",n.selectorScanSingleTrigger=".t3js-extensionScanner-scan-single",n}return __extends(n,e),n.prototype.initialize=function(e){var n=this;this.currentModal=e,this.getData(),e.on("show.bs.collapse",this.selectorExtensionContainer,function(e){var t=s(e.currentTarget);if(void 0===t.data("scanned")){var i=t.data("extension");n.scanSingleExtension(i),t.data("scanned",!0)}}).on("click",this.selectorScanSingleTrigger,function(e){e.preventDefault();var t=s(e.currentTarget).closest(n.selectorExtensionContainer).data("extension");n.scanSingleExtension(t)}).on("click",".t3js-extensionScanner-scan-all",function(t){t.preventDefault();var s=e.find(n.selectorExtensionContainer);n.scanAll(s)})},n.prototype.getData=function(){var e=this.getModalBody();i.add({url:a.getUrl("extensionScannerGetData"),cache:!1,success:function(n){!0===n.success?e.empty().append(n.html):o.error("Something went wrong")},error:function(n){a.handleAjaxError(n,e)}})},n.prototype.getExtensionSelector=function(e){return this.selectorExtensionContainer+"-"+e},n.prototype.scanAll=function(e){var n=this;this.findInModal(this.selectorExtensionContainer).removeClass("panel-danger panel-warning panel-success").find(".panel-progress-bar").css("width",0).attr("aria-valuenow",0).find("span").text("0%"),this.setProgressForAll(),e.each(function(e,t){var i=s(t),a=i.data("extension");n.scanSingleExtension(a),i.data("scanned",!0)})},n.prototype.setStatusMessageForScan=function(e,n,t){this.findInModal(this.getExtensionSelector(e)).find(this.selectorNumberOfFiles).text("Checked "+n+" of "+t+" files")},n.prototype.setProgressForScan=function(e,n,t){var s=n/t*100;this.findInModal(this.getExtensionSelector(e)).find(".panel-progress-bar").css("width",s+"%").attr("aria-valuenow",s).find("span").text(s+"%")},n.prototype.setProgressForAll=function(){var e=this.findInModal(this.selectorExtensionContainer).length,n=this.findInModal(this.selectorExtensionContainer+".t3js-extensionscan-finished.panel-success").length+this.findInModal(this.selectorExtensionContainer+".t3js-extensionscan-finished.panel-warning").length+this.findInModal(this.selectorExtensionContainer+".t3js-extensionscan-finished.panel-danger").length,t=n/e*100,s=this.getModalBody();this.findInModal(".t3js-extensionScanner-progress-all-extension .progress-bar").css("width",t+"%").attr("aria-valuenow",t).find("span").text(n+" of "+e+" scanned"),n===e&&(o.success("Scan finished","All extensions have been scanned"),i.add({url:a.getUrl(),method:"POST",data:{install:{action:"extensionScannerMarkFullyScannedRestFiles",token:this.getModuleContent().data("extension-scanner-mark-fully-scanned-rest-files-token"),hashes:this.uniqueArray(this.listOfAffectedRestFileHashes)}},cache:!1,success:function(e){!0===e.success&&o.success("Marked not affected files","Marked "+e.markedAsNotAffected+" ReST files as not affected.")},error:function(e){a.handleAjaxError(e,s)}}))},n.prototype.uniqueArray=function(e){return e.filter(function(e,n,t){return t.indexOf(e)===n})},n.prototype.scanSingleExtension=function(e){var n=this,t=this.getModuleContent().data("extension-scanner-files-token"),r=this.getModalBody(),l=this.findInModal(this.getExtensionSelector(e)),c=!1;l.removeClass("panel-danger panel-warning panel-success t3js-extensionscan-finished"),l.data("hasRun","true"),l.find(".t3js-extensionScanner-scan-single").text("Scanning...").attr("disabled","disabled"),l.find(".t3js-extensionScanner-extension-body-loc").empty().text("0"),l.find(".t3js-extensionScanner-extension-body-ignored-files").empty().text("0"),l.find(".t3js-extensionScanner-extension-body-ignored-lines").empty().text("0"),this.setProgressForAll(),i.add({url:a.getUrl(),method:"POST",data:{install:{action:"extensionScannerFiles",token:t,extension:e}},cache:!1,success:function(t){if(!0===t.success&&Array.isArray(t.files)){var d=t.files.length;if(d>0){n.setStatusMessageForScan(e,0,d),l.find(".t3js-extensionScanner-extension-body").text("");var f=0;t.files.forEach(function(t){i.add({method:"POST",data:{install:{action:"extensionScannerScanFile",token:n.getModuleContent().data("extension-scanner-scan-file-token"),extension:e,file:t}},url:a.getUrl(),cache:!1,success:function(i){if(f++,n.setStatusMessageForScan(e,f,d),n.setProgressForScan(e,f,d),i.success&&s.isArray(i.matches)&&i.matches.forEach(function(e){c=!0;var i=r.find("#t3js-extensionScanner-file-hit-template").clone();i.find(".t3js-extensionScanner-hit-file-panel-head").attr("href","#collapse"+e.uniqueId),i.find(".t3js-extensionScanner-hit-file-panel-body").attr("id","collapse"+e.uniqueId),i.find(".t3js-extensionScanner-hit-filename").text(t),i.find(".t3js-extensionScanner-hit-message").text(e.message),"strong"===e.indicator?i.find(".t3js-extensionScanner-hit-file-panel-head .badges").append('<span class="badge" title="Reliable match, false positive unlikely">strong</span>'):i.find(".t3js-extensionScanner-hit-file-panel-head .badges").append('<span class="badge" title="Probable match, but can be a false positive">weak</span>'),!0===e.silenced&&i.find(".t3js-extensionScanner-hit-file-panel-head .badges").append('<span class="badge" title="Match has been annotated by extension author as false positive match">silenced</span>'),i.find(".t3js-extensionScanner-hit-file-lineContent").empty().text(e.lineContent),i.find(".t3js-extensionScanner-hit-file-line").empty().text(e.line+": "),s.isArray(e.restFiles)&&e.restFiles.forEach(function(e){var t=r.find("#t3js-extensionScanner-file-hit-rest-template").clone();t.find(".t3js-extensionScanner-hit-rest-panel-head").attr("href","#collapse"+e.uniqueId),t.find(".t3js-extensionScanner-hit-rest-panel-head .badge").empty().text(e.version),t.find(".t3js-extensionScanner-hit-rest-panel-body").attr("id","collapse"+e.uniqueId),t.find(".t3js-extensionScanner-hit-rest-headline").text(e.headline),t.find(".t3js-extensionScanner-hit-rest-body").text(e.content),t.addClass("panel-"+e.class),i.find(".t3js-extensionScanner-hit-file-rest-container").append(t),n.listOfAffectedRestFileHashes.push(e.file_hash)});var a=i.find(".panel-breaking",".t3js-extensionScanner-hit-file-rest-container").length>0?"panel-danger":"panel-warning";i.addClass(a),l.find(".t3js-extensionScanner-extension-body").removeClass("hide").append(i),"panel-danger"===a&&l.removeClass("panel-warning").addClass(a),"panel-warning"!==a||l.hasClass("panel-danger")||l.addClass(a)}),i.success){var a=parseInt(l.find(".t3js-extensionScanner-extension-body-loc").text(),10);if(l.find(".t3js-extensionScanner-extension-body-loc").empty().text(a+i.effectiveCodeLines),i.isFileIgnored){var o=parseInt(l.find(".t3js-extensionScanner-extension-body-ignored-files").text(),10);l.find(".t3js-extensionScanner-extension-body-ignored-files").empty().text(o+1)}var h=parseInt(l.find(".t3js-extensionScanner-extension-body-ignored-lines").text(),10);l.find(".t3js-extensionScanner-extension-body-ignored-lines").empty().text(h+i.ignoredLines)}f===d&&(c||l.addClass("panel-success"),l.addClass("t3js-extensionscan-finished"),n.setProgressForAll(),l.find(".t3js-extensionScanner-scan-single").text("Rescan").attr("disabled",null))},error:function(t){f+=1,n.setStatusMessageForScan(e,f,d),n.setProgressForScan(e,f,d),n.setProgressForAll(),o.error("Oops, an error occurred","Please look at the console output for details"),console.error(t)}})})}else o.warning("No files found","The extension EXT:"+e+" contains no files we can scan")}else o.error("Oops, an error occurred","Please look at the console output for details"),console.error(t)},error:function(e){a.handleAjaxError(e,r)}})},n}(t.AbstractInteractableModule))});
\ No newline at end of file
index 72dd49b..5ec82ff 100644 (file)
@@ -10,4 +10,4 @@
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require","exports","jquery","../Router","TYPO3/CMS/Backend/Notification"],function(e,t,r,n,o){"use strict";return new(function(){function e(){this.selectorModalBody=".t3js-modal-body",this.selectorModuleContent=".t3js-features-content",this.selectorSaveTrigger=".t3js-features-save"}return e.prototype.initialize=function(e){var t=this;this.currentModal=e,this.getContent(),e.on("click",this.selectorSaveTrigger,function(e){e.preventDefault(),t.save()})},e.prototype.getContent=function(){var e=this.currentModal.find(this.selectorModalBody);r.ajax({url:n.getUrl("featuresGetContent"),cache:!1,success:function(t){!0===t.success&&"undefined"!==t.html&&t.html.length>0?e.empty().append(t.html):o.error("Something went wrong")},error:function(t){n.handleAjaxError(t,e)}})},e.prototype.save=function(){var e=this.currentModal.find(this.selectorModalBody),t=this.currentModal.find(this.selectorModuleContent).data("features-save-token"),s={};r(this.currentModal.find(this.selectorModuleContent+" form").serializeArray()).each(function(e,t){s[t.name]=t.value}),s["install[action]"]="featuresSave",s["install[token]"]=t,r.ajax({url:n.getUrl(),method:"POST",data:s,cache:!1,success:function(e){!0===e.success&&Array.isArray(e.status)?e.status.forEach(function(e){o.showMessage(e.title,e.message,e.severity)}):o.error("Something went wrong")},error:function(t){n.handleAjaxError(t,e)}})},e}())});
\ No newline at end of file
+var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();define(["require","exports","./AbstractInteractableModule","jquery","../Router","TYPO3/CMS/Backend/Notification"],function(t,e,n,r,o,a){"use strict";return new(function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.selectorSaveTrigger=".t3js-features-save",e}return __extends(e,t),e.prototype.initialize=function(t){var e=this;this.currentModal=t,this.getContent(),t.on("click",this.selectorSaveTrigger,function(t){t.preventDefault(),e.save()})},e.prototype.getContent=function(){var t=this.getModalBody();r.ajax({url:o.getUrl("featuresGetContent"),cache:!1,success:function(e){!0===e.success&&"undefined"!==e.html&&e.html.length>0?t.empty().append(e.html):a.error("Something went wrong")},error:function(e){o.handleAjaxError(e,t)}})},e.prototype.save=function(){var t=this.getModalBody(),e=this.getModuleContent().data("features-save-token"),n={};r(this.findInModal("form").serializeArray()).each(function(t,e){n[e.name]=e.value}),n["install[action]"]="featuresSave",n["install[token]"]=e,r.ajax({url:o.getUrl(),method:"POST",data:n,cache:!1,success:function(t){!0===t.success&&Array.isArray(t.status)?t.status.forEach(function(t){a.showMessage(t.title,t.message,t.severity)}):a.error("Something went wrong")},error:function(e){o.handleAjaxError(e,t)}})},e}(n.AbstractInteractableModule))});
\ No newline at end of file
index c225ad7..58110d2 100644 (file)
@@ -10,4 +10,4 @@
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require","exports","jquery","../Router","../Renderable/ProgressBar","../Renderable/InfoBox","../Renderable/Severity","TYPO3/CMS/Backend/Notification","bootstrap"],function(e,r,t,o,s,i,n,a){"use strict";return new(function(){function e(){this.selectorModalBody=".t3js-modal-body",this.selectorGridderBadge=".t3js-folderStructure-badge",this.selectorOutputContainer=".t3js-folderStructure-output",this.selectorErrorContainer=".t3js-folderStructure-errors",this.selectorErrorList=".t3js-folderStructure-errors-list",this.selectorErrorFixTrigger=".t3js-folderStructure-errors-fix",this.selectorOkContainer=".t3js-folderStructure-ok",this.selectorOkList=".t3js-folderStructure-ok-list",this.selectorPermissionContainer=".t3js-folderStructure-permissions"}return e.removeLoadingMessage=function(e){e.find(".alert-loading").remove()},e.prototype.initialize=function(e){var r=this;this.currentModal=e,this.getStatus(),e.on("click",this.selectorErrorFixTrigger,function(e){e.preventDefault(),r.fix()})},e.prototype.getStatus=function(){var e=this,r=this.currentModal.find(this.selectorModalBody),a=t(this.selectorGridderBadge);a.text("").hide(),r.find(this.selectorOutputContainer).empty().append(s.render(n.loading,"Loading...","")),t.ajax({url:o.getUrl("folderStructureGetStatus"),cache:!1,success:function(t){if(r.empty().append(t.html),!0===t.success&&Array.isArray(t.errorStatus)){var o=0;t.errorStatus.length>0?(r.find(e.selectorErrorContainer).show(),r.find(e.selectorErrorList).empty(),t.errorStatus.forEach(function(t){o++,a.text(o).show();var s=i.render(t.severity,t.title,t.message);r.find(e.selectorErrorList).append(s)})):r.find(e.selectorErrorContainer).hide()}!0===t.success&&Array.isArray(t.okStatus)&&(t.okStatus.length>0?(r.find(e.selectorOkContainer).show(),r.find(e.selectorOkList).empty(),t.okStatus.forEach(function(t){var o=i.render(t.severity,t.title,t.message);r.find(e.selectorOkList).append(o)})):r.find(e.selectorOkContainer).hide());var s=t.folderStructureFilePermissionStatus;r.find(e.selectorPermissionContainer).empty().append(i.render(s.severity,s.title,s.message)),s=t.folderStructureDirectoryPermissionStatus,r.find(e.selectorPermissionContainer).append(i.render(s.severity,s.title,s.message))},error:function(e){o.handleAjaxError(e,r)}})},e.prototype.fix=function(){var r=this,d=this.currentModal.find(this.selectorModalBody),u=this.currentModal.find(this.selectorOutputContainer),c=s.render(n.loading,"Loading...","");u.empty().html(c),t.ajax({url:o.getUrl("folderStructureFix"),cache:!1,success:function(t){e.removeLoadingMessage(u),!0===t.success&&Array.isArray(t.fixedStatus)?(t.fixedStatus.length>0?t.fixedStatus.forEach(function(e){u.append(i.render(e.severity,e.title,e.message))}):u.append(i.render(n.warning,"Nothing fixed","")),r.getStatus()):a.error("Something went wrong")},error:function(e){o.handleAjaxError(e,d)}})},e}())});
\ No newline at end of file
+var __extends=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)r.hasOwnProperty(t)&&(e[t]=r[t])};return function(r,t){function o(){this.constructor=r}e(r,t),r.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}}();define(["require","exports","./AbstractInteractableModule","jquery","../Router","../Renderable/ProgressBar","../Renderable/InfoBox","../Renderable/Severity","TYPO3/CMS/Backend/Notification","bootstrap"],function(e,r,t,o,n,s,i,a,u){"use strict";return new(function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.selectorGridderBadge=".t3js-folderStructure-badge",r.selectorOutputContainer=".t3js-folderStructure-output",r.selectorErrorContainer=".t3js-folderStructure-errors",r.selectorErrorList=".t3js-folderStructure-errors-list",r.selectorErrorFixTrigger=".t3js-folderStructure-errors-fix",r.selectorOkContainer=".t3js-folderStructure-ok",r.selectorOkList=".t3js-folderStructure-ok-list",r.selectorPermissionContainer=".t3js-folderStructure-permissions",r}return __extends(r,e),r.removeLoadingMessage=function(e){e.find(".alert-loading").remove()},r.prototype.initialize=function(e){var r=this;this.currentModal=e,this.getStatus(),e.on("click",this.selectorErrorFixTrigger,function(e){e.preventDefault(),r.fix()})},r.prototype.getStatus=function(){var e=this,r=this.getModalBody(),t=o(this.selectorGridderBadge);t.text("").hide(),r.find(this.selectorOutputContainer).empty().append(s.render(a.loading,"Loading...","")),o.ajax({url:n.getUrl("folderStructureGetStatus"),cache:!1,success:function(o){if(r.empty().append(o.html),!0===o.success&&Array.isArray(o.errorStatus)){var n=0;o.errorStatus.length>0?(r.find(e.selectorErrorContainer).show(),r.find(e.selectorErrorList).empty(),o.errorStatus.forEach(function(o){n++,t.text(n).show();var s=i.render(o.severity,o.title,o.message);r.find(e.selectorErrorList).append(s)})):r.find(e.selectorErrorContainer).hide()}!0===o.success&&Array.isArray(o.okStatus)&&(o.okStatus.length>0?(r.find(e.selectorOkContainer).show(),r.find(e.selectorOkList).empty(),o.okStatus.forEach(function(t){var o=i.render(t.severity,t.title,t.message);r.find(e.selectorOkList).append(o)})):r.find(e.selectorOkContainer).hide());var s=o.folderStructureFilePermissionStatus;r.find(e.selectorPermissionContainer).empty().append(i.render(s.severity,s.title,s.message)),s=o.folderStructureDirectoryPermissionStatus,r.find(e.selectorPermissionContainer).append(i.render(s.severity,s.title,s.message))},error:function(e){n.handleAjaxError(e,r)}})},r.prototype.fix=function(){var e=this,t=this.getModalBody(),c=this.findInModal(this.selectorOutputContainer),d=s.render(a.loading,"Loading...","");c.empty().html(d),o.ajax({url:n.getUrl("folderStructureFix"),cache:!1,success:function(t){r.removeLoadingMessage(c),!0===t.success&&Array.isArray(t.fixedStatus)?(t.fixedStatus.length>0?t.fixedStatus.forEach(function(e){c.append(i.render(e.severity,e.title,e.message))}):c.append(i.render(a.warning,"Nothing fixed","")),e.getStatus()):u.error("Something went wrong")},error:function(e){n.handleAjaxError(e,t)}})},r}(t.AbstractInteractableModule))});
\ No newline at end of file
index bf444e9..fd27b11 100644 (file)
@@ -10,4 +10,4 @@
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require","exports","jquery","../Router","../Renderable/InfoBox","../Renderable/Severity","TYPO3/CMS/Backend/Notification","bootstrap"],function(e,t,r,n,s,i,o){"use strict";return new(function(){function e(){this.selectorModalBody=".t3js-modal-body",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"}return e.prototype.initialize=function(e){var t=this;this.currentModal=e,this.getData(),e.on("click",this.selectorExecuteTrigger,function(e){e.preventDefault(),t.runTests()})},e.prototype.getData=function(){var e=this,t=this.currentModal.find(this.selectorModalBody);r.ajax({url:n.getUrl("imageProcessingGetData"),cache:!1,success:function(r){!0===r.success?(t.empty().append(r.html),e.runTests()):o.error("Something went wrong")},error:function(e){n.handleAjaxError(e,t)}})},e.prototype.runTests=function(){var e=this,t=this.currentModal.find(this.selectorModalBody),o=this.currentModal.find(this.selectorTwinImageTemplate);t.find(this.selectorTestContainer).each(function(a,c){var l=r(c),m=l.data("test"),d=s.render(i.loading,"Loading...","");l.empty().html(d),r.ajax({url:n.getUrl(m),cache:!1,success:function(t){if(!0===t.success){l.empty(),Array.isArray(t.status)&&t.status.forEach(function(e){var t=s.render(c.severity,c.title,c.message);l.append(t)});var r=o.clone();if(r.removeClass("t3js-imageProcessing-twinImage-template"),!0===t.fileExists&&(r.find("img.reference").attr("src",t.referenceFile),r.find("img.result").attr("src",t.outputFile),r.find(e.selectorTwinImages).show()),Array.isArray(t.command)&&t.command.length>0){r.find(e.selectorCommandContainer).show();var n=[];t.command.forEach(function(e){n.push("<strong>Command:</strong>\n"+e[1]),3===e.length&&n.push("<strong>Result:</strong>\n"+e[2])}),r.find(e.selectorCommandText).html(n.join("\n"))}l.append(r)}},error:function(e){n.handleAjaxError(e,t)}})})},e}())});
\ No newline at end of file
+var __extends=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();define(["require","exports","./AbstractInteractableModule","jquery","../Router","../Renderable/InfoBox","../Renderable/Severity","TYPO3/CMS/Backend/Notification","bootstrap"],function(e,t,n,r,o,s,a,i){"use strict";return new(function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.selectorExecuteTrigger=".t3js-imageProcessing-execute",t.selectorTestContainer=".t3js-imageProcessing-twinContainer",t.selectorTwinImageTemplate=".t3js-imageProcessing-twinImage-template",t.selectorCommandContainer=".t3js-imageProcessing-command",t.selectorCommandText=".t3js-imageProcessing-command-text",t.selectorTwinImages=".t3js-imageProcessing-images",t}return __extends(t,e),t.prototype.initialize=function(e){var t=this;this.currentModal=e,this.getData(),e.on("click",this.selectorExecuteTrigger,function(e){e.preventDefault(),t.runTests()})},t.prototype.getData=function(){var e=this,t=this.getModalBody();r.ajax({url:o.getUrl("imageProcessingGetData"),cache:!1,success:function(n){!0===n.success?(t.empty().append(n.html),e.runTests()):i.error("Something went wrong")},error:function(e){o.handleAjaxError(e,t)}})},t.prototype.runTests=function(){var e=this,t=this.getModalBody(),n=this.findInModal(this.selectorTwinImageTemplate);t.find(this.selectorTestContainer).each(function(i,c){var l=r(c),u=l.data("test"),m=s.render(a.loading,"Loading...","");l.empty().html(m),r.ajax({url:o.getUrl(u),cache:!1,success:function(t){if(!0===t.success){l.empty(),Array.isArray(t.status)&&t.status.forEach(function(e){var t=s.render(c.severity,c.title,c.message);l.append(t)});var r=n.clone();if(r.removeClass("t3js-imageProcessing-twinImage-template"),!0===t.fileExists&&(r.find("img.reference").attr("src",t.referenceFile),r.find("img.result").attr("src",t.outputFile),r.find(e.selectorTwinImages).show()),Array.isArray(t.command)&&t.command.length>0){r.find(e.selectorCommandContainer).show();var o=[];t.command.forEach(function(e){o.push("<strong>Command:</strong>\n"+e[1]),3===e.length&&o.push("<strong>Result:</strong>\n"+e[2])}),r.find(e.selectorCommandText).html(o.join("\n"))}l.append(r)}},error:function(e){o.handleAjaxError(e,t)}})})},t}(n.AbstractInteractableModule))});
\ No newline at end of file
index 625c3e2..9c8c4b2 100644 (file)
@@ -10,4 +10,4 @@
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require","exports","jquery","../Router","../Renderable/FlashMessage","../Renderable/ProgressBar","../Renderable/InfoBox","../Renderable/Severity","bootstrap"],function(t,a,e,n,s,i,o,d){"use strict";return new(function(){function t(){this.selectorModalBody=".t3js-modal-body",this.selectorModuleContent=".t3js-module-content",this.selectorOutputContainer=".t3js-languagePacks-output",this.selectorContentContainer=".t3js-languagePacks-mainContent",this.selectorActivateLanguage=".t3js-languagePacks-activateLanguage",this.selectorActivateLanguageIcon="#t3js-languagePacks-activate-icon",this.selectorAddLanguageToggle=".t3js-languagePacks-addLanguage-toggle",this.selectorLanguageInactive=".t3js-languagePacks-inactive",this.selectorDeactivateLanguage=".t3js-languagePacks-deactivateLanguage",this.selectorDeactivateLanguageIcon="#t3js-languagePacks-deactivate-icon",this.selectorUpdate=".t3js-languagePacks-update",this.selectorLanguageUpdateIcon="#t3js-languagePacks-languageUpdate-icon",this.selectorExtensionPackMissesIcon="#t3js-languagePacks-extensionPack-misses-icon",this.selectorNotifications=".t3js-languagePacks-notifications",this.activeLanguages=[],this.activeExtensions=[],this.packsUpdateDetails={toHandle:0,handled:0,updated:0,new:0,failed:0},this.notifications=[]}return t.prototype.initialize=function(t){var a=this;this.currentModal=t,this.getData(),t.on("click",this.selectorAddLanguageToggle,function(){t.find(a.selectorContentContainer+" "+a.selectorLanguageInactive).toggle()}),t.on("click",this.selectorActivateLanguage,function(t){var n=e(t.target).closest(a.selectorActivateLanguage).data("iso");t.preventDefault(),a.activateLanguage(n)}),t.on("click",this.selectorDeactivateLanguage,function(t){var n=e(t.target).closest(a.selectorDeactivateLanguage).data("iso");t.preventDefault(),a.deactivateLanguage(n)}),t.on("click",this.selectorUpdate,function(t){var n=e(t.target).closest(a.selectorUpdate).data("iso"),s=e(t.target).closest(a.selectorUpdate).data("extension");t.preventDefault(),a.updatePacks(n,s)})},t.prototype.getData=function(){var t=this,a=this.currentModal.find(this.selectorModalBody);e.ajax({url:n.getUrl("languagePacksGetData"),cache:!1,success:function(n){if(!0===n.success){t.activeLanguages=n.activeLanguages,t.activeExtensions=n.activeExtensions,a.empty().append(n.html);var s=a.parent().find(t.selectorContentContainer);s.empty(),s.append(t.languageMatrixHtml(n)),s.append(t.extensionMatrixHtml(n)),e('[data-toggle="tooltip"]').tooltip({container:s})}else{var i=o.render(d.error,"Something went wrong","");t.addNotification(i)}t.renderNotifications()},error:function(t){n.handleAjaxError(t,a)}})},t.prototype.activateLanguage=function(t){var a=this,c=this.currentModal.find(this.selectorModalBody),l=this.currentModal.find(this.selectorOutputContainer),r=i.render(d.loading,"Loading...","");l.empty().append(r),e.ajax({url:n.getUrl(),method:"POST",context:this,data:{install:{action:"languagePacksActivateLanguage",token:this.currentModal.find(this.selectorModuleContent).data("language-packs-activate-language-token"),iso:t}},cache:!1,beforeSend:function(){a.getNotificationBox().empty()},success:function(t){if(l.empty(),!0===t.success&&Array.isArray(t.status))t.status.forEach(function(t){var e=o.render(t.severity,t.title,t.message);a.addNotification(e)});else{var e=s.render(d.error,"Something went wrong","");a.addNotification(e)}a.getData()},error:function(t){n.handleAjaxError(t,c)}})},t.prototype.deactivateLanguage=function(t){var a=this,c=this.currentModal.find(this.selectorModalBody),l=this.currentModal.find(this.selectorOutputContainer),r=i.render(d.loading,"Loading...","");l.empty().append(r),e.ajax({url:n.getUrl(),method:"POST",context:this,data:{install:{action:"languagePacksDeactivateLanguage",token:this.currentModal.find(this.selectorModuleContent).data("language-packs-deactivate-language-token"),iso:t}},cache:!1,beforeSend:function(){a.getNotificationBox().empty()},success:function(t){if(l.empty(),!0===t.success&&Array.isArray(t.status))t.status.forEach(function(t){var e=o.render(t.severity,t.title,t.message);a.addNotification(e)});else{var e=s.render(d.error,"Something went wrong","");a.addNotification(e)}a.getData()},error:function(t){n.handleAjaxError(t,c)}})},t.prototype.updatePacks=function(t,a){var s=this,i=this.currentModal.find(this.selectorOutputContainer),o=this.currentModal.find(this.selectorContentContainer),d=void 0===t?this.activeLanguages:[t],c=!0,l=this.activeExtensions;void 0!==a&&(l=[a],c=!1),this.packsUpdateDetails={toHandle:d.length*l.length,handled:0,updated:0,new:0,failed:0},i.empty().append(e("<div>",{class:"progress"}).append(e("<div>",{class:"progress-bar progress-bar-info",role:"progressbar","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,style:"width: 0;"}).append(e("<span>",{class:"text-nowrap"}).text("0 of "+this.packsUpdateDetails.toHandle+" language packs updated")))),o.empty(),d.forEach(function(t){l.forEach(function(a){e.ajax({url:n.getUrl(),method:"POST",context:s,data:{install:{action:"languagePacksUpdatePack",token:s.currentModal.find(s.selectorModuleContent).data("language-packs-update-pack-token"),iso:t,extension:a}},cache:!1,beforeSend:function(){s.getNotificationBox().empty()},success:function(t){!0===t.success?(s.packsUpdateDetails.handled++,"new"===t.packResult?s.packsUpdateDetails.new++:"update"===t.packResult?s.packsUpdateDetails.updated++:s.packsUpdateDetails.failed++,s.packUpdateDone(c,d)):(s.packsUpdateDetails.handled++,s.packsUpdateDetails.failed++,s.packUpdateDone(c,d))},error:function(){s.packsUpdateDetails.handled++,s.packsUpdateDetails.failed++,s.packUpdateDone(c,d)}})})})},t.prototype.packUpdateDone=function(t,a){var i=this,c=this.currentModal.find(this.selectorModalBody),l=this.currentModal.find(this.selectorOutputContainer);if(this.packsUpdateDetails.handled===this.packsUpdateDetails.toHandle){var r=o.render(d.ok,"Language packs updated",this.packsUpdateDetails.new+" new language packs downloaded, "+this.packsUpdateDetails.updated+" language packs updated, "+this.packsUpdateDetails.failed+" language packs not available");this.addNotification(r),!0===t?e.ajax({url:n.getUrl(),method:"POST",context:this,data:{install:{action:"languagePacksUpdateIsoTimes",token:this.currentModal.find(this.selectorModuleContent).data("language-packs-update-iso-times-token"),isos:a}},cache:!1,success:function(t){if(!0===t.success)i.getData();else{var a=s.render(d.error,"Something went wrong","");i.addNotification(a)}},error:function(t){n.handleAjaxError(t,c)}}):this.getData()}else{var p=this.packsUpdateDetails.handled/this.packsUpdateDetails.toHandle*100;l.find(".progress-bar").css("width",p+"%").attr("aria-valuenow",p).find("span").text(this.packsUpdateDetails.handled+" of "+this.packsUpdateDetails.toHandle+" language packs updated")}},t.prototype.languageMatrixHtml=function(t){var a=this.currentModal.find(this.selectorActivateLanguageIcon).html(),n=this.currentModal.find(this.selectorDeactivateLanguageIcon).html(),s=this.currentModal.find(this.selectorLanguageUpdateIcon).html(),i=e("<div>"),o=e("<tbody>");return t.languages.forEach(function(t){var i=t.active,d=e("<tr>");i?o.append(d.append(e("<td>").append(e("<a>",{class:"btn btn-default t3js-languagePacks-deactivateLanguage","data-iso":t.iso,"data-toggle":"tooltip",title:"Deactivate"}).append(n),e("<a>",{class:"btn btn-default t3js-languagePacks-update","data-iso":t.iso,"data-toggle":"tooltip",title:"Download language packs"}).append(s)))):o.append(d.addClass("t3-languagePacks-inactive t3js-languagePacks-inactive").css({display:"none"}).append(e("<td>").append(e("<a>",{class:"btn btn-default t3js-languagePacks-activateLanguage","data-iso":t.iso,"data-toggle":"tooltip",title:"Activate"}).append(a)))),d.append(e("<td>").text(t.name),e("<td>").text(t.iso),e("<td>").text(t.dependencies.join(", ")),e("<td>").text(null===t.lastUpdate?"":t.lastUpdate)),o.append(d)}),i.append(e("<h3>").text("Active languages"),e("<table>",{class:"table table-striped table-bordered"}).append(e("<thead>").append(e("<tr>").append(e("<th>").append(e("<button>",{class:"btn btn-default t3js-languagePacks-addLanguage-toggle",type:"button"}).append(e("<span>").append(a)," Add language"),e("<button>",{class:"btn btn-default t3js-languagePacks-update",type:"button"}).append(e("<span>").append(s)," Update all")),e("<th>").text("Language"),e("<th>").text("Locale"),e("<th>").text("Dependencies"),e("<th>").text("Last update"))),o)),i.html()},t.prototype.extensionMatrixHtml=function(t){var a,n=this.currentModal.find(this.selectorExtensionPackMissesIcon).html(),s=this.currentModal.find(this.selectorLanguageUpdateIcon).html(),i="",c=!0,l=0,r=e("<div>"),p=e("<tr>");p.append(e("<th>").text("Extension"),e("<th>").text("Key")),t.activeLanguages.forEach(function(t){p.append(e("<th>").append(e("<a>",{class:"btn btn-default t3js-languagePacks-update","data-iso":t,"data-toggle":"tooltip",title:"Download and update all language packs"}).append(e("<span>").append(s)," "+t)))});var g=e("<tbody>");return t.extensions.forEach(function(t){if(c=!0,t.packs.forEach(function(t){!1===t.exists&&(c=!1)}),!0!==c){l++,a=""!==t.icon?e("<span>").append(e("<img>",{style:"max-height: 16px; max-width: 16px;",src:"../"+t.icon,alt:t.title}),e("<span>").text(t.title)):e("<span>").text(t.title);var s=e("<tr>");s.append(e("<td>").html(a.html()),e("<td>").text(t.key)),t.packs.forEach(function(a){!0!==a.exists&&(i=null!==a.lastUpdate?"No language pack available when tried at "+a.lastUpdate+". Click to re-try.":"Language pack not downloaded. Click to download",s.append(e("<td>").append(e("<a>",{class:"btn btn-default t3js-languagePacks-update","data-extension":t.key,"data-iso":a.iso,"data-toggle":"tooltip",title:i}).append(n))))}),g.append(s)}}),r.append(e("<h3>").text("Translation status"),e("<table>",{class:"table table-striped table-bordered"}).append(e("<thead>").append(p),g)),0===l?o.render(d.ok,"Language packs have been found for every installed extension.","To download the latest changes, use the refresh button in the list above."):r.html()},t.prototype.getNotificationBox=function(){return this.currentModal.find(this.selectorNotifications)},t.prototype.addNotification=function(t){this.notifications.push(t)},t.prototype.renderNotifications=function(){for(var t=this.getNotificationBox(),a=0;a<this.notifications.length;++a)t.append(this.notifications[a]);this.notifications=[]},t}())});
\ No newline at end of file
+var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,a){t.__proto__=a}||function(t,a){for(var e in a)a.hasOwnProperty(e)&&(t[e]=a[e])};return function(a,e){function n(){this.constructor=a}t(a,e),a.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}}();define(["require","exports","./AbstractInteractableModule","jquery","../Router","../Renderable/FlashMessage","../Renderable/ProgressBar","../Renderable/InfoBox","../Renderable/Severity","bootstrap"],function(t,a,e,n,s,o,i,c,d){"use strict";return new(function(t){function a(){var a=null!==t&&t.apply(this,arguments)||this;return a.selectorOutputContainer=".t3js-languagePacks-output",a.selectorContentContainer=".t3js-languagePacks-mainContent",a.selectorActivateLanguage=".t3js-languagePacks-activateLanguage",a.selectorActivateLanguageIcon="#t3js-languagePacks-activate-icon",a.selectorAddLanguageToggle=".t3js-languagePacks-addLanguage-toggle",a.selectorLanguageInactive=".t3js-languagePacks-inactive",a.selectorDeactivateLanguage=".t3js-languagePacks-deactivateLanguage",a.selectorDeactivateLanguageIcon="#t3js-languagePacks-deactivate-icon",a.selectorUpdate=".t3js-languagePacks-update",a.selectorLanguageUpdateIcon="#t3js-languagePacks-languageUpdate-icon",a.selectorExtensionPackMissesIcon="#t3js-languagePacks-extensionPack-misses-icon",a.selectorNotifications=".t3js-languagePacks-notifications",a.activeLanguages=[],a.activeExtensions=[],a.packsUpdateDetails={toHandle:0,handled:0,updated:0,new:0,failed:0},a.notifications=[],a}return __extends(a,t),a.prototype.initialize=function(t){var a=this;this.currentModal=t,this.getData(),t.on("click",this.selectorAddLanguageToggle,function(){t.find(a.selectorContentContainer+" "+a.selectorLanguageInactive).toggle()}),t.on("click",this.selectorActivateLanguage,function(t){var e=n(t.target).closest(a.selectorActivateLanguage).data("iso");t.preventDefault(),a.activateLanguage(e)}),t.on("click",this.selectorDeactivateLanguage,function(t){var e=n(t.target).closest(a.selectorDeactivateLanguage).data("iso");t.preventDefault(),a.deactivateLanguage(e)}),t.on("click",this.selectorUpdate,function(t){var e=n(t.target).closest(a.selectorUpdate).data("iso"),s=n(t.target).closest(a.selectorUpdate).data("extension");t.preventDefault(),a.updatePacks(e,s)})},a.prototype.getData=function(){var t=this,a=this.getModalBody();n.ajax({url:s.getUrl("languagePacksGetData"),cache:!1,success:function(e){if(!0===e.success){t.activeLanguages=e.activeLanguages,t.activeExtensions=e.activeExtensions,a.empty().append(e.html);var s=a.parent().find(t.selectorContentContainer);s.empty(),s.append(t.languageMatrixHtml(e)),s.append(t.extensionMatrixHtml(e)),n('[data-toggle="tooltip"]').tooltip({container:s})}else{var o=c.render(d.error,"Something went wrong","");t.addNotification(o)}t.renderNotifications()},error:function(t){s.handleAjaxError(t,a)}})},a.prototype.activateLanguage=function(t){var a=this,e=this.getModalBody(),l=this.findInModal(this.selectorOutputContainer),r=i.render(d.loading,"Loading...","");l.empty().append(r),n.ajax({url:s.getUrl(),method:"POST",context:this,data:{install:{action:"languagePacksActivateLanguage",token:this.getModuleContent().data("language-packs-activate-language-token"),iso:t}},cache:!1,beforeSend:function(){a.getNotificationBox().empty()},success:function(t){if(l.empty(),!0===t.success&&Array.isArray(t.status))t.status.forEach(function(t){var e=c.render(t.severity,t.title,t.message);a.addNotification(e)});else{var e=o.render(d.error,"Something went wrong","");a.addNotification(e)}a.getData()},error:function(t){s.handleAjaxError(t,e)}})},a.prototype.deactivateLanguage=function(t){var a=this,e=this.getModalBody(),l=this.findInModal(this.selectorOutputContainer),r=i.render(d.loading,"Loading...","");l.empty().append(r),n.ajax({url:s.getUrl(),method:"POST",context:this,data:{install:{action:"languagePacksDeactivateLanguage",token:this.getModuleContent().data("language-packs-deactivate-language-token"),iso:t}},cache:!1,beforeSend:function(){a.getNotificationBox().empty()},success:function(t){if(l.empty(),!0===t.success&&Array.isArray(t.status))t.status.forEach(function(t){var e=c.render(t.severity,t.title,t.message);a.addNotification(e)});else{var e=o.render(d.error,"Something went wrong","");a.addNotification(e)}a.getData()},error:function(t){s.handleAjaxError(t,e)}})},a.prototype.updatePacks=function(t,a){var e=this,o=this.findInModal(this.selectorOutputContainer),i=this.findInModal(this.selectorContentContainer),c=void 0===t?this.activeLanguages:[t],d=!0,l=this.activeExtensions;void 0!==a&&(l=[a],d=!1),this.packsUpdateDetails={toHandle:c.length*l.length,handled:0,updated:0,new:0,failed:0},o.empty().append(n("<div>",{class:"progress"}).append(n("<div>",{class:"progress-bar progress-bar-info",role:"progressbar","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,style:"width: 0;"}).append(n("<span>",{class:"text-nowrap"}).text("0 of "+this.packsUpdateDetails.toHandle+" language packs updated")))),i.empty(),c.forEach(function(t){l.forEach(function(a){n.ajax({url:s.getUrl(),method:"POST",context:e,data:{install:{action:"languagePacksUpdatePack",token:e.getModuleContent().data("language-packs-update-pack-token"),iso:t,extension:a}},cache:!1,beforeSend:function(){e.getNotificationBox().empty()},success:function(t){!0===t.success?(e.packsUpdateDetails.handled++,"new"===t.packResult?e.packsUpdateDetails.new++:"update"===t.packResult?e.packsUpdateDetails.updated++:e.packsUpdateDetails.failed++,e.packUpdateDone(d,c)):(e.packsUpdateDetails.handled++,e.packsUpdateDetails.failed++,e.packUpdateDone(d,c))},error:function(){e.packsUpdateDetails.handled++,e.packsUpdateDetails.failed++,e.packUpdateDone(d,c)}})})})},a.prototype.packUpdateDone=function(t,a){var e=this,i=this.getModalBody(),l=this.findInModal(this.selectorOutputContainer);if(this.packsUpdateDetails.handled===this.packsUpdateDetails.toHandle){var r=c.render(d.ok,"Language packs updated",this.packsUpdateDetails.new+" new language packs downloaded, "+this.packsUpdateDetails.updated+" language packs updated, "+this.packsUpdateDetails.failed+" language packs not available");this.addNotification(r),!0===t?n.ajax({url:s.getUrl(),method:"POST",context:this,data:{install:{action:"languagePacksUpdateIsoTimes",token:this.getModuleContent().data("language-packs-update-iso-times-token"),isos:a}},cache:!1,success:function(t){if(!0===t.success)e.getData();else{var a=o.render(d.error,"Something went wrong","");e.addNotification(a)}},error:function(t){s.handleAjaxError(t,i)}}):this.getData()}else{var p=this.packsUpdateDetails.handled/this.packsUpdateDetails.toHandle*100;l.find(".progress-bar").css("width",p+"%").attr("aria-valuenow",p).find("span").text(this.packsUpdateDetails.handled+" of "+this.packsUpdateDetails.toHandle+" language packs updated")}},a.prototype.languageMatrixHtml=function(t){var a=this.findInModal(this.selectorActivateLanguageIcon).html(),e=this.findInModal(this.selectorDeactivateLanguageIcon).html(),s=this.findInModal(this.selectorLanguageUpdateIcon).html(),o=n("<div>"),i=n("<tbody>");return t.languages.forEach(function(t){var o=t.active,c=n("<tr>");o?i.append(c.append(n("<td>").append(n("<a>",{class:"btn btn-default t3js-languagePacks-deactivateLanguage","data-iso":t.iso,"data-toggle":"tooltip",title:"Deactivate"}).append(e),n("<a>",{class:"btn btn-default t3js-languagePacks-update","data-iso":t.iso,"data-toggle":"tooltip",title:"Download language packs"}).append(s)))):i.append(c.addClass("t3-languagePacks-inactive t3js-languagePacks-inactive").css({display:"none"}).append(n("<td>").append(n("<a>",{class:"btn btn-default t3js-languagePacks-activateLanguage","data-iso":t.iso,"data-toggle":"tooltip",title:"Activate"}).append(a)))),c.append(n("<td>").text(t.name),n("<td>").text(t.iso),n("<td>").text(t.dependencies.join(", ")),n("<td>").text(null===t.lastUpdate?"":t.lastUpdate)),i.append(c)}),o.append(n("<h3>").text("Active languages"),n("<table>",{class:"table table-striped table-bordered"}).append(n("<thead>").append(n("<tr>").append(n("<th>").append(n("<button>",{class:"btn btn-default t3js-languagePacks-addLanguage-toggle",type:"button"}).append(n("<span>").append(a)," Add language"),n("<button>",{class:"btn btn-default t3js-languagePacks-update",type:"button"}).append(n("<span>").append(s)," Update all")),n("<th>").text("Language"),n("<th>").text("Locale"),n("<th>").text("Dependencies"),n("<th>").text("Last update"))),i)),o.html()},a.prototype.extensionMatrixHtml=function(t){var a,e=this.findInModal(this.selectorExtensionPackMissesIcon).html(),s=this.findInModal(this.selectorLanguageUpdateIcon).html(),o="",i=!0,l=0,r=n("<div>"),p=n("<tr>");p.append(n("<th>").text("Extension"),n("<th>").text("Key")),t.activeLanguages.forEach(function(t){p.append(n("<th>").append(n("<a>",{class:"btn btn-default t3js-languagePacks-update","data-iso":t,"data-toggle":"tooltip",title:"Download and update all language packs"}).append(n("<span>").append(s)," "+t)))});var g=n("<tbody>");return t.extensions.forEach(function(t){if(i=!0,t.packs.forEach(function(t){!1===t.exists&&(i=!1)}),!0!==i){l++,a=""!==t.icon?n("<span>").append(n("<img>",{style:"max-height: 16px; max-width: 16px;",src:"../"+t.icon,alt:t.title}),n("<span>").text(t.title)):n("<span>").text(t.title);var s=n("<tr>");s.append(n("<td>").html(a.html()),n("<td>").text(t.key)),t.packs.forEach(function(a){!0!==a.exists&&(o=null!==a.lastUpdate?"No language pack available when tried at "+a.lastUpdate+". Click to re-try.":"Language pack not downloaded. Click to download",s.append(n("<td>").append(n("<a>",{class:"btn btn-default t3js-languagePacks-update","data-extension":t.key,"data-iso":a.iso,"data-toggle":"tooltip",title:o}).append(e))))}),g.append(s)}}),r.append(n("<h3>").text("Translation status"),n("<table>",{class:"table table-striped table-bordered"}).append(n("<thead>").append(p),g)),0===l?c.render(d.ok,"Language packs have been found for every installed extension.","To download the latest changes, use the refresh button in the list above."):r.html()},a.prototype.getNotificationBox=function(){return this.findInModal(this.selectorNotifications)},a.prototype.addNotification=function(t){this.notifications.push(t)},a.prototype.renderNotifications=function(){for(var t=this.getNotificationBox(),a=0;a<this.notifications.length;++a)t.append(this.notifications[a]);this.notifications=[]},a}(e.AbstractInteractableModule))});
\ No newline at end of file
index fcc0d16..81cf9a8 100644 (file)
@@ -10,4 +10,4 @@
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require","exports","jquery","../Router","TYPO3/CMS/Backend/Notification","bootstrap"],function(e,t,r,o,n){"use strict";return new(function(){function t(){this.selectorModalBody=".t3js-modal-body",this.selectorModuleContent=".t3js-module-content",this.selectorToggleAllTrigger=".t3js-localConfiguration-toggleAll",this.selectorWriteTrigger=".t3js-localConfiguration-write",this.selectorSearchTrigger=".t3js-localConfiguration-search"}return t.prototype.initialize=function(t){var o=this;this.currentModal=t,this.getContent(),t.on("click",this.selectorWriteTrigger,function(){o.write()}),t.on("click",this.selectorToggleAllTrigger,function(){var e=o.currentModal.find(o.selectorModalBody).find(".panel-collapse"),t=e.eq(0).hasClass("in")?"hide":"show";e.collapse(t)}),jQuery.expr[":"].contains=jQuery.expr.createPseudo(function(e){return function(t){return jQuery(t).text().toUpperCase().indexOf(e.toUpperCase())>=0}}),t.on("keydown",function(e){var r=t.find(o.selectorSearchTrigger);e.ctrlKey||e.metaKey?"f"===String.fromCharCode(e.which).toLowerCase()&&(e.preventDefault(),r.focus()):27===e.keyCode&&(e.preventDefault(),r.val("").focus())}),t.on("keyup",this.selectorSearchTrigger,function(n){var a=r(n.target).val(),i=t.find(o.selectorSearchTrigger);t.find("div.item").each(function(e,t){var o=r(t);r(":contains("+a+")",o).length>0||r('input[value*="'+a+'"]',o).length>0?o.removeClass("hidden").addClass("searchhit"):o.removeClass("searchhit").addClass("hidden")}),t.find(".searchhit").parent().collapse("show"),e(["jquery.clearable"],function(){i.clearable().focus()})})},t.prototype.getContent=function(){var e=this.currentModal.find(this.selectorModalBody);r.ajax({url:o.getUrl("localConfigurationGetContent"),cache:!1,success:function(t){!0===t.success&&(Array.isArray(t.status)&&t.status.forEach(function(e){n.success(e.title,e.message)}),e.html(t.html))},error:function(t){o.handleAjaxError(t,e)}})},t.prototype.write=function(){var e=this.currentModal.find(this.selectorModalBody),t=this.currentModal.find(this.selectorModuleContent).data("local-configuration-write-token"),a={};this.currentModal.find(".t3js-localConfiguration-pathValue").each(function(e,t){var o=r(t);"checkbox"===o.attr("type")?t.checked?a[o.data("path")]="1":a[o.data("path")]="0":a[o.data("path")]=o.val()}),r.ajax({url:o.getUrl(),method:"POST",data:{install:{action:"localConfigurationWrite",token:t,configurationValues:a}},cache:!1,success:function(e){!0===e.success&&Array.isArray(e.status)?e.status.forEach(function(e){n.showMessage(e.title,e.message,e.severity)}):n.error("Something went wrong")},error:function(t){o.handleAjaxError(t,e)}})},t}())});
\ No newline at end of file
+var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function o(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}();define(["require","exports","./AbstractInteractableModule","jquery","../Router","TYPO3/CMS/Backend/Notification","bootstrap"],function(t,e,r,o,n,a){"use strict";return new(function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return t.selectorToggleAllTrigger=".t3js-localConfiguration-toggleAll",t.selectorWriteTrigger=".t3js-localConfiguration-write",t.selectorSearchTrigger=".t3js-localConfiguration-search",t}return __extends(r,e),r.prototype.initialize=function(e){var r=this;this.currentModal=e,this.getContent(),e.on("click",this.selectorWriteTrigger,function(){r.write()}),e.on("click",this.selectorToggleAllTrigger,function(){var t=r.getModalBody().find(".panel-collapse"),e=t.eq(0).hasClass("in")?"hide":"show";t.collapse(e)}),jQuery.expr[":"].contains=jQuery.expr.createPseudo(function(t){return function(e){return jQuery(e).text().toUpperCase().indexOf(t.toUpperCase())>=0}}),e.on("keydown",function(t){var o=e.find(r.selectorSearchTrigger);t.ctrlKey||t.metaKey?"f"===String.fromCharCode(t.which).toLowerCase()&&(t.preventDefault(),o.focus()):27===t.keyCode&&(t.preventDefault(),o.val("").focus())}),e.on("keyup",this.selectorSearchTrigger,function(n){var a=o(n.target).val(),i=e.find(r.selectorSearchTrigger);e.find("div.item").each(function(t,e){var r=o(e);o(":contains("+a+")",r).length>0||o('input[value*="'+a+'"]',r).length>0?r.removeClass("hidden").addClass("searchhit"):r.removeClass("searchhit").addClass("hidden")}),e.find(".searchhit").parent().collapse("show"),t(["jquery.clearable"],function(){i.clearable().focus()})})},r.prototype.getContent=function(){var t=this.getModalBody();o.ajax({url:n.getUrl("localConfigurationGetContent"),cache:!1,success:function(e){!0===e.success&&(Array.isArray(e.status)&&e.status.forEach(function(t){a.success(t.title,t.message)}),t.html(e.html))},error:function(e){n.handleAjaxError(e,t)}})},r.prototype.write=function(){var t=this.getModalBody(),e=this.getModuleContent().data("local-configuration-write-token"),r={};this.findInModal(".t3js-localConfiguration-pathValue").each(function(t,e){var n=o(e);"checkbox"===n.attr("type")?e.checked?r[n.data("path")]="1":r[n.data("path")]="0":r[n.data("path")]=n.val()}),o.ajax({url:n.getUrl(),method:"POST",data:{install:{action:"localConfigurationWrite",token:e,configurationValues:r}},cache:!1,success:function(t){!0===t.success&&Array.isArray(t.status)?t.status.forEach(function(t){a.showMessage(t.title,t.message,t.severity)}):a.error("Something went wrong")},error:function(e){n.handleAjaxError(e,t)}})},r}(r.AbstractInteractableModule))});
\ No newline at end of file
index f381c41..3c18f67 100644 (file)
@@ -10,4 +10,4 @@
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require","exports","jquery","../Router","../Renderable/ProgressBar","../Renderable/Severity","../Renderable/InfoBox","TYPO3/CMS/Backend/Notification","bootstrap"],function(t,e,r,o,n,s,i,a){"use strict";return new(function(){function t(){this.selectorModalBody=".t3js-modal-body",this.selectorModuleContent=".t3js-module-content",this.selectorForm="#t3js-mailTest-form",this.selectorOutputContainer=".t3js-mailTest-output"}return t.prototype.initialize=function(t){var e=this;this.currentModal=t,this.getData(),t.on("submit",this.selectorForm,function(t){t.preventDefault(),e.send()})},t.prototype.getData=function(){var t=this.currentModal.find(this.selectorModalBody);r.ajax({url:o.getUrl("mailTestGetData"),cache:!1,success:function(e){!0===e.success?t.empty().append(e.html):a.error("Something went wrong")},error:function(e){o.handleAjaxError(e,t)}})},t.prototype.send=function(){var t=this.currentModal.find(this.selectorModuleContent).data("mail-test-token"),e=this.currentModal.find(this.selectorOutputContainer),l=n.render(s.loading,"Loading...","");e.empty().html(l),r.ajax({url:o.getUrl(),method:"POST",data:{install:{action:"mailTest",token:t,email:this.currentModal.find(".t3js-mailTest-email").val()}},cache:!1,success:function(t){e.empty(),!0===t.success&&Array.isArray(t.status)?t.status.forEach(function(t){var r=i.render(t.severity,t.title,t.message);e.html(r)}):a.error("Something went wrong")},error:function(){a.error("Something went wrong")}})},t}())});
\ No newline at end of file
+var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();define(["require","exports","./AbstractInteractableModule","jquery","../Router","../Renderable/ProgressBar","../Renderable/Severity","../Renderable/InfoBox","TYPO3/CMS/Backend/Notification","bootstrap"],function(t,e,r,n,o,a,i,s,c){"use strict";return new(function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.selectorForm="#t3js-mailTest-form",e.selectorOutputContainer=".t3js-mailTest-output",e}return __extends(e,t),e.prototype.initialize=function(t){var e=this;this.currentModal=t,this.getData(),t.on("submit",this.selectorForm,function(t){t.preventDefault(),e.send()})},e.prototype.getData=function(){var t=this.getModalBody();n.ajax({url:o.getUrl("mailTestGetData"),cache:!1,success:function(e){!0===e.success?t.empty().append(e.html):c.error("Something went wrong")},error:function(e){o.handleAjaxError(e,t)}})},e.prototype.send=function(){var t=this.getModuleContent().data("mail-test-token"),e=this.findInModal(this.selectorOutputContainer),r=a.render(i.loading,"Loading...","");e.empty().html(r),n.ajax({url:o.getUrl(),method:"POST",data:{install:{action:"mailTest",token:t,email:this.findInModal(".t3js-mailTest-email").val()}},cache:!1,success:function(t){e.empty(),!0===t.success&&Array.isArray(t.status)?t.status.forEach(function(t){var r=s.render(t.severity,t.title,t.message);e.html(r)}):c.error("Something went wrong")},error:function(){c.error("Something went wrong")}})},e}(r.AbstractInteractableModule))});
\ No newline at end of file
index 7ffbc70..bb1acc8 100644 (file)
@@ -10,4 +10,4 @@
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require","exports","jquery","../Router","TYPO3/CMS/Backend/Notification"],function(t,e,r,o,n){"use strict";return new(function(){function t(){this.selectorModalBody=".t3js-modal-body",this.currentModal={}}return t.prototype.initialize=function(t){this.currentModal=t,this.getData()},t.prototype.getData=function(){var t=this.currentModal.find(this.selectorModalBody);r.ajax({url:o.getUrl("phpInfoGetData"),cache:!1,success:function(e){!0===e.success?t.empty().append(e.html):n.error("Something went wrong")},error:function(e){o.handleAjaxError(e,t)}})},t}())});
\ No newline at end of file
+var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();define(["require","exports","./AbstractInteractableModule","jquery","../Router","TYPO3/CMS/Backend/Notification"],function(t,e,n,r,o,i){"use strict";return new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.initialize=function(t){this.currentModal=t,this.getData()},e.prototype.getData=function(){var t=this.getModalBody();r.ajax({url:o.getUrl("phpInfoGetData"),cache:!1,success:function(e){!0===e.success?t.empty().append(e.html):i.error("Something went wrong")},error:function(e){o.handleAjaxError(e,t)}})},e}(n.AbstractInteractableModule))});
\ No newline at end of file
index 59b028c..00e69c9 100644 (file)
@@ -10,4 +10,4 @@
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require","exports","jquery","../Router","TYPO3/CMS/Backend/Notification","bootstrap"],function(t,e,r,n,o){"use strict";return new(function(){function t(){this.selectorModalBody=".t3js-modal-body",this.selectorModuleContent=".t3js-presets-content",this.selectorActivateTrigger=".t3js-presets-activate",this.selectorImageExecutable=".t3js-presets-image-executable",this.selectorImageExecutableTrigger=".t3js-presets-image-executable-trigger"}return t.prototype.initialize=function(t){var e=this;this.currentModal=t,this.getContent(),t.on("click",this.selectorImageExecutableTrigger,function(t){t.preventDefault(),e.getCustomImagePathContent()}),t.on("click",this.selectorActivateTrigger,function(t){t.preventDefault(),e.activate()}),t.find(".t3js-custom-preset").on("input",".t3js-custom-preset",function(t){r("#"+r(t.currentTarget).data("radio")).prop("checked",!0)})},t.prototype.getContent=function(){var t=this.currentModal.find(this.selectorModalBody);r.ajax({url:n.getUrl("presetsGetContent"),cache:!1,success:function(e){!0===e.success&&"undefined"!==e.html&&e.html.length>0?t.empty().append(e.html):o.error("Something went wrong")},error:function(e){n.handleAjaxError(e,t)}})},t.prototype.getCustomImagePathContent=function(){var t=this.currentModal.find(this.selectorModalBody),e=this.currentModal.find(this.selectorModuleContent).data("presets-content-token");r.ajax({url:n.getUrl(),method:"POST",data:{install:{token:e,action:"presetsGetContent",values:{Image:{additionalSearchPath:this.currentModal.find(this.selectorImageExecutable).val()}}}},cache:!1,success:function(e){!0===e.success&&"undefined"!==e.html&&e.html.length>0?t.empty().append(e.html):o.error("Something went wrong")},error:function(e){n.handleAjaxError(e,t)}})},t.prototype.activate=function(){var t=this.currentModal.find(this.selectorModalBody),e=this.currentModal.find(this.selectorModuleContent).data("presets-activate-token"),s={};r(this.currentModal.find(this.selectorModuleContent+" form").serializeArray()).each(function(t,e){s[e.name]=e.value}),s["install[action]"]="presetsActivate",s["install[token]"]=e,r.ajax({url:n.getUrl(),method:"POST",data:s,cache:!1,success:function(t){!0===t.success&&Array.isArray(t.status)?t.status.forEach(function(t){o.showMessage(t.title,t.message,t.severity)}):o.error("Something went wrong")},error:function(e){n.handleAjaxError(e,t)}})},t}())});
\ No newline at end of file
+var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();define(["require","exports","./AbstractInteractableModule","jquery","../Router","TYPO3/CMS/Backend/Notification","bootstrap"],function(t,e,n,r,o,a){"use strict";return new(function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.selectorActivateTrigger=".t3js-presets-activate",e.selectorImageExecutable=".t3js-presets-image-executable",e.selectorImageExecutableTrigger=".t3js-presets-image-executable-trigger",e}return __extends(e,t),e.prototype.initialize=function(t){var e=this;this.currentModal=t,this.getContent(),t.on("click",this.selectorImageExecutableTrigger,function(t){t.preventDefault(),e.getCustomImagePathContent()}),t.on("click",this.selectorActivateTrigger,function(t){t.preventDefault(),e.activate()}),t.find(".t3js-custom-preset").on("input",".t3js-custom-preset",function(t){r("#"+r(t.currentTarget).data("radio")).prop("checked",!0)})},e.prototype.getContent=function(){var t=this.getModalBody();r.ajax({url:o.getUrl("presetsGetContent"),cache:!1,success:function(e){!0===e.success&&"undefined"!==e.html&&e.html.length>0?t.empty().append(e.html):a.error("Something went wrong")},error:function(e){o.handleAjaxError(e,t)}})},e.prototype.getCustomImagePathContent=function(){var t=this.getModalBody(),e=this.getModuleContent().data("presets-content-token");r.ajax({url:o.getUrl(),method:"POST",data:{install:{token:e,action:"presetsGetContent",values:{Image:{additionalSearchPath:this.findInModal(this.selectorImageExecutable).val()}}}},cache:!1,success:function(e){!0===e.success&&"undefined"!==e.html&&e.html.length>0?t.empty().append(e.html):a.error("Something went wrong")},error:function(e){o.handleAjaxError(e,t)}})},e.prototype.activate=function(){var t=this.getModalBody(),e=this.getModuleContent().data("presets-activate-token"),n={};r(this.findInModal("form").serializeArray()).each(function(t,e){n[e.name]=e.value}),n["install[action]"]="presetsActivate",n["install[token]"]=e,r.ajax({url:o.getUrl(),method:"POST",data:n,cache:!1,success:function(t){!0===t.success&&Array.isArray(t.status)?t.status.forEach(function(t){a.showMessage(t.title,t.message,t.severity)}):a.error("Something went wrong")},error:function(e){o.handleAjaxError(e,t)}})},e}(n.AbstractInteractableModule))});
\ No newline at end of file
index c7d9a83..9ac4ff3 100644 (file)
@@ -10,4 +10,4 @@
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require","exports","jquery","../Router","TYPO3/CMS/Backend/Notification"],function(t,e,r,o,n){"use strict";return new(function(){function t(){this.selectorModalBody=".t3js-modal-body",this.currentModal={}}return t.prototype.initialize=function(t){this.currentModal=t,this.getData()},t.prototype.getData=function(){var t=this.currentModal.find(this.selectorModalBody);r.ajax({url:o.getUrl("systemInformationGetData"),cache:!1,success:function(e){!0===e.success?t.empty().append(e.html):n.error("Something went wrong")},error:function(e){o.handleAjaxError(e,t)}})},t}())});
\ No newline at end of file
+var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();define(["require","exports","./AbstractInteractableModule","jquery","../Router","TYPO3/CMS/Backend/Notification"],function(t,e,n,r,o,i){"use strict";return new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.initialize=function(t){this.currentModal=t,this.getData()},e.prototype.getData=function(){var t=this.getModalBody();r.ajax({url:o.getUrl("systemInformationGetData"),cache:!1,success:function(e){!0===e.success?t.empty().append(e.html):i.error("Something went wrong")},error:function(e){o.handleAjaxError(e,t)}})},e}(n.AbstractInteractableModule))});
\ No newline at end of file
index a295a67..a4cdb52 100644 (file)
@@ -10,4 +10,4 @@
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require","exports","jquery","../Router","TYPO3/CMS/Backend/Notification","bootstrap"],function(t,e,s,r,n){"use strict";return new(function(){function e(){this.selectorModalBody=".t3js-modal-body",this.selectorModuleContent=".t3js-module-content",this.selectorWriteTrigger=".t3js-systemMaintainer-write",this.selectorChosenContainer=".t3js-systemMaintainer-chosen",this.selectorChosenField=".t3js-systemMaintainer-chosen-select"}return e.prototype.initialize=function(e){var s=this;this.currentModal=e,window.location!==window.parent.location?top.require(["TYPO3/CMS/Install/chosen.jquery.min"],function(){s.getList()}):t(["TYPO3/CMS/Install/chosen.jquery.min"],function(){s.getList()}),e.on("click",this.selectorWriteTrigger,function(t){t.preventDefault(),s.write()})},e.prototype.getList=function(){var t=this,e=this.currentModal.find(this.selectorModalBody);s.ajax({url:r.getUrl("systemMaintainerGetList"),cache:!1,success:function(r){if(!0===r.success){Array.isArray(r.status)&&r.status.forEach(function(t){n.success(t.title,t.message)}),e.html(r.html),Array.isArray(r.users)&&r.users.forEach(function(r){var n=r.username;r.disable&&(n="[DISABLED] "+n);var i=s("<option>",{value:r.uid}).text(n);r.isSystemMaintainer&&i.attr("selected","selected"),e.find(t.selectorChosenField).append(i)});var i={".t3js-systemMaintainer-chosen-select":{width:"100%",placeholder_text_multiple:"users"}};for(var o in i)i.hasOwnProperty(o)&&e.find(o).chosen(i[o]);e.find(t.selectorChosenContainer).show(),e.find(t.selectorChosenField).trigger("chosen:updated")}},error:function(t){r.handleAjaxError(t,e)}})},e.prototype.write=function(){var t=this.currentModal.find(this.selectorModalBody),e=this.currentModal.find(this.selectorModuleContent).data("system-maintainer-write-token"),i=this.currentModal.find(this.selectorChosenField).val();s.ajax({method:"POST",url:r.getUrl(),data:{install:{users:i,token:e,action:"systemMaintainerWrite"}},success:function(t){!0===t.success?Array.isArray(t.status)&&t.status.forEach(function(t){n.success(t.title,t.message)}):n.error("Something went wrong")},error:function(e){r.handleAjaxError(e,t)}})},e}())});
\ No newline at end of file
+var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();define(["require","exports","./AbstractInteractableModule","jquery","../Router","TYPO3/CMS/Backend/Notification","bootstrap"],function(t,e,n,r,s,i){"use strict";return new(function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.selectorWriteTrigger=".t3js-systemMaintainer-write",t.selectorChosenContainer=".t3js-systemMaintainer-chosen",t.selectorChosenField=".t3js-systemMaintainer-chosen-select",t}return __extends(n,e),n.prototype.initialize=function(e){var n=this;this.currentModal=e,window.location!==window.parent.location?top.require(["TYPO3/CMS/Install/chosen.jquery.min"],function(){n.getList()}):t(["TYPO3/CMS/Install/chosen.jquery.min"],function(){n.getList()}),e.on("click",this.selectorWriteTrigger,function(t){t.preventDefault(),n.write()})},n.prototype.getList=function(){var t=this,e=this.getModalBody();r.ajax({url:s.getUrl("systemMaintainerGetList"),cache:!1,success:function(n){if(!0===n.success){Array.isArray(n.status)&&n.status.forEach(function(t){i.success(t.title,t.message)}),e.html(n.html),Array.isArray(n.users)&&n.users.forEach(function(n){var s=n.username;n.disable&&(s="[DISABLED] "+s);var i=r("<option>",{value:n.uid}).text(s);n.isSystemMaintainer&&i.attr("selected","selected"),e.find(t.selectorChosenField).append(i)});var s={".t3js-systemMaintainer-chosen-select":{width:"100%",placeholder_text_multiple:"users"}};for(var o in s)s.hasOwnProperty(o)&&e.find(o).chosen(s[o]);e.find(t.selectorChosenContainer).show(),e.find(t.selectorChosenField).trigger("chosen:updated")}},error:function(t){s.handleAjaxError(t,e)}})},n.prototype.write=function(){var t=this.getModalBody(),e=this.getModuleContent().data("system-maintainer-write-token"),n=this.findInModal(this.selectorChosenField).val();r.ajax({method:"POST",url:s.getUrl(),data:{install:{users:n,token:e,action:"systemMaintainerWrite"}},success:function(t){!0===t.success?Array.isArray(t.status)&&t.status.forEach(function(t){i.success(t.title,t.message)}):i.error("Something went wrong")},error:function(e){s.handleAjaxError(e,t)}})},n}(n.AbstractInteractableModule))});
\ No newline at end of file
index 97dbaf1..4d60cbe 100644 (file)
@@ -10,4 +10,4 @@
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require","exports","jquery","../Router","../Renderable/ProgressBar","../Renderable/Severity","../Renderable/InfoBox","TYPO3/CMS/Backend/Notification"],function(e,t,n,r,o,i,s,a){"use strict";return new(function(){function e(){this.selectorModalBody=".t3js-modal-body",this.selectorCheckTrigger=".t3js-tcaExtTablesCheck-check",this.selectorOutputContainer=".t3js-tcaExtTablesCheck-output"}return e.prototype.initialize=function(e){var t=this;this.currentModal=e,this.check(),e.on("click",this.selectorCheckTrigger,function(e){e.preventDefault(),t.check()})},e.prototype.check=function(){var e=this,t=this.currentModal.find(this.selectorModalBody),c=n(this.selectorOutputContainer),l=o.render(i.loading,"Loading...","");c.empty().html(l),n.ajax({url:r.getUrl("tcaExtTablesCheck"),cache:!1,success:function(n){if(t.empty().append(n.html),!0===n.success&&Array.isArray(n.status))if(n.status.length>0){var r=s.render(i.warning,"Extensions change TCA in ext_tables.php",'Check for ExtensionManagementUtility and $GLOBALS["TCA"]');t.find(e.selectorOutputContainer).append(r),n.status.forEach(function(e){var n=s.render(e.severity,e.title,e.message);c.append(n),t.append(n)})}else{r=s.render(i.ok,"No TCA changes in ext_tables.php files. Good job!","");t.find(e.selectorOutputContainer).append(r)}else a.error("Something went wrong",'Use "Check for broken extensions"')},error:function(e){r.handleAjaxError(e,t)}})},e}())});
\ No newline at end of file
+var __extends=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();define(["require","exports","./AbstractInteractableModule","jquery","../Router","../Renderable/ProgressBar","../Renderable/Severity","../Renderable/InfoBox","TYPO3/CMS/Backend/Notification"],function(e,t,n,r,o,a,i,s,c){"use strict";return new(function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.selectorCheckTrigger=".t3js-tcaExtTablesCheck-check",t.selectorOutputContainer=".t3js-tcaExtTablesCheck-output",t}return __extends(t,e),t.prototype.initialize=function(e){var t=this;this.currentModal=e,this.check(),e.on("click",this.selectorCheckTrigger,function(e){e.preventDefault(),t.check()})},t.prototype.check=function(){var e=this,t=this.getModalBody(),n=r(this.selectorOutputContainer),u=a.render(i.loading,"Loading...","");n.empty().html(u),r.ajax({url:o.getUrl("tcaExtTablesCheck"),cache:!1,success:function(r){if(t.empty().append(r.html),!0===r.success&&Array.isArray(r.status))if(r.status.length>0){var o=s.render(i.warning,"Extensions change TCA in ext_tables.php",'Check for ExtensionManagementUtility and $GLOBALS["TCA"]');t.find(e.selectorOutputContainer).append(o),r.status.forEach(function(e){var r=s.render(e.severity,e.title,e.message);n.append(r),t.append(r)})}else{o=s.render(i.ok,"No TCA changes in ext_tables.php files. Good job!","");t.find(e.selectorOutputContainer).append(o)}else c.error("Something went wrong",'Use "Check for broken extensions"')},error:function(e){o.handleAjaxError(e,t)}})},t}(n.AbstractInteractableModule))});
\ No newline at end of file
index 0f03d95..6ee4f51 100644 (file)
@@ -10,4 +10,4 @@
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require","exports","jquery","../Router","../Renderable/ProgressBar","../Renderable/FlashMessage","../Renderable/Severity","../Renderable/InfoBox"],function(e,t,r,n,o,i,s,a){"use strict";return new(function(){function e(){this.selectorModalBody=".t3js-modal-body",this.selectorCheckTrigger=".t3js-tcaMigrationsCheck-check",this.selectorOutputContainer=".t3js-tcaMigrationsCheck-output"}return e.prototype.initialize=function(e){var t=this;this.currentModal=e,this.check(),e.on("click",this.selectorCheckTrigger,function(e){e.preventDefault(),t.check()})},e.prototype.check=function(){var e=this,t=r(this.selectorOutputContainer),c=this.currentModal.find(this.selectorModalBody),l=o.render(s.loading,"Loading...","");t.empty().html(l),r.ajax({url:n.getUrl("tcaMigrationsCheck"),cache:!1,success:function(t){if(c.empty().append(t.html),!0===t.success&&Array.isArray(t.status))if(t.status.length>0){var r=a.render(s.warning,"TCA migrations need to be applied","Check the following list and apply needed changes.");c.find(e.selectorOutputContainer).empty(),c.find(e.selectorOutputContainer).append(r),t.status.forEach(function(t){var r=a.render(t.severity,t.title,t.message);c.find(e.selectorOutputContainer).append(r)})}else{var n=a.render(s.ok,"No TCA migrations need to be applied","Your TCA looks good.");c.find(e.selectorOutputContainer).append(n)}else{var o=i.render(s.error,"Something went wrong",'Use "Check for broken extensions"');c.find(e.selectorOutputContainer).append(o)}},error:function(e){n.handleAjaxError(e,c)}})},e}())});
\ No newline at end of file
+var __extends=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();define(["require","exports","./AbstractInteractableModule","jquery","../Router","../Renderable/ProgressBar","../Renderable/FlashMessage","../Renderable/Severity","../Renderable/InfoBox"],function(e,t,r,n,o,i,a,s,c){"use strict";return new(function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.selectorCheckTrigger=".t3js-tcaMigrationsCheck-check",t.selectorOutputContainer=".t3js-tcaMigrationsCheck-output",t}return __extends(t,e),t.prototype.initialize=function(e){var t=this;this.currentModal=e,this.check(),e.on("click",this.selectorCheckTrigger,function(e){e.preventDefault(),t.check()})},t.prototype.check=function(){var e=this,t=n(this.selectorOutputContainer),r=this.getModalBody(),u=i.render(s.loading,"Loading...","");t.empty().html(u),n.ajax({url:o.getUrl("tcaMigrationsCheck"),cache:!1,success:function(t){if(r.empty().append(t.html),!0===t.success&&Array.isArray(t.status))if(t.status.length>0){var n=c.render(s.warning,"TCA migrations need to be applied","Check the following list and apply needed changes.");r.find(e.selectorOutputContainer).empty(),r.find(e.selectorOutputContainer).append(n),t.status.forEach(function(t){var n=c.render(t.severity,t.title,t.message);r.find(e.selectorOutputContainer).append(n)})}else{var o=c.render(s.ok,"No TCA migrations need to be applied","Your TCA looks good.");r.find(e.selectorOutputContainer).append(o)}else{var i=a.render(s.error,"Something went wrong",'Use "Check for broken extensions"');r.find(e.selectorOutputContainer).append(i)}},error:function(e){o.handleAjaxError(e,r)}})},t}(r.AbstractInteractableModule))});
\ No newline at end of file
index afec552..b72212a 100644 (file)
@@ -10,4 +10,4 @@
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require","exports","jquery","../Router","TYPO3/CMS/Backend/Notification","bootstrap"],function(e,t,n,o,a){"use strict";return new(function(){function t(){this.selectorModalBody=".t3js-modal-body",this.selectorModuleContent=".t3js-module-content",this.selectorRestFileItem=".upgrade_analysis_item_to_filter",this.selectorFulltextSearch=".t3js-upgradeDocs-fulltext-search",this.selectorChosenField=".t3js-upgradeDocs-chosen-select",this.selectorChangeLogsForVersionContainer=".t3js-version-changes",this.selectorChangeLogsForVersion=".t3js-changelog-list"}return t.trimExplodeAndUnique=function(e,t){for(var o=[],a=t.split(e),r=0;r<a.length;r++){var i=a[r].trim();i.length>0&&-1===n.inArray(i,o)&&o.push(i)}return o},t.prototype.initialize=function(t){var n=this;this.currentModal=t,window.location!==window.parent.location?top.require(["TYPO3/CMS/Install/chosen.jquery.min"],function(){n.getContent()}):e(["TYPO3/CMS/Install/chosen.jquery.min"],function(){n.getContent()}),t.on("click",".t3js-upgradeDocs-markRead",function(e){n.markRead(e.target)}),t.on("click",".t3js-upgradeDocs-unmarkRead",function(e){n.unmarkRead(e.target)}),jQuery.expr[":"].contains=jQuery.expr.createPseudo(function(e){return function(t){return jQuery(t).text().toUpperCase().indexOf(e.toUpperCase())>=0}}),e(["jquery.clearable"],function(){t.find(n.selectorFulltextSearch).clearable().focus()})},t.prototype.getContent=function(){var e=this,t=this.currentModal.find(this.selectorModalBody);n.ajax({url:o.getUrl("upgradeDocsGetContent"),cache:!1,success:function(n){!0===n.success&&"undefined"!==n.html&&n.html.length>0&&(t.empty().append(n.html),e.initializeFullTextSearch(),e.initializeChosenSelector(),e.loadChangelogs())},error:function(e){o.handleAjaxError(e,t)}})},t.prototype.loadChangelogs=function(){var e=this,t=[],r=this.currentModal.find(this.selectorModalBody);this.currentModal.find(this.selectorChangeLogsForVersionContainer).each(function(i,s){var l=n.ajax({url:o.getUrl("upgradeDocsGetChangelogForVersion"),cache:!1,data:{install:{version:s.dataset.version}},success:function(t){if(!0===t.success){var o=n(s),r=o.find(e.selectorChangeLogsForVersion);r.html(t.html),e.renderTags(r),e.moveNotRelevantDocuments(r),o.find(".t3js-panel-loading").remove()}else a.error("Something went wrong")},error:function(e){o.handleAjaxError(e,r)}});t.push(l)}),n.when.apply(n,t).done(function(){e.fulltextSearchField.prop("disabled",!1),e.appendItemsToChosenSelector()})},t.prototype.initializeFullTextSearch=function(){var e=this;this.fulltextSearchField=this.currentModal.find(this.selectorFulltextSearch),this.fulltextSearchField.clearable().focus(),this.initializeChosenSelector(),this.fulltextSearchField.on("keyup",function(){e.combinedFilterSearch()})},t.prototype.initializeChosenSelector=function(){var e=this;this.chosenField=this.currentModal.find(this.selectorModalBody).find(this.selectorChosenField);var t={".chosen-select":{width:"100%",placeholder_text_multiple:"tags"},".chosen-select-deselect":{allow_single_deselect:!0},".chosen-select-no-single":{disable_search_threshold:10},".chosen-select-no-results":{no_results_text:"Oops, nothing found!"},".chosen-select-width":{width:"100%"}};for(var n in t)t.hasOwnProperty(n)&&this.currentModal.find(n).chosen(t[n]);this.chosenField.on("change",function(){e.combinedFilterSearch()})},t.prototype.appendItemsToChosenSelector=function(){var e=this,o="";n(this.currentModal.find(this.selectorRestFileItem)).each(function(e,t){o+=n(t).data("item-tags")+","});var a=t.trimExplodeAndUnique(",",o).sort(function(e,t){return e.toLowerCase().localeCompare(t.toLowerCase())});this.chosenField.prop("disabled",!1),n.each(a,function(t,o){e.chosenField.append(n("<option>").text(o))}),this.chosenField.trigger("chosen:updated")},t.prototype.combinedFilterSearch=function(){var e=this.currentModal.find(this.selectorModalBody),t=e.find("div.item");if(this.chosenField.val().length<1&&this.fulltextSearchField.val().length<1)return n(".panel-version:not(:first) > .panel-collapse").collapse("hide"),t.removeClass("hidden searchhit filterhit"),!1;if(t.addClass("hidden").removeClass("searchhit filterhit"),this.chosenField.val().length>0){t.addClass("hidden").removeClass("filterhit");var o=[],a=[];n.each(this.chosenField.val(),function(e,t){var n='[data-item-tags*="'+t+'"]';t.indexOf(":")>0?o.push(n):a.push(n)});var r=a.join(""),i=[];if(o.length)for(var s=0;s<o.length;s++)i.push(r+o[s]);else i.push(r);var l=i.join(",");e.find(l).removeClass("hidden").addClass("searchhit filterhit")}else t.addClass("filterhit").removeClass("hidden");var d=this.fulltextSearchField.val();return e.find("div.item.filterhit").each(function(e,t){var o=n(t);n(":contains("+d+")",o).length>0||n('input[value*="'+d+'"]',o).length>0?o.removeClass("hidden").addClass("searchhit"):o.removeClass("searchhit").addClass("hidden")}),e.find(".searchhit").closest(".panel-collapse").collapse("show"),e.find(".panel-version").each(function(e,t){var o=n(t);o.find(".searchhit",".filterhit").length<1&&o.find(" > .panel-collapse").collapse("hide")}),!0},t.prototype.renderTags=function(e){n.each(e.find(this.selectorRestFileItem),function(e,t){var o=n(t),a=o.data("item-tags").split(","),r=o.find(".t3js-tags");a.forEach(function(e){r.append(n("<span />",{class:"label"}).text(e))})})},t.prototype.moveNotRelevantDocuments=function(e){e.find('[data-item-state="read"]').appendTo(this.currentModal.find(".panel-body-read")),e.find('[data-item-state="notAffected"]').appendTo(this.currentModal.find(".panel-body-not-affected"))},t.prototype.markRead=function(e){var t=this.currentModal.find(this.selectorModalBody),a=this.currentModal.find(this.selectorModuleContent).data("upgrade-docs-mark-read-token"),r=n(e).closest("a");r.toggleClass("t3js-upgradeDocs-unmarkRead t3js-upgradeDocs-markRead"),r.find("i").toggleClass("fa-check fa-ban"),r.closest(".panel").appendTo(this.currentModal.find(".panel-body-read")),n.ajax({method:"POST",url:o.getUrl(),data:{install:{ignoreFile:r.data("filepath"),token:a,action:"upgradeDocsMarkRead"}},error:function(e){o.handleAjaxError(e,t)}})},t.prototype.unmarkRead=function(e){var t=this.currentModal.find(this.selectorModalBody),a=this.currentModal.find(this.selectorModuleContent).data("upgrade-docs-unmark-read-token"),r=n(e).closest("a"),i=r.closest(".panel").data("item-version");r.toggleClass("t3js-upgradeDocs-markRead t3js-upgradeDocs-unmarkRead"),r.find("i").toggleClass("fa-check fa-ban"),r.closest(".panel").appendTo(this.currentModal.find('*[data-group-version="'+i+'"] .panel-body')),n.ajax({method:"POST",url:o.getUrl(),data:{install:{ignoreFile:r.data("filepath"),token:a,action:"upgradeDocsUnmarkRead"}},error:function(e){o.handleAjaxError(e,t)}})},t}())});
\ No newline at end of file
+var __extends=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function o(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}();define(["require","exports","./AbstractInteractableModule","jquery","../Router","TYPO3/CMS/Backend/Notification","bootstrap"],function(e,t,n,o,a,i){"use strict";return new(function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.selectorRestFileItem=".upgrade_analysis_item_to_filter",e.selectorFulltextSearch=".t3js-upgradeDocs-fulltext-search",e.selectorChosenField=".t3js-upgradeDocs-chosen-select",e.selectorChangeLogsForVersionContainer=".t3js-version-changes",e.selectorChangeLogsForVersion=".t3js-changelog-list",e}return __extends(n,t),n.trimExplodeAndUnique=function(e,t){for(var n=[],a=t.split(e),i=0;i<a.length;i++){var r=a[i].trim();r.length>0&&-1===o.inArray(r,n)&&n.push(r)}return n},n.prototype.initialize=function(t){var n=this;this.currentModal=t,window.location!==window.parent.location?top.require(["TYPO3/CMS/Install/chosen.jquery.min"],function(){n.getContent()}):e(["TYPO3/CMS/Install/chosen.jquery.min"],function(){n.getContent()}),t.on("click",".t3js-upgradeDocs-markRead",function(e){n.markRead(e.target)}),t.on("click",".t3js-upgradeDocs-unmarkRead",function(e){n.unmarkRead(e.target)}),jQuery.expr[":"].contains=jQuery.expr.createPseudo(function(e){return function(t){return jQuery(t).text().toUpperCase().indexOf(e.toUpperCase())>=0}}),e(["jquery.clearable"],function(){t.find(n.selectorFulltextSearch).clearable().focus()})},n.prototype.getContent=function(){var e=this,t=this.getModalBody();o.ajax({url:a.getUrl("upgradeDocsGetContent"),cache:!1,success:function(n){!0===n.success&&"undefined"!==n.html&&n.html.length>0&&(t.empty().append(n.html),e.initializeFullTextSearch(),e.initializeChosenSelector(),e.loadChangelogs())},error:function(e){a.handleAjaxError(e,t)}})},n.prototype.loadChangelogs=function(){var e=this,t=[],n=this.getModalBody();this.findInModal(this.selectorChangeLogsForVersionContainer).each(function(r,s){var l=o.ajax({url:a.getUrl("upgradeDocsGetChangelogForVersion"),cache:!1,data:{install:{version:s.dataset.version}},success:function(t){if(!0===t.success){var n=o(s),a=n.find(e.selectorChangeLogsForVersion);a.html(t.html),e.renderTags(a),e.moveNotRelevantDocuments(a),n.find(".t3js-panel-loading").remove()}else i.error("Something went wrong")},error:function(e){a.handleAjaxError(e,n)}});t.push(l)}),o.when.apply(o,t).done(function(){e.fulltextSearchField.prop("disabled",!1),e.appendItemsToChosenSelector()})},n.prototype.initializeFullTextSearch=function(){var e=this;this.fulltextSearchField=this.findInModal(this.selectorFulltextSearch),this.fulltextSearchField.clearable().focus(),this.initializeChosenSelector(),this.fulltextSearchField.on("keyup",function(){e.combinedFilterSearch()})},n.prototype.initializeChosenSelector=function(){var e=this;this.chosenField=this.getModalBody().find(this.selectorChosenField);var t={".chosen-select":{width:"100%",placeholder_text_multiple:"tags"},".chosen-select-deselect":{allow_single_deselect:!0},".chosen-select-no-single":{disable_search_threshold:10},".chosen-select-no-results":{no_results_text:"Oops, nothing found!"},".chosen-select-width":{width:"100%"}};for(var n in t)t.hasOwnProperty(n)&&this.findInModal(n).chosen(t[n]);this.chosenField.on("change",function(){e.combinedFilterSearch()})},n.prototype.appendItemsToChosenSelector=function(){var e=this,t="";o(this.findInModal(this.selectorRestFileItem)).each(function(e,n){t+=o(n).data("item-tags")+","});var a=n.trimExplodeAndUnique(",",t).sort(function(e,t){return e.toLowerCase().localeCompare(t.toLowerCase())});this.chosenField.prop("disabled",!1),o.each(a,function(t,n){e.chosenField.append(o("<option>").text(n))}),this.chosenField.trigger("chosen:updated")},n.prototype.combinedFilterSearch=function(){var e=this.getModalBody(),t=e.find("div.item");if(this.chosenField.val().length<1&&this.fulltextSearchField.val().length<1)return o(".panel-version:not(:first) > .panel-collapse").collapse("hide"),t.removeClass("hidden searchhit filterhit"),!1;if(t.addClass("hidden").removeClass("searchhit filterhit"),this.chosenField.val().length>0){t.addClass("hidden").removeClass("filterhit");var n=[],a=[];o.each(this.chosenField.val(),function(e,t){var o='[data-item-tags*="'+t+'"]';t.indexOf(":")>0?n.push(o):a.push(o)});var i=a.join(""),r=[];if(n.length)for(var s=0;s<n.length;s++)r.push(i+n[s]);else r.push(i);var l=r.join(",");e.find(l).removeClass("hidden").addClass("searchhit filterhit")}else t.addClass("filterhit").removeClass("hidden");var d=this.fulltextSearchField.val();return e.find("div.item.filterhit").each(function(e,t){var n=o(t);o(":contains("+d+")",n).length>0||o('input[value*="'+d+'"]',n).length>0?n.removeClass("hidden").addClass("searchhit"):n.removeClass("searchhit").addClass("hidden")}),e.find(".searchhit").closest(".panel-collapse").collapse("show"),e.find(".panel-version").each(function(e,t){var n=o(t);n.find(".searchhit",".filterhit").length<1&&n.find(" > .panel-collapse").collapse("hide")}),!0},n.prototype.renderTags=function(e){o.each(e.find(this.selectorRestFileItem),function(e,t){var n=o(t),a=n.data("item-tags").split(","),i=n.find(".t3js-tags");a.forEach(function(e){i.append(o("<span />",{class:"label"}).text(e))})})},n.prototype.moveNotRelevantDocuments=function(e){e.find('[data-item-state="read"]').appendTo(this.findInModal(".panel-body-read")),e.find('[data-item-state="notAffected"]').appendTo(this.findInModal(".panel-body-not-affected"))},n.prototype.markRead=function(e){var t=this.getModalBody(),n=this.getModuleContent().data("upgrade-docs-mark-read-token"),i=o(e).closest("a");i.toggleClass("t3js-upgradeDocs-unmarkRead t3js-upgradeDocs-markRead"),i.find("i").toggleClass("fa-check fa-ban"),i.closest(".panel").appendTo(this.findInModal(".panel-body-read")),o.ajax({method:"POST",url:a.getUrl(),data:{install:{ignoreFile:i.data("filepath"),token:n,action:"upgradeDocsMarkRead"}},error:function(e){a.handleAjaxError(e,t)}})},n.prototype.unmarkRead=function(e){var t=this.getModalBody(),n=this.getModuleContent().data("upgrade-docs-unmark-read-token"),i=o(e).closest("a"),r=i.closest(".panel").data("item-version");i.toggleClass("t3js-upgradeDocs-markRead t3js-upgradeDocs-unmarkRead"),i.find("i").toggleClass("fa-check fa-ban"),i.closest(".panel").appendTo(this.findInModal('*[data-group-version="'+r+'"] .panel-body')),o.ajax({method:"POST",url:a.getUrl(),data:{install:{ignoreFile:i.data("filepath"),token:n,action:"upgradeDocsUnmarkRead"}},error:function(e){a.handleAjaxError(e,t)}})},n}(n.AbstractInteractableModule))});
\ No newline at end of file
index 4e2706f..8d5bd37 100644 (file)
@@ -10,4 +10,4 @@
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require","exports","jquery","../Router","../Renderable/Severity","../Renderable/ProgressBar","../Renderable/InfoBox","../Renderable/FlashMessage","TYPO3/CMS/Backend/Notification","TYPO3/CMS/Core/SecurityUtility","bootstrap"],function(e,t,r,s,a,i,n,o,d,l){"use strict";return new(function(){function e(){this.selectorModalBody=".t3js-modal-body",this.selectorModuleContent=".t3js-module-content",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 l}return e.removeLoadingMessage=function(e){e.find(".alert-loading").remove()},e.renderProgressBar=function(e){return i.render(a.loading,e,"")},e.prototype.initialize=function(e){var t=this;this.currentModal=e,this.getData().done(function(){t.doneUpgrades()}),e.on("click",this.selectorWizardsDoneRowMarkUndone,function(e){t.markUndone(e.target.dataset.identifier)}),e.on("click",this.selectorWizardsBlockingCharsetFix,function(e){t.blockingUpgradesDatabaseCharsetFix()}),e.on("click",this.selectorWizardsBlockingAddsExecute,function(e){t.blockingUpgradesDatabaseAddsExecute()}),e.on("click",this.selectorWizardsListRowExecute,function(e){t.wizardInput(e.target.dataset.identifier,e.target.dataset.title)}),e.on("click",this.selectorWizardsInputPerform,function(e){t.wizardExecute(e.target.dataset.identifier,e.target.dataset.title)})},e.prototype.getData=function(){var e=this,t=this.currentModal.find(this.selectorModalBody);return r.ajax({url:s.getUrl("upgradeWizardsGetData"),cache:!1,success:function(r){!0===r.success?(t.empty().append(r.html),e.blockingUpgradesDatabaseCharsetTest()):d.error("Something went wrong")},error:function(e){s.handleAjaxError(e)}})},e.prototype.blockingUpgradesDatabaseCharsetTest=function(){var t=this,a=this.currentModal.find(this.selectorModalBody),i=this.currentModal.find(this.selectorOutputWizardsContainer);i.empty().html(e.renderProgressBar("Checking database charset...")),r.ajax({url:s.getUrl("upgradeWizardsBlockingDatabaseCharsetTest"),cache:!1,success:function(r){e.removeLoadingMessage(i),!0===r.success&&(!0===r.needsUpdate?a.find(t.selectorOutputWizardsContainer).append(a.find(t.selectorWizardsBlockingCharsetTemplate)).clone():t.blockingUpgradesDatabaseAdds())},error:function(e){s.handleAjaxError(e,i)}})},e.prototype.blockingUpgradesDatabaseCharsetFix=function(){var t=r(this.selectorOutputWizardsContainer);t.empty().html(e.renderProgressBar("Setting database charset to UTF-8...")),r.ajax({url:s.getUrl("upgradeWizardsBlockingDatabaseCharsetFix"),cache:!1,success:function(r){if(e.removeLoadingMessage(t),!0===r.success)Array.isArray(r.status)&&r.status.length>0&&r.status.forEach(function(e){var r=n.render(e.severity,e.title,e.message);t.append(r)});else{var s=o.render(a.error,"Something went wrong","");e.removeLoadingMessage(t),t.append(s)}},error:function(e){s.handleAjaxError(e,t)}})},e.prototype.blockingUpgradesDatabaseAdds=function(){var t=this,a=this.currentModal.find(this.selectorModalBody),i=this.currentModal.find(this.selectorOutputWizardsContainer);i.empty().html(e.renderProgressBar("Check for missing mandatory database tables and fields...")),r.ajax({url:s.getUrl("upgradeWizardsBlockingDatabaseAdds"),cache:!1,success:function(r){if(e.removeLoadingMessage(i),!0===r.success)if(!0===r.needsUpdate){var s=a.find(t.selectorWizardsBlockingAddsTemplate).clone();"object"==typeof r.adds.tables&&r.adds.tables.forEach(function(e){var r="Table: "+t.securityUtility.encodeHtml(e.table);s.find(t.selectorWizardsBlockingAddsRows).append(r,"<br>")}),"object"==typeof r.adds.columns&&r.adds.columns.forEach(function(e){var r="Table: "+t.securityUtility.encodeHtml(e.table)+", Field: "+t.securityUtility.encodeHtml(e.field);s.find(t.selectorWizardsBlockingAddsRows).append(r,"<br>")}),"object"==typeof r.adds.indexes&&r.adds.indexes.forEach(function(e){var r="Table: "+t.securityUtility.encodeHtml(e.table)+", Index: "+t.securityUtility.encodeHtml(e.index);s.find(t.selectorWizardsBlockingAddsRows).append(r,"<br>")}),a.find(t.selectorOutputWizardsContainer).append(s)}else t.wizardsList();else d.error("Something went wrong")},error:function(e){s.handleAjaxError(e,i)}})},e.prototype.blockingUpgradesDatabaseAddsExecute=function(){var t=this,i=this.currentModal.find(this.selectorOutputWizardsContainer);i.empty().html(e.renderProgressBar("Adding database tables and fields...")),r.ajax({url:s.getUrl("upgradeWizardsBlockingDatabaseExecute"),cache:!1,success:function(r){if(e.removeLoadingMessage(i),!0===r.success)Array.isArray(r.status)&&r.status.length>0&&(r.status.forEach(function(e){var t=n.render(e.severity,e.title,e.message);i.append(t)}),t.wizardsList());else{var s=o.render(a.error,"Something went wrong","");e.removeLoadingMessage(i),i.append(s)}},error:function(e){s.handleAjaxError(e,i)}})},e.prototype.wizardsList=function(){var t=this,a=this.currentModal.find(this.selectorModalBody),i=this.currentModal.find(this.selectorOutputWizardsContainer);i.append(e.renderProgressBar("Loading upgrade wizards...")),r.ajax({url:s.getUrl("upgradeWizardsList"),cache:!1,success:function(r){e.removeLoadingMessage(i);var s=a.find(t.selectorWizardsListTemplate).clone();if(s.removeClass("t3js-upgradeWizards-list-template"),!0===r.success){var n=0,o=0;Array.isArray(r.wizards)&&r.wizards.length>0&&(o=r.wizards.length,r.wizards.forEach(function(e){if(!0===e.shouldRenderWizard){var r=a.find(t.selectorWizardsListRowTemplate).clone();n+=1,r.removeClass("t3js-upgradeWizards-list-row-template"),r.find(t.selectorWizardsListRowTitle).empty().text(e.title),r.find(t.selectorWizardsListRowExplanation).empty().text(e.explanation),r.find(t.selectorWizardsListRowExecute).attr("data-identifier",e.identifier).attr("data-title",e.title),s.find(t.selectorWizardsListRows).append(r)}}),s.find(t.selectorWizardsListRows+" hr:last").remove());var l=100,c=s.find(".progress-bar");n>0?l=Math.round((o-n)/r.wizards.length*100):c.removeClass("progress-bar-info").addClass("progress-bar-success"),c.removeClass("progress-bar-striped").css("width",l+"%").attr("aria-valuenow",l).find("span").text(l+"%"),a.find(t.selectorOutputWizardsContainer).append(s),t.currentModal.find(t.selectorWizardsDoneRowMarkUndone).prop("disabled",!1)}else d.error("Something went wrong")},error:function(e){s.handleAjaxError(e,i)}})},e.prototype.wizardInput=function(t,a){var i=this,n=this.currentModal.find(this.selectorModuleContent).data("upgrade-wizards-input-token"),d=this.currentModal.find(this.selectorModalBody),l=this.currentModal.find(this.selectorOutputWizardsContainer);l.empty().html(e.renderProgressBar('Loading "'+a+'"...')),d.animate({scrollTop:d.scrollTop()-Math.abs(d.find(".t3js-upgrade-status-section").position().top)},250),r.ajax({url:s.getUrl(),method:"POST",data:{install:{action:"upgradeWizardsInput",token:n,identifier:t}},cache:!1,success:function(e){l.empty();var t=d.find(i.selectorWizardsInputTemplate).clone();t.removeClass("t3js-upgradeWizards-input"),!0===e.success&&(Array.isArray(e.status)&&e.status.forEach(function(e){var t=o.render(e.severity,e.title,e.message);l.append(t)}),e.userInput.wizardHtml.length>0&&t.find(i.selectorWizardsInputHtml).html(e.userInput.wizardHtml),t.find(i.selectorWizardsInputTitle).text(e.userInput.title),t.find(i.selectorWizardsInputPerform).attr("data-identifier",e.userInput.identifier).attr("data-title",e.userInput.title)),d.find(i.selectorOutputWizardsContainer).append(t)},error:function(e){s.handleAjaxError(e,l)}})},e.prototype.wizardExecute=function(t,a){var i=this,o=this.currentModal.find(this.selectorModuleContent).data("upgrade-wizards-execute-token"),l=this.currentModal.find(this.selectorModalBody),c={"install[action]":"upgradeWizardsExecute","install[token]":o,"install[identifier]":t};r(this.currentModal.find(this.selectorOutputWizardsContainer+" form").serializeArray()).each(function(e,t){c[t.name]=t.value});var u=this.currentModal.find(this.selectorOutputWizardsContainer);u.empty().html(e.renderProgressBar('Executing "'+a+'"...')),this.currentModal.find(this.selectorWizardsDoneRowMarkUndone).prop("disabled",!0),r.ajax({method:"POST",data:c,url:s.getUrl(),cache:!1,success:function(e){u.empty(),!0===e.success?(Array.isArray(e.status)&&e.status.forEach(function(e){var t=n.render(e.severity,e.title,e.message);u.append(t)}),i.wizardsList(),l.find(i.selectorOutputDoneContainer).empty(),i.doneUpgrades()):d.error("Something went wrong")},error:function(e){s.handleAjaxError(e,u)}})},e.prototype.doneUpgrades=function(){var t=this,a=this.currentModal.find(this.selectorModalBody),i=a.find(this.selectorOutputDoneContainer);i.empty().html(e.renderProgressBar("Loading executed upgrade wizards...")),r.ajax({url:s.getUrl("upgradeWizardsDoneUpgrades"),cache:!1,success:function(r){if(e.removeLoadingMessage(i),!0===r.success){Array.isArray(r.status)&&r.status.length>0&&r.status.forEach(function(e){var t=n.render(e.severity,e.title,e.message);i.append(t)});var s=a.find(t.selectorWizardsDoneBodyTemplate).clone(),o=s.find(t.selectorWizardsDoneRows),l=!1;Array.isArray(r.wizardsDone)&&r.wizardsDone.length>0&&r.wizardsDone.forEach(function(e){l=!0;var r=a.find(t.selectorWizardsDoneRowTemplate).clone();r.find(t.selectorWizardsDoneRowMarkUndone).attr("data-identifier",e.identifier),r.find(t.selectorWizardsDoneRowTitle).text(e.title),o.append(r)}),Array.isArray(r.rowUpdatersDone)&&r.rowUpdatersDone.length>0&&r.rowUpdatersDone.forEach(function(e){l=!0;var r=a.find(t.selectorWizardsDoneRowTemplate).clone();r.find(t.selectorWizardsDoneRowMarkUndone).attr("data-identifier",e.identifier),r.find(t.selectorWizardsDoneRowTitle).text(e.title),o.append(r)}),l&&(a.find(t.selectorOutputDoneContainer).append(s),t.currentModal.find(t.selectorWizardsDoneRowMarkUndone).prop("disabled",!0))}else d.error("Something went wrong")},error:function(e){s.handleAjaxError(e,i)}})},e.prototype.markUndone=function(t){var a=this,i=this.currentModal.find(this.selectorModuleContent).data("upgrade-wizards-mark-undone-token"),n=this.currentModal.find(this.selectorModalBody),o=this.currentModal.find(this.selectorOutputDoneContainer);o.empty().html(e.renderProgressBar("Marking upgrade wizard as undone...")),r.ajax({url:s.getUrl(),method:"POST",data:{install:{action:"upgradeWizardsMarkUndone",token:i,identifier:t}},cache:!1,success:function(e){o.empty(),n.find(a.selectorOutputDoneContainer).empty(),!0===e.success&&Array.isArray(e.status)?e.status.forEach(function(e){d.success(e.message),a.doneUpgrades(),a.blockingUpgradesDatabaseCharsetTest()}):d.error("Something went wrong")},error:function(e){s.handleAjaxError(e,o)}})},e}())});
\ No newline at end of file
+var __extends=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function a(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(a.prototype=r.prototype,new a)}}();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,r,a,s,i,n,o,d,l,c){"use strict";return new(function(e){function t(){var t=e.call(this)||this;return t.selectorOutputWizardsContainer=".t3js-upgradeWizards-wizards-output",t.selectorOutputDoneContainer=".t3js-upgradeWizards-done-output",t.selectorWizardsBlockingAddsTemplate=".t3js-upgradeWizards-blocking-adds-template",t.selectorWizardsBlockingAddsRows=".t3js-upgradeWizards-blocking-adds-rows",t.selectorWizardsBlockingAddsExecute=".t3js-upgradeWizards-blocking-adds-execute",t.selectorWizardsBlockingCharsetTemplate=".t3js-upgradeWizards-blocking-charset-template",t.selectorWizardsBlockingCharsetFix=".t3js-upgradeWizards-blocking-charset-fix",t.selectorWizardsDoneBodyTemplate=".t3js-upgradeWizards-done-body-template",t.selectorWizardsDoneRows=".t3js-upgradeWizards-done-rows",t.selectorWizardsDoneRowTemplate=".t3js-upgradeWizards-done-row-template table tr",t.selectorWizardsDoneRowMarkUndone=".t3js-upgradeWizards-done-markUndone",t.selectorWizardsDoneRowTitle=".t3js-upgradeWizards-done-title",t.selectorWizardsListTemplate=".t3js-upgradeWizards-list-template",t.selectorWizardsListRows=".t3js-upgradeWizards-list-rows",t.selectorWizardsListRowTemplate=".t3js-upgradeWizards-list-row-template",t.selectorWizardsListRowTitle=".t3js-upgradeWizards-list-row-title",t.selectorWizardsListRowExplanation=".t3js-upgradeWizards-list-row-explanation",t.selectorWizardsListRowExecute=".t3js-upgradeWizards-list-row-execute",t.selectorWizardsInputTemplate=".t3js-upgradeWizards-input",t.selectorWizardsInputTitle=".t3js-upgradeWizards-input-title",t.selectorWizardsInputHtml=".t3js-upgradeWizards-input-html",t.selectorWizardsInputPerform=".t3js-upgradeWizards-input-perform",t.securityUtility=new c,t}return __extends(t,e),t.removeLoadingMessage=function(e){e.find(".alert-loading").remove()},t.renderProgressBar=function(e){return n.render(i.loading,e,"")},t.prototype.initialize=function(e){var t=this;this.currentModal=e,this.getData().done(function(){t.doneUpgrades()}),e.on("click",this.selectorWizardsDoneRowMarkUndone,function(e){t.markUndone(e.target.dataset.identifier)}),e.on("click",this.selectorWizardsBlockingCharsetFix,function(e){t.blockingUpgradesDatabaseCharsetFix()}),e.on("click",this.selectorWizardsBlockingAddsExecute,function(e){t.blockingUpgradesDatabaseAddsExecute()}),e.on("click",this.selectorWizardsListRowExecute,function(e){t.wizardInput(e.target.dataset.identifier,e.target.dataset.title)}),e.on("click",this.selectorWizardsInputPerform,function(e){t.wizardExecute(e.target.dataset.identifier,e.target.dataset.title)})},t.prototype.getData=function(){var e=this,t=this.getModalBody();return a.ajax({url:s.getUrl("upgradeWizardsGetData"),cache:!1,success:function(r){!0===r.success?(t.empty().append(r.html),e.blockingUpgradesDatabaseCharsetTest()):l.error("Something went wrong")},error:function(e){s.handleAjaxError(e)}})},t.prototype.blockingUpgradesDatabaseCharsetTest=function(){var e=this,r=this.getModalBody(),i=this.findInModal(this.selectorOutputWizardsContainer);i.empty().html(t.renderProgressBar("Checking database charset...")),a.ajax({url:s.getUrl("upgradeWizardsBlockingDatabaseCharsetTest"),cache:!1,success:function(a){t.removeLoadingMessage(i),!0===a.success&&(!0===a.needsUpdate?r.find(e.selectorOutputWizardsContainer).append(r.find(e.selectorWizardsBlockingCharsetTemplate)).clone():e.blockingUpgradesDatabaseAdds())},error:function(e){s.handleAjaxError(e,i)}})},t.prototype.blockingUpgradesDatabaseCharsetFix=function(){var e=a(this.selectorOutputWizardsContainer);e.empty().html(t.renderProgressBar("Setting database charset to UTF-8...")),a.ajax({url:s.getUrl("upgradeWizardsBlockingDatabaseCharsetFix"),cache:!1,success:function(r){if(t.removeLoadingMessage(e),!0===r.success)Array.isArray(r.status)&&r.status.length>0&&r.status.forEach(function(t){var r=o.render(t.severity,t.title,t.message);e.append(r)});else{var a=d.render(i.error,"Something went wrong","");t.removeLoadingMessage(e),e.append(a)}},error:function(t){s.handleAjaxError(t,e)}})},t.prototype.blockingUpgradesDatabaseAdds=function(){var e=this,r=this.getModalBody(),i=this.findInModal(this.selectorOutputWizardsContainer);i.empty().html(t.renderProgressBar("Check for missing mandatory database tables and fields...")),a.ajax({url:s.getUrl("upgradeWizardsBlockingDatabaseAdds"),cache:!1,success:function(a){if(t.removeLoadingMessage(i),!0===a.success)if(!0===a.needsUpdate){var s=r.find(e.selectorWizardsBlockingAddsTemplate).clone();"object"==typeof a.adds.tables&&a.adds.tables.forEach(function(t){var r="Table: "+e.securityUtility.encodeHtml(t.table);s.find(e.selectorWizardsBlockingAddsRows).append(r,"<br>")}),"object"==typeof a.adds.columns&&a.adds.columns.forEach(function(t){var r="Table: "+e.securityUtility.encodeHtml(t.table)+", Field: "+e.securityUtility.encodeHtml(t.field);s.find(e.selectorWizardsBlockingAddsRows).append(r,"<br>")}),"object"==typeof a.adds.indexes&&a.adds.indexes.forEach(function(t){var r="Table: "+e.securityUtility.encodeHtml(t.table)+", Index: "+e.securityUtility.encodeHtml(t.index);s.find(e.selectorWizardsBlockingAddsRows).append(r,"<br>")}),r.find(e.selectorOutputWizardsContainer).append(s)}else e.wizardsList();else l.error("Something went wrong")},error:function(e){s.handleAjaxError(e,i)}})},t.prototype.blockingUpgradesDatabaseAddsExecute=function(){var e=this,r=this.findInModal(this.selectorOutputWizardsContainer);r.empty().html(t.renderProgressBar("Adding database tables and fields...")),a.ajax({url:s.getUrl("upgradeWizardsBlockingDatabaseExecute"),cache:!1,success:function(a){if(t.removeLoadingMessage(r),!0===a.success)Array.isArray(a.status)&&a.status.length>0&&(a.status.forEach(function(e){var t=o.render(e.severity,e.title,e.message);r.append(t)}),e.wizardsList());else{var s=d.render(i.error,"Something went wrong","");t.removeLoadingMessage(r),r.append(s)}},error:function(e){s.handleAjaxError(e,r)}})},t.prototype.wizardsList=function(){var e=this,r=this.getModalBody(),i=this.findInModal(this.selectorOutputWizardsContainer);i.append(t.renderProgressBar("Loading upgrade wizards...")),a.ajax({url:s.getUrl("upgradeWizardsList"),cache:!1,success:function(a){t.removeLoadingMessage(i);var s=r.find(e.selectorWizardsListTemplate).clone();if(s.removeClass("t3js-upgradeWizards-list-template"),!0===a.success){var n=0,o=0;Array.isArray(a.wizards)&&a.wizards.length>0&&(o=a.wizards.length,a.wizards.forEach(function(t){if(!0===t.shouldRenderWizard){var a=r.find(e.selectorWizardsListRowTemplate).clone();n+=1,a.removeClass("t3js-upgradeWizards-list-row-template"),a.find(e.selectorWizardsListRowTitle).empty().text(t.title),a.find(e.selectorWizardsListRowExplanation).empty().text(t.explanation),a.find(e.selectorWizardsListRowExecute).attr("data-identifier",t.identifier).attr("data-title",t.title),s.find(e.selectorWizardsListRows).append(a)}}),s.find(e.selectorWizardsListRows+" hr:last").remove());var d=100,c=s.find(".progress-bar");n>0?d=Math.round((o-n)/a.wizards.length*100):c.removeClass("progress-bar-info").addClass("progress-bar-success"),c.removeClass("progress-bar-striped").css("width",d+"%").attr("aria-valuenow",d).find("span").text(d+"%"),r.find(e.selectorOutputWizardsContainer).append(s),e.findInModal(e.selectorWizardsDoneRowMarkUndone).prop("disabled",!1)}else l.error("Something went wrong")},error:function(e){s.handleAjaxError(e,i)}})},t.prototype.wizardInput=function(e,r){var i=this,n=this.getModuleContent().data("upgrade-wizards-input-token"),o=this.getModalBody(),l=this.findInModal(this.selectorOutputWizardsContainer);l.empty().html(t.renderProgressBar('Loading "'+r+'"...')),o.animate({scrollTop:o.scrollTop()-Math.abs(o.find(".t3js-upgrade-status-section").position().top)},250),a.ajax({url:s.getUrl(),method:"POST",data:{install:{action:"upgradeWizardsInput",token:n,identifier:e}},cache:!1,success:function(e){l.empty();var t=o.find(i.selectorWizardsInputTemplate).clone();t.removeClass("t3js-upgradeWizards-input"),!0===e.success&&(Array.isArray(e.status)&&e.status.forEach(function(e){var t=d.render(e.severity,e.title,e.message);l.append(t)}),e.userInput.wizardHtml.length>0&&t.find(i.selectorWizardsInputHtml).html(e.userInput.wizardHtml),t.find(i.selectorWizardsInputTitle).text(e.userInput.title),t.find(i.selectorWizardsInputPerform).attr("data-identifier",e.userInput.identifier).attr("data-title",e.userInput.title)),o.find(i.selectorOutputWizardsContainer).append(t)},error:function(e){s.handleAjaxError(e,l)}})},t.prototype.wizardExecute=function(e,r){var i=this,n=this.getModuleContent().data("upgrade-wizards-execute-token"),d=this.getModalBody(),c={"install[action]":"upgradeWizardsExecute","install[token]":n,"install[identifier]":e};a(this.findInModal(this.selectorOutputWizardsContainer+" form").serializeArray()).each(function(e,t){c[t.name]=t.value});var u=this.findInModal(this.selectorOutputWizardsContainer);u.empty().html(t.renderProgressBar('Executing "'+r+'"...')),this.findInModal(this.selectorWizardsDoneRowMarkUndone).prop("disabled",!0),a.ajax({method:"POST",data:c,url:s.getUrl(),cache:!1,success:function(e){u.empty(),!0===e.success?(Array.isArray(e.status)&&e.status.forEach(function(e){var t=o.render(e.severity,e.title,e.message);u.append(t)}),i.wizardsList(),d.find(i.selectorOutputDoneContainer).empty(),i.doneUpgrades()):l.error("Something went wrong")},error:function(e){s.handleAjaxError(e,u)}})},t.prototype.doneUpgrades=function(){var e=this,r=this.getModalBody(),i=r.find(this.selectorOutputDoneContainer);i.empty().html(t.renderProgressBar("Loading executed upgrade wizards...")),a.ajax({url:s.getUrl("upgradeWizardsDoneUpgrades"),cache:!1,success:function(a){if(t.removeLoadingMessage(i),!0===a.success){Array.isArray(a.status)&&a.status.length>0&&a.status.forEach(function(e){var t=o.render(e.severity,e.title,e.message);i.append(t)});var s=r.find(e.selectorWizardsDoneBodyTemplate).clone(),n=s.find(e.selectorWizardsDoneRows),d=!1;Array.isArray(a.wizardsDone)&&a.wizardsDone.length>0&&a.wizardsDone.forEach(function(t){d=!0;var a=r.find(e.selectorWizardsDoneRowTemplate).clone();a.find(e.selectorWizardsDoneRowMarkUndone).attr("data-identifier",t.identifier),a.find(e.selectorWizardsDoneRowTitle).text(t.title),n.append(a)}),Array.isArray(a.rowUpdatersDone)&&a.rowUpdatersDone.length>0&&a.rowUpdatersDone.forEach(function(t){d=!0;var a=r.find(e.selectorWizardsDoneRowTemplate).clone();a.find(e.selectorWizardsDoneRowMarkUndone).attr("data-identifier",t.identifier),a.find(e.selectorWizardsDoneRowTitle).text(t.title),n.append(a)}),d&&(r.find(e.selectorOutputDoneContainer).append(s),e.findInModal(e.selectorWizardsDoneRowMarkUndone).prop("disabled",!0))}else l.error("Something went wrong")},error:function(e){s.handleAjaxError(e,i)}})},t.prototype.markUndone=function(e){var r=this,i=this.getModuleContent().data("upgrade-wizards-mark-undone-token"),n=this.getModalBody(),o=this.findInModal(this.selectorOutputDoneContainer);o.empty().html(t.renderProgressBar("Marking upgrade wizard as undone...")),a.ajax({url:s.getUrl(),method:"POST",data:{install:{action:"upgradeWizardsMarkUndone",token:i,identifier:e}},cache:!1,success:function(e){o.empty(),n.find(r.selectorOutputDoneContainer).empty(),!0===e.success&&Array.isArray(e.status)?e.status.forEach(function(e){l.success(e.message),r.doneUpgrades(),r.blockingUpgradesDatabaseCharsetTest()}):l.error("Something went wrong")},error:function(e){s.handleAjaxError(e,o)}})},t}(r.AbstractInteractableModule))});
\ No newline at end of file