Skip to content

Commit

Permalink
add validation to user display name
Browse files Browse the repository at this point in the history
  • Loading branch information
sathomas committed Jun 10, 2015
1 parent 29fc7f8 commit 50032d1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion node_modules/oae-core/userdetails/userdetails.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion shared/oae/api/oae.api.util.js
Expand Up @@ -589,8 +589,11 @@ define(['exports', 'require', 'jquery', 'underscore', 'oae.api.config', 'markdow
if (options.submitHandler && $.isFunction(options.submitHandler)) {
submitCallback = options.submitHandler;
}

// Register common custom validation methods
$.validator.addMethod('displayname', isValidDisplayName, require('oae.api.i18n').translate('__MSG__NAMES_CANNOT_INCLUDE_URLS_OR_AT_SIGNS__'));

// Register the custom validation methods
// Register additional custom validation methods
if (options.methods) {
$.each(options.methods, function(key, value) {
$.validator.addMethod(key, value.method, value.text);
Expand Down
1 change: 1 addition & 0 deletions shared/oae/bundles/ui/default.properties
Expand Up @@ -398,6 +398,7 @@ MY_PICTURE = My picture
MY_PREFERENCES = My preferences
MY_PROFILE = My profile
NAME = Name
NAMES_CANNOT_INCLUDE_URLS_OR_AT_SIGNS = Names cannot include URLs or the '@' character
NAME_COLON = Name:
NARROW_BY_KEYWORD = Narrow by keyword
NETWORK = Network
Expand Down

0 comments on commit 50032d1

Please sign in to comment.