jquery-sliders-rails 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in jquery-sliders-rails.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2012 Andrew De Ponte
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,29 @@
1
+ # Jquery::Sliders::Rails
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'jquery-sliders-rails'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install jquery-sliders-rails
18
+
19
+ ## Usage
20
+
21
+ TODO: Write usage instructions here
22
+
23
+ ## Contributing
24
+
25
+ 1. Fork it
26
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
27
+ 3. Commit your changes (`git commit -am 'Added some feature'`)
28
+ 4. Push to the branch (`git push origin my-new-feature`)
29
+ 5. Create new Pull Request
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env rake
2
+ require "bundler/gem_tasks"
@@ -0,0 +1,17 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require File.expand_path('../lib/jquery-sliders-rails/version', __FILE__)
3
+
4
+ Gem::Specification.new do |gem|
5
+ gem.authors = ["Andrew De Ponte"]
6
+ gem.email = ["cyphactor@gmail.com"]
7
+ gem.description = %q{A gem that provides the jQuery Sliders plugin in Rails 3.1 asset pipeline gem format.}
8
+ gem.summary = %q{Official jQuery Sliders Rails 3.1 asset pipeline gem.}
9
+ gem.homepage = "http://github.com/cyphactor/jquery-sliders-rails"
10
+
11
+ gem.files = `git ls-files`.split($\)
12
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
13
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
14
+ gem.name = "jquery-sliders-rails"
15
+ gem.require_paths = ["lib"]
16
+ gem.version = Jquery::Sliders::Rails::VERSION
17
+ end
@@ -0,0 +1,10 @@
1
+ require "jquery-sliders-rails/version"
2
+
3
+ module Jquery
4
+ module Sliders
5
+ module Rails
6
+ class Engine < ::Rails::Engine
7
+ end
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,8 @@
1
+ module Jquery
2
+ module Sliders
3
+ module Rails
4
+ VERSION = "0.0.1"
5
+ JQUERY_SLIDERS_VERSION = "d065e78899632444ce64ecc76bd3c4ffb1322a2e"
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,54 @@
1
+ // This is a jQuery plugin based on a simple jquery slideshow tutorial that I found at
2
+ // the following http://jonraasch.com/blog/a-simple-jquery-slideshow. It was a decent
3
+ // basis to get something working but wasn't the most reusable code base so I turned it
4
+ // into a jQuery plugin called sliders.
5
+ //
6
+ // I built this plugin because I needed a very simple slider that didn't do too much
7
+ // that I could use in an app I was working on. All the other jQuery slideshow plugins
8
+ // I could find tried to help too much, in turn adding too many constraints on how they
9
+ // could be used. Hence, I am specificly trying to keep this plugin vague in the ways
10
+ // it can be used which probably means it won't be the most feature rich slideshow
11
+ // plugin available.
12
+
13
+ (function($){ // An anonymous function to wrap around your function to avoid conflicts
14
+ $.fn.extend({ // Attach this new method to jQuery
15
+ sliders: function(user_options) { // The plugin constructor/initialization method
16
+
17
+ var defaults = {
18
+ interval: 5000, // interval at which slides will change
19
+ selector: ".slide", // selector used to identify slides
20
+ active_class: "active-slide", // class used to identify active slides
21
+ last_active_class: "last-active-slide" // class used to identify the last active slide
22
+ };
23
+
24
+ var options = $.extend(defaults, user_options);
25
+
26
+ return this.each(function() { // Iterate over the current set of matched elements
27
+ var o = options;
28
+
29
+ var self = $(this);
30
+
31
+ setInterval(function() {
32
+ var active_slide_selector = o.selector + "." + o.active_class;
33
+ var last_active_slide_selector = o.selector + "." + o.last_active_class;
34
+
35
+ var active = self.find(active_slide_selector);
36
+ if (active.length === 0) active = self.find(o.selector).last();
37
+
38
+ var next = active.next().length ? active.next() : self.find(o.selector).first();
39
+
40
+ active.addClass(o.last_active_class);
41
+
42
+ next.css({ opacity: 0.0 })
43
+ .addClass(o.active_class)
44
+ .animate({ opacity: 1.0 }, 1000, function() {
45
+ active.removeClass(o.last_active_class);
46
+ active.removeClass(o.active_class);
47
+ });
48
+ }, o.interval);
49
+
50
+ return this;
51
+ });
52
+ }
53
+ });
54
+ })(jQuery);
@@ -0,0 +1,18 @@
1
+ .sliders {
2
+ position: relative;
3
+ }
4
+
5
+ .sliders .slide {
6
+ position:absolute;
7
+ top:0;
8
+ left:0;
9
+ z-index:8;
10
+ }
11
+
12
+ .sliders .slide.active-slide {
13
+ z-index: 10;
14
+ }
15
+
16
+ .sliders .slide.last-active-slide {
17
+ z-index: 9;
18
+ }
metadata ADDED
@@ -0,0 +1,56 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jquery-sliders-rails
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Andrew De Ponte
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-04-24 00:00:00.000000000 Z
13
+ dependencies: []
14
+ description: A gem that provides the jQuery Sliders plugin in Rails 3.1 asset pipeline
15
+ gem format.
16
+ email:
17
+ - cyphactor@gmail.com
18
+ executables: []
19
+ extensions: []
20
+ extra_rdoc_files: []
21
+ files:
22
+ - .gitignore
23
+ - Gemfile
24
+ - LICENSE
25
+ - README.md
26
+ - Rakefile
27
+ - jquery-sliders-rails.gemspec
28
+ - lib/jquery-sliders-rails.rb
29
+ - lib/jquery-sliders-rails/version.rb
30
+ - vendor/assets/javascripts/jquery.sliders.js
31
+ - vendor/assets/stylesheets/jquery.sliders.css
32
+ homepage: http://github.com/cyphactor/jquery-sliders-rails
33
+ licenses: []
34
+ post_install_message:
35
+ rdoc_options: []
36
+ require_paths:
37
+ - lib
38
+ required_ruby_version: !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ required_rubygems_version: !ruby/object:Gem::Requirement
45
+ none: false
46
+ requirements:
47
+ - - ! '>='
48
+ - !ruby/object:Gem::Version
49
+ version: '0'
50
+ requirements: []
51
+ rubyforge_project:
52
+ rubygems_version: 1.8.16
53
+ signing_key:
54
+ specification_version: 3
55
+ summary: Official jQuery Sliders Rails 3.1 asset pipeline gem.
56
+ test_files: []