Skip to content

Commit 5dac354

Browse files
committed
Add an email field type which validates the value to be an email address [#65]
1 parent ac825f8 commit 5dac354

4 files changed

Lines changed: 8 additions & 1 deletion

File tree

assets/components/clientconfig/js/mgr/sections/home.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,10 @@ Ext.extend(ClientConfig.page.Home,MODx.Component,{
151151
field.xtype = 'textfield';
152152
field.inputType = 'password';
153153
}
154+
if (field.xtype === 'email') {
155+
field.xtype = 'textfield';
156+
field.vtype = 'email';
157+
}
154158

155159
if (field.xtype == 'modx-combo') {
156160
var options = value.options.split('||');

assets/components/clientconfig/js/mgr/widgets/combos.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ ClientConfig.combo.FieldTypes = function(config) {
4242
['modx-panel-tv-file', _('clientconfig.xtype.file')],
4343
['numberfield', _('clientconfig.xtype.numberfield')],
4444
['colorpickerfield', _('clientconfig.xtype.colorpalette')],
45+
['email', _('clientconfig.xtype.email')],
4546
['xcheckbox', _('clientconfig.xtype.xcheckbox')],
4647
['datefield', _('clientconfig.xtype.datefield')],
4748
['timefield', _('clientconfig.xtype.timefield')],

core/components/clientconfig/docs/changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
- Allow a hash in the url containing the ID of a group to automatically open to that tab [#169]
55
- Add a line/divider field type to create simple sections [#149]
66
- Add a code field type (requires Ace editor) for things like custom CSS or other markup [#144]
7+
- Add an email field type which validates the value to be an email address [#65]
78
- Include OnHandleRequest plugin event (alongside OnMODXInit), to make ClientConfig play nicer with various context routing and other solutions that don't use OnMODXInit [#140]
89

910
ClientConfig 2.2.0-pl

core/components/clientconfig/lexicon/en/default.inc.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,4 +111,5 @@
111111

112112
// New 2019-10-24
113113
$_lang['clientconfig.xtype.line'] = 'Line (divider)';
114-
$_lang['clientconfig.xtype.code'] = 'Code (requires Ace editor installed)';
114+
$_lang['clientconfig.xtype.code'] = 'Code (requires Ace editor installed)';
115+
$_lang['clientconfig.xtype.email'] = 'Email';

0 commit comments

Comments
 (0)