@@ -7852,7 +7852,10 @@ var ReactDOMOption = {
7852
7852
}
7853
7853
});
7854
7854
7855
- nativeProps.children = content;
7855
+ if (content) {
7856
+ nativeProps.children = content;
7857
+ }
7858
+
7856
7859
return nativeProps;
7857
7860
}
7858
7861
@@ -14021,7 +14024,7 @@ module.exports = ReactUpdates;
14021
14024
14022
14025
'use strict';
14023
14026
14024
- module.exports = '0.14.6 ';
14027
+ module.exports = '0.14.7 ';
14025
14028
},{}],87:[function(require,module,exports){
14026
14029
/**
14027
14030
* Copyright 2013-2015, Facebook, Inc.
@@ -15116,6 +15119,7 @@ var warning = require('fbjs/lib/warning');
15116
15119
*/
15117
15120
var EventInterface = {
15118
15121
type: null,
15122
+ target: null,
15119
15123
// currentTarget is set when dispatching; no use in copying it here
15120
15124
currentTarget: emptyFunction.thatReturnsNull,
15121
15125
eventPhase: null,
@@ -15149,8 +15153,6 @@ function SyntheticEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEvent
15149
15153
this.dispatchConfig = dispatchConfig;
15150
15154
this.dispatchMarker = dispatchMarker;
15151
15155
this.nativeEvent = nativeEvent;
15152
- this.target = nativeEventTarget;
15153
- this.currentTarget = nativeEventTarget;
15154
15156
15155
15157
var Interface = this.constructor.Interface;
15156
15158
for (var propName in Interface) {
@@ -15161,7 +15163,11 @@ function SyntheticEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEvent
15161
15163
if (normalize) {
15162
15164
this[propName] = normalize(nativeEvent);
15163
15165
} else {
15164
- this[propName] = nativeEvent[propName];
15166
+ if (propName === 'target') {
15167
+ this.target = nativeEventTarget;
15168
+ } else {
15169
+ this[propName] = nativeEvent[propName];
15170
+ }
15165
15171
}
15166
15172
}
15167
15173
@@ -19037,6 +19043,11 @@ var TwoDots;
19037
19043
return colors[getRandomInt(0, colors.length)];
19038
19044
};
19039
19045
TwoDots.colors = ['red', 'yellow', 'brown', 'blue', 'green'];
19046
+ TwoDots.colorsTable = { red: 'red', yellow: 'yellow', brown: 'orange', blue: '#4A90E2', green: 'green', grey: 'grey' };
19047
+ function makeCopy(obj) {
19048
+ return JSON.parse(JSON.stringify(obj));
19049
+ }
19050
+ TwoDots.makeCopy = makeCopy;
19040
19051
function shuffleArray(array) {
19041
19052
for (var i = array.length - 1; i > 0; i--) {
19042
19053
var j = Math.floor(Math.random() * (i + 1));
@@ -19071,6 +19082,7 @@ var TwoDots;
19071
19082
if (height === void 0) { height = 5; }
19072
19083
this.width = width;
19073
19084
this.height = height;
19085
+ this.levelSolved = 0;
19074
19086
this.Rules = new Rules();
19075
19087
this.mode = 'board';
19076
19088
this.Grid = [];
@@ -19109,9 +19121,6 @@ var Hello = React.createClass({displayName: "Hello",
19109
19121
path: [],
19110
19122
getInitialState: function () {
19111
19123
return new TwoDotsState_1.TwoDots.TwoDotsState(Number(this.props.width), Number(this.props.height));
19112
- while (this.needsShuffling()) {
19113
- this.shuffleBoard();
19114
- }
19115
19124
},
19116
19125
needsShuffling: function () {
19117
19126
var thisFlatArray = this.thisArray();
@@ -19346,6 +19355,7 @@ var LevelEditor = (function (_super) {
19346
19355
LevelEditor.prototype.changedcolorRules = function () {
19347
19356
var _this = this;
19348
19357
var colorLimit = this.refs['colorRules'].value;
19358
+ this.state.Rules.amountToCollect = {};
19349
19359
TwoDotsState_1.TwoDots.colors.slice(0, Number(colorLimit)).map(function (color) {
19350
19360
_this.state.Rules.amountToCollect[color] = 5;
19351
19361
});
@@ -19450,6 +19460,7 @@ var __extends = (this && this.__extends) || function (d, b) {
19450
19460
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
19451
19461
};
19452
19462
var React = require('react');
19463
+ var TwoDotsState_1 = require('./TwoDotsState');
19453
19464
var ScoreTable = (function (_super) {
19454
19465
__extends(ScoreTable, _super);
19455
19466
function ScoreTable() {
@@ -19461,20 +19472,39 @@ var ScoreTable = (function (_super) {
19461
19472
var turns = this.props.turns;
19462
19473
var maxTurns = this.props.maxTurns;
19463
19474
var cells = [];
19475
+ var colors = [];
19464
19476
Object.keys(rules.amountToCollect).map(function (key) {
19465
19477
//var short = key + " short"
19466
19478
var key2 = key + "value";
19467
- cells.push(React.createElement("td", {className: "short", key: key}, React.createElement("div", {className: key + ' cell'})));
19468
- cells.push(React.createElement("td", {className: 'short2 ' + (score[key] >= rules.amountToCollect[key] ? 'completedColor' : ''), key: key2}, score[key] + ' / ' + rules.amountToCollect[key]));
19479
+ cells.push(React.createElement("td", {className: 'short2 ' + (score[key] >= rules.amountToCollect[key] ? 'completedColor' : ''), key: key2}, score[key] + ' / ' +
19480
+ rules.amountToCollect[key]));
19481
+ colors.push(React.createElement("td", {key: key},
19482
+ React.createElement("svg", {height: "20", width: "20"},
19483
+ React.createElement("circle", {cx: "10", cy: "10", r: "10", strokeWidth: "0", fill: TwoDotsState_1.TwoDots.colorsTable[key]})
19484
+ )
19485
+ ));
19469
19486
});
19470
- cells.push(React.createElement("td", {className: "short3", key: "turns"}, " ", 'Turns ' + turns + ' / ' + maxTurns, " "));
19471
- return (React.createElement("table", {className: "scoreTable"}, React.createElement("tbody", null, React.createElement("tr", null,
19472
- cells
19473
- ))));
19487
+ //cells.push(<td className="short3" key='turns'> {'Turns ' + turns + ' / ' + maxTurns} </td>)
19488
+ return (React.createElement("div", {className: "score"},
19489
+
19490
+
19491
+ React.createElement("table", null,
19492
+ React.createElement("tbody", null,
19493
+ React.createElement("tr", null,
19494
+ cells
19495
+ ),
19496
+ React.createElement("tr", null,
19497
+ colors
19498
+
19499
+ )
19500
+ )
19501
+ )
19502
+
19503
+ ));
19474
19504
};
19475
19505
return ScoreTable;
19476
19506
})(React.Component);
19477
19507
Object.defineProperty(exports, "__esModule", { value: true });
19478
19508
exports.default = ScoreTable;
19479
19509
19480
- },{"react":158}]},{},[160]);
19510
+ },{"./TwoDotsState":159," react":158}]},{},[160]);
0 commit comments