browser_warrior 0.3.0 → 0.4.0
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.
- checksums.yaml +4 -4
- data/README.md +27 -30
- data/app/assets/stylesheets/browser_warrior/application.scss +4 -1
- data/app/views/browser_warrior/index.en.html.erb +12 -12
- data/lib/browser_warrior/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e01062f08d8f3f8bfe12e5a07ad9b73a393d0cc7
|
4
|
+
data.tar.gz: 84e0699a838d8a1ccf419b337af91f5a0a32f54f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ec67fc6e96fbaba8790d15abfd614d37e2776facdb0eb5cc8150222ad6c9d1508f3e78ba0a2a111ed315fc0445d30d650c318ae399003f4320cbfb59899c932
|
7
|
+
data.tar.gz: 123f5f32182e8f7f17f68f32fa13baeba2440d34ac10d347d88921ca0af49bdd17c2f82929ffbe3e5286e5835b2ca4d6fed6ad25f0f3aa3c22e4485368b4fe0b
|
data/README.md
CHANGED
@@ -1,12 +1,11 @@
|
|
1
1
|
# BrowserWarrior
|
2
2
|
|
3
|
-
Are you a warrior?
|
3
|
+
Are you a warrior? Are you brave enough to reject your IE 6/7/8 users?
|
4
4
|
|
5
|
-
|
5
|
+
It is time to say YES.
|
6
6
|
|
7
|
-
**BrowserWarrior**
|
8
|
-
|
9
|
-
Make your Ruby on Rails 5 Application rejecting ie6/7/8 with only one line code. ( Notice: only support Rails 5 now, we will do more work to support 4 & 3 )
|
7
|
+
**BrowserWarrior** makes this super easy with one line of code.
|
8
|
+
Note: Only Rails 5 is supported at this time. Support for 3 & 4 is being worked on.
|
10
9
|
|
11
10
|
```ruby
|
12
11
|
# in your Gemfile
|
@@ -15,21 +14,24 @@ gem 'browser_warrior'
|
|
15
14
|
|
16
15
|
And then:
|
17
16
|
```bash
|
18
|
-
$ bundle
|
17
|
+
$ bundle install
|
19
18
|
```
|
20
19
|
|
21
|
-
|
20
|
+
That's it.
|
21
|
+
|
22
|
+
All IE 6/7/8 users will be redirected to a page that suggests they should upgrade their browsers.
|
22
23
|
|
23
|
-
|
24
|
+
Upgrading browser screenshot (en)
|
25
|
+

|
24
26
|
|
25
|
-
Upgrading browser screenshot
|
27
|
+
Upgrading browser screenshot (zh-CN)
|
26
28
|

|
27
29
|
|
28
|
-
##
|
30
|
+
## Configuration
|
29
31
|
|
30
|
-
**
|
32
|
+
**Question**: Can I add more unsupported browsers?
|
31
33
|
|
32
|
-
Very easy.
|
34
|
+
Very easy. Run:
|
33
35
|
|
34
36
|
```bash
|
35
37
|
$ rails g browser_warrior:install
|
@@ -37,36 +39,30 @@ $ rails g browser_warrior:install
|
|
37
39
|
|
38
40
|
It will generate `browser_warrior.rb` in `config/initializers/`.
|
39
41
|
|
40
|
-
|
41
|
-
|
42
|
-
There is a `browser` object that you can easily custom your requirement.
|
42
|
+
There is a `browser` object that you can easily customize.
|
43
43
|
|
44
44
|
See more: <https://github.com/fnando/browser#usage>
|
45
45
|
|
46
|
-
**
|
46
|
+
**Question**: Can I customize the suggested browser page?
|
47
47
|
|
48
|
-
Sure.
|
48
|
+
Sure. Run:
|
49
49
|
|
50
50
|
```bash
|
51
51
|
$ rails g browser_warrior:views
|
52
52
|
```
|
53
53
|
|
54
|
-
It will generate `view` and `css` files for you.
|
55
|
-
Then edit them.
|
54
|
+
It will generate `view` and `css` files for you that can be edited.
|
56
55
|
|
57
|
-
|
56
|
+
Nice and easy.
|
58
57
|
|
59
58
|
## i18n
|
60
59
|
|
61
|
-
`BrowserWarrior` will render the correct page based on your i18n locale config.
|
62
|
-
|
63
|
-
Now it supports `en` and `zh-CN`.
|
64
|
-
|
65
|
-
You can easily add more locale pages.
|
60
|
+
`BrowserWarrior` will render the correct page based on your i18n locale config.
|
61
|
+
It currently supports `en` and `zh-CN`, and you can add more locale pages easily.
|
66
62
|
|
67
|
-
##
|
63
|
+
## Advice
|
68
64
|
|
69
|
-
I
|
65
|
+
I suggest adding the code below to your base layout( e.g. `application.html.erb` ):
|
70
66
|
|
71
67
|
```html
|
72
68
|
// app/layouts/application.html.erb
|
@@ -79,11 +75,12 @@ I advise adding the code below to your base layout( e.g. `application.html.erb`
|
|
79
75
|
|
80
76
|
- [x] Release 0.1.0, one line code to support rejecting old browser page
|
81
77
|
- [x] I18n support ( 0.3.0 )
|
82
|
-
- [ ] Extend support rails 4 and rails 3.
|
83
|
-
- [ ]
|
78
|
+
- [ ] Extend support to rails 4 and rails 3.
|
79
|
+
- [ ] Extend support to more than one theme.
|
84
80
|
|
85
81
|
## Contributing
|
86
|
-
[windy](https://github.com/windy)
|
82
|
+
[windy](https://github.com/windy)
|
83
|
+
[azah](https://github.com/azah) (Fixing EN grammar)
|
87
84
|
|
88
85
|
## License
|
89
86
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
@@ -20,11 +20,14 @@
|
|
20
20
|
}
|
21
21
|
.browser-warrior-dialog {
|
22
22
|
position: absolute;
|
23
|
-
top: 20%;
|
24
23
|
left: 50%;
|
25
24
|
margin-left: -340px;
|
25
|
+
top: 50%;
|
26
|
+
margin-top: -230px;
|
26
27
|
padding: 40px;
|
27
28
|
background: #FAFAFA;
|
29
|
+
width: 665px;
|
30
|
+
height: 380px;
|
28
31
|
}
|
29
32
|
.browser-warrior-title {
|
30
33
|
font-size: 20px;
|
@@ -8,36 +8,36 @@
|
|
8
8
|
<div class="browser-warrior-mask">
|
9
9
|
<div class="browser-warrior-dialog" id="browser-warrior-dialog">
|
10
10
|
<div class="browser-warrior-text">
|
11
|
-
<h1 class="browser-warrior-title">
|
11
|
+
<h1 class="browser-warrior-title">Unsupported Browser Detected</h1>
|
12
12
|
<p class="browser-warrior-para">
|
13
|
-
This
|
13
|
+
This website has been built using modern HTML standards. The current browser will not interpret the page correctly and introduce layout descrepencies with text and images.
|
14
14
|
</p>
|
15
15
|
<p class="browser-warrior-para">
|
16
|
-
|
16
|
+
In addition to our website not behaving as intented, out-of-date browsers often have exploitable security issues.
|
17
17
|
</p>
|
18
18
|
<p class="browser-warrior-para">
|
19
|
-
|
19
|
+
Please use a browser supported by this website:
|
20
20
|
</p>
|
21
21
|
<div class="browser-warrior-para">
|
22
|
-
<a class="browser-warrior-browser-link" href="https://www.google.com/search?q=chrome" target="_blank" hidefocus>
|
22
|
+
<a class="browser-warrior-browser-link" href="https://www.google.com/search?q=google+chrome+browser" target="_blank" hidefocus>
|
23
23
|
<i class="browser-warrior-browser-icon browser-warrior-browser-icon-chrome"></i>
|
24
|
-
Chrome Browser
|
24
|
+
Google Chrome Browser
|
25
25
|
</a>
|
26
|
-
<a class="browser-warrior-browser-link" href="https://www.google.com/search?q=firefox" target="_blank" hidefocus>
|
26
|
+
<a class="browser-warrior-browser-link" href="https://www.google.com/search?q=mozilla+firefox+browser" target="_blank" hidefocus>
|
27
27
|
<i class="browser-warrior-browser-icon browser-warrior-browser-icon-firefox"></i>
|
28
|
-
Firefox Browser
|
28
|
+
Mozilla Firefox Browser
|
29
29
|
</a>
|
30
|
-
<a class="browser-warrior-browser-link" href="https://www.google.com/search?q=opera" target="_blank" hidefocus>
|
30
|
+
<a class="browser-warrior-browser-link" href="https://www.google.com/search?q=opera+browser" target="_blank" hidefocus>
|
31
31
|
<i class="browser-warrior-browser-icon browser-warrior-browser-icon-opera"></i>
|
32
32
|
Opera Browser
|
33
33
|
</a>
|
34
|
-
<a class="browser-warrior-browser-link" href="https://www.google.com/search?q=
|
34
|
+
<a class="browser-warrior-browser-link" href="https://www.google.com/search?q=microsoft+browser" target="_blank" hidefocus>
|
35
35
|
<i class="browser-warrior-browser-icon browser-warrior-browser-icon-ie"></i>
|
36
|
-
|
36
|
+
Microsoft Edge/IE Browsers
|
37
37
|
</a>
|
38
38
|
</div>
|
39
39
|
<p class="browser-warrior-para">
|
40
|
-
|
40
|
+
After updating you will no longer see this page.
|
41
41
|
</p>
|
42
42
|
</div>
|
43
43
|
</div>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: browser_warrior
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- yafeilee
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|