Skip to content

Commit

Permalink
check domain
Browse files Browse the repository at this point in the history
  • Loading branch information
seibtph authored and seibt@pdir.de committed Dec 11, 2020
1 parent 0bba866 commit 1fe4ce3
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Resources/contao/languages/en/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@
$GLOBALS['TL_LANG']['MSC']['th_explanation'] = '<p><strong>Here you can bind your purchased domain license to a theme.</strong></p><p>When checking the domain, the IP of the server is transferred to pdir, the operator of contao-themes.net.<br>The IP is used exclusively to register and review your theme license.</p>';
$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';
$GLOBALS['TL_LANG']['MSC']['th_button_check'] = 'Check Domain';
15 changes: 13 additions & 2 deletions src/Resources/contao/templates/backend/be_th_check_domain.html5
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
MATE Theme: <strong>mate</strong><br>
ODD Theme: <strong>odd</strong><br>
NATURE Theme: <strong>nature</strong><br>
0.1 Theme: <strong>0.1</strong>
0.1 Theme: <strong>0.1</strong><br>
CONVERT Theme: <strong>convert</strong>

<br><br>Danach sollten Sie Ihre Domain registrieren können.<br><br>
Detaillierte Informationen finden Sie auch auf:
Expand All @@ -31,10 +32,11 @@
<input type="text" name="domain" id="ctrl_domain" class="tl_text" value="" required="" maxlength="255" onfocus="Backend.getScrollOffset()">
<p class="tl_help tl_tip" title=""><?= $this->domainTip ?></p>
</div>
<p class="note clr">Bitte geben Sie die Domain <strong>ohne http(s):// und www</strong> ein, z. B. meinedomain.de. Subdomains
müssen explizit angegeben werden, z. B. shop.meinedomain.de.</p>
<div class="clr tl_formbody_submit">
<div class="tl_submit_container">
<button type="submit" name="check" id="save" class="tl_submit" accesskey="s"><?= $this->buttonCheck ?></button>
<a id="close" class="close-me tl_submit" accesskey="c">Close</a>
</div>
</div>
</form>
Expand All @@ -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);
</script>
</div>
<?php endif; ?>
Expand Down
12 changes: 11 additions & 1 deletion src/Resources/public/sass/th_check_domain.scss
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
#tl_navigation a.navigation.thLicence { display:none; }
#tl_navigation a.navigation.thLicence { display:none; }

p.note {
margin: 15px;

&.error {
&, strong {
color: #e11d1d;
}
}
}

0 comments on commit 1fe4ce3

Please sign in to comment.