Fixes and Design Improvements

This commit is contained in:
mmk2410 2015-04-16 22:30:23 +02:00
parent 945b5838e1
commit 4d6006e99b
6 changed files with 55 additions and 19 deletions

View file

@ -18,10 +18,10 @@ function drawer(){
}
}
function encode(){
function encrypt(){
var input = $('#textarea').val()
if(wm){
$("#output").text(encodeWrittenMorseManager(input))
$("#output").text(encryptWrittenMorseManager(input))
} else {
//TODO port the normal morse decode engine
$("#output").text("The normal morse engine is not ported jet.")
@ -29,10 +29,10 @@ function encode(){
$('#outputcard').fadeIn(dur)
}
function decode(){
function decrypt(){
var input = $('#textarea').val()
if(wm){
$('#output').text(decodeWrittenMorseManager(input))
$('#output').text(decryptWrittenMorseManager(input))
} else {
//TODO port the normal morse decode engine
$("#output").text("The normal morse engine is not ported jet.")
@ -59,3 +59,21 @@ function about(){
window.location = "http://marcel-kapfer.de/writtenmorse"
})
}
window.onload = function() {
var t = document.getElementsByTagName('textarea')[0];
var offset= !window.opera ? (t.offsetHeight - t.clientHeight) : (t.offsetHeight + parseInt(window.getComputedStyle(t, null).getPropertyValue('border-top-width'))) ;
var resize = function(t) {
t.style.height = 'auto';
t.style.height = (t.scrollHeight + offset ) + 'px';
}
t.addEventListener && t.addEventListener('input', function(event) {
resize(t);
});
t['attachEvent'] && t.attachEvent('onkeyup', function() {
resize(t);
});
}