binfinity-rails 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ YjU4ZDU1ZjQ0Yzk1YzJhZmUwMDRmMzRkYmFkYzBiMTJjMWQzY2Q1Nw==
5
+ data.tar.gz: !binary |-
6
+ NjQzZWMxYmE1ZGMxOGNiMTBmMzAwYTMzNzI4ZGRiOTBmNTUzMGNlZg==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ M2Y5MmEwM2RmMzgyMzJmMDE1MDM3Y2MwMDE3OGUyYzA2YTUwMzJiNzcxMTdk
10
+ MWM5MjY5NWJhZGY4ZWVlMGFlMzUxYTVmZGJjZjY3MjZiNGU5N2I5NWVkMzdl
11
+ NmU2ZDc5ZjQ4OTJlODAwNjIzYmY0MGUwNmU4OGUzOWJhMjVjYTY=
12
+ data.tar.gz: !binary |-
13
+ ZjAzMjY0NTU0YmJkMWJmMTkyNWI2YjE3MGI1YWYwMGNlMTU5NmI3YTkyMzI2
14
+ Y2I2NDFiMTA5MzQ2NGQ1YWY3OGVmYjE3ODFmN2VkNTM5NDFmNjQ1MTFkYjgw
15
+ ODEyOTVmMmFjZGE4MTgyYzkwN2EwZTNlZDEzZTA3NTRkYmRlNjA=
data/.gitignore ADDED
@@ -0,0 +1,2 @@
1
+ index.html
2
+ *.gem
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,51 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ binfinity-rails (0.0.1)
5
+ jquery-rails
6
+ railties (> 3.1.0)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ actionpack (4.0.0)
12
+ activesupport (= 4.0.0)
13
+ builder (~> 3.1.0)
14
+ erubis (~> 2.7.0)
15
+ rack (~> 1.5.2)
16
+ rack-test (~> 0.6.2)
17
+ activesupport (4.0.0)
18
+ i18n (~> 0.6, >= 0.6.4)
19
+ minitest (~> 4.2)
20
+ multi_json (~> 1.3)
21
+ thread_safe (~> 0.1)
22
+ tzinfo (~> 0.3.37)
23
+ atomic (1.1.14)
24
+ builder (3.1.4)
25
+ erubis (2.7.0)
26
+ i18n (0.6.5)
27
+ jquery-rails (3.0.4)
28
+ railties (>= 3.0, < 5.0)
29
+ thor (>= 0.14, < 2.0)
30
+ minitest (4.7.5)
31
+ multi_json (1.8.1)
32
+ rack (1.5.2)
33
+ rack-test (0.6.2)
34
+ rack (>= 1.0)
35
+ railties (4.0.0)
36
+ actionpack (= 4.0.0)
37
+ activesupport (= 4.0.0)
38
+ rake (>= 0.8.7)
39
+ thor (>= 0.18.1, < 2.0)
40
+ rake (10.1.0)
41
+ thor (0.18.1)
42
+ thread_safe (0.1.3)
43
+ atomic
44
+ tzinfo (0.3.38)
45
+
46
+ PLATFORMS
47
+ ruby
48
+
49
+ DEPENDENCIES
50
+ binfinity-rails!
51
+ bundler (~> 1.0)
data/README.md ADDED
@@ -0,0 +1,45 @@
1
+ Binfinity Scroll Gem
2
+ ====================
3
+
4
+ ### Installation
5
+
6
+ In your Gemfile
7
+
8
+ `gem "binfinity-rais"`
9
+
10
+ In your application.js file
11
+
12
+ `\\= require binfinity`
13
+
14
+ ### Usage
15
+
16
+ Binfinity is a javascript plugin that allows infite scroll in either up or down direction.
17
+
18
+ The format for use is to call window.scroller.initialize(your_callback_here, options_hash).
19
+
20
+ Downward infinity scroll is a built-in default. To scroll upward, you need to pass `{upwardScroll: your_upscroll_callback}` as an option in the `scroller.initialize` function.
21
+
22
+ Also, to change the clearance value or "cushion" as we call it, pass `{cushion: your_integer_value}` into initialize.
23
+
24
+ For example:
25
+
26
+ ```
27
+ $(function(){
28
+ var upCallback = function(){ do stuff here };
29
+ var downCallback = function(){ do stuff here };
30
+ scroller.intialize(myDownCallback, {cushion: 500, upwardScroll: upCallback});
31
+ })
32
+ ```
33
+
34
+ ### Contributing
35
+ > Feel free to fork and contribute:
36
+
37
+ 1. Fork the repo
38
+ 2. Clone the fork
39
+ 3. Create a feature branch `git checkout -b YOUR_BRANCH_NAME`
40
+ 4. Commit
41
+ 5. Create a pull request
42
+
43
+ ### Authors
44
+ * Joshua Wilborn
45
+ * David Kim
data/Rakefile ADDED
File without changes
@@ -0,0 +1,21 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = "binfinity-rails"
5
+ s.version = "0.0.2"
6
+ s.platform = Gem::Platform::RUBY
7
+ s.authors = ["Joshua Wilborn", "David Kim"]
8
+ s.email = ["joshua.j.wilborn@gmail.com", "daviddarden11@gmail.com"]
9
+ s.homepage = "https://github.com/12days/day6_binfinity"
10
+ s.summary = "Bi-directional Infinite Scroll"
11
+ s.description = "This gem provides a javascript plugin to allow uni or bidirectional infinite scrolling with options"
12
+
13
+ s.required_rubygems_version = ">= 1.3.6"
14
+
15
+ s.add_dependency "railties", "> 3.1.0"
16
+ s.add_dependency "jquery-rails"
17
+ s.add_development_dependency "bundler", "~> 1.0"
18
+
19
+ s.files = `git ls-files`.split("\n")
20
+ s.require_path = 'lib'
21
+ end
@@ -0,0 +1 @@
1
+ require 'binfinity/rails'
@@ -0,0 +1,5 @@
1
+ module Binfinity
2
+ module Rails
3
+ require 'binfinity/rails/engine'
4
+ end
5
+ end
@@ -0,0 +1,6 @@
1
+ module Binfinity
2
+ module Rails
3
+ class Engine < ::Rails::Engine
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,48 @@
1
+ $(function(){
2
+ scroller = {
3
+ initialize : function(callback, options) {
4
+ if (options) {
5
+ if (typeof(options.upwardScroll) == 'function') {
6
+ scroller.upscroll = true;
7
+ scroller.upCallback = options.upwardScroll;
8
+ } else {
9
+ scroller.upscroll = false;
10
+ };
11
+ if (options.cushion) {
12
+ scroller.cushion = options.cushion;
13
+ } else {
14
+ scroller.cushion = 50;
15
+ }
16
+ } else {
17
+ scroller.cushion = 50;
18
+ };
19
+ scroller.downCallback = callback;
20
+ scroller.start();
21
+ },
22
+ getBottom : function(){ return $(document).height() - ($(window).scrollTop() + $(window).height())},
23
+
24
+ start : function() {
25
+ window.onscroll = scroller.iscroll;
26
+ },
27
+ iscroll : function() {
28
+ if (scroller.upscroll == true) {
29
+ if (window.pageYOffset < 0) {
30
+ scroller.upCallback();
31
+ }
32
+ }
33
+
34
+ if (scroller.getBottom() <= scroller.cushion) {
35
+ scroller.downCallback();
36
+ }
37
+ }
38
+ }
39
+ var scroll_func = function() {
40
+ add_div();
41
+ }
42
+
43
+ // you can add your own callbacks
44
+ var add_div = function() { $('body').append('<div>this is more stuff</div>'); };
45
+ var prepend_func = function() { $($('body').children()[0]).prepend($('<div>PREPEND TEH DATA</div> '))};
46
+
47
+ scroller.initialize(scroll_func, {upwardScroll: prepend_func })
48
+ });
metadata ADDED
@@ -0,0 +1,98 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: binfinity-rails
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ platform: ruby
6
+ authors:
7
+ - Joshua Wilborn
8
+ - David Kim
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-10-10 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: railties
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - ! '>'
19
+ - !ruby/object:Gem::Version
20
+ version: 3.1.0
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ! '>'
26
+ - !ruby/object:Gem::Version
27
+ version: 3.1.0
28
+ - !ruby/object:Gem::Dependency
29
+ name: jquery-rails
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ! '>='
33
+ - !ruby/object:Gem::Version
34
+ version: '0'
35
+ type: :runtime
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ! '>='
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
42
+ - !ruby/object:Gem::Dependency
43
+ name: bundler
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ~>
47
+ - !ruby/object:Gem::Version
48
+ version: '1.0'
49
+ type: :development
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ~>
54
+ - !ruby/object:Gem::Version
55
+ version: '1.0'
56
+ description: This gem provides a javascript plugin to allow uni or bidirectional infinite
57
+ scrolling with options
58
+ email:
59
+ - joshua.j.wilborn@gmail.com
60
+ - daviddarden11@gmail.com
61
+ executables: []
62
+ extensions: []
63
+ extra_rdoc_files: []
64
+ files:
65
+ - .gitignore
66
+ - Gemfile
67
+ - Gemfile.lock
68
+ - README.md
69
+ - Rakefile
70
+ - binfinity-rails.gemspec
71
+ - lib/binfinity-rails.rb
72
+ - lib/binfinity/rails.rb
73
+ - lib/binfinity/rails/engine.rb
74
+ - vendor/assets/javascripts/binfinity.js
75
+ homepage: https://github.com/12days/day6_binfinity
76
+ licenses: []
77
+ metadata: {}
78
+ post_install_message:
79
+ rdoc_options: []
80
+ require_paths:
81
+ - lib
82
+ required_ruby_version: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - ! '>='
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
87
+ required_rubygems_version: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - ! '>='
90
+ - !ruby/object:Gem::Version
91
+ version: 1.3.6
92
+ requirements: []
93
+ rubyforge_project:
94
+ rubygems_version: 2.0.6
95
+ signing_key:
96
+ specification_version: 4
97
+ summary: Bi-directional Infinite Scroll
98
+ test_files: []