1
0
forked from x/ContextOS

opt cli.date

This commit is contained in:
shaoying 2019-09-20 09:29:53 +08:00
parent ff63b234cb
commit 935c845a8b
3 changed files with 25 additions and 16 deletions

View File

@ -1,15 +1,18 @@
{init: function(run, field, option, output) { {init: function(run, field, option, output) {return {
return {
show: function(event) { show: function(event) {
run(event, ["", "", "cmd", "ssh.data", "show", "love"], function(msg) { run(event, ["", "", "cmd", "ssh.data", "show", option.table.value], function(msg) {ctx.Table(msg, function(value) {
ctx.Table(msg, function(value) { kit.Selector(output, ".s"+value[option.when.value].split(" ")[0].split("-").join(""), function(item) {
var ts = ".s"+value.when.split(" ")[0].split("-").join("")
kit.Selector(output, ts, function(item) {
item.parentNode.style.backgroundColor = "red" item.parentNode.style.backgroundColor = "red"
item.parentNode.title = value.where item.parentNode.title = value[option.where.value]
})
}) })
})})
},
show_after: function(msg) {
var now = kit.format_date(new Date())
kit.Selector(output, ".s"+now.split(" ")[0].split("-").join(""), function(item) {
item.parentNode.style.backgroundColor = "red"
item.innerText = "TODAY"
item.parentNode.title = "today"
}) })
}, },
} }}}
}}

View File

@ -3,7 +3,7 @@ kit imports "导入" "" "" private "ssh.data" "import" \
text "" name file \ text "" name file \
button "导入" button "导入"
fun meets "第一眼" private \ fun meet "第一眼" private \
text "love" name table imports plugin_table \ text "love" name table imports plugin_table \
text "date" name when \ text "date" name when \
text "" name where \ text "" name where \
@ -16,9 +16,13 @@ fun meets "第一眼" private \
copy ssh.data insert _ when _ where __ copy ssh.data insert _ when _ where __
end end
kit date "日历" "index.js" protected "cli.date" format '<span class="%s">%s</span>' "s20060102" space true _ nature _ \ kit date "日历" "index.js" protected "cli.date" _ nature _ \
\ space true format '<span class="%s">%s</span>' "s20060102" \
text "2019-07-08" name "起始时间" \ text "2019-07-08" name "起始时间" \
text "date" name "截止时间" \ text "date" name "截止时间" \
text "love" name "table" imports plugin_table \
text "when" name "when" \
text "where" name "where" \
button "查看" action auto \ button "查看" action auto \
button "显示" click show button "显示" click show

View File

@ -867,7 +867,9 @@ function Plugin(page, pane, field, runs) {
}, },
display: function(arg, cb) { display: function(arg, cb) {
deal = arg, plugin.ondaemon[deal||"table"](plugin.msg, cb) deal = arg, plugin.ondaemon[deal||"table"](plugin.msg, cb)
plugin.show_after(plugin.msg)
}, },
show_after: function(msg) {},
ondaemon: { ondaemon: {
inner: function(msg, cb) { inner: function(msg, cb) {
output.style.maxWidth = pane.target.clientWidth-20+"px" output.style.maxWidth = pane.target.clientWidth-20+"px"