Skip to content

Commit d5f94f1

Browse files
committed
s/maybe/computed, fixes ondras#24
1 parent dcf79d0 commit d5f94f1

File tree

5 files changed

+23
-17
lines changed

5 files changed

+23
-17
lines changed

index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ <h3>My Mind</h3>
5757
<option value="">None</option>
5858
<option value="yes">Yes</option>
5959
<option value="no">No</option>
60-
<option value="maybe">Auto</option>
60+
<option value="computed">Autocompute</option>
6161
</select>
6262
</p>
6363
<p>

my-mind.js

+11-8
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,10 @@ MM.Item.prototype.fromJSON = function(data) {
358358
if (data.side) { this._side = data.side; }
359359
if (data.color) { this._color = data.color; }
360360
if (data.value) { this._value = data.value; }
361-
if (data.status) { this._status = data.status; }
361+
if (data.status) {
362+
this._status = data.status;
363+
if (this._status == "maybe") { this._status = "computed"; }
364+
}
362365
if (data.collapsed) { this.collapse(); }
363366
if (data.layout) { this._layout = MM.Layout.getById(data.layout); }
364367
if (data.shape) { this.setShape(MM.Shape.getById(data.shape)); }
@@ -683,7 +686,7 @@ MM.Item.prototype._updateStatus = function() {
683686
this._dom.status.style.display = "";
684687

685688
var status = this._status;
686-
if (this._status == "maybe") {
689+
if (this._status == "computed") {
687690
var childrenStatus = this._children.every(function(child) {
688691
return (child.getComputedStatus() !== false);
689692
});
@@ -1803,13 +1806,13 @@ MM.Command.No.execute = function() {
18031806
MM.App.action(action);
18041807
}
18051808

1806-
MM.Command.Maybe = Object.create(MM.Command, {
1807-
label: {value: "Maybe"},
1808-
keys: {value: [{charCode: "m".charCodeAt(0), ctrlKey:false}]}
1809+
MM.Command.Computed = Object.create(MM.Command, {
1810+
label: {value: "Computed"},
1811+
keys: {value: [{charCode: "c".charCodeAt(0), ctrlKey:false}]}
18091812
});
1810-
MM.Command.Maybe.execute = function() {
1813+
MM.Command.Computed.execute = function() {
18111814
var item = MM.App.current;
1812-
var status = (item.getStatus() == "maybe" ? null : "maybe");
1815+
var status = (item.getStatus() == "computed" ? null : "computed");
18131816
var action = new MM.Action.SetStatus(item, status);
18141817
MM.App.action(action);
18151818
}
@@ -3525,7 +3528,7 @@ MM.UI.Help.prototype._build = function() {
35253528

35263529
var t = this._node.querySelector(".editing");
35273530
this._buildRow(t, "Value");
3528-
this._buildRow(t, "Yes", "No", "Maybe");
3531+
this._buildRow(t, "Yes", "No", "Computed");
35293532
this._buildRow(t, "Edit");
35303533
this._buildRow(t, "Newline");
35313534
this._buildRow(t, "Bold");

src/command.edit.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,13 @@ MM.Command.No.execute = function() {
138138
MM.App.action(action);
139139
}
140140

141-
MM.Command.Maybe = Object.create(MM.Command, {
142-
label: {value: "Maybe"},
143-
keys: {value: [{charCode: "m".charCodeAt(0), ctrlKey:false}]}
141+
MM.Command.Computed = Object.create(MM.Command, {
142+
label: {value: "Computed"},
143+
keys: {value: [{charCode: "c".charCodeAt(0), ctrlKey:false}]}
144144
});
145-
MM.Command.Maybe.execute = function() {
145+
MM.Command.Computed.execute = function() {
146146
var item = MM.App.current;
147-
var status = (item.getStatus() == "maybe" ? null : "maybe");
147+
var status = (item.getStatus() == "computed" ? null : "computed");
148148
var action = new MM.Action.SetStatus(item, status);
149149
MM.App.action(action);
150150
}

src/item.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,10 @@ MM.Item.prototype.fromJSON = function(data) {
7070
if (data.side) { this._side = data.side; }
7171
if (data.color) { this._color = data.color; }
7272
if (data.value) { this._value = data.value; }
73-
if (data.status) { this._status = data.status; }
73+
if (data.status) {
74+
this._status = data.status;
75+
if (this._status == "maybe") { this._status = "computed"; }
76+
}
7477
if (data.collapsed) { this.collapse(); }
7578
if (data.layout) { this._layout = MM.Layout.getById(data.layout); }
7679
if (data.shape) { this.setShape(MM.Shape.getById(data.shape)); }
@@ -395,7 +398,7 @@ MM.Item.prototype._updateStatus = function() {
395398
this._dom.status.style.display = "";
396399

397400
var status = this._status;
398-
if (this._status == "maybe") {
401+
if (this._status == "computed") {
399402
var childrenStatus = this._children.every(function(child) {
400403
return (child.getComputedStatus() !== false);
401404
});

src/ui.help.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ MM.UI.Help.prototype._build = function() {
6262

6363
var t = this._node.querySelector(".editing");
6464
this._buildRow(t, "Value");
65-
this._buildRow(t, "Yes", "No", "Maybe");
65+
this._buildRow(t, "Yes", "No", "Computed");
6666
this._buildRow(t, "Edit");
6767
this._buildRow(t, "Newline");
6868
this._buildRow(t, "Bold");

0 commit comments

Comments
 (0)