Revision 3981:d2f19ce90a4c,
614 bytes
checked in by franck <carnet.franck.paul@…>, 6 years ago
(diff) |
Switching from inline JS variables to JSON script, user prefs page
|
Line | |
---|
1 | /*global $, getData */ |
---|
2 | 'use strict'; |
---|
3 | |
---|
4 | $(function() { |
---|
5 | if ($('#new_pwd').length == 0) { |
---|
6 | return; |
---|
7 | } |
---|
8 | const texts = getData('preferences'); |
---|
9 | $('#new_pwd').pwstrength({ |
---|
10 | texts: texts |
---|
11 | }); |
---|
12 | const user_email = $('#user_email').val(); |
---|
13 | $('#user-form').submit(function() { |
---|
14 | var e = this.elements.cur_pwd; |
---|
15 | if (e.value != '') { |
---|
16 | return true; |
---|
17 | } |
---|
18 | if ($('#user_email').val() != user_email || $('#new_pwd').val() != '') { |
---|
19 | $(e).addClass('missing').focusout(function() { |
---|
20 | $(this).removeClass('missing'); |
---|
21 | }); |
---|
22 | e.focus(); |
---|
23 | return false; |
---|
24 | } |
---|
25 | return true; |
---|
26 | }); |
---|
27 | }); |
---|
Note: See
TracBrowser
for help on using the repository browser.