X-Git-Url: https://hackdaworld.org/gitweb/?p=outofuni%2Fjsutils.git;a=blobdiff_plain;f=utils.js;fp=utils.js;h=0d78e8ba33ca17cb8c762e0ebdeaa7bf6a7a2a65;hp=30190b4e922bd198f0f5a88fc1ad91ae8df271c4;hb=a74eb693d6d0c721af6c418263c75eb7bc1628bf;hpb=1395597e615dce174f454251ed4e462edd529659 diff --git a/utils.js b/utils.js index 30190b4..0d78e8b 100644 --- a/utils.js +++ b/utils.js @@ -17,3 +17,35 @@ function objdbg(obj) { cl(msg); } +function anddbg(obj) { + var msg="debug object:\n"; + for(var k in obj) { + msg=msg+"--> "+k+": "+obj[k]+"\n"; + } + alert(msg); +} + +function vert_align_text(trg) { + $(trg).each(function() { + var lh=$(this).height(); + $(this).css('line-height',lh+'px'); + $(this).css('vertical-align','middle'); + }); +} + +function html2ascii(str) { + str=str.replace(/\ä\;/g,"ä"); + str=str.replace(/\ö\;/g,"ö"); + str=str.replace(/\ü\;/g,"ü"); + str=str.replace(/\ß\;/g,"ß"); + return str; +} + +function ascii2html(str) { + str=str.replace(/ä/g,"ä"); + str=str.replace(/ö/g,"ö"); + str=str.replace(/ü/g,"ü"); + str=str.replace(/ß/g,"ß"); + return str; +} +