update docify

This commit is contained in:
lxsang 2020-11-24 20:07:46 +00:00
parent 6ee45214af
commit 8523c7fbb6
11 changed files with 19 additions and 39 deletions

View File

@ -1,15 +1,2 @@
# Docify # Docify
This is an example project, generated by AntOS Development Kit Simple PDF document manager
## Howto
Use the CodePad command palette to access to the SDK functionalities:
1. Create new project
2. Init the project from the current folder located in side bar
3. Build and run the project
4. Release the project in zip package
## Set up build target
Open the `project.json` file from the current project tree and add/remove
build target entries. Save the file

View File

@ -41,7 +41,7 @@ local merge_files = function(data)
if #data.file > 1 then if #data.file > 1 then
local cmd = "gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile="..vfs.ospath(fpath) local cmd = "gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile="..vfs.ospath(fpath)
for i,v in ipairs(data.file) do for i,v in ipairs(data.file) do
cmd = cmd.." "..vfs.ospath(v) cmd = cmd.." \""..vfs.ospath(v).."\""
end end
os.execute(cmd) os.execute(cmd)
if not vfs.exists(fpath) then if not vfs.exists(fpath) then
@ -233,7 +233,7 @@ handle.preview = function(path)
local tpath = docpath.."/cache/"..name local tpath = docpath.."/cache/"..name
if not vfs.exists(tpath) then if not vfs.exists(tpath) then
-- regenerate thumb -- regenerate thumb
local cmd = "convert -resize 250x500 "..vfs.ospath(path).."[0] "..vfs.ospath(tpath) local cmd = "convert -resize 250x500 \""..vfs.ospath(path).."\"[0] "..vfs.ospath(tpath)
os.execute(cmd) os.execute(cmd)
end end

View File

@ -1,15 +1,2 @@
# Docify # Docify
This is an example project, generated by AntOS Development Kit Simple PDF document manager
## Howto
Use the CodePad command palette to access to the SDK functionalities:
1. Create new project
2. Init the project from the current folder located in side bar
3. Build and run the project
4. Release the project in zip package
## Set up build target
Open the `project.json` file from the current project tree and add/remove
build target entries. Save the file

View File

@ -41,7 +41,7 @@ local merge_files = function(data)
if #data.file > 1 then if #data.file > 1 then
local cmd = "gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile="..vfs.ospath(fpath) local cmd = "gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile="..vfs.ospath(fpath)
for i,v in ipairs(data.file) do for i,v in ipairs(data.file) do
cmd = cmd.." "..vfs.ospath(v) cmd = cmd.." \""..vfs.ospath(v).."\""
end end
os.execute(cmd) os.execute(cmd)
if not vfs.exists(fpath) then if not vfs.exists(fpath) then
@ -233,7 +233,7 @@ handle.preview = function(path)
local tpath = docpath.."/cache/"..name local tpath = docpath.."/cache/"..name
if not vfs.exists(tpath) then if not vfs.exists(tpath) then
-- regenerate thumb -- regenerate thumb
local cmd = "convert -resize 250x500 "..vfs.ospath(path).."[0] "..vfs.ospath(tpath) local cmd = "convert -resize 250x500 \""..vfs.ospath(path).."\"[0] "..vfs.ospath(tpath)
os.execute(cmd) os.execute(cmd)
end end

File diff suppressed because one or more lines are too long

View File

@ -7,7 +7,7 @@
"author": "", "author": "",
"email": "" "email": ""
}, },
"version":"0.0.1-a", "version":"0.0.2-a",
"category":"Other", "category":"Other",
"iconclass":"fa fa-adn", "iconclass":"fa fa-adn",
"mimes":["none"], "mimes":["none"],

Binary file not shown.

View File

@ -251,7 +251,7 @@ class FilePreviewDialog extends this.OS.GUI.BasicDialog
.then (d) => .then (d) =>
return @error d.error if d.error return @error d.error if d.error
v.text = v.filename for v in d.result v.text = v.filename for v in d.result
@flist.data = d.result @flist.data = (v for v in d.result when v.filename[0] isnt '.')
.catch (e) => .catch (e) =>
@error __("Unable to fetch unclassified file list: {0}", e.toString()), e @error __("Unable to fetch unclassified file list: {0}", e.toString()), e

View File

@ -193,6 +193,8 @@ class Docify extends this.OS.application.BaseApplication
@error e.toString(), e @error e.toString(), e
cat_refresh: () -> cat_refresh: () ->
@docview.data = []
@clear_preview()
@exec("fetch", "categories") @exec("fetch", "categories")
.then (d) => .then (d) =>
v.text = v.name for v in d.result v.text = v.name for v in d.result
@ -239,8 +241,9 @@ class Docify extends this.OS.application.BaseApplication
{ {
text: "__(View)", text: "__(View)",
nodes: [ nodes: [
{ text: "__(Owners)", id:"owners", shortcut: "A-O"}, { text: "__(Owners)", id:"owners"},
{ text: "__(Preview)", id:"preview", shortcut: "A-P"} { text: "__(Preview)", id:"preview"},
{ text: "__(Change doc path)", id:"setdocp"}
], ],
onchildselect: (e) => @fileMenuHandle e.data.item.data.id onchildselect: (e) => @fileMenuHandle e.data.item.data.id
} }
@ -254,5 +257,8 @@ class Docify extends this.OS.application.BaseApplication
@openDialog(new FilePreviewDialog()) @openDialog(new FilePreviewDialog())
.then (d) => .then (d) =>
@notify d.path @notify d.path
when "setdocp"
@setting.docpath = undefined
@initialize()
this.OS.register "Docify", Docify this.OS.register "Docify", Docify

View File

@ -7,7 +7,7 @@
"author": "", "author": "",
"email": "" "email": ""
}, },
"version":"0.0.1-a", "version":"0.0.2-a",
"category":"Other", "category":"Other",
"iconclass":"fa fa-adn", "iconclass":"fa fa-adn",
"mimes":["none"], "mimes":["none"],

View File

@ -77,7 +77,7 @@
"description": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/Docify/README.md", "description": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/Docify/README.md",
"category": "Other", "category": "Other",
"author": "", "author": "",
"version": "0.0.1-a", "version": "0.0.2-a",
"download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/Docify/build/release/Docify.zip" "download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/Docify/build/release/Docify.zip"
}, },
{ {