summaryrefslogtreecommitdiff
path: root/www/js
diff options
context:
space:
mode:
authorpliablepixels <pliablepixels@gmail.com>2016-01-22 16:38:04 -0500
committerpliablepixels <pliablepixels@gmail.com>2016-01-22 16:38:04 -0500
commit5a80b2394a4bedd1212835c6dfb00fb0300893f1 (patch)
tree3bc26ac0a76f6cefc33805b61148e634b172e4d2 /www/js
parent5c5a5fd83d8552de34cbe0a40d192b2443c62d83 (diff)
#147 - Content Security Policy and modified new directive to honor my share factory
Former-commit-id: 06a5c6cf48019d05bb0365d92670b9235a4ab8ff
Diffstat (limited to 'www/js')
-rw-r--r--www/js/app.js10
1 files changed, 8 insertions, 2 deletions
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);
+ });
}
}