diff --git a/localization/en_US.inc b/localization/en_US.inc index dce76ee..b3a08f2 100644 --- a/localization/en_US.inc +++ b/localization/en_US.inc @@ -20,6 +20,8 @@ $labels['authentication_cancelled'] = 'Authentication cancelled'; $labels['test_key'] = 'Test key'; $labels['key_checked'] = 'Successfully checked key'; $labels['request_key_name'] = 'Please enter a name for this key'; +$labels['edit_key_name'] = 'Please enter a new name for key'; +$labels['key_renamed'] = 'Key renamed to'; // Messages used for the different portions of the plugin $messages = array(); diff --git a/localization/nl_NL.inc b/localization/nl_NL.inc index ab2e02f..7b7275a 100644 --- a/localization/nl_NL.inc +++ b/localization/nl_NL.inc @@ -20,6 +20,8 @@ $labels['authentication_cancelled'] = 'Authenticatie geannuleerd'; $labels['test_key'] = 'Sleutel testen'; $labels['key_checked'] = 'Sleutel gecontroleerd met ID'; $labels['request_key_name'] = 'Voer een naam in voor deze sleutel'; +$labels['edit_key_name'] = 'Voer een nieuwe naam in voor sleutel'; +$labels['key_renamed'] = 'Sleutel hernoemd naar'; // Messages used for the different portions of the plugin $messages = array(); diff --git a/settings.css b/settings.css index 5b51e36..750516a 100644 --- a/settings.css +++ b/settings.css @@ -1 +1,3 @@ -#twofactor_webauthn_keylist SPAN { font-size: 16px; color: red; cursor: pointer; margin-left: 5px; } +#twofactor_webauthn_keylist SPAN { font-size: 16px; cursor: pointer; margin-left: 5px; } +#twofactor_webauthn_keylist SPAN.rename { color: orange; } +#twofactor_webauthn_keylist SPAN.delete { color: red; } diff --git a/twofactor_webauthn.js b/twofactor_webauthn.js index bea82ff..d76da4d 100644 --- a/twofactor_webauthn.js +++ b/twofactor_webauthn.js @@ -1,6 +1,7 @@ if (window.rcmail) { rcmail.addEventListener('init', function(evt) { rcmail.register_command('plugin.twofactor_webauthn_prepare', twofactor_webauthn_prepare, true); + rcmail.register_command('plugin.twofactor_webauthn_rename', twofactor_webauthn_rename, true); rcmail.register_command('plugin.twofactor_webauthn_delete', twofactor_webauthn_delete, true); rcmail.register_command('plugin.twofactor_webauthn_save', twofactor_webauthn_save, true); rcmail.register_command('plugin.twofactor_webauthn_test', twofactor_webauthn_test); @@ -14,6 +15,9 @@ if (window.rcmail) { function twofactor_webauthn_prepare() { rcmail.http_post('plugin.twofactor_webauthn_prepare'); } +function twofactor_webauthn_rename(id, name) { + rcmail.http_post('plugin.twofactor_webauthn_rename', { id: id, name: name }); +} function twofactor_webauthn_delete(id) { rcmail.http_post('plugin.twofactor_webauthn_delete', { id: id }); } @@ -55,8 +59,11 @@ function twofactor_webauthn_list(data) { rcmail.enable_command('plugin.twofactor_webauthn_test', true); for (key of data) { ul.append('