var settingsRadioOptionStyles = { display: 'block', marginLeft: '13px' }, settingsCheckBoxOptionStyles = { display: 'block', marginLeft: '13px' }, settingsNumberFieldStyles = { width: '40px' }, downloadDirectoryLabelStyles = { fontSize: '.9em', marginLeft: '13px' }, downloadDirectoryFieldStyles= { width: '300px' }; var SettingsPage = React.createClass({ storeSetting: function(setting, val) { var settings = Object.assign({}, this.state.settings); settings[setting] = val; this.setState({ 'settings': settings }); lbry.setSettings(settings); }, onRunOnStartChange: function (event) { this.storeSetting('run_on_startup', event.target.checked); }, onShareDataChange: function (event) { this.storeSetting('upload_log', event.target.checked); }, onDownloadDirChange: function(event) { this.storeSetting('download_directory', event.target.value); }, onMaxUploadPrefChange: function(isLimited) { if (!isLimited) { this.storeSetting('max_upload', 0.0); } this.setState({ isMaxUpload: isLimited }); }, onMaxUploadFieldChange: function(event) { this.storeSetting('max_upload', Number(event.target.value)); }, onMaxDownloadPrefChange: function(isLimited) { if (!isLimited) { this.storeSetting('max_download', 0.0); } this.setState({ isMaxDownload: isLimited }); }, onMaxDownloadFieldChange: function(event) { this.storeSetting('max_download', Number(event.target.value)); }, getInitialState: function() { return { settings: null } }, componentDidMount: function() { document.title = "Settings"; }, componentWillMount: function() { lbry.getSettings(function(settings) { this.setState({ settings: settings, isMaxUpload: settings.max_upload != 0, isMaxDownload: settings.max_download != 0 }); }.bind(this)); }, render: function() { if (!this.state.settings) { // If the settings aren't loaded yet, don't render anything. return null; } return (

Run on Startup

Download Directory

Where would you like the files you download from LBRY to be saved?

Bandwidth Limits

Max Upload

Max Download

Share Diagnostic Data

); } });