mirror of
https://shylinux.com/x/ContextOS
synced 2025-04-25 16:58:06 +08:00
opt love
This commit is contained in:
parent
df5d390820
commit
79ef6c8718
@ -719,10 +719,6 @@ var Index = &ctx.Context{Name: "cli", Help: "管理中心",
|
|||||||
return
|
return
|
||||||
}},
|
}},
|
||||||
"date": &ctx.Command{Name: "date", Help: "日历", Form: map[string]int{"space": 1, "format": 2, "count": 1, "nature": 1, "cmd": -1}, Hand: func(m *ctx.Message, c *ctx.Context, key string, arg ...string) (e error) {
|
"date": &ctx.Command{Name: "date", Help: "日历", Form: map[string]int{"space": 1, "format": 2, "count": 1, "nature": 1, "cmd": -1}, Hand: func(m *ctx.Message, c *ctx.Context, key string, arg ...string) (e error) {
|
||||||
if m.Has("cmd") { // TODO 这是个漏洞
|
|
||||||
m.Cmdy(m.Meta["cmd"])
|
|
||||||
return
|
|
||||||
}
|
|
||||||
show := map[int]string{0: "周日", 1: "周一", 2: "周二", 3: "周三", 4: "周四", 5: "周五", 6: "周六"}
|
show := map[int]string{0: "周日", 1: "周一", 2: "周二", 3: "周三", 4: "周四", 5: "周五", 6: "周六"}
|
||||||
|
|
||||||
space := m.Options("space")
|
space := m.Options("space")
|
||||||
|
@ -1,8 +1,11 @@
|
|||||||
package cli
|
package cli
|
||||||
|
|
||||||
var version = struct {
|
var version = struct {
|
||||||
|
init []string
|
||||||
time string
|
time string
|
||||||
host string
|
host string
|
||||||
self int
|
self int
|
||||||
}{
|
}{
|
||||||
"2019-09-29 22:27:58", "mac", 612,
|
[]string{"2017-11-01 01:02:03", "2019-07-13 18:02:21"},
|
||||||
|
`2019-09-30 15:01:56`, `centos`, 622,
|
||||||
}
|
}
|
||||||
|
@ -399,7 +399,7 @@ var Index = &ctx.Context{Name: "ssh", Help: "集群中心",
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
}},
|
}},
|
||||||
"data": {Name: "data show|save|create|insert", Help: "数据", Form: map[string]int{"format": 1}, Hand: func(m *ctx.Message, c *ctx.Context, key string, arg ...string) (e error) {
|
"data": {Name: "data show|save|create|insert", Help: "数据", Form: map[string]int{"format": 1, "fields": -1}, Hand: func(m *ctx.Message, c *ctx.Context, key string, arg ...string) (e error) {
|
||||||
if len(arg) == 0 {
|
if len(arg) == 0 {
|
||||||
arg = append(arg, "show")
|
arg = append(arg, "show")
|
||||||
}
|
}
|
||||||
@ -433,7 +433,9 @@ var Index = &ctx.Context{Name: "ssh", Help: "集群中心",
|
|||||||
}
|
}
|
||||||
sort.Strings(keys)
|
sort.Strings(keys)
|
||||||
|
|
||||||
m.Meta["append"] = []string{"id", "when"}
|
if m.Meta["append"] = []string{"id", "when"}; m.Has("fields") {
|
||||||
|
keys = kit.Trans(m.Optionv("fields"))
|
||||||
|
}
|
||||||
m.Confm("flow", []string{m.Option("river"), "data", arg[1], "list"}, func(index int, value map[string]interface{}) {
|
m.Confm("flow", []string{m.Option("river"), "data", arg[1], "list"}, func(index int, value map[string]interface{}) {
|
||||||
for _, k := range keys {
|
for _, k := range keys {
|
||||||
m.Push(k, kit.Format(value[k]))
|
m.Push(k, kit.Format(value[k]))
|
||||||
@ -445,13 +447,25 @@ var Index = &ctx.Context{Name: "ssh", Help: "集群中心",
|
|||||||
switch m.Option("format") {
|
switch m.Option("format") {
|
||||||
case "object":
|
case "object":
|
||||||
m.Confm("flow", []string{m.Option("river"), "data", arg[1], "list", kit.Format(index)}, func(key string, value string) {
|
m.Confm("flow", []string{m.Option("river"), "data", arg[1], "list", kit.Format(index)}, func(key string, value string) {
|
||||||
m.Push(key, value)
|
if key != "extra" {
|
||||||
|
m.Push(key, value)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
m.Confm("flow", []string{m.Option("river"), "data", arg[1], "list", kit.Format(index), "extra"}, func(key string, value string) {
|
||||||
|
m.Push("extra."+key, value)
|
||||||
})
|
})
|
||||||
default:
|
default:
|
||||||
m.Confm("flow", []string{m.Option("river"), "data", arg[1], "list", kit.Format(index)}, func(key string, value string) {
|
m.Confm("flow", []string{m.Option("river"), "data", arg[1], "list", kit.Format(index)}, func(key string, value string) {
|
||||||
m.Push("key", key)
|
if key != "extra" {
|
||||||
|
m.Push("key", key)
|
||||||
|
m.Push("value", value)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
m.Confm("flow", []string{m.Option("river"), "data", arg[1], "list", kit.Format(index), "extra"}, func(key string, value string) {
|
||||||
|
m.Push("key", "extra."+key)
|
||||||
m.Push("value", value)
|
m.Push("value", value)
|
||||||
})
|
})
|
||||||
|
m.Sort("key")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
m.Table()
|
m.Table()
|
||||||
@ -529,10 +543,14 @@ var Index = &ctx.Context{Name: "ssh", Help: "集群中心",
|
|||||||
m.Cmdy("ssh.data", "save", arg[1])
|
m.Cmdy("ssh.data", "save", arg[1])
|
||||||
|
|
||||||
case "update":
|
case "update":
|
||||||
index := kit.Int(arg[2]) - 1
|
table, index, prefix, arg := arg[1], kit.Int(arg[2])-1, "", arg[3:]
|
||||||
for i := 3; i < len(arg)-1; i += 2 {
|
if arg[0] == "extra" {
|
||||||
m.Confv("flow", []string{m.Option("river"), "data", arg[1], "list", kit.Format(index), arg[i]}, arg[i+1])
|
prefix, arg = "extra.", arg[1:]
|
||||||
}
|
}
|
||||||
|
for i := 0; i < len(arg)-1; i += 2 {
|
||||||
|
m.Confv("flow", []string{m.Option("river"), "data", table, "list", kit.Format(index), prefix + arg[i]}, arg[i+1])
|
||||||
|
}
|
||||||
|
m.Cmdy("ssh.data", "show", table, index+1)
|
||||||
case "import":
|
case "import":
|
||||||
if len(arg) < 3 {
|
if len(arg) < 3 {
|
||||||
m.Cmdy("ssh.data", "show", arg)
|
m.Cmdy("ssh.data", "show", arg)
|
||||||
|
@ -3,24 +3,17 @@ fieldset.item.love.date table td.today {
|
|||||||
border:solid 2px red;
|
border:solid 2px red;
|
||||||
}
|
}
|
||||||
fieldset.item.love.date table td {
|
fieldset.item.love.date table td {
|
||||||
word-break:break-all;
|
|
||||||
text-align:center;
|
text-align:center;
|
||||||
min-width:40px;
|
min-width:40px;
|
||||||
}
|
}
|
||||||
|
|
||||||
fieldset.item.love.days div.day {
|
fieldset.item.love.days div.day {
|
||||||
opacity:0;
|
|
||||||
padding:8px;
|
|
||||||
border:solid 2px cyan;
|
|
||||||
margin:8px;
|
margin:8px;
|
||||||
|
border:solid 2px cyan;
|
||||||
|
padding:8px;
|
||||||
|
opacity:0;
|
||||||
float:left;
|
float:left;
|
||||||
}
|
}
|
||||||
fieldset.item.love.days div.day span.day {
|
|
||||||
font-size:18px;
|
|
||||||
font-weight:bold;
|
|
||||||
font-style:italic;
|
|
||||||
margin-right:5px;
|
|
||||||
}
|
|
||||||
fieldset.item.love.days span.what {
|
fieldset.item.love.days span.what {
|
||||||
font-size:24px;
|
font-size:24px;
|
||||||
}
|
}
|
||||||
@ -32,3 +25,8 @@ fieldset.item.love.days span.day1 {
|
|||||||
font-size:32px;
|
font-size:32px;
|
||||||
color:green;
|
color:green;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fieldset.item.love.media table td {
|
||||||
|
text-align:center;
|
||||||
|
min-width:60px;
|
||||||
|
}
|
||||||
|
@ -1,13 +1,20 @@
|
|||||||
{init: function(run, field, option, output) {
|
{init: function(run, field, option, output) {
|
||||||
return {
|
return {
|
||||||
show: function(event) {
|
data: function(event) {var plugin = field.Plugin
|
||||||
run(event, ["", "", "cmd", "ssh.data", "show", option.table.value], function(msg) {
|
run(event, [option.table.value], function(msg) {
|
||||||
kit.List(ctx.Table(msg), function(value) {
|
plugin.msg = msg, plugin.display("table")
|
||||||
kit.Selector(output, ".s"+value[option.when.value].split(" ")[0].split("-").join(""), function(item) {
|
})
|
||||||
kit.classList.add(item.parentNode, "select")
|
},
|
||||||
item.parentNode.title = value[option.where.value]
|
show: function(event) {var plugin = field.Plugin
|
||||||
})
|
plugin.Check(undefined, function(msg) {
|
||||||
}, 200)
|
run(event, [option.table.value], function(msg) {
|
||||||
|
kit.List(ctx.Table(msg), function(line) {
|
||||||
|
kit.Selector(output, ".s"+line.when.split(" ")[0].split("-").join(""), function(item) {
|
||||||
|
kit.classList.add(item.parentNode, "select")
|
||||||
|
item.parentNode.title = line.what
|
||||||
|
})
|
||||||
|
}, 200)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
show_after: function(msg) {
|
show_after: function(msg) {
|
||||||
@ -15,29 +22,55 @@ return {
|
|||||||
kit.classList.add(item.parentNode, "today")
|
kit.classList.add(item.parentNode, "today")
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
onexport: {"": function(value, name, line) {var plugin = field.Plugin
|
||||||
|
switch (field.Meta.name) {
|
||||||
|
case "days": plugin.flash(line, function(list) {
|
||||||
|
return kit.AppendChilds(output, list)
|
||||||
|
}); break
|
||||||
|
case "date":
|
||||||
|
plugin.Check(undefined, function(msg) {
|
||||||
|
kit.Selector(output, ".s"+line.when.split(" ")[0].split("-").join(""), function(item) {
|
||||||
|
kit.classList.add(item.parentNode, "select")
|
||||||
|
item.parentNode.title = line.what
|
||||||
|
})
|
||||||
|
})
|
||||||
|
break
|
||||||
|
case "detail":
|
||||||
|
plugin.Change(event.target, function(value) {
|
||||||
|
run(event, ["update", option.table.value, option.index.value, line.key, value], function(msg) {
|
||||||
|
kit.Log("ok")
|
||||||
|
})
|
||||||
|
})
|
||||||
|
break
|
||||||
|
}
|
||||||
|
return line.id
|
||||||
|
}},
|
||||||
|
flash: function(line, cb, index, array) {var plugin = field.Plugin
|
||||||
|
var now = new Date()
|
||||||
|
var day = new Date(line.when)
|
||||||
|
var mis = parseInt((day.getTime() - now.getTime()) / 1000 / 3600 / 24)
|
||||||
|
if (array && index == array.length-1) {
|
||||||
|
mis = 999999
|
||||||
|
}
|
||||||
|
|
||||||
|
var list = kit.Span()
|
||||||
|
list.span(["距", "day"], line.when.split(" ")[0])
|
||||||
|
list.span(["在", "day"], line.where)
|
||||||
|
list.span([line.what, "what"])
|
||||||
|
list.span(mis>0? "还有": "过去", [mis, mis>0? "day1": "day0"], "天")
|
||||||
|
|
||||||
|
kit.Opacity(cb([{text: [list.join(""), "div", "day"]}]).last)
|
||||||
|
},
|
||||||
Order: function(t, cb, cbs) {var plugin = field.Plugin
|
Order: function(t, cb, cbs) {var plugin = field.Plugin
|
||||||
var msg = plugin.msg, now = new Date()
|
kit.List(ctx.Table(plugin.msg).concat([{when: "9999-01-08", what: "最后一次爱你", where: "北京市"}]), function(line, index, array) {
|
||||||
kit.List(ctx.Table(msg).concat([{when: "9999-01-08", what: "最后一次爱你", where: "北京市"}]), function(line, index, array) {
|
plugin.flash(line, cb, index, array)
|
||||||
var day = new Date(line.when)
|
|
||||||
var mis = parseInt((day.getTime() - now.getTime()) / 1000 / 3600 / 24)
|
|
||||||
if (index == array.length-1) {
|
|
||||||
mis = 999999
|
|
||||||
}
|
|
||||||
|
|
||||||
var list = kit.Span()
|
|
||||||
list.span(["距", "day"], line.when.split(" ")[0])
|
|
||||||
list.span(["在", "day"], line.where)
|
|
||||||
list.span([line.what, "what"])
|
|
||||||
list.span(mis>0? "还有": "过去", [mis, mis>0? "day1": "day0"], "天")
|
|
||||||
|
|
||||||
kit.Opacity(cb(output, [{text: [list.join(""), "div", "day"]}]).last)
|
|
||||||
}, t, cbs)
|
}, t, cbs)
|
||||||
},
|
},
|
||||||
Flash: function(event) {var plugin = field.Plugin
|
Flash: function(event) {var plugin = field.Plugin
|
||||||
plugin.Order(1000, function(output, list) {
|
plugin.Order(1000, function(list) {
|
||||||
return kit.AppendChilds(output, list)
|
return kit.AppendChilds(output, list)
|
||||||
}, function() {
|
}, function() {
|
||||||
output.innerHTML = "", plugin.Order(400, function(output, list) {
|
output.innerHTML = "", plugin.Order(400, function(list) {
|
||||||
return kit.AppendChild(output, list)
|
return kit.AppendChild(output, list)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
@ -1,29 +1,36 @@
|
|||||||
|
|
||||||
kit date "每一天" "index.js" "index.css" protected "cli.date" _ nature _ \
|
fun date "每一天" "index.js" "index.css" protected \
|
||||||
\ space true format '<span class="%s">%s</span>' "s20060102" \
|
text "love" name "table" imports plugin_table view tiny \
|
||||||
text "2019-07-08" name "起始时间" \
|
text "2019-07-08" name "起始时间" \
|
||||||
text "" name "截止时间" init date \
|
text "" name "截止时间" init date \
|
||||||
text "love" name "table" imports plugin_table view tiny \
|
button "日历" action auto \
|
||||||
text "when" name "when" view tiny \
|
button "记录" cb data \
|
||||||
text "where" name "where" view tiny \
|
button "展示" cb show \
|
||||||
button "查看" action auto \
|
exports index ""
|
||||||
button "显示" cb show
|
|
||||||
|
if $2 == "" || $3 == ""
|
||||||
|
copy skip ssh.data show _ fields id when where what
|
||||||
|
else
|
||||||
|
copy skip cli.date $2 nature $3 space true format '<span class="%s">%s</span>' "s20060102"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
fun maps "每一面" "maps.js" "index.css" protected \
|
fun maps "每一面" "maps.js" "index.css" protected \
|
||||||
text "love" name table imports plugin_table \
|
text "love" name table imports plugin_table \
|
||||||
text "" name when init date \
|
text "" name when init date \
|
||||||
text "" name what view long \
|
text "" name what view long \
|
||||||
|
button "本地" cb Current \
|
||||||
text "北京市" name city view tiny \
|
text "北京市" name city view tiny \
|
||||||
text "弘源首著" name where \
|
text "弘源首著" name where \
|
||||||
button "本地" cb Current \
|
|
||||||
button "搜索" cb Search action auto \
|
button "搜索" cb Search action auto \
|
||||||
button "记录" cb Record \
|
button "记录" cb Record \
|
||||||
button "展示" cb Flashs
|
button "展示" cb Flashs \
|
||||||
|
exports index ""
|
||||||
|
|
||||||
if $2 == "" || $3 == ""
|
if $2 == "" || $3 == ""
|
||||||
copy skip ssh.data show _
|
copy skip ssh.data show _
|
||||||
else
|
else
|
||||||
copy ssh.data insert _ when _ what _ city _ where _ longitude _ latitude _ scale _
|
copy ssh.data insert _ when _ what _ city _ where _
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -32,15 +39,34 @@ fun days "每一次" "index.js" "index.css" protected \
|
|||||||
text "" name when init date \
|
text "" name when init date \
|
||||||
text "" name what view long \
|
text "" name what view long \
|
||||||
button "记录" \
|
button "记录" \
|
||||||
button "展示" cb Flash
|
button "展示" cb Flash \
|
||||||
|
exports index ""
|
||||||
|
|
||||||
if $2 == "" || $3 == ""
|
if $2 == "" || $3 == ""
|
||||||
copy skip ssh.data show _
|
copy skip ssh.data show _ fields id when where what
|
||||||
else
|
else
|
||||||
copy ssh.data insert _ when _ what __
|
copy ssh.data insert _ when _ what __
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
fun detail "详情" "index.js" protected \
|
||||||
|
text "love" name table imports plugin_table \
|
||||||
|
text "1" name index imports plugin_index action auto view tiny \
|
||||||
|
button "查看"
|
||||||
|
if $1 == "update"
|
||||||
|
copy ssh.data
|
||||||
|
else
|
||||||
|
copy ssh.data show
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
kit note "回忆" "index.js" protected "ssh.data" update _ _ extra \
|
||||||
|
text "love" name table imports plugin_table \
|
||||||
|
text "1" name index imports plugin_index action auto view tiny \
|
||||||
|
text "" name field \
|
||||||
|
text "" name value \
|
||||||
|
button "添加"
|
||||||
|
|
||||||
fun delay "以后告诉你" protected \
|
fun delay "以后告诉你" protected \
|
||||||
text "delay" name table imports plugin_table \
|
text "delay" name table imports plugin_table \
|
||||||
text "" name when init date\
|
text "" name when init date\
|
||||||
@ -56,14 +82,15 @@ end
|
|||||||
|
|
||||||
fun media "娱乐" private \
|
fun media "娱乐" private \
|
||||||
text "media" name table imports plugin_table \
|
text "media" name table imports plugin_table \
|
||||||
text "电影" name title \
|
select "电影" values "电影" values "音乐" values "电视剧" \
|
||||||
text "" name link \
|
text "" name title \
|
||||||
|
text "" name link view long \
|
||||||
button "记下了"
|
button "记下了"
|
||||||
|
|
||||||
if $2 == "" || $3 == ""
|
if $2 == "" || $3 == "" || $4 == ""
|
||||||
copy ssh.data show _
|
copy skip ssh.data show $1 fields id type name link
|
||||||
else
|
else
|
||||||
copy ssh.data insert _ title _ link __
|
copy ssh.data insert _ type _ name _ link __
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -2,14 +2,17 @@
|
|||||||
var id
|
var id
|
||||||
return {
|
return {
|
||||||
initMap: function() {var plugin = field.Plugin
|
initMap: function() {var plugin = field.Plugin
|
||||||
var width = field.parentNode.clientWidth-40
|
|
||||||
!id && (id = plugin.id+"map"+plugin.ID())
|
!id && (id = plugin.id+"map"+plugin.ID())
|
||||||
|
|
||||||
|
var width = field.parentNode.clientWidth-40
|
||||||
kit.AppendChilds(output, [{type: "div", data: {id: id}, style: {width: width+"px", height: width*(kit.device.isMobile? 7: 3)/5}}])
|
kit.AppendChilds(output, [{type: "div", data: {id: id}, style: {width: width+"px", height: width*(kit.device.isMobile? 7: 3)/5}}])
|
||||||
|
|
||||||
map = new BMap.Map(id)
|
map = new BMap.Map(id)
|
||||||
map.addControl(new BMap.NavigationControl())
|
map.addControl(new BMap.NavigationControl())
|
||||||
map.addControl(new BMap.ScaleControl())
|
map.addControl(new BMap.ScaleControl())
|
||||||
map.addControl(new BMap.OverviewMapControl())
|
map.addControl(new BMap.OverviewMapControl())
|
||||||
map.addControl(new BMap.MapTypeControl())
|
map.addControl(new BMap.MapTypeControl())
|
||||||
|
return map
|
||||||
},
|
},
|
||||||
Current: function() {
|
Current: function() {
|
||||||
var geo = new BMap.Geolocation()
|
var geo = new BMap.Geolocation()
|
||||||
@ -34,27 +37,29 @@ return {
|
|||||||
return parseInt(value*len)/parseFloat(len)
|
return parseInt(value*len)/parseFloat(len)
|
||||||
}
|
}
|
||||||
var l = map.getCenter()
|
var l = map.getCenter()
|
||||||
run(event, [option.table.value, option.when.value, option.what.value, option.city.value, option.where.value, trunc(l.lng), trunc(l.lat), map.getZoom()], function(msg) {
|
run(event, [option.table.value, option.when.value, option.what.value, option.city.value, option.where.value,
|
||||||
|
"longitude", trunc(l.lng), "latitude", trunc(l.lat), "scale", map.getZoom()], function(msg) {
|
||||||
plugin.msg = msg, plugin.display("table")
|
plugin.msg = msg, plugin.display("table")
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
Flashs: function() {var plugin = field.Plugin
|
Flashs: function() {var plugin = field.Plugin
|
||||||
plugin.initMap(), run(event, [option.table.value], function(msg) {
|
plugin.initMap(), run(event, [option.table.value], function(msg) {
|
||||||
kit.List(ctx.Table(msg), function(line, index) {
|
kit.List(ctx.Table(msg), plugin.place, 1000)
|
||||||
var p = new BMap.Point(line.longitude, line.latitude)
|
|
||||||
map.centerAndZoom(p, line.scale)
|
|
||||||
|
|
||||||
var info = new BMap.InfoWindow(line.when+"<br/>"+line.where, {width: 200, height: 100, title: line.what})
|
|
||||||
map.openInfoWindow(info, map.getCenter())
|
|
||||||
|
|
||||||
output.style.opacity = 0
|
|
||||||
kit.Opacity(output)
|
|
||||||
}, 1000)
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
Demo: function() {
|
place: function(line) {
|
||||||
var info = new BMap.InfoWindow("hello"+"<br/>"+"world", {width: 200, height: 100, title: "haha"})
|
var p = new BMap.Point(line.longitude, line.latitude)
|
||||||
map.openInfoWindow(info, map.getCenter())
|
map.centerAndZoom(p, line.scale)
|
||||||
},
|
|
||||||
|
var info = new BMap.InfoWindow(line.when+"<br/>"+line.where, {width: 200, height: 100, title: line.what})
|
||||||
|
map.openInfoWindow(info, map.getCenter())
|
||||||
|
|
||||||
|
output.style.opacity = 0
|
||||||
|
kit.Opacity(output)
|
||||||
|
},
|
||||||
|
onexport: {"": function(value, name, line) {var plugin = field.Plugin
|
||||||
|
plugin.initMap(), plugin.place(line)
|
||||||
|
return line.id
|
||||||
|
}},
|
||||||
}}}
|
}}}
|
||||||
|
|
||||||
|
@ -20,8 +20,10 @@ var page = Page({check: true,
|
|||||||
width -= page.river.offsetWidth+page.storm.offsetWidth
|
width -= page.river.offsetWidth+page.storm.offsetWidth
|
||||||
|
|
||||||
sizes.action == -1 && (sizes.action = kit.device.isMobile? "": height, sizes.target = 0, sizes.source = 0)
|
sizes.action == -1 && (sizes.action = kit.device.isMobile? "": height, sizes.target = 0, sizes.source = 0)
|
||||||
sizes.action == undefined && (sizes.action = page.action.clientHeight)
|
sizes.action == undefined && (sizes.action = page.action.offsetHeight-page.conf.border)
|
||||||
sizes.source == undefined && (sizes.source = page.source.clientHeight)
|
sizes.source == undefined && (sizes.source = page.source.clientHeight)
|
||||||
|
sizes.target == undefined && (sizes.target = page.target.clientHeight)
|
||||||
|
sizes.source == 0 && sizes.target == 0 && (sizes.action = height)
|
||||||
page.action.Pane.Size(width, sizes.action)
|
page.action.Pane.Size(width, sizes.action)
|
||||||
page.source.Pane.Size(width, sizes.source)
|
page.source.Pane.Size(width, sizes.source)
|
||||||
height -= sizes.target==0? height: page.source.offsetHeight+page.action.offsetHeight
|
height -= sizes.target==0? height: page.source.offsetHeight+page.action.offsetHeight
|
||||||
@ -704,6 +706,6 @@ var page = Page({check: true,
|
|||||||
page.onaction[item] && page.onaction[item](event, item, value, page)
|
page.onaction[item] && page.onaction[item](event, item, value, page)
|
||||||
})
|
})
|
||||||
page.river.Pane.Show()
|
page.river.Pane.Show()
|
||||||
// page.WSS()
|
page.WSS()
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
@ -731,6 +731,19 @@ function Plugin(page, pane, field, runs) {
|
|||||||
var name = "args"+kit.Selector(option, "input.args.temp").length
|
var name = "args"+kit.Selector(option, "input.args.temp").length
|
||||||
plugin.Append({type: "text", name: name, className: "args temp"}).focus()
|
plugin.Append({type: "text", name: name, className: "args temp"}).focus()
|
||||||
},
|
},
|
||||||
|
Change: function(target, cb) {
|
||||||
|
var value = target.value
|
||||||
|
function reset(event) {
|
||||||
|
value != event.target.value && kit._call(cb, [event.target.value, value])
|
||||||
|
target.innerHTML = event.target.value
|
||||||
|
}
|
||||||
|
kit.AppendChilds(target, [{type: "input", value: target.innerText, data: {
|
||||||
|
onblur: reset,
|
||||||
|
onkeydown: function(event) {
|
||||||
|
page.oninput(event), event.key == "Enter" && reset(event)
|
||||||
|
},
|
||||||
|
}}]).last.focus()
|
||||||
|
},
|
||||||
Append: function(item, name, value) {
|
Append: function(item, name, value) {
|
||||||
kit.Item(plugin.onaction, function(k, cb) {
|
kit.Item(plugin.onaction, function(k, cb) {
|
||||||
item[k] == undefined && (item[k] = typeof cb == "function"? function(event) {
|
item[k] == undefined && (item[k] = typeof cb == "function"? function(event) {
|
||||||
@ -949,14 +962,14 @@ function Plugin(page, pane, field, runs) {
|
|||||||
inner: function(msg, cb) {
|
inner: function(msg, cb) {
|
||||||
output.style.maxWidth = pane.target.clientWidth-20+"px"
|
output.style.maxWidth = pane.target.clientWidth-20+"px"
|
||||||
output.style.maxHeight = pane.target.clientHeight-60+"px"
|
output.style.maxHeight = pane.target.clientHeight-60+"px"
|
||||||
output.innerHTML = "", msg.append? kit.OrderTable(kit.AppendTable(kit.AppendChild(output, "table"), ctx.Table(msg), msg.append), exports[1], function(event, value, name, line) {
|
output.innerHTML = "", msg.append? kit.OrderTable(kit.AppendTable(kit.AppendChild(output, "table"), ctx.Table(msg), msg.append), exports[1]||"", function(event, value, name, line) {
|
||||||
page.Sync("plugin_"+exports[0]).set(plugin.onexport[exports[2]||""](value, name, line))
|
page.Sync("plugin_"+exports[0]).set(plugin.onexport[exports[2]||""](value, name, line))
|
||||||
}): (output.innerHTML = msg.result.join(""))
|
}): (output.innerHTML = msg.result.join(""))
|
||||||
typeof cb == "function" && cb(msg)
|
typeof cb == "function" && cb(msg)
|
||||||
},
|
},
|
||||||
table: function(msg, cb) {
|
table: function(msg, cb) {
|
||||||
output.innerHTML = ""
|
output.innerHTML = ""
|
||||||
!display.hide_append && msg.append && kit.OrderTable(kit.AppendTable(kit.AppendChild(output, "table"), ctx.Table(msg), msg.append), exports[1], function(event, value, name, line) {
|
!display.hide_append && msg.append && kit.OrderTable(kit.AppendTable(kit.AppendChild(output, "table"), ctx.Table(msg), msg.append), exports[1]||"", function(event, value, name, line) {
|
||||||
page.Sync("plugin_"+exports[0]).set(plugin.onexport[exports[2]||""](value, name, line))
|
page.Sync("plugin_"+exports[0]).set(plugin.onexport[exports[2]||""](value, name, line))
|
||||||
});
|
});
|
||||||
(display.show_result || !msg.append) && msg.result && kit.OrderCode(kit.AppendChild(output, [{view: ["code", "div", msg.Results()]}]).first)
|
(display.show_result || !msg.append) && msg.result && kit.OrderCode(kit.AppendChild(output, [{view: ["code", "div", msg.Results()]}]).first)
|
||||||
@ -970,7 +983,7 @@ function Plugin(page, pane, field, runs) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
onexport: {
|
onexport: {
|
||||||
"": function(value, name) {
|
"": function(value, name, line) {
|
||||||
return value
|
return value
|
||||||
},
|
},
|
||||||
see: function(value, name, line) {
|
see: function(value, name, line) {
|
||||||
|
@ -597,6 +597,7 @@ kit = toolkit = {__proto__: document,
|
|||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
},
|
},
|
||||||
|
// HTML修改文本
|
||||||
|
|
||||||
// 数据容器迭代
|
// 数据容器迭代
|
||||||
Selector: function(obj, item, cb, interval, cbs) {
|
Selector: function(obj, item, cb, interval, cbs) {
|
||||||
@ -774,6 +775,8 @@ kit = toolkit = {__proto__: document,
|
|||||||
},
|
},
|
||||||
_call: function(cb, arg) {
|
_call: function(cb, arg) {
|
||||||
var res
|
var res
|
||||||
|
if (typeof cb != "function") {return}
|
||||||
|
|
||||||
switch (arg.length) {
|
switch (arg.length) {
|
||||||
case 0: res = cb(); break
|
case 0: res = cb(); break
|
||||||
case 1: res = cb(arg[0]); break
|
case 1: res = cb(arg[0]); break
|
||||||
|
Loading…
x
Reference in New Issue
Block a user