Changeset View
Changeset View
Standalone View
Standalone View
plugins/kolab_2fa/kolab2fa.js
Show First 20 Lines • Show All 268 Lines • ▼ Show 20 Lines | rcmail.addEventListener('plugin.render_data', function(data) { | ||||
} | } | ||||
} | } | ||||
else if (window.console) { | else if (window.console) { | ||||
console.error("Cannot assign auth data", data); | console.error("Cannot assign auth data", data); | ||||
} | } | ||||
}); | }); | ||||
// callback for save action | // callback for save action | ||||
rcmail.addEventListener('plugin.save_success', function(data) { | rcmail.addEventListener('plugin.kolab_2fa_save_success', function(data) { | ||||
// force object | |||||
if (rcmail.env.kolab_2fa_factors.length !== undefined) { | |||||
rcmail.env.kolab_2fa_factors = {}; | |||||
} | |||||
if (!data.active && rcmail.env.kolab_2fa_factors[data.id]) { | if (!data.active && rcmail.env.kolab_2fa_factors[data.id]) { | ||||
delete rcmail.env.kolab_2fa_factors[data.id]; | delete rcmail.env.kolab_2fa_factors[data.id]; | ||||
} | } | ||||
else if (rcmail.env.kolab_2fa_factors[data.id]) { | else if (rcmail.env.kolab_2fa_factors[data.id]) { | ||||
$.extend(rcmail.env.kolab_2fa_factors[data.id], data); | $.extend(rcmail.env.kolab_2fa_factors[data.id], data); | ||||
} | } | ||||
else { | else { | ||||
rcmail.env.kolab_2fa_factors[data.id] = data; | rcmail.env.kolab_2fa_factors[data.id] = data; | ||||
▲ Show 20 Lines • Show All 71 Lines • ▼ Show 20 Lines | $('.propform input.k2fa-verify').keypress(function(e) { | ||||
if (e.which == 13) { | if (e.which == 13) { | ||||
$(this).closest('.propform').find('.button.verify').click(); | $(this).closest('.propform').find('.button.verify').click(); | ||||
} | } | ||||
}); | }); | ||||
// render list initially | // render list initially | ||||
render(); | render(); | ||||
}); | }); | ||||
No newline at end of file | No newline at end of file |