From 4d1ab1cfc7da41755a10323c7bf0d59c63566ffd Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sat, 24 Sep 2005 17:54:51 +0000 Subject: [PATCH] don't show hidden options while the page loads SVN-Revision: 1991 --- .../webif/files/usr/lib/webif/form.awk | 7 +++--- .../webif/files/www/cgi-bin/webif/wan.sh | 22 +++++++++---------- .../www/cgi-bin/webif/wireless-config.sh | 12 +++++----- 3 files changed, 21 insertions(+), 20 deletions(-) diff --git a/openwrt/package/webif/files/usr/lib/webif/form.awk b/openwrt/package/webif/files/usr/lib/webif/form.awk index d6f170cb3a..25d1507acc 100644 --- a/openwrt/package/webif/files/usr/lib/webif/form.awk +++ b/openwrt/package/webif/files/usr/lib/webif/form.awk @@ -18,9 +18,10 @@ $1 ~ /^start_form/ { } $1 ~ /^field/ { if (field_open == 1) print "" - if ($3 != "") field_id=" id=\"" $3 "\"" - else field_id="" - print "" $2 "" + if ($3 != "") field_opts=" id=\"" $3 "\"" + else field_opts="" + if ($4 == "hidden") field_opts = field_opts " style=\"display: none\"" + print "" $2 "" field_open=1 } $1 ~ /^checkbox/ { diff --git a/openwrt/package/webif/files/www/cgi-bin/webif/wan.sh b/openwrt/package/webif/files/www/cgi-bin/webif/wan.sh index d43f7d574c..b3e6b984a6 100755 --- a/openwrt/package/webif/files/www/cgi-bin/webif/wan.sh +++ b/openwrt/package/webif/files/www/cgi-bin/webif/wan.sh @@ -16,7 +16,7 @@ load_settings network # detect pptp package and compile option [ -x /sbin/ifup.pptp ] && { PPTP_OPTION="radio:wan_proto:$FORM_wan_proto:pptp:PPTP
:onChange=\"modechange()\"" - PPTP_SERVER_OPTION="field:PPTP Server IP:pptp_server_ip + PPTP_SERVER_OPTION="field:PPTP Server IP:pptp_server_ip:hidden text:pptp_server_ip:$FORM_pptp_server_ip" } [ -x /sbin/ifup.pppoe ] && { @@ -146,28 +146,28 @@ radio:wan_proto:$FORM_wan_proto:static:Static IP
:onchange=\"modechange()\" $PPPOE_OPTION $PPTP_OPTION -field:Internet IP Address:wan_ipaddr +field:Internet IP Address:wan_ipaddr:hidden text:wan_ipaddr:$FORM_wan_ipaddr -field:Subnet Mask:wan_netmask +field:Subnet Mask:wan_netmask:hidden text:wan_netmask:$FORM_wan_netmask -field:Gateway:wan_gateway +field:Gateway:wan_gateway:hidden text:wan_gateway:$FORM_wan_gateway -field:DNS Server(s):wan_dns +field:DNS Server(s):wan_dns:hidden text:wan_dns:$FORM_wan_dns $PPTP_SERVER_OPTION -field:PPP Redial Policy:ppp_redial +field:PPP Redial Policy:ppp_redial:hidden radio:ppp_redial:$FORM_ppp_redial:demand:Connect on Demand
:onChange=\"modechange()\" radio:ppp_redial:$FORM_ppp_redial:persist:Keep Alive:onChange=\"modechange()\" -field:Maximum Idle Time:ppp_demand_idletime +field:Maximum Idle Time:ppp_demand_idletime:hidden text:ppp_idletime:$FORM_ppp_idletime -field:Redial Timeout:ppp_persist_redialperiod +field:Redial Timeout:ppp_persist_redialperiod:hidden text:ppp_redialperiod:$FORM_ppp_redialperiod -field:PPP Username:ppp_username +field:PPP Username:ppp_username:hidden text:ppp_username:$FORM_ppp_username -field:PPP Password:ppp_passwd +field:PPP Password:ppp_passwd:hidden text:ppp_passwd:$FORM_ppp_passwd -field:PPP MTU:ppp_mtu +field:PPP MTU:ppp_mtu:hidden text:ppp_mtu:$FORM_ppp_mtu field diff --git a/openwrt/package/webif/files/www/cgi-bin/webif/wireless-config.sh b/openwrt/package/webif/files/www/cgi-bin/webif/wireless-config.sh index 0e46108ed1..d4e698d633 100755 --- a/openwrt/package/webif/files/www/cgi-bin/webif/wireless-config.sh +++ b/openwrt/package/webif/files/www/cgi-bin/webif/wireless-config.sh @@ -162,19 +162,19 @@ radio:encryption:$FORM_encryption:off:Disabled
:onChange=\"modechange()\" radio:encryption:$FORM_encryption:wep:WEP
:onChange=\"modechange()\" radio:encryption:$FORM_encryption:psk:WPA (preshared key)
:onChange=\"modechange()\" radio:encryption:$FORM_encryption:wpa:WPA (RADIUS):onChange=\"modechange()\" -field:WPA support:wpa_support +field:WPA support:wpa_support:hidden checkbox:wpa1:$FORM_wpa1:wpa1:WPA1 checkbox:wpa2:$FORM_wpa2:wpa2:WPA2 -field:WPA encryption type:wpa_crypto +field:WPA encryption type:wpa_crypto:hidden checkbox:tkip:$FORM_tkip:tkip:RC4 (TKIP) checkbox:aes:$FORM_aes:aes:AES -field:WPA preshared key:wpa_psk +field:WPA preshared key:wpa_psk:hidden text:wpa_psk:$FORM_wpa_psk -field:RADIUS Server IP:radius_ipaddr +field:RADIUS Server IP:radius_ipaddr:hidden text:radius_ipaddr:$FORM_radius_ipaddr -field:RADIUS Server Key:radius_key +field:RADIUS Server Key:radius_key:hidden text:radius_key:$FORM_radius_key -field:WEP keys:wep_keys +field:WEP keys:wep_keys:hidden radio:key:$FORM_key:1 text:key1:$FORM_key1:
radio:key:$FORM_key:2 -- 2.30.2