Commits

php committed 6916a7e

base: Reset value if the user clicks into the search input field

Comments (0)

Files changed (3)

-bdc8c15f5ce113b288f38ebf0b8cc2fe456c89a3 content
-682e552ec279b13f1f4e9bc020c964f2d26cd9f4 rendered
+fb4a8d01ba683a7b64f2e52979795693b78c777c content
+77cc59d1fe754200b34d8b70c422538eb3c7c878 rendered

static/javascript/common.js

+var resetted = false;
+function resetBar() {
+    if (!resetted) {
+        document.getElementById('keyword').value = '';
+        resetted = true;
+    }
+}

templates/base.html

         <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();
                 <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>