From 5a80b2394a4bedd1212835c6dfb00fb0300893f1 Mon Sep 17 00:00:00 2001 From: pliablepixels Date: Fri, 22 Jan 2016 16:38:04 -0500 Subject: #147 - Content Security Policy and modified new directive to honor my share factory Former-commit-id: 06a5c6cf48019d05bb0365d92670b9235a4ab8ff --- www/js/app.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'www/js') diff --git a/www/js/app.js b/www/js/app.js index 0b289623..d0e96838 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -71,7 +71,7 @@ angular.module('zmApp', [ //credit http://stackoverflow.com/questions/20997406/force-http-interceptor-in-dynamic-ngsrc-request .directive('httpSrc', [ - '$http', function ($http) { + '$http', 'imageLoadingDataShare', function ($http, imageLoadingDataShare) { var directive = { link: link, restrict: 'A' @@ -86,6 +86,7 @@ angular.module('zmApp', [ cache: 'true' }; + imageLoadingDataShare.set(1); $http(requestConfig) .success(function(data) { var arr = new Uint8Array(data); @@ -100,7 +101,12 @@ angular.module('zmApp', [ var b64 = btoa(raw); attrs.$set('src', "data:image/jpeg;base64," + b64); - }); + imageLoadingDataShare.set(0); + }) + .error (function(data) { + attrs.$set('src', 'img/novideo.png'); + imageLoadingDataShare.set(0); + }); } } -- cgit v1.2.3