mirror of
https://shylinux.com/x/volcanos
synced 2025-07-01 20:11:19 +08:00
add some
This commit is contained in:
parent
8360c62d23
commit
273dc46c08
7
frame.js
7
frame.js
@ -815,6 +815,7 @@ Volcanos(chat.ONAPPEND, {
|
|||||||
onmousemove: function(event) { if (!hbegin) { return } target.scrollLeft = hbegin.left+(event.x-hbegin.x)/target.offsetWidth*target.scrollWidth, can.onkeymap.prevent(event) },
|
onmousemove: function(event) { if (!hbegin) { return } target.scrollLeft = hbegin.left+(event.x-hbegin.x)/target.offsetWidth*target.scrollWidth, can.onkeymap.prevent(event) },
|
||||||
onmouseup: function(event) { hbegin = null, delete(window._mousemove) },
|
onmouseup: function(event) { hbegin = null, delete(window._mousemove) },
|
||||||
}])._target
|
}])._target
|
||||||
|
can.ui.vbar = vbar, can.ui.hbar = hbar
|
||||||
target.addEventListener("scroll", function(event) {
|
target.addEventListener("scroll", function(event) {
|
||||||
var height = can.base.Min(target.offsetHeight*target.offsetHeight/target.scrollHeight, target.offsetHeight/4)
|
var height = can.base.Min(target.offsetHeight*target.offsetHeight/target.scrollHeight, target.offsetHeight/4)
|
||||||
vbar.innerHTML = `${(target.scrollTop*100/(target.scrollHeight-target.offsetHeight)).toFixed(2)}%`
|
vbar.innerHTML = `${(target.scrollTop*100/(target.scrollHeight-target.offsetHeight)).toFixed(2)}%`
|
||||||
@ -1407,10 +1408,10 @@ Volcanos(chat.ONMOTION, {
|
|||||||
target.ontouchmove = function(event) { var msg = can.request(event)
|
target.ontouchmove = function(event) { var msg = can.request(event)
|
||||||
if (msg.Option(ice.MSG_HANDLE) == ice.TRUE) { return } msg.Option(ice.MSG_HANDLE, ice.TRUE)
|
if (msg.Option(ice.MSG_HANDLE) == ice.TRUE) { return } msg.Option(ice.MSG_HANDLE, ice.TRUE)
|
||||||
spanY = event.touches[0].clientY-beginY, spanX = event.touches[0].clientX-beginX
|
spanY = event.touches[0].clientY-beginY, spanX = event.touches[0].clientX-beginX
|
||||||
if (can.page.tagis(event.target, "table.content")) { return }
|
|
||||||
if (can.page.tagis(event.target, "th")) { return }
|
|
||||||
if (can.page.tagis(event.target, "td")) { return }
|
|
||||||
if (can.page.tagis(event.target.parentNode, "div.tabs")) { return }
|
if (can.page.tagis(event.target.parentNode, "div.tabs")) { return }
|
||||||
|
if (can.page.tagis(event.target, "table.content.scroll")) { return }
|
||||||
|
// if (can.page.tagis(event.target, "th")) { return }
|
||||||
|
// if (can.page.tagis(event.target, "td")) { return }
|
||||||
if (Math.abs(spanX) > Math.abs(spanY)) { can.onkeymap.prevent(event) }
|
if (Math.abs(spanX) > Math.abs(spanY)) { can.onkeymap.prevent(event) }
|
||||||
can.onaction.onslidemove(event, can, data = {beginX: beginX, beginY: beginY, spanX: spanX, spanY: spanY}, direction())
|
can.onaction.onslidemove(event, can, data = {beginX: beginX, beginY: beginY, spanX: spanX, spanY: spanY}, direction())
|
||||||
}
|
}
|
||||||
|
24
index.css
24
index.css
@ -1,7 +1,7 @@
|
|||||||
/* variable */
|
/* variable */
|
||||||
body {
|
body {
|
||||||
--code-bg-color:black; --code-fg-color:silver;
|
--code-bg-color:black; --code-fg-color:silver;
|
||||||
--disable-fg-color:gray; --notice-color:blue; --danger-color:red;
|
--notice-color:blue; --danger-color:red; --label-fg-color:gray; --disable-fg-color:gray;
|
||||||
// --shadow-color:var(--disable-fg-color); --border-color:var(--disable-fg-color);
|
// --shadow-color:var(--disable-fg-color); --border-color:var(--disable-fg-color);
|
||||||
--shadow-color:transparent; --border-color:var(--disable-fg-color);
|
--shadow-color:transparent; --border-color:var(--disable-fg-color);
|
||||||
--notice-bg-color:var(--notice-color); --notice-fg-color:white;
|
--notice-bg-color:var(--notice-color); --notice-fg-color:white;
|
||||||
@ -47,7 +47,7 @@ body {
|
|||||||
--header-height:48px; --footer-height:var(--action-height);
|
--header-height:48px; --footer-height:var(--action-height);
|
||||||
--action-height:32px; --status-height:32px; --textarea-height:96px;
|
--action-height:32px; --status-height:32px; --textarea-height:96px;
|
||||||
--input-width:140px; --button-width:60px; --form-width:360px; --url-input-width:480px;
|
--input-width:140px; --button-width:60px; --form-width:360px; --url-input-width:480px;
|
||||||
--card-width:300px; --card-height:160px; --qrcode-width:240px; --qrcode-height:323px;
|
--card-width:300px; --card-height:160px; --qrcode-width:240px; --qrcode-height:243px;
|
||||||
--story-height:var(--float-height); --iframe-height:480px;
|
--story-height:var(--float-height); --iframe-height:480px;
|
||||||
--plug-height:480px; --plug-width:var(--float-width);
|
--plug-height:480px; --plug-width:var(--float-width);
|
||||||
--desktop-height:684px; --desktop-width:var(--float-width);
|
--desktop-height:684px; --desktop-width:var(--float-width);
|
||||||
@ -162,7 +162,7 @@ body.width1 table.content.checkbox td:first-child { padding:var(--table-padding)
|
|||||||
body.width1 table.content.action th:last-child { padding:var(--table-padding) var(--input-padding); }
|
body.width1 table.content.action th:last-child { padding:var(--table-padding) var(--input-padding); }
|
||||||
body.width1 table.content.action td:last-child { padding:var(--table-padding) var(--input-padding); }
|
body.width1 table.content.action td:last-child { padding:var(--table-padding) var(--input-padding); }
|
||||||
body.width1 table.content.detail thead { display:none; }
|
body.width1 table.content.detail thead { display:none; }
|
||||||
table.content input { border:none; background-color:var(--th-bg-color); padding:var(--input-padding); }
|
table.content input { border:none; padding:var(--input-padding); }
|
||||||
table.content input:not(:last-child) { margin-right:var(--input-margin); }
|
table.content input:not(:last-child) { margin-right:var(--input-margin); }
|
||||||
body:not(.mobile) fieldset.Action:not(.tabview):not(.horizon):not(.grid) fieldset.plugin:not(.float):not(.full):not(.cmd)>div.output>table.content td i { display:none; }
|
body:not(.mobile) fieldset.Action:not(.tabview):not(.horizon):not(.grid) fieldset.plugin:not(.float):not(.full):not(.cmd)>div.output>table.content td i { display:none; }
|
||||||
body:not(.mobile) fieldset.Action:not(.tabview):not(.horizon):not(.grid) fieldset.plugin:not(.float):not(.full):not(.cmd)>div.output>table.content td input.icons { display:unset; }
|
body:not(.mobile) fieldset.Action:not(.tabview):not(.horizon):not(.grid) fieldset.plugin:not(.float):not(.full):not(.cmd)>div.output>table.content td input.icons { display:unset; }
|
||||||
@ -245,8 +245,10 @@ div.output>div.layout>div.layout { position:relative; }
|
|||||||
/* project */
|
/* project */
|
||||||
div.project { background-color:var(--plugin-bg-color); }
|
div.project { background-color:var(--plugin-bg-color); }
|
||||||
div.project div.action:not(.hide) { width:100%; display:flex; overflow:hidden; }
|
div.project div.action:not(.hide) { width:100%; display:flex; overflow:hidden; }
|
||||||
div.project div.action div.item input { border-right:var(--box-border); }
|
// div.project div.action div.item input { border-right:var(--box-border); }
|
||||||
div.project div.action div.item input:hover { border-right:var(--box-notice); }
|
div.project div.action div.item input:hover { border-right:var(--box-notice); }
|
||||||
|
div.project div.action div.item input { border-right:none; }
|
||||||
|
// div.project div.action div.item input:hover { border-right:none; }
|
||||||
div.project div.action div.item.icons input { display:none; }
|
div.project div.action div.item.icons input { display:none; }
|
||||||
div.project div.action div.item.icons { background-color:var(--plugin-bg-color); padding:0; }
|
div.project div.action div.item.icons { background-color:var(--plugin-bg-color); padding:0; }
|
||||||
div.project div.expand { margin-right:var(--input-margin); width:5px; float:left; transform: translate(1px, -1px) rotate(0deg); transition:all .5s; }
|
div.project div.expand { margin-right:var(--input-margin); width:5px; float:left; transform: translate(1px, -1px) rotate(0deg); transition:all .5s; }
|
||||||
@ -381,7 +383,7 @@ div.toast.float>div.close { color:var(--notice-bg-color); float:right; cursor:po
|
|||||||
div.toast.float>div.close:hover { background-color:var(--hover-bg-color); color:var(--hover-fg-color); }
|
div.toast.float>div.close:hover { background-color:var(--hover-bg-color); color:var(--hover-fg-color); }
|
||||||
div.toast.float div.duration { color:var(--disable-fg-color); float:right; }
|
div.toast.float div.duration { color:var(--disable-fg-color); float:right; }
|
||||||
div.toast.float div.duration { font-size:var(--status-font-size); }
|
div.toast.float div.duration { font-size:var(--status-font-size); }
|
||||||
div.toast.float div.title { font-size:var(--status-font-size); }
|
div.toast.float div.title { font-size:var(--status-font-size); max-width:240px; }
|
||||||
div.toast.float div.content { color:var(--notice-bg-color); white-space:pre-line; text-align:center; padding:var(--input-padding); margin-bottom:var(--input-margin); min-height:28px; }
|
div.toast.float div.content { color:var(--notice-bg-color); white-space:pre-line; text-align:center; padding:var(--input-padding); margin-bottom:var(--input-margin); min-height:28px; }
|
||||||
div.toast.float.warn div.content { white-space:pre-wrap; text-align:left; display:block; overflow:auto; }
|
div.toast.float.warn div.content { white-space:pre-wrap; text-align:left; display:block; overflow:auto; }
|
||||||
div.toast.float div.progress { margin-left:0px; height:5px; }
|
div.toast.float div.progress { margin-left:0px; height:5px; }
|
||||||
@ -393,6 +395,7 @@ div.toast.float div.action>div.item input { padding:0 20px; }
|
|||||||
div.toast.float div.action>div.item.danger input { border:var(--box-danger); }
|
div.toast.float div.action>div.item.danger input { border:var(--box-danger); }
|
||||||
div.toast.float div.action>div.item.notice input { border:var(--box-notice); }
|
div.toast.float div.action>div.item.notice input { border:var(--box-notice); }
|
||||||
div.toast.float div.action>div.item.open input { border:var(--box-notice); }
|
div.toast.float div.action>div.item.open input { border:var(--box-notice); }
|
||||||
|
div.toast.float div.action>div.item.open:hover input { background-color:var(--notice-bg-color); }
|
||||||
body>div.loading { white-space:pre; text-align:center; padding:20px; width:100%; position:absolute; left:0; top:0; z-index:5; }
|
body>div.loading { white-space:pre; text-align:center; padding:20px; width:100%; position:absolute; left:0; top:0; z-index:5; }
|
||||||
body>div.carte { border:0; padding:0; }
|
body>div.carte { border:0; padding:0; }
|
||||||
body>div.carte input[name=filter] { margin:var(--input-margin); width:calc(100% - 10px); position:sticky; top:var(--input-margin); }
|
body>div.carte input[name=filter] { margin:var(--input-margin); width:calc(100% - 10px); position:sticky; top:var(--input-margin); }
|
||||||
@ -440,6 +443,11 @@ body div.input.float select { width:var(--form-width) !important; }
|
|||||||
body div.input.float input.select[type=button] { width:var(--form-width) !important; }
|
body div.input.float input.select[type=button] { width:var(--form-width) !important; }
|
||||||
body div.input.float input:not([type=button]) { width:var(--form-width) !important; padding:0 24px; }
|
body div.input.float input:not([type=button]) { width:var(--form-width) !important; padding:0 24px; }
|
||||||
body div.input.float input[type=text] { width:var(--form-width) !important; padding:0 24px; }
|
body div.input.float input[type=text] { width:var(--form-width) !important; padding:0 24px; }
|
||||||
|
body div.input.float div.prompt { font-size:12px; color:gray; }
|
||||||
|
body:not(.mobile) div.input.float tr td:first-child {
|
||||||
|
line-height:32px;
|
||||||
|
vertical-align:top;
|
||||||
|
}
|
||||||
body div.input.float input[name=cancel] { border:var(--box-danger); background-color:transparent; color:var(--danger-bg-color); }
|
body div.input.float input[name=cancel] { border:var(--box-danger); background-color:transparent; color:var(--danger-bg-color); }
|
||||||
body.mobile div.input.float input[name=submit] { border:var(--box-notice); background-color:var(--notice-bg-color); color:var(--notice-fg-color); }
|
body.mobile div.input.float input[name=submit] { border:var(--box-notice); background-color:var(--notice-bg-color); color:var(--notice-fg-color); }
|
||||||
body div.input.float input[name=submit]:hover { background-color:var(--notice-bg-color); color:var(--notice-fg-color); }
|
body div.input.float input[name=submit]:hover { background-color:var(--notice-bg-color); color:var(--notice-fg-color); }
|
||||||
@ -577,7 +585,7 @@ body.mobile div.action div.tabs:not(.select) { display:none; }
|
|||||||
div.zone>div.item { background-color:var(--th-bg-color); }
|
div.zone>div.item { background-color:var(--th-bg-color); }
|
||||||
div.zone>div.list>div.zone>div.item { background-color:var(--th-bg-color); }
|
div.zone>div.list>div.zone>div.item { background-color:var(--th-bg-color); }
|
||||||
div.tabs div { background-color:var(--plugin-bg-color); }
|
div.tabs div { background-color:var(--plugin-bg-color); }
|
||||||
div.tabs div:hover { background-color:var(--hover-bg-color); color:var(--hover-fg-color); }
|
body:not(.mobile) div.tabs div:hover { background-color:var(--hover-bg-color); color:var(--hover-fg-color); }
|
||||||
div.tabs div.select { background-color:var(--hover-bg-color); color:var(--hover-fg-color); }
|
div.tabs div.select { background-color:var(--hover-bg-color); color:var(--hover-fg-color); }
|
||||||
div.plug>legend { background-color:var(--output-bg-color); }
|
div.plug>legend { background-color:var(--output-bg-color); }
|
||||||
div.plug>legend:hover { background-color:var(--hover-bg-color); }
|
div.plug>legend:hover { background-color:var(--hover-bg-color); }
|
||||||
@ -690,7 +698,7 @@ legend { font-size:var(--legend-font-size); line-height:30px; height:var(--actio
|
|||||||
legend>img { margin-right:var(--input-margin); height:28px; display:block; float:left; }
|
legend>img { margin-right:var(--input-margin); height:28px; display:block; float:left; }
|
||||||
legend>span.icon:first-child { margin-right:var(--input-margin); }
|
legend>span.icon:first-child { margin-right:var(--input-margin); }
|
||||||
legend>i:first-child { margin-right:var(--input-margin); }
|
legend>i:first-child { margin-right:var(--input-margin); }
|
||||||
select, input { font-size:var(--body-font-size); height:var(--action-height); } input::placeholder, textarea::placeholder { font-style:italic; color:var(--disable-fg-color); }
|
select, input { font-size:var(--body-font-size); height:var(--action-height); } input::placeholder, textarea::placeholder { font-style:italic; color:var(--label-fg-color); }
|
||||||
input[type=checkbox] { height:16px; width:16px; cursor:pointer; }
|
input[type=checkbox] { height:16px; width:16px; cursor:pointer; }
|
||||||
textarea { font-family:var(--input-font-family); font-size:var(--body-font-size); padding:var(--input-padding); height:var(--textarea-height); width:100%; outline:none; resize:vertical; }
|
textarea { font-family:var(--input-font-family); font-size:var(--body-font-size); padding:var(--input-padding); height:var(--textarea-height); width:100%; outline:none; resize:vertical; }
|
||||||
table.content.full { width:100%; }
|
table.content.full { width:100%; }
|
||||||
@ -770,7 +778,7 @@ body:not(.width2):not(.mobile) fieldset.plugin.feel>form.option>div.item.text.fi
|
|||||||
body:not(.width2) fieldset>div.action>div.item.text.filter>input { width:var(--input-width); height:30px; transition:all 1.2s; }
|
body:not(.width2) fieldset>div.action>div.item.text.filter>input { width:var(--input-width); height:30px; transition:all 1.2s; }
|
||||||
body:not(.width2) fieldset>div.action>div.item.text.filter>input:focus { width:var(--project-width); transition:all 0.5s; }
|
body:not(.width2) fieldset>div.action>div.item.text.filter>input:focus { width:var(--project-width); transition:all 0.5s; }
|
||||||
div.item.text.will>input { border:var(--box-notice); }
|
div.item.text.will>input { border:var(--box-notice); }
|
||||||
div.item.text>i:first-child { color:var(--disable-fg-color); line-height:22px; padding:var(--input-padding); position:absolute; left:0; }
|
div.item.text>i:first-child { color:var(--label-fg-color); line-height:22px; padding:var(--input-padding); position:absolute; left:0; }
|
||||||
body:mobile(.mobile) div.item.text:hover>i:first-child { color:unset; }
|
body:mobile(.mobile) div.item.text:hover>i:first-child { color:unset; }
|
||||||
div.item.text>span.icon { font-size:var(--icon-font-size); padding:var(--input-padding); position:absolute; right:0; visibility:hidden; }
|
div.item.text>span.icon { font-size:var(--icon-font-size); padding:var(--input-padding); position:absolute; right:0; visibility:hidden; }
|
||||||
body:not(.mobile) div.item.text:hover>span.icon { visibility:visible; }
|
body:not(.mobile) div.item.text:hover>span.icon { visibility:visible; }
|
||||||
|
@ -286,6 +286,10 @@ Volcanos("user", {
|
|||||||
if (target.value && hidden) { can.onmotion.hidden(can, can.page.parentNode(can, target, html.TR)) }
|
if (target.value && hidden) { can.onmotion.hidden(can, can.page.parentNode(can, target, html.TR)) }
|
||||||
return target.value
|
return target.value
|
||||||
},
|
},
|
||||||
|
Prompt: function(key, value) {
|
||||||
|
var target = can.page.Select(can, ui._target, "div.item."+key)[0]
|
||||||
|
target && can.page.Append(can, target.parentNode, [{view: [[html.ITEM, "prompt"], "", value], style: {width: target.offsetWidth}}])
|
||||||
|
},
|
||||||
layout: function(event) {
|
layout: function(event) {
|
||||||
if (event && event.target) { can.onlayout.figure(event, can, ui._target)
|
if (event && event.target) { can.onlayout.figure(event, can, ui._target)
|
||||||
can.user.isMobile && can.page.style(can, ui._target, html.LEFT, (can.page.width()-ui._target.offsetWidth)/2, html.TOP, 40)
|
can.user.isMobile && can.page.style(can, ui._target, html.LEFT, (can.page.width()-ui._target.offsetWidth)/2, html.TOP, 40)
|
||||||
@ -445,8 +449,7 @@ Volcanos("user", {
|
|||||||
}},
|
}},
|
||||||
avatar: {view: [[html.ITEM, "state", aaa.AVATAR]], list: [{img: can.misc.Resource(can, can.user.info.avatar)}], onclick: function(event) { header && header.onaction.avatar(event, header) }},
|
avatar: {view: [[html.ITEM, "state", aaa.AVATAR]], list: [{img: can.misc.Resource(can, can.user.info.avatar)}], onclick: function(event) { header && header.onaction.avatar(event, header) }},
|
||||||
usernick: {view: [[html.ITEM, "state", aaa.USERNICK, html.FLEX], "", can.user.info.usernick], onclick: function(event) { header && header.onaction.usernick(event, header) }, _init: function(target) {
|
usernick: {view: [[html.ITEM, "state", aaa.USERNICK, html.FLEX], "", can.user.info.usernick], onclick: function(event) { header && header.onaction.usernick(event, header) }, _init: function(target) {
|
||||||
can = can._fields? can.sup: can
|
can = can._fields? can.sup: can; can.ui.head = target.parentNode
|
||||||
can.ui.head = target.parentNode
|
|
||||||
}},
|
}},
|
||||||
qrcode: {view: [[html.ITEM, "state", cli.QRCODE]], list: [{icon: icon.qrcode}], onclick: function(event) { var _can = can._fields? can.sup: can; _can.onaction["生成链接"](event, _can) }},
|
qrcode: {view: [[html.ITEM, "state", cli.QRCODE]], list: [{icon: icon.qrcode}], onclick: function(event) { var _can = can._fields? can.sup: can; _can.onaction["生成链接"](event, _can) }},
|
||||||
}; return can.core.List(can.base.getValid(can.core.List(arguments).slice(1), [html.SPACE, mdb.TIME, aaa.AVATAR, aaa.USERNICK, cli.QRCODE]), function(item) { return meta[item] })
|
}; return can.core.List(can.base.getValid(can.core.List(arguments).slice(1), [html.SPACE, mdb.TIME, aaa.AVATAR, aaa.USERNICK, cli.QRCODE]), function(item) { return meta[item] })
|
||||||
|
@ -96,16 +96,13 @@ Volcanos(chat.ONACTION, {_init: function(can) {},
|
|||||||
can.user.info.usernick = can.Conf(aaa.USERNICK)
|
can.user.info.usernick = can.Conf(aaa.USERNICK)
|
||||||
can.user.info.repos = msg.Option(nfs.REPOS)
|
can.user.info.repos = msg.Option(nfs.REPOS)
|
||||||
can.user.info.email = msg.Option(aaa.EMAIL)
|
can.user.info.email = msg.Option(aaa.EMAIL)
|
||||||
can.user.info.avatar = msg.Option(aaa.AVATAR)
|
can.user.info.avatar = msg.Option(aaa.AVATAR)||msg.Option("user.avatar")
|
||||||
can.user.info.background = msg.Option(aaa.BACKGROUND)
|
can.user.info.background = msg.Option(aaa.BACKGROUND)
|
||||||
can.user.info.favicon = msg.Option("favicon")
|
can.user.info.favicon = msg.Option("favicon")
|
||||||
can.user.info.titles = msg.Option("titles")||document.title
|
can.user.info.titles = msg.Option("titles")||document.title
|
||||||
lang(msg, function() { can.onmotion.clear(can), can.onimport._init(can, can.request(), can._output), can.onengine.signal(can, chat.ONLOGIN) })
|
lang(msg, function() { can.onmotion.clear(can), can.onimport._init(can, can.request(), can._output), can.onengine.signal(can, chat.ONLOGIN) })
|
||||||
}
|
}
|
||||||
can.run(can.request({}, {_method: http.GET}), [], function(msg) { lang(msg)
|
can.run(can.request({}, {_method: http.GET}), [], function(msg) { lang(msg)
|
||||||
if (msg.Option(ice.MSG_PROCESS) == "_open") {
|
|
||||||
// return can.user.jumps(msg.Option("_arg"))
|
|
||||||
}
|
|
||||||
can.ui.diy = can.base.Obj(msg.Option("diy"))||{}, can.__theme = can.onimport._theme(can, can.page.theme(function(theme) {
|
can.ui.diy = can.base.Obj(msg.Option("diy"))||{}, can.__theme = can.onimport._theme(can, can.page.theme(function(theme) {
|
||||||
can.onengine.signal(can, chat.ONTHEMECHANGE, can.request(event, {theme: can.__theme = can.onimport._theme(can, theme)})), can.onimport.theme(can)
|
can.onengine.signal(can, chat.ONTHEMECHANGE, can.request(event, {theme: can.__theme = can.onimport._theme(can, theme)})), can.onimport.theme(can)
|
||||||
})), can.onimport.theme(can, can.misc.Search(can, "theme")||"")
|
})), can.onimport.theme(can, can.misc.Search(can, "theme")||"")
|
||||||
@ -119,7 +116,7 @@ Volcanos(chat.ONACTION, {_init: function(can) {},
|
|||||||
msg.Option(mdb.PLUGIN) && can.onappend.plugin(can, {space: msg.plugin[1], index: msg.Option(mdb.PLUGIN)}, function(sub) { can.onmotion.hidden(can, sub._target) }, document.body)
|
msg.Option(mdb.PLUGIN) && can.onappend.plugin(can, {space: msg.plugin[1], index: msg.Option(mdb.PLUGIN)}, function(sub) { can.onmotion.hidden(can, sub._target) }, document.body)
|
||||||
msg.Option(nfs.SCRIPT) && can.require(can.base.Obj(msg.Option(nfs.SCRIPT)), function(can) { can.onaction.source(can, msg) })
|
msg.Option(nfs.SCRIPT) && can.require(can.base.Obj(msg.Option(nfs.SCRIPT)), function(can) { can.onaction.source(can, msg) })
|
||||||
var tool = can._root.Action._conf.tool
|
var tool = can._root.Action._conf.tool
|
||||||
if (can.Conf(aaa.USERNICK, (msg.Option(aaa.USERNICK)||msg.Option(ice.MSG_USERNICK)||msg.Option(ice.MSG_USERNAME)).slice(0, 8))
|
if (can.Conf(aaa.USERNICK, (msg.Option(aaa.USERNICK)||msg.Option(ice.MSG_USERNICK)||msg.Option(ice.MSG_USERNAME)).slice(0, 16))
|
||||||
|| can.misc.Search(can, web.SHARE) || tool && can.base.isIn(can.user.info._cmd = tool[0]._command, "web.chat.oauth.client", web.PORTAL, aaa.OFFER, aaa.APPLY)) { return show(msg) }
|
|| can.misc.Search(can, web.SHARE) || tool && can.base.isIn(can.user.info._cmd = tool[0]._command, "web.chat.oauth.client", web.PORTAL, aaa.OFFER, aaa.APPLY)) { return show(msg) }
|
||||||
can.onlayout._init(can), can.user.login(can, function() { can.onengine.signal(can, chat.ONMAIN, msg) }, msg)
|
can.onlayout._init(can), can.user.login(can, function() { can.onengine.signal(can, chat.ONMAIN, msg) }, msg)
|
||||||
})
|
})
|
||||||
|
@ -3,8 +3,11 @@ Volcanos(chat.ONFIGURE, {key: {
|
|||||||
if (target._done && target.value) { return can.onmotion.hidden(can, can._target, can.Status("total") > 0)} target._done = true
|
if (target._done && target.value) { return can.onmotion.hidden(can, can._target, can.Status("total") > 0)} target._done = true
|
||||||
can.onmotion.focus(can, target), can.onmotion.hidden(can, can._target)
|
can.onmotion.focus(can, target), can.onmotion.hidden(can, can._target)
|
||||||
can.runAction(event, mdb.INPUTS, [name, value||""], function(msg) {
|
can.runAction(event, mdb.INPUTS, [name, value||""], function(msg) {
|
||||||
name == ctx.INDEX && can.core.Item(can.onengine.plugin.meta, function(key) { msg.Push(ctx.INDEX, can.core.Keys(ice.CAN, key)) })
|
if (can.sup.ConfIndex() != "web.team.production.case") {
|
||||||
|
name == ctx.INDEX && can.core.Item(can.onengine.plugin.meta, function(key) { msg.Push(ctx.INDEX, can.core.Keys(ice.CAN, key)) })
|
||||||
|
}
|
||||||
can._show(can, msg, cb, target, name)
|
can._show(can, msg, cb, target, name)
|
||||||
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
_show: function(can, msg, cb, target, name) {
|
_show: function(can, msg, cb, target, name) {
|
||||||
|
@ -13,4 +13,7 @@ Volcanos(chat.ONFIGURE, {upload: {
|
|||||||
target.value = msg.Result()
|
target.value = msg.Result()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
onfocus: function(event, can, meta, target, cbs, mod) {
|
||||||
|
can.onmotion.delay(can, function() { target.blur() })
|
||||||
|
},
|
||||||
}})
|
}})
|
@ -35,8 +35,8 @@ fieldset.inner>div.output>div.layout>div.layout>div.profile h2 { border-bottom:v
|
|||||||
fieldset.inner>div.output>div.layout>div.layout>div.profile pre>code { padding-left:var(--table-padding); border-left:var(--box-notice3); display:block; }
|
fieldset.inner>div.output>div.layout>div.layout>div.profile pre>code { padding-left:var(--table-padding); border-left:var(--box-notice3); display:block; }
|
||||||
fieldset.inner>div.output>div.layout>div.layout>div.profile>div.code { white-space:unset; padding:var(--table-padding); }
|
fieldset.inner>div.output>div.layout>div.layout>div.profile>div.code { white-space:unset; padding:var(--table-padding); }
|
||||||
fieldset.inner>div.output>div.layout>div.layout>div.profile>div.status { background-color:var(--output-bg-color); height:var(--action-height); overflow:auto; position:sticky; bottom:0; }
|
fieldset.inner>div.output>div.layout>div.layout>div.profile>div.status { background-color:var(--output-bg-color); height:var(--action-height); overflow:auto; position:sticky; bottom:0; }
|
||||||
fieldset.inner>div.output>div.layout>div.layout>div.profile fieldset>form.option>div.item.text input { max-width:80px; }
|
// fieldset.inner>div.output>div.layout>div.layout>div.profile fieldset>form.option>div.item.text input { max-width:80px; }
|
||||||
fieldset.inner>div.output>div.layout>div.layout>div.profile fieldset>div.action>div.item.text input { max-width:80px; }
|
// fieldset.inner>div.output>div.layout>div.layout>div.profile fieldset>div.action>div.item.text input { max-width:80px; }
|
||||||
fieldset.inner>div.output>div.layout>div.layout>div.profile div.status>div { font-style:italic; font-size:var(--status-font-size); padding:var(--input-padding); float:left; }
|
fieldset.inner>div.output>div.layout>div.layout>div.profile div.status>div { font-style:italic; font-size:var(--status-font-size); padding:var(--input-padding); float:left; }
|
||||||
fieldset.inner>div.output>div.layout>div.layout>div.content div.tips { color:var(--disable-fg-color); font-style:italic; line-height:var(--code-line-height); position:absolute; top:0; right:10px; }
|
fieldset.inner>div.output>div.layout>div.layout>div.content div.tips { color:var(--disable-fg-color); font-style:italic; line-height:var(--code-line-height); position:absolute; top:0; right:10px; }
|
||||||
fieldset.inner>div.output>div.layout>div.layout>fieldset.story { box-shadow:unset; }
|
fieldset.inner>div.output>div.layout>div.layout>fieldset.story { box-shadow:unset; }
|
||||||
|
@ -226,7 +226,8 @@ Volcanos(chat.ONIMPORT, {
|
|||||||
item.file && can.onimport.tabview(can, item.path, item.file||can.Option(nfs.FILE), item.line)
|
item.file && can.onimport.tabview(can, item.path, item.file||can.Option(nfs.FILE), item.line)
|
||||||
}} }, target), can.onappend.board(can, msg, target), msg.Option(ice.MSG_STATUS) && can.onappend._status(can, msg.Option(ice.MSG_STATUS), can.page.Append(can, target, [html.STATUS])._target)
|
}} }, target), can.onappend.board(can, msg, target), msg.Option(ice.MSG_STATUS) && can.onappend._status(can, msg.Option(ice.MSG_STATUS), can.page.Append(can, target, [html.STATUS])._target)
|
||||||
} else {
|
} else {
|
||||||
return can.onmotion.toggle(can, target, false), can.onimport.layout(can), can.user.toastFailure(can, "nothing to display")
|
return can.onmotion.toggle(can, target, false), can.onimport.layout(can)
|
||||||
|
// can.user.toastFailure(can, "nothing to display")
|
||||||
} return can.onmotion.toggle(can, target, true), can.onimport.layout(can)
|
} return can.onmotion.toggle(can, target, true), can.onimport.layout(can)
|
||||||
},
|
},
|
||||||
toolkit: function(can, meta, cb) { can.base.isString(meta) && (meta = {index: meta})
|
toolkit: function(can, meta, cb) { can.base.isString(meta) && (meta = {index: meta})
|
||||||
@ -267,8 +268,16 @@ Volcanos(chat.ONIMPORT, {
|
|||||||
if (can.isSimpleMode()) { can.ui.layout(can.ConfHeight(), can.ConfWidth()); return can.page.style(can, can.ui.content, html.WIDTH, can.ConfWidth()) }
|
if (can.isSimpleMode()) { can.ui.layout(can.ConfHeight(), can.ConfWidth()); return can.page.style(can, can.ui.content, html.WIDTH, can.ConfWidth()) }
|
||||||
if (can.isCmdMode()) { can.page.style(can, can._output, html.HEIGHT, can.ConfHeight(can.page.height())) }
|
if (can.isCmdMode()) { can.page.style(can, can._output, html.HEIGHT, can.ConfHeight(can.page.height())) }
|
||||||
can.ui.size = {profile: can._msg.Option(html.WIDTH), display: can._msg.Option(html.HEIGHT)}
|
can.ui.size = {profile: can._msg.Option(html.WIDTH), display: can._msg.Option(html.HEIGHT)}
|
||||||
can.ui.layout(can.ConfHeight(), can.ConfWidth(), 0, function(height, width) {
|
can.ui.layout(can.ConfHeight(), can.ConfWidth(), 0, function(height, width) { var _width = width
|
||||||
var sub = can._msg._profile_plugin; sub && can.page.isDisplay(can.ui.profile) && sub.onimport && sub.onimport.size(sub, can.ui.profile.offsetHeight, can.ui.profile.offsetWidth-1, false)
|
var sub = can._msg._profile_plugin; if (sub && can.page.isDisplay(can.ui.profile)) { _width = (can.ConfWidth()-can.ui.project.offsetWidth)/2
|
||||||
|
can.page.style(can, can.ui.profile, html.WIDTH, _width, html.MAX_WIDTH, _width, html.FLEX, "0 0 "+_width+"px")
|
||||||
|
sub.onimport && sub.onimport.size(sub, can.ui.profile.offsetHeight, _width-1, false)
|
||||||
|
can.page.style(can, can.ui.vbar, html.RIGHT, _width)
|
||||||
|
} else {
|
||||||
|
can.page.style(can, can.ui.vbar, html.RIGHT, "0")
|
||||||
|
}
|
||||||
|
can.page.style(can, can.ui.content, html.FLEX, "0 0 "+_width+"px")
|
||||||
|
can.page.style(can, can.ui.hbar, html.BOTTOM, "0")
|
||||||
var sub = can.ui.content._plugin; if (!sub) { return } if (height == sub.ConfHeight()+sub.onexport.actionHeight(sub)+sub.onexport.statusHeight(sub) && width == sub.ConfWidth()) { return }
|
var sub = can.ui.content._plugin; if (!sub) { return } if (height == sub.ConfHeight()+sub.onexport.actionHeight(sub)+sub.onexport.statusHeight(sub) && width == sub.ConfWidth()) { return }
|
||||||
sub.onimport.size(sub, height, width, false), can.page.style(can, sub._target, html.HEIGHT, height)
|
sub.onimport.size(sub, height, width, false), can.page.style(can, sub._target, html.HEIGHT, height)
|
||||||
})
|
})
|
||||||
@ -347,7 +356,8 @@ Volcanos(chat.ONSYNTAX, {
|
|||||||
})
|
})
|
||||||
} p && include(p.include), p && p.prepare && can.core.ItemForm(p.prepare, function(value, index, key) { p.keyword = p.keyword||{}, p.keyword[value] = key })
|
} p && include(p.include), p && p.prepare && can.core.ItemForm(p.prepare, function(value, index, key) { p.keyword = p.keyword||{}, p.keyword[value] = key })
|
||||||
if (can.db.history.length > 1) { can.ui.content = can.page.insertBefore(can, [{view: html.CONTENT, style: {width: can.ui.content.offsetWidth}}], can.ui._content), can.ui.content._cache_key = key }
|
if (can.db.history.length > 1) { can.ui.content = can.page.insertBefore(can, [{view: html.CONTENT, style: {width: can.ui.content.offsetWidth}}], can.ui._content), can.ui.content._cache_key = key }
|
||||||
can.ui.content._max = 0, can.ui.content._msg = msg, can.page.Appends(can, can.ui.content, [{view: ["tips", "", msg.Option(nfs.FILE).split(nfs.PS).slice(-2).join(nfs.PS)]}])
|
can.ui.content._max = 0, can.ui.content._msg = msg
|
||||||
|
// can.page.Appends(can, can.ui.content, [{view: ["tips", "", msg.Option(nfs.FILE).split(nfs.PS).slice(-2).join(nfs.PS)]}])
|
||||||
if (msg.Length() > 0) { can.onsyntax._change(can, msg), can.onaction.rerankLine(can, "tr.line:not(.delete)>td.line")
|
if (msg.Length() > 0) { can.onsyntax._change(can, msg), can.onaction.rerankLine(can, "tr.line:not(.delete)>td.line")
|
||||||
can.page.Select(can, can.ui.content, "tr.line.delete>td.line", function(target) { target.innerHTML = "" })
|
can.page.Select(can, can.ui.content, "tr.line.delete>td.line", function(target) { target.innerHTML = "" })
|
||||||
} else {
|
} else {
|
||||||
|
@ -280,10 +280,11 @@ Volcanos(chat.ONSYNTAX, {
|
|||||||
"not": code.DATATYPE, "first-child": code.DATATYPE, "last-child": code.DATATYPE, "nth-child": code.DATATYPE,
|
"not": code.DATATYPE, "first-child": code.DATATYPE, "last-child": code.DATATYPE, "nth-child": code.DATATYPE,
|
||||||
"placeholder": code.DATATYPE, "hover": code.DATATYPE, "focus": code.DATATYPE,
|
"placeholder": code.DATATYPE, "hover": code.DATATYPE, "focus": code.DATATYPE,
|
||||||
|
|
||||||
"$body": code.KEYWORD, "$fieldset": code.KEYWORD,
|
"$body": code.KEYWORD, "$fieldset": code.KEYWORD, "$input": code.KEYWORD,
|
||||||
"$option": code.KEYWORD, "$action": code.KEYWORD, "$output": code.KEYWORD, "$status": code.KEYWORD,
|
"$option": code.KEYWORD, "$action": code.KEYWORD, "$output": code.KEYWORD, "$status": code.KEYWORD,
|
||||||
"$content": code.KEYWORD, "$profile": code.KEYWORD, "$display": code.KEYWORD, "$project": code.KEYWORD,
|
"$content": code.KEYWORD, "$profile": code.KEYWORD, "$display": code.KEYWORD, "$project": code.KEYWORD,
|
||||||
|
|
||||||
|
|
||||||
"output": code.KEYWORD,
|
"output": code.KEYWORD,
|
||||||
"background-color": code.FUNCTION, "color": code.FUNCTION,
|
"background-color": code.FUNCTION, "color": code.FUNCTION,
|
||||||
"font-family": code.FUNCTION, "font-weight": code.FUNCTION, "font-style": code.FUNCTION, "font-size": code.FUNCTION, "line-height": code.FUNCTION,
|
"font-family": code.FUNCTION, "font-weight": code.FUNCTION, "font-style": code.FUNCTION, "font-size": code.FUNCTION, "line-height": code.FUNCTION,
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
Volcanos(chat.ONIMPORT, {
|
Volcanos(chat.ONIMPORT, {
|
||||||
_init: function(can, msg, cb) { can.onappend.style(can, code.VIMER); if (can.user.mod.isPod) { delete(can.onfigure.space) }
|
_init: function(can, msg, cb) { can.onappend.style(can, code.VIMER); if (can.user.mod.isPod) { delete(can.onfigure.space) }
|
||||||
|
can.misc.Search(can, html.TITLE) && can.Conf("help", can.misc.Search(can, html.TITLE))
|
||||||
|
can.misc.Search(can, html.TITLE) && can.sup.Conf("help", can.misc.Search(can, html.TITLE))
|
||||||
can.require(["/plugin/local/code/inner.js"], function(can) { can.onimport._last_init(can, msg, function() {
|
can.require(["/plugin/local/code/inner.js"], function(can) { can.onimport._last_init(can, msg, function() {
|
||||||
can.db.undo = [], can.db.redo = [], can.onimport._input(can), cb && cb(msg)
|
can.db.undo = [], can.db.redo = [], can.onimport._input(can), cb && cb(msg)
|
||||||
}) })
|
}) })
|
||||||
|
@ -359,7 +359,8 @@ Volcanos(chat.ONEXPORT, {
|
|||||||
return can.misc.localStorage(can, [can.ConfSpace()||can.misc.Search(can, ice.POD), can.ConfIndex(), key], value)
|
return can.misc.localStorage(can, [can.ConfSpace()||can.misc.Search(can, ice.POD), can.ConfIndex(), key], value)
|
||||||
},
|
},
|
||||||
hash: function(can, hash) {
|
hash: function(can, hash) {
|
||||||
if (can.user.isWeiXin) { return }
|
// if (can.user.isWeiXin) { return }
|
||||||
|
if (can.user.isMobile) { return }
|
||||||
can.misc.SearchHash(can, hash)
|
can.misc.SearchHash(can, hash)
|
||||||
// can.onexport.storage(can, "hash", hash)
|
// can.onexport.storage(can, "hash", hash)
|
||||||
return hash
|
return hash
|
||||||
|
653
plugin/table.js
653
plugin/table.js
@ -427,338 +427,339 @@ Volcanos(chat.ONIMPORT, {
|
|||||||
sub._select = function() { can.onimport.myOption(sub), can.user.trans(can, {goback: "返回"})
|
sub._select = function() { can.onimport.myOption(sub), can.user.trans(can, {goback: "返回"})
|
||||||
can.page.SelectChild(can, _output, "*", function(target) { can.onmotion.toggle(can, target, target == sub._target) })
|
can.page.SelectChild(can, _output, "*", function(target) { can.onmotion.toggle(can, target, target == sub._target) })
|
||||||
var list = [
|
var list = [
|
||||||
// can.user.isMobile || can._msg.IsTech() && can.page.button(can, can.user.trans(can, sub.ConfIndex(), sub.ConfHelp()), function(event) {
|
can.user.isMobile || can.page.button(can, can.user.trans(can, sub.ConfIndex().split(".").pop(), sub.ConfHelp()), function(event) {
|
||||||
can.user.isMobile || can.page.button(can, can.user.trans(can, sub.ConfIndex(), sub.ConfHelp()), function(event) {
|
can._msg.IsTech() && sub._legend.onclick(event)
|
||||||
can._msg.IsTech() && sub._legend.onclick(event)
|
}),
|
||||||
}),
|
can.page.button(can, "goback", function(event) { goback(event) }),
|
||||||
can.page.button(can, "goback", function(event) { goback(event) }),
|
can.page.button(can, "reload", function(event) { reload(event) }),
|
||||||
can.page.button(can, "reload", function(event) { reload(event) }),
|
]
|
||||||
]
|
can.page.Appends(can, _action, list)
|
||||||
can.page.Appends(can, _action, list)
|
sub._msg && sub._msg.IsDetail() === false && can.onappend.filter(can, _action, sub._output)
|
||||||
sub._msg && sub._msg.IsDetail() === false && can.onappend.filter(can, _action, sub._output)
|
can.page.style(can, _action, html.DISPLAY, html.FLEX)
|
||||||
can.page.style(can, _action, html.DISPLAY, html.FLEX)
|
can.user.isMobile && sub.onimport.size(sub, window.innerHeight-ACTION_HEIGHT, window.innerWidth, false)
|
||||||
can.user.isMobile && sub.onimport.size(sub, window.innerHeight-ACTION_HEIGHT, window.innerWidth, false)
|
sub._msg && header(sub._msg)
|
||||||
// var msg = sub._msg
|
|
||||||
sub._msg && header(sub._msg)
|
|
||||||
}
|
|
||||||
can._stacks_current.push(sub), sub._select()
|
|
||||||
}, _output)
|
|
||||||
},
|
|
||||||
myTabs: function(can, key, list, target) { var last = can.sup.Conf("option."+key)||""
|
|
||||||
if (!target && !can.ui.tabs) { can.ui = can.page.Append(can, can._output, [html.TABS, html.LIST]) } target = target||can.ui.tabs
|
|
||||||
can.page.Append(can, target, can.core.List(list, function(value) {
|
|
||||||
return {text: [can.user.trans(can, value, "", "value."+key), "", [value, value == "all" && last == "" || value == last? html.SELECT: ""]], onclick: function(event) {
|
|
||||||
can.onmotion.select(can, target, "*", event.currentTarget)
|
|
||||||
can.sup.Conf("option."+key, value == "all"? "": value)
|
|
||||||
can.Update()
|
|
||||||
}}
|
|
||||||
}))
|
|
||||||
},
|
|
||||||
myViewTabs: function(can, status, msg, cb, cbs, target) {
|
|
||||||
var trans = can.Conf("feature._trans.value."+status)
|
|
||||||
var stat = {}; msg.Table(function(value) { stat[value[status]] = (stat[value[status]]||0)+1 })
|
|
||||||
var list = can.core.Item(trans, function(key, value) { if (key == "style") { return }
|
|
||||||
if (stat[key]) { return {name: key, value: value+"("+stat[key]+")", style: can.core.Value(trans, "style."+key) } }
|
|
||||||
})
|
|
||||||
if (list.length == 0) { var _list = [], stat = {}
|
|
||||||
msg.Table(function(value) { can.base.AddUniq(_list, value[status]), stat[value[status]] = (stat[value[status]]||0)+1 })
|
|
||||||
can.core.List(_list, function(status) { list.push({name: status, value: status+"("+stat[status]+")"}) })
|
|
||||||
}
|
}
|
||||||
var last = can.sup.Conf("option."+status)
|
can._stacks_current.push(sub), sub._select()
|
||||||
if (!msg.IsDetail() && msg.Length() > 3 && list.length > 1) {
|
}, _output)
|
||||||
can.ui.tabs = can.page.Append(can, can._output, [{view: "tabs", list: can.core.List([
|
},
|
||||||
{name: "all", value: "全部"+"("+msg.Length()+")", style: last == undefined? "select": ""},
|
myTabs: function(can, key, list, target) { var last = can.sup.Conf("option."+key)||""
|
||||||
].concat(list), function(value) {
|
if (!target && !can.ui.tabs) { can.ui = can.page.Append(can, can._output, [html.TABS, html.LIST]) } target = target||can.ui.tabs
|
||||||
return {view: [[html.ITEM].concat([value.name, value.style, value.name == last? "select": ""]), "", can.user.trans(can, value.name, value.value)], onclick: function(event) { var target = event.currentTarget
|
can.page.Append(can, target, can.core.List(list, function(value) {
|
||||||
can.onmotion.select(can, target.parentNode, html.DIV_ITEM, target)
|
return {text: [can.user.trans(can, value, "", "value."+key), "", [value, value == "all" && last == "" || value == last? html.SELECT: ""]], onclick: function(event) {
|
||||||
// can.sup.Conf("option."+status, value.name == "all"? "": value.name)
|
can.onmotion.select(can, target, "*", event.currentTarget)
|
||||||
can.page.Select(can, can._output, "div.item.card", function(target) {
|
can.sup.Conf("option."+key, value == "all"? "": value)
|
||||||
can.onmotion.hidden(can, target, value.name == "all" || can.page.ClassList.has(can, target, value.name))
|
can.Update()
|
||||||
})
|
|
||||||
}}
|
|
||||||
})}])._target
|
|
||||||
can.ui.list = can.page.Append(can, can._output, [{view: "list"}])._target; target = can.ui.list
|
|
||||||
var list = can.base.Obj(msg.Option(ice.MSG_ACTION))||[]
|
|
||||||
if (can.user.isMobile && list.length > 0) {
|
|
||||||
can.ui.todo = can.page.Append(can, can._output, [{view: "todo"}])._target
|
|
||||||
can.user.isMobile && can.onappend._action(can, can.base.Obj(msg.Option(ice.MSG_ACTION))||[], can.ui.todo)
|
|
||||||
}
|
|
||||||
} else if (msg.Option(ice.MSG_ACTION)) {
|
|
||||||
var list = can.base.Obj(msg.Option(ice.MSG_ACTION))||[]
|
|
||||||
if (can.user.isMobile && list.length > 0) {
|
|
||||||
can.ui.list = can.page.Append(can, can._output, [{view: "list"}])._target; target = can.ui.list
|
|
||||||
can.ui.todo = can.page.Append(can, can._output, [{view: "todo"}])._target
|
|
||||||
can.onappend._action(can, list, can.ui.todo)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
can.onimport.myView(can, msg, function(value) { return value._style = value[status], cb(value) }, cbs, target)
|
|
||||||
},
|
|
||||||
myView: function(can, msg, cb, cbs, target) {
|
|
||||||
if (msg.Option("market_uid")) { can.onimport.myPlaceInfo(can, msg, "marketPlaceInfo") }
|
|
||||||
if (msg.Option("message_uid")) { can.onimport.myPlaceInfo(can, msg, "messagePlaceInfo") }
|
|
||||||
can.onimport.itemcards(can, msg, cb, cbs, target||can.ui.list)
|
|
||||||
msg.Option("otherList") && can.onimport.otherList && can.onimport.otherList(can, msg, can.core.Split(msg.Option("otherList")))
|
|
||||||
},
|
|
||||||
itemcards: function(can, msg, cb, cbs, target) { target = target||can.ui.list||can._output
|
|
||||||
if (msg.IsDetail()) { var value = msg.TableDetail(); var _msg = can.request(); _msg.Push(value)
|
|
||||||
if (!msg.Option("market_uid") && !msg.Option("message_uid")) {
|
|
||||||
value.user_avatar && can.page.Append(can, target, [{view: "place_info", _init: function(target) {
|
|
||||||
_msg.action = [], _msg.PushButton("userInfo")
|
|
||||||
if (can.base.endWith(can.ConfIndex(), ".member") && !_msg.Append("auth_name")) { _msg.action = [] }
|
|
||||||
can.onimport.itemcards(can, _msg, function(value) { value.icons = value.auth_avatar||value.user_avatar; return [
|
|
||||||
{view: html.TITLE, list: [value.user_name, can.onimport.authView(can, value), !value.to_user_avatar && can.onimport.titleAction(can, value)]},
|
|
||||||
{view: html.STATUS, list: [value.uid.slice(0, 6), can.onimport.timeView(can, value)]},
|
|
||||||
] }, function(event, value) {
|
|
||||||
can.run(can.request(event, value), [ctx.ACTION, "userInfo"])
|
|
||||||
}, target)
|
|
||||||
}}])
|
|
||||||
}
|
|
||||||
can.onappend.table(can, msg), can.page.Select(can, target, html.TR, function(target) {
|
|
||||||
target.className.indexOf("_uid") > -1 && can.page.ClassList.add(can, target, "hide")
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
can.onappend.style(can, msg.Option(ctx.STYLE))
|
|
||||||
can.page.Append(can, target, msg.Table(function(value) {
|
|
||||||
return can.onimport.itemcard(can, value, cb(value), cbs)
|
|
||||||
}))
|
|
||||||
}
|
|
||||||
msg.Result() && can.onappend.board(can, msg), can.onmotion.story.auto(can)
|
|
||||||
can.page.Select(can, target, html.INPUT_BUTTON, function(target) {
|
|
||||||
var style = can.Conf("_style."+target.name); style && can.page.ClassList.add(can, target, style)
|
|
||||||
})
|
|
||||||
can.onimport.shareTitle(can, msg)
|
|
||||||
},
|
|
||||||
itemcard: function(can, value, list, cb) { if (!list) { return }
|
|
||||||
can.core.List(list, function(item) { if (!item || !item.list) { return }
|
|
||||||
for (var i = 0; i < item.list.length; i++) { if (item.list[i] && typeof item.list[i] == code.STRING) { item.list[i] = {text: item.list[i]} } }
|
|
||||||
})
|
|
||||||
cb = cb|| function(event) { var done = false
|
|
||||||
if (can.onaction.carddetail && can.onaction.carddetail(event, can, value)) { return }
|
|
||||||
if (value.uid) { return can.Option(UID, value.uid), can.Update(can.request(event, value)) }
|
|
||||||
can.core.Item(can.Option(), function(k, v) {
|
|
||||||
if (!done && !v) { done = true, can.Option(k, value[k]), can.Update() }
|
|
||||||
})
|
|
||||||
}
|
|
||||||
return {view: [[html.ITEM_CARD, value._uid? "uid-"+value._uid: ""].concat(value._style||[])], list: [
|
|
||||||
!value.to_user_avatar && {view: html.ACTION, _init: function(target) {
|
|
||||||
can.page.appendAction(can, value, target)
|
|
||||||
can.user.isMobile && can.page.Select(can, target, "input.notice", function(target) { can.page.Remove(can, target) })
|
|
||||||
}},
|
|
||||||
{view: html.OUTPUT, list: [
|
|
||||||
{img: can.misc.ResourceIcons(can, value.icons||value.icon||value.avatar||
|
|
||||||
value.auth_avatar||value.command_icon||value.service_icon||value.user_avatar||can.ConfIcons(),
|
|
||||||
value.nodename||can.ConfSpace(),
|
|
||||||
), onclick: function(event) { can.onkeymap.prevent(event)
|
|
||||||
can.onaction.updateAvatar && can.onaction.updateAvatar(event, can)
|
|
||||||
}},
|
|
||||||
{view: html.CONTAINER, list: list},
|
|
||||||
value.to_user_avatar && {img: can.misc.ResourceIcons(can, value.to_user_avatar)},
|
|
||||||
], _init: function(target) {
|
|
||||||
value.action && can.onmotion.slideAction(can, target)
|
|
||||||
}},
|
|
||||||
], onclick: function(event) { cb && cb(event, value)
|
|
||||||
can.onmotion.select(can, event.currentTarget.parentNode, html.DIV_ITEM, event.currentTarget)
|
|
||||||
}}
|
}}
|
||||||
},
|
}))
|
||||||
myPlaceInfo: function(can, msg, action) { if (!can.user.isMobile) { return }
|
},
|
||||||
can.core.List(can._stacks_current.concat([]).reverse(), function(sub) {
|
myViewTabs: function(can, status, msg, cb, cbs, target) {
|
||||||
if (sub._output == can._target) { can.onappend.style(can, "market_uid", can._fields)
|
var trans = can.Conf("feature._trans.value."+status)
|
||||||
can.page.Append(can, can._output, [{view: "place_info", _init: function(target) {
|
var stat = {}; msg.Table(function(value) { stat[value[status]] = (stat[value[status]]||0)+1 })
|
||||||
can.run({}, [ctx.ACTION, action], function(msg) {
|
var list = can.core.Item(trans, function(key, value) { if (key == "style") { return }
|
||||||
can.onimport.itemcards(can, msg, function(value) { return [
|
if (stat[key]) { return {name: key, value: value+"("+stat[key]+")", style: can.core.Value(trans, "style."+key) } }
|
||||||
{view: html.TITLE, list: [value.user_name, can.onimport.titleAction(can, value)]},
|
})
|
||||||
{view: html.STATUS, list: [value.city_name, value.street_name, value.place_name, value.service_name]},
|
if (list.length == 0) { var _list = [], stat = {}
|
||||||
] }, function(event, value) {
|
msg.Table(function(value) { can.base.AddUniq(_list, value[status]), stat[value[status]] = (stat[value[status]]||0)+1 })
|
||||||
can.onimport.myStory(can, {
|
can.core.List(_list, function(status) { list.push({name: status, value: status+"("+stat[status]+")"}) })
|
||||||
index: can.ConfIndex().split(".").slice(0, 3).concat("portal").join("."), args: [value.place_uid],
|
}
|
||||||
})
|
var last = can.sup.Conf("option."+status)
|
||||||
}, target)
|
if (!msg.IsDetail() && msg.Length() > 3 && list.length > 1) {
|
||||||
can.page.Select(can, target, html.INPUT_BUTTON, function(target) {
|
can.ui.tabs = can.page.Append(can, can._output, [{view: "tabs", list: can.core.List([
|
||||||
target.onclick = function(event) {
|
{name: "all", value: "全部"+"("+msg.Length()+")", style: last == undefined? "select": ""},
|
||||||
can.onimport.myStory(can, {
|
].concat(list), function(value) {
|
||||||
index: can.ConfIndex().split(".").slice(0, 3).concat("portal").join("."), args: [msg.Append("place_uid")],
|
return {view: [[html.ITEM].concat([value.name, value.style, value.name == last? "select": ""]), "", can.user.trans(can, value.name, value.value)], onclick: function(event) { var target = event.currentTarget
|
||||||
})
|
can.onmotion.select(can, target.parentNode, html.DIV_ITEM, target)
|
||||||
}
|
can.sup.Conf("option."+status, value.name == "all"? "": value.name)
|
||||||
})
|
can.page.Select(can, can._output, "div.item.card", function(target) {
|
||||||
})
|
can.onmotion.hidden(can, target, value.name == "all" || can.page.ClassList.has(can, target, value.name))
|
||||||
}}])
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
otherList: function(can, msg, action) { if (!msg.IsDetail()) { return } typeof action == "string" && (action = [action])
|
|
||||||
can.core.Next(action, function(action, next) {
|
|
||||||
can.run(can.request({}, {uid: msg.Append(UID)}, msg.TableDetail()), action, function(msg) { if (msg.Length() == 0) { return next() }
|
|
||||||
can.page.Append(can, can._output, [{view: [[html.ITEM, html.TITLE, action], "", can.user.trans(can, action)]}])
|
|
||||||
can.onappend.plugin(can, {index: can.ConfIndex()}, function(sub) { can.onimport.myField(can, sub), can.onappend.style(sub, "otherList")
|
|
||||||
sub.run = function(event, cmds, cb) { if (!cmds || cmds.length == 0) { cb(msg) } else { can.run(event, cmds, cb) } }, next()
|
|
||||||
sub.onexport.output = function(_sub, msg) {
|
|
||||||
_sub.onaction.carddetail = function(event, _sub, value) {
|
|
||||||
can.onimport.myStory(can, {index: msg.Option("_other_cmd"), args: [value.place_uid||msg.Option("place_uid"), value.uid]})
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
})
|
}}
|
||||||
|
})}])._target
|
||||||
|
list.length > 3 && can.page.Append(can, can.ui.tabs, [{view: [[html.ITEM, "wrap"], "", can.user.trans(can, "expand", "展开")], onclick: function(event) {
|
||||||
|
event.target.innerHTML = can.page.ClassList.neg(can, can.ui.tabs, "wrap")? can.user.trans(can, "collapse", "折叠"): can.user.trans(can, "expand", "展开")
|
||||||
|
can.onimport.layout && can.onimport.layout(can), can.ui.list.scrollTop = 0
|
||||||
|
}}])
|
||||||
|
can.ui.list = can.page.Append(can, can._output, [{view: "list"}])._target; target = can.ui.list
|
||||||
|
var list = can.base.Obj(msg.Option(ice.MSG_ACTION))||[]
|
||||||
|
if (can.user.isMobile && list.length > 0) {
|
||||||
|
can.ui.todo = can.page.Append(can, can._output, [{view: "todo"}])._target
|
||||||
|
can.user.isMobile && can.onappend._action(can, can.base.Obj(msg.Option(ice.MSG_ACTION))||[], can.ui.todo)
|
||||||
|
}
|
||||||
|
} else if (msg.Option(ice.MSG_ACTION)) {
|
||||||
|
var list = can.base.Obj(msg.Option(ice.MSG_ACTION))||[]
|
||||||
|
if (can.user.isMobile && list.length > 0) {
|
||||||
|
can.ui.list = can.page.Append(can, can._output, [{view: "list"}])._target; target = can.ui.list
|
||||||
|
can.ui.todo = can.page.Append(can, can._output, [{view: "todo"}])._target
|
||||||
|
can.onappend._action(can, list, can.ui.todo)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
can.onimport.myView(can, msg, function(value) { return value._style = value[status], cb(value) }, cbs, target)
|
||||||
|
can.ui.tabs && can.page.Select(can, can.ui.tabs, html.DIV_ITEM_SELECT, function(target) { target.click() })
|
||||||
|
},
|
||||||
|
myView: function(can, msg, cb, cbs, target) {
|
||||||
|
if (msg.Option("market_uid")) { can.onimport.myPlaceInfo(can, msg, "marketPlaceInfo") }
|
||||||
|
if (msg.Option("message_uid")) { can.onimport.myPlaceInfo(can, msg, "messagePlaceInfo") }
|
||||||
|
can.onimport.itemcards(can, msg, cb, cbs, target||can.ui.list)
|
||||||
|
msg.Option("otherList") && can.onimport.otherList && can.onimport.otherList(can, msg, can.core.Split(msg.Option("otherList")))
|
||||||
|
},
|
||||||
|
itemcards: function(can, msg, cb, cbs, target) { target = target||can.ui.list||can._output
|
||||||
|
if (msg.IsDetail()) { var value = msg.TableDetail(); var _msg = can.request(); _msg.Push(value)
|
||||||
|
if (!msg.Option("market_uid") && !msg.Option("message_uid")) {
|
||||||
|
value.user_avatar && can.page.Append(can, target, [{view: "place_info", _init: function(target) {
|
||||||
|
_msg.action = [], _msg.PushButton("userInfo")
|
||||||
|
if (can.base.endWith(can.ConfIndex(), ".member") && !_msg.Append("auth_name")) { _msg.action = [] }
|
||||||
|
can.onimport.itemcards(can, _msg, function(value) { value.icons = value.auth_avatar||value.user_avatar; return [
|
||||||
|
{view: html.TITLE, list: [value.user_name, can.onimport.authView(can, value), !value.to_user_avatar && can.onimport.titleAction(can, value)]},
|
||||||
|
{view: html.STATUS, list: [value.uid.slice(0, 6), can.onimport.timeView(can, value)]},
|
||||||
|
] }, function(event, value) {
|
||||||
|
can.run(can.request(event, value), [ctx.ACTION, "userInfo"])
|
||||||
|
}, target)
|
||||||
|
}}])
|
||||||
|
}
|
||||||
|
can.onappend.table(can, msg), can.page.Select(can, target, html.TR, function(target) {
|
||||||
|
target.className.indexOf("_uid") > -1 && can.page.ClassList.add(can, target, "hide")
|
||||||
})
|
})
|
||||||
},
|
} else {
|
||||||
shareTitle: function(can, msg, icons, title, content) { if (msg.IsDetail()) { var value = msg.TableDetail()
|
can.onappend.style(can, msg.Option(ctx.STYLE))
|
||||||
msg.Option("_share_icons", msg.Option("_share_icons")||value[icons]||value.icons||value.avatar)
|
can.page.Append(can, target, msg.Table(function(value) {
|
||||||
msg.Option("_share_title", msg.Option("_share_title")||(value[title]||value.title||value.name||value.uid.slice(0, 6)))
|
return can.onimport.itemcard(can, value, cb(value), cbs)
|
||||||
msg.Option("_share_content", msg.Option("_share_content")||value[content]||value.content||value.info)
|
}))
|
||||||
} },
|
}
|
||||||
titleAction: function(can, value, filter) { var filter = can.core.List(arguments).slice(2)
|
msg.Result() && can.onappend.board(can, msg), can.onmotion.story.auto(can)
|
||||||
return {view: html.ACTION, _init: function(target) {
|
can.page.Select(can, target, html.INPUT_BUTTON, function(target) {
|
||||||
if (value.Option) { return can.onappend._action(can, value.Option(ice.MSG_ACTION), target) }
|
var style = can.Conf("_style."+target.name); style && can.page.ClassList.add(can, target, style)
|
||||||
|
})
|
||||||
|
can.onimport.shareTitle(can, msg)
|
||||||
|
},
|
||||||
|
itemcard: function(can, value, list, cb) { if (!list) { return }
|
||||||
|
can.core.List(list, function(item) { if (!item || !item.list) { return }
|
||||||
|
for (var i = 0; i < item.list.length; i++) { if (item.list[i] && typeof item.list[i] == code.STRING) { item.list[i] = {text: item.list[i]} } }
|
||||||
|
})
|
||||||
|
cb = cb|| function(event) { var done = false
|
||||||
|
if (can.onaction.carddetail && can.onaction.carddetail(event, can, value)) { return }
|
||||||
|
if (value.uid) { return can.Option(UID, value.uid), can.Update(can.request(event, value)) }
|
||||||
|
can.core.Item(can.Option(), function(k, v) {
|
||||||
|
if (!done && !v) { done = true, can.Option(k, value[k]), can.Update() }
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return {view: [[html.ITEM_CARD, value._uid? "uid-"+value._uid: ""].concat(value._style||[])], list: [
|
||||||
|
!value.to_user_avatar && {view: html.ACTION, _init: function(target) {
|
||||||
can.page.appendAction(can, value, target)
|
can.page.appendAction(can, value, target)
|
||||||
can.page.Select(can, target, html.INPUT_BUTTON, function(target) {
|
can.user.isMobile && can.page.Select(can, target, "input.notice", function(target) { can.page.Remove(can, target) })
|
||||||
target.value = can.user.trans(can, target.name)
|
}},
|
||||||
if (filter.length > 0) {
|
{view: html.OUTPUT, list: [
|
||||||
filter.indexOf(target.name) == -1 && can.page.Remove(can, target)
|
{img: can.misc.ResourceIcons(can, value.icons||value.icon||value.avatar||value.auth_avatar||value.user_avatar||
|
||||||
} else {
|
value.command_icon||value.service_icon||can.ConfIcons(), value.nodename||value.space||can.ConfSpace(),
|
||||||
can.page.tagis(target, "input.notice") || can.page.Remove(can, target)
|
), onclick: function(event) { can.onkeymap.prevent(event)
|
||||||
|
can.onaction.updateAvatar && can.onaction.updateAvatar(event, can)
|
||||||
|
}},
|
||||||
|
{view: html.CONTAINER, list: list},
|
||||||
|
value.to_user_avatar && value.to_user_avatar != value.user_avatar? {img: can.misc.ResourceIcons(can, value.to_user_avatar)}:
|
||||||
|
value.from_user_avatar && value.from_user_avatar != value.user_avatar? {img: can.misc.ResourceIcons(can, value.from_user_avatar)}: null,
|
||||||
|
], _init: function(target) {
|
||||||
|
value.action && can.onmotion.slideAction(can, target)
|
||||||
|
}},
|
||||||
|
], onclick: function(event) { cb && cb(event, value)
|
||||||
|
can.onmotion.select(can, event.currentTarget.parentNode, html.DIV_ITEM, event.currentTarget)
|
||||||
|
}}
|
||||||
|
},
|
||||||
|
myPlaceInfo: function(can, msg, action) { if (!can.user.isMobile) { return }
|
||||||
|
can.core.List(can._stacks_current.concat([]).reverse(), function(sub) {
|
||||||
|
if (sub._output == can._target) { can.onappend.style(can, "market_uid", can._fields)
|
||||||
|
can.page.Append(can, can._output, [{view: "place_info", _init: function(target) {
|
||||||
|
can.run({}, [ctx.ACTION, action], function(msg) {
|
||||||
|
can.onimport.itemcards(can, msg, function(value) { return [
|
||||||
|
{view: html.TITLE, list: [value.user_name, can.onimport.titleAction(can, value)]},
|
||||||
|
{view: html.STATUS, list: [value.city_name, value.street_name, value.place_name, value.service_name]},
|
||||||
|
] }, function(event, value) {
|
||||||
|
can.onimport.myStory(can, {
|
||||||
|
index: can.ConfIndex().split(".").slice(0, 3).concat("portal").join("."), args: [value.place_uid],
|
||||||
|
})
|
||||||
|
}, target)
|
||||||
|
can.page.Select(can, target, html.INPUT_BUTTON, function(target) {
|
||||||
|
target.onclick = function(event) {
|
||||||
|
can.onimport.myStory(can, {
|
||||||
|
index: can.ConfIndex().split(".").slice(0, 3).concat("portal").join("."), args: [msg.Append("place_uid")],
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}}])
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
otherList: function(can, msg, action) { if (!msg.IsDetail()) { return } typeof action == "string" && (action = [action])
|
||||||
|
can.core.Next(action, function(action, next) {
|
||||||
|
can.run(can.request({}, {uid: msg.Append(UID)}, msg.TableDetail()), action, function(msg) { if (msg.Length() == 0) { return next() }
|
||||||
|
can.page.Append(can, can._output, [{view: [[html.ITEM, html.TITLE, action], "", can.user.trans(can, action)]}])
|
||||||
|
can.onappend.plugin(can, {index: can.ConfIndex()}, function(sub) { can.onimport.myField(can, sub), can.onappend.style(sub, "otherList")
|
||||||
|
sub.run = function(event, cmds, cb) { if (!cmds || cmds.length == 0) { cb(msg) } else { can.run(event, cmds, cb) } }, next()
|
||||||
|
sub.onexport.output = function(_sub, msg) {
|
||||||
|
_sub.onaction.carddetail = function(event, _sub, value) {
|
||||||
|
can.onimport.myStory(can, {index: msg.Option("_other_cmd"), args: [value.place_uid||msg.Option("place_uid"), value.uid]})
|
||||||
|
return true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}}
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
shareTitle: function(can, msg, icons, title, content) { if (msg.IsDetail()) { var value = msg.TableDetail()
|
||||||
|
msg.Option("_share_icons", msg.Option("_share_icons")||value[icons]||value.icons||value.avatar)
|
||||||
|
msg.Option("_share_title", msg.Option("_share_title")||(value[title]||value.title||value.name||value.uid.slice(0, 6)))
|
||||||
|
msg.Option("_share_content", msg.Option("_share_content")||value[content]||value.content||value.info)
|
||||||
|
} },
|
||||||
|
titleAction: function(can, value, filter) { var filter = can.core.List(arguments).slice(2)
|
||||||
|
return {view: html.ACTION, _init: function(target) {
|
||||||
|
if (value.Option) { return can.onappend._action(can, value.Option(ice.MSG_ACTION), target) }
|
||||||
|
can.page.appendAction(can, value, target)
|
||||||
|
can.page.Select(can, target, html.INPUT_BUTTON, function(target) {
|
||||||
|
target.value = can.user.trans(can, target.name)
|
||||||
|
if (filter.length > 0) {
|
||||||
|
filter.indexOf(target.name) == -1 && can.page.Remove(can, target)
|
||||||
|
} else {
|
||||||
|
can.page.tagis(target, "input.notice") || can.page.Remove(can, target)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}}
|
||||||
|
},
|
||||||
|
uidView: function(can, value) { return value.uid.slice(0, 6) },
|
||||||
|
metaView: function(can, value) {
|
||||||
|
return {view: html.STATUS, list: [
|
||||||
|
can.onimport.uidView(can, value), can.onimport.timeView(can, value), value.user_name,
|
||||||
|
]}
|
||||||
|
},
|
||||||
|
shipView: function(can, value) {
|
||||||
|
return {view: html.STATUS, list: [value.city_name, value.city_name? "|": "",
|
||||||
|
value.street_name, value.street_name? "|": "",
|
||||||
|
value.place_name, value.place_name? "|": "",
|
||||||
|
value.service_name.replace(" ", " | ")]}
|
||||||
|
},
|
||||||
|
spaceView: function(can, value) { return {view: "space"} },
|
||||||
|
imageView: function(can, value) {
|
||||||
|
return can.base.contains(value.icons, "bi ")? {view: [value.icons, "i"]}: {img: can.misc.ResourceIcons(can, value.icons)}
|
||||||
|
},
|
||||||
|
timeView: function(can, value, key) {
|
||||||
|
if (key) { return {text: [can.user.trans(can, key, null, html.INPUT)+": "+can.base.TimeTrim(value[key]), "", mdb.TIME]} }
|
||||||
|
return {text: [can.base.TimeTrim(value[key]||value.browse_time||value.updated_at||value.created_at||value.time), "", mdb.TIME]}
|
||||||
|
},
|
||||||
|
unitView: function(can, value, key, unit) { if (!value[key] || value[key] == "0") { return }
|
||||||
|
return {text: [[can.user.trans(can, key, null, html.INPUT)+":", value[key]].concat(unit? [unit]: []).join(" "), "", key]}
|
||||||
|
},
|
||||||
|
typeStyle: function(can, value, key) { return can.Conf("_trans.value."+key+".style."+value[key])||"" },
|
||||||
|
roleStyle: function(can, value, key) { return can.Conf("_trans.value."+key+".style."+value[key])||"" },
|
||||||
|
authView: function(can, value) { return can.base.isIn(value.auth_status, "issued", "2") && {view: [aaa.AUTH, html.SPAN], list: [{icon: "bi bi-patch-check-fill", style: {color: "var(--notice-bg-color)"}}]} },
|
||||||
|
textView: function(can, value, key, type) {
|
||||||
|
key || can.core.Item(value, function(k, v) { if (k == "status" || can.base.endWith(k, "_status")) { key = k } }); if (!type) { type = key.split("_").pop() }
|
||||||
|
return value[key] && !can.base.isIn(value[key], "finish", "done") && {text: [can.user.transValue(can, value, key), "", [type, value[key], can.Conf("_trans.value."+key+".style."+value[key])||""]]}
|
||||||
|
},
|
||||||
|
beginTime: function(can, value) {
|
||||||
|
return (value.process_time||value.begin_time||"").split(" ")[0]+" ~ "+(value.finish_time||value.end_time||"").split(" ")[0]
|
||||||
|
},
|
||||||
|
moneyView: function(can, value, key) { return {text: ["¥ "+(value[key]||value.price||value.amount)+" 元", "", "price"]} },
|
||||||
|
})
|
||||||
|
Volcanos(chat.ONLAYOUT, {
|
||||||
|
_init: function(can, height, width) { can.core.CallFunc([can.onimport, html.LAYOUT], {can: can, height: height, width: width}) },
|
||||||
|
zone: function(can, height, width) { can.onlayout._init(can, height, width) },
|
||||||
|
result: function(can, height, width) { can.onlayout._init(can, height, width) },
|
||||||
|
simple: function(can, height, width) { can.onlayout._init(can, height, width) },
|
||||||
|
output: function(can, height, width) { can.onlayout._init(can, height, width) },
|
||||||
|
float: function(can, height, width) { can.onlayout._init(can, height, width) },
|
||||||
|
full: function(can, height, width) { can.onlayout._init(can, height, width) },
|
||||||
|
cmd: function(can, height, width) { can.onlayout._init(can, height, width) },
|
||||||
|
})
|
||||||
|
Volcanos(chat.ONEXPORT, {
|
||||||
|
action_value: function(can, key, def) { var value = can.Action(key); return can.base.isIn(value, ice.AUTO, key, undefined)? def: value },
|
||||||
|
table: function(can) { var msg = can._msg; if (msg.Length() == 0) { return } var res = [msg.append && msg.append.join(mdb.FS)]
|
||||||
|
msg.Table(function(line, index, array) { res.push(can.core.Item(line, function(key, value) { return value }).join(ice.FS)) })
|
||||||
|
return res.join(lex.NL)
|
||||||
|
},
|
||||||
|
board: function(can) { var msg = can._msg; return msg.Result() },
|
||||||
|
tabs: function(can) {},
|
||||||
|
tool: function(can) { can.onexport.session(can, "tool", JSON.stringify(can.page.Select(can, can._status, html.LEGEND, function(target) { return target._meta }))) },
|
||||||
|
hash: function(can, hash) {
|
||||||
|
hash = typeof hash == code.STRING? hash.split(":").concat(can.core.List(arguments).slice(2)||[]): hash || can.core.Item(can.Option(), function(key, value) { return value||"" })
|
||||||
|
return can.sup.onexport.hash(can.sup, hash)
|
||||||
|
},
|
||||||
|
title: function(can, title) { can.sup.onexport.title.apply(can.sup.onexport, [can.sup].concat(can.core.List(arguments).slice(1))) },
|
||||||
|
session: function(can, key, value) { return can.sup && can.sup.onexport.session(can.sup, key, value) },
|
||||||
|
storage: function(can, key, value) { return can.sup && can.sup.onexport.storage(can.sup, key, value) },
|
||||||
|
})
|
||||||
|
Volcanos(chat.ONACTION, {
|
||||||
|
onkeydown: function(event, can) {
|
||||||
|
if (can.onkeymap.selectCtrlN(event, can, can.ui.tabs||can._action, html.DIV_TABS)) { return }
|
||||||
|
can.onkeymap._parse(event, can)
|
||||||
|
},
|
||||||
|
onslidemove: function(event, can, data, direction) {
|
||||||
|
// can.user.toast(can, [direction, data.spanX, data.spanY].join(","))
|
||||||
|
},
|
||||||
|
onslideleft: function(event, can, data, direction) {
|
||||||
|
return
|
||||||
|
var button = can.base.Obj(can._msg.Option("_action"), [])[0]; if (!button) { return }
|
||||||
|
can.run({}, [ctx.ACTION, button].concat(can.base.trim(can.core.Item(can.Option(), function(key, value) { return value }))))
|
||||||
|
},
|
||||||
|
onslideright: function(event, can, data, direction) {
|
||||||
|
can.onaction._goback && can.onaction._goback(event)
|
||||||
|
},
|
||||||
|
onslidedown: function(event, can, data, direction) {
|
||||||
|
var target = can.ui.list||can.ui.output||can._output
|
||||||
|
if (target.scrollTop < -100) {
|
||||||
|
can.Update(can.request(event, {_toast: "reload"}))
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onslideup: function(event, can, data, direction) {
|
||||||
|
var target = can.ui.list||can.ui.output||can._output
|
||||||
|
if (target.offsetHeight+target.scrollTop > target.scrollHeight+100) {
|
||||||
|
can.Update(can.request(event, {_toast: "reload"}))
|
||||||
|
}
|
||||||
|
},
|
||||||
|
})
|
||||||
|
Volcanos(chat.ONKEYMAP, {
|
||||||
|
escape: function(event, can) {}, enter: function(event, can) {},
|
||||||
|
ctrln: function(event, can) { can.onkeymap.selectCtrlN(event, can, can._action, html.DIV_TABS) },
|
||||||
|
space: function(event, can) { can.ui.filter && (can.ui.filter.focus(), can.onkeymap.prevent(event)) },
|
||||||
|
tabx: function(event, can) { can.page.Select(can, can._action, html.DIV_TABS_SELECT, function(target) { target._close() }) },
|
||||||
|
tabs: function(event, can) {},
|
||||||
|
_mode: {
|
||||||
|
plugin: {
|
||||||
|
Escape: shy("清理屏幕", function(event, can) { can.onkeymap.escape(event, can) }),
|
||||||
|
Enter: shy("执行操作", function(event, can) { can.onkeymap.enter(event, can) }),
|
||||||
|
" ": shy("搜索项目", function(event, can) { can.onkeymap.space(event, can) }),
|
||||||
|
f: shy("搜索项目", function(event, can) { can.ui.filter && (can.ui.filter.focus(), can.onkeymap.prevent(event)) }),
|
||||||
|
a: shy("展示项目", function(event, can) { can.ui.project && (can.onmotion.toggle(can, can.ui.project), can.onimport.layout(can)) }),
|
||||||
|
v: shy("展示预览", function(event, can) { can.ui.profile && (can.onmotion.toggle(can, can.ui.profile), can.onimport.layout(can)) }),
|
||||||
|
r: shy("展示输出", function(event, can) { can.ui.display && (can.onmotion.toggle(can, can.ui.display), can.onimport.layout(can)) }),
|
||||||
|
p: shy("添加插件", function(event, can) { can.sup.onaction["添加工具"](event, can.sup) }),
|
||||||
|
t: shy("添加标签", function(event, can) { can.onkeymap.tabs(event, can) }),
|
||||||
|
x: shy("添加标签", function(event, can) { can.onkeymap.tabx(event, can) }),
|
||||||
|
l: shy("打开右边标签", function(event, can) { can.page.Select(can, can._action, html.DIV_TABS_SELECT, function(target) {
|
||||||
|
var next = target.nextSibling; next && can.page.ClassList.has(can, next, html.TABS) && next.click()
|
||||||
|
}) }),
|
||||||
|
h: shy("打开左边标签", function(event, can) { can.page.Select(can, can._action, html.DIV_TABS_SELECT, function(target) {
|
||||||
|
var prev = target.previousSibling; prev && can.page.ClassList.has(can, prev, html.TABS) && prev.click()
|
||||||
|
}) }),
|
||||||
},
|
},
|
||||||
uidView: function(can, value) { return value.uid.slice(0, 6) },
|
}, _engine: {},
|
||||||
metaView: function(can, value) {
|
})
|
||||||
return {view: html.STATUS, list: [
|
Volcanos(chat.ONINPUTS, {
|
||||||
can.onimport.uidView(can, value), can.onimport.timeView(can, value), value.user_name,
|
_nameicon: function(event, can, msg, target, name, title) { name = name||mdb.NAME
|
||||||
]}
|
can.page.Appends(can, can._output, msg.Table(function(value) {
|
||||||
},
|
var _title = can.user.trans(can.sup, value[title]||value[name]||value[mdb.NAME], null, "value."+name)
|
||||||
shipView: function(can, value) {
|
var icons = can.misc.ResourceIcons(can,
|
||||||
return {view: html.STATUS, list: [value.city_name, value.city_name? "|": "",
|
value.icons||value.icon||value.user_avatar||
|
||||||
value.street_name, value.street_name? "|": "",
|
can.sup.Conf("_trans.value."+name+".icons."+value[name])||
|
||||||
value.place_name, value.place_name? "|": "",
|
can.sup.Conf("_trans.value."+name+".icons."+value[title])
|
||||||
value.service_name.replace(" ", " | ")]}
|
)
|
||||||
},
|
return {view: html.ITEM, list: [{img: can.misc.Resource(can, icons), },
|
||||||
spaceView: function(can, value) { return {view: "space"} },
|
{view: html.CONTAINER, list: [{view: [html.TITLE, "", _title]},
|
||||||
imageView: function(can, value) {
|
can.onappend.label(can, value, kit.Dict(
|
||||||
return can.base.contains(value.icons, "bi ")? {view: [value.icons, "i"]}: {img: can.misc.ResourceIcons(can, value.icons)}
|
"version", icon.version, "time", icon.compile, name, icon.data,
|
||||||
},
|
"user_name", icon.username,
|
||||||
timeView: function(can, value, key) {
|
)),
|
||||||
if (key) { return {text: [can.user.trans(can, key, null, html.INPUT)+": "+can.base.TimeTrim(value[key]), "", mdb.TIME]} }
|
]},
|
||||||
return {text: [can.base.TimeTrim(value[key]||value.browse_time||value.updated_at||value.created_at||value.time), "", mdb.TIME]}
|
], onclick: function(event) { can.showIcons(value[name]||value[mdb.NAME], icons, _title) }}
|
||||||
},
|
}))
|
||||||
unitView: function(can, value, key, unit) { if (!value[key] || value[key] == "0") { return }
|
},
|
||||||
return {text: [[can.user.trans(can, key, null, html.INPUT)+":", value[key]].concat(unit? [unit]: []).join(" "), "", key]}
|
dream: function(event, can, msg, target, name) { can.sup.sub.oninputs._nameicon(event, can, msg, target, name) },
|
||||||
},
|
})
|
||||||
typeStyle: function(can, value, key) { return can.Conf("_trans.value."+key+".style."+value[key])||"" },
|
|
||||||
roleStyle: function(can, value, key) { return can.Conf("_trans.value."+key+".style."+value[key])||"" },
|
|
||||||
authView: function(can, value) { return can.base.isIn(value.auth_status, "issued", "2") && {view: [aaa.AUTH, html.SPAN], list: [{icon: "bi bi-patch-check-fill", style: {color: "var(--notice-bg-color)"}}]} },
|
|
||||||
textView: function(can, value, key, type) {
|
|
||||||
key || can.core.Item(value, function(k, v) { if (k == "status" || can.base.endWith(k, "_status")) { key = k } }); if (!type) { type = key.split("_").pop() }
|
|
||||||
return value[key] && !can.base.isIn(value[key], "finish", "done") && {text: [can.user.transValue(can, value, key), "", [type, value[key], can.Conf("_trans.value."+key+".style."+value[key])||""]]}
|
|
||||||
},
|
|
||||||
beginTime: function(can, value) {
|
|
||||||
return (value.process_time||value.begin_time||"").split(" ")[0]+" ~ "+(value.finish_time||value.end_time||"").split(" ")[0]
|
|
||||||
},
|
|
||||||
moneyView: function(can, value, key) { return {text: ["¥ "+(value[key]||value.price||value.amount)+" 元", "", "price"]} },
|
|
||||||
})
|
|
||||||
Volcanos(chat.ONLAYOUT, {
|
|
||||||
_init: function(can, height, width) { can.core.CallFunc([can.onimport, html.LAYOUT], {can: can, height: height, width: width}) },
|
|
||||||
zone: function(can, height, width) { can.onlayout._init(can, height, width) },
|
|
||||||
result: function(can, height, width) { can.onlayout._init(can, height, width) },
|
|
||||||
simple: function(can, height, width) { can.onlayout._init(can, height, width) },
|
|
||||||
output: function(can, height, width) { can.onlayout._init(can, height, width) },
|
|
||||||
float: function(can, height, width) { can.onlayout._init(can, height, width) },
|
|
||||||
full: function(can, height, width) { can.onlayout._init(can, height, width) },
|
|
||||||
cmd: function(can, height, width) { can.onlayout._init(can, height, width) },
|
|
||||||
})
|
|
||||||
Volcanos(chat.ONEXPORT, {
|
|
||||||
action_value: function(can, key, def) { var value = can.Action(key); return can.base.isIn(value, ice.AUTO, key, undefined)? def: value },
|
|
||||||
table: function(can) { var msg = can._msg; if (msg.Length() == 0) { return } var res = [msg.append && msg.append.join(mdb.FS)]
|
|
||||||
msg.Table(function(line, index, array) { res.push(can.core.Item(line, function(key, value) { return value }).join(ice.FS)) })
|
|
||||||
return res.join(lex.NL)
|
|
||||||
},
|
|
||||||
board: function(can) { var msg = can._msg; return msg.Result() },
|
|
||||||
tabs: function(can) {},
|
|
||||||
tool: function(can) { can.onexport.session(can, "tool", JSON.stringify(can.page.Select(can, can._status, html.LEGEND, function(target) { return target._meta }))) },
|
|
||||||
hash: function(can, hash) {
|
|
||||||
hash = typeof hash == code.STRING? hash.split(":").concat(can.core.List(arguments).slice(2)||[]): hash || can.core.Item(can.Option(), function(key, value) { return value||"" })
|
|
||||||
return can.sup.onexport.hash(can.sup, hash)
|
|
||||||
},
|
|
||||||
title: function(can, title) { can.sup.onexport.title.apply(can.sup.onexport, [can.sup].concat(can.core.List(arguments).slice(1))) },
|
|
||||||
session: function(can, key, value) { return can.sup && can.sup.onexport.session(can.sup, key, value) },
|
|
||||||
storage: function(can, key, value) { return can.sup && can.sup.onexport.storage(can.sup, key, value) },
|
|
||||||
})
|
|
||||||
Volcanos(chat.ONACTION, {
|
|
||||||
onkeydown: function(event, can) {
|
|
||||||
if (can.onkeymap.selectCtrlN(event, can, can.ui.tabs||can._action, html.DIV_TABS)) { return }
|
|
||||||
can.onkeymap._parse(event, can)
|
|
||||||
},
|
|
||||||
onslidemove: function(event, can, data, direction) {
|
|
||||||
// can.user.toast(can, [direction, data.spanX, data.spanY].join(","))
|
|
||||||
},
|
|
||||||
onslideleft: function(event, can, data, direction) {
|
|
||||||
return
|
|
||||||
var button = can.base.Obj(can._msg.Option("_action"), [])[0]; if (!button) { return }
|
|
||||||
can.run({}, [ctx.ACTION, button].concat(can.base.trim(can.core.Item(can.Option(), function(key, value) { return value }))))
|
|
||||||
},
|
|
||||||
onslideright: function(event, can, data, direction) {
|
|
||||||
can.onaction._goback && can.onaction._goback(event)
|
|
||||||
},
|
|
||||||
onslidedown: function(event, can, data, direction) {
|
|
||||||
var target = can.ui.list||can.ui.output||can._output
|
|
||||||
if (target.scrollTop < -100) {
|
|
||||||
can.Update(can.request(event, {_toast: "reload"}))
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onslideup: function(event, can, data, direction) {
|
|
||||||
var target = can.ui.list||can.ui.output||can._output
|
|
||||||
if (target.offsetHeight+target.scrollTop > target.scrollHeight+100) {
|
|
||||||
can.Update(can.request(event, {_toast: "reload"}))
|
|
||||||
}
|
|
||||||
},
|
|
||||||
})
|
|
||||||
Volcanos(chat.ONKEYMAP, {
|
|
||||||
escape: function(event, can) {}, enter: function(event, can) {},
|
|
||||||
ctrln: function(event, can) { can.onkeymap.selectCtrlN(event, can, can._action, html.DIV_TABS) },
|
|
||||||
space: function(event, can) { can.ui.filter && (can.ui.filter.focus(), can.onkeymap.prevent(event)) },
|
|
||||||
tabx: function(event, can) { can.page.Select(can, can._action, html.DIV_TABS_SELECT, function(target) { target._close() }) },
|
|
||||||
tabs: function(event, can) {},
|
|
||||||
_mode: {
|
|
||||||
plugin: {
|
|
||||||
Escape: shy("清理屏幕", function(event, can) { can.onkeymap.escape(event, can) }),
|
|
||||||
Enter: shy("执行操作", function(event, can) { can.onkeymap.enter(event, can) }),
|
|
||||||
" ": shy("搜索项目", function(event, can) { can.onkeymap.space(event, can) }),
|
|
||||||
f: shy("搜索项目", function(event, can) { can.ui.filter && (can.ui.filter.focus(), can.onkeymap.prevent(event)) }),
|
|
||||||
a: shy("展示项目", function(event, can) { can.ui.project && (can.onmotion.toggle(can, can.ui.project), can.onimport.layout(can)) }),
|
|
||||||
v: shy("展示预览", function(event, can) { can.ui.profile && (can.onmotion.toggle(can, can.ui.profile), can.onimport.layout(can)) }),
|
|
||||||
r: shy("展示输出", function(event, can) { can.ui.display && (can.onmotion.toggle(can, can.ui.display), can.onimport.layout(can)) }),
|
|
||||||
p: shy("添加插件", function(event, can) { can.sup.onaction["添加工具"](event, can.sup) }),
|
|
||||||
t: shy("添加标签", function(event, can) { can.onkeymap.tabs(event, can) }),
|
|
||||||
x: shy("添加标签", function(event, can) { can.onkeymap.tabx(event, can) }),
|
|
||||||
l: shy("打开右边标签", function(event, can) { can.page.Select(can, can._action, html.DIV_TABS_SELECT, function(target) {
|
|
||||||
var next = target.nextSibling; next && can.page.ClassList.has(can, next, html.TABS) && next.click()
|
|
||||||
}) }),
|
|
||||||
h: shy("打开左边标签", function(event, can) { can.page.Select(can, can._action, html.DIV_TABS_SELECT, function(target) {
|
|
||||||
var prev = target.previousSibling; prev && can.page.ClassList.has(can, prev, html.TABS) && prev.click()
|
|
||||||
}) }),
|
|
||||||
},
|
|
||||||
}, _engine: {},
|
|
||||||
})
|
|
||||||
Volcanos(chat.ONINPUTS, {
|
|
||||||
_nameicon: function(event, can, msg, target, name, title) { name = name||mdb.NAME
|
|
||||||
can.page.Appends(can, can._output, msg.Table(function(value) {
|
|
||||||
var _title = can.user.trans(can.sup, value[title]||value[name]||value[mdb.NAME], null, "value."+name)
|
|
||||||
var icons = can.misc.ResourceIcons(can,
|
|
||||||
value.icons||value.icon||value.user_avatar||
|
|
||||||
can.sup.Conf("_trans.value."+name+".icons."+value[name])||
|
|
||||||
can.sup.Conf("_trans.value."+name+".icons."+value[title])
|
|
||||||
)
|
|
||||||
return {view: html.ITEM, list: [{img: can.misc.Resource(can, icons), },
|
|
||||||
{view: html.CONTAINER, list: [{view: [html.TITLE, "", _title]},
|
|
||||||
can.onappend.label(can, value, kit.Dict(
|
|
||||||
"version", icon.version, "time", icon.compile,
|
|
||||||
name, icon.data,
|
|
||||||
"user_name", icon.username,
|
|
||||||
)),
|
|
||||||
]},
|
|
||||||
], onclick: function(event) { can.showIcons(value[name]||value[mdb.NAME], icons, _title) }}
|
|
||||||
}))
|
|
||||||
},
|
|
||||||
dream: function(event, can, msg, target, name) { can.sup.sub.oninputs._nameicon(event, can, msg, target, name) },
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user