You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by ru...@apache.org on 2016/07/31 13:31:15 UTC
[whimsy] branch master updated (62cd170 -> 63f06ea)
This is an automated email from the ASF dual-hosted git repository.
rubys pushed a change to branch master
in repository https://git-dual.apache.org/repos/asf/whimsy.git.
from 62cd170 rough in service workers; disabled for now
new 978782b cleanup
new 63f06ea add mtime to app.js; prep for expires header
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "adds" were already present in the repository and have only
been added to this reference.
Summary of changes:
www/board/agenda/routes.rb | 1 +
www/board/agenda/views/bootstrap.html.rb | 2 +-
www/board/agenda/views/main.html.rb | 2 +-
www/board/agenda/views/sw.js.rb | 20 ++++++++------------
4 files changed, 11 insertions(+), 14 deletions(-)
--
To stop receiving notification emails like this one, please contact
['"commits@whimsical.apache.org" <co...@whimsical.apache.org>'].
[whimsy] 02/02: add mtime to app.js; prep for expires header
Posted by ru...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rubys pushed a commit to branch master
in repository https://git-dual.apache.org/repos/asf/whimsy.git
commit 63f06ea70a54daab7c0faf2e67c0bd6be8a48031
Author: Sam Ruby <ru...@intertwingly.net>
AuthorDate: Sun Jul 31 09:30:00 2016 -0400
add mtime to app.js; prep for expires header
---
www/board/agenda/routes.rb | 1 +
www/board/agenda/views/bootstrap.html.rb | 2 +-
www/board/agenda/views/main.html.rb | 2 +-
3 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/www/board/agenda/routes.rb b/www/board/agenda/routes.rb
index a980a89..b5edef2 100755
--- a/www/board/agenda/routes.rb
+++ b/www/board/agenda/routes.rb
@@ -113,6 +113,7 @@ get %r{/(\d\d\d\d-\d\d-\d\d)/(.*)} do |date, path|
@page[:minutes] = YAML.load(File.read(minutes)) if File.exist? minutes
@cssmtime = File.mtime('public/stylesheets/app.css').to_i
+ @appmtime = Wunderbar::Asset.convert("#{settings.views}/app.js.rb").mtime.to_i
if path == 'bootstrap.html'
@page[:parsed] = [@page[:parsed].first]
diff --git a/www/board/agenda/views/bootstrap.html.rb b/www/board/agenda/views/bootstrap.html.rb
index 3ebe956..a5abdf0 100644
--- a/www/board/agenda/views/bootstrap.html.rb
+++ b/www/board/agenda/views/bootstrap.html.rb
@@ -12,7 +12,7 @@ _html do
_footer
end
- _script src: '../app.js', lang: 'text/javascript'
+ _script src: "../app.js?#{@appmtime}", lang: 'text/javascript'
_script %{
React.render(React.createElement(Main,
#{JSON.generate(server: @server, page: @page)}),
diff --git a/www/board/agenda/views/main.html.rb b/www/board/agenda/views/main.html.rb
index e2b4280..cec3b8f 100644
--- a/www/board/agenda/views/main.html.rb
+++ b/www/board/agenda/views/main.html.rb
@@ -10,7 +10,7 @@ _html do
_div_.main!
- _script src: '../app.js'
+ _script src: "../app.js?#{@appmtime}", lang: 'text/javascript'
_.render '#main' do
_Main server: @server, page: @page
end
--
To stop receiving notification emails like this one, please contact
"commits@whimsical.apache.org" <co...@whimsical.apache.org>.
[whimsy] 01/02: cleanup
Posted by ru...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rubys pushed a commit to branch master
in repository https://git-dual.apache.org/repos/asf/whimsy.git
commit 978782b866ebb563e5d9d40e5592ec755e87a692
Author: Sam Ruby <ru...@intertwingly.net>
AuthorDate: Fri Jul 29 09:43:04 2016 -0400
cleanup
---
www/board/agenda/views/sw.js.rb | 20 ++++++++------------
1 file changed, 8 insertions(+), 12 deletions(-)
diff --git a/www/board/agenda/views/sw.js.rb b/www/board/agenda/views/sw.js.rb
index b69fcc1..b7c5122 100644
--- a/www/board/agenda/views/sw.js.rb
+++ b/www/board/agenda/views/sw.js.rb
@@ -1,16 +1,14 @@
#
# A very simple service worker
#
-# 1) Return back cached bootstrap page instead of fetching agenda pages
-# from the network. Bootstrap will construct page from cached
-# agenda.json, as well as updating the cache.
+# 1) Create an event source and pass all events received to all clients
#
-# 2) For all other pages, serve cached content when offline
+# 2) Return back cached bootstrap page instead of fetching agenda pages
+# from the network. Bootstrap will construct page from cached
+# agenda.json, as well as update the cache.
#
-
-# polyfill if necessary
-window = self
-importScripts 'assets/eventsource.min.js' unless defined? EventSource
+# 3) For all other pages, serve cached content when offline
+#
events = nil
@@ -47,7 +45,6 @@ self.addEventListener :fetch do |event|
caches.open('board/agenda').then do |cache|
date = url.split('/')[0]
return cache.match("#{date}/bootstrap.html").then do |response|
- console.log response
return response || fetch(event.request.url, credentials: 'include')
end
end
@@ -55,9 +52,8 @@ self.addEventListener :fetch do |event|
else
event.respondWith(
fetch(event.request, credentials: 'include').catch do |error|
- caches.open('board/agenda').then do |cache|
- return cache.match(event.request.url) do |response|
- console.log response
+ return caches.open('board/agenda').then do |cache|
+ return cache.match(event.request) do |response|
return response || error
end
end
--
To stop receiving notification emails like this one, please contact
"commits@whimsical.apache.org" <co...@whimsical.apache.org>.