manhcodedao / jquery-watermark

Automatically exported from code.google.com/p/jquery-watermark
0 stars 0 forks source link

Updating watermark on password field #114

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. set a watermark on a password field
2. update the watermark
3. update the watermark ...

What is the expected output? What do you see instead?
Only update the watermark.
It takes the watermark text (value of text input which replaces the password 
input) as value of the input

What version of the product are you using? On what operating system?
The last available version, on OSX/ Firefox. certainly all os/browers are 
affected

I join a patch which fixes this issue.

Original issue reported on code.google.com by Diorcet....@gmail.com on 4 Jul 2013 at 2:39

GoogleCodeExporter commented 8 years ago
See important notes section on project home page, which includes:

Avoid programmatic changes to passwords - Because of the complexity of making 
password watermarks operate, it is recommended that programmatic changes to 
password input elements (changes made after the page finishes loading) be 
avoided.

Original comment by t...@speednet.biz on 4 Jul 2013 at 2:47

GoogleCodeExporter commented 8 years ago
Ok.
So it is a limitation. can't i provide a patch removing this limitation?

Original comment by Diorcet....@gmail.com on 4 Jul 2013 at 3:29

GoogleCodeExporter commented 8 years ago
182c182,186
<                       $input.attr( "maxLength", text.length );
---
>
>                       // Update variables
>                       text = $input.data( dataText ) || "";
>                       type = $input.attr( "type" ) || "";
>                       className = $input.data( dataClass );
315d318
<
322a326,342
>
>                   // Update alertnative input (password or text)
>                   var $ainput = $input.data( dataPassword );
>                   if($ainput) {
>                       if ( hasText ) {
>                           $ainput.data( dataText, text );
>                       }
>
>                       if ( hasClass ) {
>                           $ainput.data( dataClass, options.className );
>                       }
>
>                       // Get the password input
>                       if($input.attr( "type" ) !== "password") {
>                           $input = $ainput;
>                       }
>                   }

Original comment by Diorcet....@gmail.com on 4 Jul 2013 at 3:37

GoogleCodeExporter commented 8 years ago
I cannot commit such a patch to this plugin, because I do not feel it is safe.  
One of the great things about open source, however, is that you are free to 
make modifications to your own copy of the code and use it on your site.

I do appreciate you submitting the patch.

Original comment by t...@speednet.biz on 4 Jul 2013 at 3:40

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
No problem. As long there is a trace.  At least someone interested by this 
feature can use it.

Regards,

Original comment by Diorcet....@gmail.com on 4 Jul 2013 at 3:43