diff --git a/.npmrc b/.npmrc index bf55e5c3baa..8992c1397d2 100644 --- a/.npmrc +++ b/.npmrc @@ -1,5 +1,5 @@ runtime = electron -target = 2.56.0 +target = 2.56.3 target_arch = x64 -brave_electron_version = 2.56.0 +brave_electron_version = 2.56.3 disturl = http://brave-laptop-binaries.s3.amazonaws.com/atom-shell/dist diff --git a/CHANGELOG.md b/CHANGELOG.md index c169b079b31..1ca83d0ff74 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,26 @@ # Changelog ## [0.13.3](https://github.com/brave/browser-laptop/releases/v0.13.3dev) -- TODO +- Added a way to export bookmarks. ([#1002](https://github.com/brave/browser-laptop/issues/1002)) +- Added preference for background image or gradient for new tab. ([#6965](https://github.com/brave/browser-laptop/issues/6965)) +- Added a preference setting to "always allow" full screen view. ([#5979](https://github.com/brave/browser-laptop/issues/5979)) +- Added Ecosia as search engine. ([#7158](https://github.com/brave/browser-laptop/issues/7158)) +- Added translation for bookmarks manager. ([#7130](https://github.com/brave/browser-laptop/issues/7130)) +- Added new verified state for disabled publishers. ([#6974](https://github.com/brave/browser-laptop/issues/6974)) +- Fixed lookup in dictionary by context menu. ([#7167](https://github.com/brave/browser-laptop/issues/7167)) +- Fixed various UI issues. ([#7181](https://github.com/brave/browser-laptop/issues/7181)) +- Fixed 'more bookmarks' menu item. ([#7097](https://github.com/brave/browser-laptop/issues/7097)) +- Fixed Brave crash when Brave payment is disabled and enabled frequently. ([#7031](https://github.com/brave/browser-laptop/issues/7031)) +- Fixed stutter/odd jump when tab switching with unloaded tabs. ([#6895](https://github.com/brave/browser-laptop/issues/6895)) +- Fixed disable close button on tabs if tab size is too small. ([#5431](https://github.com/brave/browser-laptop/issues/5431)) +- Fixed viewport regaining focus after closing downloads-bar. ([#3219](https://github.com/brave/browser-laptop/issues/3219)) +- Fixed click target for Audio indicator on/off button. ([#1776](https://github.com/brave/browser-laptop/issues/1776)) +- Fixed three-finger "Look up" tap. ([#1064](https://github.com/brave/browser-laptop/issues/1064)) +- Fixed tabs don't resize with window. ([#100](https://github.com/brave/browser-laptop/issues/100)) +- Upgraded to node 7.4.0. ([#7061](https://github.com/brave/browser-laptop/issues/7061)) +- Upgrade muon to 2.56.3. ([#7173](https://github.com/brave/browser-laptop/issues/7173)) +- Upgrade to Chromium v56.0.2924.76. ([#3681](https://github.com/brave/browser-laptop/issues/3681)) + ## [0.13.2](https://github.com/brave/browser-laptop/releases/v0.13.2dev) - Added a way to keep tabs the same size when closing instead of resizing. ([#6088](https://github.com/brave/browser-laptop/issues/6088)) diff --git a/app/browser/bookmarksExporter.js b/app/browser/bookmarksExporter.js index 092b8bc377c..072412ad2ba 100644 --- a/app/browser/bookmarksExporter.js +++ b/app/browser/bookmarksExporter.js @@ -52,7 +52,7 @@ function createBookmarkArray (sites, parentFolderId, first = true, depth = 1) { if (first) payload.push(`${indentFirst}

`) - filteredBookmarks.forEach((site) => { + filteredBookmarks.toList().sort(siteUtil.siteSort).forEach((site) => { if (site.get('tags').includes(siteTags.BOOKMARK) && site.get('location')) { title = site.get('customTitle') || site.get('title') || site.get('location') payload.push(`${indentNext}

${title}`) diff --git a/app/common/lib/menuUtil.js b/app/common/lib/menuUtil.js index 818eb0b5001..1f507d6c565 100644 --- a/app/common/lib/menuUtil.js +++ b/app/common/lib/menuUtil.js @@ -151,20 +151,19 @@ const isItemValid = (currentItem, previousItem) => { return false } } - return currentItem && (typeof currentItem.l10nLabelId === 'string' || typeof currentItem.label === 'string' || currentItem.type === 'separator') + + return currentItem && (typeof currentItem.l10nLabelId === 'string' || typeof currentItem.label === 'string' || + currentItem.type === 'separator' || typeof currentItem.slice === 'function' || typeof currentItem.labelDataBind === 'string') } -/** - * Remove invalid entries from a menu template: - * - null or falsey entries - * - extra menu separators - * - entries which don't have a label (or l10nLabelId) if their type is not 'separator' - */ -module.exports.sanitizeTemplateItems = (template) => { +const sanitizeTemplateItems = (template) => { const reduced = template.reduce((result, currentValue, currentIndex, array) => { const previousItem = result.length > 0 ? result[result.length - 1] : undefined + if (currentValue && currentValue.submenu) { + currentValue.submenu = sanitizeTemplateItems(currentValue.submenu) + } if (isItemValid(currentValue, previousItem)) { result.push(currentValue) } @@ -185,3 +184,11 @@ module.exports.sanitizeTemplateItems = (template) => { return result } + +/** + * Remove invalid entries from a menu template: + * - null or falsey entries + * - extra menu separators + * - entries which don't have a label (or l10nLabelId) if their type is not 'separator' + */ +module.exports.sanitizeTemplateItems = sanitizeTemplateItems diff --git a/app/common/lib/randomUtil.js b/app/common/lib/randomUtil.js new file mode 100644 index 00000000000..92b6e6f0593 --- /dev/null +++ b/app/common/lib/randomUtil.js @@ -0,0 +1,5 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +module.exports.random = () => Math.random() diff --git a/app/crash-herald.js b/app/crash-herald.js index 190ef3ebd2a..c4eb42af487 100644 --- a/app/crash-herald.js +++ b/app/crash-herald.js @@ -5,6 +5,15 @@ const appConfig = require('../js/constants/appConfig') const crashReporter = require('electron').crashReporter +// buildConfig.js is built at package time, we need to require it in a try/catch +// block to trap for it not existing yet. +var buildConfig +try { + buildConfig = require('../js/constants/buildConfig') +} catch (e) { + buildConfig = {} +} + exports.init = () => { const options = { productName: 'Brave Developers', @@ -12,7 +21,8 @@ exports.init = () => { submitURL: appConfig.crashes.crashSubmitUrl, autoSubmit: true, extra: { - node_env: process.env.NODE_ENV + node_env: process.env.NODE_ENV, + rev: buildConfig.BROWSER_LAPTOP_REV || 'unknown' } } crashReporter.start(options) diff --git a/app/extensions/brave/content/scripts/blockFlash.js b/app/extensions/brave/content/scripts/blockFlash.js index b68ca45b3eb..ea1929cd89a 100644 --- a/app/extensions/brave/content/scripts/blockFlash.js +++ b/app/extensions/brave/content/scripts/blockFlash.js @@ -2,7 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ -const adobeRegex = new RegExp('//(get\\.adobe\\.com/([a-z_-]+/)*flashplayer|www\\.macromedia\\.com/go/getflash|www\\.adobe\\.com/go/getflash)', 'i') +const adobeRegex = + new RegExp('//(get\\.adobe\\.com/([a-z_-]+/)*flashplayer|www\\.macromedia\\.com/go/getflash|www\\.adobe\\.com/go/getflash|helpx\\.adobe\\.com/flash-player/([a-z_-]+/)*flash-player)', 'i') function blockFlashDetection () { const handler = { diff --git a/app/extensions/brave/index-dev.html b/app/extensions/brave/index-dev.html index 7fa8b25f942..6a8f5c3dbcc 100644 --- a/app/extensions/brave/index-dev.html +++ b/app/extensions/brave/index-dev.html @@ -7,7 +7,7 @@ - + Brave diff --git a/app/extensions/brave/index.html b/app/extensions/brave/index.html index 0a8e80b7551..89ec018c27d 100644 --- a/app/extensions/brave/index.html +++ b/app/extensions/brave/index.html @@ -7,7 +7,7 @@ - + Brave diff --git a/app/extensions/brave/locales/en-US/bookmarks.properties b/app/extensions/brave/locales/en-US/bookmarks.properties index ac6282a2aea..ed2b5c43442 100644 --- a/app/extensions/brave/locales/en-US/bookmarks.properties +++ b/app/extensions/brave/locales/en-US/bookmarks.properties @@ -10,3 +10,5 @@ allFolders=All Folders addBookmarkFolder.title=Add Folder addBookmark.title=Add Bookmark exportBookmarks.title=Export bookmarks +title=Title +lastVisited=Last Visited diff --git a/app/extensions/brave/locales/en-US/preferences.properties b/app/extensions/brave/locales/en-US/preferences.properties index 3a27f1cfe8c..0ce1af0a59b 100644 --- a/app/extensions/brave/locales/en-US/preferences.properties +++ b/app/extensions/brave/locales/en-US/preferences.properties @@ -311,3 +311,5 @@ notDefaultBrowser=Brave is not your default browser. setAsDefault=Set as default… checkDefaultOnStartup=Always check on startup useTorrentViewer=Enable Torrent Viewer (requires browser restart) +dashboardSettingsTitle=Dashboard +dashboardShowImages=Show images diff --git a/app/renderer/components/addEditBookmarkHanger.js b/app/renderer/components/addEditBookmarkHanger.js index 364804ef5b1..a8185dda24a 100644 --- a/app/renderer/components/addEditBookmarkHanger.js +++ b/app/renderer/components/addEditBookmarkHanger.js @@ -12,6 +12,7 @@ const KeyCodes = require('../../common/constants/keyCodes') const siteTags = require('../../../js/constants/siteTags') const settings = require('../../../js/constants/settings') const siteUtil = require('../../../js/state/siteUtil') +const UrlUtil = require('../../../js/lib/urlutil') const getSetting = require('../../../js/settings').getSetting class AddEditBookmarkHanger extends ImmutableComponent { @@ -53,7 +54,9 @@ class AddEditBookmarkHanger extends ImmutableComponent { : 'bookmarkAdded' } get isFolder () { - return siteUtil.isFolder(this.props.currentDetail) + // Fake a folderId property so that the bookmark is considered a bookmark folder. + // This is ImmutableJS so it doesn't actually set a value, it just returns a new one. + return siteUtil.isFolder(this.props.currentDetail.set('folderId', 0)) } setDefaultFocus () { this.bookmarkName.select() @@ -95,15 +98,29 @@ class AddEditBookmarkHanger extends ImmutableComponent { } onNameChange (e) { let currentDetail = this.props.currentDetail - if (currentDetail.get('title') === e.target.value && e.target.value) { + let name = e.target.value + if (typeof name === 'string' && UrlUtil.isURL(name)) { + const punycodeUrl = UrlUtil.getPunycodeUrl(name) + if (punycodeUrl.replace(/\/$/, '') !== name) { + name = punycodeUrl + } + } + if (currentDetail.get('title') === name && name) { currentDetail = currentDetail.delete('customTitle') } else { - currentDetail = currentDetail.set('customTitle', e.target.value) + currentDetail = currentDetail.set('customTitle', name) } windowActions.setBookmarkDetail(currentDetail, this.props.originalDetail, this.props.destinationDetail, this.props.shouldShowLocation, !this.props.isModal) } onLocationChange (e) { - const currentDetail = this.props.currentDetail.set('location', e.target.value) + let location = e.target.value + if (typeof location === 'string') { + const punycodeUrl = UrlUtil.getPunycodeUrl(location) + if (punycodeUrl.replace(/\/$/, '') !== location) { + location = punycodeUrl + } + } + const currentDetail = this.props.currentDetail.set('location', location) windowActions.setBookmarkDetail(currentDetail, this.props.originalDetail, this.props.destinationDetail, this.props.shouldShowLocation, !this.props.isModal) } onParentFolderChange (e) { diff --git a/app/renderer/components/bookmarksToolbar.js b/app/renderer/components/bookmarksToolbar.js index 291fbce3f53..ce30dee56b0 100644 --- a/app/renderer/components/bookmarksToolbar.js +++ b/app/renderer/components/bookmarksToolbar.js @@ -32,9 +32,15 @@ class BookmarkToolbarButton extends ImmutableComponent { this.onDragOver = this.onDragOver.bind(this) this.onContextMenu = this.onContextMenu.bind(this) } + componentDidMount () { + this.bookmarkNode.addEventListener('auxclick', this.onAuxClick.bind(this)) + } get activeFrame () { return windowStore.getFrame(this.props.activeFrameKey) } + onAuxClick (e) { + this.onClick(e) + } onClick (e) { if (!this.props.clickBookmarkItem(this.props.bookmark, e) && this.props.bookmark.get('tags').includes(siteTags.BOOKMARK_FOLDER)) { diff --git a/app/renderer/components/preferences/paymentsTab.js b/app/renderer/components/preferences/paymentsTab.js index 7333776f6e8..59328bdf9b2 100644 --- a/app/renderer/components/preferences/paymentsTab.js +++ b/app/renderer/components/preferences/paymentsTab.js @@ -11,6 +11,7 @@ const getSetting = require('../../../../js/settings').getSetting const settings = require('../../../../js/constants/settings') const ModalOverlay = require('../../../../js/components/modalOverlay') const coinbaseCountries = require('../../../../js/constants/coinbaseCountries') +const {changeSetting} = require('../../lib/settingsUtil') const moment = require('moment') moment.locale(navigator.language) @@ -18,6 +19,7 @@ moment.locale(navigator.language) const Button = require('../../../../js/components/button') const {FormTextbox, RecoveryKeyTextbox} = require('../textbox') const {FormDropdown, SettingDropdown} = require('../dropdown') +const {SettingsList, SettingItem, SettingCheckbox} = require('../settings') class PaymentsTab extends ImmutableComponent { constructor () { @@ -228,7 +230,6 @@ class PaymentsTab extends ImmutableComponent { get advancedSettingsContent () { const minDuration = this.props.ledgerData.getIn(['synopsisOptions', 'minDuration']) const minPublisherVisits = this.props.ledgerData.getIn(['synopsisOptions', 'minPublisherVisits']) - const {SettingsList, SettingItem, SettingCheckbox, changeSetting} = require('../../../../js/about/preferences') return
@@ -326,8 +327,6 @@ class PaymentsTab extends ImmutableComponent { } get ledgerRecoveryContent () { - const {SettingsList, SettingItem} = require('../../../../js/about/preferences') - const l10nDataArgs = { balance: this.btcToCurrencyString(this.props.ledgerData.get('balance')) } @@ -476,7 +475,6 @@ class PaymentsTab extends ImmutableComponent { } get enabledContent () { - const {SettingsList, SettingItem, changeSetting} = require('../../../../js/about/preferences') // TODO: report when funds are too low // TODO: support non-USD currency return
@@ -541,7 +539,6 @@ class PaymentsTab extends ImmutableComponent { } render () { - const {SettingCheckbox} = require('../../../../js/about/preferences') return
{ this.enabled && this.props.addFundsOverlayVisible diff --git a/app/renderer/components/publisherToggle.js b/app/renderer/components/publisherToggle.js index 1a9dc976cc7..0fa55d14182 100644 --- a/app/renderer/components/publisherToggle.js +++ b/app/renderer/components/publisherToggle.js @@ -73,8 +73,8 @@ class PublisherToggle extends ImmutableComponent { get shouldShowAddPublisherButton () { if ((!!this.hostSettings || !!this.validPublisherSynopsis) && this.visiblePublisher) { - // Only show publisher icon if autoSuggest option is OFF - return !getSetting(settings.AUTO_SUGGEST_SITES) + // Only show publisher icon if ledger is enabled + return getSetting(settings.PAYMENTS_ENABLED) } return false } @@ -89,11 +89,6 @@ class PublisherToggle extends ImmutableComponent { } onAuthorizePublisher () { - // if payments disabled, enable it - if (!getSetting(settings.AUTO_SUGGEST_SITES)) { - appActions.changeSetting(settings.PAYMENTS_ENABLED, true) - } - this.authorizedPublisher ? appActions.changeSiteSetting(this.hostPattern, 'ledgerPayments', false) : appActions.changeSiteSetting(this.hostPattern, 'ledgerPayments', true) diff --git a/app/renderer/components/settings.js b/app/renderer/components/settings.js index b4a77caefa6..58e37a6cc4b 100644 --- a/app/renderer/components/settings.js +++ b/app/renderer/components/settings.js @@ -4,6 +4,10 @@ const React = require('react') const ImmutableComponent = require('../../../js/components/immutableComponent') +const aboutActions = require('../../../js/about/aboutActions') +const getSetting = require('../../../js/settings').getSetting +const {changeSetting} = require('../lib/settingsUtil') +const SwitchControl = require('../../../js/components/switchControl') class SettingsList extends ImmutableComponent { render () { @@ -33,7 +37,72 @@ class SettingItem extends ImmutableComponent { } } +class SettingCheckbox extends ImmutableComponent { + constructor () { + super() + this.onClick = this.onClick.bind(this) + } + + onClick (e) { + if (this.props.disabled) { + return + } + return this.props.onChange ? this.props.onChange(e) : changeSetting(this.props.onChangeSetting, this.props.prefKey, e) + } + + render () { + const props = { + style: this.props.style, + className: 'settingItem' + } + if (this.props.id) { + props.id = this.props.id + } + return
+ +
+ } +} + +class SiteSettingCheckbox extends ImmutableComponent { + constructor () { + super() + this.onClick = this.onClick.bind(this) + } + + onClick (e) { + if (this.props.disabled || !this.props.hostPattern) { + return + } else { + const value = !!e.target.value + value === this.props.defaultValue + ? aboutActions.removeSiteSetting(this.props.hostPattern, + this.props.prefKey) + : aboutActions.changeSiteSetting(this.props.hostPattern, + this.props.prefKey, value) + } + } + + render () { + return
+ +
+ } +} + module.exports = { SettingsList, - SettingItem + SettingItem, + SettingCheckbox, + SiteSettingCheckbox } diff --git a/app/renderer/components/styles/global.js b/app/renderer/components/styles/global.js index 2f0e53bfeeb..a0c4ab8487b 100644 --- a/app/renderer/components/styles/global.js +++ b/app/renderer/components/styles/global.js @@ -105,7 +105,8 @@ const globalStyles = { sideBarWidth: '190px', aboutPageSectionPadding: '24px', defaultTabPadding: '0 4px', - defaultIconPadding: '0 2px' + defaultIconPadding: '2px', + iconSize: '16px' }, shadow: { switchShadow: 'inset 0 1px 4px rgba(0, 0, 0, 0.35)', @@ -126,7 +127,8 @@ const globalStyles = { transitionFastEase: 'all 100ms ease', transitionSlowEase: 'all 1s ease', switchBGTransition: 'background-color 100ms', - switchNubTransition: 'right 100ms' + switchNubTransition: 'right 100ms', + tabBackgroundTransition: 'background-color 100ms linear' }, zindex: { zindexWindowNotActive: '900', diff --git a/app/renderer/components/styles/tab.js b/app/renderer/components/styles/tab.js index c01c601442f..9f1f0aeeebb 100644 --- a/app/renderer/components/styles/tab.js +++ b/app/renderer/components/styles/tab.js @@ -22,7 +22,7 @@ const styles = StyleSheet.create({ display: 'flex', height: '23px', marginTop: '2px', - transition: 'transform 200ms ease', + transition: `transform 200ms ease, ${globalStyles.transition.tabBackgroundTransition}`, left: '0', opacity: '1', width: '100%', @@ -43,9 +43,13 @@ const styles = StyleSheet.create({ }, narrowViewPlayIndicator: { - borderWidth: '2px 0 0', + borderWidth: '2px 1px 0', borderStyle: 'solid', - borderColor: 'lightskyblue' + borderColor: 'lightskyblue transparent transparent' + }, + + activeTabNarrowViewPlayIndicator: { + borderColor: `lightskyblue ${globalStyles.color.chromeControlsBackground} ${globalStyles.color.chromeControlsBackground}` }, tabNarrowestView: { @@ -82,7 +86,8 @@ const styles = StyleSheet.create({ }, isPinned: { - padding: globalStyles.spacing.defaultIconPadding + paddingLeft: globalStyles.spacing.defaultIconPadding, + paddingRight: globalStyles.spacing.defaultIconPadding }, active: { diff --git a/app/renderer/components/tabContent.js b/app/renderer/components/tabContent.js index 69ba87e6662..9f2b1058597 100644 --- a/app/renderer/components/tabContent.js +++ b/app/renderer/components/tabContent.js @@ -19,8 +19,8 @@ class TabIcon extends ImmutableComponent { fontSize: 'inherit', display: 'flex', alignSelf: 'center', - width: '16px', - height: '16px', + width: globalStyles.spacing.iconSize, + height: globalStyles.spacing.iconSize, alignItems: 'center', justifyContent: 'center' } @@ -147,17 +147,32 @@ class TabTitle extends ImmutableComponent { return this.props.tabProps.get('audioPlaybackActive') || this.props.tabProps.get('audioMuted') } + get hoveredOnNarrowView () { + const sizes = ['mediumSmall', 'small', 'extraSmall', 'smallest'] + return this.props.tabProps.get('hoverState') && sizes.includes(this.props.tabProps.get('breakpoint')) + } + get shouldHideTitle () { return (this.props.tabProps.get('breakpoint') === 'largeMedium' && this.pageCanPlayAudio && this.locationHasSecondaryIcon) || (this.props.tabProps.get('breakpoint') === 'mediumSmall' && this.locationHasSecondaryIcon) || - this.props.tabProps.get('breakpoint') === 'extraSmall' || this.props.tabProps.get('breakpoint') === 'smallest' + this.props.tabProps.get('breakpoint') === 'extraSmall' || this.props.tabProps.get('breakpoint') === 'smallest' || + this.hoveredOnNarrowView } render () { + const titleStyles = StyleSheet.create({ + reduceTitleSize: { + // include a margin gutter with same size + // as closeTabIcon to avoid title overflow + // when hovering over a tab + marginRight: `calc(${globalStyles.spacing.iconSize} + ${globalStyles.spacing.defaultIconPadding})` + } + }) return !this.isPinned && !this.shouldHideTitle ?
{ this.node = node }} + className={cx({ + selected: this.props.selected, + suggestionItem: true, + [this.props.suggestion.type]: true + })}> + { + this.props.suggestion.type !== suggestionTypes.TOP_SITE && this.props.suggestion.title + ?
{this.props.suggestion.title}
+ : null + } + { + this.props.suggestion.type !== suggestionTypes.SEARCH && this.props.suggestion.type !== suggestionTypes.ABOUT_PAGES + ?
{this.props.suggestion.location}
+ : null + } + + } +} + +module.exports = UrlBarSuggestionItem diff --git a/app/renderer/components/urlBarSuggestions.js b/app/renderer/components/urlBarSuggestions.js index f0aaf1693ef..1254a84eb71 100644 --- a/app/renderer/components/urlBarSuggestions.js +++ b/app/renderer/components/urlBarSuggestions.js @@ -3,10 +3,10 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ const React = require('react') - -const windowActions = require('../../../js/actions/windowActions') const ImmutableComponent = require('../../../js/components/immutableComponent') +const UrlBarSuggestionItem = require('./urlBarSuggestionItem') +const windowActions = require('../../../js/actions/windowActions') const suggestionTypes = require('../../../js/constants/suggestionTypes') const cx = require('../../../js/lib/classSet') const locale = require('../../../js/l10n') @@ -16,6 +16,7 @@ class UrlBarSuggestions extends ImmutableComponent { constructor () { super() this.onSuggestionClicked = this.onSuggestionClicked.bind(this) + this.onMouseOver = this.onMouseOver.bind(this) } get activeIndex () { @@ -63,27 +64,13 @@ class UrlBarSuggestions extends ImmutableComponent { items = items.concat(suggestions.map((suggestion, i) => { const currentIndex = index + i const selected = this.activeIndex === currentIndex || (!this.activeIndex && currentIndex === 0 && this.props.hasLocationValueSuffix) - return
  • { selected && (this.selectedElement = node) }} - className={cx({ - selected, - suggestionItem: true, - [suggestion.type]: true - })}> - { - suggestion.type !== suggestionTypes.TOP_SITE && suggestion.title - ?
    {suggestion.title}
    - : null - } - { - suggestion.type !== suggestionTypes.SEARCH && suggestion.type !== suggestionTypes.ABOUT_PAGES - ?
    {suggestion.location}
    - : null - } -
  • + return })) index += suggestions.size } @@ -109,12 +96,6 @@ class UrlBarSuggestions extends ImmutableComponent { componentDidMount () { } - componentWillUpdate (nextProps) { - if (this.selectedElement) { - this.selectedElement.scrollIntoView() - } - } - updateSuggestions (newIndex) { const suggestions = this.suggestionList || this.props.suggestionList if (!suggestions) { diff --git a/app/renderer/lib/settingsUtil.js b/app/renderer/lib/settingsUtil.js new file mode 100644 index 00000000000..825d478de82 --- /dev/null +++ b/app/renderer/lib/settingsUtil.js @@ -0,0 +1,25 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +module.exports.changeSetting = (cb, key, e) => { + if (e.target.type === 'checkbox') { + cb(key, e.target.value) + } else { + let value = e.target.value + if (e.target.dataset && e.target.dataset.type === 'number') { + value = parseInt(value, 10) + } else if (e.target.dataset && e.target.dataset.type === 'float') { + value = parseFloat(value) + } + if (e.target.type === 'number') { + value = value.replace(/\D/g, '') + value = parseInt(value, 10) + if (Number.isNaN(value)) { + return + } + value = Math.min(e.target.getAttribute('max'), Math.max(value, e.target.getAttribute('min'))) + } + cb(key, value) + } +} diff --git a/img/toolbar/verified_white_icon.svg b/img/toolbar/verified_white_icon.svg new file mode 100644 index 00000000000..c46c0a0f9fb --- /dev/null +++ b/img/toolbar/verified_white_icon.svg @@ -0,0 +1,15 @@ + + + + +verified_green_icon + + + + + diff --git a/js/about/bookmarks.js b/js/about/bookmarks.js index abf96166281..3cb39bc584e 100644 --- a/js/about/bookmarks.js +++ b/js/about/bookmarks.js @@ -337,8 +337,8 @@ class BookmarksList extends ImmutableComponent { , - 'Last Visited' + , + ]} defaultHeading='Title' rows={this.props.bookmarks.map((entry) => [ diff --git a/js/about/entry.js b/js/about/entry.js index 21cce45ea98..a00e51b0617 100644 --- a/js/about/entry.js +++ b/js/about/entry.js @@ -74,7 +74,7 @@ switch (getBaseUrl(getSourceAboutUrl(window.location.href))) { element = require('./history') break case 'about:newtab': - element = require('./newtab') + element = require('./newtab').AboutNewTab break case 'about:passwords': element = require('./passwords') diff --git a/js/about/newTabComponents/footerInfo.js b/js/about/newTabComponents/footerInfo.js index d8ae0e5c0fa..1919354a392 100644 --- a/js/about/newTabComponents/footerInfo.js +++ b/js/about/newTabComponents/footerInfo.js @@ -8,15 +8,18 @@ const {aboutUrls} = require('../../lib/appUrlUtil') class FooterInfo extends ImmutableComponent { render () { - if (!this.props.backgroundImage.name) { - return null - } return