Mercurial > hg-website
changeset 276:6916a7e4fbf0
base: Reset value if the user clicks into the search input field
author | David Soria Parra <dsp@php.net> |
---|---|
date | Sun, 01 Nov 2009 19:24:19 +0100 |
parents | e3139f44b837 |
children | 84f2a6a16bd2 |
files | .hgsubstate static/javascript/common.js templates/base.html |
diffstat | 3 files changed, 11 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/.hgsubstate Wed Oct 28 22:56:21 2009 +0100 +++ b/.hgsubstate Sun Nov 01 19:24:19 2009 +0100 @@ -1,2 +1,2 @@ -bdc8c15f5ce113b288f38ebf0b8cc2fe456c89a3 content -682e552ec279b13f1f4e9bc020c964f2d26cd9f4 rendered +fb4a8d01ba683a7b64f2e52979795693b78c777c content +77cc59d1fe754200b34d8b70c422538eb3c7c878 rendered
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/static/javascript/common.js Sun Nov 01 19:24:19 2009 +0100 @@ -0,0 +1,7 @@ +var resetted = false; +function resetBar() { + if (!resetted) { + document.getElementById('keyword').value = ''; + resetted = true; + } +}
--- a/templates/base.html Wed Oct 28 22:56:21 2009 +0100 +++ b/templates/base.html Sun Nov 01 19:24:19 2009 +0100 @@ -9,6 +9,7 @@ <script type="text/javascript" src="/javascript/typeface.js"></script> <script type="text/javascript" src="/javascript/optimer_regular.typeface.js"></script> <script type="text/javascript" src="/javascript/download.js"></script> + <script type="text/javascript" src="/javascript/common.js"></script> <script language="javascript" type="text/javascript"> {% set download = downloads[downloads['current']] %} var dl = new Download(); @@ -39,7 +40,7 @@ <legend>Search form</legend> <label for="keyword">keyword</label> <input class="text" type="text" name="value" - value="Search the Wiki" id="keyword"> + value="Search the Wiki" id="keyword" onclick="resetBar();"> <input class="submit" type="submit" value="Title" name="titlesearch" alt="Search Titles"> </fieldset>