diff --git a/README.md b/README.md
index 17efe8ff..1b7c085b 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
-# Volcanos.js
+# volcanos
-volcanos是一个前端框架,通过模块化、配置化提升项目的复用性、灵活性。
+volcanos是一个前端框架,通过模块化、共享化、自动化、快速的创建、共享应用程序、数据。
## 1 原型 proto.js
### 1.1 ID 生成器
@@ -20,27 +20,33 @@ volcanos是一个前端框架,通过模块化、配置化提升项目的复用
### 2.4 Inputs 控件
### 2.5 Output 组件
-## 3 核心模块 lib/
-### 3.1 base 模块
-### 3.2 core 模块
-### 3.3 misc 模块
-### 3.4 page 模块
-### 3.5 user 模块
+## 3 工具模块 lib/
+### 3.1 数据类型 base.js
+### 3.2 数据结构 core.js
+### 3.3 后端通信 misc.js
+### 3.4 网页操作 page.js
+### 3.5 用户交互 user.js
-## 4 事件模块 pane/
-### 4.1 onimport 模块
-### 4.2 onaction 模块
-### 4.3 onchoice 模块
-### 4.4 ondetail 模块
-### 4.5 onexport 模块
+## 4 网页模块 page/
+### 4.1 应用页面 index.html
+### 4.2 共享页面 share.html
-## 5 配置 order.js
-### 5.1 Header
-### 5.2 Ocean
-### 5.3 River
-### 5.4 Target
-### 5.5 Source
-### 5.6 Action
-### 5.7 Storm
-### 5.8 Steam
-### 5.9 Footer
+## 4 面板模块 pane/
+### 4.1 标题栏 Header.js
+### 4.2 用户列表 Ocean.js
+### 4.3 群组列表 River.js
+### 4.4 工作台 Action.js
+### 4.5 应用列表 Storm.js
+### 4.6 设备列表 Steam.js
+### 4.7 状态栏 Footer.js
+
+## 5 插件模块 plugin/
+### 5.1 插件模块 state.js
+### 5.2 输入模块 input.js
+### 5.3 输出模块 table.js
+### 5.4 输入插件 input/
+### 5.5 输出插件 story/
+### 5.6 其它模块 local/
+
+## 6 客户端 client/
+### 6.1 小程序 mp/
diff --git a/frame.js b/frame.js
index 443ebddf..924052c6 100644
--- a/frame.js
+++ b/frame.js
@@ -33,7 +33,7 @@ var can = Volcanos("chat", {
},
run: function(event, option, cmds, cb) {can.misc.Run(event, page, option, cmds, cb)},
- }, Config.libs.concat(["page/"+name, "page/"+topic+".css"]), function(page) {
+ }, Config.libs.concat(["page/"+name, "page/topic/"+topic+".css"]), function(page) {
// 加载配置
page.onimport._init && page.onimport._init(page, page.Conf(conf), body)
@@ -128,7 +128,7 @@ var can = Volcanos("chat", {
can.run(event, pane.option.dataset, cmds, cb)
return msg
},
- }, Config.libs.concat(["pane/"+name]), function(pane) {can.Dream(document.head, "pane/"+name+".css")
+ }, Config.libs.concat(["pane/"+(meta.path||"")+name]), function(pane) {can.Dream(document.head, "pane/"+(meta.path||"")+name+".css")
pane.onimport._init && pane.onimport._init(pane, pane.Conf(meta), pane.output, pane.action, pane.option, field)
typeof cb == "function" && cb(pane)
}, meta)
diff --git a/lib/misc.js b/lib/misc.js
index 2510194f..ec94bfdc 100644
--- a/lib/misc.js
+++ b/lib/misc.js
@@ -59,7 +59,7 @@ Volcanos("misc", {help: "工具模块",
return msg[key] = value, key
})
- msg._hand = true, can.misc.POST(can, msg, can.Conf("iceberg")+(msg.names||dataset.names||event.names||"").toLowerCase(), option, function(msg) {
+ msg._hand = true, can.misc.POST(can, msg, can.Conf("iceberg")+(msg.name||dataset.name||event.name||"").toLowerCase(), option, function(msg) {
typeof cb == "function" && cb(msg)
}), delete(event.msg)
}),
diff --git a/lib/page.js b/lib/page.js
index 599a5d40..4bbff81f 100644
--- a/lib/page.js
+++ b/lib/page.js
@@ -145,7 +145,7 @@ Volcanos("page", {help: "网页模块",
// 创建节点
name = name || data.className || type || "";
- name && (data.name = data.name || item.name);
+ !data.name && item.name && (data.name = item.name)
var node = can.page.Create(can, type, data);
value.last = node, value.first || (value.first = node), name && (value[name] = value[data.className||""] = value[type] = node);
item.list && can.page.Append(can, node, item.list, value);
@@ -196,7 +196,7 @@ Volcanos("page", {help: "网页模块",
AppendField: shy("添加插件", function(can, target, type, item) {
typeof item.help == "string" && item.help.startsWith("[") && (item.help = JSON.parse(item.help))
- var dataset = {}; item && item.name && (dataset.names = item.name);
+ var dataset = {}; item && item.name && (dataset.name = item.name);
var field = can.page.Append(can, target, [{view: [type, "fieldset"], list: [
item.pos? undefined: {text: [(item.nick||item.name||"")+"("+((typeof item.help == "string"? item.help: item.help.length > 0 && item.help[0])||"")+")", "legend"]},
{view: ["option", "form"], dataset: dataset, list: []},
diff --git a/page/index.html b/page/index.html
index 3dd95fb5..e214103c 100644
--- a/page/index.html
+++ b/page/index.html
@@ -2,16 +2,15 @@
-
volcanos
-
-
+
+
-
-
-
+
+
+
diff --git a/page/index.js b/page/index.js
index 8d7208de..dde63d82 100644
--- a/page/index.js
+++ b/page/index.js
@@ -1,37 +1,38 @@
-var Config = {iceberg: "/chat/", volcano: "/static/volcanos/",
+var Config = {iceberg: "/chat/", volcano: "",
libs: ["lib/base", "lib/core", "lib/misc", "lib/page", "lib/user"],
- main: "chat", list: ["page/chat",
- "pane/Toast", "pane/Carte",
- "pane/Debug", "pane/Tutor", "pane/Favor", "pane/Login",
+ main: "chat", list: [
+ "page/chat",
+ "pane/float/Toast", "pane/float/Carte",
+ "pane/float/Tutor", "pane/float/Debug",
+ "pane/float/Login", "pane/float/Favor",
"pane/Header",
- "pane/Ocean", "pane/River", "pane/Storm", "pane/Steam",
+ "pane/River", "pane/Storm",
"pane/Target", "pane/Source", "pane/Action",
+ "pane/Ocean", "pane/Steam",
"pane/Footer",
"plugin/state", "plugin/table", "plugin/input",
"plugin/input/date", "plugin/input/key",
], pane: [
- {group: "index", name: "Toast", pos: "dialog", duration: 3000},
- {group: "index", name: "Carte", pos: "dialog"},
- {group: "index", name: "Debug", pos: "dialog"},
- {group: "index", name: "Tutor", pos: "dialog"},
- {group: "index", name: "Favor", pos: "dialog"},
- {group: "index", name: "Login", pos: "dialog"},
+ {group: "index", name: "Toast", path: "float/", pos: "dialog", duration: 3000},
+ {group: "index", name: "Carte", path: "float/", pos: "dialog"},
+ {group: "index", name: "Tutor", path: "float/", pos: "dialog"},
+ {group: "index", name: "Debug", path: "float/", pos: "dialog"},
+ {group: "index", name: "Login", path: "float/", pos: "dialog"},
+ {group: "index", name: "Favor", path: "float/", pos: "dialog"},
- {group: "index", name: "Header", pos: "head",
- title: "github.com/shylinux/context",
- state: ["time", "user", "link"],
- },
- {group: "index", name: "Ocean", pos: "dialog", def_name: "meet"},
+ {group: "index", name: "Header", pos: "head", state: ["time", "user", "link"]},
{group: "index", name: "River", pos: "left"},
{group: "index", name: "Storm", pos: "right"},
- {group: "index", name: "Steam", pos: "dialog", def_name: "miss"},
{group: "index", name: "Target", pos: "top"},
{group: "index", name: "Source", pos: "center"},
{group: "index", name: "Action", pos: "bottom"},
- {group: "index", name: "Footer", pos: "foot", state: ["ntxt", "ncmd"], title: 'shylinux@163.com'},
+
+ {group: "index", name: "Ocean", pos: "dialog", def_name: "meet"},
+ {group: "index", name: "Steam", pos: "dialog", def_name: "miss"},
+ {group: "index", name: "Footer", pos: "foot", state: ["ntxt", "ncmd"]},
], title: "volcanos", topic: "black", layout: {def: "工作", list: ["工作", "办公", "聊天"], size: {
"最大": {head: 0, foot: 0, left: 0, right: 0, bottom: -1, center: 0, top: 0},
diff --git a/page/share.js b/page/share.js
index 251e5133..74929b4b 100644
--- a/page/share.js
+++ b/page/share.js
@@ -1,6 +1,8 @@
var Config = {iceberg: "", volcano: "/static/volcanos/",
libs: ["lib/base", "lib/core", "lib/misc", "lib/page", "lib/user"],
main: "chat", list: [
+ "pane/float/Toast", "pane/float/Carte",
+
"pane/Header",
"pane/River", "pane/Storm",
"pane/Target", "pane/Source", "pane/Action",
diff --git a/page/black.css b/page/topic/black.css
similarity index 100%
rename from page/black.css
rename to page/topic/black.css
diff --git a/page/gray.css b/page/topic/gray.css
similarity index 100%
rename from page/gray.css
rename to page/topic/gray.css
diff --git a/page/miss.css b/page/topic/miss.css
similarity index 100%
rename from page/miss.css
rename to page/topic/miss.css
diff --git a/page/miss.svg b/page/topic/miss.svg
similarity index 100%
rename from page/miss.svg
rename to page/topic/miss.svg
diff --git a/pane/Carte.css b/pane/float/Carte.css
similarity index 100%
rename from pane/Carte.css
rename to pane/float/Carte.css
diff --git a/pane/Carte.js b/pane/float/Carte.js
similarity index 100%
rename from pane/Carte.js
rename to pane/float/Carte.js
diff --git a/pane/Debug.css b/pane/float/Debug.css
similarity index 100%
rename from pane/Debug.css
rename to pane/float/Debug.css
diff --git a/pane/Debug.js b/pane/float/Debug.js
similarity index 100%
rename from pane/Debug.js
rename to pane/float/Debug.js
diff --git a/pane/Favor.css b/pane/float/Favor.css
similarity index 100%
rename from pane/Favor.css
rename to pane/float/Favor.css
diff --git a/pane/Favor.js b/pane/float/Favor.js
similarity index 100%
rename from pane/Favor.js
rename to pane/float/Favor.js
diff --git a/pane/Login.css b/pane/float/Login.css
similarity index 100%
rename from pane/Login.css
rename to pane/float/Login.css
diff --git a/pane/Login.js b/pane/float/Login.js
similarity index 100%
rename from pane/Login.js
rename to pane/float/Login.js
diff --git a/pane/Toast.css b/pane/float/Toast.css
similarity index 100%
rename from pane/Toast.css
rename to pane/float/Toast.css
diff --git a/pane/Toast.js b/pane/float/Toast.js
similarity index 100%
rename from pane/Toast.js
rename to pane/float/Toast.js
diff --git a/pane/Tutor.css b/pane/float/Tutor.css
similarity index 100%
rename from pane/Tutor.css
rename to pane/float/Tutor.css
diff --git a/pane/Tutor.js b/pane/float/Tutor.js
similarity index 100%
rename from pane/Tutor.js
rename to pane/float/Tutor.js
diff --git a/plugin/input/province.js b/plugin/input/province.js
index 6314cda2..89215f15 100644
--- a/plugin/input/province.js
+++ b/plugin/input/province.js
@@ -13,6 +13,6 @@ Volcanos("onfigure", {help: "控件详情", list: [],
});
}},
}, [
- "/plugin/github.com/shylinux/echarts/echarts.js",
- "/plugin/github.com/shylinux/echarts/china.js",
+ "plugin/github.com/shylinux/echarts/echarts.js",
+ "plugin/github.com/shylinux/echarts/china.js",
])
diff --git a/plugin/local/wiki/draw.js b/plugin/local/wiki/draw.js
index 10e775fb..b858ebf9 100644
--- a/plugin/local/wiki/draw.js
+++ b/plugin/local/wiki/draw.js
@@ -126,7 +126,7 @@ Volcanos("onimport", {help: "导入数据", list: [],
call(prefix.concat(list.list))
return can.keys = [], can.Status(event, can.keys, "keys")
},
-}, ["/plugin/local/wiki/draw.css"])
+}, ["plugin/local/wiki/draw.css"])
Volcanos("onfigure", {help: "图形绘制", list: [],
_spawn: function(sup, can) {can.sup = sup},
_swell: function(can, sub) {
@@ -483,7 +483,7 @@ Volcanos("onfigure", {help: "图形绘制", list: [],
return value.tagName + ": (" + value.points.baseVal.value + ")"
},
},
-}, Config.libs.concat(["/plugin/local/wiki/draw/heart"]))
+}, Config.libs.concat(["plugin/local/wiki/draw/heart"]))
Volcanos("onaction", {help: "组件菜单", list: ["保存", "清空", "删除", "添加",
["group", "svg"],
["font-size", 12, 16, 18, 24, 32],
diff --git a/plugin/local/wiki/walk.js b/plugin/local/wiki/walk.js
index 5183387b..1c4d1d0c 100644
--- a/plugin/local/wiki/walk.js
+++ b/plugin/local/wiki/walk.js
@@ -18,8 +18,8 @@ Volcanos("onimport", {help: "导入数据", list: [],
}
// can.page.Append(can, action, [{type: "script", src: "https://cdn.bootcss.com/echarts/4.2.0-rc.2/echarts.js"}]);
- can.page.Append(can, output, [{include: ["/plugin/github.com/shylinux/echarts/echarts.js", function(event) {
- can.page.Append(can, output, [{include: ["/plugin/github.com/shylinux/echarts/china.js", function(event) {
+ can.page.Append(can, output, [{include: ["plugin/github.com/shylinux/echarts/echarts.js", function(event) {
+ can.page.Append(can, output, [{include: ["plugin/github.com/shylinux/echarts/china.js", function(event) {
var china_chart = echarts.init(can.page.Append(can, output, [{type: "div", style: {width: "600px", height: "400px"}}]).last);
var data = msg.Table()
diff --git a/plugin/local/wiki/word.js b/plugin/local/wiki/word.js
index 432a9a87..592eabb5 100644
--- a/plugin/local/wiki/word.js
+++ b/plugin/local/wiki/word.js
@@ -34,7 +34,7 @@ Volcanos("onimport", {help: "导入数据", list: [],
})
return typeof cb == "function" && cb(msg)
},
-}, ["/plugin/local/wiki/word.css"])
+}, ["plugin/local/wiki/word.css"])
Volcanos("onfigure", {help: "图形绘制", list: [],
_spawn: function(sup, can) {can.sup = sup},
_swell: function(can, sub) {},
diff --git a/plugin/story/trend.js b/plugin/story/trend.js
index 6a30be8c..1292c08a 100644
--- a/plugin/story/trend.js
+++ b/plugin/story/trend.js
@@ -16,7 +16,7 @@ Volcanos("onimport", {help: "导入数据", list: [],
can.data = can.msg.Table()
can.page.ClassList.add(can, can.ui.total, "status")
- can.sub = can.Output(can, {}, "/plugin/wiki/draw", can.Event({}), function() {
+ can.sub = can.Output(can, {}, "/plugin/local/wiki/draw", can.Event({}), function() {
can.Action("width", 600)
can.onaction["编辑"]({}, can)
can.onaction["股价图"]({}, can)
diff --git a/proto.js b/proto.js
index 42defe97..22bdc9e9 100644
--- a/proto.js
+++ b/proto.js
@@ -76,8 +76,9 @@ function Volcanos(name, can, libs, cb, msg) { // 封装模块
}
// 加载脚本
- can.Dream(document.body, !libs[0].endsWith("/") && libs[0].indexOf(".") == -1? libs[0]+".js": libs[0], function() {
- can._load(libs[0]), can.require(libs.slice(1), cb);
+ can.Dream(libs[0].endsWith(".css")? document.head: document.body,
+ !libs[0].endsWith("/") && libs[0].indexOf(".") == -1? libs[0]+".js": libs[0], function() {
+ can._load(libs[0]), can.require(libs.slice(1), cb);
})
},
Name: function() {return can._name.toLowerCase()},