adding autocomplete attribute to et2_textbox and et2_passwd and use it in email wizzard/account to stop browser from accidently filling out empty fields

This commit is contained in:
Ralf Becker 2014-08-21 13:06:42 +00:00
parent 5a53a36ff1
commit 894e757f18
4 changed files with 18 additions and 11 deletions

View File

@ -62,13 +62,13 @@
</row>
<row class="@manual_class">
<description for="acc_imap_username" value="Username"/>
<textbox id="acc_imap_username" size="32" maxlength="128"/>
<textbox id="acc_imap_username" size="32" maxlength="128" autocomplete="off"/>
<description for="acc_domain" value="Domain" class="emailadmin_no_single"/>
<textbox id="acc_domain" size="32" maxlength="128" class="emailadmin_no_single"/>
</row>
<row>
<description for="acc_imap_password" value="Password"/>
<passwd id="acc_imap_password" options="32,128"/>
<passwd id="acc_imap_password" size="32" maxlength="128" autocomplete="off"/>
<description id="acc_imap_account_id" class="emailadmin_diagnostic"/>
<description/>
</row>
@ -98,11 +98,11 @@
<rows>
<row>
<description for="acc_imap_admin_username" value="Admin user"/>
<textbox id="acc_imap_admin_username" size="32" maxlength="128"/>
<textbox id="acc_imap_admin_username" size="32" maxlength="128" autocomplete="off"/>
</row>
<row>
<description for="acc_imap_admin_password" value="Password"/>
<passwd id="acc_imap_admin_password" options="32,128"/>
<passwd id="acc_imap_admin_password" size="32" maxlength="128" autocomplete="off"/>
</row>
</rows>
</grid>
@ -208,12 +208,12 @@
</row>
<row class="@manual_class">
<description for="acc_smtp_username" value="Username"/>
<textbox blur="if authentication required" id="acc_smtp_username" size="32" maxlength="128"/>
<textbox blur="if authentication required" id="acc_smtp_username" size="32" maxlength="128" autocomplete="off"/>
</row>
<row class="@manual_class">
<description for="acc_smtp_password" value="Password"/>
<hbox>
<passwd id="acc_smtp_password" options="32,128"/>
<passwd id="acc_smtp_password" size="32" maxlength="128" autocomplete="off"/>
<description id="acc_smtp_account_id" class="emailadmin_diagnostic"/>
</hbox>
</row>

View File

@ -14,11 +14,11 @@
</row>
<row class="@manual_class">
<description value="Username" for="acc_smtp_username"/>
<textbox blur="if authentication required" id="acc_smtp_username" size="32" maxlength="128"/>
<textbox blur="if authentication required" id="acc_smtp_username" size="32" maxlength="128" autocomplete="off"/>
</row>
<row class="@manual_class">
<description value="Password" for="acc_smtp_password"/>
<passwd id="acc_smtp_password" options="32,128"/>
<passwd id="acc_smtp_password" size="32" maxlength="128" autocomplete="off"/>
</row>
<row class="@manual_class">
<description value="SMTP server" for="acc_smtp_host"/>

View File

@ -14,15 +14,15 @@
</row>
<row>
<description value="EMail address"/>
<url-email id="ident_email" needed="1" options="32,128"/>
<url-email id="ident_email" needed="1" size="32" maxlength="128" autocomplete="off"/>
</row>
<row class="@manual_class">
<description value="Username" for="acc_imap_username"/>
<textbox blur="if different from EMail address" id="acc_imap_username" size="32" maxlength="128"/>
<textbox blur="if different from EMail address" id="acc_imap_username" size="32" maxlength="128" autocomplete="off"/>
</row>
<row>
<description value="Password" for="acc_imap_password"/>
<passwd id="acc_imap_password" needed="1" options="32,128"/>
<passwd id="acc_imap_password" needed="1" size="32" maxlength="128" autocomplete="off"/>
</row>
<row class="@manual_class">
<description value="IMAP server" for="acc_imap_host"/>

View File

@ -68,6 +68,12 @@ var et2_textbox = et2_inputWidget.extend(
"type": "string",
"default": et2_no_init,
"description": "Perl regular expression eg. '/^[0-9][a-f]{4}$/i'"
},
"autocomplete": {
"name": "Autocomplete",
"type": "string",
"default": "",
"description": "Weither or not browser should autocomplete that field: 'on', 'off', 'default' (use attribute from form)"
}
},
@ -107,6 +113,7 @@ var et2_textbox = et2_inputWidget.extend(
if(this.options.type == "passwd") {
this.input.attr("type", "password");
}
if (this.options.autocomplete) this.input.attr("autocomplete", this.options.autocomplete);
}
if(this.options.size) {