From 3e4b7b4cd79b23a6bd739a85182ea199b2e24096 Mon Sep 17 00:00:00 2001 From: CounterPillow Date: Fri, 5 Aug 2011 13:38:09 +0200 Subject: [PATCH] Added title field for sign search box, added default value which sets to nothing when focussed and resets when box is empty and blured. --- overviewer_core/data/web_assets/overviewer.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/overviewer_core/data/web_assets/overviewer.js b/overviewer_core/data/web_assets/overviewer.js index c5083fc..1d7fe60 100644 --- a/overviewer_core/data/web_assets/overviewer.js +++ b/overviewer_core/data/web_assets/overviewer.js @@ -817,6 +817,22 @@ var overviewer = { var searchInput = document.createElement("input"); searchInput.type = "text"; + searchInput.value = "Sign Search" + searchInput.title = "Sign Search" + + /* Hey dawg, I heard you like functions. + * So we defined a function inside your function. + */ + searchInput.onfocus = function() { + if (searchInput.value == "Sign Search") { + searchInput.value = ""; + } + }; + searchInput.onblur = function() { + if (searchInput.value == "") { + searchInput.value = "Sign Search"; + } + }; searchControl.appendChild(searchInput);