1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-22 12:15:36 +01:00

es6 javascript

This commit is contained in:
Kyle Spearrin 2018-03-23 16:30:15 -04:00
parent 46182e3c90
commit f07cb3ab07
2 changed files with 19 additions and 19 deletions

View File

@ -5,8 +5,8 @@
@section Scripts {
<script>
(function() {
document.getElementById('enterprise-trial').addEventListener('click', function () {
(() => {
document.getElementById('enterprise-trial').addEventListener('click', () => {
if (document.getElementById('@(nameof(Model.PlanType))').value !==
'@((byte)Bit.Core.Enums.PlanType.Free)') {
alert('Organization is not on a free plan.');
@ -32,15 +32,15 @@
document.getElementById('@(nameof(Model.ExpirationDate))').value = '@Model.FourteenDayExpirationDate';
});
document.getElementById('@(nameof(Model.PlanType))').addEventListener('change', function() {
var selectEl = document.getElementById('@(nameof(Model.PlanType))');
var selectText = selectEl.options[selectEl.selectedIndex].text;
document.getElementById('@(nameof(Model.PlanType))').addEventListener('change', () => {
const selectEl = document.getElementById('@(nameof(Model.PlanType))');
const selectText = selectEl.options[selectEl.selectedIndex].text;
document.getElementById('@(nameof(Model.Plan))').value = selectText;
});
document.getElementById('gateway-customer-link').addEventListener('click', function () {
var gateway = document.getElementById('@(nameof(Model.Gateway))');
var customerId = document.getElementById('@(nameof(Model.GatewayCustomerId))');
document.getElementById('gateway-customer-link').addEventListener('click', () => {
const gateway = document.getElementById('@(nameof(Model.Gateway))');
const customerId = document.getElementById('@(nameof(Model.GatewayCustomerId))');
if (!gateway || gateway.value === '' || !customerId || customerId.value === '') {
return;
}
@ -53,9 +53,9 @@
}
});
document.getElementById('gateway-subscription-link').addEventListener('click', function () {
var gateway = document.getElementById('@(nameof(Model.Gateway))');
var subId = document.getElementById('@(nameof(Model.GatewaySubscriptionId))');
document.getElementById('gateway-subscription-link').addEventListener('click', () => {
const gateway = document.getElementById('@(nameof(Model.Gateway))');
const subId = document.getElementById('@(nameof(Model.GatewaySubscriptionId))');
if (!gateway || gateway.value === '' || !subId || subId.value === '') {
return;
}

View File

@ -5,8 +5,8 @@
@section Scripts {
<script>
(function() {
document.getElementById('upgrade-premium').addEventListener('click', function () {
(() => {
document.getElementById('upgrade-premium').addEventListener('click', () => {
if (document.getElementById('@(nameof(Model.Premium))').checked) {
alert('User is already premium.');
return;
@ -21,9 +21,9 @@
'@Model.OneYearExpirationDate';
});
document.getElementById('gateway-customer-link').addEventListener('click', function () {
var gateway = document.getElementById('@(nameof(Model.Gateway))');
var customerId = document.getElementById('@(nameof(Model.GatewayCustomerId))');
document.getElementById('gateway-customer-link').addEventListener('click', () => {
const gateway = document.getElementById('@(nameof(Model.Gateway))');
const customerId = document.getElementById('@(nameof(Model.GatewayCustomerId))');
if (!gateway || gateway.value === '' || !customerId || customerId.value === '') {
return;
}
@ -36,9 +36,9 @@
}
});
document.getElementById('gateway-subscription-link').addEventListener('click', function () {
var gateway = document.getElementById('@(nameof(Model.Gateway))');
var subId = document.getElementById('@(nameof(Model.GatewaySubscriptionId))');
document.getElementById('gateway-subscription-link').addEventListener('click', () => {
const gateway = document.getElementById('@(nameof(Model.Gateway))');
const subId = document.getElementById('@(nameof(Model.GatewaySubscriptionId))');
if (!gateway || gateway.value === '' || !subId || subId.value === '') {
return;
}