1
0
mirror of https://shylinux.com/x/ContextOS synced 2025-04-25 16:58:06 +08:00

mov librarys

This commit is contained in:
shaoying 2019-12-12 18:34:41 +08:00
parent ea6e70ddbf
commit b2193c2d31
7 changed files with 29 additions and 17 deletions

View File

@ -409,8 +409,9 @@ var Index = &ctx.Context{Name: "web", Help: "应用中心",
"cert": "etc/cert.pem",
"key": "etc/key.pem",
"site": "",
"index": "/chat/",
"open": []interface{}{},
// "index": "/chat/",
"index": "/static/volcanos/",
"open": []interface{}{},
}, Help: "服务配置"},
"route": &ctx.Config{Name: "route", Value: map[string]interface{}{
"index": "/render",

View File

@ -41,7 +41,8 @@ var Index = &ctx.Context{Name: "chat", Help: "会议中心",
"tmpl": "head", "metas": []interface{}{map[string]interface{}{
"name": "viewport", "content": "width=device-width, initial-scale=0.7, user-scalable=no",
}}, "favicon": "favicon.ico", "styles": []interface{}{
"example.css", "chat.css",
// "example.css", "chat.css",
"can_style.css",
}},
map[string]interface{}{"name": "toast",
"tmpl": "fieldset", "view": "Toast dialog", "init": "initToast",
@ -106,7 +107,7 @@ var Index = &ctx.Context{Name: "chat", Help: "会议中心",
},
map[string]interface{}{"name": "tail",
"tmpl": "tail", "scripts": []interface{}{
"toolkit.js", "context.js", "example.js", "chat.js",
// "toolkit.js", "context.js", "example.js", "chat.js",
"can_proto.js", "can_order.js", "can_frame.js",
},
},

View File

@ -110,7 +110,7 @@ func (b *Chain) Init(m *ctx.Message, arg ...string) Chart {
return b
}
func (b *Chain) Draw(m *ctx.Message, x, y int) Chart {
return b.draw(m, b.data, 0, b.max, x, y)
return b.draw(m, b.data, 0, b.max, x, y, &Block{})
}
func (b *Chain) show(m *ctx.Message, str string) (res []string) {
miss := []int{}
@ -180,14 +180,14 @@ func (b *Chain) size(m *ctx.Message, root map[string]interface{}, depth int, wid
meta["height"] = height
return height
}
func (b *Chain) draw(m *ctx.Message, root map[string]interface{}, depth int, width map[int]int, x int, y int) Chart {
func (b *Chain) draw(m *ctx.Message, root map[string]interface{}, depth int, width map[int]int, x, y int, p *Block) Chart {
meta := root["meta"].(map[string]interface{})
b.Width, b.Height = 0, 0
// 当前节点
block := &Block{
BackGround: kit.Select(b.BackGround, meta["bg"]),
FontColor: kit.Select(b.FontColor, meta["fg"]),
BackGround: kit.Select(b.BackGround, kit.Select(p.BackGround, meta["bg"])),
FontColor: kit.Select(b.FontColor, kit.Select(p.FontColor, meta["fg"])),
FontSize: b.FontSize,
LineSize: b.LineSize,
Padding: b.Padding,
@ -200,7 +200,7 @@ func (b *Chain) draw(m *ctx.Message, root map[string]interface{}, depth int, wid
// 递归节点
kit.Map(root["list"], "", func(index int, value map[string]interface{}) {
b.draw(m, value, depth+1, width, x+b.GetWidths(strings.Repeat(" ", width[depth])), y)
b.draw(m, value, depth+1, width, x+b.GetWidths(strings.Repeat(" ", width[depth])), y, block)
y += kit.Int(kit.Chain(value, "meta.height")) * b.GetHeights()
})
return b

View File

@ -51,10 +51,9 @@ kit cmd "命令" private "_:context" _ _ command \
kit dir "目录" private "_:nfs.dir" _ _ time size line path \
text "" name pod imports plugin_pod action auto \
text "usr/local" name dir imports plugin_dir action auto view long \
text "usr/local" name path action auto view long \
button "浏览" action auto \
button "返回" cb Last \
feature display editor \
exports dir "" dir
fun wss "推送" private \

View File

@ -193,7 +193,7 @@ fieldset.dialog.Favor div.output {
white-space:pre;
max-height: 200px;
overflow:auto;
width:400px;
width:383px;
}
fieldset.dialog.Toast {

View File

@ -136,6 +136,7 @@ function Page(page) {
var script = {}, record = ""
page = Meta([document.title], document.body, page, {check: true,
onload: function(event) {
if (ctx.Search("feature") != "") {return}
// Event入口 0
if (page.Event(event, {}) && page.check && !ctx.Cookie("sessid")) {
// 用户登录
@ -154,8 +155,6 @@ function Page(page) {
page.Status()
}
if (ctx.Search("feature") != "") {return}
// 事件回调
document.body.onkeydown = function(event) {
// page.oncontrol(event) || page.onscroll(event)

View File

@ -15,21 +15,26 @@ volcanos
"Cache 缓存器"
"Story 存储器"
frame.js bg blue
Page bg blue
Page
Pane bg blue
"base 基础模块"
"core 核心模块"
"misc 工具模块"
"page 网页模块"
"user 用户模块"
Plugin bg blue
Plugin bg red
"state.js"
"input.js"
"table.js"
"inner.js"
"media.js"
Inputs bg blue
"onimport 导入数据"
"onaction 控件交互"
"onchoice 控件菜单"
"ondetail 控件详情"
"onexport 导出数据"
Output bg blue
Output
order.js
Header
Ocean
@ -75,6 +80,13 @@ volcanos
### {{section "ondetail 模块"}}
### {{section "onexport 模块"}}
## {{chapter "插件模块 plugin/"}}
### {{section "state.js 模块"}}
### {{section "input.js 模块"}}
### {{section "table.js 模块"}}
### {{section "inner.js 模块"}}
### {{section "media.js 模块"}}
## {{chapter "配置 order.js"}}
### {{section "Header"}}
### {{section "Ocean"}}