diff --git a/IOMail/README.md b/IOMail/README.md new file mode 100644 index 0000000..674a9c2 --- /dev/null +++ b/IOMail/README.md @@ -0,0 +1,3 @@ +# IOMail + +Simple Mail client wrapper for https://mail.iohub.dev/ diff --git a/IOMail/assets/scheme.html b/IOMail/assets/scheme.html new file mode 100644 index 0000000..a712243 --- /dev/null +++ b/IOMail/assets/scheme.html @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/IOMail/build/debug/README.md b/IOMail/build/debug/README.md new file mode 100644 index 0000000..674a9c2 --- /dev/null +++ b/IOMail/build/debug/README.md @@ -0,0 +1,3 @@ +# IOMail + +Simple Mail client wrapper for https://mail.iohub.dev/ diff --git a/IOMail/build/debug/main.js b/IOMail/build/debug/main.js new file mode 100644 index 0000000..50af420 --- /dev/null +++ b/IOMail/build/debug/main.js @@ -0,0 +1 @@ +(function(){var i;(i=class extends this.OS.application.BaseApplication{constructor(i){super("IOMail",i)}main(){}}).singleton=!0,this.OS.register("IOMail",i)}).call(this); \ No newline at end of file diff --git a/IOMail/build/debug/package.json b/IOMail/build/debug/package.json new file mode 100644 index 0000000..b6be60d --- /dev/null +++ b/IOMail/build/debug/package.json @@ -0,0 +1,16 @@ +{ + "pkgname": "IOMail", + "app":"IOMail", + "name":"IOHub mail", + "description":"IOHub mail", + "info":{ + "author": "", + "email": "" + }, + "version":"0.1.0-a", + "category":"Other", + "iconclass":"fa fa-envelope", + "mimes":["none"], + "dependencies":[], + "locale": {} +} \ No newline at end of file diff --git a/IOMail/build/debug/scheme.html b/IOMail/build/debug/scheme.html new file mode 100644 index 0000000..a712243 --- /dev/null +++ b/IOMail/build/debug/scheme.html @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/IOMail/build/release/IOMail.zip b/IOMail/build/release/IOMail.zip new file mode 100644 index 0000000..09ea387 Binary files /dev/null and b/IOMail/build/release/IOMail.zip differ diff --git a/IOMail/coffees/main.coffee b/IOMail/coffees/main.coffee new file mode 100644 index 0000000..831efc6 --- /dev/null +++ b/IOMail/coffees/main.coffee @@ -0,0 +1,9 @@ +class IOMail extends this.OS.application.BaseApplication + constructor: ( args ) -> + super "IOMail", args + + main: () -> + +IOMail.singleton = true + +this.OS.register "IOMail", IOMail \ No newline at end of file diff --git a/IOMail/package.json b/IOMail/package.json new file mode 100644 index 0000000..b6be60d --- /dev/null +++ b/IOMail/package.json @@ -0,0 +1,16 @@ +{ + "pkgname": "IOMail", + "app":"IOMail", + "name":"IOHub mail", + "description":"IOHub mail", + "info":{ + "author": "", + "email": "" + }, + "version":"0.1.0-a", + "category":"Other", + "iconclass":"fa fa-envelope", + "mimes":["none"], + "dependencies":[], + "locale": {} +} \ No newline at end of file diff --git a/IOMail/project.json b/IOMail/project.json new file mode 100644 index 0000000..87ea05b --- /dev/null +++ b/IOMail/project.json @@ -0,0 +1,7 @@ +{ + "name": "IOMail", + "css": [], + "javascripts": [], + "coffees": ["coffees/main.coffee"], + "copies": ["assets/scheme.html", "package.json", "README.md"] +} \ No newline at end of file diff --git a/OnlyOffice/build/debug/README.md b/OnlyOffice/build/debug/README.md deleted file mode 100644 index 45e4955..0000000 --- a/OnlyOffice/build/debug/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# OnlyOffice - -This application is the front-end connector of the OnlyOffice suite. -It needs to connect to a working OnlyOffice document server. - -The application allows to open/edit commons document, presentation, and spreedsheet. -Integrate OnlyOffice to an virtual window environment like AntOs allows an inconvenient -way to work with multiple documents at the same time. - -![https://github.com/lxsang/antosdk-apps/blob/master/OnlyOffice/screenshot.png?raw=true](https://github.com/lxsang/antosdk-apps/blob/master/OnlyOffice/screenshot.png?raw=true) - -## Change log -- v 0.1.3a: Let backend generates document key, compatible with doc.iohub.dev/office -- v 0.1.2a: generate document key based on username, file path and modified time -- v 0.1.1a: generate document key based on username and file path diff --git a/OnlyOffice/build/debug/api.lua b/OnlyOffice/build/debug/api.lua deleted file mode 100644 index 307b703..0000000 --- a/OnlyOffice/build/debug/api.lua +++ /dev/null @@ -1,87 +0,0 @@ -local args=... -local web = require("web") -local vfs = require("vfs") - -if not args then - args = REQUEST -end - -local result = function(data) - return { - error = false, - result = data - } -end - -local error = function(data) - return { - error = data, - result = false - } -end - -local handle = {} - -handle.token = function(data) - local file = vfs.ospath(data.file) - local stat = ulib.file_stat(file) - local ret = { - sid = "sessionid="..SESSION.sessionid, - key = std.sha1(file..":"..stat.mtime) - } - return result(ret) -end - -handle.duplicate = function(data) - local file = vfs.ospath(data.as) - local tmpfile = "/tmp/"..std.sha1(file) - local cmd = "curl -o "..tmpfile..' "'..data.remote..'"' - os.execute(cmd) - -- move file to correct position - if ulib.exists(tmpfile) then - cmd = "mv "..tmpfile.." "..file - os.execute(cmd) - print("File "..file.." is duplicated with remote") - else - return error("Unable to duplicate file") - end - return result("File duplicated") -end - -handle.save = function() - --print(JSON.encode(REQUEST)) - if not REQUEST.json then - return error("Invalid request") - end - local data = JSON.decodeString(REQUEST.json) - if not data then - return error("Invalid request") - end - if not REQUEST.file then - return error("No file found") - end - local file = vfs.ospath(REQUEST.file) - if data.status == 2 then - local tmpfile = "/tmp/"..std.sha1(file) - local cmd = "curl -o "..tmpfile..' "'..data.url..'"' - os.execute(cmd) - -- move file to correct position - if ulib.exists(tmpfile) then - cmd = "mv "..tmpfile.." "..file - os.execute(cmd) - print("File "..file.." sync with remote") - else - return error("Unable to download") - end - end - - return result("OK") -end - ---print(JSON.encode(args)) - -if args.action and handle[args.action] then - return handle[args.action](args.args) -else - return error("Invalid action parameter") -end diff --git a/OnlyOffice/build/debug/icon.png b/OnlyOffice/build/debug/icon.png deleted file mode 100644 index 21d6726..0000000 Binary files a/OnlyOffice/build/debug/icon.png and /dev/null differ diff --git a/OnlyOffice/build/debug/main.css b/OnlyOffice/build/debug/main.css deleted file mode 100644 index 6deea5e..0000000 --- a/OnlyOffice/build/debug/main.css +++ /dev/null @@ -1,9 +0,0 @@ - -afx-app-window[data-id="OnlyOffice"] div[data-id="editor-area"] p{ - text-align: center; -} - -afx-app-window[data-id="OnlyOffice"] div[data-id="editor-area"] button { - width: 250px; - -} \ No newline at end of file diff --git a/OnlyOffice/build/debug/main.js b/OnlyOffice/build/debug/main.js deleted file mode 100644 index 845c357..0000000 --- a/OnlyOffice/build/debug/main.js +++ /dev/null @@ -1 +0,0 @@ -(function(){var e;(e=class extends this.OS.application.BaseApplication{constructor(e){super("OnlyOffice",e),this.eid="id"+Math.random().toString(36).replace(".","")}main(){if(this.currfile=void 0,this.args&&this.args.length>0&&(this.currfile=this.args[0].path.asFileHandle()),this.placeholder=this.find("editor-area"),this.placeholder.id=this.eid,this.find("btn-open-file").onbtclick=e=>this.openFile(),this.find("btn-new-doc").onbtclick=e=>this.create("word"),this.find("btn-new-cell").onbtclick=e=>this.create("sheet"),this.find("btn-new-slide").onbtclick=e=>this.create("slide"),this.currfile)return this.open()}create(e){var t;return t=void 0,"word"===e&&(t="docx"),"sheet"===e&&(t="xlsx"),"slide"===e&&(t="pptx"),t?this.openDialog("FileDialog",{title:__("Save file as"),type:"dir",file:("home://Untitled."+t).asFileHandle()}).then(e=>{var i,s;return i=`${e.file.path}/${e.name}`.asFileHandle(),(s=`${this.path()}/templates/model.${t}`.asFileHandle()).read("binary").then(e=>{var t;return t=new Blob([e],{type:s.info.mime}),i.cache=t,i.write(s.info.mime).then(e=>(i.cache=void 0,this.currfile=i,this.open())).catch(e=>this.error(e.toString(),e))}).catch(e=>this.error(e.toString(),e))}):this.error(__("Unkown file type"))}openFile(){return this.openDialog("FileDialog",{title:__("Open file"),type:"file",mimes:this.meta().mimes}).then((e,t)=>(this.currfile=e.file.path.asFileHandle(),this.open()))}editorReady(){return console.log($('iframe[name="frameEditor"]',this.scheme).contents())}open(){if(this.currfile)return this.exec("token",{file:this.currfile.path}).then(e=>(console.log(e),e.error?this.error(e.error):(this.access_token=e.result.sid,this.currfile.onready().then(t=>(this.scheme.apptitle=this.currfile.path,$(this.placeholder).empty(),this.editor&&this.editor.destroyEditor(),this.editor=new DocsAPI.DocEditor(this.eid,{events:{onAppReady:e=>this.editorReady(e),onRequestCreateNew:()=>this.newDocument(),onRequestSaveAs:e=>this.saveAs(e)},document:{fileType:this.currfile.ext,key:e.result.key,title:this.currfile.filename,url:this.currfile.getlink()+"?"+this.access_token},documentType:this.getDocType(this.currfile.ext),editorConfig:{user:{id:this.systemsetting.user.id.toString(),name:this.systemsetting.user.username},customization:{compactHeader:!1},callbackUrl:this.uapi("save")}})))))).catch(e=>this.error(e.toString(),e))}getDocType(e){return"doc,docx,epub,odt".split(",").includes(e)?"word":"csv,ods,xls,xlsx".split(",").includes(e)?"cell":"odp,ppt,pptx".split(",").includes(e)?"slide":"none"}saveAs(e){if(e.data.url)return e.data.url.asFileHandle(),this.openDialog("FileDialog",{title:__("Save file as"),type:"dir",file:("home://"+e.data.title).asFileHandle()}).then(t=>{var i;return i=`${t.file.path}/${t.name}`,this.exec("duplicate",{remote:e.data.url,as:i}).then(e=>e.error?this.error(e.error):"none"!==this.getDocType(i.asFileHandle().ext)?(this.currfile=i.asFileHandle(),this.open()):void 0).catch(e=>this.error(e.toString(),e))})}newDocument(){return this.openDialog("SelectionDialog",{title:__("Create new"),data:[{text:__("Open a file"),iconclass:"fa fa-folder-open",type:"open"},{text:__("Document"),iconclass:"fa fa-file-word-o",type:"word"},{text:__("Spreadsheet"),iconclass:"fa fa-file-excel-o",type:"sheet"},{text:__("Presentation"),iconclass:"fa fa-file-powerpoint-o",type:"slide"}]}).then(e=>{switch(e.type){case"open":return this.openFile();default:return this.create(e.type)}})}uapi(e){return`${this._api.REST}/system/apigateway?ws=0&path=${this.path()}/api.lua&action=${e}&file=${this.currfile.path}&${this.access_token}`}exec(e,t){var i;return i={path:this.path()+"/api.lua",parameters:{action:e,args:t}},this.call(i)}cleanup(){return this.editor&&this.editor.destroyEditor(),this.editor=void 0}}).dependencies=["https://office.iohub.dev/web-apps/apps/api/documents/api.js"],this.OS.register("OnlyOffice",e),this.extensionParams={url:"https://office.iohub.dev/web-apps/"}}).call(this); \ No newline at end of file diff --git a/OnlyOffice/build/debug/package.json b/OnlyOffice/build/debug/package.json deleted file mode 100644 index 5ebc5b0..0000000 --- a/OnlyOffice/build/debug/package.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "pkgname": "OnlyOffice", - "app":"OnlyOffice", - "name":"Office Suite", - "description":"Online Office suite based on OnlyOffice", - "info":{ - "author": "Xuan Sang LE", - "email": "mrsang@iohub.dev" - }, - "version":"0.1.3-a", - "category":"Other", - "icon":"icon.png", - "mimes":[ - "application/vnd.oasis.opendocument.text", - "application/vnd.oasis.opendocument.spreadsheet", - "application/vnd.oasis.opendocument.presentation", - "application/vnd.openxmlformats-officedocument.wordprocessingml.document", - "application/msword", - "application/vnd.ms-excel", - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", - "application/vnd.ms-powerpoint", - "application/vnd.openxmlformats-officedocument.presentationml.presentation", - "application/epub+zip" - ], - "dependencies":[], - "locale": {} -} \ No newline at end of file diff --git a/OnlyOffice/build/debug/scheme.html b/OnlyOffice/build/debug/scheme.html deleted file mode 100644 index cb1efa8..0000000 --- a/OnlyOffice/build/debug/scheme.html +++ /dev/null @@ -1,18 +0,0 @@ - - -
-

- -

-

- -

-

- -

-

- -

-
-
-
\ No newline at end of file diff --git a/OnlyOffice/build/debug/templates/model.docx b/OnlyOffice/build/debug/templates/model.docx deleted file mode 100644 index d167663..0000000 Binary files a/OnlyOffice/build/debug/templates/model.docx and /dev/null differ diff --git a/OnlyOffice/build/debug/templates/model.pptx b/OnlyOffice/build/debug/templates/model.pptx deleted file mode 100644 index a795055..0000000 Binary files a/OnlyOffice/build/debug/templates/model.pptx and /dev/null differ diff --git a/OnlyOffice/build/debug/templates/model.xlsx b/OnlyOffice/build/debug/templates/model.xlsx deleted file mode 100644 index 6c7b924..0000000 Binary files a/OnlyOffice/build/debug/templates/model.xlsx and /dev/null differ diff --git a/packages.json b/packages.json index 703180e..bc5df98 100644 --- a/packages.json +++ b/packages.json @@ -119,6 +119,16 @@ "dependencies": [], "download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/GraphEditor/build/release/GraphEditor.zip" }, + { + "pkgname": "IOMail", + "name": "IOHub mail", + "description": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/IOMail/README.md", + "category": "Other", + "author": "", + "version": "0.1.0-a", + "dependencies": [], + "download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/IOMail/build/release/IOMail.zip" + }, { "pkgname": "Katex", "name": "Katex",