rack-no_animations 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rack/no_animations.rb +3 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b4eb8d8ef4c9cf73e1849a2e8be4bd547be5f39
|
4
|
+
data.tar.gz: 5ecbe5692d98d399e8a18fe083b7a8fed3fefbb2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da261c1feceeaa238cb2be4cda631a787ad59b6d18b64eaaab3aa0ad34d96bdb422bc6fd970f6ef676fbc7fec979fe074f8c18fcdb0231f6dff356f2a549f4de
|
7
|
+
data.tar.gz: 6704424a9b0ac82cab846f9020bd7f1fa6f42a216a85d6fb984b5abc9039109f90ab508cb7fa8aef242f72f09bf6ce669fa08c2cd1b838d477ef0673a20f2045
|
data/lib/rack/no_animations.rb
CHANGED
@@ -3,7 +3,7 @@ module Rack
|
|
3
3
|
TEXT_HTML = %r{text/html}.freeze
|
4
4
|
CONTENT_LENGTH = 'Content-Length'.freeze
|
5
5
|
|
6
|
-
DISABLE_ANIMATIONS_SNIPPET = <<-EOF
|
6
|
+
DISABLE_ANIMATIONS_SNIPPET = <<-EOF.strip
|
7
7
|
<script>if (typeof jQuery !== 'undefined') { jQuery.fx.off = true }</script>
|
8
8
|
<style>
|
9
9
|
* {
|
@@ -24,7 +24,7 @@ module Rack
|
|
24
24
|
animation: none !important;
|
25
25
|
}
|
26
26
|
</style>
|
27
|
-
|
27
|
+
EOF
|
28
28
|
SNIPPET_LENGTH = DISABLE_ANIMATIONS_SNIPPET.length
|
29
29
|
|
30
30
|
def initialize(app)
|
@@ -69,7 +69,7 @@ module Rack
|
|
69
69
|
end
|
70
70
|
|
71
71
|
if (body_index = body.rindex('</body>'.freeze))
|
72
|
-
body.insert(body_index
|
72
|
+
body.insert(body_index, DISABLE_ANIMATIONS_SNIPPET)
|
73
73
|
end
|
74
74
|
|
75
75
|
[ body_index, [ body ] ]
|