Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions client/components/Dropdown.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Link } from 'react-router';
import styled from 'styled-components';
import { remSize, prop, common } from '../theme';
import { remSize, prop } from '../theme';
import IconButton from './mobile/IconButton';
import Button from '../common/Button';

const DropdownWrapper = styled.ul`
background-color: ${prop('Modal.background')};
Expand Down
1 change: 0 additions & 1 deletion client/components/mobile/Explorer.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from 'react';
import { useTranslation } from 'react-i18next';
import styled from 'styled-components';
import PropTypes from 'prop-types';
import Sidebar from './Sidebar';
import ConnectedFileNode from '../../modules/IDE/components/FileNode';
Expand Down
3 changes: 1 addition & 2 deletions client/components/mobile/Footer.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from 'react';
import styled from 'styled-components';
import { prop, grays } from '../../theme';
import { prop } from '../../theme';


const background = prop('MobilePanel.default.background');
Expand Down
1 change: 0 additions & 1 deletion client/components/mobile/IDEWrapper.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import styled from 'styled-components';
import { remSize } from '../../theme';

Expand Down
3 changes: 1 addition & 2 deletions client/components/mobile/Sidebar.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Link } from 'react-router';
import styled from 'styled-components';
import { remSize, prop, common } from '../../theme';
import { remSize, prop, } from '../../theme';
import Header from './Header';
import IconButton from './IconButton';
import { ExitIcon } from '../../common/icons';
Expand Down
1 change: 0 additions & 1 deletion client/components/mobile/Tab.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import styled from 'styled-components';
import { Link } from 'react-router';
import { prop, remSize } from '../../theme';
Expand Down
3 changes: 1 addition & 2 deletions client/components/mobile/TabSwitcher.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import styled from 'styled-components';

import { prop, remSize } from '../../theme';
import { prop, } from '../../theme';

export default styled.div`
display: flex;
Expand Down
1 change: 0 additions & 1 deletion client/i18n.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import i18n from 'i18next';
import { initReactI18next } from 'react-i18next';
import LanguageDetector from 'i18next-browser-languagedetector';
import Backend from 'i18next-http-backend';
import { enUS, es, ja } from 'date-fns/locale';

Expand Down
1 change: 0 additions & 1 deletion client/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import configureStore from './store';
import routes from './routes';
import ThemeProvider from './modules/App/components/ThemeProvider';
import Loader from './modules/App/components/loader';
import i18n from './i18n';

require('./styles/main.scss');

Expand Down
6 changes: 5 additions & 1 deletion client/modules/App/components/Overlay.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,11 @@ class Overlay extends React.Component {
<h2 className="overlay__title">{title}</h2>
<div className="overlay__actions">
{actions}
<button className="overlay__close-button" onClick={this.close} aria-label={this.props.t('Overlay.AriaLabel', { title })}>
<button
className="overlay__close-button"
onClick={this.close}
aria-label={this.props.t('Overlay.AriaLabel', { title })}
>
<ExitIcon focusable="false" aria-hidden="true" />
</button>
</div>
Expand Down
36 changes: 31 additions & 5 deletions client/modules/IDE/components/CollectionList/CollectionList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,18 @@ class CollectionList extends React.Component {
>
<span className={headerClass}>{displayName}</span>
{field === fieldName && direction === SortingActions.DIRECTION.ASC &&
<ArrowUpIcon role="img" aria-label={this.props.t('CollectionList.DirectionAscendingARIA')} focusable="false" />
<ArrowUpIcon
role="img"
aria-label={this.props.t('CollectionList.DirectionAscendingARIA')}
focusable="false"
/>
}
{field === fieldName && direction === SortingActions.DIRECTION.DESC &&
<ArrowDownIcon role="img" aria-label={this.props.t('CollectionList.DirectionDescendingARIA')} focusable="false" />
<ArrowDownIcon
role="img"
aria-label={this.props.t('CollectionList.DirectionDescendingARIA')}
focusable="false"
/>
}
</button>
</th>
Expand All @@ -144,9 +152,27 @@ class CollectionList extends React.Component {
<thead>
<tr>
{this._renderFieldHeader('name', this.props.t('CollectionList.HeaderName'))}
{this._renderFieldHeader('createdAt', this.props.t('CollectionList.HeaderCreatedAt', { context: mobile ? 'mobile' : '' }))}
{this._renderFieldHeader('updatedAt', this.props.t('CollectionList.HeaderUpdatedAt', { context: mobile ? 'mobile' : '' }))}
{this._renderFieldHeader('numItems', this.props.t('CollectionList.HeaderNumItems', { context: mobile ? 'mobile' : '' }))}
{this._renderFieldHeader(
'createdAt',
this.props.t(
'CollectionList.HeaderCreatedAt',
{ context: mobile ? 'mobile' : '' }
)
)}
{this._renderFieldHeader(
'updatedAt',
this.props.t(
'CollectionList.HeaderUpdatedAt',
{ context: mobile ? 'mobile' : '' }
)
)}
{this._renderFieldHeader(
'numItems',
this.props.t(
'CollectionList.HeaderNumItems',
{ context: mobile ? 'mobile' : '' }
)
)}
<th scope="col"></th>
</tr>
</thead>
Expand Down
12 changes: 9 additions & 3 deletions client/modules/IDE/components/Editor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ class Editor extends React.Component {

delete this._cm.options.lint.options.errors;

const replaceCommand = metaKey === 'Ctrl' ? `${metaKey}-H` : `${metaKey}-Option-F`;
this._cm.setOption('extraKeys', {
Tab: (cm) => {
// might need to specify and indent more?
Expand Down Expand Up @@ -156,7 +155,10 @@ class Editor extends React.Component {
}, 1000));

this._cm.on('keyup', () => {
const temp = this.props.t('Editor.KeyUpLineNumber', { lineNumber: parseInt((this._cm.getCursor().line) + 1, 10) });
const temp = this.props.t(
'Editor.KeyUpLineNumber',
{ lineNumber: parseInt((this._cm.getCursor().line) + 1, 10) }
);
document.getElementById('current-line').innerHTML = temp;
});

Expand Down Expand Up @@ -361,7 +363,11 @@ class Editor extends React.Component {
{this.props.file.name}
<span className="editor__unsaved-changes">
{this.props.unsavedChanges ?
<UnsavedChangesDotIcon role="img" aria-label={this.props.t('Editor.UnsavedChangesARIA')} focusable="false" /> :
<UnsavedChangesDotIcon
role="img"
aria-label={this.props.t('Editor.UnsavedChangesARIA')}
focusable="false"
/> :
null}
</span>
</span>
Expand Down
7 changes: 6 additions & 1 deletion client/modules/IDE/components/FileNode.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,12 @@ class FileNode extends React.Component {

renderChild = childId => (
<li key={childId}>
<ConnectedFileNode id={childId} parentId={this.props.id} canEdit={this.props.canEdit} onClickFile={this.props.onClickFile} />
<ConnectedFileNode
id={childId}
parentId={this.props.id}
canEdit={this.props.canEdit}
onClickFile={this.props.onClickFile}
/>
</li>
)

Expand Down
5 changes: 4 additions & 1 deletion client/modules/IDE/components/KeyboardShortcutModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ function KeyboardShortcutModal() {
<div className="keyboard-shortcuts">
<h3 className="keyboard-shortcuts__title">{t('KeyboardShortcuts.CodeEditing.CodeEditing')}</h3>
<p className="keyboard-shortcuts__description">
{t('KeyboardShortcuts.ShortcutsFollow')} <a href="https://shortcuts.design/toolspage-sublimetext.html" target="_blank" rel="noopener noreferrer">{t('KeyboardShortcuts.SublimeText')}</a>.
{t('KeyboardShortcuts.ShortcutsFollow')}
<a href="https://shortcuts.design/toolspage-sublimetext.html" target="_blank" rel="noopener noreferrer">
{t('KeyboardShortcuts.SublimeText')}
</a>.
</p>
<ul className="keyboard-shortcuts__list">
<li className="keyboard-shortcut-item">
Expand Down
40 changes: 30 additions & 10 deletions client/modules/IDE/components/Preferences/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ class Preferences extends React.Component {
value="light"
checked={this.props.theme === 'light'}
/>
<label htmlFor="light-theme-on" className="preference__option">{this.props.t('Preferences.LightTheme')}</label>
<label htmlFor="light-theme-on" className="preference__option">
{this.props.t('Preferences.LightTheme')}
</label>
<input
type="radio"
onChange={() => this.props.setTheme('dark')}
Expand All @@ -128,7 +130,9 @@ class Preferences extends React.Component {
value="dark"
checked={this.props.theme === 'dark'}
/>
<label htmlFor="dark-theme-on" className="preference__option">{this.props.t('Preferences.DarkTheme')}</label>
<label htmlFor="dark-theme-on" className="preference__option">
{this.props.t('Preferences.DarkTheme')}
</label>
<input
type="radio"
onChange={() => this.props.setTheme('contrast')}
Expand All @@ -139,7 +143,9 @@ class Preferences extends React.Component {
value="contrast"
checked={this.props.theme === 'contrast'}
/>
<label htmlFor="high-contrast-theme-on" className="preference__option">{this.props.t('Preferences.HighContrastTheme')}</label>
<label htmlFor="high-contrast-theme-on" className="preference__option">
{this.props.t('Preferences.HighContrastTheme')}
</label>
</div>
</div>
<div className="preference">
Expand Down Expand Up @@ -215,7 +221,9 @@ class Preferences extends React.Component {
value="On"
checked={this.props.autocloseBracketsQuotes}
/>
<label htmlFor="autoclosebracketsquotes-on" className="preference__option">{this.props.t('Preferences.On')}</label>
<label htmlFor="autoclosebracketsquotes-on" className="preference__option">
{this.props.t('Preferences.On')}
</label>
<input
type="radio"
onChange={() => this.props.setAutocloseBracketsQuotes(false)}
Expand All @@ -226,7 +234,9 @@ class Preferences extends React.Component {
value="Off"
checked={!this.props.autocloseBracketsQuotes}
/>
<label htmlFor="autoclosebracketsquotes-off" className="preference__option">{this.props.t('Preferences.Off')}</label>
<label htmlFor="autoclosebracketsquotes-off" className="preference__option">
{this.props.t('Preferences.Off')}
</label>
</div>
</div>
<div className="preference">
Expand Down Expand Up @@ -282,7 +292,9 @@ class Preferences extends React.Component {
value="Off"
checked={!this.props.lineNumbers}
/>
<label htmlFor="line-numbers-off" className="preference__option">{this.props.t('Preferences.Off')}</label>
<label htmlFor="line-numbers-off" className="preference__option">
{this.props.t('Preferences.Off')}
</label>
</div>
</div>
<div className="preference">
Expand All @@ -309,7 +321,9 @@ class Preferences extends React.Component {
value="Off"
checked={!this.props.lintWarning}
/>
<label htmlFor="lint-warning-off" className="preference__option">{this.props.t('Preferences.Off')}</label>
<label htmlFor="lint-warning-off" className="preference__option">
{this.props.t('Preferences.Off')}
</label>
<button
className="preference__preview-button"
onClick={() => beep.play()}
Expand All @@ -335,7 +349,9 @@ class Preferences extends React.Component {
value="On"
checked={(this.props.textOutput)}
/>
<label htmlFor="text-output-on" className="preference__option preference__canvas">{this.props.t('Preferences.PlainText')}</label>
<label htmlFor="text-output-on" className="preference__option preference__canvas">
{this.props.t('Preferences.PlainText')}
</label>
<input
type="checkbox"
onChange={(event) => {
Expand All @@ -347,7 +363,9 @@ class Preferences extends React.Component {
value="On"
checked={(this.props.gridOutput)}
/>
<label htmlFor="table-output-on" className="preference__option preference__canvas">{this.props.t('Preferences.TableText')}</label>
<label htmlFor="table-output-on" className="preference__option preference__canvas">
{this.props.t('Preferences.TableText')}
</label>
<input
type="checkbox"
onChange={(event) => {
Expand All @@ -359,7 +377,9 @@ class Preferences extends React.Component {
value="On"
checked={(this.props.soundOutput)}
/>
<label htmlFor="sound-output-on" className="preference__option preference__canvas">{this.props.t('Preferences.Sound')}</label>
<label htmlFor="sound-output-on" className="preference__option preference__canvas">
{this.props.t('Preferences.Sound')}
</label>
</div>
</div>
</TabPanel>
Expand Down
1 change: 0 additions & 1 deletion client/modules/IDE/components/PreviewFrame.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import loopProtect from 'loop-protect';
import { JSHINT } from 'jshint';
import decomment from 'decomment';
import classNames from 'classnames';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import { Decode } from 'console-feed';
import { getBlobUrl } from '../actions/files';
Expand Down
22 changes: 19 additions & 3 deletions client/modules/IDE/components/SketchList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,11 @@ class SketchList extends React.Component {
<ArrowUpIcon role="img" aria-label={this.props.t('SketchList.DirectionAscendingARIA')} focusable="false" />
}
{field === fieldName && direction === SortingActions.DIRECTION.DESC &&
<ArrowDownIcon role="img" aria-label={this.props.t('SketchList.DirectionDescendingARIA')} focusable="false" />
<ArrowDownIcon
role="img"
aria-label={this.props.t('SketchList.DirectionDescendingARIA')}
focusable="false"
/>
}
</button>
</th>
Expand All @@ -437,8 +441,20 @@ class SketchList extends React.Component {
<thead>
<tr>
{this._renderFieldHeader('name', this.props.t('SketchList.HeaderName'))}
{this._renderFieldHeader('createdAt', this.props.t('SketchList.HeaderCreatedAt', { context: mobile ? 'mobile' : '' }))}
{this._renderFieldHeader('updatedAt', this.props.t('SketchList.HeaderUpdatedAt', { context: mobile ? 'mobile' : '' }))}
{this._renderFieldHeader(
'createdAt',
this.props.t(
'SketchList.HeaderCreatedAt',
{ context: mobile ? 'mobile' : '' }
)
)}
{this._renderFieldHeader(
'updatedAt',
this.props.t(
'SketchList.HeaderUpdatedAt',
{ context: mobile ? 'mobile' : '' }
)
)}
<th scope="col"></th>
</tr>
</thead>
Expand Down
7 changes: 5 additions & 2 deletions client/modules/IDE/pages/MobileIDEView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ const handleGlobalKeydown = (props, cmController) => (e) => {

const autosave = (autosaveInterval, setAutosaveInterval) => (props, prevProps) => {
const {
autosaveProject, preferences, ide, selectedFile: file, project, isUserOwner
autosaveProject, preferences, ide, selectedFile: file, project,
} = props;

const { selectedFile: oldFile } = prevProps;
Expand Down Expand Up @@ -241,7 +241,10 @@ const MobileIDEView = (props) => {

const projectActions =
[{
icon: TerminalIcon, aria: 'Toggle console open/closed', action: consoleIsExpanded ? collapseConsole : expandConsole, inverted: true
icon: TerminalIcon,
aria: 'Toggle console open/closed',
action: consoleIsExpanded ? collapseConsole : expandConsole,
inverted: true
},
{ icon: SaveIcon, aria: 'Save project', action: () => saveProject(cmController.getContent(), false, true) },
{ icon: FolderIcon, aria: 'Open files explorer', action: toggleExplorer }
Expand Down
Loading