slitaz-dev-tools rev 236
tazwikiss: enhance getWidth
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sat Feb 21 11:57:51 2015 +0100 (2015-02-21) |
parents | 49e5213991e6 |
children | 674bad1f758b |
files | tazwikiss/rootfs/var/www/wiki/plugins/wkp_Calc.css tazwikiss/rootfs/var/www/wiki/plugins/wkp_Calc.sh |
line diff
1.1 --- a/tazwikiss/rootfs/var/www/wiki/plugins/wkp_Calc.css Sat Feb 21 11:04:03 2015 +0100 1.2 +++ b/tazwikiss/rootfs/var/www/wiki/plugins/wkp_Calc.css Sat Feb 21 11:57:51 2015 +0100 1.3 @@ -9,7 +9,7 @@ 1.4 .inputcalc { 1.5 border: none; 1.6 width: 80px; 1.7 - font-size: 14px; 1.8 + font-size: inherit; 1.9 padding: 2px; 1.10 } 1.11 1.12 @@ -28,4 +28,5 @@ 1.13 .cellcalc { 1.14 border: 1px solid #999; 1.15 padding: 0; 1.16 + font-size: 14px; 1.17 }
2.1 --- a/tazwikiss/rootfs/var/www/wiki/plugins/wkp_Calc.sh Sat Feb 21 11:04:03 2015 +0100 2.2 +++ b/tazwikiss/rootfs/var/www/wiki/plugins/wkp_Calc.sh Sat Feb 21 11:57:51 2015 +0100 2.3 @@ -59,7 +59,7 @@ 2.4 function getWidth(s) 2.5 { 2.6 var e = document.getElementById("widthcalc"); 2.7 - e.innerHTML = s+" :"; 2.8 + e.innerHTML = s; 2.9 return (e.offsetWidth < 80 || s.charAt(0) == "=") ? 80 : e.offsetWidth; 2.10 } 2.11 2.12 @@ -92,7 +92,7 @@ 2.13 var value = elm.title || ""; 2.14 if (value.charAt(0) == "=") 2.15 with (DATA[calcid]) return eval(value.substring(1)); 2.16 - else return isNaN(value) ? value : parseFloat(value); 2.17 + else return (value == "" || isNaN(value)) ? value : parseFloat(value); 2.18 }; 2.19 Object.defineProperty(DATA[calcid], cellid, {get:getter}); 2.20 Object.defineProperty(DATA[calcid], cellid.toLowerCase(), {get:getter});