use_js_please 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,29 @@
1
+ # encoding: utf-8
2
+
3
+ module Usejsplease
4
+ module Generators
5
+ class InstallGenerator < Rails::Generators::Base
6
+ source_root File.expand_path('../templates', __FILE__)
7
+ desc "This generator adds a noscript support to your rails application"
8
+
9
+ def create_noscript_partial
10
+ copy_file 'noscript.html', 'app/views/layouts/_noscript.html'
11
+ end
12
+
13
+ def create_noscript_css
14
+ copy_file 'noscript.css', "app/assets/stylesheets/noscript.css"
15
+ end
16
+
17
+ def insert_noscript_partial_into_application_layout
18
+ gsub_file 'app/views/layouts/application.html.erb', /<body>/, "<body>
19
+ <%= render 'layouts/noscript' %>"
20
+ end
21
+
22
+ def insert_noscript_css_into_application_css
23
+ gsub_file 'app/assets/stylesheets/application.css', /\*\//, ' *= require noscript
24
+ */'
25
+ end
26
+
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,7 @@
1
+ noscript {
2
+ width: 100%;
3
+ height: 100%;
4
+ z-index: 1000;
5
+ position: fixed;
6
+ background-color: red;
7
+ }
@@ -0,0 +1,3 @@
1
+ <noscript>
2
+ <h2> This site requires javascript. </h2>
3
+ </noscript>
metadata ADDED
@@ -0,0 +1,49 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: use_js_please
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Nick Shook
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-04-01 00:00:00.000000000 Z
13
+ dependencies: []
14
+ description: This app creates a noscript partial, css styling to cover the whole page,
15
+ and inserts the partial and the css into the proper application files
16
+ email:
17
+ - nicholas.shook@gmail.com
18
+ executables: []
19
+ extensions: []
20
+ extra_rdoc_files: []
21
+ files:
22
+ - lib/rails/generators/usejsplease/install/install_generator.rb
23
+ - lib/rails/generators/usejsplease/install/templates/noscript.css
24
+ - lib/rails/generators/usejsplease/install/templates/noscript.html
25
+ homepage: https://github.com/shicholas/use_js_please
26
+ licenses: []
27
+ post_install_message:
28
+ rdoc_options: []
29
+ require_paths:
30
+ - lib
31
+ required_ruby_version: !ruby/object:Gem::Requirement
32
+ none: false
33
+ requirements:
34
+ - - ! '>='
35
+ - !ruby/object:Gem::Version
36
+ version: '0'
37
+ required_rubygems_version: !ruby/object:Gem::Requirement
38
+ none: false
39
+ requirements:
40
+ - - ! '>='
41
+ - !ruby/object:Gem::Version
42
+ version: '0'
43
+ requirements: []
44
+ rubyforge_project: use_js_please
45
+ rubygems_version: 1.8.24
46
+ signing_key:
47
+ specification_version: 3
48
+ summary: If a user has no javascript, encourage them to use it!
49
+ test_files: []