savagery 0.4.4 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 767ed4a1bf7218b6c226106f16d9b0cabad38d24
4
- data.tar.gz: 1680f3af8f6a82d912dfa7fa42c06446b0f59495
3
+ metadata.gz: 9f4b4df0b64f3c16e8f0360e06487c503dd46801
4
+ data.tar.gz: 1109e5be39b0b83df68cd7ff2e295244b21e4c5a
5
5
  SHA512:
6
- metadata.gz: 65c25a0a4e108d343f6104dc8285835cd937f2ff1763296039b9dfdafdac9d91ba93ed420306c23b6e7b7c1ed32ec239030b5ec0f79be3ca0edffeffb5a7492f
7
- data.tar.gz: 8797918371e227c28e247a37cebbc8dc20dcce9fc0b6f44cb02b3010503ae1412911ecf53899da953753116918d7cc4e5ba7bb20b85431468a85ca7f15feb9ee
6
+ metadata.gz: 40faf0e88229a9236b18d69201e10f0becf7b9a591f57602911add25688aeaf6aa5cd78ec35a0e42b5743bb0ac943ee1f4b26a0762a343c5d66ddddb1e5be2d0
7
+ data.tar.gz: 3382127d0727c26a8c97c7f20d4dfb0a7eb29c9b6d93154ae6d61e77db386cc76ea889b64b524ac4629fb67b6a2dd591bdff3c27271cccb90f7c25f6371aebbd
@@ -2,10 +2,8 @@
2
2
 
3
3
  Savagery = {
4
4
  svgSpriteInclude: function(name) {
5
- if(this._svgSpritesIncluded[name]) { return; }
6
- this._svgSpritesIncluded[name] = true
7
-
8
- path = window.ASSETS.path(name + ".svg")
5
+ var path = window.ASSETS.path(name + ".svg")
6
+ if($("[data-savagery-path='" + path.split("/assets/").reverse()[0] + "']").length > 0) { return; }
9
7
  $.get(path, function(data) {
10
8
  $("body").prepend(data);
11
9
  }, "text");
@@ -18,8 +16,6 @@ Savagery = {
18
16
  absolutePath = absolutePath + "#" + basename;
19
17
  return '<svg class="' + cssClass + '"><use xlink:href="' + absolutePath + '"></use></svg>';
20
18
  },
21
-
22
- _svgSpritesIncluded: {},
23
19
  };
24
20
 
25
21
  Ember.Application.initializer({
@@ -19,7 +19,7 @@ module Savagery
19
19
  end
20
20
 
21
21
  def sprite
22
- %(<svg style="display: none"><defs>\n\n#{symbols.join("\n")}\n</defs></svg>\n)
22
+ %(<svg data-savagery-path="#{sprite_path.split("/assets/svgs/").last}" style="display: none"><defs>\n\n#{symbols.join("\n")}\n</defs></svg>\n)
23
23
  end
24
24
 
25
25
  def symbols
@@ -1,3 +1,3 @@
1
1
  module Savagery
2
- VERSION = "0.4.4"
2
+ VERSION = "0.5.0"
3
3
  end
@@ -1,4 +1,4 @@
1
- <svg style="display: none"><defs>
1
+ <svg data-savagery-path="tmp/svgs.svg" style="display: none"><defs>
2
2
 
3
3
  <symbol id="callout1"><g opacity="0.6">
4
4
  <path fill="#C2DFF5" d="M945.959,12.514c-2.913-1.25-7.968-1.442-12.753-1.714C936.875,12.009,940.785,12.569,945.959,12.514z"/>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: savagery
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Micah Geisel