mirror of
https://github.com/lxsang/antos-frontend.git
synced 2025-07-27 03:09:45 +02:00
VFS for Google Drive, 1st working version
This commit is contained in:
@ -88,6 +88,7 @@ class Files extends this.OS.GUI.BaseApplication
|
||||
|
||||
chdir: (p) ->
|
||||
me = @
|
||||
console.log "ch"
|
||||
dir = if p then p.asFileHandler() else me.currdir
|
||||
dir.read (d) ->
|
||||
if(d.error)
|
||||
@ -102,7 +103,7 @@ class Files extends this.OS.GUI.BaseApplication
|
||||
d.result.unshift p
|
||||
($ me.navinput).val dir.path
|
||||
me.view.set "path", dir.path
|
||||
console.log d.result
|
||||
#console.log d.result
|
||||
me.view.set "data", d.result
|
||||
|
||||
mnFile:() ->
|
||||
@ -252,7 +253,7 @@ class Files extends this.OS.GUI.BaseApplication
|
||||
@openDialog "PromptDialog",
|
||||
(d) ->
|
||||
fp = "#{me.currdir.path}/#{d}".asFileHandler()
|
||||
fp.write "", (r) ->
|
||||
fp.write "text/plain", (r) ->
|
||||
me.error "Fail to create #{d}: #{r.error}" if r.error
|
||||
, "New file", { label: "File name:" }
|
||||
|
||||
|
@ -112,6 +112,7 @@ class NotePad extends this.OS.GUI.BaseApplication
|
||||
open: (file) ->
|
||||
#find table
|
||||
i = @findTabByFile file
|
||||
@fileview.set "preventUpdate", true
|
||||
return @tabarea.set "selected", i if i isnt -1
|
||||
return @newtab file if file.path.toString() is "Untitled"
|
||||
me = @
|
||||
@ -163,7 +164,7 @@ class NotePad extends this.OS.GUI.BaseApplication
|
||||
|
||||
save: (file) ->
|
||||
me = @
|
||||
file.write (file.getb64 "text/plain"), (d) ->
|
||||
file.write "text/plain", (d) ->
|
||||
return me.error "Error saving file #{file.basename}" if d.error
|
||||
file.dirty = false
|
||||
file.text = file.basename
|
||||
@ -191,7 +192,6 @@ class NotePad extends this.OS.GUI.BaseApplication
|
||||
@currfile.selected = false
|
||||
file.selected = true
|
||||
#console.log cnt
|
||||
@fileview.set "preventUpdate", true
|
||||
@tabarea.push file, true
|
||||
#@currfile = @file
|
||||
#TODO: fix problem : @tabarea.set "selected", cnt
|
||||
@ -255,7 +255,15 @@ class NotePad extends this.OS.GUI.BaseApplication
|
||||
me = @
|
||||
saveas = () ->
|
||||
me.openDialog "FileDiaLog", (d, n) ->
|
||||
me.currfile.setPath "#{d}/#{n}"
|
||||
file = "#{d}/#{n}".asFileHandler()
|
||||
file.cache = me.currfile.cache
|
||||
file.dirty = me.currfile.dirty
|
||||
file.um = me.currfile.um
|
||||
file.cursor = me.currfile.cursor
|
||||
file.selected = me.currfile.selected
|
||||
file.text = me.currfile.text
|
||||
me.tabarea.replaceItem me.currfile, file, false
|
||||
me.currfile = file
|
||||
me.save me.currfile
|
||||
, "Save as", { file: me.currfile }
|
||||
switch e
|
||||
|
Reference in New Issue
Block a user