nether 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -29,6 +29,24 @@ Usage is the same as for will_paginate, however the method num_pages is instead
29
29
 
30
30
  <%= nether(@articles.num_pages, articles_path, "#content") %>
31
31
 
32
+ == Sticky Footers
33
+ Nether now has inbuilt support for sticky footers. To use the nether sticky footer functionality you must first stickify your application.
34
+
35
+ rails generate nether:stickify
36
+
37
+ This will install a css file into your stylesheets directory, after which you can simply use the nether block helpers around your content.
38
+
39
+ <%= nether_sticky_wrap do %>
40
+ # header content
41
+ <%= nether_sticky_content do %>
42
+ # body content
43
+ <% end %>
44
+ <% end %>
45
+
46
+ <%= nether_sticky_footer do %>
47
+ # footer content
48
+ <% end %>
49
+
32
50
  == Help
33
51
  * You will find an example app at nether_example[https://github.com/maecro/nether_example].
34
52
  * The wiki[https://github.com/maecro/nether/wiki] contains other useful information and examples.
@@ -1,4 +1,12 @@
1
1
  module NetherController
2
+
3
+ # Captures the request and renders the partial
4
+ #
5
+ # ==== Signatures
6
+ #
7
+ # render_nether(partial)
8
+ #
9
+ # render_nether(partial, delay)
2
10
  def render_nether(partial, delay=3)
3
11
  if request.xhr?
4
12
  sleep(delay)
@@ -1,4 +1,12 @@
1
1
  module NetherHelper
2
+
3
+ # Replaces manual pagination links with endless page.
4
+ #
5
+ # ==== Signatures
6
+ #
7
+ # nether(total_pages, url, identifier)
8
+ #
9
+ # nether(total_pages, url, identifier, container)
2
10
  def nether(total_pages, url=nil, identifier=nil, container=nil)
3
11
  opts = {
4
12
  :totalPages => total_pages,
@@ -10,4 +18,74 @@ module NetherHelper
10
18
 
11
19
  javascript_tag("$('#{identifier}').pageless(#{opts.to_json});")
12
20
  end
21
+
22
+ # Creates a wrapper that sticks nether sticky content in place.
23
+ #
24
+ # ==== Signatures
25
+ #
26
+ # nether_sticky_wrap() do
27
+ # # ...
28
+ # end
29
+ #
30
+ # nether_sticky_wrap(wrap_options = {}) do
31
+ # # ...
32
+ # end
33
+ def nether_sticky_wrap(wrap_options={}, content_options={}, &block)
34
+ if block_given?
35
+
36
+ wrap_options[:class] ||= "nether_wrap"
37
+ wrap_tag_options = tag_options(wrap_options)
38
+
39
+ "<div#{wrap_tag_options}>#{capture(&block)}</div>".html_safe
40
+ else
41
+ raise ArgumentError, "Missing block"
42
+ end
43
+ end
44
+
45
+ # Creates a content area that can be paired with nether_sticky_footer
46
+ #
47
+ # ==== Signatures
48
+ #
49
+ # nether_sticky_content() do
50
+ # # ...
51
+ # end
52
+ #
53
+ # nether_sticky_content(content_options = {}) do
54
+ # # ...
55
+ # end
56
+ def nether_sticky_content(content_options={}, &block)
57
+ if block_given?
58
+
59
+ content_options[:class] ||= "nether_content"
60
+ content_tag_options = tag_options(content_options)
61
+
62
+ "<div#{content_tag_options}>#{capture(&block)}</div>".html_safe
63
+ else
64
+ raise ArgumentError, "Missing block"
65
+ end
66
+ end
67
+
68
+ # Creates a sticky footer that is paired with nether_sticky_body
69
+ #
70
+ # ==== Signatures
71
+ #
72
+ # nether_sticky_footer() do
73
+ # # ...
74
+ # end
75
+ #
76
+ # nether_sticky_footer(footer_options = {}) do
77
+ # # ...
78
+ # end
79
+ def nether_sticky_footer(footer_options={}, &block)
80
+ if block_given?
81
+ footer_options[:class] ||= "nether_footer"
82
+
83
+ footer_tag_options = tag_options(footer_options)
84
+
85
+ "<div#{footer_tag_options}>#{capture(&block)}</div>".html_safe
86
+ else
87
+ raise ArgumentError, "Missing block"
88
+ end
89
+ end
90
+
13
91
  end
@@ -1,7 +1,5 @@
1
1
  Description:
2
- The install generator downloads jquery.pageless from
3
- github to assets/javascripts.
4
-
2
+ The install generator downloads jquery.pageless from github to assets/javascripts.
5
3
 
6
4
  Options:
7
5
 
@@ -10,10 +8,4 @@ Examples:
10
8
 
11
9
  This will create two files:
12
10
  Layout: app/views/layouts/application.rhtml
13
- Stylesheet: public/stylesheets/application.css
14
-
15
-
16
- ./script/generate app_layout myname --no-css
17
-
18
- This will create one file:
19
- Layout: app/views/layouts/myname.rhtml
11
+ Stylesheet: public/stylesheets/application.css
@@ -0,0 +1,10 @@
1
+ Description:
2
+ The stickify generator installs the css files necessary for nether sticky footer functionality.
3
+
4
+ Options:
5
+
6
+ Examples:
7
+ rails generate nether:stickify
8
+
9
+ This will create one file:
10
+ Stylesheet: public/stylesheets/stickify.css
@@ -0,0 +1,8 @@
1
+ module Nether
2
+ class StickifyGenerator < Rails::Generators::Base
3
+ source_root File.expand_path('../templates', __FILE__)
4
+ def stickify
5
+ copy_file "stickify.css", "app/assets/stylesheets/stickify.css"
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,49 @@
1
+ /*
2
+ Sticky Footer Solution
3
+ by Steve Hatcher
4
+ http://stever.ca
5
+ http://www.cssstickyfooter.com
6
+ */
7
+
8
+ * {
9
+ margin: 0;
10
+ padding: 0;
11
+ }
12
+
13
+ /* must declare 0 margins on everything, also for main layout components use padding, not
14
+ vertical margins (top and bottom) to add spacing, else those margins get added to total height
15
+ and your footer gets pushed down a bit more, creating vertical scroll bars in the browser */
16
+
17
+ html, body {
18
+ height: 100%;
19
+ }
20
+
21
+ #nether_wrap {
22
+ min-height: 100%;
23
+ }
24
+
25
+ #nether_content {
26
+ overflow:auto;
27
+ padding-bottom: 150px; /* must be same height as the footer */
28
+ }
29
+
30
+ #nether_footer {position: relative;
31
+ margin-top: -150px; /* negative value of footer height */
32
+ height: 150px;
33
+ clear: both;
34
+ }
35
+
36
+ /* Opera Fix */
37
+ body:before {
38
+ content:"";
39
+ height:100%;
40
+ float:left;
41
+ width:0;
42
+ margin-top:-32767px;
43
+ }
44
+
45
+ /* Fix for IE 6 and lower and 8 and higher. */
46
+ #nether_wrap {
47
+ _display: table;
48
+ _height: 100%
49
+ }
@@ -1,3 +1,3 @@
1
1
  module Nether
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
File without changes
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nether
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,19 +9,19 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-01-11 00:00:00.000000000Z
12
+ date: 2012-04-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
- requirement: &9862272 !ruby/object:Gem::Requirement
16
+ requirement: &74552930 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
- - - ~>
19
+ - - ! '>='
20
20
  - !ruby/object:Gem::Version
21
21
  version: 3.1.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *9862272
24
+ version_requirements: *74552930
25
25
  description: Nether is a rails engine for easily adding endless page functionality
26
26
  to paginated content.
27
27
  email:
@@ -30,48 +30,52 @@ executables: []
30
30
  extensions: []
31
31
  extra_rdoc_files: []
32
32
  files:
33
- - app/controllers/nether_controller.rb
34
33
  - app/helpers/nether_helper.rb
35
- - lib/generators/nether/install/install_generator.rb
36
- - lib/generators/nether/install/templates/jquery.pageless.js.erb
37
- - lib/generators/nether/install/templates/load.gif
38
- - lib/generators/nether/install/USAGE
34
+ - app/controllers/nether_controller.rb
39
35
  - lib/nether/engine.rb
40
36
  - lib/nether/version.rb
41
37
  - lib/nether.rb
42
38
  - lib/tasks/nether_tasks.rake
39
+ - lib/generators/nether/stickify/USAGE
40
+ - lib/generators/nether/stickify/templates/stickify.css
41
+ - lib/generators/nether/stickify/stickify_generator.rb
42
+ - lib/generators/nether/install/USAGE
43
+ - lib/generators/nether/install/templates/load.gif
44
+ - lib/generators/nether/install/templates/jquery.pageless.js.erb
45
+ - lib/generators/nether/install/install_generator.rb
43
46
  - MIT-LICENSE
44
47
  - Rakefile
45
48
  - README.rdoc
46
- - test/dummy/app/assets/javascripts/application.js
47
- - test/dummy/app/assets/stylesheets/application.css
48
- - test/dummy/app/controllers/application_controller.rb
49
- - test/dummy/app/helpers/application_helper.rb
50
- - test/dummy/app/views/layouts/application.html.erb
49
+ - test/test_helper.rb
50
+ - test/dummy/Rakefile
51
+ - test/dummy/config/environment.rb
52
+ - test/dummy/config/initializers/inflections.rb
53
+ - test/dummy/config/initializers/session_store.rb
54
+ - test/dummy/config/initializers/backtrace_silencers.rb
55
+ - test/dummy/config/initializers/mime_types.rb
56
+ - test/dummy/config/initializers/secret_token.rb
57
+ - test/dummy/config/initializers/wrap_parameters.rb
51
58
  - test/dummy/config/application.rb
52
59
  - test/dummy/config/boot.rb
53
60
  - test/dummy/config/database.yml
54
- - test/dummy/config/environment.rb
61
+ - test/dummy/config/routes.rb
55
62
  - test/dummy/config/environments/development.rb
56
63
  - test/dummy/config/environments/production.rb
57
64
  - test/dummy/config/environments/test.rb
58
- - test/dummy/config/initializers/backtrace_silencers.rb
59
- - test/dummy/config/initializers/inflections.rb
60
- - test/dummy/config/initializers/mime_types.rb
61
- - test/dummy/config/initializers/secret_token.rb
62
- - test/dummy/config/initializers/session_store.rb
63
- - test/dummy/config/initializers/wrap_parameters.rb
64
65
  - test/dummy/config/locales/en.yml
65
- - test/dummy/config/routes.rb
66
- - test/dummy/config.ru
67
- - test/dummy/public/404.html
68
- - test/dummy/public/422.html
69
66
  - test/dummy/public/500.html
70
67
  - test/dummy/public/favicon.ico
71
- - test/dummy/Rakefile
68
+ - test/dummy/public/422.html
69
+ - test/dummy/public/404.html
70
+ - test/dummy/config.ru
71
+ - test/dummy/log/test.log
72
+ - test/dummy/app/views/layouts/application.html.erb
73
+ - test/dummy/app/helpers/application_helper.rb
74
+ - test/dummy/app/controllers/application_controller.rb
75
+ - test/dummy/app/assets/stylesheets/application.css
76
+ - test/dummy/app/assets/javascripts/application.js
72
77
  - test/dummy/script/rails
73
78
  - test/nether_test.rb
74
- - test/test_helper.rb
75
79
  homepage: https://github.com/maecro/nether
76
80
  licenses: []
77
81
  post_install_message:
@@ -86,7 +90,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
86
90
  version: '0'
87
91
  segments:
88
92
  - 0
89
- hash: 951286625
93
+ hash: 1027374989
90
94
  required_rubygems_version: !ruby/object:Gem::Requirement
91
95
  none: false
92
96
  requirements:
@@ -95,40 +99,41 @@ required_rubygems_version: !ruby/object:Gem::Requirement
95
99
  version: '0'
96
100
  segments:
97
101
  - 0
98
- hash: 951286625
102
+ hash: 1027374989
99
103
  requirements: []
100
104
  rubyforge_project:
101
- rubygems_version: 1.7.2
105
+ rubygems_version: 1.8.16
102
106
  signing_key:
103
107
  specification_version: 3
104
108
  summary: Endless page for rails 3.1
105
109
  test_files:
106
- - test/dummy/app/assets/javascripts/application.js
107
- - test/dummy/app/assets/stylesheets/application.css
108
- - test/dummy/app/controllers/application_controller.rb
109
- - test/dummy/app/helpers/application_helper.rb
110
- - test/dummy/app/views/layouts/application.html.erb
110
+ - test/test_helper.rb
111
+ - test/dummy/Rakefile
112
+ - test/dummy/config/environment.rb
113
+ - test/dummy/config/initializers/inflections.rb
114
+ - test/dummy/config/initializers/session_store.rb
115
+ - test/dummy/config/initializers/backtrace_silencers.rb
116
+ - test/dummy/config/initializers/mime_types.rb
117
+ - test/dummy/config/initializers/secret_token.rb
118
+ - test/dummy/config/initializers/wrap_parameters.rb
111
119
  - test/dummy/config/application.rb
112
120
  - test/dummy/config/boot.rb
113
121
  - test/dummy/config/database.yml
114
- - test/dummy/config/environment.rb
122
+ - test/dummy/config/routes.rb
115
123
  - test/dummy/config/environments/development.rb
116
124
  - test/dummy/config/environments/production.rb
117
125
  - test/dummy/config/environments/test.rb
118
- - test/dummy/config/initializers/backtrace_silencers.rb
119
- - test/dummy/config/initializers/inflections.rb
120
- - test/dummy/config/initializers/mime_types.rb
121
- - test/dummy/config/initializers/secret_token.rb
122
- - test/dummy/config/initializers/session_store.rb
123
- - test/dummy/config/initializers/wrap_parameters.rb
124
126
  - test/dummy/config/locales/en.yml
125
- - test/dummy/config/routes.rb
126
- - test/dummy/config.ru
127
- - test/dummy/public/404.html
128
- - test/dummy/public/422.html
129
127
  - test/dummy/public/500.html
130
128
  - test/dummy/public/favicon.ico
131
- - test/dummy/Rakefile
129
+ - test/dummy/public/422.html
130
+ - test/dummy/public/404.html
131
+ - test/dummy/config.ru
132
+ - test/dummy/log/test.log
133
+ - test/dummy/app/views/layouts/application.html.erb
134
+ - test/dummy/app/helpers/application_helper.rb
135
+ - test/dummy/app/controllers/application_controller.rb
136
+ - test/dummy/app/assets/stylesheets/application.css
137
+ - test/dummy/app/assets/javascripts/application.js
132
138
  - test/dummy/script/rails
133
139
  - test/nether_test.rb
134
- - test/test_helper.rb