diff --git a/PRIVACY.md b/PRIVACY.md index 9e1d5f62..18dfb51d 100644 --- a/PRIVACY.md +++ b/PRIVACY.md @@ -25,4 +25,4 @@ Our websites use: --- -This privacy policy is subject to change without notice and was last updated on March 10, 2019. If you have any questions feel free to [create a GitHub issue](https://github.com/atomery/singlebox/issues) or contact us via [contact@atomery.com](mailto:contact@atomery.com). \ No newline at end of file +This privacy policy is subject to change without notice and was last updated on April 27, 2019. If you have any questions feel free to [create a GitHub issue](https://github.com/atomery/singlebox/issues) or contact us via [contact@atomery.com](mailto:contact@atomery.com). \ No newline at end of file diff --git a/package.json b/package.json index db564f09..b2f1ba92 100755 --- a/package.json +++ b/package.json @@ -46,6 +46,7 @@ "@material-ui/core": "4.9.13", "@material-ui/icons": "4.9.1", "@material-ui/pickers": "3.2.10", + "ace-builds": "1.4.11", "algoliasearch": "4.2.0", "babel-eslint": "10.1.0", "babel-preset-env": "1.7.0", @@ -66,6 +67,7 @@ "eslint-plugin-react-hooks": "1.7.0", "prop-types": "15.7.2", "react": "16.13.1", + "react-ace": "8.1.0", "react-dom": "16.13.1", "react-redux": "7.2.0", "react-scripts": "3.4.1", diff --git a/public/windows/code-injection.js b/public/windows/code-injection.js index 7db09d6c..32fe01f4 100644 --- a/public/windows/code-injection.js +++ b/public/windows/code-injection.js @@ -19,8 +19,8 @@ const create = (type) => { global.codeInjectionType = type; win = new BrowserWindow({ - width: 400, - height: 350, + width: 640, + height: 560, resizable: false, maximizable: false, minimizable: false, diff --git a/src/components/dialog-code-injection/index.js b/src/components/dialog-code-injection/index.js index 11fd2e44..d9bbc94f 100644 --- a/src/components/dialog-code-injection/index.js +++ b/src/components/dialog-code-injection/index.js @@ -2,7 +2,13 @@ import React from 'react'; import PropTypes from 'prop-types'; import Button from '@material-ui/core/Button'; -import TextField from '@material-ui/core/TextField'; + +import AceEditor from 'react-ace'; + +import 'ace-builds/src-noconflict/mode-css'; +import 'ace-builds/src-noconflict/mode-javascript'; +import 'ace-builds/src-noconflict/theme-github'; +import 'ace-builds/src-noconflict/theme-monokai'; import connectComponent from '../../helpers/connect-component'; @@ -13,42 +19,50 @@ const styles = (theme) => ({ background: theme.palette.background.paper, height: '100vh', width: '100vw', - padding: theme.spacing(2), + padding: 0, display: 'flex', flexDirection: 'column', }, flexGrow: { flex: 1, }, + actions: { + borderTop: `1px solid ${theme.palette.divider}`, + padding: theme.spacing(2), + }, button: { float: 'right', marginLeft: theme.spacing(1), }, }); +const getMode = () => { + const codeInjectionType = window.require('electron').remote.getGlobal('codeInjectionType'); + if (codeInjectionType === 'css') return 'css'; + if (codeInjectionType === 'js') return 'javascript'; + return ''; +}; + const CodeInjection = ({ - classes, code, onUpdateForm, onSave, + classes, + code, + onSave, + onUpdateForm, + shouldUseDarkColors, }) => (
- onUpdateForm({ code: e.target.value })} + onChange={(value) => onUpdateForm({ code: value })} />
-
+
@@ -62,12 +76,14 @@ const CodeInjection = ({ CodeInjection.propTypes = { classes: PropTypes.object.isRequired, code: PropTypes.string.isRequired, - onUpdateForm: PropTypes.func.isRequired, onSave: PropTypes.func.isRequired, + onUpdateForm: PropTypes.func.isRequired, + shouldUseDarkColors: PropTypes.bool.isRequired, }; const mapStateToProps = (state) => ({ code: state.dialogCodeInjection.form.code || '', + shouldUseDarkColors: state.general.shouldUseDarkColors, }); const actionCreators = { diff --git a/src/components/dialog-preferences/index.js b/src/components/dialog-preferences/index.js index fd864157..29a207cf 100644 --- a/src/components/dialog-preferences/index.js +++ b/src/components/dialog-preferences/index.js @@ -432,41 +432,6 @@ const Preferences = ({ /> - {window.process.platform === 'darwin' && ( - <> - - - - Navigate between pages with 3-finger gestures. -
- To enable it, you also need to change - - macOS Preferences > Trackpad > More Gestures > Swipe between page - - to - Swipe with three fingers - or - Swipe with two or three fingers. - - )} - /> - - { - requestSetPreference('swipeToNavigate', e.target.checked); - requestShowRequireRestartDialog(); - }} - /> - -
- - )} @@ -788,6 +753,32 @@ const Preferences = ({ /> + + + + WebCatalog supports notifications out of the box. + But for some web apps, to receive notifications, + you will need to manually configure additional + web app settings. + requestOpenInBrowser('https://github.com/atomery/webcatalog/wiki/How-to-Enable-Notifications-in-Web-Apps')} + onKeyDown={(e) => { + if (e.key !== 'Enter') return; + requestOpenInBrowser('https://github.com/atomery/webcatalog/wiki/How-to-Enable-Notifications-in-Web-Apps'); + }} + > + Learn more + + . + + )} + /> + @@ -1066,6 +1057,42 @@ const Preferences = ({ /> + {window.process.platform === 'darwin' && ( + <> + + + + Navigate between pages with 3-finger gestures. + Swipe left to go back or swipe right to go forward. +
+ To enable it, you also need to change + + macOS Preferences > Trackpad > More Gestures > Swipe between page + + to + Swipe with three fingers + or + Swipe with two or three fingers. + + )} + /> + + { + requestSetPreference('swipeToNavigate', e.target.checked); + requestShowRequireRestartDialog(); + }} + /> + +
+ + )}