@ -1,5 +1,5 @@
/ *
/ *
* Copyright ( c ) 201 6 , WSO2 Inc . ( http : //www.wso2.org) All Rights Reserved.
* Copyright ( c ) 201 5 , WSO2 Inc . ( http : //www.wso2.org) All Rights Reserved.
*
*
* WSO2 Inc . licenses this file to you under the Apache License ,
* WSO2 Inc . licenses this file to you under the Apache License ,
* Version 2.0 ( the "License" ) ; you may not use this file except
* Version 2.0 ( the "License" ) ; you may not use this file except
@ -72,8 +72,8 @@ var disableInlineError = function (inputField, errorMsg, errorSign) {
* Validate if provided username is valid against RegEx configures .
* Validate if provided username is valid against RegEx configures .
* /
* /
validateInline [ "user-name" ] = function ( ) {
validateInline [ "user-name" ] = function ( ) {
var username i nput = $ ( "input#username" ) ;
var username I nput = $ ( "input#username" ) ;
if ( inputIsValid ( username input. data ( "regex" ) , usernamei nput. val ( ) ) ) {
if ( inputIsValid ( username Input. data ( "regex" ) , usernameI nput. val ( ) ) ) {
disableInlineError ( "usernameInputField" , "usernameEmpty" , "usernameError" ) ;
disableInlineError ( "usernameInputField" , "usernameEmpty" , "usernameError" ) ;
} else {
} else {
enableInlineError ( "usernameInputField" , "usernameEmpty" , "usernameError" ) ;
enableInlineError ( "usernameInputField" , "usernameEmpty" , "usernameError" ) ;
@ -84,8 +84,8 @@ validateInline["user-name"] = function () {
* Validate if provided first name is valid against RegEx configures .
* Validate if provided first name is valid against RegEx configures .
* /
* /
validateInline [ "first-name" ] = function ( ) {
validateInline [ "first-name" ] = function ( ) {
var firstname i nput = $ ( "input#firstname" ) ;
var firstname I nput = $ ( "input#firstname" ) ;
if ( firstname i nput. val ( ) ) {
if ( firstname I nput. val ( ) ) {
disableInlineError ( "firstNameField" , "fnError" ) ;
disableInlineError ( "firstNameField" , "fnError" ) ;
} else {
} else {
enableInlineError ( "firstNameField" , "fnError" ) ;
enableInlineError ( "firstNameField" , "fnError" ) ;
@ -96,8 +96,8 @@ validateInline["first-name"] = function () {
* Validate if provided last name is valid against RegEx configures .
* Validate if provided last name is valid against RegEx configures .
* /
* /
validateInline [ "last-name" ] = function ( ) {
validateInline [ "last-name" ] = function ( ) {
var lastname i nput = $ ( "input#lastname" ) ;
var lastname I nput = $ ( "input#lastname" ) ;
if ( lastname i nput. val ( ) ) {
if ( lastname I nput. val ( ) ) {
disableInlineError ( "lastNameField" , "lnError" ) ;
disableInlineError ( "lastNameField" , "lnError" ) ;
} else {
} else {
enableInlineError ( "lastNameField" , "lnError" ) ;
enableInlineError ( "lastNameField" , "lnError" ) ;
@ -165,9 +165,9 @@ $("#userStore").change(
function ( ) {
function ( ) {
var str = "" ;
var str = "" ;
$ ( "select option:selected" ) . each ( function ( ) {
$ ( "select option:selected" ) . each ( function ( ) {
str += $ ( this ) . text ( ) + " ";
str += $ ( this ) . text ( ) + " ";
} ) ;
} ) ;
var getRolesAPI = deviceMgtAPIsBasePath + "/roles /"+ str ;
var getRolesAPI = deviceMgtAPIsBasePath + "/roles ?user-store=" + str + "&limit=100" ;
invokerUtil . get (
invokerUtil . get (
getRolesAPI ,
getRolesAPI ,
@ -188,8 +188,7 @@ $("#userStore").change(
}
}
) ;
) ;
}
} ) . change ( ) ;
) . change ( ) ;
$ ( document ) . ready ( function ( ) {
$ ( document ) . ready ( function ( ) {
$ ( "#emailValidationText" ) . hide ( ) ;
$ ( "#emailValidationText" ) . hide ( ) ;
@ -207,7 +206,7 @@ $(document).ready(function () {
var usernameInput = $ ( "input#username" ) ;
var usernameInput = $ ( "input#username" ) ;
var firstnameInput = $ ( "input#firstname" ) ;
var firstnameInput = $ ( "input#firstname" ) ;
var lastnameInput = $ ( "input#lastname" ) ;
var lastnameInput = $ ( "input#lastname" ) ;
//var charLimit = parseInt($("input#username").attr("limit"));
var charLimit = parseInt ( $ ( "input#username" ) . attr ( "limit" ) ) ;
var domain = $ ( "#userStore" ) . val ( ) ;
var domain = $ ( "#userStore" ) . val ( ) ;
var username = usernameInput . val ( ) . trim ( ) ;
var username = usernameInput . val ( ) . trim ( ) ;
var firstname = firstnameInput . val ( ) ;
var firstname = firstnameInput . val ( ) ;