This commit is contained in:
lxsang 2020-06-17 21:08:15 +02:00
parent fe0223d2eb
commit 9405900664
19 changed files with 129 additions and 8 deletions

View File

@ -5,6 +5,9 @@ Blackend for my blog at https://blog.iohub.dev
## Change logs
### v0.2.0-a
* Important change: Store raw post content to the database instead of base64 string as before
### v0.1.4-a
* Minor bug fix
* Enhance youtube video embedding feature in markdown

View File

@ -5,6 +5,9 @@ Blackend for my blog at https://blog.iohub.dev
## Change logs
### v0.2.0-a
* Important change: Store raw post content to the database instead of base64 string as before
### v0.1.4-a
* Minor bug fix
* Enhance youtube video embedding feature in markdown

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.4-a",
"version":"0.2.0-a",
"category":"Internet",
"iconclass":"fa fa-book",
"mimes":["none"]

Binary file not shown.

View File

@ -253,7 +253,7 @@ class Blogger extends this.OS.application.BaseApplication
return unless sel
@blogdb.get Number(sel.id)
.then (r) =>
@editor.value atob(r.content)
@editor.value r.content
@inputtags.value = r.tags
(@find "blog-publish").swon = if Number(r.publish) then true else false
.catch (e) =>
@ -401,7 +401,7 @@ class Blogger extends this.OS.application.BaseApplication
return @notify __("Please enter tags") if tags is ""
d = new Date()
data =
content: content.asBase64()
content: content
title: title[1].trim()
tags: tags
ctime: if sel then sel.ctime else d.timestamp()
@ -441,7 +441,7 @@ class Blogger extends this.OS.application.BaseApplication
begin = it.index + it[0].length
ret += text.substring begin, text.length
#console.log ret
return ret.asBase64()
return ret
clearEditor:() ->
@.editor.value ""

View File

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

15
DBDecoder/README.md Normal file
View 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

View 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>

View 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

View File

@ -0,0 +1 @@
(function(){var t;t=class extends this.OS.application.BaseApplication{constructor(t){super("DBDecoder",t)}main(){var t;return t=this.find("decoder"),this.db=new this._api.DB("blogs"),t.onbtclick=t=>this.db.find("1=1").then(t=>{var e,n,r;for(e=0,n=t.length;e<n;e++)(r=t[e]).content=atob(r.content),r.rendered=atob(r.rendered);return this.saveDB(t).then(()=>this.notify("Data base saved")).catch(t=>this.error(t.toString(),t))})}saveDB(t){return new Promise((e,n)=>{var r;return 0===t.length?e():(r=t.shift(),this.db.save(r).then(()=>this.saveDB(t).then(()=>e()).catch(t=>n(__e(t)))).catch(t=>n(__e(t))))})}},this.OS.register("DBDecoder",t)}).call(this);

View File

@ -0,0 +1,14 @@
{
"app":"DBDecoder",
"name":"DBDecoder",
"description":"DBDecoder",
"info":{
"author": "",
"email": ""
},
"version":"0.0.1-a",
"category":"Other",
"iconclass":"fa fa-adn",
"mimes":["none"],
"locale": {}
}

View 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>

Binary file not shown.

View 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
View File

@ -0,0 +1,14 @@
{
"app":"DBDecoder",
"name":"DBDecoder",
"description":"DBDecoder",
"info":{
"author": "",
"email": ""
},
"version":"0.0.1-a",
"category":"Other",
"iconclass":"fa fa-adn",
"mimes":["none"],
"locale": {}
}

8
DBDecoder/project.json Normal file
View File

@ -0,0 +1,8 @@
{
"name": "DBDecoder",
"root": "home://workspace/antosdk-apps/DBDecoder",
"css": [],
"javascripts": [],
"coffees": ["coffees/main.coffee"],
"copies": ["assets/scheme.html", "package.json", "README.md"]
}

View File

@ -1,3 +1,3 @@
# MarkOn markdown editor
markdown editor for antOS
Simple Markdown editor for antOS

View File

@ -32,7 +32,7 @@
"description": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/Blogger/README.md",
"category": "Internet",
"author": "Xuan Sang LE",
"version": "0.1.4-a",
"version": "0.2.0-a",
"download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/Blogger/build/release/Blogger.zip"
},
{
@ -44,6 +44,15 @@
"version": "0.0.2-a",
"download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/Booklet/build/release/Booklet.zip"
},
{
"pkgname": "DBDecoder",
"name": "DBDecoder",
"description": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/DBDecoder/README.md",
"category": "Other",
"author": "",
"version": "0.0.1-a",
"download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/DBDecoder/build/release/DBDecoder.zip"
},
{
"pkgname": "GraphEditor",
"name": "Graph Editor",