mirror of
https://github.com/antos-rde/antosdk-apps.git
synced 2025-07-20 15:59:46 +02:00
Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
5594516697 |
14
Blogger/project.json
Normal file
14
Blogger/project.json
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "Blogger",
|
||||
"css": ["main.css"],
|
||||
"javascripts": [],
|
||||
"coffees": ["main.coffee", "dialogs.coffee", "tags.coffee"],
|
||||
"copies": [
|
||||
"scheme.html",
|
||||
"cvsection.html",
|
||||
"api/sendmail.lua",
|
||||
"sendmail.html",
|
||||
"package.json",
|
||||
"README.md"
|
||||
]
|
||||
}
|
@ -1,8 +1,8 @@
|
||||
# AntunnelTestClient
|
||||
# DBDecoder
|
||||
This is an example project, generated by AntOS Development Kit
|
||||
|
||||
## Howto
|
||||
Use the Antedit command palette to access to the SDK functionalities:
|
||||
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
|
||||
@ -11,5 +11,5 @@ Use the Antedit command palette to access to the SDK functionalities:
|
||||
|
||||
## Set up build target
|
||||
|
||||
Open the `build.json` file from the current project tree and add/remove
|
||||
build target entries and jobs. Save the file
|
||||
Open the `project.json` file from the current project tree and add/remove
|
||||
build target entries. Save the file
|
5
DBDecoder/assets/scheme.html
Normal file
5
DBDecoder/assets/scheme.html
Normal file
@ -0,0 +1,5 @@
|
||||
<afx-app-window apptitle="DBDecoder" width="500" height="400" data-id="DBDecoder">
|
||||
<afx-hbox >
|
||||
<afx-button data-id="decoder" text="GO"></afx-button>
|
||||
</afx-hbox>
|
||||
</afx-app-window>
|
15
DBDecoder/build/debug/README.md
Normal file
15
DBDecoder/build/debug/README.md
Normal file
@ -0,0 +1,15 @@
|
||||
# DBDecoder
|
||||
This is an example project, generated by AntOS Development Kit
|
||||
|
||||
## 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
|
54
DBDecoder/build/debug/main.js
Normal file
54
DBDecoder/build/debug/main.js
Normal file
@ -0,0 +1,54 @@
|
||||
(function() {
|
||||
var DBDecoder;
|
||||
|
||||
DBDecoder = class DBDecoder extends this.OS.application.BaseApplication {
|
||||
constructor(args) {
|
||||
super("DBDecoder", args);
|
||||
}
|
||||
|
||||
main() {
|
||||
var bt;
|
||||
bt = this.find("decoder");
|
||||
this.db = new this._api.DB("blogs");
|
||||
return bt.onbtclick = (e) => {
|
||||
// decode the database
|
||||
return this.db.find("1=1").then((data) => {
|
||||
var i, len, v;
|
||||
for (i = 0, len = data.length; i < len; i++) {
|
||||
v = data[i];
|
||||
v.content = atob(v.content);
|
||||
v.rendered = atob(v.rendered);
|
||||
}
|
||||
return this.saveDB(data).then(() => {
|
||||
return this.notify("Data base saved");
|
||||
}).catch((e) => {
|
||||
return this.error(e.toString(), e);
|
||||
});
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
saveDB(list) {
|
||||
return new Promise((resolve, reject) => {
|
||||
var record;
|
||||
if (list.length === 0) {
|
||||
return resolve();
|
||||
}
|
||||
record = list.shift();
|
||||
return this.db.save(record).then(() => {
|
||||
return this.saveDB(list).then(() => {
|
||||
return resolve();
|
||||
}).catch((e) => {
|
||||
return reject(__e(e));
|
||||
});
|
||||
}).catch((e) => {
|
||||
return reject(__e(e));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
this.OS.register("DBDecoder", DBDecoder);
|
||||
|
||||
}).call(this);
|
14
DBDecoder/build/debug/package.json
Normal file
14
DBDecoder/build/debug/package.json
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"app":"DBDecoder",
|
||||
"name":"DBDecoder",
|
||||
"description":"DBDecoder",
|
||||
"info":{
|
||||
"author": "",
|
||||
"email": ""
|
||||
},
|
||||
"version":"0.0.2-a",
|
||||
"category":"Other",
|
||||
"iconclass":"fa fa-adn",
|
||||
"mimes":["none"],
|
||||
"locale": {}
|
||||
}
|
5
DBDecoder/build/debug/scheme.html
Normal file
5
DBDecoder/build/debug/scheme.html
Normal file
@ -0,0 +1,5 @@
|
||||
<afx-app-window apptitle="DBDecoder" width="500" height="400" data-id="DBDecoder">
|
||||
<afx-hbox >
|
||||
<afx-button data-id="decoder" text="GO"></afx-button>
|
||||
</afx-hbox>
|
||||
</afx-app-window>
|
BIN
DBDecoder/build/release/DBDecoder.zip
Normal file
BIN
DBDecoder/build/release/DBDecoder.zip
Normal file
Binary file not shown.
29
DBDecoder/coffees/main.coffee
Normal file
29
DBDecoder/coffees/main.coffee
Normal file
@ -0,0 +1,29 @@
|
||||
class DBDecoder extends this.OS.application.BaseApplication
|
||||
constructor: ( args ) ->
|
||||
super "DBDecoder", args
|
||||
|
||||
main: () ->
|
||||
bt = @find "decoder"
|
||||
@db = new @_api.DB("blogs")
|
||||
bt.onbtclick = (e) =>
|
||||
# decode the database
|
||||
@db.find("1=1").then (data) =>
|
||||
for v in data
|
||||
v.content = atob(v.content)
|
||||
v.rendered = atob(v.rendered)
|
||||
@saveDB(data).then () =>
|
||||
@notify "Data base saved"
|
||||
.catch (e) => @error e.toString(), e
|
||||
|
||||
saveDB: (list) ->
|
||||
new Promise (resolve, reject) =>
|
||||
return resolve() if list.length is 0
|
||||
record = list.shift()
|
||||
@db.save(record).then () =>
|
||||
@saveDB(list)
|
||||
.then () => resolve()
|
||||
.catch (e) => reject __e e
|
||||
.catch (e) => reject __e e
|
||||
|
||||
|
||||
this.OS.register "DBDecoder", DBDecoder
|
14
DBDecoder/package.json
Normal file
14
DBDecoder/package.json
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"app":"DBDecoder",
|
||||
"name":"DBDecoder",
|
||||
"description":"DBDecoder",
|
||||
"info":{
|
||||
"author": "",
|
||||
"email": ""
|
||||
},
|
||||
"version":"0.0.2-a",
|
||||
"category":"Other",
|
||||
"iconclass":"fa fa-adn",
|
||||
"mimes":["none"],
|
||||
"locale": {}
|
||||
}
|
7
DBDecoder/project.json
Normal file
7
DBDecoder/project.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"name": "DBDecoder",
|
||||
"css": [],
|
||||
"javascripts": [],
|
||||
"coffees": ["coffees/main.coffee"],
|
||||
"copies": ["assets/scheme.html", "package.json", "README.md"]
|
||||
}
|
24
Docify/css/main.css
Normal file
24
Docify/css/main.css
Normal file
@ -0,0 +1,24 @@
|
||||
afx-app-window[data-id = "Docify"] .header .label-text
|
||||
{
|
||||
font-weight: bold;
|
||||
}
|
||||
div[data-id = "preview-container"]
|
||||
{
|
||||
overflow: auto;
|
||||
display: block;
|
||||
}
|
||||
|
||||
canvas[data-id = "preview-canvas"]
|
||||
{
|
||||
display: block;
|
||||
margin:0 auto;
|
||||
}
|
||||
afx-app-window[data-id = "DocifyPrintDialog"] i.label-text {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
afx-app-window[data-id = "DocifyPrintDialog"] input[type="radio"] {
|
||||
margin: 0;
|
||||
height: 12px;
|
||||
margin-left: 10px;
|
||||
}
|
@ -9,6 +9,9 @@ It support a wide range of documents.
|
||||

|
||||
|
||||
## Change log
|
||||
- v 0.1.6-a:
|
||||
* fix document exporting does not work
|
||||
* fix missing toolbar icons
|
||||
- v 0.1.5-a:
|
||||
* allow user to configure document server URI
|
||||
- v 0.1.4-a:
|
||||
|
@ -13,9 +13,20 @@ local result = function(data)
|
||||
end
|
||||
|
||||
local error = function(msg)
|
||||
LOG_ERROR("Error: "..msg)
|
||||
return {error = msg, result = false}
|
||||
end
|
||||
|
||||
local decode_path = function(str)
|
||||
local encoded = str:gsub("%.(.*)$", ""):gsub('_', '/'):gsub('-', '+')
|
||||
if #encoded % 4 == 2 then
|
||||
encoded = encoded.."=="
|
||||
elseif #encoded %4 == 3 then
|
||||
encoded = encoded.."="
|
||||
end
|
||||
return tostring(enc.b64decode(encoded))
|
||||
end
|
||||
|
||||
local fetch = function(url)
|
||||
local https = require('ssl.https')
|
||||
local body, code, headers = https.request(url)
|
||||
@ -63,15 +74,19 @@ end
|
||||
|
||||
handle.file = function(data)
|
||||
local rq = REQUEST.r
|
||||
LOG_INFO("Request Data:"..JSON.encode(data))
|
||||
if not rq then
|
||||
return error("Unknown request")
|
||||
end
|
||||
|
||||
local ret, stat = vfs.fileinfo(data.file)
|
||||
if not ret then
|
||||
return error("Unable to query file info")
|
||||
end
|
||||
local path = vfs.ospath(data.file)
|
||||
LOG_INFO("Check for request GET/POST/or data")
|
||||
if rq:match("/wopi/files/[^/]*/contents$") then
|
||||
LOG_INFO("/wopi/files/[^/]*/contents$")
|
||||
if REQUEST.method == "GET" then
|
||||
std.sendFile(path)
|
||||
return nil
|
||||
@ -84,6 +99,8 @@ handle.file = function(data)
|
||||
return error("Unknown request method")
|
||||
end
|
||||
elseif rq:match("/wopi/files/[^/]*$") then
|
||||
LOG_INFO("Matching /wopi/files/[^/]*$")
|
||||
if REQUEST.method == "GET" then
|
||||
return {
|
||||
BaseFileName = stat.name,
|
||||
Size = math.floor(stat.size),
|
||||
@ -92,6 +109,34 @@ handle.file = function(data)
|
||||
PostMessageOrigin = "*",
|
||||
UserCanNotWriteRelative = false
|
||||
}
|
||||
elseif REQUEST.method == "POST" then
|
||||
LOG_INFO("Checking for header X_WOPI_SUGGESTEDTARGET")
|
||||
local out_file = HEADER['X_WOPI_SUGGESTEDTARGET']
|
||||
if not out_file then
|
||||
return error("Unknown request")
|
||||
end
|
||||
LOG_INFO("Encoded path:"..out_file)
|
||||
local dpath = decode_path(out_file)
|
||||
LOG_INFO("Decoded path:"..dpath)
|
||||
out_file = vfs.ospath(dpath)
|
||||
LOG_INFO("Save file to:"..out_file)
|
||||
local barr = REQUEST["application/octet-stream"]
|
||||
barr:fileout(out_file)
|
||||
local ret, stat = vfs.fileinfo(out_file)
|
||||
if not ret then
|
||||
return error("Unable to save file")
|
||||
end
|
||||
return {
|
||||
BaseFileName = stat.name,
|
||||
Size = math.floor(stat.size),
|
||||
UserCanWrite = vfs.checkperm(data.file,"write"),
|
||||
mime = stat.mime,
|
||||
PostMessageOrigin = "*",
|
||||
UserCanNotWriteRelative = false
|
||||
}
|
||||
else
|
||||
return error("Unknown request method")
|
||||
end
|
||||
else
|
||||
return error("Unknown request")
|
||||
end
|
||||
|
@ -52,7 +52,9 @@
|
||||
"api",
|
||||
"main.css",
|
||||
"templates",
|
||||
"icon.png"
|
||||
"icons/icon.png",
|
||||
"icons/new.png",
|
||||
"icons/open.png"
|
||||
],
|
||||
"dest":"build/debug"
|
||||
}
|
||||
|
@ -9,6 +9,9 @@ It support a wide range of documents.
|
||||

|
||||
|
||||
## Change log
|
||||
- v 0.1.6-a:
|
||||
* fix document exporting does not work
|
||||
* fix missing toolbar icons
|
||||
- v 0.1.5-a:
|
||||
* allow user to configure document server URI
|
||||
- v 0.1.4-a:
|
||||
|
@ -13,9 +13,20 @@ local result = function(data)
|
||||
end
|
||||
|
||||
local error = function(msg)
|
||||
LOG_ERROR("Error: "..msg)
|
||||
return {error = msg, result = false}
|
||||
end
|
||||
|
||||
local decode_path = function(str)
|
||||
local encoded = str:gsub("%.(.*)$", ""):gsub('_', '/'):gsub('-', '+')
|
||||
if #encoded % 4 == 2 then
|
||||
encoded = encoded.."=="
|
||||
elseif #encoded %4 == 3 then
|
||||
encoded = encoded.."="
|
||||
end
|
||||
return tostring(enc.b64decode(encoded))
|
||||
end
|
||||
|
||||
local fetch = function(url)
|
||||
local https = require('ssl.https')
|
||||
local body, code, headers = https.request(url)
|
||||
@ -63,15 +74,19 @@ end
|
||||
|
||||
handle.file = function(data)
|
||||
local rq = REQUEST.r
|
||||
LOG_INFO("Request Data:"..JSON.encode(data))
|
||||
if not rq then
|
||||
return error("Unknown request")
|
||||
end
|
||||
|
||||
local ret, stat = vfs.fileinfo(data.file)
|
||||
if not ret then
|
||||
return error("Unable to query file info")
|
||||
end
|
||||
local path = vfs.ospath(data.file)
|
||||
LOG_INFO("Check for request GET/POST/or data")
|
||||
if rq:match("/wopi/files/[^/]*/contents$") then
|
||||
LOG_INFO("/wopi/files/[^/]*/contents$")
|
||||
if REQUEST.method == "GET" then
|
||||
std.sendFile(path)
|
||||
return nil
|
||||
@ -84,6 +99,8 @@ handle.file = function(data)
|
||||
return error("Unknown request method")
|
||||
end
|
||||
elseif rq:match("/wopi/files/[^/]*$") then
|
||||
LOG_INFO("Matching /wopi/files/[^/]*$")
|
||||
if REQUEST.method == "GET" then
|
||||
return {
|
||||
BaseFileName = stat.name,
|
||||
Size = math.floor(stat.size),
|
||||
@ -92,6 +109,34 @@ handle.file = function(data)
|
||||
PostMessageOrigin = "*",
|
||||
UserCanNotWriteRelative = false
|
||||
}
|
||||
elseif REQUEST.method == "POST" then
|
||||
LOG_INFO("Checking for header X_WOPI_SUGGESTEDTARGET")
|
||||
local out_file = HEADER['X_WOPI_SUGGESTEDTARGET']
|
||||
if not out_file then
|
||||
return error("Unknown request")
|
||||
end
|
||||
LOG_INFO("Encoded path:"..out_file)
|
||||
local dpath = decode_path(out_file)
|
||||
LOG_INFO("Decoded path:"..dpath)
|
||||
out_file = vfs.ospath(dpath)
|
||||
LOG_INFO("Save file to:"..out_file)
|
||||
local barr = REQUEST["application/octet-stream"]
|
||||
barr:fileout(out_file)
|
||||
local ret, stat = vfs.fileinfo(out_file)
|
||||
if not ret then
|
||||
return error("Unable to save file")
|
||||
end
|
||||
return {
|
||||
BaseFileName = stat.name,
|
||||
Size = math.floor(stat.size),
|
||||
UserCanWrite = vfs.checkperm(data.file,"write"),
|
||||
mime = stat.mime,
|
||||
PostMessageOrigin = "*",
|
||||
UserCanNotWriteRelative = false
|
||||
}
|
||||
else
|
||||
return error("Unknown request method")
|
||||
end
|
||||
else
|
||||
return error("Unknown request")
|
||||
end
|
||||
|
File diff suppressed because one or more lines are too long
BIN
LibreOffice/build/debug/new.png
Normal file
BIN
LibreOffice/build/debug/new.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.9 KiB |
BIN
LibreOffice/build/debug/open.png
Normal file
BIN
LibreOffice/build/debug/open.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
@ -7,7 +7,7 @@
|
||||
"author": "Dany LE",
|
||||
"email": "contact@iohub.dev"
|
||||
},
|
||||
"version":"0.1.5-a",
|
||||
"version":"0.1.6-b",
|
||||
"category":"Office",
|
||||
"icon":"icon.png",
|
||||
"mimes":[
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
BIN
LibreOffice/icons/new.png
Normal file
BIN
LibreOffice/icons/new.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.9 KiB |
BIN
LibreOffice/icons/open.png
Normal file
BIN
LibreOffice/icons/open.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
@ -2,8 +2,8 @@ namespace OS {
|
||||
|
||||
export namespace application {
|
||||
const BUTTON_ICONS = {
|
||||
opendoc: "data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAD8UlEQVR42q1Va2gcVRQ+587s7mRItNskfaY1trRi2sZHNYoQHzGmQkAMlNZK1R+l0R+K/REhRAmzIEElaqX2R/tDhZamov4QbV0a6V9Nm9DiI8QEEtpI8zDbPPfh7sw93juzOzv7Ugge2L3nztz7fed859w7CHmGiKocYHVGwswcvLwFWnNzc3tLS8sjaTIvcX4kBZvD4fBAf3//aeEmShGUd3Z2nu7q6noBHZPABOjA2/9ijs4+wiwrydehUKivp6fnqPCjOQSHPhrTmKI2XP/uA33/k9s6Ot58rSkNnvPzZlKQkTDDMM4XJXjp08m3aiqV9xUex3sqZqCtqZ6QMSeDdKQeEoISGQiCvo9PfnY0tjBVQNC9d7vf0Fkcq2AK9jXeR8wrEQB6Ii8gkJWV/skz4ZlLI8posKbOQmQfnnl9y/f2gsMnbnbvuctnaCwOm9QZaH3ifmAlpCklj7RvLw/Bn8lqSPAy+PVGKnT2ja0hN4MdmxTDDzGs1Wbh+aYHXVm8kebNM5m4En3TfxXGY1WUBB3HblmGyCBLsLUaDZViuLN8DvY/s9cL+p8SZQi+DF+BkaW1ZKKON/+iLIGUaEMQDMZjsHtNBA7ue6hAnlISCfldv++HK/DL7SBwpsP0PGQlOnh8onttBRpgruDD6xbgcGtDTgb5EkmXc27XVozus7MXr8Lg7BoCtRznlyF0/litgfUdAxcCqnovAK/l3IRKnWBz9Z155ZMZQEHUcnRcZz41twyROAJj8rZhN5KmOYxtvcMLLz5egxanCimrIiT2qUpBAT1sztzGppw1psXBIlkj0aQIsYHRSAqffnd4fOeWDRoRXy8iYgGBXab5PKDu1SAxwQXOji5BPGlCirNMB94em5xdxGffGx3as23zRotbLoGu+XMzQEgDOagZAqE/SplknUzLwtjfFqDiJ9kTDNn8bxO3JvC53vEfG+o21okF68VWTBN4znnaIUpzkJ2JBBZ1BlVVIJlMwUrCBKb43E2MscXBkekhPHBi8qvHdlc3Eqd1Ygtqoj56ma94Dci5FmT3ZEZRO4jGUwTMZzebXCIlFXkt/Tw8dwlfPjV9qrE+2MYYVckMHAK/q3uGwBN9uj3JliUaN4UsPoK8QyeT+un3hXPY/nmk59FdFa8GfBSUb/2MQ1lALXrXULYOIMDB0bz4BzCaoMTgSPQ4Hju31LHrbu0dXaM7ZDmJmxmof29T+wCq6QNCdmtmw0BcXOHJPyaTb2PvxciRYGX5J5wsvQRocYLSa5yTbiGPLifasfXAkada2g59kTKpuC6rNJ+C1uULX78iPlxKgHPrAfGssqiYqzOZRURRlGv/F2BJ+wdsRP1yLA0KOQAAAABJRU5ErkJggg==",
|
||||
newdoc: "data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABmJLR0QA/wD/AP+gvaeTAAABmklEQVRIie2Vv0tbURTHP+fmJTGpIYM/KEoUHItOEtIu6uTk2r9BcNMWuro62X9D6OTWIhp00baLCI2giKKYVoMtJtTE93JPhyLSpyavLxE69Due+73nwzn3nnvhkSX+wNut2pugm9XapdkXicO/A3ysaZDk3UnD9yt77KETs9mOg4d8Jkiy+9TTCc8HIpmoSH7xU3Wo7QCA3k5DLtMY0hIgCKRlwB8QI6v+NSds0sKZpXBm/eFBf6AtFTTSf0BThT5kvxRw620G1FUREQxwUraUa3c9LbXoa0XZLbkUSpYBd4Pp+Bz6eTQJoPo7d0sVVD14FZ8mbc5JU8IRF6/CnpsfSXlr5iVsvw9VQa0Ox5eWRP0b/ZF9uqSII+7Nch+QwthJVSTUc31aUXqvN5npeE2Uexp/q5VQFfQkhCN9hquxZtb1f3PQzq+UQflCVK6bWcdCAboSQtHJMf/zHVV98pBt0Rnfmbx7TYWFZoC4A5m0oVh+mr2gP5viIpbUH7GIeAKcAilUPogQ6H9vqJuB8taGp9z88LJ/0H4BR3aNW1eB/4cAAAAASUVORK5CYII="
|
||||
opendoc: "pkg://LibreOffice/open.png".asFileHandle().getlink(),
|
||||
newdoc: "pkg://LibreOffice/new.png".asFileHandle().getlink()
|
||||
}
|
||||
const DEFAULT_LOO_URL = "https://loo.iohub.dev/hosting/discovery";
|
||||
/**
|
||||
@ -163,6 +163,7 @@ namespace OS {
|
||||
return;
|
||||
let orgevt = e.originalEvent;
|
||||
let data = JSON.parse(orgevt.data);
|
||||
console.log("receive data", data);
|
||||
switch(data.MessageId)
|
||||
{
|
||||
case 'Action_Load_Resp':
|
||||
@ -220,7 +221,7 @@ namespace OS {
|
||||
}
|
||||
break;
|
||||
case "UI_SaveAs":
|
||||
this.check_dirty().then((_)=>this.save_as());
|
||||
this.check_dirty().then((_)=>this.save_as(data.Values.format));
|
||||
break;
|
||||
default:
|
||||
console.log(data);
|
||||
@ -228,19 +229,28 @@ namespace OS {
|
||||
//console.log(this.eid, e);
|
||||
|
||||
}
|
||||
private save_as()
|
||||
private save_as(format:string = undefined)
|
||||
{
|
||||
if(!format) {
|
||||
format = this.curr_file.ext;
|
||||
}
|
||||
const out_file = `${this.curr_file.parent().path}/${this.curr_file.basename.replace(/\..*$/, '.'+format)}`;
|
||||
console.log("export file data as ", out_file);
|
||||
this.openDialog("FileDialog",
|
||||
{
|
||||
this.openDialog("FileDialog", {
|
||||
title: __("Save file as"),
|
||||
type: "dir",
|
||||
file: this.curr_file.asFileHandle()
|
||||
file: out_file.asFileHandle()
|
||||
})
|
||||
.then(async (d) => {
|
||||
.then(async (d) =>
|
||||
{
|
||||
const file = `${d.file.path}/${d.name}`.asFileHandle();
|
||||
try
|
||||
{
|
||||
|
||||
const r = await this.exec({
|
||||
if(this.curr_file.ext == file.ext)
|
||||
{
|
||||
const r = await this.exec(
|
||||
{
|
||||
action: 'duplicate',
|
||||
args:{src: this.curr_file.path, dest: file.path}
|
||||
});
|
||||
@ -251,6 +261,14 @@ namespace OS {
|
||||
this.curr_file = file;
|
||||
this.open();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.post_message("Action_SaveAs", {
|
||||
Filename: `${this.enb64u(file.path)}.${format}`,
|
||||
Notify: true
|
||||
});
|
||||
}
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
this.error(__("Unable to save file as {0}: {1}", file.path, e.toString()),e);
|
||||
@ -453,13 +471,17 @@ namespace OS {
|
||||
args: {file: this.curr_file.path}
|
||||
}
|
||||
}
|
||||
|
||||
// encode data to URL safe base64 encoding
|
||||
let encoded =
|
||||
btoa(JSON.stringify(cmd))
|
||||
let encoded = this.enb64u(JSON.stringify(cmd));
|
||||
return `${this._api.REST}/system/apigateway/${encoded}/wopi/files/${this.curr_file.path.hash()}&${this.access_token}`;
|
||||
}
|
||||
private enb64u(input: string)
|
||||
{
|
||||
return btoa(input)
|
||||
.trimBy("=")
|
||||
.replace(/\+/g, '-')
|
||||
.replace(/\//g, '_');
|
||||
return `${this._api.REST}/system/apigateway/${encoded}/wopi/files/${this.curr_file.basename}&${this.access_token}`;
|
||||
}
|
||||
private check_dirty():Promise<any>
|
||||
{
|
||||
|
@ -7,7 +7,7 @@
|
||||
"author": "Dany LE",
|
||||
"email": "contact@iohub.dev"
|
||||
},
|
||||
"version":"0.1.5-a",
|
||||
"version":"0.1.6-b",
|
||||
"category":"Office",
|
||||
"icon":"icon.png",
|
||||
"mimes":[
|
||||
|
@ -6,7 +6,7 @@
|
||||
"name": "batch",
|
||||
"data": {
|
||||
"target": "release",
|
||||
"modules": ["Blogger"]
|
||||
"modules": ["LibreOffice"]
|
||||
}
|
||||
}
|
||||
]
|
||||
|
Binary file not shown.
@ -9,6 +9,9 @@ It support a wide range of documents.
|
||||

|
||||
|
||||
## Change log
|
||||
- v 0.1.6-a:
|
||||
* fix document exporting does not work
|
||||
* fix missing toolbar icons
|
||||
- v 0.1.5-a:
|
||||
* allow user to configure document server URI
|
||||
- v 0.1.4-a:
|
||||
|
Binary file not shown.
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user