sprockets-preload 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a34bd32e5ecddbb1711c74b6b83ed2d614cc4ae5
4
- data.tar.gz: 9f6475b44ff8e1a926d7f1dd8bcc469420fa23a5
3
+ metadata.gz: 45f0a6d6d7ec678e7d785146a05cdc88ffcf22e0
4
+ data.tar.gz: aebed604cab1b988ee830d26b890660d58c4fed7
5
5
  SHA512:
6
- metadata.gz: e23cf927ad5a8e08a6f08f30659e4c95904b63995fa0d57a7ee01912089d604d4bec0246c15382c3f472de66c4f4d1486353a849c72b66f50a256f7ee9f3b1c5
7
- data.tar.gz: baf5c63c43417aa11882d59a7ac3e4ef15fc49c34da2485c114d078cd49b4d5158ec50549a414ba90c945590730fd3267f3a58cfe26ff267f602012526741196
6
+ metadata.gz: 858a0a0c7d2f807b05f518fe8d72a0b41929d42cb302a321fb551c8c88fd2df63780009a521984b64cf52f040e0d3e5b7d42ca810d5a2cb94107373500a834be
7
+ data.tar.gz: 6ddc6e4e57f0488afb9870b124281e3635d455b0b1d3de4220e18a1bea8c9fb195b28317f2d65fe325bd3d16841dfaf67a20959d585e73f68ca7cdb76009206a
data/README.md CHANGED
@@ -17,8 +17,10 @@ Imagine that you are riding on Rails and have the following `application.js` whe
17
17
  //= include jquery-ui
18
18
  //= include front
19
19
 
20
- // Starting application
21
- $ -> Front.start()
20
+ $(function(){
21
+ // Starting application
22
+ Front.start();
23
+ });
22
24
  ```
23
25
 
24
26
  Let's make user experience smooth:
@@ -33,8 +35,10 @@ Let's make user experience smooth:
33
35
  //= preload jquery-ui
34
36
  //= preload front
35
37
 
36
- // Starting application
37
- $ -> Front.start()
38
+ $(function(){
39
+ // Starting application
40
+ Front.start();
41
+ });
38
42
  ```
39
43
 
40
44
  3. Delay initialization to the moment when detached assets are loaded:
@@ -47,7 +51,7 @@ Let's make user experience smooth:
47
51
 
48
52
  SprocketsPreload.success = function() {
49
53
  // Starting application
50
- $ -> Front.start()
54
+ Front.start();
51
55
  }
52
56
  ```
53
57
 
@@ -61,7 +65,7 @@ Let's make user experience smooth:
61
65
 
62
66
  SprocketsPreload.success = function() {
63
67
  // Starting application
64
- $ -> Front.start()
68
+ Front.start();
65
69
  }
66
70
 
67
71
  SprocketsPreload.progress = function(percent) {
@@ -82,7 +86,7 @@ Let's make user experience smooth:
82
86
 
83
87
  SprocketsPreload.success = function() {
84
88
  // Starting application
85
- $ -> Front.start()
89
+ Front.start();
86
90
  }
87
91
 
88
92
  SprocketsPreload.progress = function(percent) {
@@ -115,7 +119,7 @@ SprocketsPreload.localStorage = false;
115
119
 
116
120
  SprocketsPreload.success = function() {
117
121
  // Starting application
118
- $ -> Front.start()
122
+ Front.start();
119
123
  }
120
124
 
121
125
  SprocketsPreload.progress = function(percent) {
@@ -141,4 +145,4 @@ SprocketsPreload.progress = function(percent) {
141
145
 
142
146
  ## License
143
147
 
144
- It is free software, and may be redistributed under the terms of MIT license.
148
+ It is free software, and may be redistributed under the terms of MIT license.
@@ -52,8 +52,11 @@
52
52
  # Loads asset using localStorage as a manual cache
53
53
  #
54
54
  loadCached: (url, version, size) ->
55
- attempt = localStorage['sprockets-preload']
56
- attempt = JSON.parse(attempt) if attempt
55
+ try
56
+ attempt = localStorage['sprockets-preload']
57
+ attempt = JSON.parse(attempt) if attempt
58
+ catch
59
+ delete localStorage['sprockets-preload']
57
60
 
58
61
  if attempt?.version == version
59
62
  @inject defer: true, text: attempt.source
@@ -9,7 +9,7 @@ module Sprockets
9
9
  Sprockets::Preload.environment = app.assets
10
10
  Sprockets::Preload.precompiles = app.config.assets.precompile
11
11
 
12
- app.config.assets.precompile += ['sprockets/preload/assets', 'sprockets/preload/load']
12
+ app.config.assets.precompile += ['sprockets/preload/assets.js']
13
13
  end
14
14
  end
15
15
  end
@@ -1,5 +1,5 @@
1
1
  module Sprockets
2
2
  module Preload
3
- VERSION = "0.0.3"
3
+ VERSION = "0.0.4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sprockets-preload
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Boris Staal
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-11 00:00:00.000000000 Z
11
+ date: 2013-08-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sprockets