arcabouco 0.1.6 → 0.1.7

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: 7a93e0f420aa15cdfaab193a0e49d8243ada1d9a
4
- data.tar.gz: 0e1af6c521d2d9391e2794cbd785c1eaa85c42be
3
+ metadata.gz: a414f3cf2934a272cae4064adf7f91e424ccc691
4
+ data.tar.gz: 93568dd13aef228db774fa0659d2acd576e4100d
5
5
  SHA512:
6
- metadata.gz: 6a2761add2a5ee124029411b45da5e5b8de4954379b70d65d89303c13e229fee688d6c54fb76cc76c92cbe8e3441d5600d3e175ab631c66be019ce35ca59fd9c
7
- data.tar.gz: 4dded12e42f5b99bd618215bb4f9b4cc6a32ae4059d03c745a2f7b77f49f32585793f7e4362e0d025294558e84d90226cee8a6632f947ce988d985c03f6e0a46
6
+ metadata.gz: a1d946274b0385a017e503e0d3d5b428eb255be6ec568382a66a0c16fff9b117516827efc21cce71689e53173c4a0ad8051992f587e77cb310198fb46739191f
7
+ data.tar.gz: beeb5fe024c58438317eb9ff161cf91c71f1e1741d458b4ea0d05c763f0cf9387be26f3e9ab14a506d9bec05d90066ce7065d9dd7b1b17f09cdb7ab4158155d1
@@ -46,7 +46,12 @@ module Arcabouco
46
46
  end
47
47
 
48
48
  def content_for_index
49
- erb :"#{relative_to}/index.html", locals: { :assets => $environment, :application_name => Arcabouco.application_name}, layout: false, cache: false
49
+ application_preload_html = ""
50
+ application_preloader_filename = File.join Arcabouco.root, 'app', 'templates', 'application_preloader.html'
51
+ if File.file?(application_preloader_filename)
52
+ application_preload_html = File.read application_preloader_filename
53
+ end
54
+ erb :"#{relative_to}/index.html", locals: { :assets => $environment, :application_name => Arcabouco.application_name, :application_preload_html => application_preload_html}, layout: false, cache: false
50
55
  end
51
56
 
52
57
  get '/save_app.html' do
@@ -1,3 +1,3 @@
1
1
  module Arcabouco
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
@@ -15,6 +15,7 @@
15
15
  <noscript>
16
16
  <div class='js-warning'></div>
17
17
  </noscript>
18
+ <div id="application_preload_layer" style="position:absolute;top:0px;right:0px;left:0px;bottom:0px"><%= application_preload_html %></div>
18
19
  <div id='app'></div>
19
20
 
20
21
  <script type="text/javascript">
@@ -67,14 +68,16 @@
67
68
  {
68
69
  if (app.bootstraped) return;
69
70
  app.bootstraped = true;
70
- console.log("START");
71
+ console.log("START UPDATED");
71
72
  console.log("FETCH " + app.assets_manifest );
72
73
  jQuery.getJSON( app.assets_manifest, function(data) {
73
74
  $('head').append('<link rel="stylesheet" href="/app.assets/' + data.assets["vendor.css"] + '" type="text/css" />');
74
75
  $('head').append('<link rel="stylesheet" href="/app.assets/' + data.assets["app.css"] + '" type="text/css" />');
75
76
  addScriptTag( data.assets['vendor.js'], function() {
76
77
  // After vendor is loaded. Start application
77
- addScriptTag( data.assets['app.js'] );
78
+ addScriptTag( data.assets['app.js'], function() {
79
+ $('#application_preload_layer').remove();
80
+ });
78
81
  });
79
82
  });
80
83
  }
@@ -87,8 +90,8 @@
87
90
 
88
91
  function refreshApplicationFiles()
89
92
  {
93
+ app.applicationCache.swapCache();
90
94
  if (app.bootstraped == false) {
91
- app.applicationCache.swapCache();
92
95
  bootstrapApplication();
93
96
  }
94
97
  else {
@@ -103,13 +106,14 @@
103
106
  app.applicationCache = appcache_frame.contentWindow.applicationCache;
104
107
 
105
108
  app.applicationCache.addEventListener('noupdate', bootstrapApplication, false);
109
+ app.applicationCache.addEventListener('cached', bootstrapApplication, false);
106
110
  app.applicationCache.addEventListener('updateready', refreshApplicationFiles, false);
107
111
  app.applicationCache.addEventListener('progress', function(e) { updateApplicationDownloadProgress(e); }, false);
108
112
 
109
113
  setInterval(function() {
110
114
  console.log("Checking for new versions");
111
115
  app.applicationCache.update();
112
- }, 60*5*1000);
116
+ }, 10*60*1000);
113
117
 
114
118
  }).appendTo('head')[0]
115
119
  });
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.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrick Negri