Coder Social home page Coder Social logo

cloudfour / hideshowpassword Goto Github PK

View Code? Open in Web Editor NEW
737.0 35.0 115.0 273 KB

Because life's too short to waste time re-typing passwords.

Home Page: http://blog.cloudfour.com/hide-show-passwords-plugin/

CSS 18.26% JavaScript 63.86% HTML 17.88%
jquery forms

hideshowpassword's People

Contributors

barryceelen avatar bytestream avatar dlegr250 avatar jeremykenedy avatar kuatsure avatar tylersticka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hideshowpassword's Issues

jquery dependency in wordpress

I tried using this plugin for a form created by a the ultimate member plugin I included the hideshowPassword plugin in the footer of the page except for the jquery dependency which is already in use througn my functions.php file but it doesnt work and if I add the jquery dependency script in the footer of the page the form completely disapears.

Use deep merge for options

I wanted to override the labels for the toggle and got strange errors because the other fields in the states hash were missing. You can avoid this by doing a deep merge with $.extend(true, {}, ...

Removing Inline Width On Wrapper

Hi Guys,

Thanks for making this great little plugin! One small issue I have is the inline width on the hideShowPassword-wrapper div. What would be the best way to make the wrapper fluid when using the second example?

Thx!

Revise methods of instantiation for consistency

In an effort to make the plugin easy to use for novices and control-freaks alike, the plugin currently uses several shorthand methods as well as shorthand arguments to simplify calling the plugin. This has the unintended side-effect of the documentation being confusing... any one method of calling the plugin is as simple as it can be, but altogether they make the plugin as a whole more confusing.

We should explore consolidating things into one consistent JavaScript API, with possibly something like a data-attribute API for those with simpler needs.

Attach to hover event

Hello, how can i attach hidePassword to hover event? I need show passord on mousedown and hide on mouseup.

Password Text Box Size Changes

First, Thanks for this plugin.

I am using it one of my project and it works fine. I am having a little issue which is stopping me to go ahead.

I am having a floating box which accepts username and password. Once this plugin is installed, the size of the password text box changes to small size.

On other pages, this works fine. The issue is only with the floating box.
password

Without this plugin, the size of the password text box is normal as the username.

Keyboard accessibility for the hide/show toggle

Love the plugin. The hide/show toggle added to the password field is available to users with a pointer, but not available for keyboard users. Keyboard availability is a key element of accessibility, so it would be good to:

  1. add a tabindex=0 to the toggle div, which will allow tabbing to the hide/show element
  2. add a keypress event handler to allow space or enter to toggle the hide/show status

browserify require is broken when jQuery versions mismatch

Hello,

Just encountered a problem when requiring hideshowpassword using Browserify.

Given that I need to support IE8, jQuery is defined as ^1.11.3 in my package.json.

Since you have also added jQuery as dependency, and that the two versions mismatch, the hideshowpassword function will be attached to your jQuery instance, instead of mine, making it unavailable from my code.

Why jQuery has been added as production dependency, given that the function is attached to $.fn ?

A CSS requirement

I guess this style is definitely a requirement to the plugin (in order to achieve the same behaviour as the demo).

.hideShowPassword-toggle {
z-index: 3;
}

keep on developing this plugin, is really really great !!

Auto left and right margins not inherited in Firefox

I have an element with auto left and right margins. In Chrome and other Webkit-based browsers, this is inherited by the wrapper by assigning the margin the calculated pixel value of the left and right margins. In Firefox, the left and right margins are instead inherited as 0px margins.

Smaller wink image?

I'd like to see a 25% smaller wink image, about the same size as the one in IE11.
image

npm styles

It would be nice if the example stylesheets could be included via npm the same way that the JavaScript file can be. (This would also address the intent behind #14.)

Npm package broken

The NPM package seems to be broken :

npm install hideShowPassword
fetch failed https://registry.npmjs.org/hideShowPassword/-/hideShowPassword-2.0.4.tgz
npm ERR! Error: 404 Not Found

By the way, thanks for the good work. It works very well.

IE8 bug

Hi - was about to write about an IE8 bug, before I started looking into it and realised that older versions of IE throw an error if you change the type property of an input element after creation - so it's unfixable in this incarnation.

It might be worth adding an exception so that the script just disables itself in such browsers, or at least a mention in the docs that IE < 9 throws an error?

Many thanks for releasing the script, it was a great help!

Rendering issue when displayed on a modal form.

Hello.

When I display a form in a modal, the plugin rendering fails somehow.

Screen shot with plugin enabled on a modal dialog:
password-bad

Screen shot with plugin disabled on a modal dialog:
password-good

Screen shot with plugin enabled, without modal dialog:
password-good-no-modal

And here is the initialization function:

// password reveals
$('#' + signupModelID +  '-password').hideShowPassword({
    show: false,
    innerToggle: true,
});

What do you think?

Thanks.

Hide Password Toggle on Blur

Howdy Tyler!

Just upgrading to v2... Looks like I can just use the shorthand method .showPassword('focus') to get my desired behavior. However, I cannot seem to find the option for hiding the toggle on the blur event. I'm probably missing something simple. Figured it best to just ask though...

Thx for the great plugin :-)

Classes should be in kebab-case

Validation of css to use with this library (via stylelint and stylelint-config-standard) detects the following errora:

 ✖  Expected class selector ".hideShowPassword-toggle" to be kebab-case  selector-class-pattern
 ✖  Expected class selector ".hideShowPassword-field" to be kebab-case   selector-class-pattern

classes should be renamed like ".hide-show-password-toggle" and ".hide-show-password-field"

Rely more on CSS and less on JS for styles

The majority of the issues we receive are related to the styles set via JavaScript on the wrapper and inline toggle. It may be the case that the convenience of this method is outweighed by the risk of breakage introduced.

In an upcoming major-release version with support for smarter importing of styles (see #25) and without a jQuery dependency (see #32), it may make sense to shift that responsibility back to CSS-land.

Bower install fails

At least at Windows machines (haven't tested with others OS, but with multiple Windows machines), the bower install fails as bower.json seems to be a symbolic link with "package.json" text within it. The symbolic link seems to break down for some reason and since the "package.json" isn't exactly valid JSON, the install aborts.

bower hideshowpassword#*                               EMALFORMED Failed to read
<temp path here>\bower.json

Additional error details:
Unexpected token p

Vanilla JS

IE8 and earlier doesn't allow changes to the type attribute of <input> elements, so browser compatibility isn't much of a concern for this script. Because of that, and because this script is intended to improve mobile or touch experiences in particular, it seems feasible to accept that we might not need jQuery for the next version. It may make sense to include a jquery.* version for convenience, but I imagine it could feasibly include the vanilla JS script and use it to instantiate a plugin.

Disable added inline styles

How do I remove the inline styles on hideShowPassword-wrapper and hideShowPassword-field?

I tried adding the style property in the options object, but still the inline styles are added automatically.

Rogue console.log

There's a console.log in toggleKeyEvent. Old browsers don't support console.log, though I'm not sure what your list of supported browsers is, so this could be a non-issue.

Problem in bootstrap modals

I'm using two tabs based on the bootstrap framework - if the hideShowPassword plugin is called in the tab that's visible on page load, all is fine.

If I'm switching to the second tab, the input gehts shortened and the icon is displayed above it, instead of inside of it. It still works though, just the layout gets messed up.

hideshowpassword

I solved it by overriding the css with:

.hideShowPassword-wrapper { width: 100% }
.hideShowPassword-toggle { margin-top: -19px !important }

Possibility to use existing wrapper (parent) element

wrapElement method always creates a new "wrapper" element around input.
In some situations it would be great to pass the wrapper element within options and just do initialization like copy all CSS etc.

My use case is that we uses "adaptive placeholders" which requires to have label exactly after input element. Something like this:

<div>
  <input>
  <label>
</div>

Determine solution or official recommendation for autofill issues

The plug in works so well. But it just has a weird issue. When the user name or the password input have not been set up with any value, it will automatically show the browser saved user name and password for the current webpage. Is there a way to not show browser saved user name and password? Thank you
untitled

Multiple Selectors

Sorry for the question again.

I have 2 password text boxes.

I tried the plugin with the wildcard selectors. For me, it works only for the first text box.

$("input[name*=password]").showPassword(true, { wrapper: { enforceWidth: false } });

Please note the * in the selector.

How to ...

In your demo, the middle one has the password initially shown with a toggle. I want it initially masked, like in IE11 and have the show button showing. I don't see how to do that.

.hideShowPassword-field not added on init

Noticing that when a password field is initialized, class "hideShowPassword-field" is not assigned to the input element. The class is only added after clicking the toggle button for the first time.

Traced it to if (! this.options.enable || this.isType()) return false; in the updateElement function. On init, both evaluate to true.

Is this by design?

Thanks for making your plugin available.

Uncaught Error: type property can't be changed

Hi,

I'm getting this error just calling the hideShowPassword() function on my jQuery password object.

Looking at your code, it seems that you change the type attribute using .attr() that is not allowed by jQuery. Using .prop() does the trick though.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.