From d8d56ffef5d9a30466a9d3a46f684670354bebed Mon Sep 17 00:00:00 2001 From: lxsang Date: Wed, 25 Jul 2018 14:20:13 +0000 Subject: [PATCH] fix --- TinyEditor/build/debug/main.js | 5 ++--- TinyEditor/build/debug/package.json | 2 +- TinyEditor/coffees/main.coffee | 5 ++--- TinyEditor/package.json | 2 +- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/TinyEditor/build/debug/main.js b/TinyEditor/build/debug/main.js index a201be2..420f31a 100644 --- a/TinyEditor/build/debug/main.js +++ b/TinyEditor/build/debug/main.js @@ -10,7 +10,6 @@ var me; me = this; this.editor = this.find("editor"); - this.stbar = this.find("statusbar"); this.bindKey("ALT-N", function() { return me.newFile(); }); @@ -20,7 +19,7 @@ this.bindKey("CTRL-S", function() { return me.saveFile(); }); - this.filehandler = null; + this.filehandler = this.args && this.args.length > 0 ? this.args[0].asFileHandler() : null; $(this.editor).on('input', function(e) { if (me.filehandler.dirty === true) { return; @@ -74,7 +73,7 @@ return this.read(); } - openFile(fi) { + openFile() { var me; me = this; return this.openDialog("FileDiaLog", function(dir, fname, d) { diff --git a/TinyEditor/build/debug/package.json b/TinyEditor/build/debug/package.json index d3c9f90..8ea9640 100644 --- a/TinyEditor/build/debug/package.json +++ b/TinyEditor/build/debug/package.json @@ -9,5 +9,5 @@ "version":"0.0.1-a", "category":"Other", "iconclass":"fa fa-adn", - "mimes":["none"] + "mimes":["text/.*"] } \ No newline at end of file diff --git a/TinyEditor/coffees/main.coffee b/TinyEditor/coffees/main.coffee index 9560ee8..c82e5be 100644 --- a/TinyEditor/coffees/main.coffee +++ b/TinyEditor/coffees/main.coffee @@ -5,11 +5,10 @@ class TinyEditor extends this.OS.GUI.BaseApplication main: () -> me = @ @editor = @find "editor" - @stbar = @find "statusbar" @bindKey "ALT-N", () -> me.newFile() @bindKey "ALT-O", () -> me.openFile() @bindKey "CTRL-S", () -> me.saveFile() - @filehandler = null + @filehandler = if @args and @args.length > 0 then @args[0].asFileHandler() else null $(@editor).on 'input', (e) -> return if me.filehandler.dirty is true me.filehandler.dirty = true @@ -39,7 +38,7 @@ class TinyEditor extends this.OS.GUI.BaseApplication @filehandler = null @read() - openFile: (fi) -> + openFile: () -> me = @ @openDialog "FileDiaLog", ( dir, fname, d ) -> me.filehandler = "#{dir}/#{fname}".asFileHandler() diff --git a/TinyEditor/package.json b/TinyEditor/package.json index d3c9f90..8ea9640 100644 --- a/TinyEditor/package.json +++ b/TinyEditor/package.json @@ -9,5 +9,5 @@ "version":"0.0.1-a", "category":"Other", "iconclass":"fa fa-adn", - "mimes":["none"] + "mimes":["text/.*"] } \ No newline at end of file