-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
300 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
assets/javascripts/app/controllers/stage/selection.module.coffee
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
min = (a = 0, b = 0) -> | ||
return b if a is 0 | ||
Math.min(a, b) | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
class Undo | ||
@undoStack: [] | ||
@redoStack: [] | ||
|
||
@add: (undo, redo) -> | ||
@undoStack.push([undo, redo]) | ||
@redoStack = [] | ||
redo() | ||
|
||
@undo: -> | ||
[undo, redo] = @undoStack.pop() | ||
undo() | ||
@redoStack.push([undo, redo]) | ||
|
||
@redo: -> | ||
[undo, redo] = @redoStack.pop() | ||
redo() | ||
@undoStack.push([undo, redo]) | ||
|
||
module.exports = Undo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
(function() { | ||
if (!this.require) { | ||
var modules = {}, cache = {}; | ||
|
||
var require = function(name, root) { | ||
var path = expand(root, name), indexPath = expand(path, './index'), module, fn; | ||
module = cache[path] || cache[indexPath]; | ||
if (module) { | ||
return module; | ||
} else if (fn = modules[path] || modules[path = indexPath]) { | ||
module = {id: path, exports: {}}; | ||
cache[path] = module.exports; | ||
fn(module.exports, function(name) { | ||
return require(name, dirname(path)); | ||
}, module); | ||
return cache[path] = module.exports; | ||
} else { | ||
throw 'module ' + name + ' not found'; | ||
} | ||
}; | ||
|
||
var expand = function(root, name) { | ||
var results = [], parts, part; | ||
// If path is relative | ||
if (/^\.\.?(\/|$)/.test(name)) { | ||
parts = [root, name].join('/').split('/'); | ||
} else { | ||
parts = name.split('/'); | ||
} | ||
for (var i = 0, length = parts.length; i < length; i++) { | ||
part = parts[i]; | ||
if (part == '..') { | ||
results.pop(); | ||
} else if (part != '.' && part != '') { | ||
results.push(part); | ||
} | ||
} | ||
return results.join('/'); | ||
}; | ||
|
||
var dirname = function(path) { | ||
return path.split('/').slice(0, -1).join('/'); | ||
}; | ||
|
||
this.require = function(name) { | ||
return require(name, ''); | ||
}; | ||
|
||
this.require.define = function(bundle) { | ||
for (var key in bundle) { | ||
modules[key] = bundle[key]; | ||
} | ||
}; | ||
|
||
this.require.modules = modules; | ||
this.require.cache = cache; | ||
} | ||
|
||
return this.require; | ||
}).call(this); | ||
this.require.define({"app/controllers/element/undo":function(exports, require, module){(function() { | ||
var Undo; | ||
|
||
Undo = (function() { | ||
|
||
function Undo() {} | ||
|
||
Undo.undoStack = []; | ||
|
||
Undo.redoStack = []; | ||
|
||
Undo.add = function(undo, action) { | ||
this.undoStack.push(undo); | ||
return this.redoStack = []; | ||
}; | ||
|
||
Undo.undo = function() {}; | ||
|
||
return Undo; | ||
|
||
})(); | ||
|
||
module["extends"] = Undo; | ||
|
||
}).call(this); | ||
;}}); |
Oops, something went wrong.