imagine-orbit_view 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
Binary file
Binary file
@@ -0,0 +1,17 @@
1
+ /*
2
+ * jQuery Orbit Plugin 1.2.3
3
+ * www.ZURB.com/playground
4
+ * Copyright 2010, ZURB
5
+ * Free to use under the MIT license.
6
+ * http://www.opensource.org/licenses/mit-license.php
7
+ */
8
+
9
+ (function(d){d.fn.orbit=function(a){a=d.extend({animation:"horizontal-push",animationSpeed:600,timer:!0,advanceSpeed:4E3,pauseOnHover:!1,startClockOnMouseOut:!1,startClockOnMouseOutAfter:1E3,directionalNav:!0,captions:!0,captionAnimation:"fade",captionAnimationSpeed:600,bullets:!1,bulletThumbs:!1,bulletThumbLocation:"",afterSlideChange:function(){}},a);return this.each(function(){function q(){if(!a.timer||a.timer=="false")return!1;else r.is(":hidden")?s=setInterval(function(){l("next")},a.advanceSpeed):
10
+ (o=!0,x.removeClass("active"),s=setInterval(function(){var a="rotate("+m+"deg)";m+=2;t.css({"-webkit-transform":a,"-moz-transform":a,"-o-transform":a});m>180&&(t.addClass("move"),y.addClass("move"));m>360&&(t.removeClass("move"),y.removeClass("move"),m=0,l("next"))},a.advanceSpeed/180))}function n(){if(!a.timer||a.timer=="false")return!1;else o=!1,clearInterval(s),x.addClass("active")}function z(){if(!a.captions||a.captions=="false")return!1;else{var c=e.eq(b).data("caption");(_captionHTML=d(c).html())?
11
+ (j.attr("id",c).html(_captionHTML),a.captionAnimation=="none"&&j.show(),a.captionAnimation=="fade"&&j.fadeIn(a.captionAnimationSpeed),a.captionAnimation=="slideOpen"&&j.slideDown(a.captionAnimationSpeed)):(a.captionAnimation=="none"&&j.hide(),a.captionAnimation=="fade"&&j.fadeOut(a.captionAnimationSpeed),a.captionAnimation=="slideOpen"&&j.slideUp(a.captionAnimationSpeed))}}function A(){if(a.bullets)C.children("li").removeClass("active").eq(b).addClass("active");else return!1}function l(c){function d(){e.eq(f).css({"z-index":1});
12
+ u=!1;a.afterSlideChange.call(this)}var f=b,g=c;if(f==g)return!1;if(e.length=="1")return!1;u||(u=!0,c=="next"?(b++,b==p&&(b=0)):c=="prev"?(b--,b<0&&(b=p-1)):(b=c,f<b?g="next":f>b&&(g="prev")),A(),e.eq(f).css({"z-index":2}),a.animation=="fade"&&e.eq(b).css({opacity:0,"z-index":3}).animate({opacity:1},a.animationSpeed,d),a.animation=="horizontal-slide"&&(g=="next"&&e.eq(b).css({left:h,"z-index":3}).animate({left:0},a.animationSpeed,d),g=="prev"&&e.eq(b).css({left:-h,"z-index":3}).animate({left:0},a.animationSpeed,
13
+ d)),a.animation=="vertical-slide"&&(g=="prev"&&e.eq(b).css({top:v,"z-index":3}).animate({top:0},a.animationSpeed,d),g=="next"&&e.eq(b).css({top:-v,"z-index":3}).animate({top:0},a.animationSpeed,d)),a.animation=="horizontal-push"&&(g=="next"&&(e.eq(b).css({left:h,"z-index":3}).animate({left:0},a.animationSpeed,d),e.eq(f).animate({left:-h},a.animationSpeed)),g=="prev"&&(e.eq(b).css({left:-h,"z-index":3}).animate({left:0},a.animationSpeed,d),e.eq(f).animate({left:h},a.animationSpeed))),z())}var b=0,
14
+ p=0,h,v,u,f=d(this).addClass("orbit"),c=f.wrap('<div class="orbit-wrapper" />').parent();f.add(h).width("1px").height("1px");var e=f.children("img, a, div");e.each(function(){var a=d(this),b=a.width(),a=a.height();b>f.width()&&(f.add(c).width(b),h=f.width());a>f.height()&&(f.add(c).height(a),v=f.height());p++});if(e.length==1)a.directionalNav=!1,a.timer=!1,a.bullets=!1;e.eq(b).css({"z-index":3}).fadeIn(function(){e.css({display:"block"})});if(a.timer){c.append('<div class="timer"><span class="mask"><span class="rotator"></span></span><span class="pause"></span></div>');
15
+ var r=c.children("div.timer"),o;if(r.length!=0){var t=d("div.timer span.rotator"),y=d("div.timer span.mask"),x=d("div.timer span.pause"),m=0,s;q();r.click(function(){o?n():q()});if(a.startClockOnMouseOut){var B;c.mouseleave(function(){B=setTimeout(function(){o||q()},a.startClockOnMouseOutAfter)});c.mouseenter(function(){clearTimeout(B)})}}}a.pauseOnHover&&c.mouseenter(function(){n()});if(a.captions){c.append('<div class="orbit-caption"></div>');var j=c.children(".orbit-caption");z()}if(a.directionalNav){if(a.directionalNav==
16
+ "false")return!1;c.append('<div class="slider-nav"><span class="right">Right</span><span class="left">Left</span></div>');var k=c.children("div.slider-nav").children("span.left"),w=c.children("div.slider-nav").children("span.right");k.click(function(){n();l("prev")});w.click(function(){n();l("next")})}if(a.bullets){c.append('<ul class="orbit-bullets"></ul>');var C=c.children("ul.orbit-bullets");for(i=0;i<p;i++){k=d("<li>"+(i+1)+"</li>");if(a.bulletThumbs&&(w=e.eq(i).data("thumb")))k=d('<li class="has-thumb">'+
17
+ i+"</li>"),k.css({background:"url("+a.bulletThumbLocation+w+") no-repeat"});c.children("ul.orbit-bullets").append(k);k.data("index",i);k.click(function(){n();l(d(this).data("index"))})}A()}})}})(jQuery);
@@ -0,0 +1,201 @@
1
+ /* CSS for jQuery Orbit Plugin 1.2.3
2
+ * www.ZURB.com/playground
3
+ * Copyright 2010, ZURB
4
+ * Free to use under the MIT license.
5
+ * http://www.opensource.org/licenses/mit-license.php
6
+
7
+
8
+
9
+ /* PUT IN YOUR SLIDER ID AND SIZE TO MAKE LOAD BEAUTIFULLY
10
+ ================================================== */
11
+ #featured {
12
+ width: 940px;
13
+ height: 450px;
14
+ background: #000 url('orbit/loading.gif') no-repeat center center;
15
+ overflow: hidden; }
16
+ #featured>img,
17
+ #featured>div,
18
+ #featured>a { display: none; }
19
+
20
+
21
+
22
+
23
+ /* CONTAINER
24
+ ================================================== */
25
+
26
+ div.orbit-wrapper {
27
+ width: 1px;
28
+ height: 1px;
29
+ position: relative; }
30
+
31
+ div.orbit {
32
+ width: 1px;
33
+ height: 1px;
34
+ position: relative;
35
+ overflow: hidden }
36
+
37
+ div.orbit>img {
38
+ position: absolute;
39
+ top: 0;
40
+ left: 0;
41
+ display: none; }
42
+
43
+ div.orbit>a {
44
+ border: none;
45
+ position: absolute;
46
+ top: 0;
47
+ left: 0;
48
+ line-height: 0;
49
+ display: none; }
50
+
51
+ .orbit>div {
52
+ position: absolute;
53
+ top: 0;
54
+ left: 0;
55
+ width: 100%;
56
+ height: 100%; }
57
+
58
+ /* Note: If your slider only uses content or anchors, you're going to want to put the width and height declarations on the ".orbit>div" and "div.orbit>a" tags in addition to just the .orbit-wrapper */
59
+
60
+
61
+ /* TIMER
62
+ ================================================== */
63
+
64
+ div.timer {
65
+ width: 40px;
66
+ height: 40px;
67
+ overflow: hidden;
68
+ position: absolute;
69
+ top: 10px;
70
+ right: 10px;
71
+ opacity: .6;
72
+ cursor: pointer;
73
+ z-index: 1001; }
74
+
75
+ span.rotator {
76
+ display: block;
77
+ width: 40px;
78
+ height: 40px;
79
+ position: absolute;
80
+ top: 0;
81
+ left: -20px;
82
+ background: url(orbit/rotator-black.png) no-repeat;
83
+ z-index: 3; }
84
+
85
+ span.mask {
86
+ display: block;
87
+ width: 20px;
88
+ height: 40px;
89
+ position: absolute;
90
+ top: 0;
91
+ right: 0;
92
+ z-index: 2;
93
+ overflow: hidden; }
94
+
95
+ span.rotator.move {
96
+ left: 0 }
97
+
98
+ span.mask.move {
99
+ width: 40px;
100
+ left: 0;
101
+ background: url(orbit/timer-black.png) repeat 0 0; }
102
+
103
+ span.pause {
104
+ display: block;
105
+ width: 40px;
106
+ height: 40px;
107
+ position: absolute;
108
+ top: 0;
109
+ left: 0;
110
+ background: url(orbit/pause-black.png) no-repeat;
111
+ z-index: 4;
112
+ opacity: 0; }
113
+
114
+ span.pause.active {
115
+ background: url(orbit/pause-black.png) no-repeat 0 -40px }
116
+
117
+ div.timer:hover span.pause,
118
+ span.pause.active {
119
+ opacity: 1 }
120
+
121
+
122
+ /* CAPTIONS
123
+ ================================================== */
124
+
125
+ .orbit-caption {
126
+ display: none;
127
+ font-family: "HelveticaNeue", "Helvetica-Neue", Helvetica, Arial, sans-serif; }
128
+
129
+ .orbit-wrapper .orbit-caption {
130
+ background: #000;
131
+ background: rgba(0,0,0,.6);
132
+ z-index: 1000;
133
+ color: #fff;
134
+ text-align: center;
135
+ padding: 7px 0;
136
+ font-size: 13px;
137
+ position: absolute;
138
+ right: 0;
139
+ bottom: 0;
140
+ width: 100%; }
141
+
142
+
143
+ /* DIRECTIONAL NAV
144
+ ================================================== */
145
+
146
+ div.slider-nav {
147
+ display: block }
148
+
149
+ div.slider-nav span {
150
+ width: 78px;
151
+ height: 100px;
152
+ text-indent: -9999px;
153
+ position: absolute;
154
+ z-index: 1000;
155
+ top: 50%;
156
+ margin-top: -50px;
157
+ cursor: pointer; }
158
+
159
+ div.slider-nav span.right {
160
+ background: url(orbit/right-arrow.png);
161
+ right: 0; }
162
+
163
+ div.slider-nav span.left {
164
+ background: url(orbit/left-arrow.png);
165
+ left: 0; }
166
+
167
+ /* BULLET NAV
168
+ ================================================== */
169
+
170
+ .orbit-bullets {
171
+ position: absolute;
172
+ z-index: 1000;
173
+ list-style: none;
174
+ bottom: -40px;
175
+ left: 50%;
176
+ margin-left: -50px;
177
+ padding: 0; }
178
+
179
+ .orbit-bullets li {
180
+ float: left;
181
+ margin-left: 5px;
182
+ cursor: pointer;
183
+ color: #999;
184
+ text-indent: -9999px;
185
+ background: url(orbit/bullets.jpg) no-repeat 4px 0;
186
+ width: 13px;
187
+ height: 12px;
188
+ overflow: hidden; }
189
+
190
+ .orbit-bullets li.active {
191
+ color: #222;
192
+ background-position: -8px 0; }
193
+
194
+ .orbit-bullets li.has-thumb {
195
+ background: none;
196
+ width: 100px;
197
+ height: 75px; }
198
+
199
+ .orbit-bullets li.active.has-thumb {
200
+ background-position: 0 0;
201
+ border-top: 2px solid #000; }
@@ -0,0 +1,15 @@
1
+ %h2= @album.name
2
+ %h3 Orbit View
3
+
4
+ .images#featured
5
+ - @album.images.each do |image|
6
+ = render :partial => 'imagine/images/orbit_view/image', :object => image
7
+
8
+ = link_to "New Image", new_album_image_path(@album)
9
+
10
+ = javascript_include_tag 'jquery.orbit-1.2.3.min.js'
11
+ = stylesheet_link_tag 'orbit-1.2.3.css'
12
+ :javascript
13
+ $(window).load(function() {
14
+ $('#featured').orbit();
15
+ });
@@ -0,0 +1 @@
1
+ = image_tag image.file.url
@@ -0,0 +1,21 @@
1
+ # Encoding: UTF-8
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = %q{imagine-orbit_view}
5
+ s.version = %q{0.1.4}
6
+ s.summary = %q{Orbit slider view for Imagine}
7
+ s.description = %q{A jquery slider album view for Imagine. Uses orbit.}
8
+ s.date = %q{2011-09-19}
9
+ s.email = %q{josh@isotope11.com}
10
+ s.homepage = %q{http://github.com/knewter/imagine}
11
+ s.rubyforge_project = %q{imagine}
12
+ s.authors = ['Josh Adams']
13
+ s.license = %q{MIT}
14
+ s.require_paths = %w(lib)
15
+ s.executables = %w()
16
+
17
+ s.files = Dir["app/**/*"] + [
18
+ 'imagine-orbit_view.gemspec',
19
+ 'lib/imagine-orbit_view.rb'
20
+ ]
21
+ end
@@ -0,0 +1,20 @@
1
+ module Imagine
2
+ module OrbitView
3
+ class Engine < ::Rails::Engine
4
+ isolate_namespace ::Imagine
5
+ engine_name 'imagine_orbit_view'
6
+
7
+ config.after_initialize do |app|
8
+ ::Imagine::Plugin.register do |plugin|
9
+ plugin.pathname = root
10
+ plugin.name = 'imagine_orbit_view'
11
+ plugin.directory = 'orbit_view'
12
+ plugin.version = %q{0.1.5}
13
+ end
14
+ end
15
+
16
+ end
17
+ end
18
+ end
19
+
20
+ ::Imagine.engines << 'orbit_view'
metadata ADDED
@@ -0,0 +1,59 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: imagine-orbit_view
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.4
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Josh Adams
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2011-09-19 00:00:00.000000000Z
13
+ dependencies: []
14
+ description: A jquery slider album view for Imagine. Uses orbit.
15
+ email: josh@isotope11.com
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - app/assets/javascripts/jquery.orbit-1.2.3.min.js
21
+ - app/assets/images/orbit/loading.gif
22
+ - app/assets/images/orbit/pause-black.png
23
+ - app/assets/images/orbit/rotator-black.png
24
+ - app/assets/images/orbit/timer-black.png
25
+ - app/assets/images/orbit/left-arrow.png
26
+ - app/assets/images/orbit/mask-black.png
27
+ - app/assets/images/orbit/bullets.jpg
28
+ - app/assets/images/orbit/right-arrow.png
29
+ - app/assets/stylesheets/orbit-1.2.3.css
30
+ - app/views/imagine/images/orbit_view/_image.html.haml
31
+ - app/views/imagine/albums/orbit_view/show.html.haml
32
+ - imagine-orbit_view.gemspec
33
+ - lib/imagine-orbit_view.rb
34
+ homepage: http://github.com/knewter/imagine
35
+ licenses:
36
+ - MIT
37
+ post_install_message:
38
+ rdoc_options: []
39
+ require_paths:
40
+ - lib
41
+ required_ruby_version: !ruby/object:Gem::Requirement
42
+ none: false
43
+ requirements:
44
+ - - ! '>='
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ required_rubygems_version: !ruby/object:Gem::Requirement
48
+ none: false
49
+ requirements:
50
+ - - ! '>='
51
+ - !ruby/object:Gem::Version
52
+ version: '0'
53
+ requirements: []
54
+ rubyforge_project: imagine
55
+ rubygems_version: 1.8.6
56
+ signing_key:
57
+ specification_version: 3
58
+ summary: Orbit slider view for Imagine
59
+ test_files: []