Add keyboard shortcut for text based output (#193)
* add shortcuts * add keyboard shortcut for text based output * remove duplicate
This commit is contained in:
parent
41c1613d10
commit
d082ada1fd
3 changed files with 20 additions and 2 deletions
|
@ -16,7 +16,7 @@ class KeyboardShortcutModal extends React.Component {
|
|||
<InlineSVG src={exitUrl} alt="Close Keyboard Shortcuts Overlay" />
|
||||
</button>
|
||||
</header>
|
||||
<ul>
|
||||
<ul title="keyboard shortcuts">
|
||||
<li className="keyboard-shortcut-item">
|
||||
<span className="keyboard-shortcut__command">Shift + Tab</span>
|
||||
<span>Tidy</span>
|
||||
|
@ -56,6 +56,18 @@ class KeyboardShortcutModal extends React.Component {
|
|||
</span>
|
||||
<span>Stop Sketch</span>
|
||||
</li>
|
||||
<li className="keyboard-shortcut-item">
|
||||
<span className="keyboard-shortcut__command">
|
||||
{this.isMac ? 'Command + Shift + 1' : 'Control + Shift + 1'}
|
||||
</span>
|
||||
<span>Turn On Text-based Canvas</span>
|
||||
</li>
|
||||
<li className="keyboard-shortcut-item">
|
||||
<span className="keyboard-shortcut__command">
|
||||
{this.isMac ? 'Command + Shift + 2' : 'Control + Shift + 2'}
|
||||
</span>
|
||||
<span>Turn Off Text-based Canvas</span>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
);
|
||||
|
|
|
@ -153,6 +153,12 @@ class IDEView extends React.Component {
|
|||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
this.props.startSketchAndRefresh();
|
||||
} else if (e.keyCode === 50 && ((e.metaKey && this.isMac) || (e.ctrlKey && !this.isMac)) && e.shiftKey) {
|
||||
e.preventDefault();
|
||||
this.props.setTextOutput(false);
|
||||
} else if (e.keyCode === 49 && ((e.metaKey && this.isMac) || (e.ctrlKey && !this.isMac)) && e.shiftKey) {
|
||||
e.preventDefault();
|
||||
this.props.setTextOutput(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -13,6 +13,6 @@ function fetchJSONFile(path, callback) {
|
|||
httpRequest.send();
|
||||
}
|
||||
|
||||
fetchJSONFile('data.min.json', function(data){
|
||||
fetchJSONFile('/data.min.json', function(data){
|
||||
allData = data;
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue