mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 58986 The find dialog should autocomplete recently searched items r=Neil.
This commit is contained in:
parent
b993a04a12
commit
bb05fba625
@ -5,6 +5,7 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
Components.utils.import("resource://gre/modules/Services.jsm");
|
||||
Components.utils.import("resource://gre/modules/FormHistory.jsm");
|
||||
|
||||
var dialog; // Quick access to document/form elements.
|
||||
var gFindInst; // nsIWebBrowserFind that we're going to use
|
||||
@ -100,6 +101,7 @@ function onAccept()
|
||||
|
||||
// Transfer dialog contents to the find service.
|
||||
saveFindData();
|
||||
updateFormHistory();
|
||||
|
||||
// set up the find instance
|
||||
gFindInst.searchString = dialog.findKey.value;
|
||||
@ -126,3 +128,22 @@ function doEnabling()
|
||||
{
|
||||
dialog.find.disabled = !dialog.findKey.value;
|
||||
}
|
||||
|
||||
function updateFormHistory()
|
||||
{
|
||||
if (window.opener.PrivateBrowsingUtils &&
|
||||
window.opener.PrivateBrowsingUtils.isWindowPrivate(window.opener) ||
|
||||
!dialog.findKey.value)
|
||||
return;
|
||||
|
||||
FormHistory.update({
|
||||
op: "bump",
|
||||
fieldname: "find-dialog",
|
||||
value: dialog.findKey.value
|
||||
}, {
|
||||
handleError: function(aError) {
|
||||
Components.utils.reportError("Saving find to form history failed: " +
|
||||
aError.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -25,7 +25,11 @@
|
||||
<vbox>
|
||||
<hbox align="center">
|
||||
<label value="&findField.label;" accesskey="&findField.accesskey;" control="dialog.findKey"/>
|
||||
<textbox id="dialog.findKey" flex="1" oninput="doEnabling();"/>
|
||||
<textbox id="dialog.findKey" flex="1"
|
||||
type="autocomplete"
|
||||
autocompletesearch="form-history"
|
||||
autocompletesearchparam="find-dialog"
|
||||
oninput="doEnabling();"/>
|
||||
</hbox>
|
||||
<hbox align="center">
|
||||
<vbox>
|
||||
|
Loading…
Reference in New Issue
Block a user