Added suggestions for default values in UI (interactive). Fixed bug when
Security combobox was not disabled.
This commit is contained in:
@@ -14,14 +14,23 @@ $(function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var $enFld = $("INPUT[name='_ident_switch.form.enabled']");
|
$("INPUT[name='_ident_switch.form.enabled']").change();
|
||||||
if ($enFld.size() == 1)
|
$("SELECT[name='_ident_switch.form.secure']").change();
|
||||||
$enFld.change();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
function plugin_switchIdent_enabled_onChange(e) {
|
function plugin_switchIdent_enabled_onChange(e) {
|
||||||
var $enFld = $("INPUT[name='_ident_switch.form.enabled']");
|
var $enFld = $("INPUT[name='_ident_switch.form.enabled']");
|
||||||
$("INPUT[name!='_ident_switch.form.enabled']", $enFld.parents("FIELDSET")).prop("disabled", !$enFld.is(":checked"));
|
$("INPUT[name!='_ident_switch.form.enabled'], SELECT", $enFld.parents("FIELDSET")).prop("disabled", !$enFld.is(":checked"));
|
||||||
|
}
|
||||||
|
|
||||||
|
function plugin_switchIdent_secure_onChange(e) {
|
||||||
|
var $secSel = $("SELECT[name='_ident_switch.form.secure']");
|
||||||
|
var $portFld = $("INPUT[name='_ident_switch.form.port']");
|
||||||
|
|
||||||
|
if ('SSL' === $secSel.val().toUpperCase())
|
||||||
|
$portFld.attr("placeholder", 993);
|
||||||
|
else
|
||||||
|
$portFld.attr("placeholder", 143);
|
||||||
}
|
}
|
||||||
|
|
||||||
function plugin_switchIdent_switch(val) {
|
function plugin_switchIdent_switch(val) {
|
||||||
|
|||||||
@@ -159,13 +159,17 @@ class ident_switch extends rcube_plugin
|
|||||||
'name' => $this->gettext('form.caption'),
|
'name' => $this->gettext('form.caption'),
|
||||||
'content' => array(
|
'content' => array(
|
||||||
'ident_switch.form.enabled' => array('type' => 'checkbox', 'onchange' => 'plugin_switchIdent_enabled_onChange();'),
|
'ident_switch.form.enabled' => array('type' => 'checkbox', 'onchange' => 'plugin_switchIdent_enabled_onChange();'),
|
||||||
'ident_switch.form.label' => array('type' => 'text', 'size' => 32),
|
'ident_switch.form.label' => array('type' => 'text', 'size' => 32, 'placeholder' => $args['record']['email']),
|
||||||
'ident_switch.form.host' => array('type' => 'text', 'size' => 64),
|
'ident_switch.form.host' => array('type' => 'text', 'size' => 64, 'placeholder' => 'localhost'),
|
||||||
'ident_switch.form.secure' => array('type' => 'select', 'options' => array('ssl' => 'SSL', 'tls' => 'TLS')),
|
'ident_switch.form.secure' => array(
|
||||||
|
'type' => 'select',
|
||||||
|
'options' => array('ssl' => 'SSL', 'tls' => 'TLS'),
|
||||||
|
'onchange' => 'plugin_switchIdent_secure_onChange();'
|
||||||
|
),
|
||||||
'ident_switch.form.port' => array('type' => 'text', 'size' => 5),
|
'ident_switch.form.port' => array('type' => 'text', 'size' => 5),
|
||||||
'ident_switch.form.username' => array('type' => 'text', 'size' => 64),
|
'ident_switch.form.username' => array('type' => 'text', 'size' => 64),
|
||||||
'ident_switch.form.password' => array('type' => 'password', 'size' => 64),
|
'ident_switch.form.password' => array('type' => 'password', 'size' => 64),
|
||||||
'ident_switch.form.delimiter' => array('type' => 'text', 'size' => 1),
|
'ident_switch.form.delimiter' => array('type' => 'text', 'size' => 1, 'placeholder' => '.'),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user