diff options
author | petko <petko@524c5546-5005-0410-9a3e-e25e191bd360> | 2022-11-03 09:33:08 +0000 |
---|---|---|
committer | petko <petko@524c5546-5005-0410-9a3e-e25e191bd360> | 2022-11-03 09:33:08 +0000 |
commit | 7dcac52159bab6e0451983f5f602ec8421c5c812 (patch) | |
tree | c22be05ebc6fae549038cb2d31a0a22c339e2571 /scripts/forms.php | |
parent | 1f55e035bd710e4df9d2fb83f359e24915eb7649 (diff) | |
download | pmwiki.svn-7dcac52159bab6e0451983f5f602ec8421c5c812.tar.bz2 |
Forms migrate focus=1 to autofocus=autofocus, remove inline JS.
git-svn-id: svn://pmwiki.org/pmwiki/trunk@4211 524c5546-5005-0410-9a3e-e25e191bd360
Diffstat (limited to 'scripts/forms.php')
-rw-r--r-- | scripts/forms.php | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/scripts/forms.php b/scripts/forms.php index c8f39776..b1bc1b06 100644 --- a/scripts/forms.php +++ b/scripts/forms.php @@ -111,10 +111,6 @@ function MarkupInputForms($m) { Markup('input+sp', '<split', '/(\\(:input\\s+(select|datalist)\\s(?>.*?:\\)))\\s+(?=\\(:input\\s)/', '$1'); -SDV($InputFocusFmt, - "<script language='javascript' type='text/javascript'><!-- - document.getElementById('\$InputFocusId').focus();//--></script>"); - ## InputToHTML performs standard processing on (:input ...:) arguments, ## and returns the formatted HTML string. function InputToHTML($pagename, $type, $args, &$opt) { @@ -184,13 +180,9 @@ function InputToHTML($pagename, $type, $args, &$opt) { $FmtV['$InputFormLabel'] = " <label for=\"{$opt['id']}\"$lbtitle>{$opt['label']}</label> "; } ## handle focus=# option - $focus = @$opt['focus']; - if (isset($focus) - && (!isset($InputFocusLevel) || $focus < $InputFocusLevel)) { - if (!isset($opt['id'])) $opt['id'] = "wikifocus$focus"; - $InputFocusLevel = $focus; - $InputFocusId = $opt['id']; - $HTMLFooterFmt['inputfocus'] = $InputFocusFmt; + if (@$opt['focus']) { + unset($opt['focus']); + $opt['autofocus'] = 'autofocus'; } ## build $InputFormArgs from $opt $attrlist = (isset($opt[':attr'])) ? $opt[':attr'] : $InputAttrs; |