}
},
"delete": function() {
+ // Delete node and its entire subtree
console.log("Delete not implemented"); // TODO
},
indent: function() {
+ // Last child of previous sibling, then nothing
console.log("Indent not implemented"); // TODO
+ this.moveTo({keyboard:true});
},
outdent: function() {
+ // After parent, then nothing
console.log("Outdent not implemented"); // TODO
+ this.moveTo({keyboard:true});
},
expand: function() {
console.log("Expand not implemented"); // TODO
console.log("Zoom not implemented"); // TODO
},
moveDown: function() {
+ // After next sibling, then as first child of next node after parent, then up one level, then nothing
console.log("Move not implemented"); // TODO
+ this.moveTo({keyboard:true});
},
moveUp: function() {
+ // Before previous sibling, then as last child of previous node of parent, then before parent, then nothing
console.log("Move not implemented"); // TODO
+ this.moveTo({keyboard:true});
+ },
+ moveTo: function(loc, options) {
+ loc = _.defaults({}, loc, { parent: this.model.getParent(this.model.collection), index: this.model.getParent(this.model.collection).findChild(this.model.id) });
+ options = _.defaults({}, options, {
+ keyboard: false, // Whether the action was done with keyboard vs mouse (affects UI focus)
+ });
+ console.log("Move not implemented");
+ return false;
},
textChange: function(e) {
var collection = this.model.collection;
// - If there are children, make the new node the first child. Focus the second node.
// NOTE: Copy-paste is overridden so there can't be more than one line break.
// NOTE: Shift-enter is overridden and handled seperately, to allow "notes" spanning multiple lines.
- // NOTE: Line break on empty bullet should shift it up the tree for perfect imitation; this is stupid so I ignored it.
} else if ((lines.length === 2 && lines[0] === "" && lines[1] === "") || (lines.length === 3 && lines[0] === "" && lines[1] === "" && lines[2] === "")) { // Enter pressed on empty line
this.model.setText(this.decodeText(lines[0]));
this.stopEditingText();
}
},
"delete": function() {
+ // Delete node and its entire subtree
console.log("Delete not implemented"); // TODO
},
indent: function() {
+ // Last child of previous sibling, then nothing
console.log("Indent not implemented"); // TODO
+ this.moveTo({keyboard:true});
},
outdent: function() {
+ // After parent, then nothing
console.log("Outdent not implemented"); // TODO
+ this.moveTo({keyboard:true});
},
expand: function() {
console.log("Expand not implemented"); // TODO
console.log("Zoom not implemented"); // TODO
},
moveDown: function() {
+ // After next sibling, then as first child of next node after parent, then up one level, then nothing
console.log("Move not implemented"); // TODO
+ this.moveTo({keyboard:true});
},
moveUp: function() {
+ // Before previous sibling, then as last child of previous node of parent, then before parent, then nothing
console.log("Move not implemented"); // TODO
+ this.moveTo({keyboard:true});
+ },
+ moveTo: function(loc, options) {
+ loc = _.defaults({}, loc, { parent: this.model.getParent(this.model.collection), index: this.model.getParent(this.model.collection).findChild(this.model.id) });
+ options = _.defaults({}, options, {
+ keyboard: false, // Whether the action was done with keyboard vs mouse (affects UI focus)
+ });
+ console.log("Move not implemented");
+ return false;
},
textChange: function(e) {
var collection = this.model.collection;
// - If there are children, make the new node the first child. Focus the second node.
// NOTE: Copy-paste is overridden so there can't be more than one line break.
// NOTE: Shift-enter is overridden and handled seperately, to allow "notes" spanning multiple lines.
- // NOTE: Line break on empty bullet should shift it up the tree for perfect imitation; this is stupid so I ignored it.
} else if ((lines.length === 2 && lines[0] === "" && lines[1] === "") || (lines.length === 3 && lines[0] === "" && lines[1] === "" && lines[2] === "")) { // Enter pressed on empty line
this.model.setText(this.decodeText(lines[0]));
this.stopEditingText();
}
},
"delete": function() {
+ // Delete node and its entire subtree
console.log("Delete not implemented"); // TODO
},
indent: function() {
+ // Last child of previous sibling, then nothing
console.log("Indent not implemented"); // TODO
+ this.moveTo({keyboard:true});
},
outdent: function() {
+ // After parent, then nothing
console.log("Outdent not implemented"); // TODO
+ this.moveTo({keyboard:true});
},
expand: function() {
console.log("Expand not implemented"); // TODO
console.log("Zoom not implemented"); // TODO
},
moveDown: function() {
+ // After next sibling, then as first child of next node after parent, then up one level, then nothing
console.log("Move not implemented"); // TODO
+ this.moveTo({keyboard:true});
},
moveUp: function() {
+ // Before previous sibling, then as last child of previous node of parent, then before parent, then nothing
console.log("Move not implemented"); // TODO
+ this.moveTo({keyboard:true});
+ },
+ moveTo: function(loc, options) {
+ loc = _.defaults({}, loc, { parent: this.model.getParent(this.model.collection), index: this.model.getParent(this.model.collection).findChild(this.model.id) });
+ options = _.defaults({}, options, {
+ keyboard: false, // Whether the action was done with keyboard vs mouse (affects UI focus)
+ });
+ console.log("Move not implemented");
+ return false;
},
textChange: function(e) {
var collection = this.model.collection;
// - If there are children, make the new node the first child. Focus the second node.
// NOTE: Copy-paste is overridden so there can't be more than one line break.
// NOTE: Shift-enter is overridden and handled seperately, to allow "notes" spanning multiple lines.
- // NOTE: Line break on empty bullet should shift it up the tree for perfect imitation; this is stupid so I ignored it.
} else if ((lines.length === 2 && lines[0] === "" && lines[1] === "") || (lines.length === 3 && lines[0] === "" && lines[1] === "" && lines[2] === "")) { // Enter pressed on empty line
this.model.setText(this.decodeText(lines[0]));
this.stopEditingText();