Back out fba4dc82c929 bug 1162140 for bustage on a CLOSED TREE.

This commit is contained in:
Drew Willcoxon 2015-06-11 15:39:49 -07:00
Родитель d97a19b468
Коммит 008a1bf78e
4 изменённых файлов: 19 добавлений и 37 удалений

Просмотреть файл

@ -966,7 +966,7 @@ Search.prototype = {
match.engineAlias = alias;
let query = this._searchTokens.slice(1).join(" ");
this._addSearchEngineMatch(match, query);
yield this._addSearchEngineMatch(match, query);
return true;
},
@ -976,17 +976,16 @@ Search.prototype = {
return;
let query = this._originalSearchString;
this._addSearchEngineMatch(match, query);
yield this._addSearchEngineMatch(match, query);
},
_addSearchEngineMatch(match, query, suggestion) {
_addSearchEngineMatch: function* (match, query) {
let actionURLParams = {
engineName: match.engineName,
input: this._originalSearchString,
searchQuery: query,
};
if (suggestion)
actionURLParams.searchSuggestion = suggestion;
if (match.engineAlias) {
actionURLParams.alias = match.engineAlias;
}

Просмотреть файл

@ -11,7 +11,3 @@
image-rendering: -moz-crisp-edges;
}
}
richlistitem > .ac-title-box > .ac-title > .ac-comment:not([selected]) > html|span.ac-selected-text {
display: none;
}

Просмотреть файл

@ -1539,10 +1539,11 @@ extends="chrome://global/content/bindings/popup.xml#popup">
let index = (match[1] || 1) - 1;
if (index >= 0 && index < aReplacements.length) {
pairs.push([...aReplacements[index]]);
let replacement = aReplacements[index];
pairs.push([...replacement]);
}
} else {
pairs.push([part]);
pairs.push([part, false]);
}
}
@ -1571,15 +1572,8 @@ extends="chrome://global/content/bindings/popup.xml#popup">
if (emphasise) {
let span = aDescriptionElement.appendChild(
document.createElementNS("http://www.w3.org/1999/xhtml", "span"));
span.className = "ac-emphasize-text";
span.textContent = text;
switch(emphasise) {
case "match":
span.className = "ac-emphasize-text";
break;
case "selected":
span.className = "ac-selected-text";
break;
}
} else {
aDescriptionElement.appendChild(document.createTextNode(text));
}
@ -1635,22 +1629,10 @@ extends="chrome://global/content/bindings/popup.xml#popup">
} else if (action.type == "searchengine") {
emphasiseUrl = false;
// The order here is not localizable, we default to appending
// "- Search with Engine" to the search string, to be able to
// properly generate emphasis pairs. That said, no localization
// changed the order while it was possible, so doesn't look like
// there's a strong need for that.
let {engineName, searchSuggestion, searchQuery} = action.params;
let engineStr = "- " +
this._stringBundle.formatStringFromName("searchWithEngine",
[engineName], 1);
let suggestedPart = "";
if (searchSuggestion) {
suggestedPart = searchSuggestion.substr(searchQuery.length);
}
title = this._generateEmphasisPairs(`%1$S${suggestedPart} %2$S`, [
[searchQuery, "match"],
[engineStr, "selected"],
let sourceStr = this._stringBundle.GetStringFromName("searchWithEngineForQuery");
title = this._generateEmphasisPairs(sourceStr, [
[action.params.engineName, false],
[action.params.searchQuery, true]
]);
// If this is a default search match, we remove the image so we
// can style it ourselves with a generic search icon.
@ -1667,7 +1649,7 @@ extends="chrome://global/content/bindings/popup.xml#popup">
let sourceStr = this._stringBundle.GetStringFromName("visitURL");
title = this._generateEmphasisPairs(sourceStr, [
[displayUrl, "match"],
[displayUrl, true],
]);
}
@ -1697,7 +1679,7 @@ extends="chrome://global/content/bindings/popup.xml#popup">
let sourceStr = this._stringBundle.GetStringFromName("visitURL");
title = this._generateEmphasisPairs(sourceStr, [
[displayUrl, "match"],
[displayUrl, true],
]);
types.delete("autofill");

Просмотреть файл

@ -6,6 +6,11 @@
# the search engine provider's name. This format was chosen because
# the provider can also end with "Search" (e.g.: MSN Search).
searchWithEngine = Search with %S
# LOCALIZATION NOTE (searchWithEngineForQuery):
# %1$S is the search engine's name, %2$S is the search query.
# This format was chosen because the provider can also end with "Search"
# (e.g.: MSN Search).
searchWithEngineForQuery = %2$S — Search with %1$S
switchToTab = Switch to tab
# LOCALIZATION NOTE (visitURL):
# %S is the URL to visit.