1
0
mirror of https://shylinux.com/x/ContextOS synced 2025-06-26 18:07:30 +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,7 +409,8 @@ var Index = &ctx.Context{Name: "web", Help: "应用中心",
"cert": "etc/cert.pem", "cert": "etc/cert.pem",
"key": "etc/key.pem", "key": "etc/key.pem",
"site": "", "site": "",
"index": "/chat/", // "index": "/chat/",
"index": "/static/volcanos/",
"open": []interface{}{}, "open": []interface{}{},
}, Help: "服务配置"}, }, Help: "服务配置"},
"route": &ctx.Config{Name: "route", Value: map[string]interface{}{ "route": &ctx.Config{Name: "route", Value: map[string]interface{}{

View File

@ -41,7 +41,8 @@ var Index = &ctx.Context{Name: "chat", Help: "会议中心",
"tmpl": "head", "metas": []interface{}{map[string]interface{}{ "tmpl": "head", "metas": []interface{}{map[string]interface{}{
"name": "viewport", "content": "width=device-width, initial-scale=0.7, user-scalable=no", "name": "viewport", "content": "width=device-width, initial-scale=0.7, user-scalable=no",
}}, "favicon": "favicon.ico", "styles": []interface{}{ }}, "favicon": "favicon.ico", "styles": []interface{}{
"example.css", "chat.css", // "example.css", "chat.css",
"can_style.css",
}}, }},
map[string]interface{}{"name": "toast", map[string]interface{}{"name": "toast",
"tmpl": "fieldset", "view": "Toast dialog", "init": "initToast", "tmpl": "fieldset", "view": "Toast dialog", "init": "initToast",
@ -106,7 +107,7 @@ var Index = &ctx.Context{Name: "chat", Help: "会议中心",
}, },
map[string]interface{}{"name": "tail", map[string]interface{}{"name": "tail",
"tmpl": "tail", "scripts": []interface{}{ "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", "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 return b
} }
func (b *Chain) Draw(m *ctx.Message, x, y int) Chart { 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) { func (b *Chain) show(m *ctx.Message, str string) (res []string) {
miss := []int{} miss := []int{}
@ -180,14 +180,14 @@ func (b *Chain) size(m *ctx.Message, root map[string]interface{}, depth int, wid
meta["height"] = height meta["height"] = height
return 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{}) meta := root["meta"].(map[string]interface{})
b.Width, b.Height = 0, 0 b.Width, b.Height = 0, 0
// 当前节点 // 当前节点
block := &Block{ block := &Block{
BackGround: kit.Select(b.BackGround, meta["bg"]), BackGround: kit.Select(b.BackGround, kit.Select(p.BackGround, meta["bg"])),
FontColor: kit.Select(b.FontColor, meta["fg"]), FontColor: kit.Select(b.FontColor, kit.Select(p.FontColor, meta["fg"])),
FontSize: b.FontSize, FontSize: b.FontSize,
LineSize: b.LineSize, LineSize: b.LineSize,
Padding: b.Padding, 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{}) { 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() y += kit.Int(kit.Chain(value, "meta.height")) * b.GetHeights()
}) })
return b return b

View File

@ -51,10 +51,9 @@ kit cmd "命令" private "_:context" _ _ command \
kit dir "目录" private "_:nfs.dir" _ _ time size line path \ kit dir "目录" private "_:nfs.dir" _ _ time size line path \
text "" name pod imports plugin_pod action auto \ 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 "浏览" action auto \
button "返回" cb Last \ button "返回" cb Last \
feature display editor \
exports dir "" dir exports dir "" dir
fun wss "推送" private \ fun wss "推送" private \

View File

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

View File

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

View File

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