From: Bernhard Tittelbach Date: Wed, 27 Mar 2013 03:15:13 +0000 (+0000) Subject: switch.cgi no more non-ajax but nofloat version X-Git-Url: https://git.realraum.at/?a=commitdiff_plain;h=9762669d84f32ad981c06870b628d02d63adc0ae;p=svn42.git switch.cgi no more non-ajax but nofloat version --- diff --git a/powersensordaemon/switch.cgi b/powersensordaemon/switch.cgi index bd77e61..2108955 100755 --- a/powersensordaemon/switch.cgi +++ b/powersensordaemon/switch.cgi @@ -12,17 +12,15 @@ for QUERY in `echo $QUERY_STRING | tr '&' ' '`; do POWER=$VALUE elif [ "$VALUE" == "mobile" ]; then MOBILE='1' - elif [ "$POWER" == "?" ]; then - POWER=$VALUE - elif [ "$VALUE" == "ajax" ]; then - AJAX='?' - elif [ "$AJAX" == "?" ]; then - AJAX=$VALUE + NOFLOAT='1' + elif [ "$VALUE" == "nofloat" ]; then + NOFLOAT='1' fi i=$i+1 done done + UNIXSOCK=/var/run/powersensordaemon/cmd.sock VALID_ONOFF_IDS="decke ambientlights lichter all werkzeug labor dart logo spots1 deckehinten deckevorne boiler whiteboard pcblueleds bikewcblue" VALID_SEND_IDS_CUSTOM_DISPLAY="ymhpoweroff ymhpower ymhvolup ymhvoldown" @@ -30,8 +28,7 @@ VALID_SEND_IDS="ymhpoweron ymhcd ymhwdtv ymhtuner ymhaux ymhsattv ymhvolmute ymh #VALID_BANSHEE_IDS="playPause next prev" #VALID_CAM_MOTOR_IDS="c C w W" -[ "$POWER" == "Off" ] && POWER=off -[ "$POWER" != "off" ] && POWER=on +[ "$POWER" == "send" ] && POWER=on if [ "$POWER" == "on" -o "$POWER" == "off" ]; then for CHECKID in $VALID_ONOFF_IDS $VALID_SEND_IDS; do if [ "$CHECKID" == "$ID" ]; then @@ -196,24 +193,14 @@ echo '' echo "" echo "" #echo "

Realraum rf433ctl

" -echo "
" +#echo "
" +echo "
" +echo "
" for DISPID in $VALID_ONOFF_IDS; do NAME="$(eval echo \$DESC_$DISPID)" [ -z "$NAME" ] && NAME=$DISPID - if [ -z "$AJAX" ]; then - echo "
" - echo "" - echo "
$NAME
" - echo " " - echo " " - echo "" - echo "
" - echo "
" - - else - - echo "
" +echo "
" echo "" echo " " echo " " @@ -221,60 +208,46 @@ for DISPID in $VALID_ONOFF_IDS; do echo "
$NAME
" echo "
" - fi - if [ "$MOBILE" == "1" ]; then + if [ "$NOFLOAT" == "1" ]; then echo "
" fi done + +#Custom Buttons Start +echo "
" +echo "" +echo " " +echo " " +echo "" +echo "
Receiver Power
" echo "
" -if [ "$MOBILE" != "1" ]; then -echo "
" + if [ "$NOFLOAT" == "1" ]; then + echo "
" + fi +echo "
" +echo "" +echo " " +echo " " +echo "" +echo "
Receiver Volume
" +echo "
" + if [ "$NOFLOAT" == "1" ]; then + echo "
" + fi +#Custom Buttons End - if [ -z "$AJAX" ]; then +echo "
" - echo "
Receiver Power
" - echo "
" - echo "
" - echo "
" +if [ "$MOBILE" != "1" ]; then - echo "
Receiver Volume
" - echo "
" - echo "
" - echo "
" +echo "
" - else - - echo "
" - echo "" - echo " " - echo " " - echo "" - echo "
Receiver Power
" - echo "
" - - echo "
" - echo "" - echo " " - echo " " - echo "" - echo "
Receiver Volume
" - echo "
" - - fi +ITEMCOUNT=0 for DISPID in $VALID_SEND_IDS; do + ITEMCOUNT=$((ITEMCOUNT+1)) NAME="$(eval echo \$DESC_$DISPID)" [ -z "$NAME" ] && NAME=$DISPID - if [ -z "$AJAX" ]; then - - echo "
" - echo "" - echo "
$NAME
" - echo " " - echo "
" - echo "
" - - else echo "
" echo "" @@ -282,24 +255,17 @@ for DISPID in $VALID_SEND_IDS; do echo "" echo "
$NAME
" echo "
" - - fi + if [ "$NOFLOAT" == "1" -a $((ITEMCOUNT % 2 )) -ne 1 ]; then + echo "
" + fi + done +echo '' echo "
" echo "
" for DISPID in $VALID_BANSHEE_IDS $VALID_CAM_MOTOR_IDS; do NAME="$(eval echo \$DESC_$DISPID)" [ -z "$NAME" ] && NAME=$DISPID - if [ -z "$AJAX" ]; then - - echo "
" - echo "" - echo "
$NAME
" - echo " " - echo "
" - echo "
" - - else echo "
" echo "" @@ -307,10 +273,13 @@ for DISPID in $VALID_BANSHEE_IDS $VALID_CAM_MOTOR_IDS; do echo "" echo "
$NAME
" echo "
" - - fi + if [ "$NOFLOAT" == "1" ]; then + echo "
" + fi + done echo "
" fi +echo "
" echo "" echo ""