express-user
Advanced tools
Comparing version 0.0.1-alpha.8 to 0.0.1-alpha.9
@@ -5,11 +5,20 @@ //Copyright (c) 2015 Eric Vallee <eric_vallee2003@yahoo.ca> | ||
jQuery.fn.ToJSON = function(IncludeEmpty) { | ||
var Inputs = this.children('input'); | ||
var FieldSets = this.children('fieldset'); | ||
var ToReturn = {}; | ||
Inputs.each(function(Index, Element) { | ||
FieldSets.each(function(Index, Element) { | ||
var WrappedElement = jQuery(Element); | ||
var Value = WrappedElement.val(); | ||
if(Value.length>0||IncludeEmpty) | ||
{ | ||
ToReturn[WrappedElement.attr('name')] = Value; | ||
} | ||
var Label = WrappedElement.attr('class'); | ||
var Inputs = WrappedElement.children('input'); | ||
Inputs.each(function(Index, Element) { | ||
var WrappedElement = jQuery(Element); | ||
var Value = WrappedElement.val(); | ||
if(Value.length>0||IncludeEmpty) | ||
{ | ||
if(typeof(ToReturn[Label])=='undefined') | ||
{ | ||
ToReturn[Label] = {}; | ||
} | ||
ToReturn[Label][WrappedElement.attr('name')] = Value; | ||
} | ||
}); | ||
}); | ||
@@ -42,13 +51,9 @@ return ToReturn; | ||
Method = 'PATCH'; | ||
if(Data['UrlUsername']) | ||
if(!Data['Url']) | ||
{ | ||
URL = '/User/Username/'+Data['UrlUsername']; | ||
URL = '/User/Self'; | ||
} | ||
else if(Data['UrlEmail']) | ||
{ | ||
URL = '/User/Email/'+Data['UrlEmail']; | ||
} | ||
else | ||
{ | ||
URL = '/User/Self'; | ||
URL = '/User'; | ||
} | ||
@@ -59,13 +64,9 @@ } | ||
Method = 'DELETE'; | ||
if(Data['Username']) | ||
if(!Data['Url']) | ||
{ | ||
URL = '/User/Username/'+Data['Username']; | ||
URL = '/User/Self'; | ||
} | ||
else if(Data['Email']) | ||
{ | ||
URL = '/User/Email/'+Data['Email']; | ||
} | ||
else | ||
{ | ||
URL = '/User/Self'; | ||
URL = '/User'; | ||
} | ||
@@ -76,13 +77,9 @@ } | ||
Method = 'GET'; | ||
if(Data['Username']) | ||
if(!Data['Url']) | ||
{ | ||
URL = '/User/Username/'+Data['Username']; | ||
URL = '/User/Self'; | ||
} | ||
else if(Data['Email']) | ||
{ | ||
URL = '/User/Email/'+Data['Email']; | ||
} | ||
else | ||
{ | ||
URL = '/User/Self'; | ||
URL = '/User'; | ||
} | ||
@@ -101,2 +98,14 @@ } | ||
if(Data['Url']) | ||
{ | ||
if(Data['Url']['Username']) | ||
{ | ||
URL = URL + '/Username/'+Data['Url']['Username']; | ||
} | ||
else | ||
{ | ||
URL = URL + '/Email/'+Data['Url']['Email']; | ||
} | ||
} | ||
var Options = {'cache': false, 'type': Method}; | ||
@@ -103,0 +112,0 @@ if(Data && (Method!='GET')) |
{ | ||
"name": "express-user", | ||
"version": "0.0.1-alpha.8", | ||
"version": "0.0.1-alpha.9", | ||
"description": "Ressource Oriented Express Middleware to Manage Users.", | ||
@@ -38,3 +38,3 @@ "keywords": [ | ||
"mongodb": "~1.4.30", | ||
"express-user-local": "0.0.1-alpha.3", | ||
"express-user-local": "0.0.1-alpha.5", | ||
"express-brute": "~0.5.2", | ||
@@ -41,0 +41,0 @@ "express-brute-mongo": "~0.1.0" |
@@ -227,1 +227,7 @@ Express-User | ||
- Augmented the example with brute-force mitigation | ||
0.0.1-alpha.9 | ||
------------- | ||
- Updated dev dependency of express-user-local to 0.0.1-alpha.5. | ||
- Updated the client-side of the example to changes made to express-user-local. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
73227
502
233