Tweaked search form.
authorJan Schneider <jan@horde.org>
Mon, 30 Nov 2009 15:55:07 +0000 (16:55 +0100)
committerJan Schneider <jan@horde.org>
Mon, 30 Nov 2009 15:55:07 +0000 (16:55 +0100)
kronolith/js/kronolith.js
kronolith/templates/index/index.inc
kronolith/themes/graphics/search-button.png [new file with mode: 0644]
kronolith/themes/screen.css
kronolith/themes/silver/graphics/search-button.png [new file with mode: 0644]
kronolith/themes/tango-blue/graphics/search-button.png [new file with mode: 0644]

index 32e4f55..bde32be 100644 (file)
@@ -3407,6 +3407,17 @@ KronolithCore = {
         document.observe('dblclick', KronolithCore.clickHandler.bindAsEventListener(KronolithCore, true));
         document.observe('mouseover', KronolithCore.mouseHandler.bindAsEventListener(KronolithCore, 'over'));
 
+        $('kronolithSearchTerm').observe('focus', function() {
+            if ($F(this) == this.readAttribute('default')) {
+                this.clear();
+            }
+        });
+        $('kronolithSearchTerm').observe('blur', function() {
+            if (!$F(this)) {
+                this.setValue(this.readAttribute('default'));
+            }
+        });
+
         if (Horde.dhtmlHistory.initialize()) {
             Horde.dhtmlHistory.addListener(this.go.bind(this));
         }
index 9489512..7c68324 100644 (file)
     </table>
   </div>
 
-  <h3 class="search">
-    <span><?php echo _("Search") ?></span>
-  </h3>
-
   <form id="kronolithSearchForm" action="">
-    <input type="text" id="kronolithSearchTerm" />
-    <input id="kronolithSearchButton" type="button" value="OK" class="button ok" />
-    <input id="kronolithSearchAdvanced" type="button" value="+" class="button" />
+    <input type="text" id="kronolithSearchTerm" value="<?php echo _("Search") ?>" default="<?php echo _("Search") ?>" />
+    <input id="kronolithSearchButton" type="image" src="<?php echo $GLOBALS['registry']->getImageDir() ?>/search-button.png" />
   </form>
 
   <div id="kronolithMenuCalendars">
diff --git a/kronolith/themes/graphics/search-button.png b/kronolith/themes/graphics/search-button.png
new file mode 100644 (file)
index 0000000..94c47d4
Binary files /dev/null and b/kronolith/themes/graphics/search-button.png differ
index c5b4eef..20a0940 100644 (file)
@@ -428,7 +428,7 @@ body.kronolithAjax {
 }
 #kronolithMenuCalendars {
     position: absolute;
-    top: 295px;
+    top: 265px;
     bottom: 0;
     width: 100%;
     overflow: auto;
@@ -444,13 +444,17 @@ body.kronolithAjax {
     border-bottom: 1px #000 dotted;
     cursor: default;
 }
-#kronolithMenu h3.search {
-    top: 15px;
+#kronolithMenu form {
+    padding: 0;
+    margin: 15px 0 5px 0;
 }
 #kronolithSearchForm {
     position: relative;
     top: 15px;
 }
+#kronolithSearchTerm {
+    width: 127px;
+}
 #kronolithMenu h3#kronolithCalendarsFirst {
     margin-top: 0;
 }
@@ -514,14 +518,6 @@ span#kronolithQuickEvent {
     color: transparent;
 }
 
-#kronolithMenu form {
-    padding: 0;
-    margin: 0 0 5px 0;
-}
-#kronolithSearchTerm {
-    width: 90px;
-}
-
 /* Quick edit */
 #kronolithQuickinsert {
     position: absolute;
diff --git a/kronolith/themes/silver/graphics/search-button.png b/kronolith/themes/silver/graphics/search-button.png
new file mode 100644 (file)
index 0000000..a158b99
Binary files /dev/null and b/kronolith/themes/silver/graphics/search-button.png differ
diff --git a/kronolith/themes/tango-blue/graphics/search-button.png b/kronolith/themes/tango-blue/graphics/search-button.png
new file mode 100644 (file)
index 0000000..94c47d4
Binary files /dev/null and b/kronolith/themes/tango-blue/graphics/search-button.png differ