Sha256: 08bce1334f452c1e08651789031874f80f02831ee17f0ce272a43272a96c0c3a
Contents?: true
Size: 1.07 KB
Versions: 68
Compression:
Stored size: 1.07 KB
Contents
<% url = ThinkFeelDoEngine::Engine.routes.url_helpers %> $(document).on('page:change', function() { var password_path = location.pathname.replace('/edit', ''); $("#new_participant[action='" + password_path + "'] #participant_password, #edit_participant[action='" + password_path + "'] #participant_password, #new_user[action='" + password_path + "'] #user_password, #edit_user[action='" + password_path + "'] #user_password").on("keyup", function(event) { $.getJSON("<%= url.password_entropy_bits_path %>", { password: $(this).val(), reset_password_token: _getPasswordToken() }, function(data) { if (data.bits < 10) { $("#password-strength").html("<span class='text-danger'>Weak</span>"); } else if (data.bits < 18) { $("#password-strength").html("<span class='text-primary'>Medium</span>"); } else { $("#password-strength").html("<span class='text-success'>Strong <i class='fa fa-check'></i></span>"); } }); }); function _getPasswordToken() { return location.search.split("?reset_password_token=")[1]; } });
Version data entries
68 entries across 68 versions & 1 rubygems