changed encode and decode to be 2 seperate buttons instead of 'go' and a setting.
This commit is contained in:
parent
2c146fef1a
commit
546900bcdb
@ -55,14 +55,19 @@
|
|||||||
<br><br>
|
<br><br>
|
||||||
<label>Use Encryption <input type='checkbox' id='useEncrypt' checked></label>
|
<label>Use Encryption <input type='checkbox' id='useEncrypt' checked></label>
|
||||||
<br><br>
|
<br><br>
|
||||||
<div id='one'><button id='toggle' class='btn btn-primary'>Encode Mode <i class='fa fa-lock'></i></button></div>
|
|
||||||
<span id='encryptArea'>
|
<span id='encryptArea'>
|
||||||
<input type='password' id='password' placeholder='Encryption password' class='dataItem'>
|
<input type='password' id='password' placeholder='Encryption password' class='dataItem'>
|
||||||
<br>
|
<br>
|
||||||
<input type='password' id='confirmPass' placeholder='Confirm password' class='dataItem'>
|
<input type='password' id='confirmPass' placeholder='Confirm password' class='dataItem'>
|
||||||
<br>
|
<br>
|
||||||
</span>
|
</span>
|
||||||
<button id='go' class='btn btn-success btn-lg dataItem'>Go</button>
|
<!--<div id='one'><button id='toggle' class='btn btn-primary'>Encode Mode <i class='fa fa-lock'></i></button></div>-->
|
||||||
|
<div class="btn-group" role="group" aria-label="...">
|
||||||
|
<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>
|
||||||
|
<br>
|
||||||
|
<!--<button id='go' class='btn btn-success btn-lg dataItem'>Go</button>-->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<footer class='center'>made with <i class='fa fa-heart'></i> by <a href='https://chaoswebs.net/'>Beardog</a></footer>
|
<footer class='center'>made with <i class='fa fa-heart'></i> by <a href='https://chaoswebs.net/'>Beardog</a></footer>
|
||||||
|
31
main.js
31
main.js
@ -43,29 +43,11 @@ $('#modalClose').click(function(){
|
|||||||
$('#copyFeedback').css('display', 'none');
|
$('#copyFeedback').css('display', 'none');
|
||||||
});
|
});
|
||||||
|
|
||||||
window.snowMode = 'encode';
|
|
||||||
|
|
||||||
$("#output").on("click", function () {
|
$("#output").on("click", function () {
|
||||||
$(this).select();
|
$(this).select();
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#toggle').click(function(){
|
|
||||||
|
|
||||||
if (window.snowMode == 'encode')
|
|
||||||
{
|
|
||||||
window.snowMode = 'decode';
|
|
||||||
$('#toggle').html("Decode Mode <i class='fa fa-unlock'></i>");
|
|
||||||
$('#confirmPass').css('display', 'none');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
window.snowMode = 'encode';
|
|
||||||
$('#toggle').html("Encode Mode <i class='fa fa-lock'></i>");
|
|
||||||
$('#confirmPass').css('display', 'inline');
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
$('#useZeroWidthCharacters').click(function(){
|
$('#useZeroWidthCharacters').click(function(){
|
||||||
|
|
||||||
if (zero == w_zero)
|
if (zero == w_zero)
|
||||||
@ -134,7 +116,14 @@ function verifyPass(mode)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#go').click(function(){
|
$('#encode').click(function(){
|
||||||
|
go('encode');
|
||||||
|
});
|
||||||
|
$('#decode').click(function(){
|
||||||
|
go('decode');
|
||||||
|
});
|
||||||
|
|
||||||
|
function go(mode) {
|
||||||
var output = '';
|
var output = '';
|
||||||
|
|
||||||
var input = $('#text').val();
|
var input = $('#text').val();
|
||||||
@ -143,7 +132,7 @@ $('#go').click(function(){
|
|||||||
|
|
||||||
|
|
||||||
// If we're encoding:
|
// If we're encoding:
|
||||||
if (window.snowMode == 'encode')
|
if (mode == 'encode')
|
||||||
{
|
{
|
||||||
// If we should use encryption, encrypt first:
|
// If we should use encryption, encrypt first:
|
||||||
if ($('#useEncrypt').is(':checked'))
|
if ($('#useEncrypt').is(':checked'))
|
||||||
@ -184,7 +173,7 @@ $('#go').click(function(){
|
|||||||
$('#output').val(output.toString());
|
$('#output').val(output.toString());
|
||||||
}
|
}
|
||||||
$('#outputModal').modal();
|
$('#outputModal').modal();
|
||||||
});
|
}
|
||||||
|
|
||||||
$('#clearInputButton').click(function(){
|
$('#clearInputButton').click(function(){
|
||||||
$('#text').val('');
|
$('#text').val('');
|
||||||
|
Loading…
Reference in New Issue
Block a user