From 5f90daf07992154060910e59dd3bf9989c4179d9 Mon Sep 17 00:00:00 2001 From: Xuan Sang LE Date: Mon, 8 Feb 2021 17:59:31 +0100 Subject: [PATCH] Initial add OnlyOffice --- Blogger/build/debug/README.md | 21 ------- Blogger/build/debug/cvsection.html | 32 ---------- Blogger/build/debug/main.css | 93 ----------------------------- Blogger/build/debug/main.js | 1 - Blogger/build/debug/package.json | 14 ----- Blogger/build/debug/scheme.html | 86 -------------------------- Blogger/build/debug/sendmail.html | 20 ------- Blogger/build/debug/sendmail.lua | 32 ---------- OnlyOffice/README.md | 7 +++ OnlyOffice/assets/scheme.html | 5 ++ OnlyOffice/build/debug/README.md | 7 +++ OnlyOffice/build/debug/main.js | 36 +++++++++++ OnlyOffice/build/debug/package.json | 16 +++++ OnlyOffice/build/debug/scheme.html | 5 ++ OnlyOffice/coffees/main.coffee | 25 ++++++++ OnlyOffice/package.json | 16 +++++ OnlyOffice/project.json | 7 +++ 17 files changed, 124 insertions(+), 299 deletions(-) delete mode 100644 Blogger/build/debug/README.md delete mode 100644 Blogger/build/debug/cvsection.html delete mode 100644 Blogger/build/debug/main.css delete mode 100644 Blogger/build/debug/main.js delete mode 100644 Blogger/build/debug/package.json delete mode 100644 Blogger/build/debug/scheme.html delete mode 100644 Blogger/build/debug/sendmail.html delete mode 100644 Blogger/build/debug/sendmail.lua create mode 100644 OnlyOffice/README.md create mode 100644 OnlyOffice/assets/scheme.html create mode 100644 OnlyOffice/build/debug/README.md create mode 100644 OnlyOffice/build/debug/main.js create mode 100644 OnlyOffice/build/debug/package.json create mode 100644 OnlyOffice/build/debug/scheme.html create mode 100644 OnlyOffice/coffees/main.coffee create mode 100644 OnlyOffice/package.json create mode 100644 OnlyOffice/project.json diff --git a/Blogger/build/debug/README.md b/Blogger/build/debug/README.md deleted file mode 100644 index 2c958fe..0000000 --- a/Blogger/build/debug/README.md +++ /dev/null @@ -1,21 +0,0 @@ -# Blogger - -Blackend for my blog at https://blog.iohub.dev - - -## Change logs - -### v0.2.x-a -* Patch 7: Fix sendmail API security bug -* Patch 6: Chage libraries load order -* Patch 5: Add user photo to portfolio -* Patch 4: Add package dependencies -* Patch 3: Correct JSON text decoding -* Patch 2: Bug fix rendering content -* Patch 0-1 Important change: Store raw post content to the database instead of base64 string as before - -### v0.1.x-a -* Patch 3-4: Enhance youtube video embedding feature in markdown -* Patch 2: CV Category now can be created when database is not created yet -* Patch 1: Fix package archive broken -* Patch 0: Change default email of the sender \ No newline at end of file diff --git a/Blogger/build/debug/cvsection.html b/Blogger/build/debug/cvsection.html deleted file mode 100644 index 6c0333f..0000000 --- a/Blogger/build/debug/cvsection.html +++ /dev/null @@ -1,32 +0,0 @@ - - -
- - - - - - - - - - - - - - - - - - - -
- -
- -
- - -
-
-
\ No newline at end of file diff --git a/Blogger/build/debug/main.css b/Blogger/build/debug/main.css deleted file mode 100644 index 50f349f..0000000 --- a/Blogger/build/debug/main.css +++ /dev/null @@ -1,93 +0,0 @@ - -afx-app-window[data-id="blogger-win"] afx-tab-container[data-id="tabcontainer"] afx-tab-bar afx-list-view > div.list-container { - padding: 0; - margin: 0; - border-right: 1px solid #292929; -} - -afx-app-window[data-id="blogger-win"] afx-tab-container[data-id="tabcontainer"] afx-tab-bar afx-list-view > div.list-container > ul li{ - font-size: 15px; - padding:0; - width: 100%; - border-radius: 0; - border:0; - margin: 0; - text-align: center; -} -afx-app-window[data-id="blogger-win"] afx-tab-container[data-id="tabcontainer"] afx-tab-bar afx-list-view > div.list-container > ul li.selected { - background-color: #116cd6; - color:white; -} - -afx-app-window[data-id="blogger-win"] afx-hbox[data-id="user-container"] afx-label i.label-text{ - font-weight: bold; -} - -afx-app-window .lbl-header i.label-text{ - font-weight: bold; -} -afx-app-window[data-id="blogger-win"] afx-hbox[data-id="cv-container"] .cat-header{ - border-bottom: 1px solid #cbcbcb; - text-align: center; -} - - -afx-app-window[data-id="blogger-win"] afx-list-view[ data-id = "cv-sec-list"] > .list-container > ul .afx-cv-sec-title .label-text{ - font-weight: bold; - -} - -afx-app-window[data-id="blogger-win"] afx-list-view[ data-id = "cv-sec-list"] afx-blogger-cvsection-item afx-label { - display: block; - -} -afx-app-window[data-id="blogger-win"] afx-list-view[ data-id = "cv-sec-list"] afx-blogger-cvsection-item p { - padding: 0; - margin: 0; -} - -afx-app-window[data-id="blogger-win"] afx-list-view[ data-id = "cv-sec-list"] afx-blogger-cvsection-item .afx-cv-sec-period, -afx-app-window[data-id="blogger-win"] afx-list-view[ data-id = "cv-sec-list"] afx-blogger-cvsection-item .afx-cv-sec-loc { - text-align: right; -} -afx-app-window[data-id="blogger-win"] afx-list-view[ data-id = "cv-sec-list"] afx-blogger-cvsection-item afx-cv-sec-content{ - text-align: justify; - overflow-wrap: break-word; -} - -afx-app-window[data-id="blogger-win"] afx-list-view[ data-id = "cv-sec-list"] > div.list-container > ul li.selected { - border: 1px solid #116cd6; - background-color: transparent; - border-radius: 5px; -} - -afx-app-window[data-id="blogger-win"] afx-list-view[ data-id = "cv-sec-list"] .closable::before{ - content: "\f014"; - font-size: 14px; -} - -afx-app-window[data-id="blogger-win"] afx-list-view[ data-id = "cv-sec-list"] .period-end::before{ - content: "-"; -} - -afx-app-window[data-id ='blogger-win'] .editor-toolbar{ - background-color: white; -} - -afx-app-window[data-id="blogger-win"] afx-list-view[ data-id = "blog-list"] > div.list-container > ul li afx-label { - display: block; -} - -afx-app-window[data-id="blogger-win"] afx-list-view[ data-id = "blog-list"] > div.list-container > ul .afx-blogpost-title .label-text{ - font-weight: bold; -} - -afx-app-window[data-id="blogger-win"] afx-list-view[ data-id = "blog-list"] > div.list-container > ul .blog-dates .label-text{ - font-size: 10px; - font-weight: normal; -} - -afx-app-window[data-id="blogger-win"] afx-list-view[ data-id = "blog-list"] > div.list-container > ul li.selected { - background-color: #116cd6; - color:white; -} diff --git a/Blogger/build/debug/main.js b/Blogger/build/debug/main.js deleted file mode 100644 index de770da..0000000 --- a/Blogger/build/debug/main.js +++ /dev/null @@ -1 +0,0 @@ -(function(){var t,e,i,s,a,n;(e=class extends this.OS.application.BaseApplication{constructor(t){super("Blogger",t)}main(){var t;return this.user={},this.cvlist=this.find("cv-list"),this.cvlist.ontreeselect=t=>{var e;if(t)return e=t.data.item.data,this.CVSectionByCID(Number(e.id))},this.inputtags=this.find("input-tags"),this.bloglist=this.find("blog-list"),this.seclist=this.find("cv-sec-list"),t=this.find("photo"),$(t).click(e=>this.openDialog("FileDialog",{title:__("Select image file"),mimes:["image/.*"]}).then(e=>t.value=e.file.path).catch(t=>this.error(__("Unable to get file"),t))),this.userdb=new this._api.DB("user"),this.cvcatdb=new this._api.DB("cv_cat"),this.cvsecdb=new this._api.DB("cv_sections"),this.blogdb=new this._api.DB("blogs"),this.tabcontainer=this.find("tabcontainer"),this.tabcontainer.ontabselect=t=>this.fetchData(t.data.container.aid),this.find("bt-user-save").onbtclick=t=>this.saveUser(),this.find("cv-cat-add").onbtclick=t=>{var e;return e=t=>this.openDialog(new s,{title:__("Add category"),tree:t}).then(t=>{var e;return e={name:t.value,pid:t.p.id,publish:1},this.cvcatdb.save(e).then(t=>this.refreshCVCat()).catch(t=>this.error(__("Cannot add new category"),t))}).catch(t=>this.error(t.toString(),t)),this.fetchCVCat().then(t=>e(t)).catch(t=>(e({text:"Porfolio",id:"0",nodes:[]}),this.error(__("Unable to fetch categories"),t)))},this.find("cv-cat-edit").onbtclick=t=>{var e,i;if((i=this.cvlist.selectedItem)&&(e=i.data))return this.fetchCVCat().then(t=>this.openDialog(new s,{title:__("Edit category"),tree:t,cat:e}).then(t=>{var i;return i={id:e.id,publish:e.publish,pid:t.p.id,name:t.value},this.cvcatdb.save(i).then(t=>this.refreshCVCat()).catch(t=>this.error(__("Cannot Edit category"),t))})).catch(t=>this.error(__("Unable to fetch categories"),t))},this.find("cv-cat-del").onbtclick=t=>{var e,i;if((i=this.cvlist.selectedItem)&&(e=i.data))return this.openDialog("YesNoDialog",{title:__("Delete category"),iconclass:"fa fa-question-circle",text:__("Do you really want to delete: {0}?",e.name)}).then(t=>{if(t)return this.deleteCVCat(e)}).catch(t=>this.error(t.toString(),t))},this.find("cv-sec-add").onbtclick=t=>{var e,s;if(s=this.cvlist.selectedItem)return(e=s.data)&&"0"!==e.id?this.openDialog(new i(this),{title:__("New section entry for {0}",e.name)}).then(t=>(t.cid=Number(e.id),t.start=Number(t.start),t.end=Number(t.end),this.cvsecdb.save(t).then(t=>this.CVSectionByCID(Number(e.id))).catch(t=>this.error(__("Cannot save section: {0}",t.toString()),t)))):this.notify(__("Please select a category"))},this.find("cv-sec-move").onbtclick=t=>{var e,i;return(i=this.find("cv-sec-list").selectedItem)?(e=i.data,this.fetchCVCat().then(t=>this.openDialog(new s,{title:__("Move to"),tree:t,selonly:!0}).then(t=>{var i;return i={id:e.id,cid:t.p.id},this.cvsecdb.save(i).then(t=>(this.CVSectionByCID(e.cid),this.find("cv-sec-list").unselect())).catch(t=>this.error(__("Cannot move section"),t))}))):this.notify(__("Please select a section to move"))},this.find("cv-sec-edit").onbtclick=t=>{var e,s;return(s=this.find("cv-sec-list").selectedItem)?(e=s.data,this.openDialog(new i(this),{title:__("Modify section entry"),section:e}).then(t=>(t.cid=Number(e.cid),t.start=Number(t.start),t.end=Number(t.end),this.cvsecdb.save(t).then(t=>this.CVSectionByCID(Number(e.cid))).catch(t=>this.error(__("Cannot save section: {0}",t.toString()),t))))):this.notify(__("Please select a section to edit"))},this.seclist.onitemclose=t=>{var e;if(t)return e=t.data.item.data,this.openDialog("YesNoDialog",{iconclass:"fa fa-question-circle",text:__("Do you really want to delete: {0}?",e.title)}).then(i=>{if(i)return this.cvsecdb.delete(e.id).then(e=>this.seclist.delete(t.data.item)).catch(t=>this.error(__("Cannot delete the section: {0}",t.toString()),t))}),!1},this.editor=new SimpleMDE({element:this.find("markarea"),autoDownloadFontAwesome:!1,autofocus:!0,tabSize:4,indentWithTabs:!0,toolbar:[{name:__("New"),className:"fa fa-file",action:t=>(this.bloglist.unselect(),this.clearEditor())},{name:__("Save"),className:"fa fa-save",action:t=>this.saveBlog()},"|","bold","italic","heading","|","quote","code","unordered-list","ordered-list","|","link","image","table","horizontal-rule",{name:"image",className:"fa fa-file-image-o",action:t=>this.openDialog("FileDialog",{title:__("Select image file"),mimes:["image/.*"]}).then(t=>t.file.path.asFileHandle().publish().then(t=>this.editor.codemirror.getDoc().replaceSelection(`![](${this._api.handle.shared}/${t.result})`)).catch(t=>this.error(__("Cannot export file for embedding to text"),t)))},{name:"Youtube",className:"fa fa-youtube",action:t=>this.editor.codemirror.getDoc().replaceSelection("[[youtube:]]")},"|",{name:__("Preview"),className:"fa fa-eye no-disable",action:t=>(this.previewOn=!this.previewOn,SimpleMDE.togglePreview(t),renderMathInElement(this.find("editor-container")))},"|",{name:__("Send mail"),className:"fa fa-paper-plane",action:t=>{var e,i;return(i=this.bloglist.selectedItem)?(e=i.data,this.openDialog(new a(this),{title:__("Send mail"),content:this.editor.value(),id:e.id}).then((function(t){return console.log("Email sent")}))):this.error(__("No post selected"))}}]}),this.bloglist.onlistselect=e=>{var i;if((t=this.bloglist.selectedItem)&&(i=t.data))return this.blogdb.get(Number(i.id)).then(t=>(this.editor.value(t.content),this.inputtags.value=t.tags,this.find("blog-publish").swon=!!Number(t.publish))).catch(t=>this.error(__("Cannot fetch the entry content"),t))},this.bloglist.onitemclose=e=>{var i;if(e)return t=e.data.item,i=t.data,this.openDialog("YesNoDialog",{title:__("Delete a post"),iconclass:"fa fa-question-circle",text:__("Do you really want to delete this post ?")}).then(e=>{if(e)return this.blogdb.delete(i.id).then(e=>(this.bloglist.delete(t),this.bloglist.unselect(),this.clearEditor()))}),!1},this.bindKey("CTRL-S",()=>{var t;if((t=this.tabcontainer.selectedTab)&&"blog-container"===t.container.aid)return this.saveBlog()}),this.on("vboxchange",()=>this.resizeContent()),this.resizeContent(),this.loadBlogs()}fetchData(t){switch(t){case"user-container":return this.userdb.get(null).then(t=>{var e,i,s,a,n;for(this.user=t[0],a=[],e=0,s=(i=this.select("[input-class='user-input']")).length;ethis.error(__("Cannot fetch user data"),t));case"cv-container":return this.refreshCVCat();default:return this.loadBlogs()}}saveUser(){var t,e,i,s;for(t=0,i=(e=this.select("[input-class='user-input']")).length;tthis.notify(__("User data updated"))).catch(t=>this.error(__("Cannot save user data"),t)):this.notify(__("Full name must be entered"))}refreshCVCat(){return this.fetchCVCat().then(t=>(this.cvlist.data=t,this.cvlist.expandAll())).catch(t=>this.error(__("Unable to load categories"),t))}fetchCVCat(){return new Promise((t,e)=>{var i,s;return s={text:"Porfolio",id:"0",nodes:[]},i={order:{name:"ASC"}},this.cvcatdb.find(i).then(e=>(this.catListToTree(e,s,"0"),t(s))).catch((function(t){return e(__e(t))}))})}catListToTree(t,e,i){var s,a,n,r,o;if(0===(n=function(){var e,s,a;for(a=[],e=0,s=t.length;e(e=function(){var t,e,i;for(i=[],t=0,e=s.length;t(this.refreshCVCat(),this.seclist.data=[])).catch(e=>this.error(__("Cannot delete the category: {0} [{1}]",t.name,e.toString()),e)))).catch(e=>this.error(__("Cannot delete all content of: {0} [{1}]",t.name,e.toString()),e))}CVSectionByCID(t){var e;return e={exp:{"=":{cid:t}},order:{start:"DESC"}},this.cvsecdb.find(e).then(t=>{var e,i,s,a;for(i=[],this.find("cv-sec-status").text=__("Found {0} sections",t.length),e=0,s=t.length;ethis.error(t.toString(),t))}saveBlog(){var t,e,i,s,a,n,r;return s=void 0,(a=this.bloglist.selectedItem)&&(s=a.data),n=this.inputtags.value,t=this.editor.value(),(r=new RegExp("^#+(.*)\n","g").exec(t))&&2===r.length?""===n?this.notify(__("Please enter tags")):(e=new Date,i={content:t,title:r[1].trim(),tags:n,ctime:s?s.ctime:e.timestamp(),ctimestr:s?s.ctimestr:e.toString(),utime:e.timestamp(),utimestr:e.toString(),rendered:this.process(this.editor.options.previewRender(t)),publish:this.find("blog-publish").swon?1:0},s&&(i.id=s.id),this.blogdb.save(i).then(t=>this.loadBlogs()).catch(t=>this.error(__("Cannot save blog: {0}",t.toString()),t))):this.notify(__("Please insert a title in the text: beginning with heading"))}process(t){var e,i,s,a,n,r,o,l,h;for(i=function(t){return``},o=/\[\[youtube:([^\]]*)\]\]/g,l=[];null!==(s=o.exec(t));)l.push(s);if(!(l.length>0))return t;for(h="",e=0,a=0,r=l.length;a{var e,s;for(e=0,s=t.length;ethis.error(__("No post found: {0}",t.toString()),t))}resizeContent(){var t,e,i,s,a,n;return i=this.find("editor-container"),e=$(i).children(),a=$(this.scheme).find(".afx-window-top")[0],n=e[1],s=e[4],t=$(this.scheme).height()-$(a).height()-$(n).height()-$(s).height()-90,$(e[2]).css("height",t+"px")}}).singleton=!0,e.dependencies=["pkg://SimpleMDE/main.js","pkg://SimpleMDE/main.css","pkg://Katex/main.js","pkg://Katex/main.css"],this.OS.register("Blogger",e),(s=class t extends this.OS.GUI.BasicDialog{constructor(){super("BloggerCategoryDialog",t.scheme)}main(){var t;if(super.main(),this.tree=this.find("tree"),this.txtinput=this.find("txtinput"),this.find("bt-ok").onbtclick=t=>{var e,i,s;return(e=this.tree.selectedItem)?(i=e.data,""!==(s=this.txtinput.value)||this.data.selonly?this.data.cat&&this.data.cat.id===i.id?this.notify(__("Parent can not be the category itself")):(this.handle&&this.handle({p:i,value:s}),this.quit()):this.notify(__("Please enter category name"))):this.notify(__("Please select a parent category"))},this.find("bt-cancel").onbtclick=t=>this.quit(),this.data&&this.data.tree)return this.data&&this.data.cat&&(this.txtinput.value=this.data.cat.name,(t="0"===this.data.cat.pid?this.data.tree:this.findDataByID(this.data.cat.pid,this.data.tree.nodes))&&(t.selected=!0)),this.tree.data=this.data.tree,this.tree.expandAll()}findDataByID(t,e){var i,s,a;for(s=0,a=e.length;s\n \n \n \n \n \n \n
\n \n \n
\n
\n
\n
\n',i=class extends this.OS.GUI.BasicDialog{constructor(t){super("BloggerCVSectionDiaglog",(t.meta().path+"/cvsection.html").asFileHandle())}main(){var t,e;return super.main(),this.editor=new SimpleMDE({autoDownloadFontAwesome:!1,element:this.find("contentarea"),status:!1,toolbar:!1}),$(this.select('[class = "CodeMirror-scroll"]')[0]).css("min-height","50px"),$(this.select('[class="CodeMirror cm-s-paper CodeMirror-wrap"]')[0]).css("min-height","50px"),t=this.select("[input-class='user-input']"),this.data&&this.data.section&&function(){var i,s,a;for(a=[],i=0,s=t.length;i{var s,a,n,r;for(s={},a=0,n=t.length;athis.resizeContent()),this.resizeContent()}resizeContent(){var t,e,i;return i=this.find("editor-container"),e=$(i).children(),t=$(i).height()-30,$(e[1]).css("height",t+"px")}},(a=class t extends this.OS.GUI.BasicDialog{constructor(t){super("BloggerSendmailDiaglog",(t.meta().path+"/sendmail.html").asFileHandle())}main(){var e,i;return super.main(),this.subdb=new this.parent._api.DB("subscribers"),this.maillinglist=this.find("email-list"),i=new RegExp("^#+(.*)\n","g").exec(this.data.content),this.find("mail-title").value=i[1],e=this.data.content.substring(0,500)+"...",this.find("contentarea").value=t.template.format(this.data.id,e),this.subdb.find({}).then(t=>{var e,i,s;for(e=0,i=t.length;ethis.error(__("Cannot fetch subscribers data: {0}",t.toString()),t)),this.find("bt-sendmail").onbtclick=t=>{var e,i,s,a,n,r;for(i=[],s=0,n=(a=this.maillinglist.items).length;st.error?this.notify(__("Unable to send mail to: {0}",t.result.join(", "))):this.quit()).catch(t=>(console.log(t),this.error(__("Error sending mail: {0}",t.toString()),t))))}}}).template="Hello,\n\nXuan Sang LE has just published a new post on his blog: https://blog.lxsang.me/post/id/{0}\n\n==========\n{1}\n==========\n\n\nRead the full article via:\nhttps://blog.lxsang.me/post/id/{0}\n\nYou receive this email because you have been subscribed to his blog.\n\nHave a nice day,\n\nSent from Blogger, an AntOS application",n=class extends this.OS.GUI.tag.ListViewItemTag{constructor(){super()}ondatachange(){var t,e,i,s,a,n;if(this.data){for(e in n=this.data,i=["content","start","end"],this.closable=n.closable,a=[],s=this.refs)t=s[e],n[e]&&""!==n[e]?i.includes(e)?a.push($(t).text(n[e])):a.push(t.text=n[e]):a.push(void 0);return a}}reload(){}init(){}itemlayout(){return{el:"div",children:[{el:"afx-label",ref:"title",class:"afx-cv-sec-title"},{el:"afx-label",ref:"subtitle",class:"afx-cv-sec-subtitle"},{el:"p",ref:"content",class:"afx-cv-sec-content"},{el:"p",class:"afx-cv-sec-period",children:[{el:"i",ref:"start"},{el:"i",ref:"end",class:"period-end"}]},{el:"afx-label",ref:"location",class:"afx-cv-sec-loc"}]}}},this.OS.GUI.tag.define("afx-blogger-cvsection-item",n),t=class extends this.OS.GUI.tag.ListViewItemTag{constructor(){super()}ondatachange(t){if(this.data)return(t=this.data).closable=!0,this.closable=t.closable,this.refs.title.text=t.title,this.refs.ctimestr.text=__("Created: {0}",t.ctimestr),this.refs.utimestr.text=__("Updated: {0}",t.utimestr)}reload(){}init(){}itemlayout(){return{el:"div",children:[{el:"afx-label",ref:"title",class:"afx-blogpost-title"},{el:"afx-label",ref:"ctimestr",class:"blog-dates"},{el:"afx-label",ref:"utimestr",class:"blog-dates"}]}}},this.OS.GUI.tag.define("afx-blogger-post-item",t)}).call(this); \ No newline at end of file diff --git a/Blogger/build/debug/package.json b/Blogger/build/debug/package.json deleted file mode 100644 index 0531786..0000000 --- a/Blogger/build/debug/package.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "app":"Blogger", - "name":"Blogging application", - "description":"Backend manager for blogging", - "info":{ - "author": "Xuan Sang LE", - "email": "xsang.le@gmail.com" - }, - "version":"0.2.7-a", - "category":"Internet", - "iconclass":"fa fa-book", - "dependencies": ["SimpleMDE@1.11.2-r","Katex@0.11.1-r"], - "mimes":["none"] -} \ No newline at end of file diff --git a/Blogger/build/debug/scheme.html b/Blogger/build/debug/scheme.html deleted file mode 100644 index 32001fd..0000000 --- a/Blogger/build/debug/scheme.html +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
-
-
- - -
- - - - - - - - - - - - - - - - - - - -
-
- - - - - - -
- -
- - - -
- -
-
- -
-
-
- -
-
-
\ No newline at end of file diff --git a/Blogger/build/debug/sendmail.html b/Blogger/build/debug/sendmail.html deleted file mode 100644 index f307bf7..0000000 --- a/Blogger/build/debug/sendmail.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - -
- -
- - - - -
- -
- -
-
-
-
-
\ No newline at end of file diff --git a/Blogger/build/debug/sendmail.lua b/Blogger/build/debug/sendmail.lua deleted file mode 100644 index 6e8aab4..0000000 --- a/Blogger/build/debug/sendmail.lua +++ /dev/null @@ -1,32 +0,0 @@ - -local data = ... --- print(data.content) -local error_msg = {} -local iserror = false -local tmp_name = "/tmp/"..os.time(os.date("!*t")) -local file = io.open (tmp_name , "w") -if file then - file:write("From: mrsang@lxsang.me\n") - file:write("Subject: " .. data.title .. "\n") - file:write( data.content.."\n") - file:close() - for k,v in pairs(data.to) do - print("sent to:"..v) - local to = v - local cmd = 'cat ' ..tmp_name .. '| sendmail ' .. to - --print(cmd) - local r = os.execute(cmd) - if not r then - iserror = true - table.insert(error_msg, v) - print("Unable to send mail to: "..v) - end - end -else - iserror = true - table.insert(error_msg, "Cannot create mail file") -end -local result = {} -result.error = iserror -result.result = error_msg -return result \ No newline at end of file diff --git a/OnlyOffice/README.md b/OnlyOffice/README.md new file mode 100644 index 0000000..3b6168e --- /dev/null +++ b/OnlyOffice/README.md @@ -0,0 +1,7 @@ +# 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 document, presentation, and spreedsheet + diff --git a/OnlyOffice/assets/scheme.html b/OnlyOffice/assets/scheme.html new file mode 100644 index 0000000..be5ebc5 --- /dev/null +++ b/OnlyOffice/assets/scheme.html @@ -0,0 +1,5 @@ + + +
+
+
\ No newline at end of file diff --git a/OnlyOffice/build/debug/README.md b/OnlyOffice/build/debug/README.md new file mode 100644 index 0000000..3b6168e --- /dev/null +++ b/OnlyOffice/build/debug/README.md @@ -0,0 +1,7 @@ +# 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 document, presentation, and spreedsheet + diff --git a/OnlyOffice/build/debug/main.js b/OnlyOffice/build/debug/main.js new file mode 100644 index 0000000..4889ec4 --- /dev/null +++ b/OnlyOffice/build/debug/main.js @@ -0,0 +1,36 @@ +(function() { + var OnlyOffice; + + OnlyOffice = class OnlyOffice extends this.OS.application.BaseApplication { + constructor(args) { + super("OnlyOffice", args); + } + + main() { + var placeholder; + placeholder = this.find("editor-area"); + return this.editor = new DocsAPI.DocEditor(placeholder, { + "document": { + "fileType": "docx", + "key": "Khirz6zTPdfd7", + "title": "Example Document Title.docx", + "url": "https://file-examples-com.github.io/uploads/2017/02/file-sample_100kB.doc" + }, + "documentType": "word" + }); + } + + cleanup() { + if (this.editor) { + this.editor.destroyEditor(); + } + return this.editor = void 0; + } + + }; + + OnlyOffice.dependencies = ["http://192.168.1.91/web-apps/apps/api/documents/api.js"]; + + this.OS.register("OnlyOffice", OnlyOffice); + +}).call(this); diff --git a/OnlyOffice/build/debug/package.json b/OnlyOffice/build/debug/package.json new file mode 100644 index 0000000..38a1ffd --- /dev/null +++ b/OnlyOffice/build/debug/package.json @@ -0,0 +1,16 @@ +{ + "pkgname": "OnlyOffice", + "app":"OnlyOffice", + "name":"OnlyOffice", + "description":"OnlyOffice", + "info":{ + "author": "", + "email": "" + }, + "version":"0.0.1-a", + "category":"Other", + "iconclass":"fa fa-adn", + "mimes":["none"], + "dependencies":[], + "locale": {} +} \ No newline at end of file diff --git a/OnlyOffice/build/debug/scheme.html b/OnlyOffice/build/debug/scheme.html new file mode 100644 index 0000000..be5ebc5 --- /dev/null +++ b/OnlyOffice/build/debug/scheme.html @@ -0,0 +1,5 @@ + + +
+
+
\ No newline at end of file diff --git a/OnlyOffice/coffees/main.coffee b/OnlyOffice/coffees/main.coffee new file mode 100644 index 0000000..ae035de --- /dev/null +++ b/OnlyOffice/coffees/main.coffee @@ -0,0 +1,25 @@ +class OnlyOffice extends this.OS.application.BaseApplication + constructor: ( args ) -> + super "OnlyOffice", args + + main: () -> + placeholder = @find "editor-area" + @editor = new DocsAPI.DocEditor(placeholder, { + "document": { + "fileType": "docx", + "key": "Khirz6zTPdfd7", + "title": "Example Document Title.docx", + "url": "https://file-examples-com.github.io/uploads/2017/02/file-sample_100kB.doc" + }, + "documentType": "word" + }); + + cleanup: () -> + @editor.destroyEditor() if @editor + @editor = undefined + +OnlyOffice.dependencies = [ + "http://192.168.1.91/web-apps/apps/api/documents/api.js" +] + +this.OS.register "OnlyOffice", OnlyOffice \ No newline at end of file diff --git a/OnlyOffice/package.json b/OnlyOffice/package.json new file mode 100644 index 0000000..38a1ffd --- /dev/null +++ b/OnlyOffice/package.json @@ -0,0 +1,16 @@ +{ + "pkgname": "OnlyOffice", + "app":"OnlyOffice", + "name":"OnlyOffice", + "description":"OnlyOffice", + "info":{ + "author": "", + "email": "" + }, + "version":"0.0.1-a", + "category":"Other", + "iconclass":"fa fa-adn", + "mimes":["none"], + "dependencies":[], + "locale": {} +} \ No newline at end of file diff --git a/OnlyOffice/project.json b/OnlyOffice/project.json new file mode 100644 index 0000000..1ce0928 --- /dev/null +++ b/OnlyOffice/project.json @@ -0,0 +1,7 @@ +{ + "name": "OnlyOffice", + "css": [], + "javascripts": [], + "coffees": ["coffees/main.coffee"], + "copies": ["assets/scheme.html", "package.json", "README.md"] +} \ No newline at end of file