Skip to content

Commit

Permalink
Fixing eslint issues and allowing template literals. Fixes #1537 (#1538)
Browse files Browse the repository at this point in the history
* WIP #1537 Allow template literals

* WIP #1537 added src/client/dist to ignore

* WIP #1537 fixed eslint issues

* WIP #1537 Fixed quote, indent issues

* eslint fix

* fixed a bunch of eslint

* disable console rule on utilities

* WIP #1537 removed unused banner

* WIP #1537 fixed a bunch more eslint problems
  • Loading branch information
brollb authored Sep 21, 2017
1 parent 8d9f7ce commit bac7e91
Show file tree
Hide file tree
Showing 46 changed files with 308 additions and 327 deletions.
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
src/client/Snap--Build-Your-Own-Blocks/
src/virtual-client/
src/client/dist
1 change: 1 addition & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ rules:
quotes:
- 2
- single
- allowTemplateLiterals: true
semi:
- 2
- always
2 changes: 1 addition & 1 deletion src/client/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ SnapActions.applyEvent = function(event) {
ide.promptExitReplay(function() {
// Netsblox addition: start
if (!myself.isCollaborating() || myself.isLeader) {
// Netsblox addition: end
// Netsblox addition: end
myself.acceptEvent(event);
} else {
myself.send(event);
Expand Down
28 changes: 14 additions & 14 deletions src/client/blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
ColorSlotMorph, TemplateSlotMorph, FunctionSlotMorph, ReporterSlotMorph,
SymbolMorph, MorphicPreferences, contains, IDE_Morph, Costume, ScriptsMorph,
MessageDefinitionBlock, RPCInputSlotMorph, SnapActions, MultiHintArgMorph,
PrototypeHatBlockMorph
PrototypeHatBlockMorph, CommandBlockMorph
*/

BlockMorph.prototype.setSpec = function (spec, silently) {
Expand Down Expand Up @@ -802,7 +802,7 @@ SyntaxElementMorph.prototype.labelPart = function (spec) {
part = new ReporterSlotMorph(true);
break;

// code mapping (experimental)
// code mapping (experimental)

case '%codeListPart':
part = new InputSlotMorph(
Expand All @@ -829,15 +829,15 @@ SyntaxElementMorph.prototype.labelPart = function (spec) {
);
break;

// symbols:
// symbols:

case '%turtle':
part = new SymbolMorph('turtle');
part.size = this.fontSize * 1.2;
part.color = new Color(255, 255, 255);
part.shadowColor = this.color.darker(this.labelContrast);
part.shadowOffset = MorphicPreferences.isFlat ?
new Point() : this.embossing;
new Point() : this.embossing;
part.drawNew();
break;
case '%turtleOutline':
Expand All @@ -847,7 +847,7 @@ SyntaxElementMorph.prototype.labelPart = function (spec) {
part.isProtectedLabel = true; // doesn't participate in zebraing
part.shadowColor = this.color.darker(this.labelContrast);
part.shadowOffset = MorphicPreferences.isFlat ?
new Point() : this.embossing;
new Point() : this.embossing;
part.drawNew();
break;
case '%clockwise':
Expand All @@ -857,7 +857,7 @@ SyntaxElementMorph.prototype.labelPart = function (spec) {
part.isProtectedLabel = false; // zebra colors
part.shadowColor = this.color.darker(this.labelContrast);
part.shadowOffset = MorphicPreferences.isFlat ?
new Point() : this.embossing;
new Point() : this.embossing;
part.drawNew();
break;
case '%counterclockwise':
Expand All @@ -867,7 +867,7 @@ SyntaxElementMorph.prototype.labelPart = function (spec) {
part.isProtectedLabel = false; // zebra colors
part.shadowColor = this.color.darker(this.labelContrast);
part.shadowOffset = MorphicPreferences.isFlat ?
new Point() : this.embossing;
new Point() : this.embossing;
part.drawNew();
break;
case '%greenflag':
Expand All @@ -877,7 +877,7 @@ SyntaxElementMorph.prototype.labelPart = function (spec) {
part.isProtectedLabel = true; // doesn't participate in zebraing
part.shadowColor = this.color.darker(this.labelContrast);
part.shadowOffset = MorphicPreferences.isFlat ?
new Point() : this.embossing;
new Point() : this.embossing;
part.drawNew();
break;
case '%stop':
Expand All @@ -887,7 +887,7 @@ SyntaxElementMorph.prototype.labelPart = function (spec) {
part.isProtectedLabel = true; // doesn't participate in zebraing
part.shadowColor = this.color.darker(this.labelContrast);
part.shadowOffset = MorphicPreferences.isFlat ?
new Point() : this.embossing;
new Point() : this.embossing;
part.drawNew();
break;
case '%pause':
Expand All @@ -897,7 +897,7 @@ SyntaxElementMorph.prototype.labelPart = function (spec) {
part.isProtectedLabel = true; // doesn't participate in zebraing
part.shadowColor = this.color.darker(this.labelContrast);
part.shadowOffset = MorphicPreferences.isFlat ?
new Point() : this.embossing;
new Point() : this.embossing;
part.drawNew();
break;
default:
Expand All @@ -906,7 +906,7 @@ SyntaxElementMorph.prototype.labelPart = function (spec) {
} else if (spec[0] === '$' &&
spec.length > 1 &&
this.selector !== 'reportGetVar') {
/*
/*
// allow costumes as label symbols
// has issues when loading costumes (asynchronously)
// commented out for now
Expand Down Expand Up @@ -938,7 +938,7 @@ SyntaxElementMorph.prototype.labelPart = function (spec) {
part.isBold = true;
part.shadowColor = this.color.darker(this.labelContrast);
part.shadowOffset = MorphicPreferences.isFlat ?
new Point() : this.embossing;
new Point() : this.embossing;
part.drawNew();
return part;
}
Expand All @@ -952,7 +952,7 @@ SyntaxElementMorph.prototype.labelPart = function (spec) {
part.isProtectedLabel = tokens.length > 2; // zebra colors
part.shadowColor = this.color.darker(this.labelContrast);
part.shadowOffset = MorphicPreferences.isFlat ?
new Point() : this.embossing;
new Point() : this.embossing;
part.drawNew();
} else {
part = new StringMorph(
Expand All @@ -963,7 +963,7 @@ SyntaxElementMorph.prototype.labelPart = function (spec) {
false, // italic
false, // isNumeric
MorphicPreferences.isFlat ?
new Point() : this.embossing, // shadowOffset
new Point() : this.embossing, // shadowOffset
this.color.darker(this.labelContrast), // shadowColor
new Color(255, 255, 255), // color
this.labelFontName // fontName
Expand Down
14 changes: 7 additions & 7 deletions src/client/byob.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ InputSlotDialogMorph.prototype.createSlotTypeButtons = function () {
function () {
myself.setSlotArity('single');
},
"Single input.",
'Single input.',
function () {
return myself.fragment.isSingleInput();
}
Expand All @@ -208,12 +208,12 @@ InputSlotDialogMorph.prototype.createSlotTypeButtons = function () {

this.addSlotArityButton(
function () {myself.setSlotArity('multiple'); },
"Multiple inputs (value is list of inputs)",
'Multiple inputs (value is list of inputs)',
function () {return myself.fragment.isMultipleInput(); }
);
this.addSlotArityButton(
function () {myself.setSlotArity('upvar'); },
"Upvar - make internal variable visible to caller",
'Upvar - make internal variable visible to caller',
function () {return myself.fragment.isUpvar(); }
);

Expand All @@ -223,9 +223,9 @@ InputSlotDialogMorph.prototype.createSlotTypeButtons = function () {
defLabel.setColor(new Color(255, 255, 255));
defLabel.refresh = function () {
if (myself.isExpanded && contains(
['%s', '%n', '%txt', '%anyUE'],
myself.fragment.type
)) {
['%s', '%n', '%txt', '%anyUE'],
myself.fragment.type
)) {
defLabel.show();
} else {
defLabel.hide();
Expand Down Expand Up @@ -394,7 +394,7 @@ BlockExportDialogMorph.prototype.buildContents = function (stage) {
checkBox.setPosition(new Point(
x,
y + (checkBox.top() - checkBox.toggleElement.top())
));
));
palette.addContents(checkBox);
y += checkBox.fullBounds().height() + padding;
}.bind(this));
Expand Down
2 changes: 1 addition & 1 deletion src/client/cloud.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* global localize, nop, IDE_Morph, Cloud, detect, SnapActions*/
/* global localize, nop, IDE_Morph, Cloud, detect, SnapActions, world*/
NetCloud.prototype = new Cloud();

function NetCloud(url) {
Expand Down
28 changes: 14 additions & 14 deletions src/client/gui.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,16 +284,16 @@ ProjectDialogMorph.prototype.installShareCloudProjectList = function (pl) {
this.projectList = pl || [];
this.projectList.sort(function (x, y) {
return x.ProjectName.toLowerCase() < y.ProjectName.toLowerCase() ?
-1 : 1;
-1 : 1;
});

this.listField.destroy();
this.listField = new ListMorph(
this.projectList,
this.projectList.length > 0 ?
function (element) {
return element.ProjectName || element;
} : null,
function (element) {
return element.ProjectName || element;
} : null,
[ // format: display shared project names bold
[
'bold',
Expand Down Expand Up @@ -327,7 +327,7 @@ ProjectDialogMorph.prototype.installShareCloudProjectList = function (pl) {
// Netsblox addition: start
localize('owner') + ': ' + item.Owner + '\n' +
localize('last changed') + '\n' + item.Updated,
// Netsblox addition: end
// Netsblox addition: end
null,
null,
null,
Expand Down Expand Up @@ -417,9 +417,9 @@ ProjectDialogMorph.prototype.setSource = function (source) {
this.listField = new ListMorph(
this.projectList,
this.projectList.length > 0 ?
function (element) {
return element.name;
} : null,
function (element) {
return element.name;
} : null,
null,
function () {myself.ok(); }
);
Expand Down Expand Up @@ -616,9 +616,9 @@ ProjectDialogMorph.prototype.saveProject = function () {
if (name) {
if (this.source === 'cloud') {
if (detect(
this.projectList,
function (item) {return item.ProjectName === name; }
)) {
this.projectList,
function (item) {return item.ProjectName === name; }
)) {
this.ide.confirm(
localize(
'Are you sure you want to replace'
Expand Down Expand Up @@ -659,9 +659,9 @@ ProjectDialogMorph.prototype.saveProject = function () {
}
} else { // 'local'
if (detect(
this.projectList,
function (item) {return item.name === name; }
)) {
this.projectList,
function (item) {return item.name === name; }
)) {
this.ide.confirm(
localize(
'Are you sure you want to replace'
Expand Down
Loading

0 comments on commit bac7e91

Please sign in to comment.