add-to-homescreen-rails 3.2.1 → 3.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/addtohomescreen.js +16 -2
- data/lib/add-to-homescreen-rails/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: 6dab9353915aa8e07043e03182d2c9d1a86287a5
|
4
|
+
data.tar.gz: 8901363108e4f4a4804128234bc2c3f9f3898408
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50359b42ffa711be9cb3fcb7d611050b04bd5d7fb44673067ef0d849a70ca83c16e5992711b06719717828d39f37b8914c072928df201ec1dc5a3e6da23b0249
|
7
|
+
data.tar.gz: 16ebcbcfd73b76071ebe300a5b939f047bdb7d0089cfeb6326e5dfdb8cdd2e4140a427d3c81785909df729858a2a2d8acf28a16ddf3d028e82628bd0a26c71df
|
@@ -1,4 +1,4 @@
|
|
1
|
-
/* Add to Homescreen v3.2.
|
1
|
+
/* Add to Homescreen v3.2.2 ~ (c) 2015 Matteo Spinelli ~ @license: http://cubiq.org/license */
|
2
2
|
(function (window, document) {
|
3
3
|
/*
|
4
4
|
_ _ _____ _____
|
@@ -203,6 +203,10 @@ var _defaultSession = {
|
|
203
203
|
|
204
204
|
ath.removeSession = function (appID) {
|
205
205
|
try {
|
206
|
+
if (!localStorage) {
|
207
|
+
throw new Error('localStorage is not defined');
|
208
|
+
}
|
209
|
+
|
206
210
|
localStorage.removeItem(appID || ath.defaults.appID);
|
207
211
|
} catch (e) {
|
208
212
|
// we are most likely in private mode
|
@@ -270,6 +274,10 @@ ath.Class = function (options) {
|
|
270
274
|
|
271
275
|
// check if we can use the local storage
|
272
276
|
try {
|
277
|
+
if (!localStorage) {
|
278
|
+
throw new Error('localStorage is not defined');
|
279
|
+
}
|
280
|
+
|
273
281
|
localStorage.setItem(this.options.appID, JSON.stringify(this.session));
|
274
282
|
ath.hasLocalStorage = true;
|
275
283
|
} catch (e) {
|
@@ -643,7 +651,9 @@ ath.Class.prototype = {
|
|
643
651
|
return;
|
644
652
|
}
|
645
653
|
|
646
|
-
|
654
|
+
if (localStorage) {
|
655
|
+
localStorage.setItem(this.options.appID, JSON.stringify(this.session));
|
656
|
+
}
|
647
657
|
},
|
648
658
|
|
649
659
|
clearSession: function () {
|
@@ -653,6 +663,10 @@ ath.Class.prototype = {
|
|
653
663
|
|
654
664
|
getItem: function(item) {
|
655
665
|
try {
|
666
|
+
if (!localStorage) {
|
667
|
+
throw new Error('localStorage is not defined');
|
668
|
+
}
|
669
|
+
|
656
670
|
return localStorage.getItem(item);
|
657
671
|
} catch(e) {
|
658
672
|
// Preventing exception for some browsers when fetching localStorage key
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: add-to-homescreen-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.2.
|
4
|
+
version: 3.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- RogerE
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-06-01 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Provides the 'Add to Home screen' assets for your Rails application.
|
14
14
|
email:
|