diff options
| author | Pliable Pixels <pliablepixels@gmail.com> | 2017-01-09 15:13:57 -0500 |
|---|---|---|
| committer | Pliable Pixels <pliablepixels@gmail.com> | 2017-01-09 15:13:57 -0500 |
| commit | 652f2af48cf2633b916f55c6aaa1fea7532f6807 (patch) | |
| tree | 978967db669cde3c279f6434b58b6d84a933d3d6 /www/js/app.js | |
| parent | 2c0e85ab9b927db23a509f455c3aa47255d7c21d (diff) | |
attempt to mask u:p if u:p@domain #363
Diffstat (limited to 'www/js/app.js')
| -rw-r--r-- | www/js/app.js | 53 |
1 files changed, 52 insertions, 1 deletions
diff --git a/www/js/app.js b/www/js/app.js index dd8a16cc..9d764bbd 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -140,7 +140,7 @@ angular.module('zmApp', [ angular.forEach(input, function(item) { - if ((item.Monitor.Function != 'None') && (item.Monitor.Enabled != '0') && (item.Monitor.eventUrl != 'img/noevent.png')) + if ((item.Monitor.Function != 'None') && (item.Monitor.Enabled != '0') && (item.Monitor.eventUrl != 'img/noevent.png') && (item.Monitor.listDisplay != 'noshow')) { out.push(item); } @@ -152,6 +152,57 @@ angular.module('zmApp', [ }) + +//http://stackoverflow.com/a/23931217/1361529 +.directive('hidepassword', function () { + + var modelSet = function (str) + { + + return str; + }; + + var viewSet = function (str) + { + //https://github.com/garycourt/uri-js + if (!str) return str; + var c = URI.parse(str); + if (c.userinfo) c.userinfo="***:***"; + var vc = URI.serialize({scheme : c.scheme, + userinfo: c.userinfo, + host: c.host, + port: c.port, + path: c.path, + query: c.query, + fragment: c.fragment + }); + console.log ("CONVERTED IS "+vc); + + + return vc; + }; + + return { + + restrict: 'A', + require: 'ngModel', + link: function (scope, element, attr, ngModel) { + ngModel.$parsers.push(modelSet); + ngModel.$formatters.push(viewSet); + + element.bind('blur', function() { + element.val(viewSet(ngModel.$modelValue)); + }); + element.bind('focus', function () { + element.val(ngModel.$modelValue); + }); + + } + }; +}) + + + // credit https://gist.github.com/Zren/beaafd64f395e23f4604 .directive('mouseWheelScroll', function($timeout) |
