whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ru...@apache.org
Subject [whimsy] 02/02: add mtime to app.js; prep for expires header
Date Sun, 31 Jul 2016 13:31:17 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

commit 63f06ea70a54daab7c0faf2e67c0bd6be8a48031
Author: Sam Ruby <rubys@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" <commits@whimsical.apache.org>.

Mime
View raw message