From 78c0de345b4068fb00352ce6611a7a0e14a15a7d Mon Sep 17 00:00:00 2001 From: Skylar Ittner Date: Sat, 20 Jan 2018 00:59:13 -0700 Subject: [PATCH] Generate identicons for Quick Access --- www/assets/js/jdenticon.min.js | 38 ++++++++++++++++++++++++++++++++++ www/js/login.js | 5 +++-- www/licenses.html | 31 ++++++++++++++++++++++++--- www/pages/login.html | 3 ++- 4 files changed, 71 insertions(+), 6 deletions(-) create mode 100644 www/assets/js/jdenticon.min.js diff --git a/www/assets/js/jdenticon.min.js b/www/assets/js/jdenticon.min.js new file mode 100644 index 0000000..2e4e11b --- /dev/null +++ b/www/assets/js/jdenticon.min.js @@ -0,0 +1,38 @@ +// Jdenticon 1.8.0 | jdenticon.com | zlib licensed | (c) 2014-2017 Daniel Mester Pirttijärvi +/* +Jdenticon +Copyright (c) 2014 - {year} Daniel Mester Pirttijärvi + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + +3. This notice may not be removed or altered from any source distribution. + */ +(function(r,v,w){var m=w(r,r.jQuery);"undefined"!==typeof module&&"exports"in module?module.exports=m:"function"===typeof define&&define.amd?define([],function(){return m}):r[v]=m})(this,"jdenticon",function(r,v){function w(a){this.size=Math.min(Number(a.getAttribute("width"))||100,Number(a.getAttribute("height"))||100);for(this.K=a;a.firstChild;)a.removeChild(a.firstChild);a.setAttribute("viewBox","0 0 "+this.size+" "+this.size);a.setAttribute("preserveAspectRatio","xMidYMid meet")}function m(a){this.size= +a;this.l=''}function L(a){return function(b){for(var a=[],d=0;d>>e&15).toString(16));return a.join("")}(function(b){for(var a=1732584193,d=4023233417,f=2562383102,e=271733878,l=3285377520,h=[a,d,f,e,l],k=0;kg;g++){var x=q[g-3]^q[g-8]^q[g-14]^q[g-16];q[g]=x<<1|x>>>31}for(g=0;80> +g;g++)x=(a<<5|a>>>27)+(20>g?(d&f^~d&e)+1518500249:40>g?(d^f^e)+1859775393:60>g?(d&f^d&e^f&e)+2400959708:(d^f^e)+3395469782)+l+q[g],l=e,e=f,f=d<<30|d>>>2,d=a,a=x|0;h[0]=a=h[0]+a|0;h[1]=d=h[1]+d|0;h[2]=f=h[2]+f|0;h[3]=e=h[3]+e|0;h[4]=l=h[4]+l|0}return h}(function(a){function b(a,b){for(var c=[],d=-1,e=0;e++d;)c[d]=0;return c}var d=encodeURI(a),f=[];a=0;var e,l=[];for(e=0;ea?"00":16>a?"0"+a.toString(16):256>a?a.toString(16):"ff"}function E(a,b,c){c=0>c?c+6:6c?a+(b-a)*c:3>c?b:4>c?a+(b-a)*(4-c):a))}function M(a,b){return[n.w(0,0,b.H(0)),n.v(a,b.saturation,b.u(.5)),n.w(0,0,b.H(1)),n.v(a,b.saturation,b.u(1)),n.v(a,b.saturation,b.u(0))]}function F(a,b,c,d,f,e,l){function h(e,f,h,l,k){l=l?parseInt(b.charAt(l),16):0;f=f[parseInt(b.charAt(h),16)% +f.length];a.F(p[m[e]]);for(e=0;ef;f++){var n=parseInt(b.charAt(8+f),16)%p.length;if(k([0,4])||k([2,3]))n=1;m.push(n)}h(0,G.I,2,3,[[1,0],[2,0],[2,3],[1,3],[0,1],[3,1],[3,2],[0,2]]);h(1,G.I,4,5, +[[0,0],[3,0],[3,3],[0,3]]);h(2,G.M,1,null,[[1,1],[2,1],[2,2],[1,2]]);a.finish()}function H(){function a(a,b,e){var d=c[a]instanceof Array?c[a]:[b,e];return function(a){a=d[0]+a*(d[1]-d[0]);return 0>a?0:1'},toString:function(){return this.l+""}};C.prototype={F:function(a){this.f.fillStyle=a;this.f.beginPath()},G:function(){this.f.fill()},a:function(a){var b=this.f,c;b.moveTo(a[0].x,a[0].y);for(c=1;cb?1:8>b?2:0|.25*b;a.c(d,d,b-c-d,b-c-d)},function(a,b){var c=0|.15*b,d=0|.5*b;a.b(b-d-c,b-d-c,d)},function(a,b){var c=.1*b,d=4*c;a.c(0,0,b,b);a.a([d,d,b-c,d,d+(b-d-c)/2,b-c],!0)},function(a,b){a.a([0,0,b,0,b,.7*b,.4*b,.4*b,.7*b,b,0,b])},function(a,b){a.g(b/2,b/2,b/2,b/2,3)},function(a, +b){a.c(0,0,b,b/2);a.c(0,b/2,b/2,b/2);a.g(b/2,b/2,b/2,b/2,1)},function(a,b){var c=.14*b;c=8>b?c:0|c;var d=4>b?1:6>b?2:0|.35*b;a.c(0,0,b,b);a.c(d,d,b-d-c,b-d-c,!0)},function(a,b){var c=.12*b,d=3*c;a.c(0,0,b,b);a.b(d,d,b-c-d,!0)},function(a,b){a.g(b/2,b/2,b/2,b/2,3)},function(a,b){var c=.25*b;a.c(0,0,b,b);a.D(c,c,b-c,b-c,!0)},function(a,b,c){var d=.4*b;c||a.b(d,d,1.2*b)}],I:[function(a,b){a.g(0,0,b,b,0)},function(a,b){a.g(0,b/2,b,b/2,0)},function(a,b){a.D(0,0,b,b)},function(a,b){var c=b/6;a.b(c,c,b- +2*c)}]};I.prototype={a:function(a){for(var b="M"+k(a[0].x)+" "+k(a[0].y),c=1;c=c?c*(b+1):c+b-c*b;c=2*c-b;return"#"+E(c,b,6*a+2)+E(c,b,6*a)+E(c,b,6*a-2)},v:function(a,b,c){var d=[.55,.5,.5,.46,.6,.55,.55][6*a+.5|0];return n.w(a,b,.5>c?c*d*2:d+(c-.5)*(1-d)*2)}},K="undefined"!==typeof document&&"querySelectorAll"in document;p.drawIcon=function(a, +b,c){if(!a)throw Error("No canvas specified.");a=new C(a,c);F(a,z(b)||A(b),0,0,c,0,H())};p.toSvg=function(a,b,c){var d=new m(b);F(new D(d),z(a)||A(a),0,0,b,c,H());return d.toString()};p.update=B;p.version="1.8.0";v&&(v.fn.jdenticon=function(a,b){this.each(function(c,d){B(d,a,b)});return this});"function"===typeof setTimeout&&setTimeout(p,0);return p}); \ No newline at end of file diff --git a/www/js/login.js b/www/js/login.js index 79e1a92..b86bcd2 100644 --- a/www/js/login.js +++ b/www/js/login.js @@ -1,4 +1,4 @@ -/* +/* * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. @@ -80,12 +80,13 @@ function loadQuickLogin() { for (var user in resp.users) { var u = resp.users[user]; userhtml += '
\n' - + '\n' + + '\n' + '
\n' + u["name"] + "\n" + '
\n'; } $("#userlist .row").html(userhtml); + jdenticon.update(".identicon"); $(".quick-user").click(function () { doQuickLogin($(this).data("username"), $(this).data("name"), $(this).data("uid"), $(this).data("pin") == "1"); }); diff --git a/www/licenses.html b/www/licenses.html index a2cc7fd..6f5b91d 100755 --- a/www/licenses.html +++ b/www/licenses.html @@ -61,7 +61,7 @@ THE SOFTWARE.

bassjobsen/Bootstrap-3-Typeahead

MIT License
 
-Copyright (c) 2017 Bass Jobsen
+Copyright (c) 2018 Bass Jobsen
 
 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
 
@@ -382,7 +382,7 @@ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, E
 
 MIT License
 
-Copyright (c) 2017 Dave Gandy &lt;dave@fontawesome.io&gt;
+Copyright (c) 2018 Dave Gandy &lt;dave@fontawesome.io&gt;
 
 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
 
@@ -672,7 +672,7 @@ H THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
     
     

guzzle/guzzle

-
Copyright (c) 2011-2016 Michael Dowling, https://github.com/mtdowling <mtdowling@gmail.com>
+        
Copyright (c) 2011-2018 Michael Dowling, https://github.com/mtdowling <mtdowling@gmail.com>
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
@@ -3082,4 +3082,29 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
         
+
+

dmester/jdenticon

+

+Jdenticon
+Copyright (c) 2014 - {year} Daniel Mester Pirttijärvi
+
+This software is provided 'as-is', without any express or implied
+warranty.  In no event will the authors be held liable for any damages
+arising from the use of this software.
+
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it
+freely, subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not
+   claim that you wrote the original software. If you use this software
+   in a product, an acknowledgment in the product documentation would be
+   appreciated but is not required.
+
+2. Altered source versions must be plainly marked as such, and must not be
+   misrepresented as being the original software.
+
+3. This notice may not be removed or altered from any source distribution.
+        
+
\ No newline at end of file diff --git a/www/pages/login.html b/www/pages/login.html index 0b53fa6..37fc127 100644 --- a/www/pages/login.html +++ b/www/pages/login.html @@ -146,4 +146,5 @@ - \ No newline at end of file + + \ No newline at end of file