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" />
|
<InlineSVG src={exitUrl} alt="Close Keyboard Shortcuts Overlay" />
|
||||||
</button>
|
</button>
|
||||||
</header>
|
</header>
|
||||||
<ul>
|
<ul title="keyboard shortcuts">
|
||||||
<li className="keyboard-shortcut-item">
|
<li className="keyboard-shortcut-item">
|
||||||
<span className="keyboard-shortcut__command">Shift + Tab</span>
|
<span className="keyboard-shortcut__command">Shift + Tab</span>
|
||||||
<span>Tidy</span>
|
<span>Tidy</span>
|
||||||
|
@ -56,6 +56,18 @@ class KeyboardShortcutModal extends React.Component {
|
||||||
</span>
|
</span>
|
||||||
<span>Stop Sketch</span>
|
<span>Stop Sketch</span>
|
||||||
</li>
|
</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>
|
</ul>
|
||||||
</section>
|
</section>
|
||||||
);
|
);
|
||||||
|
|
|
@ -153,6 +153,12 @@ class IDEView extends React.Component {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
this.props.startSketchAndRefresh();
|
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();
|
httpRequest.send();
|
||||||
}
|
}
|
||||||
|
|
||||||
fetchJSONFile('data.min.json', function(data){
|
fetchJSONFile('/data.min.json', function(data){
|
||||||
allData = data;
|
allData = data;
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue