Issue #1459164 by Kevin Morse, droplet: Use test() to match string for BOOL comparison .

merge-requests/26/head
webchick 2012-04-30 22:04:36 -07:00
parent 471664d00e
commit 1ef0cd4e9c
2 changed files with 5 additions and 5 deletions

View File

@ -105,7 +105,7 @@ Drupal.behaviors.dateTime = {
// Attach keyup handler to custom format inputs. // Attach keyup handler to custom format inputs.
$('input' + source, context).once('date-time').keyup(function () { $('input' + source, context).once('date-time').keyup(function () {
var input = $(this); 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) { $.getJSON(url, function (data) {
$(suffix).empty().append(' ' + fieldSettings.text + ': <em>' + data + '</em>'); $(suffix).empty().append(' ' + fieldSettings.text + ': <em>' + data + '</em>');
}); });

View File

@ -95,10 +95,10 @@ Drupal.behaviors.password = {
Drupal.evaluatePasswordStrength = function (password, translate) { Drupal.evaluatePasswordStrength = function (password, translate) {
var weaknesses = 0, strength = 100, msg = []; var weaknesses = 0, strength = 100, msg = [];
var hasLowercase = password.match(/[a-z]+/); var hasLowercase = /[a-z]+/.test(password);
var hasUppercase = password.match(/[A-Z]+/); var hasUppercase = /[A-Z]+/.test(password);
var hasNumbers = password.match(/[0-9]+/); var hasNumbers = /[0-9]+/.test(password);
var hasPunctuation = password.match(/[^a-zA-Z0-9]+/); var hasPunctuation = /[^a-zA-Z0-9]+/.test(password);
// If there is a username edit box on the page, compare password to that, otherwise // If there is a username edit box on the page, compare password to that, otherwise
// use value from the database. // use value from the database.