Bug 460694 - Make use of emptytext attribute in search textboxes (Helper apps prefpane part). r=Mnyromyr, sr=Neil.
authorstefanh@inbox.com
Tue, 20 Jan 2009 21:06:12 +0100
changeset 1700 1a22abcfbc7c5e70b0242ea0f31b1f91f07e72c8
parent 1699 ef7223d5becb8d0367b5d52947dc3d2566970095
child 1701 3858b26cdd918533df9e951deaf3ceb52fab9fe3
push id1364
push userstefanh@inbox.com
push dateTue, 20 Jan 2009 20:06:19 +0000
treeherdercomm-central@1a22abcfbc7c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMnyromyr, Neil
bugs460694
Bug 460694 - Make use of emptytext attribute in search textboxes (Helper apps prefpane part). r=Mnyromyr, sr=Neil.
suite/common/bindings/prefwindow.xml
suite/common/pref/pref-applications.xul
suite/locales/en-US/chrome/common/pref/pref-applications.dtd
suite/locales/en-US/chrome/common/pref/preferences.dtd
--- a/suite/common/bindings/prefwindow.xml
+++ b/suite/common/bindings/prefwindow.xml
@@ -508,16 +508,28 @@
 
       <handler event="paneload">
       <![CDATA[
         // panes may load asynchronously,
         // so we have to "late-sync" those to our navigation tree
         this.syncTreeWithPane(event.originalTarget, false);
       ]]>
       </handler>
+
+      <handler event="keypress" key="&focusSearch.key;" modifiers="accel">
+      <![CDATA[
+        var searchBox = this.currentPane.getElementsByAttribute("type", "search")[0];
+        if (searchBox)
+        {
+          searchBox.focus();
+          event.stopPropagation();
+          event.preventDefault();
+        }
+      ]]>
+      </handler>
     </handlers>
   </binding>
 
   <binding id="prefpane"
            extends="chrome://global/content/bindings/preferences.xml#prefpane">
     <resources>
       <stylesheet src="chrome://communicator/skin/preferences.css"/>
     </resources>
--- a/suite/common/pref/pref-applications.xul
+++ b/suite/common/pref/pref-applications.xul
@@ -98,18 +98,21 @@
                   type="bool"/>
     </preferences>
 
     <stringbundle id="bundleBrand" src="chrome://branding/locale/brand.properties"/>
     <stringbundle id="bundlePrefApplications"
                   src="chrome://communicator/locale/pref/pref-applications.properties"/>
 
     <hbox align="center">
-      <label accesskey="&filter.accesskey;" control="filter">&filter.label;</label>
-      <textbox id="filter" flex="1" type="search" clickSelectsAll="true"
+      <textbox id="filter"
+               flex="1"
+               type="search"
+               emptytext="&search.emptytext;"
+               clickSelectsAll="true"
                oncommand="gApplicationsPane._rebuildView();"/>
     </hbox>
 
     <separator class="thin"/>
 
     <listbox id="handlersView" persist="lastSelectedType" flex="1"
              preference="pref.downloads.disable_button.edit_actions">
       <listcols>
--- a/suite/locales/en-US/chrome/common/pref/pref-applications.dtd
+++ b/suite/locales/en-US/chrome/common/pref/pref-applications.dtd
@@ -2,10 +2,9 @@
 <!ENTITY pref.applications.title "Helper Applications">
 
 <!ENTITY typeColumn.label        "Content Type">
 <!ENTITY typeColumn.accesskey    "T">
 
 <!ENTITY actionColumn2.label     "Action">
 <!ENTITY actionColumn2.accesskey "A">
 
-<!ENTITY filter.label            "Search:">
-<!ENTITY filter.accesskey        "S">
+<!ENTITY search.emptytext        "Search Types and Actions">
--- a/suite/locales/en-US/chrome/common/pref/preferences.dtd
+++ b/suite/locales/en-US/chrome/common/pref/preferences.dtd
@@ -1,9 +1,9 @@
-<!--LOCALIZATION NOTE : FILE Lists preferences categories that appear on the left of the preferences dialog -->
+<!--LOCALIZATION NOTE (.label): Preferences categories that appear on the left of the preferences dialog -->
 <!ENTITY prefWindow.title "Preferences">
 <!ENTITY categoryHeader "Category">
 <!ENTITY appear.label "Appearance">
 <!ENTITY content.label "Content">
 <!ENTITY fonts.label "Fonts">
 <!ENTITY colors.label "Colors">
 <!ENTITY navigator.label "Browser">
 <!ENTITY history.label "History">
@@ -28,8 +28,10 @@
 <!ENTITY httpnetworking.label "HTTP Networking">
 <!ENTITY smart.label "Software Installation">
 <!ENTITY download.label "Downloads">
 <!ENTITY keynav.label "Keyboard Navigation">
 <!ENTITY search.label "Internet Search">
 <!ENTITY policies.label "Security Policies">
 <!ENTITY mousewheel.label "Mouse Wheel">
 <!ENTITY scriptsAndWindows.label "Scripts &amp; Plugins">
+
+<!ENTITY focusSearch.key "f">