From d7cf80652ced5e43140fe52eb4dea1feee98b124 Mon Sep 17 00:00:00 2001 From: lavinjj Date: Wed, 5 Mar 2014 21:26:53 -0600 Subject: [PATCH] Addresses Issue #18 'Unknown provider' error. the gravatarImageService was missing the minification array causing the service to not instantiate properly. --- ReadMe.md | 10 ++++++---- app/index.html | 2 +- bower.json | 2 +- dist/angularjs-gravatardirective.js | 4 ++-- dist/angularjs-gravatardirective.min.js | 2 +- package.json | 2 +- .../services/gravatarImageService.js | 4 ++-- 7 files changed, 14 insertions(+), 12 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index 65e6462..ee8b58f 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -30,13 +30,15 @@ For more information about the Gravatar Image request check out their [Developer ## Change Log -### 1.3.1 - Addresses Issue #17 Hide the image, when loading fails. Now the image element will be removed from the DOM if the image fails to load. +### v1.3.2 - Addresses Issue #18 'Unknown provider' error. the gravatarImageService was missing the minification array causing the service to not instantiate properly. -### 1.3.0 - Restructured library structure to take advantage of angularjs-library yeoman generator to generate a single file for use. +### v1.3.1 - Addresses Issue #17 Hide the image, when loading fails. Now the image element will be removed from the DOM if the image fails to load. -### 1.2.0 - Added pull request to move imageSrc to a service for use by external consumers. +### v1.3.0 - Restructured library structure to take advantage of angularjs-library yeoman generator to generate a single file for use. -### 1.1.0 - Added additional namespaces to all attributes to keep from interfering with other AngularJS Library Directives. Resolves Issue #13 +### v1.2.0 - Added pull request to move imageSrc to a service for use by external consumers. + +### v1.1.0 - Added additional namespaces to all attributes to keep from interfering with other AngularJS Library Directives. Resolves Issue #13 ## LICENSE diff --git a/app/index.html b/app/index.html index 813ada2..5dd3d60 100644 --- a/app/index.html +++ b/app/index.html @@ -36,6 +36,6 @@

Gravatar Directive Example

- + diff --git a/bower.json b/bower.json index 69ea1db..5d747f2 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "angularjs-gravatardirective", - "version": "1.3.1", + "version": "1.3.2", "dependencies": { "angular": "~1.2.12" }, diff --git a/dist/angularjs-gravatardirective.js b/dist/angularjs-gravatardirective.js index 3724275..d209352 100644 --- a/dist/angularjs-gravatardirective.js +++ b/dist/angularjs-gravatardirective.js @@ -63,7 +63,7 @@ angular.module('angularjs-gravatardirective.directives') }}; }]); angular.module('angularjs-gravatardirective.services') - .factory('gravatarImageService', function (md5) { + .factory('gravatarImageService', ['md5', function (md5) { return { getImageSrc: function (value, size, rating, defaultUrl, secure) { // convert the value to lower case and then to a md5 hash @@ -75,7 +75,7 @@ angular.module('angularjs-gravatardirective.services') return src; } }; - }); + }]); // http://kevin.vanzonneveld.net // + original by: Webtoolkit.info (http://www.webtoolkit.info/) // + namespaced by: Michael White (http://getsprink.com) diff --git a/dist/angularjs-gravatardirective.min.js b/dist/angularjs-gravatardirective.min.js index 546309a..caa3639 100644 --- a/dist/angularjs-gravatardirective.min.js +++ b/dist/angularjs-gravatardirective.min.js @@ -1,2 +1,2 @@ /*! angularjs-gravatardirective 05-03-2014 */ -!function(){"use strict";angular.module("angularjs-gravatardirective.config",[]).value("angularjs-gravatardirective.config",{debug:!0}),angular.module("angularjs-gravatardirective.directives",[]),angular.module("angularjs-gravatardirective.services",[]),angular.module("angularjs-gravatardirective",["angularjs-gravatardirective.config","angularjs-gravatardirective.directives","angularjs-gravatardirective.services"]),angular.module("angularjs-gravatardirective.directives").directive("gravatarImage",["gravatarImageService",function(a){return{restrict:"EAC",link:function(b,c,d){b.$watch(d.gravatarEmail,function(b){if(null!==b&&void 0!==b&&""!==b&&null!==b.match(/.*@.*\..{2}/)){var e=d.gravatarSize||40,f=d.gravatarRating||"pg",g=d.gravatarDefault||"identicon",h=d.gravatarCssClass||"gravatar-icon",i=a.getImageSrc(b,e,f,g,d.gravatarSecure),j='';c.find("img").remove(),c.append(j),c.find("img").bind("error",function(){c.find("img").remove()})}})}}}]),angular.module("angularjs-gravatardirective.services").factory("gravatarImageService",function(a){return{getImageSrc:function(b,c,d,e,f){var g=a.createHash(b.toLowerCase()),h=(f?"https://secure":"http://www")+".gravatar.com/avatar/"+g;return c&&(h+="?s="+c),d&&(h+="&r="+d),e&&(h+="&d="+e),h}}}),angular.module("angularjs-gravatardirective.services").factory("md5",[function(){var a={createHash:function(a){var b,c,d,e,f,g,h,i,j,k,l=function(a,b){return a<>>32-b},m=function(a,b){var c,d,e,f,g;return e=2147483648&a,f=2147483648&b,c=1073741824&a,d=1073741824&b,g=(1073741823&a)+(1073741823&b),c&d?2147483648^g^e^f:c|d?1073741824&g?3221225472^g^e^f:1073741824^g^e^f:g^e^f},n=function(a,b,c){return a&b|~a&c},o=function(a,b,c){return a&c|b&~c},p=function(a,b,c){return a^b^c},q=function(a,b,c){return b^(a|~c)},r=function(a,b,c,d,e,f,g){return a=m(a,m(m(n(b,c,d),e),g)),m(l(a,f),b)},s=function(a,b,c,d,e,f,g){return a=m(a,m(m(o(b,c,d),e),g)),m(l(a,f),b)},t=function(a,b,c,d,e,f,g){return a=m(a,m(m(p(b,c,d),e),g)),m(l(a,f),b)},u=function(a,b,c,d,e,f,g){return a=m(a,m(m(q(b,c,d),e),g)),m(l(a,f),b)},v=function(a){for(var b,c=a.length,d=c+8,e=(d-d%64)/64,f=16*(e+1),g=new Array(f-1),h=0,i=0;c>i;)b=(i-i%4)/4,h=i%4*8,g[b]=g[b]|a.charCodeAt(i)<>>29,g},w=function(a){var b,c,d="",e="";for(c=0;3>=c;c++)b=a>>>8*c&255,e="0"+b.toString(16),d+=e.substr(e.length-2,2);return d},x=[],y=7,z=12,A=17,B=22,C=5,D=9,E=14,F=20,G=4,H=11,I=16,J=23,K=6,L=10,M=15,N=21;for(x=v(a),h=1732584193,i=4023233417,j=2562383102,k=271733878,b=x.length,c=0;b>c;c+=16)d=h,e=i,f=j,g=k,h=r(h,i,j,k,x[c+0],y,3614090360),k=r(k,h,i,j,x[c+1],z,3905402710),j=r(j,k,h,i,x[c+2],A,606105819),i=r(i,j,k,h,x[c+3],B,3250441966),h=r(h,i,j,k,x[c+4],y,4118548399),k=r(k,h,i,j,x[c+5],z,1200080426),j=r(j,k,h,i,x[c+6],A,2821735955),i=r(i,j,k,h,x[c+7],B,4249261313),h=r(h,i,j,k,x[c+8],y,1770035416),k=r(k,h,i,j,x[c+9],z,2336552879),j=r(j,k,h,i,x[c+10],A,4294925233),i=r(i,j,k,h,x[c+11],B,2304563134),h=r(h,i,j,k,x[c+12],y,1804603682),k=r(k,h,i,j,x[c+13],z,4254626195),j=r(j,k,h,i,x[c+14],A,2792965006),i=r(i,j,k,h,x[c+15],B,1236535329),h=s(h,i,j,k,x[c+1],C,4129170786),k=s(k,h,i,j,x[c+6],D,3225465664),j=s(j,k,h,i,x[c+11],E,643717713),i=s(i,j,k,h,x[c+0],F,3921069994),h=s(h,i,j,k,x[c+5],C,3593408605),k=s(k,h,i,j,x[c+10],D,38016083),j=s(j,k,h,i,x[c+15],E,3634488961),i=s(i,j,k,h,x[c+4],F,3889429448),h=s(h,i,j,k,x[c+9],C,568446438),k=s(k,h,i,j,x[c+14],D,3275163606),j=s(j,k,h,i,x[c+3],E,4107603335),i=s(i,j,k,h,x[c+8],F,1163531501),h=s(h,i,j,k,x[c+13],C,2850285829),k=s(k,h,i,j,x[c+2],D,4243563512),j=s(j,k,h,i,x[c+7],E,1735328473),i=s(i,j,k,h,x[c+12],F,2368359562),h=t(h,i,j,k,x[c+5],G,4294588738),k=t(k,h,i,j,x[c+8],H,2272392833),j=t(j,k,h,i,x[c+11],I,1839030562),i=t(i,j,k,h,x[c+14],J,4259657740),h=t(h,i,j,k,x[c+1],G,2763975236),k=t(k,h,i,j,x[c+4],H,1272893353),j=t(j,k,h,i,x[c+7],I,4139469664),i=t(i,j,k,h,x[c+10],J,3200236656),h=t(h,i,j,k,x[c+13],G,681279174),k=t(k,h,i,j,x[c+0],H,3936430074),j=t(j,k,h,i,x[c+3],I,3572445317),i=t(i,j,k,h,x[c+6],J,76029189),h=t(h,i,j,k,x[c+9],G,3654602809),k=t(k,h,i,j,x[c+12],H,3873151461),j=t(j,k,h,i,x[c+15],I,530742520),i=t(i,j,k,h,x[c+2],J,3299628645),h=u(h,i,j,k,x[c+0],K,4096336452),k=u(k,h,i,j,x[c+7],L,1126891415),j=u(j,k,h,i,x[c+14],M,2878612391),i=u(i,j,k,h,x[c+5],N,4237533241),h=u(h,i,j,k,x[c+12],K,1700485571),k=u(k,h,i,j,x[c+3],L,2399980690),j=u(j,k,h,i,x[c+10],M,4293915773),i=u(i,j,k,h,x[c+1],N,2240044497),h=u(h,i,j,k,x[c+8],K,1873313359),k=u(k,h,i,j,x[c+15],L,4264355552),j=u(j,k,h,i,x[c+6],M,2734768916),i=u(i,j,k,h,x[c+13],N,1309151649),h=u(h,i,j,k,x[c+4],K,4149444226),k=u(k,h,i,j,x[c+11],L,3174756917),j=u(j,k,h,i,x[c+2],M,718787259),i=u(i,j,k,h,x[c+9],N,3951481745),h=m(h,d),i=m(i,e),j=m(j,f),k=m(k,g);var O=w(h)+w(i)+w(j)+w(k);return O.toLowerCase()}};return a}])}(window,document); \ No newline at end of file +!function(){"use strict";angular.module("angularjs-gravatardirective.config",[]).value("angularjs-gravatardirective.config",{debug:!0}),angular.module("angularjs-gravatardirective.directives",[]),angular.module("angularjs-gravatardirective.services",[]),angular.module("angularjs-gravatardirective",["angularjs-gravatardirective.config","angularjs-gravatardirective.directives","angularjs-gravatardirective.services"]),angular.module("angularjs-gravatardirective.directives").directive("gravatarImage",["gravatarImageService",function(a){return{restrict:"EAC",link:function(b,c,d){b.$watch(d.gravatarEmail,function(b){if(null!==b&&void 0!==b&&""!==b&&null!==b.match(/.*@.*\..{2}/)){var e=d.gravatarSize||40,f=d.gravatarRating||"pg",g=d.gravatarDefault||"identicon",h=d.gravatarCssClass||"gravatar-icon",i=a.getImageSrc(b,e,f,g,d.gravatarSecure),j='';c.find("img").remove(),c.append(j),c.find("img").bind("error",function(){c.find("img").remove()})}})}}}]),angular.module("angularjs-gravatardirective.services").factory("gravatarImageService",["md5",function(a){return{getImageSrc:function(b,c,d,e,f){var g=a.createHash(b.toLowerCase()),h=(f?"https://secure":"http://www")+".gravatar.com/avatar/"+g;return c&&(h+="?s="+c),d&&(h+="&r="+d),e&&(h+="&d="+e),h}}}]),angular.module("angularjs-gravatardirective.services").factory("md5",[function(){var a={createHash:function(a){var b,c,d,e,f,g,h,i,j,k,l=function(a,b){return a<>>32-b},m=function(a,b){var c,d,e,f,g;return e=2147483648&a,f=2147483648&b,c=1073741824&a,d=1073741824&b,g=(1073741823&a)+(1073741823&b),c&d?2147483648^g^e^f:c|d?1073741824&g?3221225472^g^e^f:1073741824^g^e^f:g^e^f},n=function(a,b,c){return a&b|~a&c},o=function(a,b,c){return a&c|b&~c},p=function(a,b,c){return a^b^c},q=function(a,b,c){return b^(a|~c)},r=function(a,b,c,d,e,f,g){return a=m(a,m(m(n(b,c,d),e),g)),m(l(a,f),b)},s=function(a,b,c,d,e,f,g){return a=m(a,m(m(o(b,c,d),e),g)),m(l(a,f),b)},t=function(a,b,c,d,e,f,g){return a=m(a,m(m(p(b,c,d),e),g)),m(l(a,f),b)},u=function(a,b,c,d,e,f,g){return a=m(a,m(m(q(b,c,d),e),g)),m(l(a,f),b)},v=function(a){for(var b,c=a.length,d=c+8,e=(d-d%64)/64,f=16*(e+1),g=new Array(f-1),h=0,i=0;c>i;)b=(i-i%4)/4,h=i%4*8,g[b]=g[b]|a.charCodeAt(i)<>>29,g},w=function(a){var b,c,d="",e="";for(c=0;3>=c;c++)b=a>>>8*c&255,e="0"+b.toString(16),d+=e.substr(e.length-2,2);return d},x=[],y=7,z=12,A=17,B=22,C=5,D=9,E=14,F=20,G=4,H=11,I=16,J=23,K=6,L=10,M=15,N=21;for(x=v(a),h=1732584193,i=4023233417,j=2562383102,k=271733878,b=x.length,c=0;b>c;c+=16)d=h,e=i,f=j,g=k,h=r(h,i,j,k,x[c+0],y,3614090360),k=r(k,h,i,j,x[c+1],z,3905402710),j=r(j,k,h,i,x[c+2],A,606105819),i=r(i,j,k,h,x[c+3],B,3250441966),h=r(h,i,j,k,x[c+4],y,4118548399),k=r(k,h,i,j,x[c+5],z,1200080426),j=r(j,k,h,i,x[c+6],A,2821735955),i=r(i,j,k,h,x[c+7],B,4249261313),h=r(h,i,j,k,x[c+8],y,1770035416),k=r(k,h,i,j,x[c+9],z,2336552879),j=r(j,k,h,i,x[c+10],A,4294925233),i=r(i,j,k,h,x[c+11],B,2304563134),h=r(h,i,j,k,x[c+12],y,1804603682),k=r(k,h,i,j,x[c+13],z,4254626195),j=r(j,k,h,i,x[c+14],A,2792965006),i=r(i,j,k,h,x[c+15],B,1236535329),h=s(h,i,j,k,x[c+1],C,4129170786),k=s(k,h,i,j,x[c+6],D,3225465664),j=s(j,k,h,i,x[c+11],E,643717713),i=s(i,j,k,h,x[c+0],F,3921069994),h=s(h,i,j,k,x[c+5],C,3593408605),k=s(k,h,i,j,x[c+10],D,38016083),j=s(j,k,h,i,x[c+15],E,3634488961),i=s(i,j,k,h,x[c+4],F,3889429448),h=s(h,i,j,k,x[c+9],C,568446438),k=s(k,h,i,j,x[c+14],D,3275163606),j=s(j,k,h,i,x[c+3],E,4107603335),i=s(i,j,k,h,x[c+8],F,1163531501),h=s(h,i,j,k,x[c+13],C,2850285829),k=s(k,h,i,j,x[c+2],D,4243563512),j=s(j,k,h,i,x[c+7],E,1735328473),i=s(i,j,k,h,x[c+12],F,2368359562),h=t(h,i,j,k,x[c+5],G,4294588738),k=t(k,h,i,j,x[c+8],H,2272392833),j=t(j,k,h,i,x[c+11],I,1839030562),i=t(i,j,k,h,x[c+14],J,4259657740),h=t(h,i,j,k,x[c+1],G,2763975236),k=t(k,h,i,j,x[c+4],H,1272893353),j=t(j,k,h,i,x[c+7],I,4139469664),i=t(i,j,k,h,x[c+10],J,3200236656),h=t(h,i,j,k,x[c+13],G,681279174),k=t(k,h,i,j,x[c+0],H,3936430074),j=t(j,k,h,i,x[c+3],I,3572445317),i=t(i,j,k,h,x[c+6],J,76029189),h=t(h,i,j,k,x[c+9],G,3654602809),k=t(k,h,i,j,x[c+12],H,3873151461),j=t(j,k,h,i,x[c+15],I,530742520),i=t(i,j,k,h,x[c+2],J,3299628645),h=u(h,i,j,k,x[c+0],K,4096336452),k=u(k,h,i,j,x[c+7],L,1126891415),j=u(j,k,h,i,x[c+14],M,2878612391),i=u(i,j,k,h,x[c+5],N,4237533241),h=u(h,i,j,k,x[c+12],K,1700485571),k=u(k,h,i,j,x[c+3],L,2399980690),j=u(j,k,h,i,x[c+10],M,4293915773),i=u(i,j,k,h,x[c+1],N,2240044497),h=u(h,i,j,k,x[c+8],K,1873313359),k=u(k,h,i,j,x[c+15],L,4264355552),j=u(j,k,h,i,x[c+6],M,2734768916),i=u(i,j,k,h,x[c+13],N,1309151649),h=u(h,i,j,k,x[c+4],K,4149444226),k=u(k,h,i,j,x[c+11],L,3174756917),j=u(j,k,h,i,x[c+2],M,718787259),i=u(i,j,k,h,x[c+9],N,3951481745),h=m(h,d),i=m(i,e),j=m(j,f),k=m(k,g);var O=w(h)+w(i)+w(j)+w(k);return O.toLowerCase()}};return a}])}(window,document); \ No newline at end of file diff --git a/package.json b/package.json index d0d5144..f4aff69 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "angularjs-gravatardirective", "description": "AngularJS Directive that takes an email address and creates an image tag to pull an avatar image form the Gravatar web site", - "version": "1.3.1", + "version": "1.3.2", "homepage": "", "keywords": ["angularjs", "gravatar", "directive"], "repository": { diff --git a/src/angularjs-gravatardirective/services/gravatarImageService.js b/src/angularjs-gravatardirective/services/gravatarImageService.js index ec5d296..5876f34 100644 --- a/src/angularjs-gravatardirective/services/gravatarImageService.js +++ b/src/angularjs-gravatardirective/services/gravatarImageService.js @@ -1,5 +1,5 @@ angular.module('angularjs-gravatardirective.services') - .factory('gravatarImageService', function (md5) { + .factory('gravatarImageService', ['md5', function (md5) { return { getImageSrc: function (value, size, rating, defaultUrl, secure) { // convert the value to lower case and then to a md5 hash @@ -11,4 +11,4 @@ angular.module('angularjs-gravatardirective.services') return src; } }; - }); + }]);