mirror of
https://shylinux.com/x/volcanos
synced 2025-04-25 16:58:06 +08:00
add mall/goods.js
This commit is contained in:
parent
56d7ecc7ad
commit
a123b51e68
18
const.js
18
const.js
@ -55,6 +55,7 @@ var ctx = {
|
|||||||
var mdb = {FOREACH: "*", RANDOMS: "%",
|
var mdb = {FOREACH: "*", RANDOMS: "%",
|
||||||
DICT: "dict", META: "meta", HASH: "hash", LIST: "list",
|
DICT: "dict", META: "meta", HASH: "hash", LIST: "list",
|
||||||
ID: "id", KEY: "key", TIME: "time", ZONE: "zone", TYPE: "type", NAME: "name", TEXT: "text", DATA: "data", VIEW: "view",
|
ID: "id", KEY: "key", TIME: "time", ZONE: "zone", TYPE: "type", NAME: "name", TEXT: "text", DATA: "data", VIEW: "view",
|
||||||
|
STATUS: "status",
|
||||||
LINK: "link", SCAN: "scan", HELP: "help", ICON: "icon", ICONS: "icons",
|
LINK: "link", SCAN: "scan", HELP: "help", ICON: "icon", ICONS: "icons",
|
||||||
INDEX: "index", VALUE: "value", EXTRA: "extra", ALIAS: "alias", EXPIRE: "expire",
|
INDEX: "index", VALUE: "value", EXTRA: "extra", ALIAS: "alias", EXPIRE: "expire",
|
||||||
SHORT: "short", FIELD: "field", TOTAL: "total", COUNT: "count", LIMIT: "limit",
|
SHORT: "short", FIELD: "field", TOTAL: "total", COUNT: "count", LIMIT: "limit",
|
||||||
@ -70,6 +71,7 @@ var mdb = {FOREACH: "*", RANDOMS: "%",
|
|||||||
}
|
}
|
||||||
var web = {CHAT: "chat", PORTAL: "portal", STUDIO: "studio", SERVICE: "service",
|
var web = {CHAT: "chat", PORTAL: "portal", STUDIO: "studio", SERVICE: "service",
|
||||||
SPIDE: "spide", SPACE: "space", ROUTE: "route", DREAM: "dream",
|
SPIDE: "spide", SPACE: "space", ROUTE: "route", DREAM: "dream",
|
||||||
|
DOMAIN: "domain",
|
||||||
SHARE: "share", COUNT: "count",
|
SHARE: "share", COUNT: "count",
|
||||||
WORKER: "worker", SERVER: "server", GATEWAY: "gateway",
|
WORKER: "worker", SERVER: "server", GATEWAY: "gateway",
|
||||||
OPEN: "open", LINK: "link", HTTP: "http", URL: "url", SHARE_CACHE: "/share/cache/", SHARE_LOCAL: "/share/local/",
|
OPEN: "open", LINK: "link", HTTP: "http", URL: "url", SHARE_CACHE: "/share/cache/", SHARE_LOCAL: "/share/local/",
|
||||||
@ -94,11 +96,13 @@ var web = {CHAT: "chat", PORTAL: "portal", STUDIO: "studio", SERVICE: "service",
|
|||||||
CHAT_FAVOR: "web.chat.favor",
|
CHAT_FAVOR: "web.chat.favor",
|
||||||
CHAT_FLOWS: "web.chat.flows",
|
CHAT_FLOWS: "web.chat.flows",
|
||||||
TEAM_PLAN: "web.team.plan",
|
TEAM_PLAN: "web.team.plan",
|
||||||
|
MALL_GOODS: "web.mall.goods",
|
||||||
}
|
}
|
||||||
var aaa = {
|
var aaa = {
|
||||||
LOGIN: "login", LOGOUT: "logout",
|
LOGIN: "login", LOGOUT: "logout",
|
||||||
USER: "user", AUTH: "auth", SESS: "sess",
|
USER: "user", AUTH: "auth", SESS: "sess", ROLE: "role",
|
||||||
USERNICK: "usernick", USERNAME: "username", PASSWORD: "password", USERROLE: "userrole",
|
USERNICK: "usernick", USERNAME: "username", PASSWORD: "password", USERROLE: "userrole",
|
||||||
|
USERZONE: "userzone",
|
||||||
EMAIL: "email", AVATAR: "avatar", BACKGROUND: "background",
|
EMAIL: "email", AVATAR: "avatar", BACKGROUND: "background",
|
||||||
LANGUAGE: "language", ENGLISH: "english", CHINESE: "chinese",
|
LANGUAGE: "language", ENGLISH: "english", CHINESE: "chinese",
|
||||||
VOID: "void", TECH: "tech", ROOT: "root",
|
VOID: "void", TECH: "tech", ROOT: "root",
|
||||||
@ -118,14 +122,21 @@ var gdb = {
|
|||||||
SIGNAL: "signal",
|
SIGNAL: "signal",
|
||||||
}
|
}
|
||||||
var tcp = {
|
var tcp = {
|
||||||
HOST: "host", PORT: "port",
|
|
||||||
CLIENT: "client", SERVER: "server",
|
CLIENT: "client", SERVER: "server",
|
||||||
|
PROTO: "proto", HOST: "host", PORT: "port",
|
||||||
|
HOSTNAME: "hostname",
|
||||||
|
SERVICE: "service",
|
||||||
}
|
}
|
||||||
var nfs = {
|
var nfs = {
|
||||||
DIR: "dir", CAT: "cat", DEFS: "defs", PACK: "pack", TRASH: "trash", DIR_ROOT: "dir_root",
|
DIR: "dir", CAT: "cat", DEFS: "defs", PACK: "pack", TRASH: "trash", DIR_ROOT: "dir_root",
|
||||||
COPY: "copy", EDIT: "edit", SAVE: "save", LOAD: "load", FIND: "find", GREP: "grep", TAGS: "tags",
|
COPY: "copy", EDIT: "edit", SAVE: "save", LOAD: "load", FIND: "find", GREP: "grep", TAGS: "tags",
|
||||||
SUBJECT: "subject", CONTENT: "content", RECENT: "recent", SCRIPT: "script", SOURCE: "source", TARGET: "target",
|
SUBJECT: "subject", CONTENT: "content", RECENT: "recent", SCRIPT: "script", SOURCE: "source", TARGET: "target",
|
||||||
REPOS: "repos", MASTER: "master", MODULE: "module", PUSH: "push", PULL: "pull",
|
REPOS: "repos",
|
||||||
|
IMAGE: "image",
|
||||||
|
MODULE: "module", SCRIPT: "script",
|
||||||
|
VERSION: "version",
|
||||||
|
BRANCH: "branch", MASTER: "master",
|
||||||
|
PUSH: "push", PULL: "pull",
|
||||||
PATH: "path", FILE: "file", LINE: "line", SIZE: "size",
|
PATH: "path", FILE: "file", LINE: "line", SIZE: "size",
|
||||||
REPLACE: "replace", FROM: "from", TO: "to",
|
REPLACE: "replace", FROM: "from", TO: "to",
|
||||||
SVG: "svg", HTML: "html", CSS: "css", JS: "js", SH: "sh", GO: "go", CSV: "csv", JSON: "json", SHY: "shy",
|
SVG: "svg", HTML: "html", CSS: "css", JS: "js", SH: "sh", GO: "go", CSV: "csv", JSON: "json", SHY: "shy",
|
||||||
@ -226,6 +237,7 @@ var team = {
|
|||||||
var mall = {
|
var mall = {
|
||||||
COUNT: "count", PRICE: "price",
|
COUNT: "count", PRICE: "price",
|
||||||
ASSET: "asset", SALARY: "salary",
|
ASSET: "asset", SALARY: "salary",
|
||||||
|
GOODS: "goods",
|
||||||
}
|
}
|
||||||
|
|
||||||
var http = {
|
var http = {
|
||||||
|
76
frame.js
76
frame.js
@ -99,27 +99,29 @@ Volcanos(chat.ONDAEMON, {_init: function(can, name) { if (can.user.isLocalFile)
|
|||||||
})
|
})
|
||||||
Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
||||||
meta.index && (meta.name = meta.index), meta.name = can.core.Split(meta.name||"", "\t .\n").pop()||can.Conf(mdb.NAME)
|
meta.index && (meta.name = meta.index), meta.name = can.core.Split(meta.name||"", "\t .\n").pop()||can.Conf(mdb.NAME)
|
||||||
field = field||can.onappend.field(can, meta.type, meta, target)._target
|
field = field||can.onappend.field(can, meta.type, meta, target)._target, can.isCmdMode() && can.onmotion.hidden(can, field)
|
||||||
var legend = can.page.SelectOne(can, field, html.LEGEND)
|
var legend = can.page.SelectOne(can, field, html.LEGEND); legend.innerHTML = legend.innerHTML || meta.index
|
||||||
var option = can.page.SelectOne(can, field, html.FORM_OPTION)
|
var option = can.page.SelectOne(can, field, html.FORM_OPTION)
|
||||||
var action = can.page.SelectOne(can, field, html.DIV_ACTION)
|
var action = can.page.SelectOne(can, field, html.DIV_ACTION)
|
||||||
var output = can.page.SelectOne(can, field, html.DIV_OUTPUT)
|
var output = can.page.SelectOne(can, field, html.DIV_OUTPUT)
|
||||||
var status = can.page.SelectOne(can, field, html.DIV_STATUS)
|
var status = can.page.SelectOne(can, field, html.DIV_STATUS)
|
||||||
legend.innerHTML = legend.innerHTML || meta.index
|
|
||||||
(can.base.isIn(meta.index, web.WIKI_PORTAL) || meta.style == html.OUTPUT) && can.onappend.style(can, html.OUTPUT, field)
|
|
||||||
var sub = Volcanos(meta.name, {_root: can._root||can, _follow: can.core.Keys(can._follow, meta.name), _target: field,
|
var sub = Volcanos(meta.name, {_root: can._root||can, _follow: can.core.Keys(can._follow, meta.name), _target: field,
|
||||||
_legend: legend, _option: option, _action: action, _output: output, _status: status, _history: [],
|
_legend: legend, _option: option, _action: action, _output: output, _status: status, _history: [],
|
||||||
Status: function(key, value) { if (can.base.isObject(key)) { return can.core.Item(key, sub.Status), key } try {
|
Status: function(key, value) { if (can.base.isObject(key)) { return can.core.Item(key, sub.Status), key } try {
|
||||||
can.page.Select(can, status, [[[html.SPAN, key]]], function(target) {
|
can.page.Select(can, status, [[[html.SPAN, key]]], function(target) {
|
||||||
|
if (key == web.SPACE && value) { value = can.page.Format(html.A, can.misc.MergePodCmd(can, {pod: value}), value) }
|
||||||
if (can.base.beginWith(value, nfs.PS, ice.HTTP)) { value = can.page.Format(html.A, value) }
|
if (can.base.beginWith(value, nfs.PS, ice.HTTP)) { value = can.page.Format(html.A, value) }
|
||||||
return can.base.isUndefined(value)? (value = target.innerHTML): (target.innerHTML = value.trim? value.trim(): value+"")
|
return can.base.isUndefined(value)? (value = target.innerHTML): (target.innerHTML = value.trim? value.trim(): value+"")
|
||||||
}); return value
|
}); return value
|
||||||
} catch {} },
|
} catch {} },
|
||||||
Action: function(key, value) {
|
Action: function(key, value) {
|
||||||
key && value && can.misc.sessionStorage(can, [sub.ConfIndex(), ctx.ACTION, key], value)
|
key && value && can.misc.sessionStorage(can, [sub.ConfIndex(), ctx.ACTION, key], value)
|
||||||
|
value && (value = can.user.trans(sub, value, null, html.INPUT))
|
||||||
return can.page.SelectArgs(can, action, key, value)[0]
|
return can.page.SelectArgs(can, action, key, value)[0]
|
||||||
},
|
},
|
||||||
Option: function(key, value) { return can.page.SelectArgs(can, option, key, value)[0] },
|
Option: function(key, value) {
|
||||||
|
value && (value = can.user.trans(sub, value, null, html.INPUT))
|
||||||
|
return can.page.SelectArgs(can, option, key, value)[0] },
|
||||||
Update: function(event, cmds, cb, silent) { sub.request(event)._caller(), sub.onappend._output0(sub, sub.Conf(), event||{}, cmds||sub.Input([], !silent), cb, silent); return true },
|
Update: function(event, cmds, cb, silent) { sub.request(event)._caller(), sub.onappend._output0(sub, sub.Conf(), event||{}, cmds||sub.Input([], !silent), cb, silent); return true },
|
||||||
Focus: function() { can.page.SelectOne(can, option, html.INPUT_ARGS, function(target) { target.focus() }) },
|
Focus: function() { can.page.SelectOne(can, option, html.INPUT_ARGS, function(target) { target.focus() }) },
|
||||||
Input: function(cmds, save) { cmds = cmds && cmds.length > 0? cmds: can.page.SelectArgs(sub), cmds && cmds[0] != ctx.ACTION && (cmds = can.base.trim(cmds))
|
Input: function(cmds, save) { cmds = cmds && cmds.length > 0? cmds: can.page.SelectArgs(sub), cmds && cmds[0] != ctx.ACTION && (cmds = can.base.trim(cmds))
|
||||||
@ -237,6 +239,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
|||||||
sub.db.hash = can.isCmdMode()? can.misc.SearchHash(can): []
|
sub.db.hash = can.isCmdMode()? can.misc.SearchHash(can): []
|
||||||
can.page.requireModules(can, can.Conf("modules"), function() { if (sub.Mode() != "result") { can.onmotion.clear(can, output) }
|
can.page.requireModules(can, can.Conf("modules"), function() { if (sub.Mode() != "result") { can.onmotion.clear(can, output) }
|
||||||
can.core.CallFunc([sub, chat.ONIMPORT, chat._INIT], {can: sub, msg: msg, cb: function(msg) {
|
can.core.CallFunc([sub, chat.ONIMPORT, chat._INIT], {can: sub, msg: msg, cb: function(msg) {
|
||||||
|
can.onmotion.toggle(can, can._target, true)
|
||||||
if (action !== false) { can.onkeymap._build(sub)
|
if (action !== false) { can.onkeymap._build(sub)
|
||||||
can.onmotion.clear(can, can._action), sub.onappend._action(sub, can.Conf(ice.MSG_ACTION)||msg.Option(ice.MSG_ACTION), action||can._action)
|
can.onmotion.clear(can, can._action), sub.onappend._action(sub, can.Conf(ice.MSG_ACTION)||msg.Option(ice.MSG_ACTION), action||can._action)
|
||||||
sub.onappend._status(sub, sub.onexport&&sub.onexport.list||msg.Option(ice.MSG_STATUS)), can.user.isMobile || sub.onappend.tools(sub, msg)
|
sub.onappend._status(sub, sub.onexport&&sub.onexport.list||msg.Option(ice.MSG_STATUS)), can.user.isMobile || sub.onappend.tools(sub, msg)
|
||||||
@ -256,10 +259,11 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
|||||||
_status: function(can, list, status) { status = status||can._status, can.onmotion.clear(can, status)
|
_status: function(can, list, status) { status = status||can._status, can.onmotion.clear(can, status)
|
||||||
var keys = {}
|
var keys = {}
|
||||||
can.core.List(can.base.Obj(list, can.core.Value(can, [chat.ONEXPORT, mdb.LIST])), function(item) { item = can.base.isString(item)? {name: item}: item
|
can.core.List(can.base.Obj(list, can.core.Value(can, [chat.ONEXPORT, mdb.LIST])), function(item) { item = can.base.isString(item)? {name: item}: item
|
||||||
|
if (item.name == web.SPACE && item.value) { item.value = can.page.Format(html.A, can.misc.MergePodCmd(can, {pod: item.value}), item.value) }
|
||||||
if (can.base.beginWith(item.value, nfs.PS, ice.HTTP)) { item.value = can.page.Format(html.A, item.value, item.value.split("?")[0]) }
|
if (can.base.beginWith(item.value, nfs.PS, ice.HTTP)) { item.value = can.page.Format(html.A, item.value, item.value.split("?")[0]) }
|
||||||
if (keys[item.name]) { return can.Status(item.name, item.value) } keys[item.name] = item
|
if (keys[item.name]) { return can.Status(item.name, item.value) } keys[item.name] = item
|
||||||
can.page.Append(can, status, [{view: html.ITEM, list: [
|
can.page.Append(can, status, [{view: html.ITEM, list: [
|
||||||
{text: [can.page.Color(item.name), html.LABEL]}, {text: [": ", html.LABEL]}, {text: [(item.value == undefined? "": item.value.trim())+"", html.SPAN, item.name]},
|
{text: [can.page.Color(can.user.trans(can, item.name, null, html.INPUT)), html.LABEL]}, {text: [": ", html.LABEL]}, {text: [(item.value == undefined? "": item.value.trim())+"", html.SPAN, item.name]},
|
||||||
], onclick: function(event) { can.user.copy(event, can, item.value) }}])
|
], onclick: function(event) { can.user.copy(event, can, item.value) }}])
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@ -274,19 +278,32 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
|||||||
},
|
},
|
||||||
input: function(can, item, value, target, style) { if ([html.BR, html.HR].indexOf(item.type) > -1) { return can.page.Append(can, target, [item]) }
|
input: function(can, item, value, target, style) { if ([html.BR, html.HR].indexOf(item.type) > -1) { return can.page.Append(can, target, [item]) }
|
||||||
var icon = [], _item = can.base.Copy({className: "", type: "", name: ""}, item), input = can.page.input(can, _item, value)
|
var icon = [], _item = can.base.Copy({className: "", type: "", name: ""}, item), input = can.page.input(can, _item, value)
|
||||||
|
if (item.type == html.SELECT) { can.core.List(input.list, function(item) { item.inner = can.user.trans(can, item.inner, null, html.INPUT) }) }
|
||||||
if (item.type == html.BUTTON && !input.value) { input.value = can.user.trans(can, item.name) }
|
if (item.type == html.BUTTON && !input.value) { input.value = can.user.trans(can, item.name) }
|
||||||
if (item.type == html.TEXT) { input.onfocus = input.onfocus||function(event) { can.onmotion.selectRange(event.target) }
|
if (item.type == html.TEXT) {
|
||||||
|
input.placeholder = can.user.trans(can, input.placeholder||input.name, null, html.INPUT)
|
||||||
|
input.title = can.user.trans(can, input.title||input.placeholder||input.name, null, html.INPUT)
|
||||||
input.onkeydown = item.onkeydown||function(event) { if (event.key == code.ENTER) { return can.Update(), can.onkeymap.prevent(event) }
|
input.onkeydown = item.onkeydown||function(event) { if (event.key == code.ENTER) { return can.Update(), can.onkeymap.prevent(event) }
|
||||||
can.onkeymap.input(event, can), can.onkeymap.selectOutput(event, can)
|
can.onkeymap.input(event, can), can.onkeymap.selectOutput(event, can)
|
||||||
}
|
}
|
||||||
input.onkeyup = item.onkeyup||function(event) { if (item.name == html.FILTER) { can.user.toast(can, "filter out "+can.page.Select(can, can._output, html.TR, function(tr, index) {
|
input.onkeyup = item.onkeyup||function(event) { if (item.name == html.FILTER) {
|
||||||
if (!can.page.ClassList.set(can, tr, html.HIDE, index > 0 && tr.innerText.indexOf(event.target.value) == -1)) { return tr }
|
can.onmotion.delayOnce(can, function() {
|
||||||
}).length+" lines") } }, icon.push({icon: mdb.DELETE, onclick: function(event) { _input.value = "", input.onkeyup({target: event.target.previousSibling}) }})
|
var count = can.page.Select(can, can._output, html.TR, function(tr, index) {
|
||||||
|
if (!can.page.ClassList.set(can, tr, html.HIDE, index > 0 && tr.innerText.indexOf(event.target.value) == -1)) { return tr }
|
||||||
|
}).length
|
||||||
|
count += can.page.SelectChild(can, can.ui.content||can._output, html.DIV_ITEM, function(target) {
|
||||||
|
if (!can.page.ClassList.set(can, target, html.HIDE, target.innerText.indexOf(event.target.value) == -1)) { return target }
|
||||||
|
}).length
|
||||||
|
can.user.toast(can, "filter out "+count+" lines")
|
||||||
|
}, 1000)
|
||||||
|
|
||||||
|
} }, icon.push({icon: mdb.DELETE, onclick: function(event) { _input.value = "", input.onkeyup({target: event.target.previousSibling}) }})
|
||||||
} if (item.range) { input._init = function(target) { can.onappend.figure(can, item, target, function(sub, value, old) { target.value = value, can.core.CallFunc([can.onaction, item.name], [event, can, item.name]) }) } }
|
} if (item.range) { input._init = function(target) { can.onappend.figure(can, item, target, function(sub, value, old) { target.value = value, can.core.CallFunc([can.onaction, item.name], [event, can, item.name]) }) } }
|
||||||
var _style = can.page.buttonStyle(can, item.name)
|
var _style = can.page.buttonStyle(can, item.name)
|
||||||
var _input = can.page.Append(can, target, [{view: [[html.ITEM].concat(style, [item.type, item.name], _style)], list: [item.icon && {icon: item.icon}, input].concat(icon), _init: function(target, _input) {
|
var _input = can.page.Append(can, target, [{view: [[html.ITEM].concat(style, [item.type, item.name], _style)], list: [item.icon && {icon: item.icon}, input].concat(icon), _init: function(target, _input) {
|
||||||
if (item.type == html.SELECT) {
|
if (item.type == html.SELECT) {
|
||||||
_input.select.value = value||_item.value||_item.values[0], can.onappend.select(can, _input.select, _item)
|
_input.select.value = value||_item.value||_item.values[0]
|
||||||
|
can.onappend.select(can, _input.select, _item)
|
||||||
can.onappend.style(can, html.BUTTON, target)
|
can.onappend.style(can, html.BUTTON, target)
|
||||||
}
|
}
|
||||||
item.style && can.onappend.style(can, item.style, target)
|
item.style && can.onappend.style(can, item.style, target)
|
||||||
@ -315,9 +332,10 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
select: function(can, select, item) { // can.user.trans(can, item.value||item.values[0])
|
select: function(can, select, item) { // can.user.trans(can, item.value||item.values[0])
|
||||||
return can.page.Append(can, select.parentNode, [{type: html.INPUT, data: {className: html.SELECT, type: html.BUTTON, name: item.name, value: item.value||item.values[0], title: item.name}, onclick: function(event) { var target = event.target
|
var trans = {}; can.core.List(item.values, function(value) { trans[can.user.trans(can, value, null, html.INPUT)] = value })
|
||||||
var carte = can.user.carte(event, can, {}, item.values, function(event, button) { carte.close()
|
return can.page.Append(can, select.parentNode, [{type: html.INPUT, data: {className: html.SELECT, type: html.BUTTON, name: item.name, value: can.user.trans(can, item.value||item.values[0], null, html.INPUT), title: can.user.trans(can, item.name, null, html.INPUT)}, onclick: function(event) { var target = event.target
|
||||||
if (target.value != button) { target.value = button, select.value = button, select.onchange && select.onchange({target: select}) }
|
var carte = can.user.carte(event, can, {}, can.core.List(item.values, function(item) { return can.user.trans(can, item, null, html.INPUT) }), function(event, button) { carte.close()
|
||||||
|
if (target.value != button) { target.value = button, select.value = trans[button], select.onchange && select.onchange({target: select}) }
|
||||||
return true
|
return true
|
||||||
}); can.onappend.style(can, [html.SELECT, item.name], carte._target), can.page.style(can, carte._target, html.MIN_WIDTH, event.target.offsetWidth)
|
}); can.onappend.style(can, [html.SELECT, item.name], carte._target), can.page.style(can, carte._target, html.MIN_WIDTH, event.target.offsetWidth)
|
||||||
}, _init: function(target) { can.page.style(can, target, html.WIDTH, (select.offsetWidth||80)+10), can.onappend.style(can, html.HIDE, select) }}, {icon: mdb.SELECT}])
|
}, _init: function(target) { can.page.style(can, target, html.WIDTH, (select.offsetWidth||80)+10), can.onappend.style(can, html.HIDE, select) }}, {icon: mdb.SELECT}])
|
||||||
@ -327,6 +345,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
|||||||
var table = can.page.AppendTable(can, msg, target||can._output, msg.append, cb||function(value, key, index, data, list) {
|
var table = can.page.AppendTable(can, msg, target||can._output, msg.append, cb||function(value, key, index, data, list) {
|
||||||
if (msg.append.length == 2 && msg.append[0] == mdb.KEY && msg.append[1] == mdb.VALUE) { if (key == mdb.VALUE) { key = data.key } data = {}, can.core.List(list, function(item) { data[item.key] = item.value }) }
|
if (msg.append.length == 2 && msg.append[0] == mdb.KEY && msg.append[1] == mdb.VALUE) { if (key == mdb.VALUE) { key = data.key } data = {}, can.core.List(list, function(item) { data[item.key] = item.value }) }
|
||||||
function run(event, cmd, arg) { can.misc.Event(event, can, function(msg) { can.run(can.request(event, data, can.Option()), [ctx.ACTION, cmd].concat(arg)) }) }
|
function run(event, cmd, arg) { can.misc.Event(event, can, function(msg) { can.run(can.request(event, data, can.Option()), [ctx.ACTION, cmd].concat(arg)) }) }
|
||||||
|
if (key == web.SPACE && value) { value = can.page.Format(html.A, can.misc.MergePodCmd(can, {pod: value}), value) }
|
||||||
return {text: [value, html.TD], onclick: function(event) { var target = event.target
|
return {text: [value, html.TD], onclick: function(event) { var target = event.target
|
||||||
if (can.page.tagis(target, html.INPUT) && target.type == html.BUTTON) { can.requestAction(event, target.name)
|
if (can.page.tagis(target, html.INPUT) && target.type == html.BUTTON) { can.requestAction(event, target.name)
|
||||||
meta && meta[target.name]? can.user.input(event, can, meta[target.name], function(args) { run(event, target.name, args) }): run(event, target.name)
|
meta && meta[target.name]? can.user.input(event, can, meta[target.name], function(args) { run(event, target.name, args) }): run(event, target.name)
|
||||||
@ -492,7 +511,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
|||||||
function _cb(sub, value, old) { if (value == old) { return } target.value = value, can.base.isFunc(cb) && cb(sub, value, old) }
|
function _cb(sub, value, old) { if (value == old) { return } target.value = value, can.base.isFunc(cb) && cb(sub, value, old) }
|
||||||
target.onkeydown = function() { if (event.key == code.ESCAPE && target._can) { return target._can.close(), target.blur() } else if (event.key == code.ENTER) { can.base.isFunc(cb) && cb(event, target.value) } }
|
target.onkeydown = function() { if (event.key == code.ESCAPE && target._can) { return target._can.close(), target.blur() } else if (event.key == code.ENTER) { can.base.isFunc(cb) && cb(event, target.value) } }
|
||||||
can.core.ItemCB(can.onfigure[input], function(key, on) { var last = target[key]||function() { }; target[key] = function(event) { can.misc.Event(event, can, function(msg) {
|
can.core.ItemCB(can.onfigure[input], function(key, on) { var last = target[key]||function() { }; target[key] = function(event) { can.misc.Event(event, can, function(msg) {
|
||||||
function show(sub, cb) { can.base.isFunc(cb) && cb(sub, _cb), can.onlayout.figure(event, can, sub._target), can.onmotion.toggle(can, sub._target, true) }
|
function show(sub, cb) { can.base.isFunc(cb) && cb(sub, _cb), can.onlayout._figure(event, can, sub._target), can.onmotion.toggle(can, sub._target, true) }
|
||||||
can.core.CallFunc(on, {event: event, can: can, meta: meta, cb: _cb, target: target, sub: target._can, last: last, cbs: function(cb) {
|
can.core.CallFunc(on, {event: event, can: can, meta: meta, cb: _cb, target: target, sub: target._can, last: last, cbs: function(cb) {
|
||||||
target._can? show(target._can, cb): can.onappend._init(can, {type: html.INPUT, name: input, style: meta.name, mode: chat.FLOAT}, [path], function(sub) { sub.Conf(meta)
|
target._can? show(target._can, cb): can.onappend._init(can, {type: html.INPUT, name: input, style: meta.name, mode: chat.FLOAT}, [path], function(sub) { sub.Conf(meta)
|
||||||
sub.run = function(event, cmds, cb) { var msg = sub.request(event)
|
sub.run = function(event, cmds, cb) { var msg = sub.request(event)
|
||||||
@ -500,8 +519,9 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
|||||||
(meta.run||can.run)(sub.request(event, can.Option()), cmds, cb, true)
|
(meta.run||can.run)(sub.request(event, can.Option()), cmds, cb, true)
|
||||||
}, target._can = sub, can.base.Copy(sub, can.onfigure[input], true), sub._name = sub._path = path
|
}, target._can = sub, can.base.Copy(sub, can.onfigure[input], true), sub._name = sub._path = path
|
||||||
sub._target._close = sub.close = function() { can.page.Remove(can, sub._target), delete(target._can) }, sub.hidden = function() { return !can.page.isDisplay(sub._target) }
|
sub._target._close = sub.close = function() { can.page.Remove(can, sub._target), delete(target._can) }, sub.hidden = function() { return !can.page.isDisplay(sub._target) }
|
||||||
meta.mode && can.onappend.style(sub, meta.mode), can.page.style(sub, sub._target, meta.style), can.base.isFunc(meta._init) && meta._init(sub, sub._target),
|
meta.mode && can.onappend.style(sub, meta.mode), can.page.style(sub, sub._target, meta.style), can.base.isFunc(meta._init) && meta._init(sub, sub._target)
|
||||||
can.onmotion.delay(can, function() { show(sub, cb) }, 300)
|
// can.onmotion.delay(can, function() { show(sub, cb) }, 300)
|
||||||
|
can.onmotion.delay(can, function() { show(sub, cb) }, 0)
|
||||||
}, can._root._target)
|
}, can._root._target)
|
||||||
}})
|
}})
|
||||||
}) } }), can.onfigure[input]._init && can.onfigure[input]._init(can, meta, target, _cb)
|
}) } }), can.onfigure[input]._init && can.onfigure[input]._init(can, meta, target, _cb)
|
||||||
@ -526,10 +546,26 @@ Volcanos(chat.ONLAYOUT, {_init: function(can, target) { target = target||can._ro
|
|||||||
can.page.SelectChild(can, target, html.DIV_ITEM, function(target) { can.page.styleWidth(can, target, width) })
|
can.page.SelectChild(can, target, html.DIV_ITEM, function(target) { can.page.styleWidth(can, target, width) })
|
||||||
},
|
},
|
||||||
background: function(can, url, target) { can.page.style(can, target||can._root._target, "background-image", url == "" || url == "void"? "": 'url("'+url+'")') },
|
background: function(can, url, target) { can.page.style(can, target||can._root._target, "background-image", url == "" || url == "void"? "": 'url("'+url+'")') },
|
||||||
|
_figure: function(event, can, target, right, min) { if (!event || !event.target) { return {} } target = target||can._fields||can._target
|
||||||
|
var rect = event.target == document.body? {left: can.page.width()/2, top: can.page.height()/2, right: can.page.width()/2, bottom: can.page.height()/2}: (event.currentTarget||event.target).getBoundingClientRect()
|
||||||
|
var layout = right? {left: rect.right, top: rect.top}: {left: rect.left, top: rect.bottom}
|
||||||
|
can.getActionSize(function(left, top, width, height) { left = left||0, top = top||0, height = can.base.Max(height, can.page.height()-top)
|
||||||
|
can.page.style(can, target, html.MAX_HEIGHT, top+height-layout.top)
|
||||||
|
can.page.style(can, target, html.MAX_WIDTH, left+width-layout.left)
|
||||||
|
});
|
||||||
|
can.onmotion.move(can, target, layout), can.onmotion.slideGrow(can, target)
|
||||||
|
return layout
|
||||||
|
},
|
||||||
figure: function(event, can, target, right, min) { if (!event || !event.target) { return {} } target = target||can._fields||can._target
|
figure: function(event, can, target, right, min) { if (!event || !event.target) { return {} } target = target||can._fields||can._target
|
||||||
var rect = event.target == document.body? {left: can.page.width()/2, top: can.page.height()/2, right: can.page.width()/2, bottom: can.page.height()/2}: (event.currentTarget||event.target).getBoundingClientRect()
|
var rect = event.target == document.body? {left: can.page.width()/2, top: can.page.height()/2, right: can.page.width()/2, bottom: can.page.height()/2}: (event.currentTarget||event.target).getBoundingClientRect()
|
||||||
var layout = right? {left: rect.right, top: rect.top}: {left: rect.left, top: rect.bottom}
|
var layout = right? {left: rect.right, top: rect.top}: {left: rect.left, top: rect.bottom}
|
||||||
can.getActionSize(function(left, top, width, height) { left = left||0, top = top||0, height = can.base.Max(height, can.page.height()-top)
|
can.getActionSize(function(left, top, width, height) { left = left||0, top = top||0, height = can.base.Max(height, can.page.height()-top)
|
||||||
|
if (can.user.isMobile) {
|
||||||
|
if (target.offsetHeight > height/2) { layout.top = top+32 }
|
||||||
|
if (target.offsetWidth > width/2) { layout.left = left, can.page.style(can, target, html.WIDTH, width) }
|
||||||
|
can.page.style(can, target, html.MAX_HEIGHT, top+height-layout.top)
|
||||||
|
return
|
||||||
|
}
|
||||||
if (layout.top+target.offsetHeight > top+height) {
|
if (layout.top+target.offsetHeight > top+height) {
|
||||||
if (min && top+height-layout.top > min) {
|
if (min && top+height-layout.top > min) {
|
||||||
can.page.style(can, target, html.MAX_HEIGHT, top+height-layout.top)
|
can.page.style(can, target, html.MAX_HEIGHT, top+height-layout.top)
|
||||||
@ -537,11 +573,11 @@ Volcanos(chat.ONLAYOUT, {_init: function(can, target) { target = target||can._ro
|
|||||||
layout.top = rect.top-target.offsetHeight
|
layout.top = rect.top-target.offsetHeight
|
||||||
} else {
|
} else {
|
||||||
if (!right) { right = true, layout.left += (event.currentTarget||event.target).offsetWidth }
|
if (!right) { right = true, layout.left += (event.currentTarget||event.target).offsetWidth }
|
||||||
can.page.style(can, target, html.MAX_HEIGHT, height)
|
|
||||||
layout.top = top+height-target.offsetHeight
|
layout.top = top+height-target.offsetHeight
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (layout.left+target.offsetWidth > left+width) { layout.left = (right? rect.left: left+width)-target.offsetWidth-1 }
|
if (layout.left+target.offsetWidth > left+width) { layout.left = (right? rect.left: left+width)-target.offsetWidth-1 }
|
||||||
|
can.page.style(can, target, html.MAX_HEIGHT, top+height-layout.top)
|
||||||
});
|
});
|
||||||
can.onmotion.move(can, target, layout), can.onmotion.slideGrow(can, target)
|
can.onmotion.move(can, target, layout), can.onmotion.slideGrow(can, target)
|
||||||
return layout
|
return layout
|
||||||
@ -594,7 +630,7 @@ Volcanos(chat.ONMOTION, {_init: function(can, target) {
|
|||||||
if (can.page.Select(can, document.body, list[i], function(target) { return target._close? target._close(): can.page.Remove(can, target) }).length > 0) { return true }
|
if (can.page.Select(can, document.body, list[i], function(target) { return target._close? target._close(): can.page.Remove(can, target) }).length > 0) { return true }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
clearCarte: function(can) { can.page.SelectChild(can, document.body, "div.carte.float", function(target) { can.page.Remove(can, target) }) },
|
clearCarte: function(can) { can.page.SelectChild(can, document.body, "div.carte.float,fieldset.input.float", function(target) { can.page.Remove(can, target) }) },
|
||||||
clearInput: function(can) { can.page.SelectChild(can, document.body, "div.input.float", function(target) { can.page.Remove(can, target) }) },
|
clearInput: function(can) { can.page.SelectChild(can, document.body, "div.input.float", function(target) { can.page.Remove(can, target) }) },
|
||||||
hidden: function(can, target, show) { target = target||can._target
|
hidden: function(can, target, show) { target = target||can._target
|
||||||
if (!target.tagName && target.length > 0) { return can.core.List(target, function(target) { can.onmotion.hidden(can, target, show) }) }
|
if (!target.tagName && target.length > 0) { return can.core.List(target, function(target) { can.onmotion.hidden(can, target, show) }) }
|
||||||
@ -684,7 +720,7 @@ Volcanos(chat.ONMOTION, {_init: function(can, target) {
|
|||||||
return can.user.input(event, can, input, function(args) { can.onengine.signal(can, chat.ONSHARE, can.request(event, {args: [mdb.TYPE, chat.FIELD].concat(_args||[], args||[])})) })
|
return can.user.input(event, can, input, function(args) { can.onengine.signal(can, chat.ONSHARE, can.request(event, {args: [mdb.TYPE, chat.FIELD].concat(_args||[], args||[])})) })
|
||||||
},
|
},
|
||||||
focus: function(can, target, value) { if (!target) { return } if (!can.base.isUndefined(value)) { target.value = value }
|
focus: function(can, target, value) { if (!target) { return } if (!can.base.isUndefined(value)) { target.value = value }
|
||||||
target.focus(), can.onmotion.selectRange(target)
|
target.focus(), can.user.isMobile || can.onmotion.selectRange(target)
|
||||||
}, selectRange: function(target) { target && target.setSelectionRange && target.setSelectionRange(0, target.value.length) },
|
}, selectRange: function(target) { target && target.setSelectionRange && target.setSelectionRange(0, target.value.length) },
|
||||||
copy: function(can, target, cb) { target.title = "点击复制,或 Command + Click 打开应用", target.onclick = function(event) {
|
copy: function(can, target, cb) { target.title = "点击复制,或 Command + Click 打开应用", target.onclick = function(event) {
|
||||||
can.user.copy(event, can, target.innerText), can.base.isFunc(cb) && cb(event)
|
can.user.copy(event, can, target.innerText), can.base.isFunc(cb) && cb(event)
|
||||||
|
33
index.css
33
index.css
@ -45,6 +45,7 @@ legend { padding:0 20px; }
|
|||||||
select { padding:0 10px; }
|
select { padding:0 10px; }
|
||||||
input:not([type=file]) { padding:0 10px; }
|
input:not([type=file]) { padding:0 10px; }
|
||||||
input:not([type=button]) { border-radius:0; outline:none; width:120px; }
|
input:not([type=button]) { border-radius:0; outline:none; width:120px; }
|
||||||
|
body.mobile input:not([type=button]) { width:80px; }
|
||||||
input[name=path] { width:160px; }
|
input[name=path] { width:160px; }
|
||||||
input[name=line] { width:60px !important; }
|
input[name=line] { width:60px !important; }
|
||||||
input[name=limit] { width:60px; }
|
input[name=limit] { width:60px; }
|
||||||
@ -128,16 +129,22 @@ body>div.input { padding:20px; }
|
|||||||
body>div.input div.output { clear:both; }
|
body>div.input div.output { clear:both; }
|
||||||
body>div.input td { padding:10px; }
|
body>div.input td { padding:10px; }
|
||||||
body>div.input td:nth-child(2) { padding:10px 0;}
|
body>div.input td:nth-child(2) { padding:10px 0;}
|
||||||
|
body>div.input tr.img td:last-child>span { display:none; }
|
||||||
|
body>div.input tr.img td:last-child>div {
|
||||||
|
background-color:gray; margin:1px; float:left; cursor:pointer;
|
||||||
|
display:flex; align-items:center; justify-content:center;
|
||||||
|
}
|
||||||
|
body>div.input tr.img td:last-child>div>span { font-size:32px; }
|
||||||
body>div.input tr.icon td:last-child { position:relative; }
|
body>div.input tr.icon td:last-child { position:relative; }
|
||||||
body>div.input tr.icon td:last-child i:first-child { font-size:22px; position:absolute; left:15px; top:14px; }
|
body>div.input tr.icon td:last-child i:first-child { font-size:22px; position:absolute; left:15px; top:14px; }
|
||||||
body>div.input tr.icon td:last-child img:first-child { height:28px; width:28px; left:12px; top:12px; position:absolute; }
|
body>div.input tr.icon td:last-child img:first-child { height:28px; width:28px; left:12px; top:12px; position:absolute; }
|
||||||
body>div.input tr.icon td:last-child input { padding-left:32px; }
|
body>div.input tr.icon td:last-child input { padding-left:32px; }
|
||||||
body>div.input td span.icon { margin-left:-20px; visibility:hidden; }
|
body>div.input td span.icon { margin-left:-20px; visibility:hidden; }
|
||||||
body>div.input td:hover span.icon { visibility:visible; }
|
body>div.input td:hover span.icon { visibility:visible; }
|
||||||
body>div.input select { width:230px; }
|
body>div.input select { width:230px !important; }
|
||||||
body>div.input input { width:240px; }
|
body>div.input input:not([type=button]) { width:240px !important; }
|
||||||
body>div.input textarea { height:120px; width:240px; }
|
body>div.input textarea { height:120px; width:240px !important; }
|
||||||
body>div.input div.action { width:100%; }
|
body>div.input div.action { width:100%; position:sticky; bottom:0; }
|
||||||
body>div.input div.action>div.item { margin:5px; float:right; }
|
body>div.input div.action>div.item { margin:5px; float:right; }
|
||||||
body>div.input div.action>div.item>input[type=button] { width:110px; }
|
body>div.input div.action>div.item>input[type=button] { width:110px; }
|
||||||
body>div.input.login>div.output { text-align:center; }
|
body>div.input.login>div.output { text-align:center; }
|
||||||
@ -190,6 +197,7 @@ div.action>div.item.icons.start>span.icon { font-size:30px; line-height:28px; }
|
|||||||
div.action>div.item.icons.refresh>span.icon { font-size:30px; line-height:28px; }
|
div.action>div.item.icons.refresh>span.icon { font-size:30px; line-height:28px; }
|
||||||
div.action>div.item.icons.prunes>span.icon { display:inline-block; padding-top:2px; }
|
div.action>div.item.icons.prunes>span.icon { display:inline-block; padding-top:2px; }
|
||||||
div.action>div.item.icons>i { font-size:21px; line-height:32px; padding:6px; }
|
div.action>div.item.icons>i { font-size:21px; line-height:32px; padding:6px; }
|
||||||
|
|
||||||
form.option>div.item.icons>i { font-size:21px; line-height:32px; padding:6px; }
|
form.option>div.item.icons>i { font-size:21px; line-height:32px; padding:6px; }
|
||||||
form.option div.icon, form.option span.icon { font-size:20px; line-height:32px; padding:0 5px; margin:0; height:32px; }
|
form.option div.icon, form.option span.icon { font-size:20px; line-height:32px; padding:0 5px; margin:0; height:32px; }
|
||||||
form.option div.icon.refresh { font-size:28px; line-height:28px; }
|
form.option div.icon.refresh { font-size:28px; line-height:28px; }
|
||||||
@ -211,9 +219,10 @@ div.tabs>div:hover>span.icon { visibility:visible; }
|
|||||||
div.tabs:hover>span.icon { visibility:visible; }
|
div.tabs:hover>span.icon { visibility:visible; }
|
||||||
fieldset.plug>form.option>div.icon { margin-left:5px; }
|
fieldset.plug>form.option>div.icon { margin-left:5px; }
|
||||||
fieldset.panel>div.action>div.button>span.icon { display:none; }
|
fieldset.panel>div.action>div.button>span.icon { display:none; }
|
||||||
|
fieldset.plugin.cmd>form.option>div.icon.delete { display:none; }
|
||||||
fieldset.plugin:not(.story):not(.float):not(.full):not(.cmd)>form.option>div.icon { display:none; }
|
fieldset.plugin:not(.story):not(.float):not(.full):not(.cmd)>form.option>div.icon { display:none; }
|
||||||
fieldset.plugin:not(.story):not(.float):not(.full):not(.cmd)>form.option>div.button>span.icon { display:none; }
|
fieldset.plugin:not(.story):not(.float):not(.full):not(.cmd)>form.option>div.button:not(.select)>span.icon { display:none; }
|
||||||
fieldset.plugin:not(.story):not(.float):not(.full):not(.cmd)>div.action>div.button>span.icon { display:none; }
|
fieldset.plugin:not(.story):not(.float):not(.full):not(.cmd)>div.action>div.button:not(.select)>span.icon { display:none; }
|
||||||
fieldset.story>form.option>div.button.icons>input { display:none; }
|
fieldset.story>form.option>div.button.icons>input { display:none; }
|
||||||
fieldset.float>form.option>div.button.icons>input { display:none; }
|
fieldset.float>form.option>div.button.icons>input { display:none; }
|
||||||
fieldset.full>form.option>div.button.icons>input { display:none; }
|
fieldset.full>form.option>div.button.icons>input { display:none; }
|
||||||
@ -336,6 +345,7 @@ textarea:focus { border:var(--box-notice); }
|
|||||||
table.content tr:hover { background-color:var(--tr-hover-bg-color) !important; }
|
table.content tr:hover { background-color:var(--tr-hover-bg-color) !important; }
|
||||||
table.content tr.select { background-color:var(--tr-hover-bg-color); }
|
table.content tr.select { background-color:var(--tr-hover-bg-color); }
|
||||||
table.content th { background-color:var(--th-bg-color); color:var(--th-fg-color); }
|
table.content th { background-color:var(--th-bg-color); color:var(--th-fg-color); }
|
||||||
|
table.content.detail td:first-child { text-align:center; }
|
||||||
table.content td:hover { background-color:var(--td-hover-bg-color); }
|
table.content td:hover { background-color:var(--td-hover-bg-color); }
|
||||||
table.content td.select { background-color:var(--td-hover-bg-color); }
|
table.content td.select { background-color:var(--td-hover-bg-color); }
|
||||||
table.content input { box-shadow:var(--box-shadow); }
|
table.content input { box-shadow:var(--box-shadow); }
|
||||||
@ -427,10 +437,6 @@ body.mobile fieldset.word.float>div.output>div.project { top:32px; }
|
|||||||
body.mobile fieldset.word>div.output>fieldset.story>form.option>div.text { display:none; }
|
body.mobile fieldset.word>div.output>fieldset.story>form.option>div.text { display:none; }
|
||||||
body.mobile fieldset.word>div.output { overflow-x:hidden; }
|
body.mobile fieldset.word>div.output { overflow-x:hidden; }
|
||||||
body.mobile fieldset.web.code.inner.cmd>div.output { overflow:hidden; }
|
body.mobile fieldset.web.code.inner.cmd>div.output { overflow:hidden; }
|
||||||
body.mobile fieldset.web.wiki.portal>div.output>div.layout { display:block; }
|
|
||||||
body.mobile fieldset.web.wiki.portal>div.output>div.layout>div.nav { padding:10px; height:unset; }
|
|
||||||
body.mobile fieldset.web.wiki.portal>div.output>div.layout>div.main { padding:10px; height:unset; min-width:unset; }
|
|
||||||
body.mobile fieldset.web.wiki.portal>div.output>div.header div.story[data-name=navmenu] div.item { padding:10px; }
|
|
||||||
body.mobile fieldset.word>div.output div.story.flex { display:block; }
|
body.mobile fieldset.word>div.output div.story.flex { display:block; }
|
||||||
body.mobile fieldset.word>div.output div.story.flex>* { padding:unset; }
|
body.mobile fieldset.word>div.output div.story.flex>* { padding:unset; }
|
||||||
/* print */
|
/* print */
|
||||||
@ -511,7 +517,9 @@ fieldset.draw.spide div.output svg path { stroke-width:1; }
|
|||||||
fieldset.draw>div.output>div.project { width:180px; flex:0 0 180px; }
|
fieldset.draw>div.output>div.project { width:180px; flex:0 0 180px; }
|
||||||
fieldset.draw>div.output>div.layout>div.layout>div.profile { width:180px; flex:0 0 180px; }
|
fieldset.draw>div.output>div.layout>div.layout>div.profile { width:180px; flex:0 0 180px; }
|
||||||
fieldset.web.chat.location>div.action input[type=text] { width:80px !important; }
|
fieldset.web.chat.location>div.action input[type=text] { width:80px !important; }
|
||||||
fieldset.web.chat.location>div.output>div.layout>div.layout>div.profile { position:absolute; top:0; right:0; height:200px; width:200px; z-index:5; border-left:none; }
|
fieldset.web.chat.location>div.output>div.layout>div.layout>div.profile {
|
||||||
|
background-color:var(--plugin-bg-color);
|
||||||
|
position:absolute; right:0; width:360px; z-index:5; border-left:none; }
|
||||||
fieldset.web.chat.location>div.output>div.layout>div.layout { position:relative; }
|
fieldset.web.chat.location>div.output>div.layout>div.layout { position:relative; }
|
||||||
fieldset.web.code.git.total.draw div.output { text-align:center; }
|
fieldset.web.code.git.total.draw div.output { text-align:center; }
|
||||||
fieldset.web.code.docker.studio>div.action>div.item { font-style:italic; height:32px; padding:5px 10px; }
|
fieldset.web.code.docker.studio>div.action>div.item { font-style:italic; height:32px; padding:5px 10px; }
|
||||||
@ -526,8 +534,7 @@ fieldset.studio>div.output>fieldset>form.option div.icon:nth-child(2) { margin-l
|
|||||||
fieldset.studio>div.output>fieldset>div.output>table.content { width:100%; }
|
fieldset.studio>div.output>fieldset>div.output>table.content { width:100%; }
|
||||||
fieldset.studio>div.output>fieldset:not(.select) { display:none; }
|
fieldset.studio>div.output>fieldset:not(.select) { display:none; }
|
||||||
body>div.input.vimer.plug td:first-child { display:none; }
|
body>div.input.vimer.plug td:first-child { display:none; }
|
||||||
body.cmd.web.wiki.portal { background-color:rgb(22 31 49); }
|
body.cmd.web.chat.macos.desktop { background-color:#8ebff2; }
|
||||||
body.cmd.web.chat.macos.desktop { background-color:#8dbaea; }
|
|
||||||
body.zh fieldset.inner>div.output>div.project>div.zone>div.item { letter-spacing:10px; border-top:var(--box-border); }
|
body.zh fieldset.inner>div.output>div.project>div.zone>div.item { letter-spacing:10px; border-top:var(--box-border); }
|
||||||
body.white fieldset.inner.cmd>div.output>div.layout>div.tabs div:not(.select):not(:hover) { background-color:transparent; }
|
body.white fieldset.inner.cmd>div.output>div.layout>div.tabs div:not(.select):not(:hover) { background-color:transparent; }
|
||||||
body.webview fieldset.word>form.option>div.item>input[name=path] { width:160px; }
|
body.webview fieldset.word>form.option>div.item>input[name=path] { width:160px; }
|
||||||
|
@ -71,8 +71,7 @@ Volcanos("misc", {
|
|||||||
msg.Push(ctx.ACTION, can.page.Format(html.INPUT, "", mdb.TYPE, html.BUTTON, mdb.NAME, button, mdb.VALUE, can.user.trans(can, button)))
|
msg.Push(ctx.ACTION, can.page.Format(html.INPUT, "", mdb.TYPE, html.BUTTON, mdb.NAME, button, mdb.VALUE, can.user.trans(can, button)))
|
||||||
}); return msg },
|
}); return msg },
|
||||||
Echo: function(res) { msg.result = (msg.result||[]).concat(can.core.List(arguments)); return msg._hand = true, msg },
|
Echo: function(res) { msg.result = (msg.result||[]).concat(can.core.List(arguments)); return msg._hand = true, msg },
|
||||||
Dump: function(can) { can = can||msg._can
|
Dump: function(can) { can = can||msg._can; if (can.user.isNodejs) { return }
|
||||||
if (can.user.isNodejs) { return }
|
|
||||||
can.onmotion.clear(can), can.onappend.table(can, msg), can.onappend.board(can, msg), can.onmotion.story.auto(can)
|
can.onmotion.clear(can), can.onappend.table(can, msg), can.onappend.board(can, msg), can.onmotion.story.auto(can)
|
||||||
},
|
},
|
||||||
Defer: function(cb) { msg._defer = msg._defer||[]
|
Defer: function(cb) { msg._defer = msg._defer||[]
|
||||||
@ -246,7 +245,7 @@ Volcanos("misc", {
|
|||||||
for (var i = -depth+1; i < list.length; i++) { var pos = split(i); if (pos.path != current.path) { return pos } }
|
for (var i = -depth+1; i < list.length; i++) { var pos = split(i); if (pos.path != current.path) { return pos } }
|
||||||
} return split(depth)||{}
|
} return split(depth)||{}
|
||||||
},
|
},
|
||||||
_stacks: function(n, s) { var list = ((s||(new Error())).stack||"").split(lex.NL).slice(typeof n == undefined? 2: n)
|
_stacks: function(n, s) { var list = ((s||(new Error())).stack||"").split(lex.NL).slice(typeof n == "undefined"? 2: n)
|
||||||
for (var i = 0; i < list.length; i++) { var ls = list[i].trim().split(lex.SP)
|
for (var i = 0; i < list.length; i++) { var ls = list[i].trim().split(lex.SP)
|
||||||
list[i] = ls.pop().trim(); if (list[i][0] == "(") { list[i] = list[i].slice(1, -1) }
|
list[i] = ls.pop().trim(); if (list[i][0] == "(") { list[i] = list[i].slice(1, -1) }
|
||||||
list[i] = " "+list[i]; if (ls.length > 1) { list[i] += " "+ls.pop() }
|
list[i] = " "+list[i]; if (ls.length > 1) { list[i] += " "+ls.pop() }
|
||||||
|
@ -68,7 +68,6 @@ Volcanos("page", {
|
|||||||
data.onchange = function(event) { can.misc.Event(event, can, function(msg) { can.base.isFunc(list[1]) && list[1](event, event.target.value, name) }) }
|
data.onchange = function(event) { can.misc.Event(event, can, function(msg) { can.base.isFunc(list[1]) && list[1](event, event.target.value, name) }) }
|
||||||
item.list = list[0].slice(1).map(function(value) { return {type: html.OPTION, value: value, inner: can.user.trans(can, value)} })
|
item.list = list[0].slice(1).map(function(value) { return {type: html.OPTION, value: value, inner: can.user.trans(can, value)} })
|
||||||
} else if (item.input) { var list = can.core.List(item.input); type = html.INPUT, name = list[0], data.className = data.className||list[0], data.type = data.type||html.TEXT
|
} else if (item.input) { var list = can.core.List(item.input); type = html.INPUT, name = list[0], data.className = data.className||list[0], data.type = data.type||html.TEXT
|
||||||
data.onfocus = data.onfocus||function(event) { event.target.setSelectionRange(0, -1) }
|
|
||||||
data.onkeydown = function(event) { can.base.isFunc(list[1]) && list[1](event) }
|
data.onkeydown = function(event) { can.base.isFunc(list[1]) && list[1](event) }
|
||||||
data.onkeyup = function(event) { can.base.isFunc(list[2]) && list[2](event) }
|
data.onkeyup = function(event) { can.base.isFunc(list[2]) && list[2](event) }
|
||||||
} else if (item.username) { var list = can.core.List(item.username); type = html.INPUT, name = list[0]||name||html.USERNAME
|
} else if (item.username) { var list = can.core.List(item.username); type = html.INPUT, name = list[0]||name||html.USERNAME
|
||||||
@ -175,7 +174,7 @@ Volcanos("page", {
|
|||||||
if (value == undefined) { return {view: [key, "col"]} } return {view: [[key, "option"], "col"]}
|
if (value == undefined) { return {view: [key, "col"]} } return {view: [[key, "option"], "col"]}
|
||||||
} }) }, {type: html.THEAD}, {type: html.TBODY}]}])
|
} }) }, {type: html.THEAD}, {type: html.TBODY}]}])
|
||||||
|
|
||||||
can.page.Append(can, ui.thead, [{data: {dataset: {index: -1}}, th: can.core.List(list, function(key) { if (key[0] != "_") { return key } }) }])
|
can.page.Append(can, ui.thead, [{data: {dataset: {index: -1}}, th: can.core.List(list, function(key) { if (key[0] != "_") { return can.user.trans(can, key, null, html.INPUT) } }) }])
|
||||||
can.page.Append(can, ui.tbody, can.core.List(msg.Table(), function(item, index, array) {
|
can.page.Append(can, ui.tbody, can.core.List(msg.Table(), function(item, index, array) {
|
||||||
return {dataset: {index: index}, className: item["status"], td: can.core.List(list, function(key) { if (key[0] != "_") { return cb(can.page.Color(item[key]).trim(), key, index, item, array) } }) }
|
return {dataset: {index: index}, className: item["status"], td: can.core.List(list, function(key) { if (key[0] != "_") { return cb(can.page.Color(item[key]).trim(), key, index, item, array) } }) }
|
||||||
})); return can.page.OrderTable(can, ui._target)
|
})); return can.page.OrderTable(can, ui._target)
|
||||||
|
38
lib/user.js
38
lib/user.js
@ -62,10 +62,14 @@ Volcanos("user", {
|
|||||||
title: function(text) { if (window.webview) { return title(text) } return text && (document.title = text), document.title },
|
title: function(text) { if (window.webview) { return title(text) } return text && (document.title = text), document.title },
|
||||||
language: function(can) { return (can.misc.SearchOrConf(can, aaa.LANGUAGE)||can.user.info.language||"") },
|
language: function(can) { return (can.misc.SearchOrConf(can, aaa.LANGUAGE)||can.user.info.language||"") },
|
||||||
isEnglish: function(can) { return can.base.isIn(can.user.language(can).toLowerCase(), "en", "en-us") },
|
isEnglish: function(can) { return can.base.isIn(can.user.language(can).toLowerCase(), "en", "en-us") },
|
||||||
trans: function(can, text, list) { if (can.base.isNumber(text)) { return text+"" } if (can.user.isEnglish(can)) { return text }
|
trans: function(can, text, list, zone) { if (can.base.isNumber(text)) { return text+"" } if (can.user.isEnglish(can)) { return text }
|
||||||
if (can.base.isObject(text)) { return can.core.Item(text, function(k, v) { can.core.Value(can._trans, k, v) }) }
|
if (can.base.isObject(text)) { return can.core.Item(text, function(k, v) { can.core.Value(can._trans, can.core.Keys(zone, k), v) }) }
|
||||||
if (can.base.isFunc(text)) { text = text.name||"" } if (can.base.isString(list)) { return list }
|
if (can.base.isFunc(text)) { text = text.name||"" } if (can.base.isString(list)) { return list }
|
||||||
return list&&list[text] || can.user._trans[text] || can._trans&&can._trans[text] || can.Conf("trans."+text) || can.Conf("feature._trans."+text) || text
|
var key = can.core.Keys(zone, text)
|
||||||
|
return can.core.Value(list, key) || can.core.Value(can._trans, key) ||
|
||||||
|
can.Conf(["trans", key]) || can.Conf(["feature._trans", key]) ||
|
||||||
|
can.core.Value(can.user._trans, key) || text
|
||||||
|
|
||||||
}, _trans: {"_week_header": ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]},
|
}, _trans: {"_week_header": ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]},
|
||||||
time: function(can, time, fmt) { var now = can.base.Date(time), list = can.user._trans["_week_header"]
|
time: function(can, time, fmt) { var now = can.base.Date(time), list = can.user._trans["_week_header"]
|
||||||
return fmt == "%W"? list: can.base.Time(time, (fmt||"%y-%m-%d %H:%M:%S").replace("%w", list[now.getDay()]))
|
return fmt == "%W"? list: can.base.Time(time, (fmt||"%y-%m-%d %H:%M:%S").replace("%w", list[now.getDay()]))
|
||||||
@ -126,8 +130,8 @@ Volcanos("user", {
|
|||||||
function remove_sub(carte) { carte._sub && can.page.Remove(can, carte._sub._target), delete(carte._sub) } parent? remove_sub(parent): can.onmotion.clearCarte(can)
|
function remove_sub(carte) { carte._sub && can.page.Remove(can, carte._sub._target), delete(carte._sub) } parent? remove_sub(parent): can.onmotion.clearCarte(can)
|
||||||
meta = meta||can.ondetail||can.onaction||{}, list = can.base.getValid(list, meta.list, can.core.Item(meta)), trans = trans||meta._trans; if (!list || list.length == 0) { return }
|
meta = meta||can.ondetail||can.onaction||{}, list = can.base.getValid(list, meta.list, can.core.Item(meta)), trans = trans||meta._trans; if (!list || list.length == 0) { return }
|
||||||
var _events = event._events||event
|
var _events = event._events||event
|
||||||
function click(event, button) { can.misc.Event(event, can, function() { can.request(event, {action: button}), can.onkeymap.prevent(event), event._events = _events;
|
function click(event, button, index) { can.misc.Event(event, can, function() { can.request(event, {action: button}), can.onkeymap.prevent(event), event._events = _events;
|
||||||
(can.base.isFunc(cb)? cb(event, button, meta, carte):
|
(can.base.isFunc(cb)? cb(event, button, meta, carte, index):
|
||||||
meta[button]? can.core.CallFunc([meta, button], {event: event, can: can, msg: msg, button: button}):
|
meta[button]? can.core.CallFunc([meta, button], {event: event, can: can, msg: msg, button: button}):
|
||||||
can.Update(event, [ctx.ACTION, button])) || can.onmotion.clearCarte(can)
|
can.Update(event, [ctx.ACTION, button])) || can.onmotion.clearCarte(can)
|
||||||
}) }
|
}) }
|
||||||
@ -142,12 +146,12 @@ Volcanos("user", {
|
|||||||
return {
|
return {
|
||||||
view: [[html.ITEM, item, _style], html.DIV, (isinput || meta._style == ice.CMD) && !trans? item: can.user.trans(can, item, trans)],
|
view: [[html.ITEM, item, _style], html.DIV, (isinput || meta._style == ice.CMD) && !trans? item: can.user.trans(can, item, trans)],
|
||||||
onmouseenter: function(event) { remove_sub(carte) },
|
onmouseenter: function(event) { remove_sub(carte) },
|
||||||
onclick: function(event) { click(event, item) },
|
onclick: function(event) { click(event, item, index) },
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (can.base.isArray(item)) {
|
if (can.base.isArray(item)) {
|
||||||
function subs(event) { var sub = can.user.carte(event, can, meta, item.slice(1), cb||function(event, button) {
|
function subs(event) { var sub = can.user.carte(event, can, meta, item.slice(1), cb||function(event, button) {
|
||||||
can.onimport && can.onimport[item[0]]? can.onimport[item[0]](can, button): click(event, button)
|
can.onimport && can.onimport[item[0]]? can.onimport[item[0]](can, button): click(event, button, index)
|
||||||
}, carte, trans); carte._sub = sub }
|
}, carte, trans); carte._sub = sub }
|
||||||
return {view: html.ITEM, list: [
|
return {view: html.ITEM, list: [
|
||||||
{text: can.user.trans(can, item[0], trans)},
|
{text: can.user.trans(can, item[0], trans)},
|
||||||
@ -181,12 +185,19 @@ Volcanos("user", {
|
|||||||
can.run(event, cmds, cb, true)
|
can.run(event, cmds, cb, true)
|
||||||
}, _enter: function(event) { return action.submit(event, can, html.SUBMIT), true }}, item), target)
|
}, _enter: function(event) { return action.submit(event, can, html.SUBMIT), true }}, item), target)
|
||||||
}, item.onkeydown = function(event) { if (event.key == code.ESCAPE) { event.target.blur() } }
|
}, item.onkeydown = function(event) { if (event.key == code.ESCAPE) { event.target.blur() } }
|
||||||
return {type: html.TR, className: item.name, list: [
|
item.value = item.value||msg.Option(item.name)
|
||||||
{type: html.TD, list: [{text: [can.user.trans(can, item.name||"", item._trans), html.LABEL]}]}, {type: html.TD, list: [{text: item.need == "must"? "*": "", style: {color: cli.RED}}]},
|
item.placeholder = can.user.trans(can, item.placeholder||item.name, null, html.INPUT)
|
||||||
|
item.title = can.user.trans(can, item.title||item.placeholder||item.name, null, html.INPUT)
|
||||||
|
return {view: [[item.name, item.type, item.action], html.TR], list: [
|
||||||
|
{type: html.TD, list: [{text: [can.user.trans(can, item.name||"", item._trans, html.INPUT), html.LABEL]}]}, {type: html.TD, list: [{text: item.need == "must"? "*": "", style: {color: cli.RED}}]},
|
||||||
{type: html.TD, list: [can.page.input(can, item), item.type == html.TEXT && {icon: "delete", onclick: function(event) { event.target.previousSibling.value = "" }}]},
|
{type: html.TD, list: [can.page.input(can, item), item.type == html.TEXT && {icon: "delete", onclick: function(event) { event.target.previousSibling.value = "" }}]},
|
||||||
]}
|
]}
|
||||||
})}]}, html.ACTION,
|
})}]}, html.ACTION,
|
||||||
]}])
|
], onclick: function(event) {
|
||||||
|
if (!can.page.tagis(event.target, html.INPUT, html.TEXTAREA)) {
|
||||||
|
can.onmotion.clearCarte(can)
|
||||||
|
}
|
||||||
|
}}])
|
||||||
var action = can.onappend._action(can, button||[html.SUBMIT, html.CANCEL], ui.action, {
|
var action = can.onappend._action(can, button||[html.SUBMIT, html.CANCEL], ui.action, {
|
||||||
_trans: {submit: msg.Option(web.SUBMIT)},
|
_trans: {submit: msg.Option(web.SUBMIT)},
|
||||||
focus: function() { can.onmotion.focus(can, can.page.Select(can, ui._target, html.INPUT_ARGS)[0]) },
|
focus: function() { can.onmotion.focus(can, can.page.Select(can, ui._target, html.INPUT_ARGS)[0]) },
|
||||||
@ -199,12 +210,9 @@ Volcanos("user", {
|
|||||||
can.core.CallFunc(cb, {event: can.request(event, {_handle: ice.TRUE})._event, button: button, data: data, list: list, args: args, input: action}) || action.cancel()
|
can.core.CallFunc(cb, {event: can.request(event, {_handle: ice.TRUE})._event, button: button, data: data, list: list, args: args, input: action}) || action.cancel()
|
||||||
}, _target: ui._target, _engine: function(event, can, button) { action.submit(event, can, button) },
|
}, _target: ui._target, _engine: function(event, can, button) { action.submit(event, can, button) },
|
||||||
});
|
});
|
||||||
if (event && event.target) {
|
if (event && event.target) { can.onlayout.figure(event, can, ui._target) } else {
|
||||||
can.onlayout.figure(event, can, ui._target)
|
|
||||||
} else {
|
|
||||||
can.getActionSize(function(left, top, height) { can.page.style(can, ui._target, html.LEFT, left||0, html.TOP, (height/4||0)) })
|
can.getActionSize(function(left, top, height) { can.page.style(can, ui._target, html.LEFT, left||0, html.TOP, (height/4||0)) })
|
||||||
}
|
} can.onmotion.resize(can, ui._target), can.onmotion.delay(can, function() { action.focus() }, 300)
|
||||||
can.onmotion.resize(can, ui._target), can.onmotion.delay(can, function() { action.focus() })
|
|
||||||
return button === true && action.submit(event, can, html.SUBMIT), action
|
return button === true && action.submit(event, can, html.SUBMIT), action
|
||||||
},
|
},
|
||||||
select: function(event, can, type, fields, cb, cbs) {
|
select: function(event, can, type, fields, cb, cbs) {
|
||||||
|
@ -1,14 +1,17 @@
|
|||||||
(function() { const TABS = "tabs", TABVIEW = "tabview", HORIZON = "horizon", VERTICAL = "vertical", GRID = "grid", FREE = "free", FLOW = "flow", PAGE = "page", CAN_LAYOUT = "can.layout"
|
(function() { const TABS = "tabs", TABVIEW = "tabview", HORIZON = "horizon", VERTICAL = "vertical", GRID = "grid", FREE = "free", FLOW = "flow", PAGE = "page", CAN_LAYOUT = "can.layout"
|
||||||
Volcanos(chat.ONIMPORT, {_init: function(can, msg) { var river = can.Conf(chat.RIVER), storm = can.Conf(chat.STORM), list = can.misc.SearchHash(can)
|
Volcanos(chat.ONIMPORT, {_init: function(can, msg) { var river = can.Conf(chat.RIVER), storm = can.Conf(chat.STORM), list = can.misc.SearchHash(can)
|
||||||
|
// can.isCmdMode() || can.page.style(can, can._output, "visibility", "hidden")
|
||||||
can.onmotion.clear(can), can.core.Next(msg.Table(), function(item, next) { item.type = chat.PLUGIN, item.mode = can.Mode(); if (item.deleted == ice.TRUE) { return next() }
|
can.onmotion.clear(can), can.core.Next(msg.Table(), function(item, next) { item.type = chat.PLUGIN, item.mode = can.Mode(); if (item.deleted == ice.TRUE) { return next() }
|
||||||
can.onappend.plugin(can, item, function(sub, meta, skip) { can._plugins = (can._plugins||[]).concat([sub]), can.onimport._tabs(can, sub, meta), skip || next()
|
can.onappend.plugin(can, item, function(sub, meta, skip) { can._plugins = (can._plugins||[]).concat([sub]), can.onimport._tabs(can, sub, meta), skip || next()
|
||||||
sub.onaction._close = function() { can.onengine.signal(can, chat.ONACTION_REMOVE, can.request({river: river, storm: storm}, item)), can.page.Remove(can, sub._target) }
|
sub.onaction._close = function() { can.onengine.signal(can, chat.ONACTION_REMOVE, can.request({river: river, storm: storm}, item)), can.page.Remove(can, sub._target) }
|
||||||
sub.run = function(event, cmds, cb) { return can.run(event, [river, storm, meta.id||meta.index].concat(cmds), cb) }
|
sub.run = function(event, cmds, cb) { return can.run(event, [river, storm, meta.id||meta.index].concat(cmds), cb) }
|
||||||
sub.onexport.output = function() { can.page.style(can, sub._output, html.MAX_HEIGHT, "") }
|
sub.onexport.output = function() { can.page.style(can, sub._output, html.MAX_HEIGHT, "") }
|
||||||
})
|
})
|
||||||
}, function() { can.isCmdMode() || can.onmotion.delay(can, function() { can.onaction.layout(can), can.onappend.scroll(can, can._output)
|
}, function() { if (can.isCmdMode()) { return }
|
||||||
can.onexport.layout(can) && list[0] == river && list[1] == storm && can.core.List(can._plugins, function(sub) { sub.Conf(ctx.INDEX) == list[2] && can.onmotion.delay(can, function() { sub._tabs.click() }) })
|
can.onmotion.delay(can, function() { can.onaction.layout(can), can.onappend.scroll(can, can._output), can.page.style(can, can._output, "visibility", "visible")
|
||||||
}, 300) })
|
can.onexport.layout(can) && list[0] == river && list[1] == storm && can.core.List(can._plugins, function(sub) { sub.Conf(ctx.INDEX) == list[2] && can.onmotion.delay(can, function() { sub._tabs.click() }) })
|
||||||
|
}, 300)
|
||||||
|
})
|
||||||
},
|
},
|
||||||
_tabs: function(can, sub, meta) {
|
_tabs: function(can, sub, meta) {
|
||||||
var tabs = [{view: [html.ITEM, "", meta.name], onclick: function(event) { can.onmotion.select(can, can._header_tabs, html.DIV_ITEM, sub._header_tabs)
|
var tabs = [{view: [html.ITEM, "", meta.name], onclick: function(event) { can.onmotion.select(can, can._header_tabs, html.DIV_ITEM, sub._header_tabs)
|
||||||
|
@ -1,14 +1,18 @@
|
|||||||
Volcanos(chat.ONFIGURE, {img: {
|
Volcanos(chat.ONFIGURE, {img: {
|
||||||
_init: function(can, meta, target) { var images = can.core.Split(target.value); can.onmotion.hidden(can, target)
|
_init: function(can, meta, target) { target.value == meta.value && (target.value = ""); var images = can.core.Split(target.value)
|
||||||
var count = parseInt(meta.value||"1"), width = target.parentNode.offsetWidth-12; for (var n = 1; n < 10; n++) { if (n*n >= count) { width = width/n; break } } width -= 1
|
var count = parseInt(meta.value||"1"), width = target.parentNode.offsetWidth-22; for (var n = 1; n < 10; n++) { if (n*n >= count) { width = width/n; break } } width -= 1
|
||||||
function add(target, hash) { target._hash = hash, can.page.Appends(can, target, [{img: can.misc.MergeURL(can, {_path: web.SHARE_CACHE+hash}, true), height: width, width: width}]) }
|
function add(target, hash) { target._hash = hash, can.page.Appends(can, target, [{img: can.misc.MergeURL(can, {_path: web.SHARE_CACHE+hash}, true), height: width, width: width}]) }
|
||||||
function set() { target.value = can.page.SelectChild(can, target.parentNode, html.DIV, function(target) { return target._hash }).join(mdb.FS) }
|
function set() { target.value = can.page.SelectChild(can, target.parentNode, html.DIV, function(target) { return target._hash }).join(mdb.FS) }
|
||||||
|
can.onmotion.hidden(can, target)
|
||||||
for (var i = 0; i < count; i++) {
|
for (var i = 0; i < count; i++) {
|
||||||
can.page.Append(can, target.parentNode, [{type: html.DIV, style: {
|
can.page.Append(can, target.parentNode, [{type: html.DIV, style: {
|
||||||
"background-color": "yellow", "float": "left", "clear": i%n == 0? "both": "none", "margin": 1, height: width, width: width,
|
"clear": i%n == 0? "both": "none", height: width, width: width,
|
||||||
}, _init: function(target) { images[i] && add(target, images[i]), target.onclick = function(event) { can.misc.Event(event, can, function(msg) {
|
}, _init: function(target) {
|
||||||
can.user.upload(event, can, function(msg) { add(target, msg.Result()), set() }, true)
|
if (images[i] && images[i].length > 10) { add(target, images[i]) } else { can.page.Append(can, target, [{text: "+"}]) }
|
||||||
})} } }])
|
target.onclick = function(event) { can.misc.Event(event, can, function(msg) {
|
||||||
|
can.user.upload(event, can, function(msg) { add(target, msg.Result()), set() }, true)
|
||||||
|
})}
|
||||||
|
} }])
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}})
|
}})
|
||||||
|
@ -11,11 +11,10 @@ Volcanos(chat.ONFIGURE, {key: {
|
|||||||
return {text: [value, html.TD, value == ""? html.HR: ""], style: msg.append && msg.append.length == 1? kit.Dict(html.MIN_WIDTH, target.offsetWidth-16): {}, onclick: function(event) {
|
return {text: [value, html.TD, value == ""? html.HR: ""], style: msg.append && msg.append.length == 1? kit.Dict(html.MIN_WIDTH, target.offsetWidth-16): {}, onclick: function(event) {
|
||||||
can.close(); if (msg.cb && msg.cb[index]) { return msg.cb[index](value) }
|
can.close(); if (msg.cb && msg.cb[index]) { return msg.cb[index](value) }
|
||||||
var _cb = can.Conf("select"); if (_cb) { return _cb(target.value = value) } can.base.isFunc(cb) && cb(can, value, target.value)
|
var _cb = can.Conf("select"); if (_cb) { return _cb(target.value = value) } can.base.isFunc(cb) && cb(can, value, target.value)
|
||||||
msg.Option(ice.MSG_PROCESS) == ice.PROCESS_AGAIN && can.onmotion.delay(can, function() { can._load(event, can, cb, target, name, value) })
|
|
||||||
}}
|
}}
|
||||||
}), can.onappend._status(can, [mdb.TOTAL, mdb.INDEX]), can.Status(mdb.TOTAL, msg.Length()), can.onmotion.toggle(can, can._status, msg.Length() > 5)
|
}), can.onappend._status(can, [mdb.TOTAL, mdb.INDEX]), can.Status(mdb.TOTAL, msg.Length()), can.onmotion.toggle(can, can._status, msg.Length() > 5)
|
||||||
can.page.style(can, can._output, html.MAX_HEIGHT, can.page.height()/2, html.MIN_WIDTH, target.offsetWidth, html.MAX_WIDTH, can.Conf("style.width")||can.page.width()/2)
|
can.page.style(can, can._output, html.MAX_HEIGHT, can.page.height()/2, html.MIN_WIDTH, target.offsetWidth, html.MAX_WIDTH, can.Conf("style.width")||can.page.width()/2)
|
||||||
msg.append.length == 1 && can.page.ClassList.add(can, can._target, chat.SIMPLE), can.onlayout.figure({target: target}, can, can._target, false, 200)
|
msg.append.length == 1 && can.page.ClassList.add(can, can._target, chat.SIMPLE), can.onlayout._figure({target: target}, can, can._target, false, 200)
|
||||||
},
|
},
|
||||||
onclick: function(event, can, meta, target, cbs) { can.onmotion.focus(can, target) },
|
onclick: function(event, can, meta, target, cbs) { can.onmotion.focus(can, target) },
|
||||||
onfocus: function(event, can, meta, target, cbs) { cbs(function(sub, cb) { if (sub.Status(mdb.TOTAL) > 0) { return }
|
onfocus: function(event, can, meta, target, cbs) { cbs(function(sub, cb) { if (sub.Status(mdb.TOTAL) > 0) { return }
|
||||||
|
@ -17,9 +17,8 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) { msg.Option(ice.MSG_ACTI
|
|||||||
if (msg.IsDetail()) {
|
if (msg.IsDetail()) {
|
||||||
can.onaction.center(can, can._current = can.onimport._item(can, msg.TableDetail()))
|
can.onaction.center(can, can._current = can.onimport._item(can, msg.TableDetail()))
|
||||||
} else {
|
} else {
|
||||||
msg.Table(function(item) { can.onimport._item(can, item) })
|
msg.Table(function(item) { can.onimport._item(can, item) }), can.ui.zone.favor._total(msg.Length())
|
||||||
var item = can.db.list[can.db.hash[0]]; item? item.click():
|
var item = can.db.list[can.db.hash[0]]; item? item.click(): can.user.agent.getLocation(can, function(res) { res.type = "current", can.onaction.center(can, can._current = res) })
|
||||||
can.user.agent.getLocation(can, function(res) { res.type = "current", can.onaction.center(can, can._current = res) })
|
|
||||||
}
|
}
|
||||||
can.user.isMobile && can.core.Item(can.ui.zone, function(key, item) { key == "favor" || item._legend.click() })
|
can.user.isMobile && can.core.Item(can.ui.zone, function(key, item) { key == "favor" || item._legend.click() })
|
||||||
})
|
})
|
||||||
@ -28,7 +27,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) { msg.Option(ice.MSG_ACTI
|
|||||||
{name: "explore"}, {name: "search"}, {name: "direction"},
|
{name: "explore"}, {name: "search"}, {name: "direction"},
|
||||||
{name: "favor", _menu: shy({"play": function(event, can, button) {
|
{name: "favor", _menu: shy({"play": function(event, can, button) {
|
||||||
can.core.Next(can.page.Select(can, can.ui.zone.favor._target, html.DIV_ITEM), function(item, next) {
|
can.core.Next(can.page.Select(can, can.ui.zone.favor._target, html.DIV_ITEM), function(item, next) {
|
||||||
item.click(), can.onmotion.delay(can, next, 2000)
|
item.click(), can.onmotion.delay(can, next, 3000)
|
||||||
}, function() { can.user.toastSuccess(can) })
|
}, function() { can.user.toastSuccess(can) })
|
||||||
}})},
|
}})},
|
||||||
{name: "district", _delay_init: function(target, zone) {
|
{name: "district", _delay_init: function(target, zone) {
|
||||||
@ -103,13 +102,22 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) { msg.Option(ice.MSG_ACTI
|
|||||||
remove: function(event, button) { can.runAction(event, mdb.REMOVE, [mdb.HASH, item.hash], function() { can.page.Remove(can, _target) }) },
|
remove: function(event, button) { can.runAction(event, mdb.REMOVE, [mdb.HASH, item.hash], function() { can.page.Remove(can, _target) }) },
|
||||||
})
|
})
|
||||||
}, target||can.ui.zone.favor._target); can.db.list[item.hash] = _target
|
}, target||can.ui.zone.favor._target); can.db.list[item.hash] = _target
|
||||||
|
can.ui.zone.favor._total()
|
||||||
can.mark && can.mark.add({position: can.onimport.point(can, item), properties: item})
|
can.mark && can.mark.add({position: can.onimport.point(can, item), properties: item})
|
||||||
return item
|
return item
|
||||||
},
|
},
|
||||||
point: function(can, item) { return new TMap.LatLng(item.latitude, item.longitude) },
|
point: function(can, item) { return new TMap.LatLng(item.latitude, item.longitude) },
|
||||||
plugin: function(can, item) { var extra = can.base.Obj(item.extra, {})
|
plugin: function(can, item) { var extra = can.base.Obj(item.extra, {})
|
||||||
if (!extra.index) { return can.onmotion.toggle(can, can.ui.profile, false) } can.onmotion.toggle(can, can.ui.profile, true)
|
can.onmotion.toggle(can, can.ui.profile, true)
|
||||||
if (can.onmotion.cache(can, function() { return item.hash }, can.ui.profile)) { return true}
|
if (can.onmotion.cache(can, function() { return item.hash }, can.ui.profile)) { return true }
|
||||||
|
if (!extra.index) { return can.onmotion.toggle(can, can.ui.profile, false)
|
||||||
|
var msg = can.request()
|
||||||
|
can.core.Item(item, function(key, value) { if (key == mdb.EXTRA) { return }
|
||||||
|
if (key == web.SPACE) { value = can.page.Format(html.A, can.misc.MergePodCmd(can, {pod: value}), value) }
|
||||||
|
msg.Push(mdb.KEY, key), msg.Push(mdb.VALUE, value)
|
||||||
|
}), can.onappend.table(can, msg, null, can.ui.profile)
|
||||||
|
return
|
||||||
|
}
|
||||||
can.onappend.plugin(can, {index: extra.index, args: extra.args}, function(sub) { item._plugin = sub
|
can.onappend.plugin(can, {index: extra.index, args: extra.args}, function(sub) { item._plugin = sub
|
||||||
sub.onaction._close = function() { can.onmotion.hidden(can, can.ui.profile) }
|
sub.onaction._close = function() { can.onmotion.hidden(can, can.ui.profile) }
|
||||||
sub.onexport.output = function() { sub.onimport.size(sub, can.ConfHeight()/2, can.ConfWidth()/2, true)
|
sub.onexport.output = function() { sub.onimport.size(sub, can.ConfHeight()/2, can.ConfWidth()/2, true)
|
||||||
@ -249,7 +257,7 @@ Volcanos(chat.ONACTION, {list: [
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
Volcanos(chat.ONEXPORT, {list: ["nation", "province", "city", "latitude", "longitude", "ip", "type", "name", "text"],
|
Volcanos(chat.ONEXPORT, {list: ["nation", "province", "city", "latitude", "longitude", "ip", "type", "name", "text", "space"],
|
||||||
point: function(can, point, item) { return can.base.Copy({latitude: point.lat, longitude: point.lng}, item, true) },
|
point: function(can, point, item) { return can.base.Copy({latitude: point.lat, longitude: point.lng}, item, true) },
|
||||||
center: function(can) { return can.onexport.point(can, can.map.getCenter()) },
|
center: function(can) { return can.onexport.point(can, can.map.getCenter()) },
|
||||||
current: function(can) {
|
current: function(can) {
|
||||||
|
@ -1,6 +1,14 @@
|
|||||||
fieldset.goods>div.output>div.item { border-radius:10px; height:170px; float:left; }
|
fieldset.goods>div.output>div.project { flex:0 0 80px; }
|
||||||
fieldset.goods>div.output>div.item>div { padding:10px; float:left; clear:none; }
|
fieldset.goods>div.output>div.layout>div.layout>div.content>div.item:not(.hide) {
|
||||||
fieldset.goods>div.output>div.item>div.image img { border-radius:10px; }
|
background-color:var(--plugin-bg-color); border-radius:10px; box-shadow:var(--box-shadow); margin:10px; float:left;
|
||||||
fieldset.goods>div.output>div.item>div.content { float:right; }
|
display:flex; height:150px;
|
||||||
fieldset.goods>div.output>div.item>div.content>div.title { white-space:break-spaces; overflow:hidden; height:50px; }
|
}
|
||||||
fieldset.goods>div.output>div.item>div.content>div.price { color:red; }
|
fieldset.goods>div.output>div.layout>div.layout>div.content>div.item>div { padding:10px; float:left; clear:none; }
|
||||||
|
fieldset.goods>div.output>div.layout>div.layout>div.content>div.item>div.image { flex-grow:0; }
|
||||||
|
fieldset.goods>div.output>div.layout>div.layout>div.content>div.item>div.image>img { height:100px; width:100px; }
|
||||||
|
fieldset.goods>div.output>div.layout>div.layout>div.content>div.item>div.content { flex-grow:1; }
|
||||||
|
fieldset.goods>div.output>div.layout>div.layout>div.content>div.item>div.content div.title { font-weight:bold; white-space:break-spaces; overflow:hidden; height:32px; }
|
||||||
|
fieldset.goods>div.output>div.layout>div.layout>div.content>div.item>div.content div.content { height:24px; }
|
||||||
|
fieldset.goods>div.output>div.layout>div.layout>div.content>div.item>div.content div.display { line-height:32px; }
|
||||||
|
fieldset.goods>div.output>div.layout>div.layout>div.content>div.item>div.content div.display>div { float:left; margin-right:5px; }
|
||||||
|
fieldset.goods>div.output>div.layout>div.layout>div.content>div.item>div.content div.price { color:red; }
|
||||||
|
@ -1,42 +1,28 @@
|
|||||||
Volcanos(chat.ONIMPORT, {
|
Volcanos(chat.ONIMPORT, {
|
||||||
_init: function(can, msg, target) {
|
_init: function(can, msg) { if (msg.IsDetail()) { return msg.Dump(can) }
|
||||||
can.page.Appends(can, target, msg.Table(function(item) {
|
var list = {}; can.ui = can.onappend.layout(can), can.onmotion.clear(can, can.ui.project)
|
||||||
|
can.page.Appends(can, can.ui.content, msg.Table(function(item) {
|
||||||
|
if (!list[item.zone]) { list[item.zone] = item, can.onimport.item(can, {name: item.zone}, function() {}) }
|
||||||
return {view: html.ITEM, list: [
|
return {view: html.ITEM, list: [
|
||||||
{view: wiki.IMAGE, list: [{img: can.misc.MergeCache(can, can.core.Split(item.image)[0]), width: 150, height: 150}]},
|
{view: wiki.IMAGE, list: [{img: can.misc.MergeCache(can, can.core.Split(item.image)[0])}]},
|
||||||
{view: wiki.CONTENT, list: [
|
{view: wiki.CONTENT, list: [
|
||||||
{view: [html.TITLE, html.DIV, item.name]},
|
{view: [html.TITLE, html.DIV, item.name]},
|
||||||
{view: [html.CONTENT, html.DIV, item.text]},
|
{view: [html.CONTENT, html.DIV, item.text]},
|
||||||
{view: html.DISPLAY, list: [
|
{view: html.DISPLAY, list: [
|
||||||
{view: [mall.PRICE, html.DIV, "¥ "+(item.price||0)], style: {"float": "left"}},
|
{view: [mall.PRICE, html.DIV, "¥ "+(item.price||0)]},
|
||||||
{view: [mall.COUNT, html.DIV, " 还剩 "+(item.count||0)+" 件"], style: {"float": "left"}},
|
{view: [mall.COUNT, html.DIV, "剩 "+(item.count||0)+" "+item.type]},
|
||||||
]},
|
]},
|
||||||
{view: html.ACTION, inner: item.action},
|
{view: html.ACTION, inner: item.action},
|
||||||
]},
|
]},
|
||||||
], onclick: function(event) {
|
], onclick: function(event) {
|
||||||
if (can.page.tagis(event.target, html.INPUT) && event.target.type == html.BUTTON) {
|
if (can.page.tagis(event.target, html.INPUT) && event.target.type == html.BUTTON) {
|
||||||
can.run(can.request(event, item), [ctx.ACTION, event.target.name])
|
can.run(can.request(event, item), [ctx.ACTION, event.target.name])
|
||||||
} else {
|
|
||||||
can.Option(mdb.HASH, item.hash), can.Update()
|
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
})), can.onimport.layout(can)
|
}))
|
||||||
},
|
},
|
||||||
layout: function(can) { var width = can.onexport.width(can)
|
layout: function(can) {
|
||||||
can.page.Select(can, can._output, "div.item>div.content", function(target) { can.page.styleWidth(can, target, width-190) })
|
can.page.style(can, can.ui.content, html.HEIGHT, can.ConfHeight())
|
||||||
can.isCmdMode() && can.page.styleHeight(can, can._output, can.ConfHeight())
|
can.ui.content && can.onlayout.expand(can, can.ui.content, 260)
|
||||||
},
|
},
|
||||||
}, [""])
|
}, [""])
|
||||||
Volcanos(chat.ONACTION, {list: ["music"],
|
|
||||||
"play": function(event, can, button) {
|
|
||||||
can._audio = can._audio||can.page.Append(can, can._output, [{type:"audio", src: "https://m701.music.126.net/20221029062844/f7593e1bb844dc4e35003543494314a2/jdyyaac/obj/w5rDlsOJwrLDjj7CmsOj/9879113394/5ffc/73bd/1a47/b11e9469bf4f6744db6e88c527a678df.m4a", _init: function(target) {
|
|
||||||
}}])._target
|
|
||||||
can._audio.play()
|
|
||||||
},
|
|
||||||
"stop": function(event, can, button) {
|
|
||||||
},
|
|
||||||
"music": function(event, can, button) {
|
|
||||||
},
|
|
||||||
})
|
|
||||||
Volcanos(chat.ONEXPORT, {
|
|
||||||
width: function(can) { if (can.ConfWidth() < 343) { return 343 } for (var i = 2; i < 10; i++) { if (can.ConfWidth() < 343*i) { return can.ConfWidth()/(i-1) } } },
|
|
||||||
})
|
|
||||||
|
@ -31,9 +31,9 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.onmotion.clear(
|
|||||||
_profile: function(can, task) { can.onmotion.toggle(can, can.ui.profile, true), can.onexport.hash(can, task)
|
_profile: function(can, task) { can.onmotion.toggle(can, can.ui.profile, true), can.onexport.hash(can, task)
|
||||||
if (can.onmotion.cache(can, function() { return can.sup.task = task, can.Status(task), [task.space, task.zone, task.id].join(nfs.PT) }, can.ui.profile)) { return }
|
if (can.onmotion.cache(can, function() { return can.sup.task = task, can.Status(task), [task.space, task.zone, task.id].join(nfs.PT) }, can.ui.profile)) { return }
|
||||||
task.extra && can.core.Item(can.base.Obj(task.extra), function(key, value) { task[key] = value }), delete(task.extra)
|
task.extra && can.core.Item(can.base.Obj(task.extra), function(key, value) { task[key] = value }), delete(task.extra)
|
||||||
var table = can.page.Appends(can, can.ui.profile, [{view: [chat.CONTENT, html.TABLE], list: [{th: [can.user.trans(can, mdb.KEY, "字段"), can.user.trans(can, mdb.VALUE, "属性")]}]}])._target
|
var table = can.page.Appends(can, can.ui.profile, [{view: [[chat.CONTENT, mdb.DETAIL], html.TABLE], list: [{th: [can.user.trans(can, mdb.KEY, "字段"), can.user.trans(can, mdb.VALUE, "属性")]}]}])._target
|
||||||
can.core.Item(task, function(key, value) { key != "_target" && can.page.Append(can, table, [{
|
can.core.Item(task, function(key, value) { key != "_target" && can.page.Append(can, table, [{
|
||||||
td: [key, key == web.SPACE && value != ""? can.page.Format(html.A, can.misc.MergeURL(can, {pod: value}), value): value],
|
td: [can.user.trans(can, key, null, html.INPUT), key == web.SPACE && value != ""? can.page.Format(html.A, can.misc.MergeURL(can, {pod: value}), value): value],
|
||||||
onclick: function(event) { can.page.tagis(event.target, html.INPUT) && event.target.type == html.BUTTON && can.run(can.request(event, task), [ctx.ACTION, event.target.name]) },
|
onclick: function(event) { can.page.tagis(event.target, html.INPUT) && event.target.type == html.BUTTON && can.run(can.request(event, task), [ctx.ACTION, event.target.name]) },
|
||||||
ondblclick: function(event) { if ([web.SPACE, mdb.ZONE, mdb.ID].indexOf(key) > -1) { return }
|
ondblclick: function(event) { if ([web.SPACE, mdb.ZONE, mdb.ID].indexOf(key) > -1) { return }
|
||||||
can.onmotion.modify(can, event.target, function(sub, value) { can.onaction.modifyTask(event, can, task, key, value) }, {name: key, action: key.indexOf(mdb.TIME) > 0? "date": "key"})
|
can.onmotion.modify(can, event.target, function(sub, value) { can.onaction.modifyTask(event, can, task, key, value) }, {name: key, action: key.indexOf(mdb.TIME) > 0? "date": "key"})
|
||||||
@ -149,7 +149,7 @@ Volcanos(chat.ONACTION, {list: [
|
|||||||
score: function(event, can, key, value) { can.onaction._filter(event, can, key, value) },
|
score: function(event, can, key, value) { can.onaction._filter(event, can, key, value) },
|
||||||
view: function(event, can, key, value) { can.Action(key, value), can.onmotion.clear(can, can.ui.project), can.onmotion.clear(can, can.ui.content), can.core.CallFunc([can.onimport, can.Option("scale")], [can, can._msg]) },
|
view: function(event, can, key, value) { can.Action(key, value), can.onmotion.clear(can, can.ui.project), can.onmotion.clear(can, can.ui.content), can.core.CallFunc([can.onimport, can.Option("scale")], [can, can._msg]) },
|
||||||
})
|
})
|
||||||
Volcanos(chat.ONEXPORT, {list: [mdb.COUNT, web.SPACE, team.BEGIN_TIME, mdb.ZONE, mdb.ID, mdb.TYPE, mdb.NAME, mdb.TEXT],
|
Volcanos(chat.ONEXPORT, {list: [mdb.COUNT, team.BEGIN_TIME, mdb.ZONE, mdb.ID, mdb.TYPE, mdb.NAME, mdb.TEXT, web.SPACE],
|
||||||
span: function(can) { return kit.Dict(team.DAY, 24*3600*1000, team.WEEK, 7*24*3600*1000, team.MONTH, 30*24*3600*1000, team.YEAR, 365*24*3600*1000, team.LONG, 365*24*3600*1000)[can.Option("scale")]||0 },
|
span: function(can) { return kit.Dict(team.DAY, 24*3600*1000, team.WEEK, 7*24*3600*1000, team.MONTH, 30*24*3600*1000, team.YEAR, 365*24*3600*1000, team.LONG, 365*24*3600*1000)[can.Option("scale")]||0 },
|
||||||
hash: function(can, task) { if (!can.isCmdMode()) { return } location.hash = [task.space, task.zone, task.id].join(nfs.DF) },
|
hash: function(can, task) { if (!can.isCmdMode()) { return } location.hash = [task.space, task.zone, task.id].join(nfs.DF) },
|
||||||
head: function(can, scale) { if ([team.YEAR, team.LONG].indexOf(scale) > -1) { return } return [scale].concat(can.user.time(can, "", "%W")) },
|
head: function(can, scale) { if ([team.YEAR, team.LONG].indexOf(scale) > -1) { return } return [scale].concat(can.user.time(can, "", "%W")) },
|
||||||
|
@ -44,11 +44,10 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.Conf(html.PADDI
|
|||||||
}); select && select.click()
|
}); select && select.click()
|
||||||
},
|
},
|
||||||
field: function(can, meta, target) { var item = can.base.Obj(meta.meta), width = item.width
|
field: function(can, meta, target) { var item = can.base.Obj(meta.meta), width = item.width
|
||||||
|
if (can.Option(nfs.PATH).indexOf(nfs.DF) > 0) { var ls = can.core.Split(can.Option(nfs.PATH), nfs.DF); item.space = ls[0] }
|
||||||
can.onappend.plugin(can, item, function(sub) { can._plugins = (can._plugins||[]).concat([sub])
|
can.onappend.plugin(can, item, function(sub) { can._plugins = (can._plugins||[]).concat([sub])
|
||||||
sub.onimport.size(sub, can.base.Min(can.ConfHeight()/2, 300, 600), sub.Conf("_width", width)||(can.ConfWidth()-2*can.Conf(html.PADDING)), true)
|
sub.onimport.size(sub, can.base.Min(can.ConfHeight()/2, 300, 600), sub.Conf("_width", width)||(can.ConfWidth()-2*can.Conf(html.PADDING)), true)
|
||||||
var size = sub.onimport.size; sub.onimport.size = function(can, height, width, auto, mode) { size(can, height, width, auto, mode)
|
var size = sub.onimport.size; sub.onimport.size = function(can, height, width, auto, mode) { size(can, height, width, auto, mode), can.page.style(can, sub._output, html.MAX_HEIGHT, "", "overflow-y", "hidden") }
|
||||||
can.page.style(can, sub._output, html.MAX_HEIGHT, "", "overflow-y", "hidden")
|
|
||||||
}
|
|
||||||
can.core.Value(item, "auto.cmd") && can.onmotion.delay(function() { sub.runAction(sub.request({}, can.core.Value(item, "opts")), can.core.Value(item, "auto.cmd")) })
|
can.core.Value(item, "auto.cmd") && can.onmotion.delay(function() { sub.runAction(sub.request({}, can.core.Value(item, "opts")), can.core.Value(item, "auto.cmd")) })
|
||||||
}, can._output, target)
|
}, can._output, target)
|
||||||
},
|
},
|
||||||
|
@ -9,7 +9,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.onmotion.clear(
|
|||||||
},
|
},
|
||||||
card: function(can, msg, target) {
|
card: function(can, msg, target) {
|
||||||
can.sup.onexport.outputMargin = function() { return 211 }
|
can.sup.onexport.outputMargin = function() { return 211 }
|
||||||
can.page.Appends(can, target||can._output, msg.Table(function(value) {
|
can.page.Appends(can, target||can._output, msg.Table(function(value) { value.icon = value.icon||value.image
|
||||||
return {view: [[html.ITEM, value.status]], list: [
|
return {view: [[html.ITEM, value.status]], list: [
|
||||||
{view: [wiki.TITLE, html.DIV], list: [value.icon && {img: can.misc.Resource(can, value.icon, value.name)}, {text: value.name}]},
|
{view: [wiki.TITLE, html.DIV], list: [value.icon && {img: can.misc.Resource(can, value.icon, value.name)}, {text: value.name}]},
|
||||||
{view: [wiki.CONTENT, html.DIV, value.text]},
|
{view: [wiki.CONTENT, html.DIV, value.text]},
|
||||||
@ -184,7 +184,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.onmotion.clear(
|
|||||||
can.core.Next(list.reverse(), function(meta, next) { can.base.isString(meta) && (meta = {index: meta}), meta.mode = html.FLOAT
|
can.core.Next(list.reverse(), function(meta, next) { can.base.isString(meta) && (meta = {index: meta}), meta.mode = html.FLOAT
|
||||||
can.onimport.plug(can, meta, function(sub) {
|
can.onimport.plug(can, meta, function(sub) {
|
||||||
sub.onexport.output = function() { var width = can.ConfWidth()-(can.ui && can.ui.project? can.ui.project.offsetWidth: 0)
|
sub.onexport.output = function() { var width = can.ConfWidth()-(can.ui && can.ui.project? can.ui.project.offsetWidth: 0)
|
||||||
can.page.style(can, can._output, html.MAX_HEIGHT, "", html.HEIGHT, "", html.WIDTH, "", html.MAX_WIDTH, "")
|
can.page.style(can, sub._output, html.MAX_HEIGHT, "", html.HEIGHT, "", html.WIDTH, "", html.MAX_WIDTH, "")
|
||||||
sub.onimport.size(sub, can.ConfHeight()/2, can.base.Min(sub._target.offsetWidth, width/2, width/(can.base.isIn(sub.ConfIndex(), code.COMPILE, cli.RUNTIME)? 1: 2)), true)
|
sub.onimport.size(sub, can.ConfHeight()/2, can.base.Min(sub._target.offsetWidth, width/2, width/(can.base.isIn(sub.ConfIndex(), code.COMPILE, cli.RUNTIME)? 1: 2)), true)
|
||||||
}
|
}
|
||||||
can.onmotion.hidden(can, sub._target), sub._legend._target = sub._target, sub._legend._meta = {index: meta.index}
|
can.onmotion.hidden(can, sub._target), sub._legend._target = sub._target, sub._legend._meta = {index: meta.index}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user