added undefined error catch
This commit is contained in:
parent
2a93d293f8
commit
9b7ac960cc
@ -24,7 +24,7 @@
|
||||
<link rel="stylesheet" href="./bootstrap.min.css">
|
||||
<link rel="stylesheet" href="./bootstrap-theme.min.css">
|
||||
<link rel="stylesheet" href="./font-awesome.min.css">
|
||||
<link rel='stylesheet' href='./theme.min.css'>
|
||||
<link rel='stylesheet' href='./theme.css'>
|
||||
<script src="./jquery.min.js"></script>
|
||||
<script src="./bootstrap.min.js"></script>
|
||||
<script src="./clipboard.min.js"></script>
|
||||
@ -34,7 +34,7 @@
|
||||
</head>
|
||||
<body>
|
||||
<a href="https://github.com/beardog108/snow10/"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/e7bbb0521b397edbd5fe43e7f760759336b5e05f/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f677265656e5f3030373230302e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_green_007200.png"></a>
|
||||
<div class="modal fade" id="outputModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
|
||||
<div class="modal" id="outputModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
@ -77,7 +77,7 @@
|
||||
<input type='password' id='confirmPass' placeholder='Confirm password' class='dataItem'>
|
||||
<br>
|
||||
</span>
|
||||
<div class="btn-group" role="group" aria-label="...">
|
||||
<div class="btn-group" role="group" aria-label="..." id='encodeDecodeArea'>
|
||||
<button type="button" class="btn btn-primary" id="encode">Encode <i class='fa fa-lock'></i></button>
|
||||
<button type="button" class="btn btn-primary" id="decode">Decode <i class='fa fa-unlock'></i></button>
|
||||
</div>
|
||||
|
8
main.js
8
main.js
@ -136,10 +136,14 @@ function verifyPass(mode)
|
||||
}
|
||||
|
||||
$('#encode').click(function(){
|
||||
$('#encodeDecodeArea').css('display', 'none');
|
||||
go('encode');
|
||||
$('#encodeDecodeArea').css('display', 'inline-block');
|
||||
});
|
||||
$('#decode').click(function(){
|
||||
$('#encodeDecodeArea').css('display', 'none');
|
||||
go('decode');
|
||||
$('#encodeDecodeArea').css('display', 'inline-block');
|
||||
});
|
||||
|
||||
function go(mode) {
|
||||
@ -178,6 +182,10 @@ function go(mode) {
|
||||
if(split[i] == one || split[i] == zero)
|
||||
sanitized = sanitized + split[i]
|
||||
var output = decodeURIComponent(binToText(sanitized));
|
||||
if (output === 'undefined'){
|
||||
showError('Could not decode message. Maybe there wasn\'t one?');
|
||||
return false;
|
||||
}
|
||||
if ($('#useEncrypt').is(':checked'))
|
||||
{
|
||||
if (verifyPass('decrypt'))
|
||||
|
Loading…
Reference in New Issue
Block a user