From f1828a11a9bf23862272751feb4ca68db095e192 Mon Sep 17 00:00:00 2001 From: johnnyq Date: Sun, 8 Aug 2021 15:04:39 -0400 Subject: [PATCH] Added Boostrap Password Reveal Library and clipboardJS library added copy to clipboard to client logins --- add_login_modal.php | 2 +- blank.php | 3 + client_logins.php | 8 +- edit_login_modal.php | 8 +- footer.php | 2 + js/app.js | 45 +- login.php | 2 + .../Show-Hide-Passwords-Bootstrap-4/LICENSE | 674 ++++++++++++++++++ .../Show-Hide-Passwords-Bootstrap-4/README.md | 19 + .../bootstrap-show-password.js | 31 + .../bootstrap-show-password.min.js | 7 + .../index.html | 72 ++ plugins/clipboardjs/clipboard.min.js | 7 + 13 files changed, 867 insertions(+), 13 deletions(-) create mode 100644 plugins/Show-Hide-Passwords-Bootstrap-4/LICENSE create mode 100644 plugins/Show-Hide-Passwords-Bootstrap-4/README.md create mode 100644 plugins/Show-Hide-Passwords-Bootstrap-4/bootstrap-show-password.js create mode 100644 plugins/Show-Hide-Passwords-Bootstrap-4/bootstrap-show-password.min.js create mode 100644 plugins/Show-Hide-Passwords-Bootstrap-4/index.html create mode 100644 plugins/clipboardjs/clipboard.min.js diff --git a/add_login_modal.php b/add_login_modal.php index 9800ee9c..d7c25982 100644 --- a/add_login_modal.php +++ b/add_login_modal.php @@ -55,7 +55,7 @@
- +
diff --git a/blank.php b/blank.php index 62146494..bd06687b 100644 --- a/blank.php +++ b/blank.php @@ -12,6 +12,9 @@

Blank Page


This is a great starting point for new custom pages.

+ - - - - + + + + @@ -69,14 +69,14 @@
- +
- +
diff --git a/footer.php b/footer.php index 91345930..1bbdfc4a 100644 --- a/footer.php +++ b/footer.php @@ -22,6 +22,8 @@ + + diff --git a/js/app.js b/js/app.js index 6e2d172b..bbff55d0 100644 --- a/js/app.js +++ b/js/app.js @@ -3,12 +3,12 @@ if(window.history.replaceState){ window.history.replaceState(null, null, window.location.href); } -//Slide alert up after 2 secs +// Slide alert up after 2 secs $("#alert").fadeTo(2000, 500).slideUp(500, function(){ $("#alert").slideUp(500); }); -//Initialize Select2 Elements +// Initialize Select2 Elements $('.select2').select2({ theme: 'bootstrap4' }); @@ -18,9 +18,46 @@ $('.summernote').summernote({ height: 300 }); -//DateTime +// DateTime $('.datetimepicker').datetimepicker({ }); -//Data Input Mask +// Data Input Mask $('[data-mask]').inputmask(); + +// Tooltip ClipboardJS + +$('.clipboardjs').tooltip({ + trigger: 'click', + placement: 'bottom' +}); + +function setTooltip(message) { + $('.clipboardjs').tooltip('hide') + .attr('data-original-title', message) + .tooltip('show'); +} + +function hideTooltip() { + setTimeout(function() { + $('.clipboardjs').tooltip('hide'); + }, 1000); +} + +// ClipboardJS + +//Fix to allow Clipboard Copying within Bootstrap Modals +//For use in Bootstrap Modals or with any other library that changes the focus you'll want to set the focused element as the container value. +$.fn.modal.Constructor.prototype._enforceFocus = function() {}; + +var clipboard = new ClipboardJS('.clipboardjs'); + +clipboard.on('success', function(e) { + setTooltip('Copied!'); + hideTooltip(); +}); + +clipboard.on('error', function(e) { + setTooltip('Failed!'); + hideTooltip(); +}); \ No newline at end of file diff --git a/login.php b/login.php index c73452b6..7a109976 100644 --- a/login.php +++ b/login.php @@ -150,6 +150,8 @@ if(isset($_POST['login'])){ + + +``` + +Example + +```bash +
+ +
+ +
+
+``` diff --git a/plugins/Show-Hide-Passwords-Bootstrap-4/bootstrap-show-password.js b/plugins/Show-Hide-Passwords-Bootstrap-4/bootstrap-show-password.js new file mode 100644 index 00000000..d0817e36 --- /dev/null +++ b/plugins/Show-Hide-Passwords-Bootstrap-4/bootstrap-show-password.js @@ -0,0 +1,31 @@ +/** + * @author Abdo-Hamoud + * https://github.com/Abdo-Hamoud/bootstrap-show-password + * version: 1.0 + */ + +!function ($) { +//eyeOpenClass: 'fa-eye', +//eyeCloseClass: 'fa-eye-slash', + 'use strict'; + + $(function () { + $('[data-toggle="password"]').each(function () { + var input = $(this); + var eye_btn = $(this).parent().find('.input-group-text'); + eye_btn.css('cursor', 'pointer').addClass('input-password-hide'); + eye_btn.on('click', function () { + if (eye_btn.hasClass('input-password-hide')) { + eye_btn.removeClass('input-password-hide').addClass('input-password-show'); + eye_btn.find('.fa').removeClass('fa-eye').addClass('fa-eye-slash') + input.attr('type', 'text'); + } else { + eye_btn.removeClass('input-password-show').addClass('input-password-hide'); + eye_btn.find('.fa').removeClass('fa-eye-slash').addClass('fa-eye') + input.attr('type', 'password'); + } + }); + }); + }); + +}(window.jQuery); diff --git a/plugins/Show-Hide-Passwords-Bootstrap-4/bootstrap-show-password.min.js b/plugins/Show-Hide-Passwords-Bootstrap-4/bootstrap-show-password.min.js new file mode 100644 index 00000000..904c3c7d --- /dev/null +++ b/plugins/Show-Hide-Passwords-Bootstrap-4/bootstrap-show-password.min.js @@ -0,0 +1,7 @@ +/** + * @author Abdo-Hamoud + * https://github.com/Abdo-Hamoud/bootstrap-show-password + * version: 1.0 + */ + +!function(a){a(function(){a('[data-toggle="password"]').each(function(){var b = a(this); var c = a(this).parent().find(".input-group-text"); c.css("cursor", "pointer").addClass("input-password-hide"); c.on("click", function(){if (c.hasClass("input-password-hide")){c.removeClass("input-password-hide").addClass("input-password-show"); c.find(".fa").removeClass("fa-eye").addClass("fa-eye-slash"); b.attr("type", "text")} else{c.removeClass("input-password-show").addClass("input-password-hide"); c.find(".fa").removeClass("fa-eye-slash").addClass("fa-eye"); b.attr("type", "password")}})})})}(window.jQuery); diff --git a/plugins/Show-Hide-Passwords-Bootstrap-4/index.html b/plugins/Show-Hide-Passwords-Bootstrap-4/index.html new file mode 100644 index 00000000..b0a614ca --- /dev/null +++ b/plugins/Show-Hide-Passwords-Bootstrap-4/index.html @@ -0,0 +1,72 @@ + + + + + + +Bootstrap 4 Show/Hide Password Example + + + + + + + +
+
+ +
+
+
+
+
+
+

Bootstrap 4 Show/Hide Password Example

+
+ + + We'll never share your email with anyone else. +
+
+ +
+ + +
+ +
+
+
+
+ + + + + diff --git a/plugins/clipboardjs/clipboard.min.js b/plugins/clipboardjs/clipboard.min.js new file mode 100644 index 00000000..98d4ccba --- /dev/null +++ b/plugins/clipboardjs/clipboard.min.js @@ -0,0 +1,7 @@ +/*! + * clipboard.js v2.0.6 + * https://clipboardjs.com/ + * + * Licensed MIT © Zeno Rocha + */ +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ClipboardJS=e():t.ClipboardJS=e()}(this,function(){return n={134:(t,e,n)=>{"use strict";n.d(e,{default:()=>r});var e=n(817),o=n.n(e);function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function a(t,e){for(var n=0;n{var e;"undefined"==typeof Element||Element.prototype.matches||((e=Element.prototype).matches=e.matchesSelector||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector),t.exports=function(t,e){for(;t&&9!==t.nodeType;){if("function"==typeof t.matches&&t.matches(e))return t;t=t.parentNode}}},438:(t,e,n)=>{var a=n(828);function i(t,e,n,r,o){var i=function(e,n,t,r){return function(t){t.delegateTarget=a(t.target,n),t.delegateTarget&&r.call(e,t)}}.apply(this,arguments);return t.addEventListener(n,i,o),{destroy:function(){t.removeEventListener(n,i,o)}}}t.exports=function(t,e,n,r,o){return"function"==typeof t.addEventListener?i.apply(null,arguments):"function"==typeof n?i.bind(null,document).apply(null,arguments):("string"==typeof t&&(t=document.querySelectorAll(t)),Array.prototype.map.call(t,function(t){return i(t,e,n,r,o)}))}},879:(t,n)=>{n.node=function(t){return void 0!==t&&t instanceof HTMLElement&&1===t.nodeType},n.nodeList=function(t){var e=Object.prototype.toString.call(t);return void 0!==t&&("[object NodeList]"===e||"[object HTMLCollection]"===e)&&"length"in t&&(0===t.length||n.node(t[0]))},n.string=function(t){return"string"==typeof t||t instanceof String},n.fn=function(t){return"[object Function]"===Object.prototype.toString.call(t)}},370:(t,e,n)=>{var u=n(879),s=n(438);t.exports=function(t,e,n){if(!t&&!e&&!n)throw new Error("Missing required arguments");if(!u.string(e))throw new TypeError("Second argument must be a String");if(!u.fn(n))throw new TypeError("Third argument must be a Function");if(u.node(t))return c=e,l=n,(a=t).addEventListener(c,l),{destroy:function(){a.removeEventListener(c,l)}};if(u.nodeList(t))return r=t,o=e,i=n,Array.prototype.forEach.call(r,function(t){t.addEventListener(o,i)}),{destroy:function(){Array.prototype.forEach.call(r,function(t){t.removeEventListener(o,i)})}};if(u.string(t))return t=t,e=e,n=n,s(document.body,t,e,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList");var r,o,i,a,c,l}},817:t=>{t.exports=function(t){var e,n="SELECT"===t.nodeName?(t.focus(),t.value):"INPUT"===t.nodeName||"TEXTAREA"===t.nodeName?((e=t.hasAttribute("readonly"))||t.setAttribute("readonly",""),t.select(),t.setSelectionRange(0,t.value.length),e||t.removeAttribute("readonly"),t.value):(t.hasAttribute("contenteditable")&&t.focus(),n=window.getSelection(),(e=document.createRange()).selectNodeContents(t),n.removeAllRanges(),n.addRange(e),n.toString());return n}},279:t=>{function e(){}e.prototype={on:function(t,e,n){var r=this.e||(this.e={});return(r[t]||(r[t]=[])).push({fn:e,ctx:n}),this},once:function(t,e,n){var r=this;function o(){r.off(t,o),e.apply(n,arguments)}return o._=e,this.on(t,o,n)},emit:function(t){for(var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),r=0,o=n.length;r{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r(134).default;function r(t){if(o[t])return o[t].exports;var e=o[t]={exports:{}};return n[t](e,e.exports,r),e.exports}var n,o}); \ No newline at end of file