whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ru...@apache.org
Subject [whimsy] branch master updated: forward event data, not the event itself
Date Sun, 31 Jul 2016 13:31:30 GMT
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

The following commit(s) were added to refs/heads/master by this push:
       new  d46279f   forward event data, not the event itself
d46279f is described below

commit d46279f33d354345a56f5652b7f6ed18caa2a1ab
Author: Sam Ruby <rubys@intertwingly.net>
AuthorDate: Sun Jul 31 09:31:11 2016 -0400

    forward event data, not the event itself
---
 www/board/agenda/views/models/pagecache.js.rb | 5 ++---
 www/board/agenda/views/sw.js.rb               | 2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/www/board/agenda/views/models/pagecache.js.rb b/www/board/agenda/views/models/pagecache.js.rb
index 44a9ee5..82d4303 100644
--- a/www/board/agenda/views/models/pagecache.js.rb
+++ b/www/board/agenda/views/models/pagecache.js.rb
@@ -13,7 +13,6 @@ class PageCache
   def self.enabled
     # disable service workers for now.  See:
     # https://lists.w3.org/Archives/Public/public-webapps/2016JulSep/0016.html
-    return false 
 
     unless location.protocol == 'https:' or location.hostname == 'localhost'
       return false
@@ -33,9 +32,9 @@ class PageCache
     scope = URL.new('..', document.getElementsByTagName('base')[0].href)
     navigator.serviceWorker.register(scope + 'sw.js', scope)
 
-    # listen for events
+    # forward service worker events
     navigator.serviceWorker.addEventListener :message do |event|
-      Events.dispatch event
+      Events.dispatch event.data
     end
   end
 
diff --git a/www/board/agenda/views/sw.js.rb b/www/board/agenda/views/sw.js.rb
index b7c5122..12bac7b 100644
--- a/www/board/agenda/views/sw.js.rb
+++ b/www/board/agenda/views/sw.js.rb
@@ -49,7 +49,7 @@ self.addEventListener :fetch do |event|
         end
       end
     )
-  else
+  elsif false #disable for now
     event.respondWith(
       fetch(event.request, credentials: 'include').catch do |error|
         return caches.open('board/agenda').then do |cache|

-- 
To stop receiving notification emails like this one, please contact
['"commits@whimsical.apache.org" <commits@whimsical.apache.org>'].

Mime
View raw message