From: Felix Fietkau Date: Fri, 14 Oct 2005 09:32:33 +0000 (+0000) Subject: fix safari javascript bug X-Git-Tag: whiterussian_rc4~117 X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=aa59972a7625c2620951d46423e79e215f6322cd;p=openwrt%2Fsvn-archive%2Fopenwrt.git fix safari javascript bug SVN-Revision: 2105 --- diff --git a/openwrt/package/webif/files/usr/lib/webif/form.awk b/openwrt/package/webif/files/usr/lib/webif/form.awk index 844a56c4b4..30c1ec5277 100644 --- a/openwrt/package/webif/files/usr/lib/webif/form.awk +++ b/openwrt/package/webif/files/usr/lib/webif/form.awk @@ -14,6 +14,10 @@ BEGIN { gsub(/^[ \t]+/,"",$1) } +$1 ~ /^onchange/ { + onchange = $2 +} + ($1 != "") && ($1 !~ /^option/) && (select_open == 1) { select_open = 0 print "" @@ -32,21 +36,25 @@ $1 ~ /^field/ { if ($3 != "") field_opts=" id=\"" $3 "\"" else field_opts="" if ($4 == "hidden") field_opts = field_opts " style=\"display: none\"" - print "" $2 "" + print "" $2 "" field_open=1 } $1 ~ /^checkbox/ { - if ($3==$4) checkbox_selected="checked=\"checked\" " - else checkbox_selected="" - print "" + if ($3==$4) opts="checked=\"checked\" " + else opts="" + if (onchange != "") opts = opts " onClick=\"" onchange "()\" onChange=\"" onchange "()\"" + print "" } $1 ~ /^radio/ { - if ($3==$4) radio_selected="checked=\"checked\" " - else radio_selected="" - print "" + if ($3==$4) opts="checked=\"checked\" " + else opts="" + if (onchange != "") opts = opts " onClick=\"" onchange "()\" onChange=\"" onchange "()\"" + print "" } $1 ~ /^select/ { - print "" select_open = 1 select_default = $3 } 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 656bdbc7a6..efad4d114d 100755 --- a/openwrt/package/webif/files/www/cgi-bin/webif/wan.sh +++ b/openwrt/package/webif/files/www/cgi-bin/webif/wan.sh @@ -24,12 +24,12 @@ if empty "$FORM_submit"; then # detect pptp package and compile option [ -x /sbin/ifup.pptp ] && { - PPTP_OPTION="radio|wan_proto|$FORM_wan_proto|pptp|PPTP
|onChange=\"modechange()\"" + PPTP_OPTION="radio|wan_proto|$FORM_wan_proto|pptp|PPTP
" PPTP_SERVER_OPTION="field|PPTP Server IP|pptp_server_ip|hidden text|pptp_server_ip|$FORM_pptp_server_ip" } [ -x /sbin/ifup.pppoe ] && { - PPPOE_OPTION="radio|wan_proto|$FORM_wan_proto|pppoe|PPPoE
|onChange=\"modechange()\"" + PPPOE_OPTION="radio|wan_proto|$FORM_wan_proto|pppoe|PPPoE
" } # pptp, dhcp and static common @@ -148,11 +148,12 @@ function modechange() EOF display_form <|onchange="modechange()" -radio|wan_proto|$FORM_wan_proto|dhcp|DHCP
|onchange="modechange()" -radio|wan_proto|$FORM_wan_proto|static|Static IP
|onchange="modechange()" +radio|wan_proto|$FORM_wan_proto|none|None
+radio|wan_proto|$FORM_wan_proto|dhcp|DHCP
+radio|wan_proto|$FORM_wan_proto|static|Static IP
$PPPOE_OPTION $PPTP_OPTION end_form @@ -175,8 +176,8 @@ end_form start_form|PPP Settings|ppp_settings|hidden 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()" +radio|ppp_redial|$FORM_ppp_redial|demand|Connect on Demand
+radio|ppp_redial|$FORM_ppp_redial|persist|Keep Alive field|Maximum Idle Time|ppp_demand_idletime|hidden text|ppp_idletime|$FORM_ppp_idletime field|Redial Timeout|ppp_persist_redialperiod|hidden 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 0ee96be9e1..62fb4b1a40 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 @@ -214,6 +214,7 @@ function modechange() EOF display_form <|onChange="modechange()" -radio|mode|$FORM_mode|sta|Client
|onChange="modechange()" -radio|mode|$FORM_mode|wet|Bridge
|onChange="modechange()" -radio|mode|$FORM_mode|adhoc|Ad-Hoc|onChange="modechange()" +radio|mode|$FORM_mode|ap|Access Point
+radio|mode|$FORM_mode|sta|Client
+radio|mode|$FORM_mode|wet|Bridge
+radio|mode|$FORM_mode|adhoc|Ad-Hoc helpitem|Mode helptext|Operation mode helplink|http://wiki.openwrt.org/OpenWrtDocs/Configuration#head-7126c5958e237d603674b3a9739c9d23bdfdb293 end_form start_form|Encryption settings field|Encryption type -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()" +radio|encryption|$FORM_encryption|off|Disabled
+radio|encryption|$FORM_encryption|wep|WEP
+radio|encryption|$FORM_encryption|psk|WPA (preshared key)
+radio|encryption|$FORM_encryption|wpa|WPA (RADIUS) field|WPA support|wpa_support|hidden checkbox|wpa1|$FORM_wpa1|wpa1|WPA1 checkbox|wpa2|$FORM_wpa2|wpa2|WPA2