mods not yet commited
[outofuni/jsutils.git] / utils.js
index 30190b4..0d78e8b 100644 (file)
--- 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(/\&auml\;/g,"ä");
+       str=str.replace(/\&ouml\;/g,"ö");
+       str=str.replace(/\&uuml\;/g,"ü");
+       str=str.replace(/\&szlig\;/g,"ß");
+       return str;
+}
+
+function ascii2html(str) {
+       str=str.replace(/ä/g,"ä");
+       str=str.replace(/ö/g,"ö");
+       str=str.replace(/ü/g,"ü");
+       str=str.replace(/ß/g,"ß");
+       return str;
+}
+