mirror of
https://github.com/lxsang/antos-frontend.git
synced 2025-02-22 01:42:47 +01:00
add a column to database
This commit is contained in:
parent
46256669c1
commit
10dbe6ea99
@ -163,7 +163,7 @@ class Blogger extends this.OS.GUI.BaseApplication
|
|||||||
@bloglist.set "onlistselect", (e) ->
|
@bloglist.set "onlistselect", (e) ->
|
||||||
sel = me.bloglist.get "selected"
|
sel = me.bloglist.get "selected"
|
||||||
return unless sel
|
return unless sel
|
||||||
me.editor.value sel.content
|
me.editor.value atob(sel.content)
|
||||||
me.inputtags.value = sel.tags
|
me.inputtags.value = sel.tags
|
||||||
|
|
||||||
@on "vboxchange", () ->
|
@on "vboxchange", () ->
|
||||||
@ -292,14 +292,14 @@ class Blogger extends this.OS.GUI.BaseApplication
|
|||||||
return @notify "Please enter tags" if tags is ""
|
return @notify "Please enter tags" if tags is ""
|
||||||
d = new Date()
|
d = new Date()
|
||||||
data =
|
data =
|
||||||
content: content
|
content: content.asBase64()
|
||||||
title: title[1].trim()
|
title: title[1].trim()
|
||||||
tags: tags
|
tags: tags
|
||||||
ctime: if sel then sel.ctime else d.timestamp()
|
ctime: if sel then sel.ctime else d.timestamp()
|
||||||
ctimestr: if sel then sel.ctimestr else d.toString()
|
ctimestr: if sel then sel.ctimestr else d.toString()
|
||||||
utime: d.timestamp()
|
utime: d.timestamp()
|
||||||
utimestr: d.toString()
|
utimestr: d.toString()
|
||||||
|
rendered: me.editor.options.previewRender(content).asBase64()
|
||||||
data.id = sel.id if sel
|
data.id = sel.id if sel
|
||||||
|
|
||||||
#save the data
|
#save the data
|
||||||
@ -310,7 +310,10 @@ class Blogger extends this.OS.GUI.BaseApplication
|
|||||||
# load blog
|
# load blog
|
||||||
loadBlogs: () ->
|
loadBlogs: () ->
|
||||||
me = @
|
me = @
|
||||||
@blogdb.get null, (r) ->
|
cond =
|
||||||
|
order:
|
||||||
|
ctime: "DESC"
|
||||||
|
@blogdb.find cond, (r) ->
|
||||||
return me.notify "No post found: #{r.error}" if r.error
|
return me.notify "No post found: #{r.error}" if r.error
|
||||||
for v in r.result
|
for v in r.result
|
||||||
v.text = v.title
|
v.text = v.title
|
||||||
|
Loading…
x
Reference in New Issue
Block a user