From 3f4d1502189da13d92d407cbd966d543efe67d2a Mon Sep 17 00:00:00 2001 From: DeckerSU Date: Sun, 19 Nov 2017 19:23:50 +0300 Subject: [PATCH] fix hide/show passphase button + fix "enter" press on sign-in form --- gui/css/custom.css | 2 +- gui/index.html | 12 ++++++++---- gui/js/bootstrap-show-password.min.js | 6 ++++++ 3 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 gui/js/bootstrap-show-password.min.js diff --git a/gui/css/custom.css b/gui/css/custom.css index 281bdeb..5ddf496 100644 --- a/gui/css/custom.css +++ b/gui/css/custom.css @@ -48,7 +48,7 @@ border-bottom-left-radius: 0; } .form-signin input[type="password"] { - margin-bottom: 10px; + /*margin-bottom: 10px;*/ /*border-top-left-radius: 0; border-top-right-radius: 0;*/ } diff --git a/gui/index.html b/gui/index.html index f96ca19..52bdd90 100644 --- a/gui/index.html +++ b/gui/index.html @@ -67,12 +67,14 @@

Welcome to BarterDEX

Please Login

- +
- + + +
@@ -86,6 +88,7 @@
+ @@ -703,6 +706,7 @@ + diff --git a/gui/js/bootstrap-show-password.min.js b/gui/js/bootstrap-show-password.min.js new file mode 100644 index 0000000..350a2ee --- /dev/null +++ b/gui/js/bootstrap-show-password.min.js @@ -0,0 +1,6 @@ +/** + * @author zhixin wen + * https://github.com/wenzhixin/bootstrap-show-password + * version: 1.1.0 + */ +!function(e){"use strict";var t=function(e){var t=arguments,s=!0,i=1;return e=e.replace(/%s/g,function(){var e=t[i++];return"undefined"==typeof e?(s=!1,""):e}),s?e:""},s=function(t,s){this.options=s,this.$element=e(t),this.isShown=!1,this.init()};s.DEFAULTS={placement:"after",white:!1,message:"Click here to show/hide password",eyeClass:"glyphicon",eyeOpenClass:"glyphicon-eye-open",eyeCloseClass:"glyphicon-eye-close",eyeClassPositionInside:!1},s.prototype.init=function(){var s,i;"before"===this.options.placement?(s="insertBefore",i="input-prepend"):(this.options.placement="after",s="insertAfter",i="input-append"),this.$element.wrap(t('
',i)),this.$text=e('')[s](this.$element).attr("class",this.$element.attr("class")).attr("style",this.$element.attr("style")).attr("placeholder",this.$element.attr("placeholder")).css("display",this.$element.css("display")).val(this.$element.val()).hide(),this.$element.prop("readonly")&&this.$text.prop("readonly",!0),this.$icon=e(['',''+(this.options.eyeClassPositionInside?this.options.eyeOpenClass:"")+"",""].join(""))[s](this.$text).css("cursor","pointer"),this.$text.off("keyup").on("keyup",e.proxy(function(){this.isShown&&this.$element.val(this.$text.val()).trigger("change")},this)),this.$icon.off("click").on("click",e.proxy(function(){this.$text.val(this.$element.val()).trigger("change"),this.toggle()},this))},s.prototype.toggle=function(e){this[this.isShown?"hide":"show"](e)},s.prototype.show=function(t){var s=e.Event("show.bs.password",{relatedTarget:t});this.$element.trigger(s),this.isShown=!0,this.$element.hide(),this.$text.show(),this.options.eyeClassPositionInside?this.$icon.find("i").removeClass("icon-eye-open").addClass("icon-eye-close").html(this.options.eyeCloseClass):this.$icon.find("i").removeClass("icon-eye-open "+this.options.eyeOpenClass).addClass("icon-eye-close "+this.options.eyeCloseClass),this.$text[this.options.placement](this.$element)},s.prototype.hide=function(t){var s=e.Event("hide.bs.password",{relatedTarget:t});this.$element.trigger(s),this.isShown=!1,this.$element.show(),this.$text.hide(),this.options.eyeClassPositionInside?this.$icon.find("i").removeClass("icon-eye-close").addClass("icon-eye-open").html(this.options.eyeOpenClass):this.$icon.find("i").removeClass("icon-eye-close "+this.options.eyeCloseClass).addClass("icon-eye-open "+this.options.eyeOpenClass),this.$element[this.options.placement](this.$text)},s.prototype.val=function(e){return"undefined"==typeof e?this.$element.val():(this.$element.val(e).trigger("change"),this.$text.val(e),void 0)};var i=e.fn.password;e.fn.password=function(){var t,i=arguments[0],n=arguments,o=["show","hide","toggle","val"];return this.each(function(){var a=e(this),h=a.data("bs.password"),l=e.extend({},s.DEFAULTS,a.data(),"object"==typeof i&&i);if("string"==typeof i){if(e.inArray(i,o)<0)throw"Unknown method: "+i;t=h[i](n[1])}else h?h.init(l):(h=new s(a,l),a.data("bs.password",h))}),t?t:this},e.fn.password.Constructor=s,e.fn.password.noConflict=function(){return e.fn.password=i,this},e(function(){e('[data-toggle="password"]').password()})}(window.jQuery); \ No newline at end of file