// Provides a mechanism for SVG(Z) fallback to bitmap images.  
// Copyright (C) 2013 Qloo Inc., Michael Diolosa <michael.diolosa@gmail.com>  
// License: MIT

/*global angular:true, browser: true */

(function (window) {
  'use strict';

  // private method for detecting SVG support
  var isSvgSupported = function () {
    return window.Modernizr && window.Modernizr.svg;
  };

  // svg-fallback
  // ------------
  // Images marked with the `svg` directive will fallback to PNG if the browser
  // does not support SVG. If a specific file needs to be applied the default
  // behavior can be altered by the `data-fallback-src`.
  angular.module('svg-fallback', []).directive('svg', function () {
    return function (scope, element, attrs) {
      // Should we remove our dependency on Modernizr?
      if (!isSvgSupported()) {
        // Check to see if we have a fallback source
        var src = element.attr('data-fallback-src');

        // If we do not have a fallback source then convert the SVG extension to
        // `png`
        if (!src && element.attr('src')) {
          src = element.attr('src').replace(/\.svg[z]{0,1}$/, '.png');
        }

        // If a `src` was determined apply to the image
        if (src) { element.attr('src', src); }
      }
    };
  });
}(window));
@@ -703,16 +703,51 @@
   return
+ %7B%0A      restrict: 'A',%0A      link:
  functio
@@ -770,24 +770,26 @@
 t, attrs) %7B%0A
+  
       // Sho
@@ -831,16 +831,18 @@
 ernizr?%0A
+  
       if
@@ -872,16 +872,18 @@
         
+  
 // Check
@@ -919,16 +919,18 @@
  source%0A
+  
         
@@ -979,24 +979,26 @@
 );%0A%0A        
+  
 // If we do 
@@ -1066,16 +1066,18 @@
         
+  
 // %60png%60
@@ -1077,16 +1077,18 @@
 / %60png%60%0A
+  
         
@@ -1118,24 +1118,26 @@
 r('src')) %7B%0A
+  
           sr
@@ -1207,11 +1207,15 @@
     
+  
 %7D%0A%0A
+  
     
@@ -1270,24 +1270,26 @@
 age%0A        
+  
 if (src) %7B e
@@ -1315,16 +1315,26 @@
 src); %7D%0A
+        %7D%0A
       %7D%0A

Restrict to attributes