This commit is contained in:
lxsang 2018-07-25 14:20:13 +00:00
parent e54a33605a
commit d8d56ffef5
4 changed files with 6 additions and 8 deletions

View File

@ -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) {

View File

@ -9,5 +9,5 @@
"version":"0.0.1-a",
"category":"Other",
"iconclass":"fa fa-adn",
"mimes":["none"]
"mimes":["text/.*"]
}

View File

@ -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()

View File

@ -9,5 +9,5 @@
"version":"0.0.1-a",
"category":"Other",
"iconclass":"fa fa-adn",
"mimes":["none"]
"mimes":["text/.*"]
}