From 57d928b235d3789b59e4847a65d2983fc5b3a2fd Mon Sep 17 00:00:00 2001 From: stiekel Date: Tue, 12 Apr 2016 06:31:49 +0800 Subject: [PATCH] release 0.1.6 --- dist/angular-image-404.js | 4 ++-- dist/angular-image-404.min.js | 2 +- package.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dist/angular-image-404.js b/dist/angular-image-404.js index 837c3c4..8c18242 100644 --- a/dist/angular-image-404.js +++ b/dist/angular-image-404.js @@ -19,8 +19,8 @@ angular.module('angular-image-404', []) function getDefaultImagePlaceholder() { var width = angular.element(element[0]).attr('max-width') || element[0].offsetWidth || 120; var height = angular.element(element[0]).attr('max-height') || element[0].offsetHeight || 120; - var bgcolor = attributes.fbBgcolor.replace('#', '') || ""; - var color = attributes.fbColor.replace('#', '') || ""; + var bgcolor = attributes.fbBgcolor ? attributes.fbBgcolor.replace('#', '') : ""; + var color = attributes.fbColor ? attributes.fbColor.replace('#', '') : ""; var text = attributes.fbText || ""; var result = ''; var protocol = window.location.href.split('://').shift(); diff --git a/dist/angular-image-404.min.js b/dist/angular-image-404.min.js index f70e348..c011ed6 100644 --- a/dist/angular-image-404.min.js +++ b/dist/angular-image-404.min.js @@ -1 +1 @@ -angular.module("angular-image-404",[]).directive("image404",function(){return{restrict:"A",link:function(t,e,r){function a(){var t=r.image404;(n>=3||!t)&&(t=i()),e.attr("src",t),n++}function i(){var t=angular.element(e[0]).attr("max-width")||e[0].offsetWidth||120,a=angular.element(e[0]).attr("max-height")||e[0].offsetHeight||120,i=r.fbBgcolor.replace("#","")||"",n=r.fbColor.replace("#","")||"",o=r.fbText||"",l="",c=window.location.href.split("://").shift();return c||(c="http"),l=c+"://dummyimage.com/"+t+"x"+a,i&&n&&(l+="/"+i+"/"+n),o&&(l+="&text="+o),l}var n=0;r.src||a(),e.on("error",a)}}}); \ No newline at end of file +angular.module("angular-image-404",[]).directive("image404",function(){return{restrict:"A",link:function(t,r,e){function a(){var t=e.image404;(i>=3||!t)&&(t=o()),r.attr("src",t),i++}function o(){var t=angular.element(r[0]).attr("max-width")||r[0].offsetWidth||120,a=angular.element(r[0]).attr("max-height")||r[0].offsetHeight||120,o=e.fbBgcolor?e.fbBgcolor.replace("#",""):"",i=e.fbColor?e.fbColor.replace("#",""):"",n=e.fbText||"",l="",f=window.location.href.split("://").shift();return f||(f="http"),l=f+"://dummyimage.com/"+t+"x"+a,o&&i&&(l+="/"+o+"/"+i),n&&(l+="&text="+n),l}var i=0;e.src||a(),r.on("error",a)}}}); \ No newline at end of file diff --git a/package.json b/package.json index 4d25734..8ce660e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "angular-image-404", - "version": "0.1.5", + "version": "0.1.6", "description": "AngualrJS directive that shows a fallback image when img element can not show picture correct", "main": "gulpfile.js", "directories": {