From 97b1f37055c1ef2ed70df42859fb7233246f0b16 Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Sun, 22 Feb 2015 13:41:11 -0800 Subject: [PATCH] cmd/present: do not show help text on localhost Also allow escape key to hide help text. Fixes golang/go#9950 Change-Id: Ifcffbafda68d383e529f4ad6119b384a9c5cef6a Reviewed-on: https://go-review.googlesource.com/5531 Reviewed-by: Andrew Gerrand --- cmd/present/static/slides.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/present/static/slides.js b/cmd/present/static/slides.js index a48ec52971..3697b4ecd9 100644 --- a/cmd/present/static/slides.js +++ b/cmd/present/static/slides.js @@ -399,6 +399,7 @@ function handleBodyKeyDown(event) { switch (event.keyCode) { case 72: // 'H' hides the help text + case 27: // escape key if (!inCode) hideHelpText(); break; @@ -483,6 +484,10 @@ function handleDomLoaded() { setupInteraction(); + if (window.location.hostname == "localhost" || window.location.hostname == "127.0.0.1" || window.location.hostname == "::1") { + hideHelpText(); + } + document.body.classList.add('loaded'); };