Compare commits
1 Commits
update-to-
...
fix-dep
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9749b43cfa |
13170
package-lock.json
generated
13170
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -22,6 +22,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@electron/remote": "2.0.8",
|
"@electron/remote": "2.0.8",
|
||||||
|
"@material-ui/core": "4.12.4",
|
||||||
"airplayer": "github:webtorrent/airplayer#fix-security",
|
"airplayer": "github:webtorrent/airplayer#fix-security",
|
||||||
"application-config": "2.0.0",
|
"application-config": "2.0.0",
|
||||||
"arch": "2.2.0",
|
"arch": "2.2.0",
|
||||||
@@ -39,7 +40,6 @@
|
|||||||
"iso-639-1": "2.1.15",
|
"iso-639-1": "2.1.15",
|
||||||
"languagedetect": "2.0.0",
|
"languagedetect": "2.0.0",
|
||||||
"location-history": "1.1.2",
|
"location-history": "1.1.2",
|
||||||
"material-ui": "0.20.2",
|
|
||||||
"music-metadata": "7.13.0",
|
"music-metadata": "7.13.0",
|
||||||
"network-address": "1.1.2",
|
"network-address": "1.1.2",
|
||||||
"parse-torrent": "9.1.5",
|
"parse-torrent": "9.1.5",
|
||||||
@@ -81,7 +81,7 @@
|
|||||||
"tape": "5.6.1"
|
"tape": "5.6.1"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^16.0.0",
|
"node": "^16.0.0 || ^18.0.0",
|
||||||
"npm": "^7.10.0 || ^8.0.0"
|
"npm": "^7.10.0 || ^8.0.0"
|
||||||
},
|
},
|
||||||
"homepage": "https://webtorrent.io",
|
"homepage": "https://webtorrent.io",
|
||||||
@@ -113,10 +113,12 @@
|
|||||||
"clean": "node ./bin/clean.js",
|
"clean": "node ./bin/clean.js",
|
||||||
"gh-release": "gh-release",
|
"gh-release": "gh-release",
|
||||||
"install-system-deps": "brew install fakeroot dpkg rpm",
|
"install-system-deps": "brew install fakeroot dpkg rpm",
|
||||||
|
"lint": "standard",
|
||||||
|
"lint:fix": "standard --fix",
|
||||||
"open-config": "node ./bin/open-config.js",
|
"open-config": "node ./bin/open-config.js",
|
||||||
"package": "node ./bin/package.js",
|
"package": "node ./bin/package.js",
|
||||||
"start": "npm run build && electron --no-sandbox .",
|
"start": "npm run build && electron --no-sandbox .",
|
||||||
"test": "standard && depcheck --ignores=standard,@babel/eslint-parser --ignore-dirs=build,dist",
|
"test": "npm run lint && depcheck --ignores=standard,@babel/eslint-parser --ignore-dirs=build,dist",
|
||||||
"test-integration": "npm run build && node ./test",
|
"test-integration": "npm run build && node ./test",
|
||||||
"update-authors": "./bin/update-authors.sh",
|
"update-authors": "./bin/update-authors.sh",
|
||||||
"watch": "nodemon --exec \"npm run start\" --ext js,css --ignore build/ --ignore dist/"
|
"watch": "nodemon --exec \"npm run start\" --ext js,css --ignore build/ --ignore dist/"
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ module.exports = class DeleteAllTorrentsModal extends React.Component {
|
|||||||
<p><strong>{message}</strong></p>
|
<p><strong>{message}</strong></p>
|
||||||
<ModalOKCancel
|
<ModalOKCancel
|
||||||
cancelText='CANCEL'
|
cancelText='CANCEL'
|
||||||
|
color='secondary'
|
||||||
onCancel={dispatcher('exitModal')}
|
onCancel={dispatcher('exitModal')}
|
||||||
okText={buttonText}
|
okText={buttonText}
|
||||||
onOK={handleRemove}
|
onOK={handleRemove}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
const React = require('react')
|
const React = require('react')
|
||||||
const PropTypes = require('prop-types')
|
const PropTypes = require('prop-types')
|
||||||
|
|
||||||
const colors = require('material-ui/styles/colors')
|
const grey = require('@material-ui/core/colors/grey').default
|
||||||
|
|
||||||
class Heading extends React.Component {
|
class Heading extends React.Component {
|
||||||
static get propTypes () {
|
static get propTypes () {
|
||||||
@@ -19,7 +19,7 @@ class Heading extends React.Component {
|
|||||||
render () {
|
render () {
|
||||||
const HeadingTag = 'h' + this.props.level
|
const HeadingTag = 'h' + this.props.level
|
||||||
const style = {
|
const style = {
|
||||||
color: colors.grey100,
|
color: grey['100'],
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
marginBottom: 15,
|
marginBottom: 15,
|
||||||
marginTop: 30
|
marginTop: 30
|
||||||
|
|||||||
@@ -1,26 +1,28 @@
|
|||||||
const React = require('react')
|
const React = require('react')
|
||||||
const FlatButton = require('material-ui/FlatButton').default
|
const Button = require('@material-ui/core/Button').default
|
||||||
const RaisedButton = require('material-ui/RaisedButton').default
|
|
||||||
|
|
||||||
module.exports = class ModalOKCancel extends React.Component {
|
module.exports = class ModalOKCancel extends React.Component {
|
||||||
render () {
|
render () {
|
||||||
const cancelStyle = { marginRight: 10, color: 'black' }
|
const cancelStyle = { marginRight: 10, color: 'black' }
|
||||||
const { cancelText, onCancel, okText, onOK } = this.props
|
const { cancelText, color = 'primary', onCancel, okText, onOK } = this.props
|
||||||
return (
|
return (
|
||||||
<div className='float-right'>
|
<div className='float-right'>
|
||||||
<FlatButton
|
<Button
|
||||||
className='control cancel'
|
className='control cancel'
|
||||||
style={cancelStyle}
|
|
||||||
label={cancelText}
|
|
||||||
onClick={onCancel}
|
onClick={onCancel}
|
||||||
/>
|
style={cancelStyle}
|
||||||
<RaisedButton
|
>
|
||||||
className='control ok'
|
{cancelText}
|
||||||
primary
|
</Button>
|
||||||
label={okText}
|
<Button
|
||||||
onClick={onOK}
|
|
||||||
autoFocus
|
autoFocus
|
||||||
/>
|
className='control ok'
|
||||||
|
onClick={onOK}
|
||||||
|
color={color}
|
||||||
|
variant='contained'
|
||||||
|
>
|
||||||
|
{okText}
|
||||||
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
const React = require('react')
|
const React = require('react')
|
||||||
const TextField = require('material-ui/TextField').default
|
const TextField = require('@material-ui/core/TextField').default
|
||||||
const { clipboard } = require('electron')
|
const { clipboard } = require('electron')
|
||||||
|
|
||||||
const ModalOKCancel = require('./modal-ok-cancel')
|
const ModalOKCancel = require('./modal-ok-cancel')
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
const path = require('path')
|
const path = require('path')
|
||||||
|
|
||||||
const colors = require('material-ui/styles/colors')
|
|
||||||
const remote = require('@electron/remote')
|
const remote = require('@electron/remote')
|
||||||
const React = require('react')
|
const React = require('react')
|
||||||
const PropTypes = require('prop-types')
|
const PropTypes = require('prop-types')
|
||||||
|
|
||||||
const RaisedButton = require('material-ui/RaisedButton').default
|
const Button = require('@material-ui/core/Button').default
|
||||||
const TextField = require('material-ui/TextField').default
|
const TextField = require('@material-ui/core/TextField').default
|
||||||
|
const grey = require('@material-ui/core/colors/grey').default
|
||||||
|
|
||||||
// Lets you pick a file or directory.
|
// Lets you pick a file or directory.
|
||||||
// Uses the system Open File dialog.
|
// Uses the system Open File dialog.
|
||||||
@@ -53,10 +53,8 @@ class PathSelector extends React.Component {
|
|||||||
textOverflow: 'ellipsis',
|
textOverflow: 'ellipsis',
|
||||||
whiteSpace: 'nowrap'
|
whiteSpace: 'nowrap'
|
||||||
}
|
}
|
||||||
const textareaStyle = {
|
|
||||||
color: colors.grey50
|
|
||||||
}
|
|
||||||
const textFieldStyle = {
|
const textFieldStyle = {
|
||||||
|
color: grey['50'],
|
||||||
flex: '1'
|
flex: '1'
|
||||||
}
|
}
|
||||||
const text = this.props.value || ''
|
const text = this.props.value || ''
|
||||||
@@ -70,13 +68,20 @@ class PathSelector extends React.Component {
|
|||||||
{this.props.title}:
|
{this.props.title}:
|
||||||
</div>
|
</div>
|
||||||
<TextField
|
<TextField
|
||||||
className='control' disabled id={id} value={text}
|
className='control'
|
||||||
inputStyle={textareaStyle} style={textFieldStyle}
|
disabled
|
||||||
|
id={id}
|
||||||
|
style={textFieldStyle}
|
||||||
|
value={text}
|
||||||
/>
|
/>
|
||||||
<RaisedButton
|
<Button
|
||||||
className='control' label='Change' onClick={this.handleClick}
|
className='control'
|
||||||
|
onClick={this.handleClick}
|
||||||
style={buttonStyle}
|
style={buttonStyle}
|
||||||
/>
|
variant='contained'
|
||||||
|
>
|
||||||
|
Change
|
||||||
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ module.exports = class RemoveTorrentModal extends React.Component {
|
|||||||
<p><strong>{message}</strong></p>
|
<p><strong>{message}</strong></p>
|
||||||
<ModalOKCancel
|
<ModalOKCancel
|
||||||
cancelText='CANCEL'
|
cancelText='CANCEL'
|
||||||
|
color='secondary'
|
||||||
onCancel={dispatcher('exitModal')}
|
onCancel={dispatcher('exitModal')}
|
||||||
okText={buttonText}
|
okText={buttonText}
|
||||||
onOK={handleRemove}
|
onOK={handleRemove}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
const React = require('react')
|
const React = require('react')
|
||||||
const PropTypes = require('prop-types')
|
const PropTypes = require('prop-types')
|
||||||
|
|
||||||
const RaisedButton = require('material-ui/RaisedButton').default
|
const Button = require('@material-ui/core/Button').default
|
||||||
|
|
||||||
class ShowMore extends React.Component {
|
class ShowMore extends React.Component {
|
||||||
static get propTypes () {
|
static get propTypes () {
|
||||||
@@ -42,11 +42,13 @@ class ShowMore extends React.Component {
|
|||||||
return (
|
return (
|
||||||
<div className='show-more' style={this.props.style}>
|
<div className='show-more' style={this.props.style}>
|
||||||
{this.state.expanded ? this.props.children : null}
|
{this.state.expanded ? this.props.children : null}
|
||||||
<RaisedButton
|
<Button
|
||||||
className='control'
|
className='control'
|
||||||
onClick={this.handleClick}
|
onClick={this.handleClick}
|
||||||
label={label}
|
variant='contained'
|
||||||
/>
|
>
|
||||||
|
{label}
|
||||||
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
const colors = require('material-ui/styles/colors')
|
|
||||||
const createGetter = require('fn-getter')
|
const createGetter = require('fn-getter')
|
||||||
const React = require('react')
|
const React = require('react')
|
||||||
|
|
||||||
const darkBaseTheme = require('material-ui/styles/baseThemes/darkBaseTheme').default
|
const { ThemeProvider, createTheme } = require('@material-ui/core/styles')
|
||||||
const getMuiTheme = require('material-ui/styles/getMuiTheme').default
|
const grey = require('@material-ui/core/colors/grey').default
|
||||||
const MuiThemeProvider = require('material-ui/styles/MuiThemeProvider').default
|
const red = require('@material-ui/core/colors/red').default
|
||||||
|
|
||||||
const Header = require('../components/header')
|
const Header = require('../components/header')
|
||||||
|
|
||||||
@@ -33,17 +32,8 @@ const fontFamily = process.platform === 'win32'
|
|||||||
? '"Segoe UI", sans-serif'
|
? '"Segoe UI", sans-serif'
|
||||||
: 'BlinkMacSystemFont, "Helvetica Neue", Helvetica, sans-serif'
|
: 'BlinkMacSystemFont, "Helvetica Neue", Helvetica, sans-serif'
|
||||||
|
|
||||||
darkBaseTheme.fontFamily = fontFamily
|
let darkTheme
|
||||||
darkBaseTheme.userAgent = false
|
let lightTheme
|
||||||
darkBaseTheme.palette.primary1Color = colors.grey50
|
|
||||||
darkBaseTheme.palette.primary2Color = colors.grey50
|
|
||||||
darkBaseTheme.palette.primary3Color = colors.grey600
|
|
||||||
darkBaseTheme.palette.accent1Color = colors.redA200
|
|
||||||
darkBaseTheme.palette.accent2Color = colors.redA400
|
|
||||||
darkBaseTheme.palette.accent3Color = colors.redA100
|
|
||||||
|
|
||||||
let darkMuiTheme
|
|
||||||
let lightMuiTheme
|
|
||||||
|
|
||||||
class App extends React.Component {
|
class App extends React.Component {
|
||||||
render () {
|
render () {
|
||||||
@@ -64,19 +54,66 @@ class App extends React.Component {
|
|||||||
if (state.window.isFocused) cls.push('is-focused')
|
if (state.window.isFocused) cls.push('is-focused')
|
||||||
if (hideControls) cls.push('hide-video-controls')
|
if (hideControls) cls.push('hide-video-controls')
|
||||||
|
|
||||||
if (!darkMuiTheme) {
|
if (!darkTheme) {
|
||||||
darkMuiTheme = getMuiTheme(darkBaseTheme)
|
darkTheme = createTheme({
|
||||||
|
overrides: {
|
||||||
|
MuiButton: {
|
||||||
|
contained: {
|
||||||
|
backgroundColor: '#303030',
|
||||||
|
color: 'white',
|
||||||
|
'&:hover': {
|
||||||
|
backgroundColor: '#414141',
|
||||||
|
// Reset on touch devices, it doesn't add specificity
|
||||||
|
'@media (hover: none)': {
|
||||||
|
backgroundColor: '#303030',
|
||||||
|
color: 'white'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
MuiCheckbox: {
|
||||||
|
root: {
|
||||||
|
padding: '0px',
|
||||||
|
marginRight: '16px'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
MuiFormControlLabel: {
|
||||||
|
label: {
|
||||||
|
color: 'white',
|
||||||
|
fontSize: '0.875rem'
|
||||||
|
},
|
||||||
|
root: {
|
||||||
|
marginLeft: '0px',
|
||||||
|
marginRight: '0px'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
palette: {
|
||||||
|
primary: {
|
||||||
|
main: grey['50']
|
||||||
|
},
|
||||||
|
secondary: {
|
||||||
|
main: grey['50']
|
||||||
|
},
|
||||||
|
type: 'dark'
|
||||||
|
},
|
||||||
|
typography: {
|
||||||
|
fontFamily
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
userAgent: false
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<MuiThemeProvider muiTheme={darkMuiTheme}>
|
<ThemeProvider theme={darkTheme}>
|
||||||
<div className={'app ' + cls.join(' ')}>
|
<div className={'app ' + cls.join(' ')}>
|
||||||
<Header state={state} />
|
<Header state={state} />
|
||||||
{this.getErrorPopover()}
|
{this.getErrorPopover()}
|
||||||
<div key='content' className='content'>{this.getView()}</div>
|
<div key='content' className='content'>{this.getView()}</div>
|
||||||
{this.getModal()}
|
{this.getModal()}
|
||||||
</div>
|
</div>
|
||||||
</MuiThemeProvider>
|
</ThemeProvider>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -102,23 +139,32 @@ class App extends React.Component {
|
|||||||
const state = this.props.state
|
const state = this.props.state
|
||||||
if (!state.modal) return
|
if (!state.modal) return
|
||||||
|
|
||||||
if (!lightMuiTheme) {
|
if (!lightTheme) {
|
||||||
const lightBaseTheme = require('material-ui/styles/baseThemes/lightBaseTheme').default
|
lightTheme = createTheme({
|
||||||
lightBaseTheme.fontFamily = fontFamily
|
palette: {
|
||||||
lightBaseTheme.userAgent = false
|
secondary: {
|
||||||
lightMuiTheme = getMuiTheme(lightBaseTheme)
|
main: red.A200
|
||||||
|
},
|
||||||
|
type: 'light'
|
||||||
|
},
|
||||||
|
typography: {
|
||||||
|
fontFamily
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
userAgent: false
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const ModalContents = Modals[state.modal.id]()
|
const ModalContents = Modals[state.modal.id]()
|
||||||
return (
|
return (
|
||||||
<MuiThemeProvider muiTheme={lightMuiTheme}>
|
<ThemeProvider theme={lightTheme}>
|
||||||
<div key='modal' className='modal'>
|
<div key='modal' className='modal'>
|
||||||
<div key='modal-background' className='modal-background' />
|
<div key='modal-background' className='modal-background' />
|
||||||
<div key='modal-content' className='modal-content'>
|
<div key='modal-content' className='modal-content'>
|
||||||
<ModalContents state={state} />
|
<ModalContents state={state} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</MuiThemeProvider>
|
</ThemeProvider>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,17 +3,16 @@ const path = require('path')
|
|||||||
const prettyBytes = require('prettier-bytes')
|
const prettyBytes = require('prettier-bytes')
|
||||||
const React = require('react')
|
const React = require('react')
|
||||||
|
|
||||||
const { dispatch, dispatcher } = require('../lib/dispatcher')
|
const Button = require('@material-ui/core/Button').default
|
||||||
|
const TextField = require('@material-ui/core/TextField').default
|
||||||
const FlatButton = require('material-ui/FlatButton').default
|
const Checkbox = require('@material-ui/core/Checkbox').default
|
||||||
const RaisedButton = require('material-ui/RaisedButton').default
|
|
||||||
const TextField = require('material-ui/TextField').default
|
|
||||||
const Checkbox = require('material-ui/Checkbox').default
|
|
||||||
|
|
||||||
const CreateTorrentErrorPage = require('../components/create-torrent-error-page')
|
const CreateTorrentErrorPage = require('../components/create-torrent-error-page')
|
||||||
const Heading = require('../components/heading')
|
const Heading = require('../components/heading')
|
||||||
const ShowMore = require('../components/show-more')
|
const ShowMore = require('../components/show-more')
|
||||||
|
|
||||||
|
const { dispatch, dispatcher } = require('../lib/dispatcher')
|
||||||
|
|
||||||
// Shows a basic UI to create a torrent, from an already-selected file or folder.
|
// Shows a basic UI to create a torrent, from an already-selected file or folder.
|
||||||
// Includes a "Show Advanced..." button and more advanced UI.
|
// Includes a "Show Advanced..." button and more advanced UI.
|
||||||
class CreateTorrentPage extends React.Component {
|
class CreateTorrentPage extends React.Component {
|
||||||
@@ -99,20 +98,23 @@ class CreateTorrentPage extends React.Component {
|
|||||||
{this.renderAdvanced()}
|
{this.renderAdvanced()}
|
||||||
</ShowMore>
|
</ShowMore>
|
||||||
<div className='float-right'>
|
<div className='float-right'>
|
||||||
<FlatButton
|
<Button
|
||||||
className='control cancel'
|
className='control cancel'
|
||||||
label='Cancel'
|
onClick={dispatcher('cancel')}
|
||||||
style={{
|
style={{
|
||||||
marginRight: 10
|
marginRight: 10
|
||||||
}}
|
}}
|
||||||
onClick={dispatcher('cancel')}
|
>
|
||||||
/>
|
Cancel
|
||||||
<RaisedButton
|
</Button>
|
||||||
|
<Button
|
||||||
className='control create-torrent-button'
|
className='control create-torrent-button'
|
||||||
label='Create Torrent'
|
|
||||||
primary
|
|
||||||
onClick={this.handleSubmit}
|
onClick={this.handleSubmit}
|
||||||
/>
|
color='primary'
|
||||||
|
variant='contained'
|
||||||
|
>
|
||||||
|
Create Torrent
|
||||||
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
@@ -134,10 +136,6 @@ class CreateTorrentPage extends React.Component {
|
|||||||
fileElems.push(<div key='more'>+ {files.length - maxFileElems} more</div>)
|
fileElems.push(<div key='more'>+ {files.length - maxFileElems} more</div>)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Align the text fields
|
|
||||||
const textFieldStyle = { width: '' }
|
|
||||||
const textareaStyle = { margin: 0 }
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div key='advanced' className='create-torrent-advanced'>
|
<div key='advanced' className='create-torrent-advanced'>
|
||||||
<div key='private' className='torrent-attribute'>
|
<div key='private' className='torrent-attribute'>
|
||||||
@@ -146,34 +144,32 @@ class CreateTorrentPage extends React.Component {
|
|||||||
className='torrent-is-private control'
|
className='torrent-is-private control'
|
||||||
style={{ display: '' }}
|
style={{ display: '' }}
|
||||||
checked={this.state.isPrivate}
|
checked={this.state.isPrivate}
|
||||||
onCheck={this.handleSetIsPrivate}
|
onChange={this.handleSetIsPrivate}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div key='trackers' className='torrent-attribute'>
|
<div key='trackers' className='torrent-attribute'>
|
||||||
<label>Trackers:</label>
|
<label>Trackers:</label>
|
||||||
<TextField
|
<TextField
|
||||||
className='torrent-trackers control'
|
className='torrent-trackers control'
|
||||||
style={textFieldStyle}
|
fullWidth
|
||||||
textareaStyle={textareaStyle}
|
maxRows={10}
|
||||||
multiLine
|
minRows={2}
|
||||||
rows={2}
|
multiline
|
||||||
rowsMax={10}
|
|
||||||
value={this.state.trackers}
|
|
||||||
onChange={this.handleSetTrackers}
|
onChange={this.handleSetTrackers}
|
||||||
|
value={this.state.trackers}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div key='comment' className='torrent-attribute'>
|
<div key='comment' className='torrent-attribute'>
|
||||||
<label>Comment:</label>
|
<label>Comment:</label>
|
||||||
<TextField
|
<TextField
|
||||||
className='torrent-comment control'
|
className='torrent-comment control'
|
||||||
style={textFieldStyle}
|
fullWidth
|
||||||
textareaStyle={textareaStyle}
|
maxRows={10}
|
||||||
hintText='Optionally describe your torrent...'
|
minRows={2}
|
||||||
multiLine
|
multiline
|
||||||
rows={2}
|
|
||||||
rowsMax={10}
|
|
||||||
value={this.state.comment}
|
|
||||||
onChange={this.handleSetComment}
|
onChange={this.handleSetComment}
|
||||||
|
placeholder='Optionally describe your torrent...'
|
||||||
|
value={this.state.comment}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div key='files' className='torrent-attribute'>
|
<div key='files' className='torrent-attribute'>
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
const React = require('react')
|
const React = require('react')
|
||||||
const PropTypes = require('prop-types')
|
const PropTypes = require('prop-types')
|
||||||
|
|
||||||
const colors = require('material-ui/styles/colors')
|
const Button = require('@material-ui/core/Button').default
|
||||||
const Checkbox = require('material-ui/Checkbox').default
|
const Checkbox = require('@material-ui/core/Checkbox').default
|
||||||
const RaisedButton = require('material-ui/RaisedButton').default
|
const FormControlLabel = require('@material-ui/core/FormControlLabel').default
|
||||||
const TextField = require('material-ui/TextField').default
|
const TextField = require('@material-ui/core/TextField').default
|
||||||
|
const grey = require('@material-ui/core/colors/grey').default
|
||||||
|
|
||||||
const Heading = require('../components/heading')
|
const Heading = require('../components/heading')
|
||||||
const PathSelector = require('../components/path-selector')
|
const PathSelector = require('../components/path-selector')
|
||||||
|
|
||||||
@@ -63,11 +65,15 @@ class PreferencesPage extends React.Component {
|
|||||||
openExternalPlayerCheckbox () {
|
openExternalPlayerCheckbox () {
|
||||||
return (
|
return (
|
||||||
<Preference>
|
<Preference>
|
||||||
<Checkbox
|
<FormControlLabel
|
||||||
className='control'
|
control={
|
||||||
checked={!this.props.state.saved.prefs.openExternalPlayer}
|
<Checkbox
|
||||||
|
className='control'
|
||||||
|
checked={!this.props.state.saved.prefs.openExternalPlayer}
|
||||||
|
onChange={this.handleOpenExternalPlayerChange}
|
||||||
|
/>
|
||||||
|
}
|
||||||
label='Play torrent media files using WebTorrent'
|
label='Play torrent media files using WebTorrent'
|
||||||
onCheck={this.handleOpenExternalPlayerChange}
|
|
||||||
/>
|
/>
|
||||||
</Preference>
|
</Preference>
|
||||||
)
|
)
|
||||||
@@ -80,11 +86,15 @@ class PreferencesPage extends React.Component {
|
|||||||
highestPlaybackPriorityCheckbox () {
|
highestPlaybackPriorityCheckbox () {
|
||||||
return (
|
return (
|
||||||
<Preference>
|
<Preference>
|
||||||
<Checkbox
|
<FormControlLabel
|
||||||
className='control'
|
control={
|
||||||
checked={this.props.state.saved.prefs.highestPlaybackPriority}
|
<Checkbox
|
||||||
|
className='control'
|
||||||
|
checked={this.props.state.saved.prefs.highestPlaybackPriority}
|
||||||
|
onChange={this.handleHighestPlaybackPriorityChange}
|
||||||
|
/>
|
||||||
|
}
|
||||||
label='Highest Playback Priority'
|
label='Highest Playback Priority'
|
||||||
onCheck={this.handleHighestPlaybackPriorityChange}
|
|
||||||
/>
|
/>
|
||||||
<p>Pauses all active torrents to allow playback to use all of the available bandwidth.</p>
|
<p>Pauses all active torrents to allow playback to use all of the available bandwidth.</p>
|
||||||
</Preference>
|
</Preference>
|
||||||
@@ -126,11 +136,15 @@ class PreferencesPage extends React.Component {
|
|||||||
autoAddTorrentsCheckbox () {
|
autoAddTorrentsCheckbox () {
|
||||||
return (
|
return (
|
||||||
<Preference>
|
<Preference>
|
||||||
<Checkbox
|
<FormControlLabel
|
||||||
className='control'
|
control={
|
||||||
checked={this.props.state.saved.prefs.autoAddTorrents}
|
<Checkbox
|
||||||
|
className='control'
|
||||||
|
checked={this.props.state.saved.prefs.autoAddTorrents}
|
||||||
|
onChange={(e, value) => { this.handleAutoAddTorrentsChange(e, value) }}
|
||||||
|
/>
|
||||||
|
}
|
||||||
label='Watch for new .torrent files and add them immediately'
|
label='Watch for new .torrent files and add them immediately'
|
||||||
onCheck={(e, value) => { this.handleAutoAddTorrentsChange(e, value) }}
|
|
||||||
/>
|
/>
|
||||||
</Preference>
|
</Preference>
|
||||||
)
|
)
|
||||||
@@ -188,11 +202,13 @@ class PreferencesPage extends React.Component {
|
|||||||
return (
|
return (
|
||||||
<Preference>
|
<Preference>
|
||||||
<p>WebTorrent is not currently the default torrent app.</p>
|
<p>WebTorrent is not currently the default torrent app.</p>
|
||||||
<RaisedButton
|
<Button
|
||||||
className='control'
|
className='control'
|
||||||
onClick={this.handleSetDefaultApp}
|
onClick={this.handleSetDefaultApp}
|
||||||
label='Make WebTorrent the default'
|
variant='contained'
|
||||||
/>
|
>
|
||||||
|
Make WebTorrent the default
|
||||||
|
</Button>
|
||||||
</Preference>
|
</Preference>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -208,11 +224,15 @@ class PreferencesPage extends React.Component {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Preference>
|
<Preference>
|
||||||
<Checkbox
|
<FormControlLabel
|
||||||
className='control'
|
control={
|
||||||
checked={this.props.state.saved.prefs.startup}
|
<Checkbox
|
||||||
|
className='control'
|
||||||
|
checked={this.props.state.saved.prefs.startup}
|
||||||
|
onChange={this.handleStartupChange}
|
||||||
|
/>
|
||||||
|
}
|
||||||
label='Open WebTorrent on startup'
|
label='Open WebTorrent on startup'
|
||||||
onCheck={this.handleStartupChange}
|
|
||||||
/>
|
/>
|
||||||
</Preference>
|
</Preference>
|
||||||
)
|
)
|
||||||
@@ -221,11 +241,15 @@ class PreferencesPage extends React.Component {
|
|||||||
soundNotificationsCheckbox () {
|
soundNotificationsCheckbox () {
|
||||||
return (
|
return (
|
||||||
<Preference>
|
<Preference>
|
||||||
<Checkbox
|
<FormControlLabel
|
||||||
className='control'
|
control={
|
||||||
checked={this.props.state.saved.prefs.soundNotifications}
|
<Checkbox
|
||||||
|
className='control'
|
||||||
|
checked={this.props.state.saved.prefs.soundNotifications}
|
||||||
|
onChange={this.handleSoundNotificationsChange}
|
||||||
|
/>
|
||||||
|
}
|
||||||
label='Enable sounds'
|
label='Enable sounds'
|
||||||
onCheck={this.handleSoundNotificationsChange}
|
|
||||||
/>
|
/>
|
||||||
</Preference>
|
</Preference>
|
||||||
)
|
)
|
||||||
@@ -240,21 +264,16 @@ class PreferencesPage extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setGlobalTrackers () {
|
setGlobalTrackers () {
|
||||||
// Align the text fields
|
|
||||||
const textFieldStyle = { width: '100%' }
|
|
||||||
const textareaStyle = { margin: 0 }
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Preference>
|
<Preference>
|
||||||
<TextField
|
<TextField
|
||||||
className='torrent-trackers control'
|
className='torrent-trackers control'
|
||||||
style={textFieldStyle}
|
fullWidth
|
||||||
textareaStyle={textareaStyle}
|
maxRows={10}
|
||||||
multiLine
|
minRows={2}
|
||||||
rows={2}
|
multiline
|
||||||
rowsMax={10}
|
|
||||||
value={this.state.globalTrackers}
|
|
||||||
onChange={this.handleSetGlobalTrackers}
|
onChange={this.handleSetGlobalTrackers}
|
||||||
|
value={this.state.globalTrackers}
|
||||||
/>
|
/>
|
||||||
</Preference>
|
</Preference>
|
||||||
)
|
)
|
||||||
@@ -274,7 +293,7 @@ class PreferencesPage extends React.Component {
|
|||||||
|
|
||||||
render () {
|
render () {
|
||||||
const style = {
|
const style = {
|
||||||
color: colors.grey400,
|
color: grey['400'],
|
||||||
marginLeft: 25,
|
marginLeft: 25,
|
||||||
marginRight: 25
|
marginRight: 25
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
const React = require('react')
|
const React = require('react')
|
||||||
const prettyBytes = require('prettier-bytes')
|
const prettyBytes = require('prettier-bytes')
|
||||||
|
|
||||||
const Checkbox = require('material-ui/Checkbox').default
|
const Checkbox = require('@material-ui/core/Checkbox').default
|
||||||
const LinearProgress = require('material-ui/LinearProgress').default
|
const LinearProgress = require('@material-ui/core/LinearProgress').default
|
||||||
|
|
||||||
const TorrentSummary = require('../lib/torrent-summary')
|
const TorrentSummary = require('../lib/torrent-summary')
|
||||||
const TorrentPlayer = require('../lib/torrent-player')
|
const TorrentPlayer = require('../lib/torrent-player')
|
||||||
@@ -124,19 +124,19 @@ module.exports = class TorrentList extends React.Component {
|
|||||||
const isActive = ['downloading', 'seeding'].includes(torrentSummary.status)
|
const isActive = ['downloading', 'seeding'].includes(torrentSummary.status)
|
||||||
return (
|
return (
|
||||||
<Checkbox
|
<Checkbox
|
||||||
key='download-button'
|
checked={isActive}
|
||||||
className={'control download ' + torrentSummary.status}
|
className={'control download ' + torrentSummary.status}
|
||||||
|
key='download-button'
|
||||||
|
onChange={dispatcher('toggleTorrent', infoHash)}
|
||||||
|
onClick={stopPropagation}
|
||||||
style={{
|
style={{
|
||||||
display: 'inline-block',
|
display: 'inline-block',
|
||||||
width: 32
|
marginRight: '12px',
|
||||||
|
'& .MuiSvgIconRoot': {
|
||||||
|
width: '20px',
|
||||||
|
height: '20px'
|
||||||
|
}
|
||||||
}}
|
}}
|
||||||
iconStyle={{
|
|
||||||
width: 20,
|
|
||||||
height: 20
|
|
||||||
}}
|
|
||||||
checked={isActive}
|
|
||||||
onClick={stopPropagation}
|
|
||||||
onCheck={dispatcher('toggleTorrent', infoHash)}
|
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -155,7 +155,7 @@ module.exports = class TorrentList extends React.Component {
|
|||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<div key='progress-bar' style={styles.wrapper}>
|
<div key='progress-bar' style={styles.wrapper}>
|
||||||
<LinearProgress style={styles.progress} mode='determinate' value={progress} />
|
<LinearProgress style={styles.progress} value={progress} variant='determinate' />
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -354,7 +354,7 @@ textarea,
|
|||||||
text-shadow: rgba(0, 0, 0, 0.5) 0 0 4px;
|
text-shadow: rgba(0, 0, 0, 0.5) 0 0 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.torrent .metadata span:not(:last-child)::after {
|
.torrent .metadata .ellipsis > span:not(:last-child):not(.control)::after {
|
||||||
content: ' • ';
|
content: ' • ';
|
||||||
opacity: 0.7;
|
opacity: 0.7;
|
||||||
padding-left: 4px;
|
padding-left: 4px;
|
||||||
|
|||||||
Reference in New Issue
Block a user