Update Booklet and vTerm

This commit is contained in:
lxsang 2020-09-15 10:40:06 +00:00
parent b22474a6e8
commit 416ab0d93a
14 changed files with 24 additions and 192 deletions

View File

@ -3,7 +3,9 @@ A back-end tool for my online document hub [https://doc.iohub.dev/antos/](https:
## Change logs
### v0.2.0-a
* Book meta data is no longer depending on the absolute path
* Meta-data of Books created by Booklet v0.1.x needs to be modified (manually) to work properly on v0.2.x
### v0.1.0-a
* Add support to model/gltf-binary file
### v0.1.0-a: new feature

View File

@ -3,7 +3,9 @@ A back-end tool for my online document hub [https://doc.iohub.dev/antos/](https:
## Change logs
### v0.2.0-a
* Book meta data is no longer depending on the absolute path
* Meta-data of Books created by Booklet v0.1.x needs to be modified (manually) to work properly on v0.2.x
### v0.1.0-a
* Add support to model/gltf-binary file
### v0.1.0-a: new feature

File diff suppressed because one or more lines are too long

View File

@ -6,7 +6,7 @@
"author": "Xuan Sang LE",
"email": "mrsang@lxsang.me"
},
"version":"0.1.1-a",
"version":"0.2.0-a",
"category":"Other",
"iconclass":"fa fa-adn",
"mimes":["dir"]

Binary file not shown.

View File

@ -62,6 +62,7 @@ class BookletFolder extends BookletEntry
add: (chap) ->
chap.parent = @
chap.root = @root
@nodes.push chap
@metaFile.dirty = true if @hasMeta and @metaFile
chap.metaFile.dirty = true if chap.metaFile and chap.hasMeta
@ -98,7 +99,7 @@ class BookletFolder extends BookletEntry
el = (l.splice 0, 1)[0]
obj = new NS[el.type]( @ )
obj.name = el.name
obj.read(el.path).then () =>
obj.read(el.path.replace("book://", @root)).then () =>
fn l
.catch (msg) =>
fn l
@ -144,7 +145,7 @@ class BookletFolder extends BookletEntry
return new Promise (r, e) =>
return r() unless @metaFile.dirty
entries = []
entries[i] = {name: v.name, path:v.path, type:v.type} for v,i in @nodes
entries[i] = {name: v.name, path:v.path.replace( @root, "book://" ), type:v.type} for v,i in @nodes
data = {
name: @text,
entries: entries,
@ -197,6 +198,10 @@ class BookletFolder extends BookletEntry
class BookletBook extends BookletFolder
constructor: (path) ->
super 'Book', path, true
init: () ->
super.init()
@root = @path
save:() ->

View File

@ -289,7 +289,7 @@ class Booklet extends this.OS.application.BaseApplication
switch e
when "#{@name}-Open"
@checkForDirty () =>
@openDialog "FileDialog", { title:__("Open file"), mimes: ['dir'] }
@openDialog "FileDialog", { title:__("Open book"), mimes: ['dir'] }
.then (d) =>
@book = new BookletBook(d.file.path)
@book.read(d.file.path).then () =>
@ -302,7 +302,7 @@ class Booklet extends this.OS.application.BaseApplication
.catch (msg) => @error msg.toString(), msg
when "#{@name}-New"
@openDialog "FileDialog", { title: __("Open file"), mimes: ['dir'], file: { basename: __("BookName") }}
@openDialog "FileDialog", { title: __("New book at"), mimes: ['dir'], file: { basename: __("BookName") }}
.then (d) =>
@newAt "#{d.file.path}/#{d.name}"
.catch (msg) => @error msg.toString(), msg

View File

@ -6,7 +6,7 @@
"author": "Xuan Sang LE",
"email": "mrsang@lxsang.me"
},
"version":"0.1.1-a",
"version":"0.2.0-a",
"category":"Other",
"iconclass":"fa fa-adn",
"mimes":["dir"]

View File

@ -50,7 +50,7 @@
"description": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/Booklet/README.md",
"category": "Other",
"author": "Xuan Sang LE",
"version": "0.1.1-a",
"version": "0.2.0-a",
"download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/Booklet/build/release/Booklet.zip"
},
{
@ -158,7 +158,7 @@
"description": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/vTerm/README.md",
"category": "System",
"author": "Xuan Sang LE",
"version": "0.1.3-a",
"version": "0.1.4-a",
"download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/vTerm/build/release/vTerm.zip"
},
{

File diff suppressed because one or more lines are too long

View File

@ -6,7 +6,7 @@
"author": "Xuan Sang LE",
"email": "xsang.le@gmail.com"
},
"version":"0.1.3-a",
"version":"0.1.4-a",
"category":"System",
"iconclass":"fa fa-terminal",
"mimes":["none"],

Binary file not shown.

View File

@ -78,6 +78,7 @@ class vTerm extends this.OS.application.BaseApplication
@_api.getClipboard().then (text) =>
return unless text and text isnt ""
@sub.send Antunnel.Msg.DATA, new TextEncoder("utf-8").encode(text) if @sub
@term.focus()
.catch (e) => @error __("Unable to paste"), e
when "copy"
text = @term.getSelection()

View File

@ -6,7 +6,7 @@
"author": "Xuan Sang LE",
"email": "xsang.le@gmail.com"
},
"version":"0.1.3-a",
"version":"0.1.4-a",
"category":"System",
"iconclass":"fa fa-terminal",
"mimes":["none"],