Commit 28a25f4f authored by Frank Nägler's avatar Frank Nägler Committed by Andreas Fernandez
Browse files

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

This patch migrates all install tool JS files to TypeScript.
It also improves the performance by a better caching and
with less request for modules.

Resolves: #87724
Releases: master
Change-Id: I555924008bf19eb4394268acc231eca91d8b16c6
Reviewed-on: https://review.typo3.org/c/59709


Tested-by: Markus Klein's avatarMarkus Klein <markus.klein@typo3.org>
Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Markus Klein's avatarMarkus Klein <markus.klein@typo3.org>
Reviewed-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
parent fe6e678d
......@@ -22,8 +22,8 @@ declare namespace TYPO3 {
export let Tooltip: any;
export let Utility: any;
export let Wizard: any;
export let settings: any;
export const lang: { [key: string]: string };
export const settings: any;
export const configuration: any;
export namespace CMS {
export namespace Backend {
......@@ -92,6 +92,7 @@ interface Window {
delayedImportElement: (objectId: number, table: string, uid: number, type: string) => void,
};
rawurlencode: Function;
require: Function;
list_frame: Window;
jump: Function;
currentSubScript: string;
......@@ -130,6 +131,8 @@ interface JQueryTypedEvent<T extends Event> extends JQueryEventObject {
interface JQuery {
clearable(options?: any): JQuery;
chosen(options?: any): JQuery;
datetimepicker(options?: any): JQuery;
dragUploader(options?: any): JQuery;
......
......@@ -68,7 +68,12 @@ class InstallerController
*/
public function initAction(): ResponseInterface
{
$bust = $GLOBALS['EXEC_TIME'];
if (!GeneralUtility::getApplicationContext()->isDevelopment()) {
$bust = GeneralUtility::hmac(TYPO3_version . Environment::getProjectPath());
}
$view = $this->initializeStandaloneView('Installer/Init.html');
$view->assign('bust', $bust);
return new HtmlResponse(
$view->render(),
200,
......
......@@ -18,8 +18,10 @@ namespace TYPO3\CMS\Install\Controller;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use TYPO3\CMS\Core\Configuration\ExtensionConfiguration;
use TYPO3\CMS\Core\Core\Environment;
use TYPO3\CMS\Core\Http\HtmlResponse;
use TYPO3\CMS\Core\Http\JsonResponse;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Install\Service\Exception\ConfigurationChangedException;
use TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService;
......@@ -41,10 +43,14 @@ class LayoutController extends AbstractController
*/
public function initAction(ServerRequestInterface $request): ResponseInterface
{
$bust = $GLOBALS['EXEC_TIME'];
if (!GeneralUtility::getApplicationContext()->isDevelopment()) {
$bust = GeneralUtility::hmac(TYPO3_version . Environment::getProjectPath());
}
$view = $this->initializeStandaloneView($request, 'Layout/Init.html');
$view->assignMultiple([
// time is used as cache bust for js and css resources
'time' => time(),
'bust' => $bust,
'siteName' => $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'],
]);
return new HtmlResponse(
......
......@@ -9,7 +9,7 @@
<p class="card-text">Gives an overview of your host environment including its web server, PHP version and selected database.</p>
</div>
<div class="card-footer">
<a href="#" class="btn btn-default" data-modal-size="small" data-require="TYPO3/CMS/Install/SystemInformation">Show System Information</a>
<a href="#" class="btn btn-default" data-modal-size="small" data-require="TYPO3/CMS/Install/Module/SystemInformation">Show System Information</a>
</div>
</div>
<div class="card card-size-fixed-small">
......@@ -18,7 +18,7 @@
<p class="card-text">Analyzes your host environment, identifying any issues that may prevent TYPO3 from running correctly.</p>
</div>
<div class="card-footer">
<a href="#" class="btn btn-default" data-require="TYPO3/CMS/Install/EnvironmentCheck">Check Environment</a>
<a href="#" class="btn btn-default" data-require="TYPO3/CMS/Install/Module/EnvironmentCheck">Check Environment</a>
</div>
</div>
<div class="card card-size-fixed-small">
......@@ -27,7 +27,7 @@
<p class="card-text">Analyzes your folder structure, checking files and directories for correct permissions and identifying any files or directories that may be missing from your installation.</p>
</div>
<div class="card-footer">
<a href="#" class="btn btn-default" data-require="TYPO3/CMS/Install/FolderStructure">Check Directory Status</a>
<a href="#" class="btn btn-default" data-require="TYPO3/CMS/Install/Module/FolderStructure">Check Directory Status</a>
</div>
</div>
<div class="card card-size-fixed-small">
......@@ -36,7 +36,7 @@
<p class="card-text">Outputs detailed information about your installation of PHP. Including version details and enabled PHP extensions.</p>
</div>
<div class="card-footer">
<a href="#" class="btn btn-default" data-require="TYPO3/CMS/Install/PhpInfo">View PHP Info</a>
<a href="#" class="btn btn-default" data-require="TYPO3/CMS/Install/Module/PhpInfo">View PHP Info</a>
</div>
</div>
<div class="card card-size-fixed-small">
......@@ -45,7 +45,7 @@
<p class="card-text">Test your mail configuration by sending out a dummy email via TYPO3.</p>
</div>
<div class="card-footer">
<a href="#" class="btn btn-default" data-require="TYPO3/CMS/Install/MailTest">Test Mail Setup</a>
<a href="#" class="btn btn-default" data-require="TYPO3/CMS/Install/Module/MailTest">Test Mail Setup</a>
</div>
</div>
<div class="card card-size-fixed-small">
......@@ -54,7 +54,7 @@
<p class="card-text">Creates test images and compares them against a set of reference images to help ensure that image processing is working correctly within your environment.</p>
</div>
<div class="card-footer">
<a href="#" class="btn btn-default" data-require="TYPO3/CMS/Install/ImageProcessing">Test Images</a>
<a href="#" class="btn btn-default" data-require="TYPO3/CMS/Install/Module/ImageProcessing">Test Images</a>
</div>
</div>
</div>
......
......@@ -4,11 +4,16 @@
<title>Installing TYPO3 CMS</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="{f:uri.resource(path: 'Css/backend.css', extensionName: 'backend')}?{time}" />
<link rel="icon" type="image/vnd.microsoft.icon" href="{f:uri.resource(path: 'Icons/favicon.ico')}?{time}" />
<script type="text/javascript" src="{f:uri.resource(path: 'JavaScript/RequireJSConfig.js')}?{time}"></script>
<script type="text/javascript" src="{f:uri.resource(path: 'JavaScript/Contrib/require.js', extensionName: 'Core')}?{time}"></script>
<script type="text/javascript" src="{f:uri.resource(path: 'JavaScript/Installer.js')}?{time}"></script>
<link rel="stylesheet" type="text/css" href="{f:uri.resource(path: 'Css/backend.css', extensionName: 'backend')}?{bust}" />
<link rel="icon" type="image/vnd.microsoft.icon" href="{f:uri.resource(path: 'Icons/favicon.ico')}?{bust}" />
<script>
var __bust = '{bust}';
</script>
<script type="text/javascript" src="{f:uri.resource(path: 'JavaScript/RequireJSConfig.js')}?{bust}"></script>
<script type="text/javascript" src="{f:uri.resource(path: 'JavaScript/Contrib/require.js', extensionName: 'Core')}?{bust}"></script>
<script type="text/javascript">
require(['TYPO3/CMS/Install/Installer']);
</script>
</head>
<body class="backend t3js-body install-tool-installer typo3-install"></body>
</html>
......@@ -4,14 +4,17 @@
<title>Install tool on site {siteName}</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="{f:uri.resource(path: 'Css/backend.css', extensionName: 'backend')}?{time}" />
<link rel="icon" type="image/vnd.microsoft.icon" href="{f:uri.resource(path: 'Icons/favicon.ico')}?{time}" />
<link rel="stylesheet" type="text/css" href="{f:uri.resource(path: 'Css/backend.css', extensionName: 'backend')}?{bust}" />
<link rel="icon" type="image/vnd.microsoft.icon" href="{f:uri.resource(path: 'Icons/favicon.ico')}?{bust}" />
<script>
var TYPO3 = TYPO3 || {};
var __bust = '{bust}';
</script>
<script type="text/javascript" src="{f:uri.resource(path: 'JavaScript/RequireJSConfig.js')}?{bust}"></script>
<script type="text/javascript" src="{f:uri.resource(path: 'JavaScript/Contrib/require.js', extensionName: 'Core')}?{bust}"></script>
<script type="text/javascript">
require(['TYPO3/CMS/Install/Install']);
</script>
<script type="text/javascript" src="{f:uri.resource(path: 'JavaScript/RequireJSConfig.js')}?{time}"></script>
<script type="text/javascript" src="{f:uri.resource(path: 'JavaScript/Contrib/require.js', extensionName: 'Core')}?{time}"></script>
<script type="text/javascript" src="{f:uri.resource(path: 'JavaScript/Install.js')}?{time}"></script>
</head>
<body class="backend install-tool-init t3js-body" data-controller="{controller}" data-context="{context}">
<div>
......
......@@ -12,7 +12,7 @@
</p>
</div>
<div class="card-footer">
<a href="#" class="btn btn-primary " data-inline="1" data-require="TYPO3/CMS/Install/Cache">Flush cache</a>
<a href="#" class="btn btn-primary " data-inline="1" data-require="TYPO3/CMS/Install/Module/Cache">Flush cache</a>
</div>
</div>
<div class="card card-size-fixed-small">
......@@ -21,7 +21,7 @@
<p class="card-text">Compare and update the database table and field definitions of your installation against the specification defined for every activated extension.</p>
</div>
<div class="card-footer">
<a href="#" class="btn btn-default" data-require="TYPO3/CMS/Install/DatabaseAnalyzer">Analyze database</a>
<a href="#" class="btn btn-default" data-require="TYPO3/CMS/Install/Module/DatabaseAnalyzer">Analyze database</a>
</div>
</div>
<div class="card card-size-fixed-small">
......@@ -30,7 +30,7 @@
<p class="card-text">Clears temporary files including concatenated JS/CSS files and processed images.</p>
</div>
<div class="card-footer">
<a href="#" class="btn btn-default" data-require="TYPO3/CMS/Install/ClearTypo3tempFiles">Scan temporary files</a>
<a href="#" class="btn btn-default" data-require="TYPO3/CMS/Install/Module/ClearTypo3tempFiles">Scan temporary files</a>
</div>
</div>
<div class="card card-size-fixed-small">
......@@ -44,7 +44,7 @@
</f:then>
<f:else>
<div class="card-footer">
<a href="#" class="btn btn-primary " data-inline="1" data-require="TYPO3/CMS/Install/DumpAutoload">Dump autoload</a>
<a href="#" class="btn btn-primary " data-inline="1" data-require="TYPO3/CMS/Install/Module/DumpAutoload">Dump autoload</a>
</div>
</f:else>
</f:if>
......@@ -55,7 +55,7 @@
<p class="card-text">Truncates persistent database tables, which are not related to caching.</p>
</div>
<div class="card-footer">
<a href="#" class="btn btn-default" data-require="TYPO3/CMS/Install/ClearTables">Scan tables</a>
<a href="#" class="btn btn-default" data-require="TYPO3/CMS/Install/Module/ClearTables">Scan tables</a>
</div>
</div>
<div class="card card-size-fixed-small">
......@@ -64,7 +64,7 @@
<p class="card-text">Create new administrative users and grant them system maintainer privileges (optional).</p>
</div>
<div class="card-footer">
<a href="#" class="btn btn-default" data-modal-size="small" data-require="TYPO3/CMS/Install/CreateAdmin">Create Administrator</a>
<a href="#" class="btn btn-default" data-modal-size="small" data-require="TYPO3/CMS/Install/Module/CreateAdmin">Create Administrator</a>
</div>
</div>
<div class="card card-size-fixed-small">
......@@ -73,7 +73,7 @@
<p class="card-text">Clears preferences and settings for all backend users. The <code>uc</code> field is then set to an empty string.</p>
</div>
<div class="card-footer">
<a href="#" class="btn btn-primary " data-inline="1" data-require="TYPO3/CMS/Install/ResetBackendUserUc">Reset backend user preferences</a>
<a href="#" class="btn btn-primary " data-inline="1" data-require="TYPO3/CMS/Install/Module/ResetBackendUserUc">Reset backend user preferences</a>
</div>
</div>
<div class="card card-size-fixed-small">
......@@ -82,7 +82,7 @@
<p class="card-text">Download and update language packs for installed extensions.</p>
</div>
<div class="card-footer">
<a href="#" class="btn btn-default" data-require="TYPO3/CMS/Install/LanguagePacks">Manage languages</a>
<a href="#" class="btn btn-default" data-require="TYPO3/CMS/Install/Module/LanguagePacks">Manage languages</a>
</div>
</div>
</div>
......
......@@ -9,7 +9,7 @@
<p class="card-text">Configure settings for all enabled extensions.</p>
</div>
<div class="card-footer">
<a href="#" class="btn btn-default" data-require="TYPO3/CMS/Install/ExtensionConfiguration">Configure extensions</a>
<a href="#" class="btn btn-default" data-require="TYPO3/CMS/Install/Module/ExtensionConfiguration">Configure extensions</a>
</div>
</div>
<div class="card card-size-fixed-small">
......@@ -18,7 +18,7 @@
<p class="card-text">Set a new password for the Install Tool when accessed in Standalone mode.</p>
</div>
<div class="card-footer">
<a href="#" class="btn btn-default" data-modal-size="small" data-require="TYPO3/CMS/Install/ChangeInstallToolPassword">Change Install Tool Password</a>
<a href="#" class="btn btn-default" data-modal-size="small" data-require="TYPO3/CMS/Install/Module/ChangeInstallToolPassword">Change Install Tool Password</a>
</div>
</div>
<div class="card card-size-fixed-small">
......@@ -27,7 +27,7 @@
<p class="card-text">Specify which backend administrators have access to the Admin Tools module and Install Tool when accessed in Standalone Mode.</p>
</div>
<div class="card-footer">
<a href="#" class="btn btn-default" data-modal-size="medium" data-require="TYPO3/CMS/Install/SystemMaintainer">Manage System Maintainers</a>
<a href="#" class="btn btn-default" data-modal-size="medium" data-require="TYPO3/CMS/Install/Module/SystemMaintainer">Manage System Maintainers</a>
</div>
</div>
<div class="card card-size-fixed-small">
......@@ -36,7 +36,7 @@
<p class="card-text">Configure image processing, debug/live mode and mail settings.</p>
</div>
<div class="card-footer">
<a href="#" class="btn btn-default" data-require="TYPO3/CMS/Install/Presets">Choose Preset</a>
<a href="#" class="btn btn-default" data-require="TYPO3/CMS/Install/Module/Presets">Choose Preset</a>
</div>
</div>
<div class="card card-size-fixed-small">
......@@ -45,7 +45,7 @@
<p class="card-text">Enable and disable core features.</p>
</div>
<div class="card-footer">
<a href="#" class="btn btn-default" data-modal-size="medium" data-require="TYPO3/CMS/Install/Features">Configure Features</a>
<a href="#" class="btn btn-default" data-modal-size="medium" data-require="TYPO3/CMS/Install/Module/Features">Configure Features</a>
</div>
</div>
<div class="card card-size-fixed-small">
......@@ -54,7 +54,7 @@
<p class="card-text">Modify settings written to LocalConfiguration.php.</p>
</div>
<div class="card-footer">
<a href="#" class="btn btn-default" data-require="TYPO3/CMS/Install/LocalConfiguration">Configure options</a>
<a href="#" class="btn btn-default" data-require="TYPO3/CMS/Install/Module/LocalConfiguration">Configure options</a>
</div>
</div>
</div>
......
......@@ -9,7 +9,7 @@
<p class="card-text">Update your TYPO3 installation (support for symbolic links required).</p>
</div>
<div class="card-footer">
<a href="#" class="btn btn-default" data-require="TYPO3/CMS/Install/CoreUpdate">Update Core</a>
<a href="#" class="btn btn-default" data-require="TYPO3/CMS/Install/Module/CoreUpdate">Update Core</a>
</div>
</div>
<div class="card card-size-fixed-small">
......@@ -18,7 +18,7 @@
<p class="card-text">Finalises the upgrade process when moving to a major release.</p>
</div>
<div class="card-footer">
<a href="#" class="btn btn-default" data-require="TYPO3/CMS/Install/UpgradeWizards">Run Upgrade Wizard</a>
<a href="#" class="btn btn-default" data-require="TYPO3/CMS/Install/Module/UpgradeWizards">Run Upgrade Wizard</a>
</div>
</div>
<div class="card card-size-fixed-small">
......@@ -27,7 +27,7 @@
<p class="card-text">View and search for important changes that have been made for every major and minor release of TYPO3.</p>
</div>
<div class="card-footer">
<a href="#" class="btn btn-default" data-require="TYPO3/CMS/Install/UpgradeDocs">View Upgrade Documentation</a>
<a href="#" class="btn btn-default" data-require="TYPO3/CMS/Install/Module/UpgradeDocs">View Upgrade Documentation</a>
</div>
</div>
<div class="card card-size-fixed-small">
......@@ -37,7 +37,7 @@
</p>
</div>
<div class="card-footer">
<a href="#" class="btn btn-default" data-require="TYPO3/CMS/Install/TcaExtTablesCheck">Check TCA</a>
<a href="#" class="btn btn-default" data-require="TYPO3/CMS/Install/Module/TcaExtTablesCheck">Check TCA</a>
</div>
</div>
<div class="card card-size-fixed-small">
......@@ -46,7 +46,7 @@
<p class="card-text">Checks the compatibility of all active extensions against the current (installed) version of TYPO3.</p>
</div>
<div class="card-footer">
<a href="#" class="btn btn-default" data-modal-size="small" data-require="TYPO3/CMS/Install/ExtensionCompatTester">Check Extension Compatibility</a>
<a href="#" class="btn btn-default" data-modal-size="small" data-require="TYPO3/CMS/Install/Module/ExtensionCompatTester">Check Extension Compatibility</a>
</div>
</div>
<div class="card card-size-fixed-small">
......@@ -55,7 +55,7 @@
<p class="card-text">Identifies any third-party extensions that contain an outdated TCA configuration which should be adapted for the current (installed) version of TYPO3.</p>
</div>
<div class="card-footer">
<a href="#" class="btn btn-default" data-require="TYPO3/CMS/Install/TcaMigrationsCheck">Check TCA Migrations</a>
<a href="#" class="btn btn-default" data-require="TYPO3/CMS/Install/Module/TcaMigrationsCheck">Check TCA Migrations</a>
</div>
</div>
<div class="card card-size-fixed-small">
......@@ -64,7 +64,7 @@
<p class="card-text">Scan extensions for usage of deprecated or outdated TYPO3 API calls.</p>
</div>
<div class="card-footer">
<a href="#" class="btn btn-default" data-require="TYPO3/CMS/Install/ExtensionScanner">Scan Extension Files</a>
<a href="#" class="btn btn-default" data-require="TYPO3/CMS/Install/Module/ExtensionScanner">Scan Extension Files</a>
</div>
</div>
</div>
......
......@@ -11,50 +11,49 @@
* The TYPO3 project - inspiring people to share!
*/
import * as $ from 'jquery';
/**
* Module: TYPO3/CMS/Install/AjaxQueue
* Module: TYPO3/CMS/Install/Module/AjaxQueue
*/
define(['jquery'], function($) {
'use strict';
return {
requestCount: 0,
threshold: 10,
queue: [],
add: function(payload) {
var oldComplete = payload.complete;
var that = this;
payload.complete = function(jqXHR, textStatus) {
if (that.queue.length > 0 && that.requestCount <= that.threshold) {
$.ajax(that.queue.shift()).always(function() {
that.decrementRequestCount();
});
} else {
that.decrementRequestCount();
}
if (oldComplete) {
oldComplete(jqXHR, textStatus);
}
};
if (this.requestCount >= this.threshold) {
this.queue.push(payload);
class AjaxQueue {
private requestCount: number = 0;
private threshold: number = 10;
private queue: Array<any> = [];
public add(payload: JQueryAjaxSettings): void {
const oldComplete = payload.complete;
payload.complete = (jqXHR: JQueryXHR, textStatus: string): void => {
if (this.queue.length > 0 && this.requestCount <= this.threshold) {
$.ajax(this.queue.shift()).always((): void => {
this.decrementRequestCount();
});
} else {
this.incrementRequestCount();
$.ajax(payload);
this.decrementRequestCount();
}
},
incrementRequestCount: function() {
this.requestCount++;
},
decrementRequestCount: function() {
if (this.requestCount > 0) {
this.requestCount--;
if (oldComplete) {
oldComplete(jqXHR, textStatus);
}
},
};
});
};
if (this.requestCount >= this.threshold) {
this.queue.push(payload);
} else {
this.incrementRequestCount();
$.ajax(payload);
}
}
private incrementRequestCount(): void {
this.requestCount++;
}
private decrementRequestCount(): void {
if (this.requestCount > 0) {
this.requestCount--;
}
}
}
export = new AjaxQueue();
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
import * as $ from 'jquery';
import Router = require('./Router');
/**
* Walk through the installation process of TYPO3
*/
class Install {
constructor() {
$((): void => {
Router.initialize();
});
}
}
export = new Install();
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
import * as $ from 'jquery';
import InfoBox = require('./Renderable/InfoBox');
import Severity = require('./Renderable/Severity');
import ProgressBar = require('./Renderable/ProgressBar');
import PasswordStrength = require('./Module/PasswordStrength');
/**
* Walk through the installation process of TYPO3
*/
class Installer {
private selectorBody: string = '.t3js-body';
private selectorModuleContent: string = '.t3js-module-content';
private selectorMainContent: string = '.t3js-installer-content';
private selectorProgressBar: string = '.t3js-installer-progress';
private selectorDatabaseConnectOutput: string = '.t3js-installer-databaseConnect-output';
private selectorDatabaseSelectOutput: string = '.t3js-installer-databaseSelect-output';
private selectorDatabaseDataOutput: string = '.t3js-installer-databaseData-output';
constructor() {
this.initializeEvents();
$((): void => {
this.initialize();
});
}
private initializeEvents(): void {
$(document).on('click', '.t3js-installer-environmentFolders-retry', (e: JQueryEventObject): void => {
e.preventDefault();
this.showEnvironmentAndFolders();
});
$(document).on('click', '.t3js-installer-environmentFolders-execute', (e: JQueryEventObject): void => {
e.preventDefault();
this.executeEnvironmentAndFolders();
});
$(document).on('click', '.t3js-installer-databaseConnect-execute', (e: JQueryEventObject): void => {
e.preventDefault();
this.executeDatabaseConnect();
});
$(document).on('click', '.t3js-installer-databaseSelect-execute', (e: JQueryEventObject): void => {
e.preventDefault();
this.executeDatabaseSelect();
});
$(document).on('click', '.t3js-installer-databaseData-execute', (e: JQueryEventObject): void => {
e.preventDefault();
this.executeDatabaseData();
});
$(document).on('click', '.t3js-installer-defaultConfiguration-execute', (e: JQueryEventObject): void => {
e.preventDefault();
this.executeDefaultConfiguration();
});
$(document).on('keyup', '.t3-install-form-password-strength', (): void => {
PasswordStrength.initialize('.t3-install-form-password-strength');
});
// Database connect db driver selection
$(document).on('change', '#t3js-connect-database-driver', (e: JQueryEventObject): void => {
let driver: string = $(e.currentTarget).val();
$('.t3-install-driver-data').hide();
$('.t3-install-driver-data input').attr('disabled', 'disabled');
$('#' + driver + ' input').attr('disabled', null);
$('#' + driver).show();
});
}
private initialize(): void {
this.setProgress(0);
this.getMainLayout();
}
private getUrl(action?: string): string {
let url: string = location.href;
url = url.replace(location.search, '');
if (action !== undefined) {
url = url + '?install[action]=' + action;
}
return url;
}
private setProgress(done: number): void {
let $progressBar: JQuery = $(this.selectorProgressBar);
let percent: number = 0;
if (done !== 0) {
percent = (done / 5) * 100;
$progressBar.find('.progress-bar').empty().text(done + ' / 5 - ' + percent + '% Complete');
}
$progressBar
.find('.progress-bar')
.css('width', percent + '%')
.attr('aria-valuenow', percent);
}
private getMainLayout(): void {
$.ajax({
url: this.getUrl('mainLayout'),