add-to-homescreen-rails 3.2.1 → 3.2.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 15128b93ff8bc2e92ea90be5809cc57085d200a4
4
- data.tar.gz: 8f928ffe1c38e339a9b24808e9705f21dc8194b2
3
+ metadata.gz: 6dab9353915aa8e07043e03182d2c9d1a86287a5
4
+ data.tar.gz: 8901363108e4f4a4804128234bc2c3f9f3898408
5
5
  SHA512:
6
- metadata.gz: e72be9f8de85328f90df6abc0139fad1b6e0d1d93b0a86b52206cefae4eb37b2aec15f162db5951657a7a221c9d9c2153a4f16285f2dfe79460b3034fe7a5c0d
7
- data.tar.gz: b2d0bfcaa657cf45073ce88be5ccfb4ab118f231649942a34b69dc15ce4e2ae64f5571dc41d3cc93c5656244b07864ac798fdd9cf284ad52944a907a4fc5b71d
6
+ metadata.gz: 50359b42ffa711be9cb3fcb7d611050b04bd5d7fb44673067ef0d849a70ca83c16e5992711b06719717828d39f37b8914c072928df201ec1dc5a3e6da23b0249
7
+ data.tar.gz: 16ebcbcfd73b76071ebe300a5b939f047bdb7d0089cfeb6326e5dfdb8cdd2e4140a427d3c81785909df729858a2a2d8acf28a16ddf3d028e82628bd0a26c71df
@@ -1,4 +1,4 @@
1
- /* Add to Homescreen v3.2.1 ~ (c) 2015 Matteo Spinelli ~ @license: http://cubiq.org/license */
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
- localStorage.setItem(this.options.appID, JSON.stringify(this.session));
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
@@ -2,7 +2,7 @@ module Add
2
2
  module To
3
3
  module Homescreen
4
4
  module Rails
5
- VERSION = "3.2.1"
5
+ VERSION = "3.2.2"
6
6
  end
7
7
  end
8
8
  end
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.1
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-05-21 00:00:00.000000000 Z
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: