From 293efa43292a465c0be653801f78f56a5891aac8 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Thu, 5 Jan 2012 23:19:37 +0000 Subject: [PATCH] use a more standard naming uppercase start for js 'beans' git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1227889 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/webapp/js/redback/operation.js | 4 ++-- .../src/main/webapp/js/redback/permission.js | 4 ++-- .../src/main/webapp/js/redback/resource.js | 4 ++-- .../src/main/webapp/js/redback/user.js | 10 +++++----- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/operation.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/operation.js index 9f31787ba..4ae29db61 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/operation.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/operation.js @@ -19,7 +19,7 @@ $(function() { - operation=function(name) { + Operation=function(name) { this.name=ko.observable(name); } @@ -27,7 +27,7 @@ $(function() { * @param data Operation response from redback rest api */ mapOperation=function(data) { - return new operation(data.name,null); + return new Operation(data.name,null); } diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/permission.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/permission.js index cc3da0844..7c668448d 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/permission.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/permission.js @@ -19,7 +19,7 @@ $(function() { - permission=function(name,operation,resource) { + Permission=function(name,operation,resource) { this.name=ko.observable(name); this.operation=ko.observable(operation); this.resource=ko.observable(resource); @@ -29,7 +29,7 @@ $(function() { * @param data Permission response from redback rest api */ mapPermission=function(data) { - return new permission(data.name, + return new Permission(data.name, data.operation?mapOperation(data.operation):null, data.resource?mapResource(data.resource):null); } diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/resource.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/resource.js index 9fd19c3e2..11bdd309a 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/resource.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/resource.js @@ -19,7 +19,7 @@ $(function() { - resource=function(identifier,pattern) { + Resource=function(identifier,pattern) { this.identifier=ko.observable(identifier); this.pattern=ko.observable(pattern); } @@ -28,7 +28,7 @@ $(function() { * @param data Resource response from redback rest api */ mapResource=function(data) { - return new resource(data.identifier,data.pattern); + return new Resource(data.identifier,data.pattern); } diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/user.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/user.js index db46428f2..c2d7d5ac5 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/user.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/user.js @@ -33,7 +33,7 @@ $(function() { * @param passwordChangeRequired * @param ownerViewModel */ - user=function(username, password, confirmPassword,fullName,email,permanent,validated,timestampAccountCreation,timestampLastLogin,timestampLastPasswordChange,locked,passwordChangeRequired,ownerViewModel) { + User=function(username, password, confirmPassword,fullName,email,permanent,validated,timestampAccountCreation,timestampLastLogin,timestampLastPasswordChange,locked,passwordChangeRequired,ownerViewModel) { // Potentially Editable Field. this.username = ko.observable(username); // Editable Fields. @@ -206,8 +206,8 @@ $(function() { /** * view for admin user creation */ - adminUserViewModel=function() { - this.user = new user("admin","","", "the administrator"); + AdminUserViewModel=function() { + this.user = new User("admin","","", "the administrator"); } /** @@ -216,7 +216,7 @@ $(function() { adminCreateBox=function() { window.redbackModel.createUser=true; jQuery("#main-content").attr("data-bind",'template: {name:"redback/user-edit-tmpl",data: user}'); - var viewModel = new adminUserViewModel(); + var viewModel = new AdminUserViewModel(); ko.applyBindings(viewModel); $("#user-create").validate({ rules: { @@ -549,7 +549,7 @@ $(function() { * @param data User response from redback rest api */ mapUser=function(data) { - return new user(data.username, data.password, null,data.fullName,data.email,data.permanent,data.validated,data.timestampAccountCreation,data.timestampLastLogin,data.timestampLastPasswordChange,data.locked,data.passwordChangeRequired,self); + return new User(data.username, data.password, null,data.fullName,data.email,data.permanent,data.validated,data.timestampAccountCreation,data.timestampLastLogin,data.timestampLastPasswordChange,data.locked,data.passwordChangeRequired,self); } -- 2.39.5