فهرست منبع

Add autocapitalize="off" for email fields

Visman 2 سال پیش
والد
کامیت
4f884d43e6

+ 1 - 1
app/Models/Pages/Admin/Install.php

@@ -336,7 +336,7 @@ class Install extends Admin
                             'required' => true,
                             'required' => true,
                         ],
                         ],
                         'email' => [
                         'email' => [
-                            'type'      => 'text',
+                            'type'      => 'email',
                             'maxlength' => '80',
                             'maxlength' => '80',
                             'pattern'   => '.+@.+',
                             'pattern'   => '.+@.+',
                             'value'     => $v->email ?? '',
                             'value'     => $v->email ?? '',

+ 2 - 2
app/Models/Pages/Admin/Options.php

@@ -512,7 +512,7 @@ class Options extends Admin
             'legend' => 'E-mail subhead',
             'legend' => 'E-mail subhead',
             'fields' => [
             'fields' => [
                 'o_admin_email' => [
                 'o_admin_email' => [
-                    'type'      => 'text',
+                    'type'      => 'email',
                     'maxlength' => '80',
                     'maxlength' => '80',
                     'value'     => $config->o_admin_email,
                     'value'     => $config->o_admin_email,
                     'caption'   => 'Admin e-mail label',
                     'caption'   => 'Admin e-mail label',
@@ -521,7 +521,7 @@ class Options extends Admin
                     'pattern'   => '.+@.+',
                     'pattern'   => '.+@.+',
                 ],
                 ],
                 'o_webmaster_email' => [
                 'o_webmaster_email' => [
-                    'type'      => 'text',
+                    'type'      => 'email',
                     'maxlength' => '80',
                     'maxlength' => '80',
                     'value'     => $config->o_webmaster_email,
                     'value'     => $config->o_webmaster_email,
                     'caption'   => 'Webmaster e-mail label',
                     'caption'   => 'Webmaster e-mail label',

+ 1 - 1
app/Models/Pages/Admin/Users/NewUser.php

@@ -104,7 +104,7 @@ class NewUser extends Users
                             'pattern'   => '^.{2,25}$',
                             'pattern'   => '^.{2,25}$',
                         ],
                         ],
                         'email' => [
                         'email' => [
-                            'type'      => 'text',
+                            'type'      => 'email',
                             'maxlength' => '80',
                             'maxlength' => '80',
                             'value'     => $data['email'] ?? null,
                             'value'     => $data['email'] ?? null,
                             'caption'   => 'Email',
                             'caption'   => 'Email',

+ 1 - 1
app/Models/Pages/Auth.php

@@ -371,7 +371,7 @@ class Auth extends Page
                     'fields' => [
                     'fields' => [
                         'email' => [
                         'email' => [
                             'autofocus' => true,
                             'autofocus' => true,
-                            'type'      => 'text',
+                            'type'      => 'email',
                             'maxlength' => '80',
                             'maxlength' => '80',
                             'value'     => $email,
                             'value'     => $email,
                             'caption'   => 'Email',
                             'caption'   => 'Email',

+ 1 - 1
app/Models/Pages/PostFormTrait.php

@@ -60,7 +60,7 @@ trait PostFormTrait
             ];
             ];
             $fieldset['email'] = [
             $fieldset['email'] = [
                 'class'     => ['w2'],
                 'class'     => ['w2'],
-                'type'      => 'text',
+                'type'      => 'email',
                 'maxlength' => '80',
                 'maxlength' => '80',
                 'caption'   => 'Email',
                 'caption'   => 'Email',
                 'required'  => 1 === $this->c->config->b_force_guest_email,
                 'required'  => 1 === $this->c->config->b_force_guest_email,

+ 1 - 1
app/Models/Pages/Profile/Email.php

@@ -227,7 +227,7 @@ class Email extends Profile
                     'fields' => [
                     'fields' => [
                         'new_email' => [
                         'new_email' => [
                             'autofocus' => true,
                             'autofocus' => true,
-                            'type'      => 'text',
+                            'type'      => 'email',
                             'maxlength' => '80',
                             'maxlength' => '80',
                             'caption'   => $this->rules->confirmEmail ? 'New or old email' : 'New email',
                             'caption'   => $this->rules->confirmEmail ? 'New or old email' : 'New email',
                             'required'  => true,
                             'required'  => true,

+ 1 - 1
app/Models/Pages/Register.php

@@ -111,7 +111,7 @@ class Register extends Page
                         'email' => [
                         'email' => [
                             'autofocus' => true,
                             'autofocus' => true,
                             'class'     => ['hint'],
                             'class'     => ['hint'],
-                            'type'      => 'text',
+                            'type'      => 'email',
                             'maxlength' => '80',
                             'maxlength' => '80',
                             'value'     => $v->email,
                             'value'     => $v->email,
                             'caption'   => 'Email',
                             'caption'   => 'Email',

+ 2 - 2
app/templates/layouts/form.forkbb.php

@@ -22,8 +22,8 @@
             <dl id="id-dl-{{ $cur['id'] or $key }}" @if ($cur['class']) class="f-field-{{ \implode(' f-field-', $cur['class']) }}" @endif>
             <dl id="id-dl-{{ $cur['id'] or $key }}" @if ($cur['class']) class="f-field-{{ \implode(' f-field-', $cur['class']) }}" @endif>
               <dt> @if ($cur['caption'])<label class="f-ycaption @if ($cur['required']) f-req @endif" @if (false === \strpos('.radio.yield.str.btn.link.', ".{$cur['type']}.")) for="id-{{ $key }}" @endif>{!! __($cur['caption']) !!}</label> @endif</dt>
               <dt> @if ($cur['caption'])<label class="f-ycaption @if ($cur['required']) f-req @endif" @if (false === \strpos('.radio.yield.str.btn.link.', ".{$cur['type']}.")) for="id-{{ $key }}" @endif>{!! __($cur['caption']) !!}</label> @endif</dt>
               <dd>
               <dd>
-                @if ('text' === $cur['type'])
-                <input @if ($cur['required']) required @endif @if ($cur['disabled']) disabled @endif @if ($cur['autofocus']) autofocus @endif class="f-ctrl f-ytxt" id="id-{{ $key }}" name="{{ $key }}" type="text" @if ($cur['maxlength']) maxlength="{{ $cur['maxlength'] }}" @endif @if ($cur['pattern']) pattern="{{ $cur['pattern'] }}" @endif @isset ($cur['value']) value="{{ $cur['value'] }}" @endisset>
+                @if ('text' === $cur['type'] || 'email' === $cur['type'])
+                <input @if ($cur['required']) required @endif @if ($cur['disabled']) disabled @endif @if ($cur['autofocus']) autofocus @endif @if ('email' === $cur['type']) autocapitalize="off" @endif class="f-ctrl f-ytxt" id="id-{{ $key }}" name="{{ $key }}" type="text" @if ($cur['maxlength']) maxlength="{{ $cur['maxlength'] }}" @endif @if ($cur['pattern']) pattern="{{ $cur['pattern'] }}" @endif @isset ($cur['value']) value="{{ $cur['value'] }}" @endisset>
                 @elseif ('textarea' === $cur['type'])
                 @elseif ('textarea' === $cur['type'])
                 <textarea @if ($cur['required']) required @endif @if ($cur['disabled']) disabled @endif @if ($cur['autofocus']) autofocus @endif class="f-ctrl f-ytxtarea" id="id-{{ $key }}" name="{{ $key }}" @if ($cur['data']) @foreach ($cur['data'] as $k => $v) data-{{ $k }}="{{ $v }}" @endforeach @endif>{{ $cur['value'] or '' }}</textarea>
                 <textarea @if ($cur['required']) required @endif @if ($cur['disabled']) disabled @endif @if ($cur['autofocus']) autofocus @endif class="f-ctrl f-ytxtarea" id="id-{{ $key }}" name="{{ $key }}" @if ($cur['data']) @foreach ($cur['data'] as $k => $v) data-{{ $k }}="{{ $v }}" @endforeach @endif>{{ $cur['value'] or '' }}</textarea>
                 @elseif ('select' === $cur['type'])
                 @elseif ('select' === $cur['type'])