arcabouco 0.2.1 → 0.2.2

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: 80cb888b4be443d4b22f15fbb3dbbe5e0107e734
4
- data.tar.gz: f0e8eeddc1979d7c8a5d5d3011ef5c3501e10d21
3
+ metadata.gz: 26949f5548e7ebf98d33f8a306c0eddb4bd554d5
4
+ data.tar.gz: e544ff7a626d43f1444b28a8b441d5ddd61149bd
5
5
  SHA512:
6
- metadata.gz: 7a819d4822c785ded6d14ee9fb6db51fdcaf07e64e8b258478da3d28bf357fa47f0700c5caa721a8790bd127a4a3e9f114d5495401cc949f23289abca2026472
7
- data.tar.gz: d1587804498b4faab776e23541ef0a26722576d499729b1c3e027e4add87840438b1205a7541a780f4ced3adb5b26a58bad62da93263ec524cad4bd4b08c1afe
6
+ metadata.gz: bf1cf0c9530e31954276254d21c7907e823f61add8cfe0e6937580a556bcee179fb35fcecce842aa3c62f498eb6da71245d183ceab88b2851371e87e89b1c1f3
7
+ data.tar.gz: 4d8424ff96fd2a5b3405b18d21c9cd726995ece3458e12aa657f646a9259e9295b95efed7614bf78750eca21637815000920749cafe8511382cad43eb03a7398
@@ -1,3 +1,3 @@
1
1
  module Arcabouco
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
@@ -8,7 +8,7 @@ app.module_ready = (name) ->
8
8
 
9
9
  app.load_modules = ->
10
10
  for module,status of app._bootstrap_list
11
- return if status == 1
11
+ return if status == false
12
12
 
13
13
  app.debug 'Loaded modules: '
14
14
  for name of app._bootstrap_list
@@ -29,5 +29,5 @@ app.boot = ->
29
29
  if app.document_domain
30
30
  document.domain = app.document_domain
31
31
 
32
- app._bootstrap_list_loader = setInterval( @load_modules, 250 )
32
+ app._bootstrap_list_loader = setInterval( app.load_modules, 250 )
33
33
  app.load_modules()
@@ -26,8 +26,20 @@ function _loadCSS(src)
26
26
  document.head.appendChild(css);
27
27
  }
28
28
 
29
+ function checkLastUpdate()
30
+ {
31
+ // Fix to browser finding new content
32
+ _lastUpdate = Math.ceil( app._lastUpdate/1000 );
33
+ _currentUpdate = Math.ceil( (new Date()).getTime()/1000 );
34
+ if (app.enable_debug) console.log("DEBUG: Last Update: " + _lastUpdate);
35
+ if (_lastUpdate+5 < _currentUpdate) return false;
36
+ app._lastUpdate = (new Date()).getTime();
37
+ return true;
38
+ }
39
+
29
40
  function bootstrapApplication()
30
41
  {
42
+ if (!checkLastUpdate()) return;
31
43
  if (app.bootstraped) return;
32
44
  if (app.enable_debug) console.log("DEBUG: Bootstrap Application. Manifest (" + app.assets_manifest + ")");
33
45
  _getJSON( app.assets_manifest, function(data) {
@@ -52,13 +64,6 @@ function updateApplicationDownloadProgress(progress)
52
64
 
53
65
  function refreshApplicationFiles()
54
66
  {
55
- // Fix to browser finding new content
56
- _lastUpdate = Math.ceil( app._lastUpdate/1000 );
57
- _currentUpdate = Math.ceil( (new Date()).getTime()/1000 );
58
- if (app.enable_debug) console.log("DEBUG: Last Update: " + _lastUpdate);
59
- if (_lastUpdate+5 < _currentUpdate) return;
60
- app._lastUpdate = _currentUpdate;
61
-
62
67
  app.applicationCache.swapCache();
63
68
  if (app.bootstraped == false) {
64
69
  bootstrapApplication();
@@ -81,6 +86,7 @@ appcache_frame.onload = function() {
81
86
  app.applicationCache.addEventListener('progress', function(e) { updateApplicationDownloadProgress(e); }, false);
82
87
 
83
88
  setInterval(function() {
89
+ if (!checkLastUpdate()) return;
84
90
  if (app.enable_debug) console.log("DEBUG: Checking for new assets");
85
91
  app.applicationCache.update();
86
92
  }, 10*60*1000);
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arcabouco
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrick Negri