From 1fe4ce35cfd6f93866564b1a8b0c24936ae1971a Mon Sep 17 00:00:00 2001 From: Philipp Seibt Date: Fri, 11 Dec 2020 15:28:57 +0100 Subject: [PATCH] check domain --- src/Resources/contao/languages/en/default.php | 2 +- .../templates/backend/be_th_check_domain.html5 | 15 +++++++++++++-- src/Resources/public/sass/th_check_domain.scss | 12 +++++++++++- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/src/Resources/contao/languages/en/default.php b/src/Resources/contao/languages/en/default.php index 18ce9b9..0a6e664 100644 --- a/src/Resources/contao/languages/en/default.php +++ b/src/Resources/contao/languages/en/default.php @@ -24,4 +24,4 @@ $GLOBALS['TL_LANG']['MSC']['th_explanation'] = '

Here you can bind your purchased domain license to a theme.

When checking the domain, the IP of the server is transferred to pdir, the operator of contao-themes.net.
The IP is used exclusively to register and review your theme license.

'; $GLOBALS['TL_LANG']['MSC']['th_insert_domain'] = 'Please insert Domain'; $GLOBALS['TL_LANG']['MSC']['th_domain_tip'] = 'Here you can define the domain. (ex. contao-themes.net or meissen.online, without http(s)://)'; -$GLOBALS['TL_LANG']['MSC']['th_button_check'] = 'Check Domain'; \ No newline at end of file +$GLOBALS['TL_LANG']['MSC']['th_button_check'] = 'Check Domain'; diff --git a/src/Resources/contao/templates/backend/be_th_check_domain.html5 b/src/Resources/contao/templates/backend/be_th_check_domain.html5 index 07d431d..f1aa912 100644 --- a/src/Resources/contao/templates/backend/be_th_check_domain.html5 +++ b/src/Resources/contao/templates/backend/be_th_check_domain.html5 @@ -8,7 +8,8 @@ MATE Theme: mate
ODD Theme: odd
NATURE Theme: nature
- 0.1 Theme: 0.1 + 0.1 Theme: 0.1
+ CONVERT Theme: convert

Danach sollten Sie Ihre Domain registrieren können.

Detaillierte Informationen finden Sie auch auf: @@ -31,10 +32,11 @@

domainTip ?>

+

Bitte geben Sie die Domain ohne http(s):// und www ein, z. B. meinedomain.de. Subdomains + müssen explizit angegeben werden, z. B. shop.meinedomain.de.

- Close
@@ -48,6 +50,15 @@ event.preventDefault(); window.parent.location.reload(); }, false); + + document.getElementById('save').addEventListener('click', function (e) { + var domain = document.querySelector('[name=domain]').value; + + if( domain.indexOf('http://') !== -1 || domain.indexOf('https://') !== -1 || domain.indexOf('www.') !== -1 ) { + document.querySelector('.note').addClass('error'); + e.preventDefault(); + } + }, false); diff --git a/src/Resources/public/sass/th_check_domain.scss b/src/Resources/public/sass/th_check_domain.scss index 89c56a2..105a695 100644 --- a/src/Resources/public/sass/th_check_domain.scss +++ b/src/Resources/public/sass/th_check_domain.scss @@ -1 +1,11 @@ -#tl_navigation a.navigation.thLicence { display:none; } \ No newline at end of file +#tl_navigation a.navigation.thLicence { display:none; } + +p.note { + margin: 15px; + + &.error { + &, strong { + color: #e11d1d; + } + } +}