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 2017/10/04 17:19:51 UTC

[whimsy] branch master updated: prep for another run at service workers

This is an automated email from the ASF dual-hosted git repository.

rubys pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new 3242a70  prep for another run at service workers
3242a70 is described below

commit 3242a7047782c08d2e05804f79ef0742dc7f23d7
Author: Sam Ruby <ru...@intertwingly.net>
AuthorDate: Wed Oct 4 13:19:29 2017 -0400

    prep for another run at service workers
---
 www/board/agenda/daemon/session.rb       |  2 +-
 www/board/agenda/routes.rb               |  2 +-
 www/board/agenda/views/bootstrap.html.rb | 11 ++++-------
 www/board/agenda/views/layout/main.js.rb | 10 ++++++----
 4 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/www/board/agenda/daemon/session.rb b/www/board/agenda/daemon/session.rb
index d26f294..2bc705b 100644
--- a/www/board/agenda/daemon/session.rb
+++ b/www/board/agenda/daemon/session.rb
@@ -15,7 +15,7 @@ require 'whimsy/asf/config'
 # to additionally prevent concurrent updates.
 #
 # No direct use of timers, events, or threads are made allowing this
-# service to be used in a varienty of contexts (e.g. Sinatra and 
+# service to be used in a variety of contexts (e.g. Sinatra and 
 # EventMachine).
 #
 
diff --git a/www/board/agenda/routes.rb b/www/board/agenda/routes.rb
index a1fb5db..2ac68cb 100755
--- a/www/board/agenda/routes.rb
+++ b/www/board/agenda/routes.rb
@@ -170,7 +170,7 @@ get %r{/(\d\d\d\d-\d\d-\d\d)/(.*)} do |date, path|
   @appmtime = Wunderbar::Asset.convert("#{settings.views}/app.js.rb").mtime.to_i
 
   if path == 'bootstrap.html'
-    @page[:parsed] = [@page[:parsed].first]
+    @page[:parsed] = [{timestamp: @page[:parsed].first['timestamp']}]
     @page[:digest] = nil
     @page[:etag] = nil
     @server[:session] = nil
diff --git a/www/board/agenda/views/bootstrap.html.rb b/www/board/agenda/views/bootstrap.html.rb
index a5abdf0..905bbe6 100644
--- a/www/board/agenda/views/bootstrap.html.rb
+++ b/www/board/agenda/views/bootstrap.html.rb
@@ -7,15 +7,12 @@ _html do
   _link rel: 'stylesheet', href: "../stylesheets/app.css?#{@cssmtime}"
   _meta name: 'viewport', content: 'width=device-width, initial-scale=1.0'
 
-  _div.main! do
-    _header
-    _footer
-  end
+  _div.main!
 
   _script src: "../app.js?#{@appmtime}", lang: 'text/javascript'
   _script %{
-    React.render(React.createElement(Main, 
-      #{JSON.generate(server: @server, page: @page)}),
-      document.getElementById("main"))
+    new Vue({el: "#main", render: function($h) {
+      return $h("div", {attrs: {id: "main"}}, [$h(Main, {props:
+      #{JSON.generate(server: @server, page: @page)}})])}})
   }
 end
diff --git a/www/board/agenda/views/layout/main.js.rb b/www/board/agenda/views/layout/main.js.rb
index 0f286dd..5e2e2c5 100644
--- a/www/board/agenda/views/layout/main.js.rb
+++ b/www/board/agenda/views/layout/main.js.rb
@@ -120,17 +120,19 @@ class Main < Vue
     # avoid overlapping the header and footer areas
     def window.onresize()
       main = document.querySelector('main')
+      footer = document.querySelector('footer')
+      header = document.querySelector('header')
       if 
         window.innerHeight <= 400 and 
         document.body.scrollHeight > window.innerHeight
       then
-        document.querySelector('footer').style.position = 'relative'
-        document.querySelector('header').style.position = 'relative'
+        footer.style.position = 'relative' if footer
+        header.style.position = 'relative' if header
         main.style.marginTop = 0
         main.style.marginBottom = 0
       else
-        document.querySelector('footer').style.position = 'fixed'
-        document.querySelector('header').style.position = 'fixed'
+        footer.style.position = 'fixed' if footer
+        header.style.position = 'fixed' if header
         main.style.marginTop = 
           "#{document.querySelector('header.navbar').clientHeight}px"
         main.style.marginBottom = 

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