arcabouco 0.2.5 → 0.2.6

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: b35b81746cde5c25c6e9d760931717efb1843c3b
4
- data.tar.gz: e6585f6ea9a6d9822f40650c60197da944e85491
3
+ metadata.gz: be421103c9cf9a95c59cd174cda8e9b09269a398
4
+ data.tar.gz: 042901e2b6a15d0ab33ec759ffaabbe7a33135cb
5
5
  SHA512:
6
- metadata.gz: 4882ed9feab72241affaeedadcfba4107bf2ef1db7416bb2ce6c4aaaadf17ef0d0a70619c425b9823c7dbb9634df79d3fad10cdf477da826fd8038b588ca3a36
7
- data.tar.gz: 909ee2baa5eba523e425c4fdc4f44a0759a4585a1a1125be218552a57942a4c54acdf7d9e655018f28cb02c9fcc5616d87ca019ffbc6b8b809942518fb04b407
6
+ metadata.gz: 2fc30a75066b748a0d9ced26fa9a164f4d099f770688c600318bb6dc3af8bae83a95d1afe423f5d94744802e55b4245d97c0ff487c696d098f8ffb032887e9fd
7
+ data.tar.gz: d79f0b8df783f8a15f6f1d024ba62d64d5b061dff1336474d713e972867c3f30bf0c65a005af24507e729f8c605ad16c51e0f5f2325673f04bf99a7ef3a6c393
@@ -1,3 +1,3 @@
1
1
  module Arcabouco
2
- VERSION = "0.2.5"
2
+ VERSION = "0.2.6"
3
3
  end
@@ -1,4 +1,5 @@
1
- app._lastUpdate = (new Date()).getTime();
1
+ app.bootstraping = false;
2
+ app.bootstraped = false;
2
3
 
3
4
  function _getJSON(url,callback) {
4
5
  var xobj = new XMLHttpRequest();
@@ -26,21 +27,13 @@ function _loadCSS(src)
26
27
  document.head.appendChild(css);
27
28
  }
28
29
 
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
-
40
30
  function bootstrapApplication()
41
31
  {
42
- if (!checkLastUpdate()) return;
32
+ if (app.bootstraping) return;
43
33
  if (app.bootstraped) return;
34
+
35
+ app.bootstraping = true;
36
+
44
37
  if (app.enable_debug) console.log("DEBUG: Bootstrap Application. Manifest (" + app.assets_manifest + ")");
45
38
  _getJSON( app.assets_manifest, function(data) {
46
39
  _loadCSS( data.assets['app.vendor.css'] );
@@ -48,6 +41,7 @@ function bootstrapApplication()
48
41
  _loadJS( data.assets['app.vendor.js'], function() {
49
42
  _loadJS( data.assets['app.js'], function() {
50
43
  app.boot();
44
+ app.bootstraping = false;
51
45
  app.bootstraped = true;
52
46
  var el = document.getElementById('application_preload_layer');
53
47
  el.parentNode.removeChild(el);
@@ -58,7 +52,6 @@ function bootstrapApplication()
58
52
 
59
53
  function updateApplicationDownloadProgress(progress)
60
54
  {
61
- if (app.bootstraped) return;
62
55
  if (app.enable_debug) console.log("DEBUG: Detected new asset");
63
56
  }
64
57
 
@@ -86,9 +79,9 @@ appcache_frame.onload = function() {
86
79
  app.applicationCache.addEventListener('progress', function(e) { updateApplicationDownloadProgress(e); }, false);
87
80
 
88
81
  setInterval(function() {
89
- if (!checkLastUpdate()) return;
90
82
  if (app.enable_debug) console.log("DEBUG: Checking for new assets");
91
83
  app.applicationCache.update();
84
+ bootstrapApplication();
92
85
  }, 10*60*1000);
93
86
  }
94
87
  document.head.appendChild( appcache_frame );
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arcabouco
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrick Negri
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-13 00:00:00.000000000 Z
11
+ date: 2016-06-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -326,7 +326,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
326
326
  version: '0'
327
327
  requirements: []
328
328
  rubyforge_project: arcabouco
329
- rubygems_version: 2.4.5.1
329
+ rubygems_version: 2.4.3
330
330
  signing_key:
331
331
  specification_version: 4
332
332
  summary: Arcabouco WebApp Framework