Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Merge pull request #8941 from NejcZdovc/refactor/files2
Browse files Browse the repository at this point in the history
Moves components from js to app
  • Loading branch information
NejcZdovc authored May 18, 2017
2 parents 8c73ba3 + 02f2aa0 commit 64c48d5
Show file tree
Hide file tree
Showing 67 changed files with 407 additions and 310 deletions.
4 changes: 2 additions & 2 deletions app/renderer/components/autofill/autofillAddressPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

const React = require('react')
const ImmutableComponent = require('../immutableComponent')
const Dialog = require('../../../../js/components/dialog')
const Button = require('../../../../js/components/button')
const Dialog = require('../common/dialog')
const Button = require('../common/button')
const windowActions = require('../../../../js/actions/windowActions')
const appActions = require('../../../../js/actions/appActions')
const KeyCodes = require('../../../common/constants/keyCodes')
Expand Down
4 changes: 2 additions & 2 deletions app/renderer/components/autofill/autofillCreditCardPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

const React = require('react')
const ImmutableComponent = require('../immutableComponent')
const Dialog = require('../../../../js/components/dialog')
const Button = require('../../../../js/components/button')
const Dialog = require('../common/dialog')
const Button = require('../common/button')
const windowActions = require('../../../../js/actions/windowActions')
const appActions = require('../../../../js/actions/appActions')
const KeyCodes = require('../../../common/constants/keyCodes')
Expand Down
2 changes: 1 addition & 1 deletion app/renderer/components/bookmarks/addEditBookmarkHanger.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const React = require('react')

// Components
const ImmutableComponent = require('../immutableComponent')
const Dialog = require('../../../../js/components/dialog')
const Dialog = require('../common/dialog')
const BrowserButton = require('../common/browserButton')

// Actions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */

const React = require('react')
const ImmutableComponent = require('../../app/renderer/components/immutableComponent')
const cx = require('../lib/classSet')
const ImmutableComponent = require('../immutableComponent')
const cx = require('../../../../js/lib/classSet')

/**
* ************************************************************
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,20 @@

const React = require('react')
const Immutable = require('immutable')
const ImmutableComponent = require('../../app/renderer/components/immutableComponent')
const windowActions = require('../actions/windowActions')
const cx = require('../lib/classSet')
const KeyCodes = require('../../app/common/constants/keyCodes')
const {formatAccelerator, wrappingClamp} = require('../../app/common/lib/formatUtil')
const separatorMenuItem = require('../../app/common/commonMenu').separatorMenuItem
const keyCodes = require('../../app/common/constants/keyCodes')

// Components
const ImmutableComponent = require('../immutableComponent')

// Actions
const windowActions = require('../../../../js/actions/windowActions')

// Constants
const keyCodes = require('../../../common/constants/keyCodes')

// Utils
const cx = require('../../../../js/lib/classSet')
const {formatAccelerator, wrappingClamp} = require('../../../common/lib/formatUtil')
const {separatorMenuItem} = require('../../../common/commonMenu')

class ContextMenuItem extends ImmutableComponent {
componentDidMount () {
Expand Down Expand Up @@ -295,7 +302,7 @@ class ContextMenu extends ImmutableComponent {

switch (e.keyCode) {
case keyCodes.ENTER:
case KeyCodes.TAB:
case keyCodes.TAB:
if (e.keyCode === keyCodes.ENTER) {
e.preventDefault()
}
Expand All @@ -310,7 +317,7 @@ class ContextMenu extends ImmutableComponent {
windowActions.resetMenuState()
break

case KeyCodes.ESC:
case keyCodes.ESC:
windowActions.resetMenuState()
break

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,15 @@

const React = require('react')
const PropTypes = require('prop-types')
const ImmutableComponent = require('../../app/renderer/components/immutableComponent')
const KeyCodes = require('../../app/common/constants/keyCodes')
const cx = require('../lib/classSet')

// Components
const ImmutableComponent = require('../immutableComponent')

// Constants
const KeyCodes = require('../../../common/constants/keyCodes')

// Utils
const cx = require('../../../../js/lib/classSet')

/**
* Represents a popup dialog
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
const React = require('react')
const PropTypes = require('prop-types')
const ReactDOM = require('react-dom')
const ImmutableComponent = require('../../app/renderer/components/immutableComponent')
const ImmutableComponent = require('../immutableComponent')

/**
* Represents a button in a Dialog
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */

const React = require('react')
const ImmutableComponent = require('../../app/renderer/components/immutableComponent')
const ImmutableComponent = require('../immutableComponent')

class LongPressButton extends ImmutableComponent {
constructor () {
Expand Down
4 changes: 2 additions & 2 deletions app/renderer/components/common/messageBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ const {StyleSheet, css} = require('aphrodite')

// Components
const ReduxComponent = require('../reduxComponent')
const Dialog = require('../../../../js/components/dialog')
const Dialog = require('./dialog')
const BrowserButton = require('../common/browserButton')
const SwitchControl = require('../../../../js/components/switchControl')
const SwitchControl = require('./switchControl')

// Actions
const appActions = require('../../../../js/actions/appActions')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */

const React = require('react')
const ImmutableComponent = require('../../app/renderer/components/immutableComponent')
const cx = require('../lib/classSet')
const ImmutableComponent = require('../immutableComponent')
const cx = require('../../../../js/lib/classSet')
const Button = require('./button')

const {StyleSheet, css} = require('aphrodite/no-important')
const globalStyles = require('../../app/renderer/components/styles/global')
const globalStyles = require('../styles/global')

const closeButton = require('../../img/toolbar/stoploading_btn.svg')
const closeButton = require('../../../../img/toolbar/stoploading_btn.svg')

/**
* Represents a modal overlay
Expand Down
2 changes: 1 addition & 1 deletion app/renderer/components/common/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const {StyleSheet, css} = require('aphrodite')
const aboutActions = require('../../../../js/about/aboutActions')
const getSetting = require('../../../../js/settings').getSetting
const {changeSetting} = require('../../lib/settingsUtil')
const SwitchControl = require('../../../../js/components/switchControl')
const SwitchControl = require('./switchControl')
const cx = require('../../../../js/lib/classSet')
const settings = require('../../../../js/constants/settings')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
const React = require('react')
const Immutable = require('immutable')
const tableSort = require('tablesort')
const cx = require('../lib/classSet')
const eventUtil = require('../lib/eventUtil')

// Utils
const cx = require('../../../../js/lib/classSet')
const eventUtil = require('../../../../js/lib/eventUtil')

tableSort.extend('number', (item) => {
return typeof item === 'number'
Expand Down Expand Up @@ -212,7 +214,7 @@ class SortableTable extends React.Component {
// Set the ghost drag icon to default of SVG of multiple pages
// TODO: does this cause a memory leak if you continually drag items?
const dragImage = document.createElement('img')
dragImage.src = require('../../img/cursor_multi_copy_pages.svg')
dragImage.src = require('../../../../img/cursor_multi_copy_pages.svg')
e.dataTransfer.setDragImage(dragImage, 15, 30)

// Call the provided onDragStart handler with the list of selected objects
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */

const React = require('react')
const ImmutableComponent = require('../../app/renderer/components/immutableComponent')
const cx = require('../lib/classSet')
const ImmutableComponent = require('../immutableComponent')
const cx = require('../../../../js/lib/classSet')

/**
* Represents an on/off switch control
Expand Down
2 changes: 1 addition & 1 deletion app/renderer/components/download/downloadItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const React = require('react')

// Components
const ImmutableComponent = require('../immutableComponent')
const Button = require('../../../../js/components/button')
const Button = require('../common/button')

// Constants
const downloadStates = require('../../../../js/constants/downloadStates')
Expand Down
2 changes: 1 addition & 1 deletion app/renderer/components/download/downloadsBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const React = require('react')

// Components
const ImmutableComponent = require('../immutableComponent')
const Button = require('../../../../js/components/button')
const Button = require('../common/button')
const DownloadItem = require('./downloadItem')

// Actions
Expand Down
58 changes: 29 additions & 29 deletions js/components/frame.js → app/renderer/components/frame/frame.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,52 +7,52 @@ const Immutable = require('immutable')
const ipc = require('electron').ipcRenderer

// Actions
const appActions = require('../actions/appActions')
const windowActions = require('../actions/windowActions')
const webviewActions = require('../actions/webviewActions')
const getSetting = require('../settings').getSetting
const appActions = require('../../../../js/actions/appActions')
const windowActions = require('../../../../js/actions/windowActions')
const webviewActions = require('../../../../js/actions/webviewActions')
const getSetting = require('../../../../js/settings').getSetting

// Components
const ReduxComponent = require('../../app/renderer/components/reduxComponent')
const FullScreenWarning = require('../../app/renderer/components/fullScreenWarning')
const MessageBox = require('../../app/renderer/components/common/messageBox')
const ReduxComponent = require('../reduxComponent')
const FullScreenWarning = require('./fullScreenWarning')
const MessageBox = require('../common/messageBox')

// Store
const windowStore = require('../stores/windowStore')
const appStoreRenderer = require('../stores/appStoreRenderer')
const windowStore = require('../../../../js/stores/windowStore')
const appStoreRenderer = require('../../../../js/stores/appStoreRenderer')

// State
const siteSettings = require('../state/siteSettings')
const siteSettingsState = require('../../app/common/state/siteSettingsState')
const tabState = require('../../app/common/state/tabState')
const siteSettings = require('../../../../js/state/siteSettings')
const siteSettingsState = require('../../../common/state/siteSettingsState')
const tabState = require('../../../common/state/tabState')

// Utils
const frameStateUtil = require('../state/frameStateUtil')
const siteUtil = require('../state/siteUtil')
const UrlUtil = require('../lib/urlutil')
const cx = require('../lib/classSet')
const urlParse = require('../../app/common/urlParse')
const contextMenus = require('../contextMenus')
const domUtil = require('../../app/renderer/lib/domUtil')
const frameStateUtil = require('../../../../js/state/frameStateUtil')
const siteUtil = require('../../../../js/state/siteUtil')
const UrlUtil = require('../../../../js/lib/urlutil')
const cx = require('../../../../js/lib/classSet')
const urlParse = require('../../../common/urlParse')
const contextMenus = require('../../../../js/contextMenus')
const domUtil = require('../../lib/domUtil')
const {
aboutUrls,
isSourceMagnetUrl,
isTargetAboutUrl,
getTargetAboutUrl,
getBaseUrl,
isIntermediateAboutPage
} = require('../lib/appUrlUtil')
const {isFrameError, isAborted} = require('../../app/common/lib/httpUtil')
const {isFocused} = require('../../app/renderer/currentWindow')
const debounce = require('../lib/debounce')
const locale = require('../l10n')
const imageUtil = require('../lib/imageUtil')
} = require('../../../../js/lib/appUrlUtil')
const {isFrameError, isAborted} = require('../../../common/lib/httpUtil')
const {isFocused} = require('../../currentWindow')
const debounce = require('../../../../js/lib/debounce')
const locale = require('../../../../js/l10n')
const imageUtil = require('../../../../js/lib/imageUtil')

// Constants
const settings = require('../constants/settings')
const appConfig = require('../constants/appConfig')
const messages = require('../constants/messages')
const config = require('../constants/config')
const settings = require('../../../../js/constants/settings')
const appConfig = require('../../../../js/constants/appConfig')
const messages = require('../../../../js/constants/messages')
const config = require('../../../../js/constants/config')

const pdfjsOrigin = `chrome-extension://${config.PDFJSExtensionId}/`
const WEBRTC_DEFAULT = 'default'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */

const React = require('react')
const ImmutableComponent = require('./immutableComponent')
const urlResolve = require('url').resolve

const {StyleSheet, css} = require('aphrodite/no-important')
const ImmutableComponent = require('../immutableComponent')

class FullScreenWarning extends ImmutableComponent {
render () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,24 @@

const React = require('react')
const Immutable = require('immutable')
const ImmutableComponent = require('../../app/renderer/components/immutableComponent')
const config = require('../constants/config')
const Dialog = require('./dialog')
const SwitchControl = require('./switchControl')
const {FormDropdown} = require('../../app/renderer/components/common/dropdown')
const windowActions = require('../actions/windowActions')
const appActions = require('../actions/appActions')
const urlParse = require('../../app/common/urlParse')
const cx = require('../lib/classSet')
const siteUtil = require('../state/siteUtil')

// Components
const ImmutableComponent = require('../immutableComponent')
const Dialog = require('../common/dialog')
const SwitchControl = require('../common/switchControl')
const {FormDropdown} = require('../common/dropdown')

// Constants
const config = require('../../../../js/constants/config')

// Actions
const windowActions = require('../../../../js/actions/windowActions')
const appActions = require('../../../../js/actions/appActions')

// Utils
const urlParse = require('../../../common/urlParse')
const cx = require('../../../../js/lib/classSet')
const siteUtil = require('../../../../js/state/siteUtil')

class BraveryPanel extends ImmutableComponent {
constructor () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,30 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */

const React = require('react')
const {StyleSheet, css} = require('aphrodite/no-important')

// Components
const ImmutableComponent = require('./immutableComponent')
const Dialog = require('../../../js/components/dialog')
const BrowserButton = require('./common/browserButton')
const SwitchControl = require('../../../js/components/switchControl')
const ImmutableComponent = require('../immutableComponent')
const Dialog = require('../common/dialog')
const BrowserButton = require('../common/browserButton')
const SwitchControl = require('../common/switchControl')

// Actions
const appActions = require('../../../js/actions/appActions')
const windowActions = require('../../../js/actions/windowActions')
const appActions = require('../../../../js/actions/appActions')
const windowActions = require('../../../../js/actions/windowActions')

// Constants
const settings = require('../../../js/constants/settings')

const {StyleSheet, css} = require('aphrodite/no-important')
const globalStyles = require('./styles/global')
const settings = require('../../../../js/constants/settings')

const braveAbout = require('../../extensions/brave/img/braveAbout.png')
// Styles
const globalStyles = require('../styles/global')
const braveAbout = require('../../../extensions/brave/img/braveAbout.png')

const {
CommonFormMedium,
CommonFormSection,
CommonFormButtonWrapper
} = require('./common/commonForm')
} = require('../common/commonForm')

class CheckDefaultBrowserDialog extends ImmutableComponent {
constructor () {
Expand Down
Loading

0 comments on commit 64c48d5

Please sign in to comment.