responsive_image_tag 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.5
|
@@ -1,23 +1,26 @@
|
|
1
1
|
/*jslint browser:true */
|
2
2
|
/*global $, $$*/
|
3
3
|
|
4
|
-
//responsiveImageTag detects all noscript elements on the page with a class
|
4
|
+
// responsiveImageTag detects all <noscript> elements on the page with a class
|
5
|
+
// of 'responsivize'.
|
5
6
|
|
6
|
-
//It retrieves both HTML5 data attributes and then creates an image tag with
|
7
|
-
//destination depending on the available screen width of
|
8
|
-
//images are sent to mobile devices or
|
7
|
+
// It retrieves both HTML5 data attributes and then creates an image tag with
|
8
|
+
// the correct source destination depending on the available screen width of
|
9
|
+
// the user's device. This way smaller images are sent to mobile devices or
|
10
|
+
// any device smaller than 768px.
|
9
11
|
|
10
|
-
//The noscript tags are then removed from the page.
|
12
|
+
// The <noscript> tags are then removed from the page.
|
11
13
|
var responsiveImageTag = {
|
12
14
|
|
13
15
|
replaceInitialImages:function() {
|
14
16
|
var platform = "desktop";
|
15
|
-
var responsiveImages =
|
17
|
+
var responsiveImages = $(".responsivize");
|
16
18
|
var i,
|
17
19
|
noOfresponsiveImages = responsiveImages.length;
|
18
20
|
|
19
|
-
|
20
|
-
|
21
|
+
// Test for available width in current browser window
|
22
|
+
// 767px, anything smaller than an ipad is considered mobile
|
23
|
+
if(screen.width <= 767){
|
21
24
|
platform = "mobile";
|
22
25
|
}
|
23
26
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: responsive_image_tag
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 29
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 5
|
10
|
+
version: 0.2.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Dave Hrycyszyn
|