Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show_pw #2099

Closed
wants to merge 8 commits into from
Closed

Show_pw #2099

wants to merge 8 commits into from

Conversation

bstutes
Copy link
Contributor

@bstutes bstutes commented Jun 10, 2017

This branch includes changes made to allow (un)masking the password input elements by clicking a "Show password" checkbox. Note that there are two additional commits in this branch that were part of changes submitted for fixing bug #1923 (.gitignore and results.html). Not sure why these are showing up since I have not made any additional changes to these files. Perhaps it's because I don't have a full grasp of using git yet. If they should get pulled in nothing will break.

The remaining commits in this branch all address (un)masking password using a "Show password" checkbox.

bstutes and others added 8 commits May 23, 2017 01:01
"Suggested search results give the wrong count #1923"

.gitignore:
    Added .idea to list of directories in .gitignore.
    Used by PyCharm IDE.

warehouse/templates/search/results.html:
    Removed the following lines from "suggestion_link"
    macro to remove display of counts in results messages
    per discussions in thread for bug #1923:

  {% if freq > 1 %}
  <span>({{ freq }} results)</span>
  {% endif %}
This reverts commit 85c2b0c.
"Suggested search results give the wrong count #1923"

.gitignore:
    Added .idea to list of directories in .gitignore.
    Used by PyCharm IDE.

warehouse/templates/search/results.html:
1) Removed the following lines from "suggestion_link"
   macro to remove display of counts in results messages
   per discussions in thread for bug #1923:

   {% if freq > 1 %}
   <span>({{ freq }} results)</span>
   {% endif %}

2) Added 'id=order' to <select...> element (line 143) to properly
   associate the <label...> element on line 142/
Fix "Suggested search results give the wrong count #1923"

    .gitignore:
        Added .idea to list of directories in .gitignore.
        Used by PyCharm IDE.

    warehouse/templates/search/results.html:
    1) Removed the following lines from "suggestion_link"
       macro to remove display of counts in results messages
       per discussions in thread for bug #1923:

       {% if freq > 1 %}
       <span>({{ freq }} results)</span>
       {% endif %}

    2) Added 'id=order' to <select...> element (line 143) to properly
       associate the <label...> element on line 142.
Removed "{% set freq = best_guess.freq %}" from suggestion_link macro.
Since display of search count has been removed this line no longer
necessary.
Gulpfile.babel.js:
  Added entry in `files' list for "pw-mask-toggle.js" for "dist:js"
  task.
  Modified comment and added statement for mapping output chunk
  for minified pw-mask-toggle.js.

warehouse/csp.py:
  Added "ajax.googleapis.com" to `script-src' list for accesssing
  jQuery library.

warehouse/templates/accounts/login.html:
  Added "-js-pw-m-fld" to form.password "class_" attribute.
  Added <label ...><input ...> statement for "Show password"
    checkbox.
  Added "-js-pw-m-sbt" to Login submit button "class=" attribute..
  Added {% block extra_js %} (including explanatory comments) for
    loading "jQuery" and "pwmask" JS code.

warehouse/templates/accounts/register.html:
  Added "-js-pw-m-fld" to form.password and form.confirm_password
    "class_=" attribute.
  Added <label ...><input ...> statement for "Show password"
    checkbox.
  Added comments and code to {% block extra_js %} for loading
    "jQuery" and "pwmask" JS code.

New File => warehouse/static/js/pwmask/pw-mask-toggle.js:
  JS code that handles password field (un)masking.  Also includes
    event handler to remove the checkbox element from the form
    thus prevent polluting the POST data sent on Submit.
Only cosmetic changes to satisfy "make lint".

Additional notes.

  Since pw-mask-toggle.js requires jQuery support eslint will
  complain "$ is not defined".  This is an "error" that can be
  ignored.  I just haven't figured out how to get eslint to
  accepts the jQuery references.

  I forgot to mention I have no means of testing the password
  unmasking code under IE (I run a Linux box and have no access
  to an IE browser to test with). I believe the code for unmasking
  the password for IE (it's the "catch" if the "try" fails) should
  work. It would be great if someone with access to an IE browser
  could double check that code.
@bstutes bstutes closed this Jun 23, 2017
@bstutes
Copy link
Contributor Author

bstutes commented Jun 23, 2017

This pull request has been superseded by PR Show_PW #2145.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants