Sha256: 51347918d98b7b3b185166434f01210ed868ac72927f61ac6b42b76c9301c3bc

Contents?: true

Size: 1.9 KB

Versions: 2

Compression:

Stored size: 1.9 KB

Contents

<script>
  var supportsSvg = function() {
    var div = document.createElement('div');
    div.innerHTML = '<svg/>';
    return (div.firstChild && div.firstChild.namespaceURI) == 'http://www.w3.org/2000/svg';
  };

  if (!supportsSvg()) {

    (function(e){function t(t,n,r,o){"use strict";function a(){for(var e,n=0;u.length>n;n++)u[n].href&&u[n].href.indexOf(t)>-1&&(e=!0);e?i.media=r||"all":setTimeout(a)}var i=e.document.createElement("link"),l=n||e.document.getElementsByTagName("script")[0],u=e.document.styleSheets;return i.rel="stylesheet",i.href=t,i.media="only x",i.onload=o||null,l.parentNode.insertBefore(i,l),a(),i}var n=function(r,o){"use strict";if(r&&3===r.length){var a=e.navigator,i=e.Image,l=!(!document.createElementNS||!document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect||!document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Image","1.1")||e.opera&&-1===a.userAgent.indexOf("Chrome")||-1!==a.userAgent.indexOf("Series40")),u=new i;u.onerror=function(){n.method="png",n.href=r[2],t(r[2])},u.onload=function(){var e=1===u.width&&1===u.height,a=r[e&&l?0:e?1:2];n.method=e&&l?"svg":e?"datapng":"png",n.href=a,t(a,null,null,o)},u.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==",document.documentElement.className+=" grunticon"}};n.loadCSS=t,e.grunticon=n})(this);

    grunticon(["", "<%= asset_path('fallbacks/icons.data.png.css')%>", "<%= asset_path(:css, 'fallbacks/icons.fallback.css')%>"]);

  } else {

    var ajax = new XMLHttpRequest();
    ajax.open("GET", "<%= asset_path('icons/icon-sprite.svg')%>", true);
    ajax.onload = function(e) {
      var div = document.createElement("div");
      div.innerHTML = ajax.responseText;
      document.body.insertBefore(div, document.body.childNodes[0]);
    }
    ajax.send();

  }

</script>

<noscript>
  <link href="<%= asset_path('fallbacks/icons.fallback.css')%>" rel="stylesheet" />
</noscript>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
partystreusel-2.0.0 styleguide/source/layouts/_icons.html.erb
partystreusel-1.2.0 styleguide/source/layouts/_icons.html.erb