Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
945e7605
Commit
945e7605
authored
Apr 17, 2012
by
catch
Browse files
Issue
#1459164
by Kevin Morse, droplet: Use test() to match string for BOOL comparison .
parent
b3e2c8b4
Changes
2
Hide whitespace changes
Inline
Side-by-side
core/modules/system/system.js
View file @
945e7605
...
...
@@ -105,7 +105,7 @@ Drupal.behaviors.dateTime = {
// Attach keyup handler to custom format inputs.
$
(
context
).
find
(
'
input
'
+
source
).
once
(
'
date-time
'
).
keyup
(
function
()
{
var
input
=
$
(
this
);
var
url
=
fieldSettings
.
lookup
+
(
fieldSettings
.
lookup
.
match
(
/
\?
q=/
)
?
'
&format=
'
:
'
?format=
'
)
+
encodeURIComponent
(
input
.
val
());
var
url
=
fieldSettings
.
lookup
+
(
/
\?
q=/
.
test
(
fieldSettings
.
lookup
)
?
'
&format=
'
:
'
?format=
'
)
+
encodeURIComponent
(
input
.
val
());
$
.
getJSON
(
url
,
function
(
data
)
{
$
(
suffix
).
empty
().
append
(
'
'
+
fieldSettings
.
text
+
'
: <em>
'
+
data
+
'
</em>
'
);
});
...
...
core/modules/user/user.js
View file @
945e7605
...
...
@@ -97,10 +97,10 @@ Drupal.behaviors.password = {
Drupal
.
evaluatePasswordStrength
=
function
(
password
,
translate
)
{
var
indicatorText
,
indicatorColor
,
weaknesses
=
0
,
strength
=
100
,
msg
=
[];
var
hasLowercase
=
password
.
match
(
/
[
a-z
]
+/
);
var
hasUppercase
=
password
.
match
(
/
[
A-Z
]
+/
);
var
hasNumbers
=
password
.
match
(
/
[
0-9
]
+/
);
var
hasPunctuation
=
password
.
match
(
/
[^
a-zA-Z0-9
]
+/
);
var
hasLowercase
=
/
[
a-z
]
+/
.
test
(
password
);
var
hasUppercase
=
/
[
A-Z
]
+/
.
test
(
password
);
var
hasNumbers
=
/
[
0-9
]
+/
.
test
(
password
);
var
hasPunctuation
=
/
[^
a-zA-Z0-9
]
+/
.
test
(
password
);
// If there is a username edit box on the page, compare password to that, otherwise
// use value from the database.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment