diff --git a/luciexpress/htdocs/plugins/settings/pages/settings.password.html b/luciexpress/htdocs/plugins/settings/pages/settings.password.html index 1e0987a0a..4515a38ac 100644 --- a/luciexpress/htdocs/plugins/settings/pages/settings.password.html +++ b/luciexpress/htdocs/plugins/settings/pages/settings.password.html @@ -10,5 +10,36 @@ + +
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+

+

+

+

+
+
+ +
diff --git a/luciexpress/htdocs/plugins/settings/pages/settings.password.js b/luciexpress/htdocs/plugins/settings/pages/settings.password.js index 86b4b0594..891a66950 100644 --- a/luciexpress/htdocs/plugins/settings/pages/settings.password.js +++ b/luciexpress/htdocs/plugins/settings/pages/settings.password.js @@ -1,9 +1,33 @@ $juci.module("router") .controller("SettingsPasswordCtrl", function($scope){ $scope.showPassword = 0; + $scope.showModal = 0; + $scope.modal = { + old_password: "", + password: "test", + password2: "" + }; + $scope.passwordStrength = 1; + + + function measureStrength(p) { + var strongRegex = new RegExp("^(?=.{8,})(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*\\W).*$", "g"); + var mediumRegex = new RegExp("^(?=.{7,})(((?=.*[A-Z])(?=.*[a-z]))|((?=.*[A-Z])(?=.*[0-9]))|((?=.*[a-z])(?=.*[0-9]))).*$", "g"); + var enoughRegex = new RegExp("(?=.{4,}).*", "g"); + + if(strongRegex.test(p)) return 3; + if(mediumRegex.test(p)) return 2; + if(enoughRegex.test(p)) return 1; + return 0; + } + + $scope.$watch("modal", function(){ + $scope.passwordStrength = measureStrength($scope.modal.password); + }, true); $scope.onChangePasswordClick = function(){ - $rpc.luci2.system.password_set({user: "martin", password: "asdf"}).done(function(data){ - console.log(JSON.stringify(data)); - }); + $scope.showModal = 1; + /*$rpc.luci2.system.password_set({user: "martin", password: "asdf"}).done(function(data){ + $scope.showModal = 1; + }); */ } }); diff --git a/luciexpress/htdocs/themes/vodaphone/css/theme.css b/luciexpress/htdocs/themes/vodaphone/css/theme.css index aeb75596a..2fd730470 100644 --- a/luciexpress/htdocs/themes/vodaphone/css/theme.css +++ b/luciexpress/htdocs/themes/vodaphone/css/theme.css @@ -31,30 +31,6 @@ div.logo { width: 32px; } -@media all and (min-width: 0px) and (max-width: 768px) { - .only-desktop { - display: none; - } - .only-tablet { - display: none; - } - .only-mobile { - display: block; - } -} - -@media all and (min-width: 768px) { - .only-desktop { - display: block; - } - .only-tablet { - display: none; - } - .only-mobile { - display: none; - } -} - #rhombus-wrap { float: left; margin-left: -80px;