Skip to content

Commit b72a01a

Browse files
committed
update syntax highlighting, move styles out of progressbar
1 parent ad9585f commit b72a01a

File tree

5 files changed

+41
-40
lines changed

5 files changed

+41
-40
lines changed

package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,10 @@
1414
"iggins": "^0.1.0",
1515
"irken": "^0.6.0",
1616
"lodash": "^3.9.1",
17-
"progressbar.js": "^0.8.1",
1817
"react": "^0.13.1",
1918
"react-loader": "^1.2.0",
2019
"react-material": "git://github.com/iceddev/react-material#fake-release-13",
2120
"react-mfb-iceddev": "^0.1.0",
22-
"react-progressbar": "^1.1.0",
2321
"react-select": "^0.4.0",
2422
"react-style": "^0.4.0",
2523
"skrim": "0.0.3",

plugins/editor/pbasic.js

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,13 @@ module.exports = function(CodeMirror){
1111
return new RegExp("^((" + words.join(")|(") + "))\\b", "i");
1212
}
1313

14-
function getWordRange(word, start, end){
14+
function getWordRange(word, start, end, base){
1515
var words = [];
16+
17+
if (base) {
18+
words.push(word)
19+
};
20+
1621
for (var i = start; i < end + 1; i++) {
1722
words.push(word + i);
1823
};
@@ -39,30 +44,30 @@ module.exports = function(CodeMirror){
3944
var etDirective = ['STAMP', 'PORT', 'PBASIC'];
4045
var etTargetModule = ['BS1','BS2','BS2E','BS2SX', 'BS2P', 'BS2PE','BS2PX'];
4146
var etIOFormatter = ['ASC', 'STR','REP', 'SKIP', 'WAITSTR','WAIT','NUM','SNUM']
42-
.concat(getWordRange('DEC', 1, 5))
43-
.concat(getWordRange('BIN', 1, 16))
44-
.concat(getWordRange('ISBIN', 1, 16))
45-
.concat(getWordRange('ISHEX', 1, 4))
46-
.concat(getWordRange('IHEX', 1, 4))
47-
.concat(getWordRange('IBIN', 1, 16))
48-
.concat(getWordRange('HEX', 1, 4))
49-
.concat(getWordRange('SHEX', 1, 4))
50-
.concat(getWordRange('SBIN', 1, 16))
51-
.concat(getWordRange('SDEC', 1, 5));
47+
.concat(getWordRange('DEC', 1, 5, true))
48+
.concat(getWordRange('BIN', 1, 16, true))
49+
.concat(getWordRange('IBIN', 1, 16, true))
50+
.concat(getWordRange('ISBIN', 1, 16, true))
51+
.concat(getWordRange('ISHEX', 1, 4, true))
52+
.concat(getWordRange('IHEX', 1, 4, true))
53+
.concat(getWordRange('IBIN', 1, 16, true))
54+
.concat(getWordRange('HEX', 1, 4, true))
55+
.concat(getWordRange('SHEX', 1, 4, true))
56+
.concat(getWordRange('SBIN', 1, 16, true))
57+
.concat(getWordRange('SDEC', 1, 5, true));
5258

5359
var etVariable = ['INA', 'INB', 'INC', 'IND', 'OUTA', 'OUTB', 'OUTC', 'OUTD',
5460
'DIRA', 'DIRB', 'DIRC', 'DIRD', 'INL', 'INH', 'OUTL', 'OUTH', 'DIRL', 'DIRH',
5561
'INS', 'OUTS', 'DIRS']
5662
.concat(getWordRange('B', 0, 25))
5763
.concat(getWordRange('DIR', 0, 15))
58-
.concat(getWordRange('BIT', 0, 15))
5964
.concat(getWordRange('W', 0, 12))
6065
.concat(getWordRange('OUT', 0, 15))
61-
.concat(getWordRange('NIB', 0, 3))
62-
.concat(getWordRange('IN', 1, 16));
66+
.concat(getWordRange('IN', 0, 16));
6367

6468
var etConstant = ['CLS','HOME','BELL','BKSP','TAB','CR','UNITON','UNITOFF','UNITSOFF',
65-
'LIGHTSON','DIM','BRIGHT','LSBFIRST','MSBFIRST','MSBPRE','LSBPRE','MSBPOST','LSBPOST'];
69+
'LIGHTSON','DIM','BRIGHT','LSBFIRST','MSBFIRST','MSBPRE','LSBPRE','MSBPOST','LSBPOST',
70+
'DEBUGIN','CRSRXY','CRSRLF','CRSRRT','CRSRUP','CRSRDN','LF','CLREOL','CLRDN','CRSRX','CRSRY'];
6671

6772
var etCCDirective = ['#DEFINE', '#ERROR', '#IF', '#THEN', '#ELSE', '#ENDIF', '#SELECT',
6873
'#CASE', '#ENDSELECT'];

plugins/sidebar/overlays/download.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class DownloadOverlay extends React.Component {
3535
}
3636

3737
onAccept(evt){
38-
this.download(this.state.selectedDevice);
38+
this.download(this.state.selectedDevice);
3939
}
4040

4141
onCancel(evt){
@@ -45,10 +45,11 @@ class DownloadOverlay extends React.Component {
4545
}
4646

4747
download(device){
48-
const { toast, workspace, logger, overlay } = this.props.irken;
4948

5049
const { irken, handleError, handleSuccess } = this.props;
5150

51+
const { toast, workspace, logger, overlay } = irken;
52+
5253
const name = workspace.filename.deref();
5354
const source = workspace.current.deref();
5455

@@ -116,7 +117,7 @@ class DownloadOverlay extends React.Component {
116117
return (
117118
<Card styles={[styles.overlay, styles.overlayLarge]}>
118119
<h3 style={styles.overlayTitle}>Please choose your connected device.</h3>
119-
<div style={styles.overlayTableContainer}>
120+
<div>
120121
<Loader loaded={!this.state.searching}>
121122
<div style={styles.deviceTableWrapper}>
122123
<div style={styles.deviceTableScroll}>

plugins/sidebar/overlays/progress.js

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,18 @@
22

33
const React = require('react');
44

5+
var styles = require('../styles.js');
6+
57
class Progress extends React.Component {
68

79
render(){
810

9-
const setComplete = this.props.setComplete + '%';
10-
11-
const barStyle = {
12-
width: setComplete,
13-
height: '100%',
14-
backgroundColor: '#3a81f0'
15-
}
16-
const barContainerStyle = {
17-
width: '100%',
18-
height: '8px',
19-
backgroundColor: '#b0d0ef',
20-
position: 'absolute',
21-
bottom: 0,
22-
left: 0
23-
}
11+
var setComplete = {width: this.props.setComplete + '%'};
2412

2513
return (
26-
<div style={barContainerStyle}>
27-
<div style={barStyle}></div>
28-
</div>
14+
<div style={styles.progressContainerStyle}>
15+
<div styles={[styles.progressBarStyle, setComplete]}></div>
16+
</div>
2917
);
3018
}
3119
}

plugins/sidebar/styles.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,24 @@ const styles = {
4848
display: 'flex',
4949
marginTop: 20
5050
},
51-
overlayTableContainer: {
51+
progressContainerStyle: {
52+
width: '100%',
53+
height: '8px',
54+
backgroundColor: '#b0d0ef',
55+
position: 'absolute',
56+
bottom: 0,
57+
left: 0
58+
},
59+
progressBarStyle: {
60+
height: '100%',
61+
backgroundColor: '#3a81f0'
5262
},
5363
deviceTable: {
5464
width: '100%',
5565
maxWidth: '100%',
5666
borderCollapse: 'collapse',
5767
borderSpacing: 0,
5868
display: 'table',
59-
6069
},
6170
deviceTableWrapper: {
6271
position: 'relative'

0 commit comments

Comments
 (0)