chardinjs-rails 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +1 -1
- data/app/assets/javascripts/chardinjs.js +2 -0
- data/app/assets/stylesheets/chardinjs.css +82 -0
- data/lib/chardinjs-rails/version.rb +1 -1
- metadata +5 -3
data/Rakefile
CHANGED
@@ -20,7 +20,7 @@ task :build do
|
|
20
20
|
end
|
21
21
|
|
22
22
|
task release: :build do
|
23
|
-
version =
|
23
|
+
version = Chardinjs::Rails::VERSION
|
24
24
|
system "git tag -a v#{version} -m 'Tagging #{version}'"
|
25
25
|
system "git push --tags"
|
26
26
|
system "gem push chardinjs-#{version}.gem"
|
@@ -0,0 +1,2 @@
|
|
1
|
+
// Generated by CoffeeScript 1.6.1
|
2
|
+
(function(){var e=[].slice;(function(t,n){var r;return r=function(){function e(e){var r=this;this.$el=t(e),t(n).resize(function(){return r.refresh()})}return e.prototype.start=function(){var e,t,n,r;if(this._overlay_visible())return!1;this._add_overlay_layer(),r=this.$el.find("*[data-intro]");for(t=0,n=r.length;t<n;t++)e=r[t],this._show_element(e);return this.$el.trigger("chardinJs:start")},e.prototype.toggle=function(){return this._overlay_visible()?this.stop():this.start()},e.prototype.refresh=function(){var e,t,n,r,i;if(this._overlay_visible()){r=this.$el.find("*[data-intro]"),i=[];for(t=0,n=r.length;t<n;t++)e=r[t],i.push(this._position_helper_layer(e));return i}return this},e.prototype.stop=function(){return this.$el.find(".chardinjs-overlay").fadeOut(function(){return this.remove()}),this.$el.find(".chardinjs-helper-layer").remove(),this.$el.find(".chardinjs-show-element").removeClass("chardinjs-show-element"),n.removeEventListener?n.removeEventListener("keydown",this._onKeyDown,!0):document.detachEvent&&document.detachEvent("onkeydown",this._onKeyDown),this.$el.trigger("chardinJs:stop")},e.prototype._overlay_visible=function(){return this.$el.find(".chardinjs-overlay").length!==0},e.prototype._add_overlay_layer=function(){var e,t,n,r=this;return this._overlay_visible()?!1:(t=document.createElement("div"),n="",t.className="chardinjs-overlay",this.$el.prop("tagName")==="BODY"?(n+="top: 0;bottom: 0; left: 0;right: 0;position: fixed;",t.setAttribute("style",n)):(e=this._get_offset(),e&&(n+="width: "+e.width+"px; height:"+e.height+"px; top:"+e.top+"px;left: "+e.left+"px;",t.setAttribute("style",n))),this.$el.get()[0].appendChild(t),t.onclick=function(){return r.stop()},setTimeout(function(){return n+="opacity: .8;",t.setAttribute("style",n)},10))},e.prototype._get_position=function(e){return e.getAttribute("data-position")||"bottom"},e.prototype._place_tooltip=function(e){var n,r,i,s,o,u,a;u=t(e).data("tooltip_layer"),a=this._get_offset(u),u.style.top=null,u.style.right=null,u.style.bottom=null,u.style.left=null;switch(this._get_position(e)){case"top":case"bottom":i=this._get_offset(e),o=i.width,r=t(u).width(),u.style.left=""+(o/2-a.width/2)+"px";break;case"left":case"right":i=this._get_offset(e),s=i.height,n=t(u).height(),u.style.top=""+(s/2-a.height/2)+"px"}switch(this._get_position(e)){case"left":return u.style.left="-"+(a.width-34)+"px";case"right":return u.style.right="-"+(a.width-34)+"px";case"bottom":return u.style.bottom="-"+a.height+"px";case"top":return u.style.top="-"+a.height+"px"}},e.prototype._position_helper_layer=function(e){var n,r;return r=t(e).data("helper_layer"),n=this._get_offset(e),r.setAttribute("style","width: "+n.width+"px; height:"+n.height+"px; top:"+n.top+"px; left: "+n.left+"px;")},e.prototype._show_element=function(e){var n,r,i,s;r=this._get_offset(e),i=document.createElement("div"),s=document.createElement("div"),t(e).data("helper_layer",i).data("tooltip_layer",s),e.id&&i.setAttribute("data-id",e.id),i.className="chardinjs-helper-layer chardinjs-"+this._get_position(e),this._position_helper_layer(e),this.$el.get()[0].appendChild(i),s.className="chardinjs-tooltip chardinjs-"+this._get_position(e),s.innerHTML="<div class='chardinjs-tooltiptext'>"+e.getAttribute("data-intro")+"</div>",i.appendChild(s),this._place_tooltip(e),e.className+=" chardinjs-show-element",n="",e.currentStyle?n=e.currentStyle.position:document.defaultView&&document.defaultView.getComputedStyle&&(n=document.defaultView.getComputedStyle(e,null).getPropertyValue("position")),n=n.toLowerCase();if(n!=="absolute"&&n!=="relative")return e.className+=" chardinjs-relative-position"},e.prototype._get_offset=function(e){var t,n,r;t={width:e.offsetWidth,height:e.offsetHeight},n=0,r=0;while(e&&!isNaN(e.offsetLeft)&&!isNaN(e.offsetTop))n+=e.offsetLeft,r+=e.offsetTop,e=e.offsetParent;return t.top=r,t.left=n,t},e}(),t.fn.extend({chardinJs:function(){var n,i,s,o;return o=arguments[0],i=2<=arguments.length?e.call(arguments,1):[],n=t(this[0]),s=n.data("chardinJs"),s||n.data("chardinJs",s=new r(this,o)),typeof o=="string"&&s[o].apply(s,i),s}})})(window.jQuery,window)}).call(this);
|
@@ -0,0 +1,82 @@
|
|
1
|
+
.chardinjs-overlay {
|
2
|
+
position: absolute;
|
3
|
+
z-index: 999999;
|
4
|
+
background-color: #000;
|
5
|
+
opacity: 0;
|
6
|
+
-webkit-transition: all 0.3s ease-out;
|
7
|
+
-moz-transition: all 0.3s ease-out;
|
8
|
+
-ms-transition: all 0.3s ease-out;
|
9
|
+
-o-transition: all 0.3s ease-out;
|
10
|
+
transition: all 0.3s ease-out; }
|
11
|
+
|
12
|
+
.chardinjs-helper-layer {
|
13
|
+
position: absolute;
|
14
|
+
z-index: 9999998;
|
15
|
+
color: white;
|
16
|
+
-webkit-transition: all 0.3s ease-out;
|
17
|
+
-moz-transition: all 0.3s ease-out;
|
18
|
+
-ms-transition: all 0.3s ease-out;
|
19
|
+
-o-transition: all 0.3s ease-out;
|
20
|
+
transition: all 0.3s ease-out; }
|
21
|
+
.chardinjs-helper-layer.chardinjs-left {
|
22
|
+
border-left: solid white 1px;
|
23
|
+
margin-left: -10px; }
|
24
|
+
.chardinjs-helper-layer.chardinjs-right {
|
25
|
+
border-right: solid white 1px;
|
26
|
+
padding-right: 10px; }
|
27
|
+
.chardinjs-helper-layer.chardinjs-bottom {
|
28
|
+
border-bottom: solid white 1px;
|
29
|
+
padding-bottom: 10px; }
|
30
|
+
.chardinjs-helper-layer.chardinjs-top {
|
31
|
+
border-top: solid white 1px;
|
32
|
+
padding-top: 10px; }
|
33
|
+
|
34
|
+
.chardinjs-tooltip {
|
35
|
+
position: absolute;
|
36
|
+
-webkit-transition: opacity 0.1s ease-out;
|
37
|
+
-moz-transition: opacity 0.1s ease-out;
|
38
|
+
-ms-transition: opacity 0.1s ease-out;
|
39
|
+
-o-transition: opacity 0.1s ease-out;
|
40
|
+
transition: opacity 0.1s ease-out;
|
41
|
+
max-width: 200px; }
|
42
|
+
.chardinjs-tooltip.chardinjs-left {
|
43
|
+
margin-left: -135px;
|
44
|
+
padding-right: 10px; }
|
45
|
+
.chardinjs-tooltip.chardinjs-right {
|
46
|
+
margin-right: -135px;
|
47
|
+
padding-left: 10px; }
|
48
|
+
.chardinjs-tooltip.chardinjs-bottom {
|
49
|
+
margin-bottom: -50px;
|
50
|
+
padding-top: 10px; }
|
51
|
+
.chardinjs-tooltip.chardinjs-top {
|
52
|
+
margin-top: -50px;
|
53
|
+
padding-bottom: 10px; }
|
54
|
+
.chardinjs-tooltip.chardinjs-right:before, .chardinjs-tooltip.chardinjs-left:after, .chardinjs-tooltip.chardinjs-bottom:before, .chardinjs-tooltip.chardinjs-top:after {
|
55
|
+
content: ".";
|
56
|
+
display: inline-block;
|
57
|
+
background-color: white;
|
58
|
+
height: 1px;
|
59
|
+
overflow: hidden;
|
60
|
+
position: absolute; }
|
61
|
+
.chardinjs-tooltip.chardinjs-right:before, .chardinjs-tooltip.chardinjs-left:after {
|
62
|
+
width: 100px;
|
63
|
+
top: 50%; }
|
64
|
+
.chardinjs-tooltip.chardinjs-bottom:before, .chardinjs-tooltip.chardinjs-top:after {
|
65
|
+
width: 1px;
|
66
|
+
height: 50px;
|
67
|
+
left: 50%; }
|
68
|
+
.chardinjs-tooltip.chardinjs-bottom:before {
|
69
|
+
top: -50px; }
|
70
|
+
.chardinjs-tooltip.chardinjs-top:after {
|
71
|
+
bottom: -50px; }
|
72
|
+
.chardinjs-tooltip.chardinjs-right:before {
|
73
|
+
left: -100px; }
|
74
|
+
.chardinjs-tooltip.chardinjs-left:after {
|
75
|
+
right: -100px; }
|
76
|
+
|
77
|
+
.chardinjs-show-element {
|
78
|
+
z-index: 9999999;
|
79
|
+
opacity: 0.8; }
|
80
|
+
|
81
|
+
.chardinjs-relative-position {
|
82
|
+
position: relative; }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chardinjs-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -103,6 +103,8 @@ files:
|
|
103
103
|
- LICENSE
|
104
104
|
- README.md
|
105
105
|
- Rakefile
|
106
|
+
- app/assets/javascripts/chardinjs.js
|
107
|
+
- app/assets/stylesheets/chardinjs.css
|
106
108
|
- chardinjs-rails.gemspec
|
107
109
|
- lib/chardinjs-rails.rb
|
108
110
|
- lib/chardinjs-rails/engine.rb
|
@@ -122,7 +124,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
122
124
|
version: '0'
|
123
125
|
segments:
|
124
126
|
- 0
|
125
|
-
hash: -
|
127
|
+
hash: -1444348404177709448
|
126
128
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
127
129
|
none: false
|
128
130
|
requirements:
|
@@ -131,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
131
133
|
version: '0'
|
132
134
|
segments:
|
133
135
|
- 0
|
134
|
-
hash: -
|
136
|
+
hash: -1444348404177709448
|
135
137
|
requirements: []
|
136
138
|
rubyforge_project:
|
137
139
|
rubygems_version: 1.8.25
|