# HG changeset patch # User Pascal Bellard # Date 1385550181 0 # Node ID e3b40fe05c1d96112d134c5a5836a0d5f11be7c2 # Parent d80619cb46dbad33ce25768a226865c92c5b2bc8 tazwikiss: add wkp_FullScreen.sh diff -r d80619cb46db -r e3b40fe05c1d tazwikiss/rootfs/var/www/wiki/pages/AideCalc.txt --- a/tazwikiss/rootfs/var/www/wiki/pages/AideCalc.txt Tue Nov 19 16:46:39 2013 +0000 +++ b/tazwikiss/rootfs/var/www/wiki/pages/AideCalc.txt Wed Nov 27 11:03:01 2013 +0000 @@ -14,12 +14,12 @@ ** Cliquer en dehors de la case pour tout recalculer * Cliquer sur une case grise pour voir le CSV à jour !!Exemples -{{Pommes;12;=parseInt((100*B1)/B3)+'%'; -Poires;7;=parseInt((100*B2)/B3)+"%"; -Total :;=B1+B2;;}} -Pommes;12;=parseInt((100*B1)/B3)+'%'; -Poires;7;=parseInt((100*B2)/B3)+"%"; -Total :;=B1+B2;; +{{Pommes;12;=round((100*B1)/B3)+'%'; +Poires;7;=round((100*B2)/B3)+"%"; +Total :;=B1+B2;=parseInt(C1)+parseInt(C2)+'%';}} +Pommes;12;=round((100*B1)/B3)+'%'; +Poires;7;=round((100*B2)/B3)+"%"; +Total :;=B1+B2;=parseInt(C1)+parseInt(C2)+'%'; {{Un nombre;sa racine carré; 2;=(A2<0)?alert('A2 < 0 !'):sqrt(A2);}} Un nombre;sa racine carré; diff -r d80619cb46db -r e3b40fe05c1d tazwikiss/rootfs/var/www/wiki/pages/HelpCalc.txt --- a/tazwikiss/rootfs/var/www/wiki/pages/HelpCalc.txt Tue Nov 19 16:46:39 2013 +0000 +++ b/tazwikiss/rootfs/var/www/wiki/pages/HelpCalc.txt Wed Nov 27 11:03:01 2013 +0000 @@ -14,12 +14,12 @@ ** click anywhere outside the cell to recompute everything * click to a gray cell to see the CSV update !!Examples -{{Apples;12;=parseInt((100*B1)/B3)+'%'; -Pears;7;=parseInt((100*B2)/B3)+"%"; -Total :;=B1+B2;;}} -Apples;12;=parseInt((100*B1)/B3)+'%'; -Pears;7;=parseInt((100*B2)/B3)+"%"; -Total :;=B1+B2;; +{{Apples;12;=round((100*B1)/B3)+'%'; +Pears;7;=round((100*B2)/B3)+"%"; +Total :;=B1+B2;=parseInt(C1)+parseInt(C2)+'%';}} +Apples;12;=round((100*B1)/B3)+'%'; +Pears;7;=round((100*B2)/B3)+"%"; +Total :;=B1+B2;=parseInt(C1)+parseInt(C2)+'%'; {{A number;its square root; 2;=(A2<0)?alert('A2 < 0 !'):sqrt(A2);}} A number;its square root; diff -r d80619cb46db -r e3b40fe05c1d tazwikiss/rootfs/var/www/wiki/plugins/wkp_Calc.sh --- a/tazwikiss/rootfs/var/www/wiki/plugins/wkp_Calc.sh Tue Nov 19 16:46:39 2013 +0000 +++ b/tazwikiss/rootfs/var/www/wiki/plugins/wkp_Calc.sh Wed Nov 27 11:03:01 2013 +0000 @@ -34,7 +34,7 @@ DATA[id].log10= DATA[id].LOG10= function(n){return Math.log(n)/Math.LN10;}; DATA[id].log2 = DATA[id].LOG2 = function(n){return Math.log(n)/Math.LN2;}; DATA[id].fact = DATA[id].FACT = - function(n){var x=1;while(n>0)x*=n--;return x;}; + function(n){var x=1;while(n>1)x*=n--;return x;}; DATA[id].fib = DATA[id].FIB = function(n){var c=0,p=1;while(n-->0){var x=c;c+=p;p=x};return c;}; for (var i=0; i<=rows; i++) { diff -r d80619cb46db -r e3b40fe05c1d tazwikiss/rootfs/var/www/wiki/plugins/wkp_FullScreen.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tazwikiss/rootfs/var/www/wiki/plugins/wkp_FullScreen.sh Wed Nov 27 11:03:01 2013 +0000 @@ -0,0 +1,52 @@ +plugin="FullScreen" +description="Full screen support" + +FULLSCREEN="Fullscreen" + +case "$1" in +showjs) cat < + + +EOT +esac + +template() +{ + [ -n "$(GET page)" -a -z "$(GET action)" ] || return 1 + FULLSCREEN="$FULLSCREEN" + html="$(sed "s|EDIT|& / $FULLSCREEN|" </) { + system("/bin/sh " prg " showjs") + } + print +}' +$html +EOT +)" + return 0 +}