whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ru...@apache.org
Subject [whimsy] 01/02: show response headers
Date Tue, 26 Jul 2016 01:47: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 09bae000bfaf2248faa9dba70bee662c7d66caa3
Author: Sam Ruby <rubys@intertwingly.net>
AuthorDate: Mon Jul 25 21:44:15 2016 -0400

    show response headers
---
 www/board/agenda/views/keyboard.js.rb    |  2 +-
 www/board/agenda/views/pages/cache.js.rb | 20 ++++++++++++++++++++
 2 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/www/board/agenda/views/keyboard.js.rb b/www/board/agenda/views/keyboard.js.rb
index fd80093..4edfc1c 100644
--- a/www/board/agenda/views/keyboard.js.rb
+++ b/www/board/agenda/views/keyboard.js.rb
@@ -85,7 +85,7 @@ class Keyboard
           Main.refresh()
         end
         return false
-      elsif event.keyCode == '='.ord
+      elsif event.keyCode == '='.ord or event.keyCode == 187 # "="
         Main.navigate "cache/"
         return false
       end
diff --git a/www/board/agenda/views/pages/cache.js.rb b/www/board/agenda/views/pages/cache.js.rb
index bf540f0..c94c8e6 100644
--- a/www/board/agenda/views/pages/cache.js.rb
+++ b/www/board/agenda/views/pages/cache.js.rb
@@ -98,6 +98,26 @@ class CachePage < React
   def render
     _h2 @response.url
     _p "#{@response.status} #{@response.statusText}"
+
+    if @response.headers
+      # avoid buggy @response.headers.keys()
+      keys = []
+      iterator = @response.headers.entries()
+      entry = iterator.next()
+      while not entry.done
+        keys << entry.value[0] unless entry.value[0] == 'status'
+        entry = iterator.next()
+      end
+
+      keys.sort()
+
+      _ul do 
+        keys.each do |key|
+          _li "#{key}: #{@response.headers.get(key)}"
+        end
+      end
+    end
+
     _pre @text
   end
 

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

Mime
View raw message