Bug 1126186: Allow users to turn off all tiles that aren't history tiles and update newtab cogmenu wording. r=adw

This commit is contained in:
Marina Samuel 2015-03-20 17:28:15 -04:00
Родитель 5e63826da7
Коммит a4871bd274
6 изменённых файлов: 28 добавлений и 15 удалений

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

@ -491,7 +491,7 @@ input[type=button] {
.newtab-customize-panel-item, .newtab-customize-panel-item,
.newtab-search-panel-engine, .newtab-search-panel-engine,
#newtab-search-manage { #newtab-search-manage {
padding: 4px 24px; padding: 10px 10px 10px 25px;
} }
.newtab-customize-panel-item:not(:last-child), .newtab-customize-panel-item:not(:last-child),
@ -513,6 +513,10 @@ input[type=button] {
margin: 0; margin: 0;
} }
.newtab-customize-panel-item:not([selected]) {
color: #919191;
}
.newtab-customize-panel-item[selected], .newtab-customize-panel-item[selected],
.newtab-search-panel-engine[selected] { .newtab-search-panel-engine[selected] {
background: url("chrome://global/skin/menu/shared-menu-check.png") center left 4px no-repeat transparent; background: url("chrome://global/skin/menu/shared-menu-check.png") center left 4px no-repeat transparent;

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

@ -37,13 +37,13 @@
<xul:panel id="newtab-customize-panel" orient="vertical" type="arrow" <xul:panel id="newtab-customize-panel" orient="vertical" type="arrow"
noautohide="true" hidden="true"> noautohide="true" hidden="true">
<xul:hbox id="newtab-customize-enhanced" class="newtab-customize-panel-item"> <xul:hbox id="newtab-customize-enhanced" class="newtab-customize-panel-item">
<xul:label>&newtab.customize.enhanced;</xul:label> <xul:label>&newtab.customize.suggested;</xul:label>
</xul:hbox> </xul:hbox>
<xul:hbox id="newtab-customize-classic" class="newtab-customize-panel-item"> <xul:hbox id="newtab-customize-classic" class="newtab-customize-panel-item">
<xul:label>&newtab.customize.classic;</xul:label> <xul:label>&newtab.customize.topsites;</xul:label>
</xul:hbox> </xul:hbox>
<xul:hbox id="newtab-customize-blank" class="newtab-customize-panel-item"> <xul:hbox id="newtab-customize-blank" class="newtab-customize-panel-item">
<xul:label>&newtab.customize.blank;</xul:label> <xul:label>&newtab.customize.blank2;</xul:label>
</xul:hbox> </xul:hbox>
</xul:panel> </xul:panel>

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

@ -40,21 +40,21 @@ function runTests() {
yield addNewTabPageTab(); yield addNewTabPageTab();
yield customizeNewTabPage("classic"); yield customizeNewTabPage("classic");
let {type, enhanced, title} = getData(0); let {type, enhanced, title} = getData(0);
is(type, "organic", "directory link is organic"); isnot(type, "enhanced", "history link is not enhanced");
isnot(enhanced, "", "directory link has enhanced image"); is(enhanced, "", "history link has no enhanced image");
is(title, "title"); is(title, "site#-1");
is(getData(1), null, "history link pushed out by directory link"); is(getData(1), null, "there is only one link and it's a history link");
// Test with enhanced = true // Test with enhanced = true
yield addNewTabPageTab(); yield addNewTabPageTab();
yield customizeNewTabPage("enhanced"); yield customizeNewTabPage("enhanced");
({type, enhanced, title} = getData(0)); ({type, enhanced, title} = getData(0));
is(type, "organic", "directory link is still organic"); is(type, "organic", "directory link is organic");
isnot(enhanced, "", "directory link still has enhanced image"); isnot(enhanced, "", "directory link has enhanced image");
is(title, "title"); is(title, "title");
is(getData(1), null, "history link still pushed out by directory link"); is(getData(1), null, "history link pushed out by directory link");
// Test with a pinned link // Test with a pinned link
setPinnedLinks("-1"); setPinnedLinks("-1");

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

@ -5,9 +5,9 @@
<!-- These strings are used in the about:newtab page --> <!-- These strings are used in the about:newtab page -->
<!ENTITY newtab.pageTitle "New Tab"> <!ENTITY newtab.pageTitle "New Tab">
<!ENTITY newtab.customize.title "Customize your New Tab page"> <!ENTITY newtab.customize.title "Customize your New Tab page">
<!ENTITY newtab.customize.enhanced "Enhanced"> <!ENTITY newtab.customize.suggested "Show suggested and your top sites">
<!ENTITY newtab.customize.classic "Classic"> <!ENTITY newtab.customize.topsites "Show your top sites">
<!ENTITY newtab.customize.blank "Blank"> <!ENTITY newtab.customize.blank2 "Show blank page">
<!ENTITY newtab.customize.what "What is this page?"> <!ENTITY newtab.customize.what "What is this page?">
<!ENTITY newtab.intro.header "What is this page?"> <!ENTITY newtab.intro.header "What is this page?">
<!ENTITY newtab.undo.removedLabel "Thumbnail removed."> <!ENTITY newtab.undo.removedLabel "Thumbnail removed.">

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

@ -935,7 +935,12 @@ let Links = {
_getMergedProviderLinks: function Links__getMergedProviderLinks() { _getMergedProviderLinks: function Links__getMergedProviderLinks() {
// Build a list containing a copy of each provider's sortedLinks list. // Build a list containing a copy of each provider's sortedLinks list.
let linkLists = []; let linkLists = [];
for (let links of this._providers.values()) { for (let provider of this._providers.keys()) {
if (!AllPages.enhanced && provider != PlacesProvider) {
// Only show history tiles if we're not in 'enhanced' mode.
continue;
}
let links = this._providers.get(provider);
if (links && links.sortedLinks) { if (links && links.sortedLinks) {
linkLists.push(links.sortedLinks.slice()); linkLists.push(links.sortedLinks.slice());
} }

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

@ -7,8 +7,12 @@ const { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components;
Cu.import("resource://gre/modules/NewTabUtils.jsm"); Cu.import("resource://gre/modules/NewTabUtils.jsm");
Cu.import("resource://gre/modules/Promise.jsm"); Cu.import("resource://gre/modules/Promise.jsm");
Cu.import("resource://gre/modules/Task.jsm"); Cu.import("resource://gre/modules/Task.jsm");
Cu.import("resource://gre/modules/Services.jsm");
const PREF_NEWTAB_ENHANCED = "browser.newtabpage.enhanced";
function run_test() { function run_test() {
Services.prefs.setBoolPref(PREF_NEWTAB_ENHANCED, true);
run_next_test(); run_next_test();
} }