diff --git a/.gitignore b/.gitignore index 303af01ca8..a28e051738 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,8 @@ .sass-cache/ npm-debug.log node_modules/ -public/lib +public/lib/ +public/dist/ .bower-*/ .idea/ uploads diff --git a/public/dist/application.min.css b/public/dist/application.min.css deleted file mode 100644 index 034f618cc5..0000000000 --- a/public/dist/application.min.css +++ /dev/null @@ -1,5 +0,0 @@ -.chat-message{margin-top:10px;padding-top:10px}.chat-message:not(:first-child){border-top:1px solid #e7e7e7}.chat-message-details{margin-left:10px}.chat-profile-image{height:28px;width:28px;border-radius:50%} - -.content-navigation{border-color:#fff;color:#e8e8e8}.border{padding:8px;margin:8px;border-color:#fff} -.content{margin-top:50px}.undecorated-link:hover{text-decoration:none}.ng-cloak,.x-ng-cloak,[data-ng-cloak],[ng-cloak],[ng\:cloak],[x-ng-cloak]{display:none!important}.ng-invalid.ng-dirty{border-color:#FA787E}.ng-valid.ng-dirty{border-color:#78FA89}.header-profile-image{opacity:.8;height:28px;width:28px;border-radius:50%;margin-right:5px}.open .header-profile-image,a:hover .header-profile-image{opacity:1}.user-header-dropdown-toggle{padding-top:11px!important;padding-bottom:11px!important} -@media (min-width:992px){.nav-users{position:fixed}}.social-account-container{display:inline-block;position:relative}.btn-remove-account{top:10px;right:10px;position:absolute}.btn-file{position:relative;overflow:hidden}.btn-file input[type=file]{position:absolute;top:0;right:0;min-width:100%;min-height:100%;font-size:100px;text-align:right;filter:alpha(opacity=0);opacity:0;background:#fff;cursor:inherit;display:block}.user-profile-picture{min-height:150px;max-height:150px} \ No newline at end of file diff --git a/public/dist/application.min.js b/public/dist/application.min.js deleted file mode 100644 index b841413081..0000000000 --- a/public/dist/application.min.js +++ /dev/null @@ -1,25 +0,0 @@ -"use strict";var ApplicationConfiguration=function(){var applicationModuleName="mean",applicationModuleVendorDependencies=["ngResource","ngAnimate","ui.router","ui.bootstrap","ui.utils","angularFileUpload"],registerModule=function(moduleName,dependencies){angular.module(moduleName,dependencies||[]),angular.module(applicationModuleName).requires.push(moduleName)};return{applicationModuleName:applicationModuleName,applicationModuleVendorDependencies:applicationModuleVendorDependencies,registerModule:registerModule}}(); -"use strict";angular.module(ApplicationConfiguration.applicationModuleName,ApplicationConfiguration.applicationModuleVendorDependencies),angular.module(ApplicationConfiguration.applicationModuleName).config(["$locationProvider",function($locationProvider){$locationProvider.hashPrefix("!")}]),angular.element(document).ready(function(){"#_=_"===window.location.hash&&(window.location.hash="#!"),angular.bootstrap(document,[ApplicationConfiguration.applicationModuleName])}); -"use strict";ApplicationConfiguration.registerModule("chat"); -"use strict";ApplicationConfiguration.registerModule("core"); -"use strict";ApplicationConfiguration.registerModule("users"); -"use strict";angular.module("chat").run(["Menus",function(Menus){Menus.addMenuItem("topbar",{title:"Chat",state:"chat"})}]); -"use strict";angular.module("chat").config(["$stateProvider",function($stateProvider){$stateProvider.state("chat",{url:"/chat",templateUrl:"modules/chat/views/chat.client.view.html"})}]); -"use strict";angular.module("chat").controller("ChatController",["$scope","Socket",function($scope,Socket){$scope.messages=[],Socket.on("chatMessage",function(message){$scope.messages.unshift(message)}),$scope.sendMessage=function(){var message={text:this.messageText};Socket.emit("chatMessage",message),this.messageText=""},$scope.$on("$destroy",function(){Socket.removeListener("chatMessage")})}]); -"use strict";angular.module("core").config(["$stateProvider","$urlRouterProvider",function($stateProvider,$urlRouterProvider){$urlRouterProvider.otherwise("/"),$stateProvider.state("home",{url:"/",templateUrl:"modules/core/views/home.client.view.html"})}]); -"use strict";angular.module("core").controller("HeaderController",["$scope","Authentication","Menus",function($scope,Authentication,Menus){$scope.authentication=Authentication,$scope.isCollapsed=!1,$scope.menu=Menus.getMenu("topbar"),$scope.toggleCollapsibleMenu=function(){$scope.isCollapsed=!$scope.isCollapsed},$scope.$on("$stateChangeSuccess",function(){$scope.isCollapsed=!1})}]); -"use strict";angular.module("core").controller("HomeController",["$scope","Authentication",function($scope,Authentication){$scope.authentication=Authentication}]); -"use strict";angular.module("core").service("Menus",[function(){this.defaultRoles=["*"],this.menus={};var shouldRender=function(user){if(!user)return this.isPublic;if(~this.roles.indexOf("*"))return!0;for(var userRoleIndex in user.roles)for(var roleIndex in this.roles)if(this.roles[roleIndex]===user.roles[userRoleIndex])return!0;return!1};this.validateMenuExistance=function(menuId){if(menuId&&menuId.length){if(this.menus[menuId])return!0;throw new Error("Menu does not exists")}throw new Error("MenuId was not provided")},this.getMenu=function(menuId){return this.validateMenuExistance(menuId),this.menus[menuId]},this.addMenu=function(menuId,options){return options=options||{},this.menus[menuId]={isPublic:null===options.isPublic||"undefined"==typeof options.isPublic?!0:options.isPublic,roles:options.roles||this.defaultRoles,items:options.items||[],shouldRender:shouldRender},this.menus[menuId]},this.removeMenu=function(menuId){this.validateMenuExistance(menuId),delete this.menus[menuId]},this.addMenuItem=function(menuId,options){if(options=options||{},this.validateMenuExistance(menuId),this.menus[menuId].items.push({title:options.title||"",state:options.state||"",type:options.type||"item","class":options.class,isPublic:null===options.isPublic||"undefined"==typeof options.isPublic?this.menus[menuId].isPublic:options.isPublic,roles:null===options.roles||"undefined"==typeof options.roles?this.menus[menuId].roles:options.roles,position:options.position||0,items:[],shouldRender:shouldRender}),options.items)for(var i in options.items)this.addSubMenuItem(menuId,options.link,options.items[i]);return this.menus[menuId]},this.addSubMenuItem=function(menuId,rootMenuItemURL,options){options=options||{},this.validateMenuExistance(menuId);for(var itemIndex in this.menus[menuId].items)this.menus[menuId].items[itemIndex].link===rootMenuItemURL&&this.menus[menuId].items[itemIndex].items.push({title:options.title||"",state:options.state||"",isPublic:null===options.isPublic||"undefined"==typeof options.isPublic?this.menus[menuId].items[itemIndex].isPublic:options.isPublic,roles:null===options.roles||"undefined"==typeof options.roles?this.menus[menuId].items[itemIndex].roles:options.roles,position:options.position||0,shouldRender:shouldRender});return this.menus[menuId]},this.removeMenuItem=function(menuId,menuItemURL){this.validateMenuExistance(menuId);for(var itemIndex in this.menus[menuId].items)this.menus[menuId].items[itemIndex].link===menuItemURL&&this.menus[menuId].items.splice(itemIndex,1);return this.menus[menuId]},this.removeSubMenuItem=function(menuId,submenuItemURL){this.validateMenuExistance(menuId);for(var itemIndex in this.menus[menuId].items)for(var subitemIndex in this.menus[menuId].items[itemIndex].items)this.menus[menuId].items[itemIndex].items[subitemIndex].link===submenuItemURL&&this.menus[menuId].items[itemIndex].items.splice(subitemIndex,1);return this.menus[menuId]},this.addMenu("topbar",{isPublic:!1})}]); -"use strict";angular.module("core").service("Socket",["Authentication","$state","$timeout",function(Authentication,$state,$timeout){Authentication.user?this.socket=io():$state.go("home"),this.on=function(eventName,callback){this.socket&&this.socket.on(eventName,function(data){$timeout(function(){callback(data)})})},this.emit=function(eventName,data){this.socket&&this.socket.emit(eventName,data)},this.removeListener=function(eventName){this.socket&&this.socket.removeListener(eventName)}}]); -"use strict";angular.module("users").config(["$httpProvider",function($httpProvider){$httpProvider.interceptors.push(["$q","$location","Authentication",function($q,$location,Authentication){return{responseError:function(rejection){switch(rejection.status){case 401:Authentication.user=null,$location.path("signin");break;case 403:}return $q.reject(rejection)}}}])}]); -"use strict";angular.module("users").config(["$stateProvider",function($stateProvider){$stateProvider.state("settings",{"abstract":!0,url:"/settings",templateUrl:"modules/users/views/settings/settings.client.view.html"}).state("settings.profile",{url:"/profile",templateUrl:"modules/users/views/settings/edit-profile.client.view.html"}).state("settings.password",{url:"/password",templateUrl:"modules/users/views/settings/change-password.client.view.html"}).state("settings.accounts",{url:"/accounts",templateUrl:"modules/users/views/settings/manage-social-accounts.client.view.html"}).state("settings.picture",{url:"/picture",templateUrl:"modules/users/views/settings/change-profile-picture.client.view.html"}).state("authentication",{"abstract":!0,url:"/authentication",templateUrl:"modules/users/views/authentication/authentication.client.view.html"}).state("authentication.signup",{url:"/signup",templateUrl:"modules/users/views/authentication/signup.client.view.html"}).state("authentication.signin",{url:"/signin",templateUrl:"modules/users/views/authentication/signin.client.view.html"}).state("password",{"abstract":!0,url:"/password",template:""}).state("password.forgot",{url:"/forgot",templateUrl:"modules/users/views/password/forgot-password.client.view.html"}).state("password.reset",{"abstract":!0,url:"/reset",template:""}).state("password.reset.invalid",{url:"/invalid",templateUrl:"modules/users/views/password/reset-password-invalid.client.view.html"}).state("password.reset.success",{url:"/success",templateUrl:"modules/users/views/password/reset-password-success.client.view.html"}).state("password.reset.form",{url:"/:token",templateUrl:"modules/users/views/password/reset-password.client.view.html"})}]); -"use strict";angular.module("users").controller("AuthenticationController",["$scope","$http","$location","Authentication",function($scope,$http,$location,Authentication){$scope.authentication=Authentication,$scope.authentication.user&&$location.path("/"),$scope.signup=function(){$http.post("/api/auth/signup",$scope.credentials).success(function(response){$scope.authentication.user=response,$location.path("/")}).error(function(response){$scope.error=response.message})},$scope.signin=function(){$http.post("/api/auth/signin",$scope.credentials).success(function(response){$scope.authentication.user=response,$location.path("/")}).error(function(response){$scope.error=response.message})}}]); -"use strict";angular.module("users").controller("PasswordController",["$scope","$stateParams","$http","$location","Authentication",function($scope,$stateParams,$http,$location,Authentication){$scope.authentication=Authentication,$scope.authentication.user&&$location.path("/"),$scope.askForPasswordReset=function(){$scope.success=$scope.error=null,$http.post("/api/auth/forgot",$scope.credentials).success(function(response){$scope.credentials=null,$scope.success=response.message}).error(function(response){$scope.credentials=null,$scope.error=response.message})},$scope.resetUserPassword=function(){$scope.success=$scope.error=null,$http.post("/api/auth/reset/"+$stateParams.token,$scope.passwordDetails).success(function(response){$scope.passwordDetails=null,Authentication.user=response,$location.path("/password/reset/success")}).error(function(response){$scope.error=response.message})}}]); -"use strict";angular.module("users").controller("SettingsController",["$scope","$http","$location","Users","Authentication",function($scope,$http,$location,Users,Authentication){$scope.user=Authentication.user,$scope.user||$location.path("/"),$scope.hasConnectedAdditionalSocialAccounts=function(){for(var i in $scope.user.additionalProvidersData)return!0;return!1},$scope.isConnectedSocialAccount=function(provider){return $scope.user.provider===provider||$scope.user.additionalProvidersData&&$scope.user.additionalProvidersData[provider]},$scope.removeUserSocialAccount=function(provider){$scope.success=$scope.error=null,$http.delete("/api/users/accounts",{params:{provider:provider}}).success(function(response){$scope.success=!0,$scope.user=Authentication.user=response}).error(function(response){$scope.error=response.message})},$scope.updateUserProfile=function(isValid){if(isValid){$scope.success=$scope.error=null;var user=new Users($scope.user);user.$update(function(response){$scope.success=!0,Authentication.user=response},function(response){$scope.error=response.data.message})}else $scope.submitted=!0},$scope.changeUserPassword=function(){$scope.success=$scope.error=null,$http.post("/api/users/password",$scope.passwordDetails).success(function(){$scope.success=!0,$scope.passwordDetails=null}).error(function(response){$scope.error=response.message})}}]); -"use strict";angular.module("users").factory("Authentication",[function(){var _this=this;return _this._data={user:window.user},_this._data}]); -"use strict";angular.module("users").factory("Users",["$resource",function($resource){return $resource("api/users",{},{update:{method:"PUT"}})}]); -"use strict";angular.module("users").controller("ChangePasswordController",["$scope","$http","$location","Users","Authentication",function($scope,$http,$location,Users,Authentication){$scope.user=Authentication.user,$scope.changeUserPassword=function(){$scope.success=$scope.error=null,$http.post("/api/users/password",$scope.passwordDetails).success(function(){$scope.success=!0,$scope.passwordDetails=null}).error(function(response){$scope.error=response.message})}}]); -"use strict";angular.module("users").controller("ChangeProfilePictureController",["$scope","$timeout","$window","Authentication","FileUploader",function($scope,$timeout,$window,Authentication,FileUploader){$scope.user=Authentication.user,$scope.imageURL=$scope.user.profileImageURL,$scope.uploader=new FileUploader({url:"api/users/picture"}),$scope.uploader.filters.push({name:"imageFilter",fn:function(item){var type="|"+item.type.slice(item.type.lastIndexOf("/")+1)+"|";return-1!=="|jpg|png|jpeg|bmp|gif|".indexOf(type)}}),$scope.uploader.onAfterAddingFile=function(fileItem){if($window.FileReader){var fileReader=new FileReader;fileReader.readAsDataURL(fileItem._file),fileReader.onload=function(fileReaderEvent){$timeout(function(){$scope.imageURL=fileReaderEvent.target.result},0)}}},$scope.uploader.onSuccessItem=function(fileItem,response){$scope.success=!0,$scope.user=Authentication.user=response,$scope.cancelUpload()},$scope.uploader.onErrorItem=function(fileItem,response){$scope.cancelUpload(),$scope.error=response.message},$scope.uploadProfilePicture=function(){$scope.success=$scope.error=null,$scope.uploader.uploadAll()},$scope.cancelUpload=function(){$scope.uploader.clearQueue(),$scope.imageURL=$scope.user.profileImageURL}}]); -"use strict";angular.module("users").controller("EditProfileController",["$scope","$http","$location","Users","Authentication",function($scope,$http,$location,Users,Authentication){$scope.user=Authentication.user,$scope.updateUserProfile=function(isValid){if(isValid){$scope.success=$scope.error=null;var user=new Users($scope.user);user.$update(function(response){$scope.success=!0,Authentication.user=response},function(response){$scope.error=response.data.message})}else $scope.submitted=!0}}]); -"use strict";angular.module("users").controller("SocialAccountsController",["$scope","$http","$location","Users","Authentication",function($scope,$http,$location,Users,Authentication){$scope.user=Authentication.user,$scope.hasConnectedAdditionalSocialAccounts=function(){for(var i in $scope.user.additionalProvidersData)return!0;return!1},$scope.isConnectedSocialAccount=function(provider){return $scope.user.provider===provider||$scope.user.additionalProvidersData&&$scope.user.additionalProvidersData[provider]},$scope.removeUserSocialAccount=function(provider){$scope.success=$scope.error=null,$http.delete("/api/users/accounts",{params:{provider:provider}}).success(function(response){$scope.success=!0,$scope.user=Authentication.user=response}).error(function(response){$scope.error=response.message})}}]); -"use strict";angular.module("users").controller("SettingsController",["$scope","$http","$location","Users","Authentication",function($scope,$http,$location,Users,Authentication){$scope.user=Authentication.user,$scope.user||$location.path("/")}]); \ No newline at end of file