diff options
author | Devine Lu Linvega <[email protected]> | 2018-12-02 08:03:18 +1200 |
---|---|---|
committer | Devine Lu Linvega <[email protected]> | 2018-12-02 08:03:18 +1200 |
commit | aee5fbd7151f551ab6883a0284fffa80eb925258 (patch) | |
tree | 62e08d2ae6a4ffa99031b2f4f857a1a24e9409fc /desktop/sources | |
parent | a56dc3af9229fba430ae0ed0661426303967b93a (diff) | |
download | Orca-aee5fbd7151f551ab6883a0284fffa80eb925258.tar.gz Orca-aee5fbd7151f551ab6883a0284fffa80eb925258.zip |
Made X and P passive.
Diffstat (limited to 'desktop/sources')
-rw-r--r-- | desktop/sources/index.html | 2 | ||||
-rw-r--r-- | desktop/sources/scripts/history.js | 19 | ||||
-rw-r--r-- | desktop/sources/scripts/source.js | 6 | ||||
-rw-r--r-- | desktop/sources/scripts/terminal.js | 1 |
4 files changed, 22 insertions, 6 deletions
diff --git a/desktop/sources/index.html b/desktop/sources/index.html index dddbfbc..32478ea 100644 --- a/desktop/sources/index.html +++ b/desktop/sources/index.html @@ -44,6 +44,8 @@ terminal.controller.add("default","Edit","Copy",() => { terminal.cursor.copy(); },"CmdOrCtrl+C") terminal.controller.add("default","Edit","Cut",() => { terminal.cursor.cut(); },"CmdOrCtrl+X") terminal.controller.add("default","Edit","Paste",() => { terminal.cursor.paste(); },"CmdOrCtrl+V") + terminal.controller.add("default","Edit","Undo",() => { terminal.history.undo(); },"CmdOrCtrl+Z") + terminal.controller.add("default","Edit","Redo",() => { terminal.history.redo(); },"CmdOrCtrl+Shift+Z") terminal.controller.add("default","Program","Play/Pause",() => { terminal.pause(); },"Space") terminal.controller.add("default","Program","Incr. Speed",() => { terminal.modSpeed(1); },">") diff --git a/desktop/sources/scripts/history.js b/desktop/sources/scripts/history.js new file mode 100644 index 0000000..a19cdb7 --- /dev/null +++ b/desktop/sources/scripts/history.js @@ -0,0 +1,19 @@ +'use strict' + +function History() +{ + this.record = function() + { + + } + + this.undo = function() + { + + } + + this.redo = function() + { + + } +}
\ No newline at end of file diff --git a/desktop/sources/scripts/source.js b/desktop/sources/scripts/source.js index 2d032ed..483d72a 100644 --- a/desktop/sources/scripts/source.js +++ b/desktop/sources/scripts/source.js @@ -60,16 +60,10 @@ function Source (orca, terminal) { this.read = function (path) { fs.readFile(path, 'utf8', function (err, data) { if (err) throw err - if (!terminal.source.validate(data)) { console.warn('Invalid File'); return } terminal.load(data.trim()) }) } - this.validate = function (data) { - // TODO - return true - } - this.name = function () { const parts = this.path.split('/') return parts[parts.length - 1].replace('.orca', '').trim() diff --git a/desktop/sources/scripts/terminal.js b/desktop/sources/scripts/terminal.js index ed89b62..a2b2a87 100644 --- a/desktop/sources/scripts/terminal.js +++ b/desktop/sources/scripts/terminal.js @@ -3,6 +3,7 @@ function Terminal (orca, tile = { w: 20, h: 30 }) { const Cursor = require('./cursor') const Source = require('./source') + const History = require('./history') const IO = require('./io') this.io = new IO(this) |