scroll_top 0.0.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/.gitignore ADDED
@@ -0,0 +1,18 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ coverage
6
+ InstalledFiles
7
+ lib/bundler/man
8
+ pkg
9
+ rdoc
10
+ spec/reports
11
+ test/tmp
12
+ test/version_tmp
13
+ tmp
14
+
15
+ # YARD artifacts
16
+ .yardoc
17
+ _yardoc
18
+ doc/
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in scroll_top.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 Андрей [ws70]
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.
data/README.md ADDED
@@ -0,0 +1,4 @@
1
+ scroll_top
2
+ ==========
3
+
4
+ JQuery Scroll Top for Rails 3 App
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,6 @@
1
+ module ScrollTop
2
+ module Rails
3
+ class Engine < ::Rails::Engine
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,3 @@
1
+ module ScrollTop
2
+ VERSION = "0.0.1"
3
+ end
data/lib/scroll_top.rb ADDED
@@ -0,0 +1,5 @@
1
+ require "scroll_top/version"
2
+
3
+ if defined? Rails
4
+ require 'scroll_top/engine'
5
+ end
@@ -0,0 +1,19 @@
1
+ # -*- encoding: utf-8 -*-
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'scroll_top/version'
5
+
6
+ Gem::Specification.new do |gem|
7
+ gem.name = "scroll_top"
8
+ gem.version = ScrollTop::VERSION
9
+ gem.authors = ["Андрей [ws70]"]
10
+ gem.email = ["railscode@gmail.com"]
11
+ gem.description = "JQuery Scroll Top for Rails 3 App"
12
+ gem.summary = "summary"
13
+ gem.homepage = "https://github.com/vav/scroll_top"
14
+
15
+ gem.files = `git ls-files`.split($/)
16
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
17
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
+ gem.require_paths = ["lib"]
19
+ end
Binary file
@@ -0,0 +1,19 @@
1
+ $(window).scroll(function () {
2
+ var scroll = $(this).scrollTop();
3
+ if (scroll > 300) {
4
+ $('#top').show();
5
+ } else {
6
+ $('#top').hide();
7
+ }
8
+ });
9
+
10
+ function to_top() {
11
+ $('#top').click(function(){
12
+ $('html, body').animate({scrollTop:0}, 1000);
13
+ return false;
14
+ });
15
+ }
16
+
17
+ $(document).ready(function(){
18
+ to_top();
19
+ });
@@ -0,0 +1,16 @@
1
+ #top {
2
+ display: none;
3
+ border:2px solid #ccc;
4
+ position: fixed;
5
+ bottom: 10px;
6
+ right: 10px;
7
+ cursor:pointer;
8
+ z-index:10;
9
+ padding:10px;
10
+ }
11
+
12
+ #top div {
13
+ background: url("/assets/top.png") no-repeat;
14
+ width: 32px;
15
+ height: 32px;
16
+ }
metadata ADDED
@@ -0,0 +1,57 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: scroll_top
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Андрей [ws70]
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-03-08 00:00:00.000000000 Z
13
+ dependencies: []
14
+ description: JQuery Scroll Top for Rails 3 App
15
+ email:
16
+ - railscode@gmail.com
17
+ executables: []
18
+ extensions: []
19
+ extra_rdoc_files: []
20
+ files:
21
+ - .gitignore
22
+ - Gemfile
23
+ - LICENSE.txt
24
+ - README.md
25
+ - Rakefile
26
+ - lib/scroll_top.rb
27
+ - lib/scroll_top/engine.rb
28
+ - lib/scroll_top/version.rb
29
+ - scroll_top.gemspec
30
+ - vendor/assets/images/top.png
31
+ - vendor/assets/javascripts/scroll_top.js
32
+ - vendor/assets/stylesheets/scroll_top.css
33
+ homepage: https://github.com/vav/scroll_top
34
+ licenses: []
35
+ post_install_message:
36
+ rdoc_options: []
37
+ require_paths:
38
+ - lib
39
+ required_ruby_version: !ruby/object:Gem::Requirement
40
+ none: false
41
+ requirements:
42
+ - - ! '>='
43
+ - !ruby/object:Gem::Version
44
+ version: '0'
45
+ required_rubygems_version: !ruby/object:Gem::Requirement
46
+ none: false
47
+ requirements:
48
+ - - ! '>='
49
+ - !ruby/object:Gem::Version
50
+ version: '0'
51
+ requirements: []
52
+ rubyforge_project:
53
+ rubygems_version: 1.8.23
54
+ signing_key:
55
+ specification_version: 3
56
+ summary: summary
57
+ test_files: []