pie-rails 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -36,6 +36,32 @@ See [PIE repo](git://github.com/lojjic/PIE.git) for more usage guides, demos etc
36
36
 
37
37
  Note: A `PIE.js` file is also included
38
38
 
39
+ ## Textshadow
40
+
41
+ The [textshadow](http://kilianvalkhof.com/2008/javascript/text-shadow-in-ie-with-jquery/) jquery plugin
42
+
43
+ ### Install
44
+
45
+ ```text
46
+ //= require jquery.textshadow.min
47
+ ```
48
+
49
+ ### Usage
50
+
51
+ The plugin itself offers two functions: `textShadow();` and `removeTextShadow();`, which do what you expect them to do.
52
+
53
+ `textShadow();` Allows you to optionally overwrite the text-shadow declaration from your CSS to tweak the look of the text-shadow in Internet Explorer, if needed. The available options look like this:
54
+
55
+ ```javascript
56
+ $(elem).textShadow({
57
+ color: "#000",
58
+ xoffset: "5px",
59
+ yoffset: "5px",
60
+ radius: "5px",
61
+ opacity: "50"
62
+ });
63
+ ```
64
+
39
65
  ## Contributing to pie-rails
40
66
 
41
67
  * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.0
1
+ 1.0.1
data/pie-rails.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "pie-rails"
8
- s.version = "1.0.0"
8
+ s.version = "1.0.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Kristian Mandrup"]
@@ -30,7 +30,9 @@ Gem::Specification.new do |s|
30
30
  "spec/pie-rails_spec.rb",
31
31
  "spec/spec_helper.rb",
32
32
  "vendor/assets/javascripts/PIE.htc",
33
- "vendor/assets/javascripts/PIE.js"
33
+ "vendor/assets/javascripts/PIE.js",
34
+ "vendor/assets/javascripts/jquery.textshadow.js",
35
+ "vendor/assets/javascripts/jquery.textshadow.min.js"
34
36
  ]
35
37
  s.homepage = "http://github.com/kristianmandrup/pie-rails"
36
38
  s.licenses = ["MIT"]
@@ -0,0 +1,58 @@
1
+ /*
2
+ * jQuery textShadow plugin
3
+ * Version 1.1 (26/02/2010)
4
+ * @requires jQuery v1.2+
5
+ *
6
+ * Copyright (c) 2008 - 2010 Kilian Valkhof (kilianvalkhof.com)
7
+ * Dual licensed under the MIT and GPL licenses:
8
+ * http://www.opensource.org/licenses/mit-license.php
9
+ * http://www.gnu.org/licenses/gpl.html
10
+ *
11
+ */
12
+ (function($){
13
+ $.fn.textShadow = function(useroptions) {
14
+ return this.each(function() {
15
+ var obj = $(this);
16
+ obj.removeTextShadow();
17
+ var shadowarray = obj.css("text-shadow").split(" ");
18
+ var sradi = parseInt(shadowarray[3], 10);
19
+ var text = "<span class='jQshad'>" + obj.html() + "</span>";
20
+
21
+ var padding = {
22
+ left:parseInt(obj.css("padding-left"), 10),
23
+ top:parseInt(obj.css("padding-top"), 10)
24
+ };
25
+
26
+ var defaults = {
27
+ color: shadowarray[0],
28
+ radius: sradi,
29
+ xoffset: parseInt(shadowarray[1], 10)-1+(padding.left-sradi) + "px",
30
+ yoffset: parseInt(shadowarray[2], 10)-1+(padding.top-sradi) + "px",
31
+ opacity: 50
32
+ };
33
+ var options = $.extend(defaults, useroptions);
34
+ options.color = (options.color.length == 4) ? options.color.replace(/#([0-9A-f])([0-9A-f])([0-9A-f])/i, '#$1$1$2$2$3$3') : options.color;
35
+ var filtertext = "progid:DXImageTransform.Microsoft.Glow(Color="+options.color+",Strength="+(options.radius/6)+") progid:DXImageTransform.Microsoft.Blur(pixelradius="+options.radius+", enabled='true') progid:DXImageTransform.Microsoft.Alpha(opacity="+options.opacity+")";
36
+
37
+ if($.browser.msie && options != "") {
38
+ obj.css({"position":"relative","zoom":"1"}).append(text);
39
+ obj.children("span.jQshad").css({
40
+ "position":"absolute",
41
+ "z-index":"-1",
42
+ "zoom":"1",
43
+ "left":options.xoffset,
44
+ "top":options.yoffset,
45
+ "color":options.color,
46
+ "filter":filtertext,
47
+ "-ms-filter":filtertext
48
+ });
49
+ }
50
+ });
51
+ };
52
+
53
+ $.fn.removeTextShadow = function() {
54
+ return this.each(function() {
55
+ $(this).children("span.jQshad").remove();
56
+ });
57
+ };
58
+ })(jQuery);
@@ -0,0 +1,13 @@
1
+ /*
2
+ * jQuery textShadow plugin
3
+ * Version 1.1 (26/02/2010)
4
+ * @requires jQuery v1.2+
5
+ *
6
+ * Copyright (c) 2008 - 2010 Kilian Valkhof (kilianvalkhof.com)
7
+ * Dual licensed under the MIT and GPL licenses:
8
+ * http://www.opensource.org/licenses/mit-license.php
9
+ * http://www.gnu.org/licenses/gpl.html
10
+ *
11
+ */
12
+
13
+ (function($){$.fn.textShadow=function(useroptions){return this.each(function(){var obj=$(this);obj.removeTextShadow();var shadowarray=obj.css("text-shadow").split(" ");var sradi=parseInt(shadowarray[3],10);var text="<span class='jQshad'>"+obj.html()+"</span>";var padding={left:parseInt(obj.css("padding-left"),10),top:parseInt(obj.css("padding-top"),10)};var defaults={color:shadowarray[0],radius:sradi,xoffset:parseInt(shadowarray[1],10)-1+(padding.left-sradi)+"px",yoffset:parseInt(shadowarray[2],10)-1+(padding.top-sradi)+"px",opacity:50};var options=$.extend(defaults,useroptions);options.color=(options.color.length==4)?options.color.replace(/#([0-9A-f])([0-9A-f])([0-9A-f])/i,'#$1$1$2$2$3$3'):options.color;var filtertext="progid:DXImageTransform.Microsoft.Glow(Color="+options.color+",Strength="+(options.radius/6)+") progid:DXImageTransform.Microsoft.Blur(pixelradius="+options.radius+", enabled='true') progid:DXImageTransform.Microsoft.Alpha(opacity="+options.opacity+")";if($.browser.msie&&options!=""){obj.css({"position":"relative","zoom":"1"}).append(text);obj.children("span.jQshad").css({"position":"absolute","z-index":"-1","zoom":"1","left":options.xoffset,"top":options.yoffset,"color":options.color,"filter":filtertext,"-ms-filter":filtertext})}})};$.fn.removeTextShadow=function(){return this.each(function(){$(this).children("span.jQshad").remove()})}})(jQuery);
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pie-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -113,6 +113,8 @@ files:
113
113
  - spec/spec_helper.rb
114
114
  - vendor/assets/javascripts/PIE.htc
115
115
  - vendor/assets/javascripts/PIE.js
116
+ - vendor/assets/javascripts/jquery.textshadow.js
117
+ - vendor/assets/javascripts/jquery.textshadow.min.js
116
118
  homepage: http://github.com/kristianmandrup/pie-rails
117
119
  licenses:
118
120
  - MIT
@@ -128,7 +130,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
128
130
  version: '0'
129
131
  segments:
130
132
  - 0
131
- hash: -908895803144502834
133
+ hash: 3940177036577333418
132
134
  required_rubygems_version: !ruby/object:Gem::Requirement
133
135
  none: false
134
136
  requirements: