зеркало из https://github.com/mozilla/gecko-dev.git
Bug 345786: Re-add Match Case checkbox when not in auto-detect mode.
r=mconnor
This commit is contained in:
Родитель
fbcbbacdb6
Коммит
effb08030f
|
@ -22,6 +22,9 @@
|
|||
gFindBar.setFindCloseTimeout();"
|
||||
type="checkbox" disabled="true"
|
||||
accesskey="&highlight.accesskey;"/>
|
||||
<checkbox id="find-case-sensitive"
|
||||
oncommand="gFindBar.toggleCaseSensitiveCheckbox(this.checked);"
|
||||
label="&caseSensitiveCheckbox.label;" accesskey="&caseSensitiveCheckbox.accesskey;"/>
|
||||
<label id="match-case-status" class="find-fast"/>
|
||||
<image id="find-status-icon"/>
|
||||
<label id="find-status"/>
|
||||
|
|
|
@ -113,7 +113,7 @@ var gFindBar = {
|
|||
prefService.getBoolPref("accessibility.typeaheadfind.linksonly");
|
||||
gFindBar.mTypeAheadCaseSensitive =
|
||||
prefService.getIntPref("accessibility.typeaheadfind.casesensitive");
|
||||
gFindBar.setCaseSensitiveStr();
|
||||
gFindBar.setCaseSensitiveUI();
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -369,7 +369,7 @@ var gFindBar = {
|
|||
return node;
|
||||
},
|
||||
|
||||
setCaseSensitiveStr: function (val)
|
||||
setCaseSensitiveUI: function (val)
|
||||
{
|
||||
var findToolbar = document.getElementById("FindToolbar");
|
||||
if (findToolbar.hidden)
|
||||
|
@ -378,9 +378,29 @@ var gFindBar = {
|
|||
if (!val)
|
||||
val = document.getElementById("find-field").value;
|
||||
|
||||
var matchCaseCheckbox = document.getElementById("find-case-sensitive");
|
||||
matchCaseCheckbox.checked = this.shouldBeCaseSensitive(val);
|
||||
|
||||
var matchCaseText = document.getElementById("match-case-status");
|
||||
matchCaseText.value = this.shouldBeCaseSensitive(val) ?
|
||||
this.mCaseSensitiveStr : "";
|
||||
matchCaseText.value = matchCaseCheckbox.checked ?
|
||||
this.mCaseSensitiveStr : "";
|
||||
|
||||
// Show the checkbox on the full Find bar in non-auto mode. Show the label
|
||||
// in all other cases.
|
||||
matchCaseCheckbox.hidden = this.mUsingMinimalUI ||
|
||||
(this.mTypeAheadCaseSensitive != 0 && this.mTypeAheadCaseSensitive != 1);
|
||||
matchCaseText.hidden = !matchCaseCheckbox.hidden;
|
||||
},
|
||||
|
||||
toggleCaseSensitiveCheckbox: function (aCaseSensitive)
|
||||
{
|
||||
var prefService =
|
||||
Components.classes["@mozilla.org/preferences-service;1"]
|
||||
.getService(Components.interfaces.nsIPrefBranch);
|
||||
|
||||
// Just set the pref; our observer will change the find bar behavior
|
||||
prefService.setIntPref("accessibility.typeaheadfind.casesensitive",
|
||||
aCaseSensitive ? 1 : 0);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -421,7 +441,7 @@ var gFindBar = {
|
|||
|
||||
var findField = document.getElementById("find-field");
|
||||
findField.removeAttribute("status");
|
||||
this.setCaseSensitiveStr(findField.value);
|
||||
this.setCaseSensitiveUI(findField.value);
|
||||
var statusIcon = document.getElementById("find-status-icon");
|
||||
statusIcon.removeAttribute("status");
|
||||
var statusText = document.getElementById("find-status");
|
||||
|
@ -849,7 +869,7 @@ var gFindBar = {
|
|||
|
||||
var fastFind = getBrowser().fastFind;
|
||||
fastFind.caseSensitive = this.shouldBeCaseSensitive(val);
|
||||
this.setCaseSensitiveStr(val);
|
||||
this.setCaseSensitiveUI(val);
|
||||
var res = fastFind.find(val, this.mFindMode == FIND_LINKS, this.mHasFocus);
|
||||
this.updateFoundLink(res);
|
||||
this.updateStatus(res, true);
|
||||
|
|
|
@ -12,4 +12,5 @@
|
|||
<!ENTITY highlight.label "Highlight all">
|
||||
<!ENTITY highlight.accesskey "a">
|
||||
<!ENTITY highlight.tooltiptext "Highlight all occurrences of the phrase">
|
||||
|
||||
<!ENTITY caseSensitiveCheckbox.label "Match case">
|
||||
<!ENTITY caseSensitiveCheckbox.accesskey "c">
|
||||
|
|
Загрузка…
Ссылка в новой задаче