From 2671b7469a15e6853193dac54c125b15ca6f23ef Mon Sep 17 00:00:00 2001 From: Andy Green Date: Wed, 13 Jul 2016 08:45:22 +0800 Subject: [PATCH] plugins-dim-webpage-when-connection-lost --- README.coding.md | 22 ++++++++++++++++++++++ plugins/generic-sessions/assets/index.html | 3 ++- plugins/server-status.html | 5 +++++ test-server/test-server-http.c | 3 +++ test-server/test.html | 5 +++++ 5 files changed, 37 insertions(+), 1 deletion(-) diff --git a/README.coding.md b/README.coding.md index 7a85e338..b4fc8113 100644 --- a/README.coding.md +++ b/README.coding.md @@ -672,3 +672,25 @@ the protocol struct. This allocation is only deleted / replaced when the connection accesses a URL region with a different protocol (or the default protocols[0] if no CALLBACK area matches it). + +@section dim Dimming webpage when connection lost + +The lws test plugins' html provides useful feedback on the webpage about if it +is still connected to the server, by greying out the page if not. You can +also add this to your own html easily + + - include lws-common.js from your HEAD section + + + + - dim the page during initialization, in a script section on your page + + lws_gray_out(true,{'zindex':'499'}); + + - in your ws onOpen(), remove the dimming + + lws_gray_out(false); + + - in your ws onClose(), reapply the dimming + + lws_gray_out(true,{'zindex':'499'}); diff --git a/plugins/generic-sessions/assets/index.html b/plugins/generic-sessions/assets/index.html index d370f9d9..f0703c09 100644 --- a/plugins/generic-sessions/assets/index.html +++ b/plugins/generic-sessions/assets/index.html @@ -1,5 +1,6 @@ +