diff options
| -rw-r--r-- | www/js/app.js | 53 | ||||
| -rw-r--r-- | www/templates/login.html | 8 |
2 files changed, 56 insertions, 5 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) diff --git a/www/templates/login.html b/www/templates/login.html index 9372aae0..f351016a 100644 --- a/www/templates/login.html +++ b/www/templates/login.html @@ -33,7 +33,7 @@ <div ng-if="check.isUseAuth"> <label class="item item-input item-floating-label"> <span class="input-label">{{'kUserName'|translate}}</span> - <input autocapitalize="none" autocomplete="off" autocorrect="off" type="text" placeholder="username" ng-model="loginData.username"> + <input autocapitalize="none" autocomplete="off" autocorrect="off" type="text" placeholder="username" ng-model="loginData.username"> </label> <label class="item item-input item-floating-label"> <span class="input-label">{{'kPassword' | translate}}</span> @@ -43,18 +43,18 @@ </div> <label class="item item-input item-floating-label"> <span class="input-label">{{'kPortalUrl' | translate}}</span> - <input autocapitalize="none" autocomplete="off" autocorrect="off" type="text" placeholder="ZM portal url " ng-model="loginData.url" ng-keyup="portalKeypress($event)"> + <input hidepassword autocapitalize="none" autocomplete="off" autocorrect="off" type="text" placeholder="ZM portal url " ng-model="loginData.url" ng-keyup="portalKeypress($event)"> </label> <!--<button class="button button-small button-clear icon-left ion-wand" ng-click="detectCgi()">tap here to discover cgi-bin </button>--> <label class="item item-input item-floating-label"> <!--<span style="float:right;margin-top:-7px;background-color:#6d0909;color:#fff;font-size:14px;opacity:0.7;width:90px;border-radius: 0px 0px 5px 5px;" on-tap="detectCgi();"> <i class="ion-wand"></i>discover</span>--> <span class="input-label">{{'kPathToCgi' | translate}}</span> - <input autocapitalize="none" autocomplete="off" autocorrect="off" type="text" placeholder="eg. server.com/zm/cgi-bin" ng-model="loginData.streamingurl"> + <input hidepassword autocapitalize="none" autocomplete="off" autocorrect="off" type="text" placeholder="eg. server.com/zm/cgi-bin" ng-model="loginData.streamingurl"> </label> <label class="item item-input item-floating-label"> <span class="input-label">{{'kApiUrl' | translate}}</span> - <input autocapitalize="none" autocomplete="off" autocorrect="off" type="text" placeholder="ZM api url" ng-model="loginData.apiurl"> + <input hidepassword autocapitalize="none" autocomplete="off" autocorrect="off" type="text" placeholder="ZM api url" ng-model="loginData.apiurl"> </label> <a class="item item-icon-right" href="" ng-click="selectFallback()"> <i class="icon ion-ios-arrow-right"> |
