1
0
mirror of https://shylinux.com/x/ContextOS synced 2025-06-26 18:07:30 +08:00

add can_order

This commit is contained in:
shaoying 2019-12-10 20:18:17 +08:00
parent b105c70ed0
commit 19ea4275a4
9 changed files with 66 additions and 46 deletions

View File

@ -98,7 +98,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_frame.js", "can_proto.js", "can_order.js", "can_frame.js",
}, },
}, },
}, },

View File

@ -88,7 +88,7 @@ type Chain struct {
} }
func (b *Chain) Init(m *ctx.Message, arg ...string) Chart { func (b *Chain) Init(m *ctx.Message, arg ...string) Chart {
// 解数据 // 解数据
b.data = mis.Parse(nil, "", b.show(m, arg[0])...).(map[string]interface{}) b.data = mis.Parse(nil, "", b.show(m, arg[0])...).(map[string]interface{})
b.FontColor = kit.Select("white", arg, 1) b.FontColor = kit.Select("white", arg, 1)
b.BackGround = kit.Select("red", arg, 2) b.BackGround = kit.Select("red", arg, 2)

View File

@ -171,7 +171,7 @@ var Index = &ctx.Context{Name: "wiki", Help: "文档中心",
Commands: map[string]*ctx.Command{ Commands: map[string]*ctx.Command{
"tree": {Name: "tree", Help: "目录", Form: map[string]int{"level": 1, "class": 1}, Hand: func(m *ctx.Message, c *ctx.Context, key string, arg ...string) (e error) { "tree": {Name: "tree", Help: "目录", Form: map[string]int{"level": 1, "class": 1}, Hand: func(m *ctx.Message, c *ctx.Context, key string, arg ...string) (e error) {
m.Cmdy("nfs.dir", path.Join(m.Confx("level"), m.Confx("class", arg, 0)), m.Cmdy("nfs.dir", path.Join(m.Confx("level"), m.Confx("class", arg, 0)),
"time", "size", "line", "file", "dir_sort", "time", "time_r") "time", "size", "line", "file", "dir_sort", "time", "time_r").Set("result")
return return
}}, }},
"text": {Name: "text", Help: "文章", Form: map[string]int{"level": 1, "class": 1, "favor": 1}, Hand: func(m *ctx.Message, c *ctx.Context, key string, arg ...string) (e error) { "text": {Name: "text", Help: "文章", Form: map[string]int{"level": 1, "class": 1, "favor": 1}, Hand: func(m *ctx.Message, c *ctx.Context, key string, arg ...string) (e error) {

View File

@ -4,7 +4,7 @@ kit share "共享" public "web.chat.share" \
button "共享" button "共享"
kit note "记事本" public "_:web.wiki.note" "@you" \ kit note "记事本" public "_:web.wiki.note" "@you" \
text "miss.md" name story imports plugin_story view long action auto \ text "volcano.md" name story imports plugin_story view long action auto \
button "查看" action auto \ button "查看" action auto \
button "返回" cb Last \ button "返回" cb Last \
exports story file \ exports story file \

1
usr/librarys/can_order.js Symbolic link
View File

@ -0,0 +1 @@
../volcanos/order.js

View File

@ -220,6 +220,10 @@ var page = Page({
initRiver: function(page, field, option, output) { initRiver: function(page, field, option, output) {
return { return {
Show: function(which) {var pane = field.Pane Show: function(which) {var pane = field.Pane
if (ctx.Search("feature") != "") {
return
}
pane.Event(event, {}, {name: pane.Zone("show", page.who.get())}) pane.Event(event, {}, {name: pane.Zone("show", page.who.get())})
output.innerHTML = "", pane.Appends([], "text", ["nick", "count"], "key", which||ctx.Search("river")||true, function(event, line) { output.innerHTML = "", pane.Appends([], "text", ["nick", "count"], "key", which||ctx.Search("river")||true, function(event, line) {
page.title(line.nick) page.title(line.nick)
@ -340,10 +344,6 @@ var page = Page({
Show: function() {var pane = field.Pane Show: function() {var pane = field.Pane
if (river && storm && field.Pane.Load(river+"."+storm, output)) {return} if (river && storm && field.Pane.Load(river+"."+storm, output)) {return}
return can.Page(can, "chat", ["Action"], function(page) {
page.Action.Show(river, storm)
}, document.body)
var msg = pane.Event(event, {}, {name: pane.Zone("show", river, storm)}) var msg = pane.Event(event, {}, {name: pane.Zone("show", river, storm)})
msg.Option("you", you) msg.Option("you", you)
output.innerHTML = "", pane.Appends([river, storm], "plugin", ["name", "help"], "name", true, null, function() { output.innerHTML = "", pane.Appends([river, storm], "plugin", ["name", "help"], "name", true, null, function() {

View File

@ -178,11 +178,16 @@ fieldset.dialog.Toast {
display:none; display:none;
z-index:100; z-index:100;
} }
fieldset.dialog.Toast>div.action {
padding:0 0px;
}
fieldset.dialog.Toast>div.output { fieldset.dialog.Toast>div.output {
padding:0 10px; padding:0 10px;
} }
fieldset.dialog.Toast>div.output>div.title { fieldset.dialog.Toast>div.output>div.title {
font-size:12px; font-size:12px;
text-align:center;
color:gray;
} }
fieldset.dialog.Toast>div.output>div.content { fieldset.dialog.Toast>div.output>div.content {
word-break:break-word; word-break:break-word;
@ -194,6 +199,7 @@ fieldset.dialog.Toast>div.output>div.content {
} }
fieldset.dialog.Toast>div.output>div.tick { fieldset.dialog.Toast>div.output>div.tick {
font-size:12px; font-size:12px;
color:gray;
} }
fieldset.dialog.Carte { fieldset.dialog.Carte {
padding:0; padding:0;

View File

@ -634,7 +634,7 @@ function Pane(page, field) {
var pane = Meta(page.Zone(name), field, (page[field.dataset.init] || function() {})(page, field, option, output) || {}, { var pane = Meta(page.Zone(name), field, (page[field.dataset.init] || function() {})(page, field, option, output) || {}, {
Appends: shy("添加列表", function(cmds, type, key, which, first, cb, cbs) { Appends: shy("添加列表", function(cmds, type, key, which, first, cb, cbs) {
var list = [] var list = []
pane.Runs(event, cmds, function(line, index, msg) { pane.Runs(event||{}, cmds, function(line, index, msg) {
var ui = pane.Append(type, line, key, which, cb) var ui = pane.Append(type, line, key, which, cb)
list.push(ui) list.push(ui)
if (typeof first == "string") { if (typeof first == "string") {
@ -684,20 +684,6 @@ function Pane(page, field) {
if (type == "plugin" && line.name || type == "field") { if (type == "plugin" && line.name || type == "field") {
page.Require(line.init? line.group+"/"+line.init: "", function(init) { page.Require(line.init? line.group+"/"+line.init: "", function(init) {
page.Require(line.view? line.group+"/"+line.view: "", function(view) { page.Require(line.view? line.group+"/"+line.view: "", function(view) {
can.user.carte = page.carte.Pane.Show;
can.user.toast = page.toast.Pane.Show;
(
line.group == "docker" ||
line.group == "story" ||
line.group == "favor"
) && can.Plugin(can.action||can, ui.item.Meta, "state", function(event, cmds, cbs) {
var msg = ctx.Event(event)
kit.Selector(action, "input", function(item, index) {
item.value && msg.Option(item.name, item.value)
})
ctx.Run(event, option.dataset, [line.river, line.storm, line.action].concat(cmds), cbs)
}, ui.item) ||
pane.Plugin(page, pane, ui.item, init, function(event, cmds, cbs) { pane.Plugin(page, pane, ui.item, init, function(event, cmds, cbs) {
kit._call(cb||pane.Core, [event, line, cmds, cbs]) kit._call(cb||pane.Core, [event, line, cmds, cbs])
}) })

View File

@ -1,13 +1,10 @@
# {{title "Volcanos.js"}} # {{title "Volcanos.js"}}
volcanos是一个前端框架。 volcanos是一个前端框架通过模块化、配置化提升项目的复用性、灵活性。
通过组件化方式设计功能模块,每个模块都是一个独立完整的运行单元。
通过插件化方式加载功能模块,每个模块都有框架与输入与输出。
通过模块化方式管理模块依赖,可以动态按需加载各种模块。
{{chart "chain" ` {{chart "chain" `
chat volcanos
proto proto.js
"ID 生成器" "ID 生成器"
"Log 日志器" "Log 日志器"
"Conf 配置器" "Conf 配置器"
@ -17,23 +14,34 @@ chat
"Dream 构造器" "Dream 构造器"
"Cache 缓存器" "Cache 缓存器"
"Story 存储器" "Story 存储器"
frame.js bg blue
Page bg blue
Pane bg blue
"base 基础模块"
"core 核心模块"
"misc 工具模块"
"page 网页模块"
"user 用户模块"
Plugin bg blue
Inputs bg blue
"onimport 导入数据"
"onaction 控件交互"
"onchoice 控件菜单"
"ondetail 控件详情"
"onexport 导出数据"
Output bg blue
order.js
Header
Ocean
River
Target
Source
Action
Storm
Steam
Footer
Plugin ` "" "" 16}}
Inputs
"onimport 导入数据"
"onaction 控件交互"
"onchoice 控件菜单"
"ondetail 控件详情"
"onexport 导出数据"
Output
"base 基础模块"
"core 核心模块"
"misc 工具模块"
"page 网页模块"
"user 用户模块"
`}}
## {{chapter "原型"}} ## {{chapter "原型"}}
### {{section "ID 生成器"}} ### {{section "ID 生成器"}}
@ -47,14 +55,33 @@ chat
### {{section "Story 存储器"}} ### {{section "Story 存储器"}}
## {{chapter "框架"}} ## {{chapter "框架"}}
### {{section "Page 页面"}}
### {{section "Pane 面板"}}
### {{section "Plugin 插件"}} ### {{section "Plugin 插件"}}
### {{section "Inputs 控件"}} ### {{section "Inputs 控件"}}
### {{section "Output 组件"}} ### {{section "Output 组件"}}
## {{chapter "模块"}} ## {{chapter "核心模块"}}
### {{section "base 模块"}} ### {{section "base 模块"}}
### {{section "core 模块"}} ### {{section "core 模块"}}
### {{section "misc 模块"}} ### {{section "misc 模块"}}
### {{section "page 模块"}} ### {{section "page 模块"}}
### {{section "user 模块"}} ### {{section "user 模块"}}
## {{chapter "事件模块"}}
### {{section "onimport 模块"}}
### {{section "onaction 模块"}}
### {{section "onchoice 模块"}}
### {{section "ondetail 模块"}}
### {{section "onexport 模块"}}
## {{chapter "配置"}}
### {{section "Header"}}
### {{section "Ocean"}}
### {{section "River"}}
### {{section "Target"}}
### {{section "Source"}}
### {{section "Action"}}
### {{section "Storm"}}
### {{section "Steam"}}
### {{section "Footer"}}