|
Lines 365-376
$(".prefs-tab form").each(function () {
Link Here
|
| 365 |
}); |
365 |
}); |
| 366 |
}); |
366 |
}); |
| 367 |
|
367 |
|
|
|
368 |
jQuery.validator.addMethod( |
| 369 |
"email_with_display_name", |
| 370 |
function (value, element) { |
| 371 |
// Regex source |
| 372 |
// https://web.archive.org/web/20251229171626/https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input/email#basic_validation |
| 373 |
// modified to accept "Display Name <user@host>" |
| 374 |
return ( |
| 375 |
this.optional(element) || |
| 376 |
/^(?:\w+\s+<[\w.!#$%&'*+/=?^`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*>)$|^(?:[\w.!#$%&'*+/=?^`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)$/.test( |
| 377 |
value |
| 378 |
) |
| 379 |
); |
| 380 |
}, |
| 381 |
__("Please enter a valid email address (display name allowed).") |
| 382 |
); |
| 383 |
|
| 368 |
$(".preference-email").each(function () { |
384 |
$(".preference-email").each(function () { |
| 369 |
$(this).rules("add", { |
385 |
$(this).rules("add", { |
| 370 |
email: true, |
386 |
email: true, |
| 371 |
}); |
387 |
}); |
| 372 |
}); |
388 |
}); |
| 373 |
|
389 |
|
|
|
390 |
$(".preference-email-with-display-name").each(function () { |
| 391 |
$(this).rules("add", { |
| 392 |
email_with_display_name: true, |
| 393 |
}); |
| 394 |
}); |
| 395 |
|
| 374 |
$(".modalselect").on("click", function () { |
396 |
$(".modalselect").on("click", function () { |
| 375 |
var datasource = $(this).data("source"); |
397 |
var datasource = $(this).data("source"); |
| 376 |
var exclusions = $(this).data("exclusions").split("|"); |
398 |
var exclusions = $(this).data("exclusions").split("|"); |
| 377 |
- |
|
|