arcabouco 0.1.6 → 0.1.7
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 +4 -4
- data/lib/arcabouco/server.rb +6 -1
- data/lib/arcabouco/version.rb +1 -1
- data/lib/templates/index.html.erb +8 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a414f3cf2934a272cae4064adf7f91e424ccc691
|
4
|
+
data.tar.gz: 93568dd13aef228db774fa0659d2acd576e4100d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1d946274b0385a017e503e0d3d5b428eb255be6ec568382a66a0c16fff9b117516827efc21cce71689e53173c4a0ad8051992f587e77cb310198fb46739191f
|
7
|
+
data.tar.gz: beeb5fe024c58438317eb9ff161cf91c71f1e1741d458b4ea0d05c763f0cf9387be26f3e9ab14a506d9bec05d90066ce7065d9dd7b1b17f09cdb7ab4158155d1
|
data/lib/arcabouco/server.rb
CHANGED
@@ -46,7 +46,12 @@ module Arcabouco
|
|
46
46
|
end
|
47
47
|
|
48
48
|
def content_for_index
|
49
|
-
|
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
|
data/lib/arcabouco/version.rb
CHANGED
@@ -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*
|
116
|
+
}, 10*60*1000);
|
113
117
|
|
114
118
|
}).appendTo('head')[0]
|
115
119
|
});
|