added unsupported browser warning

This commit is contained in:
Alex Booker 2015-08-15 10:15:19 +01:00
parent 793665eeb2
commit b46a16ff92

View File

@ -15,6 +15,9 @@
padding: 10px;
margin-bottom: 20px;
}
.unsupported-browser-alert {
display: none;
}
</style>
</head>
<body>
@ -28,6 +31,11 @@
<noscript>
<div class="alert alert-danger"><span class="glyphicon glyphicon-warning-sign"></span> <strong>Hold on.</strong> It looks like you have disabled JavaScript. Unfortunately, this tool will not work until you enable it.</div>
</noscript>
<div class="alert alert-danger unsupported-browser-alert" id="unsupported-browser-alert">
<p>
<span class="glyphicon glyphicon-warning-sign"></span> <strong>Hold on.</strong> It looks like you are using an <em>unsuported browser</em> (probably Internet Explorer...) Unfortunately, this tool will not work until you upgrade your browser. Sorry for any inconvenience caused.
</p>
</div>
<div class="alert alert-info" role="alert">
<p>Use this online tool to generate a strong and random password. Password generation is done on the client-side meaning no one has access to the passwords you generate here, <em>period</em>.</p>
</div>
@ -181,7 +189,13 @@
}
};
function outputGeneratedPassword() {
var password = passwordGenerator.generatePassword(getOptions());
var password;
try {
password = passwordGenerator.generatePassword(getOptions());
}
catch (error) {
return $("#unsupported-browser-alert").show();
}
if (password === '') {
alert("Whops. You unselected all the options. I don't know what characters you want. Click on the button entitled \"Advanced Options\" and enable some options then try again. Nice one");
return;