mirror of
https://shylinux.com/x/volcanos
synced 2025-04-25 16:58:06 +08:00
opt height and width
This commit is contained in:
parent
9f936179e2
commit
9a1bd48da6
4
const.js
4
const.js
@ -281,8 +281,8 @@ var http = {
|
||||
GET: "GET", PUT: "PUT", POST: "POST", DELETE: "DELETE",
|
||||
Accept: "Accept", ContentType: "Content-Type", ApplicationJSON: "application/json", ApplicationFORM: "application/x-www-form-urlencoded",
|
||||
}
|
||||
var html = {
|
||||
RIVER_WIDTH: 230,
|
||||
var html = {RIVER_WIDTH: 230, PROJECT_WIDTH: 230,
|
||||
PLUG_WIDTH: 800, PLUG_HEIHGT: 320, STORY_HEIHGT: 480, FLOAT_HEIHGT: 480, FLOAT_WIDTH: 1200, DESKTOP_WIDTH: 1200, DESKTOP_HEIGHT: 684,
|
||||
RIVER_MARGIN: 80, PLUGIN_MARGIN: 10, PLUGIN_PADDING: 10, ACTION_MARGIN: 200, ACTION_HEIGHT: 32, STATUS_HEIGHT: 32,
|
||||
FIELDSET: "fieldset", LEGEND: "legend", OPTION: "option", ACTION: "action", OUTPUT: "output", STATUS: "status",
|
||||
OPTION_ARGS: "select.args,input.args,textarea.args", INPUT_ARGS: "input.args,textarea.args", INPUT_BUTTON: "input[type=button]", INPUT_FILE: "input[type=file]",
|
||||
|
27
frame.js
27
frame.js
@ -21,14 +21,14 @@ Volcanos(chat.ONENGINE, {_init: function(can, meta, list, cb, target) {
|
||||
if (panel.onengine._plugin(event, can, msg, panel, cmds, cb)) { return }
|
||||
if (panel.onengine._engine(event, can, msg, panel, cmds, cb)) { return }
|
||||
if (panel.onengine._static(event, can, msg, panel, cmds, cb)) { return }
|
||||
var toast, _toast = msg.Option(chat._TOAST); if (_toast) { can.onmotion.delay(can, function() { if (msg._can && msg._can._toast) { return } toast = toast||can.user.toastProcess(msg._can, _toast) }, 500) }
|
||||
var toast, _toast = msg.Option(chat._TOAST); if (_toast) { can.onmotion.delay(can, function() { if (msg._can && msg._can._toast) { return } toast = toast||can.user.toastProcess(msg._can, _toast) }, 300) }
|
||||
if (can.base.isUndefined(msg[ice.MSG_DAEMON])) { can.base.isUndefined(sub._daemon) && can.ondaemon._list[0] && (sub._daemon = can.ondaemon._list.push(sub)-1)
|
||||
if (sub._daemon) { msg.Option(ice.MSG_DAEMON, can.core.Keys(can.ondaemon._list[0], sub._daemon)) }
|
||||
} if (!can.misc.CookieSessid(can) && can.user.info.sessid) { msg.Option(ice.MSG_SESSID, can.user.info.sessid) }
|
||||
var names = msg.Option(chat._NAMES)||panel._names||((can.Conf("iceberg")||Volcanos.meta.iceberg)+"/chat/"+panel._name+"/")
|
||||
names = can.base.MergeURL(names, ice.MSG_INDEX, sub.ConfIndex()), can.page.exportValue(sub, msg)
|
||||
can.onengine.signal(panel, chat.ONREMOTE, can.request({}, {_follow: panel._follow, _msg: msg, _cmds: cmds, names: names}))
|
||||
can.misc.Run(event, can, {names: names}, cmds, function(msg) { toast && toast.close && toast.close(), toast = true
|
||||
can.misc.Run(event, can, {names: names}, cmds, function(msg) { toast && toast.close && toast.close(), toast = true, _toast && can.user.toastSuccess(msg._can)
|
||||
can.base.isFunc(cb) && cb(msg), Volcanos.meta.pack[can.core.Keys(panel._name, cmds.join(mdb.FS))] = msg
|
||||
})
|
||||
},
|
||||
@ -122,7 +122,8 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
||||
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) { event = event||{}
|
||||
sub.request(event, {_toast: event.isTrusted? ice.PROCESS: ""})._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() }) },
|
||||
Input: function(cmds, save, opts) { cmds = cmds && cmds.length > 0? cmds: can.page.SelectArgs(sub), cmds && cmds[0] != ctx.ACTION && (cmds = can.base.trim(cmds))
|
||||
cmds._opts = opts
|
||||
@ -152,9 +153,9 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
||||
var icon = {
|
||||
"": {name: mdb.DELETE, cb: function(event) { can.onaction.close(event, can) }},
|
||||
run: {name: web.PLAY, cb: function(event) { can.Update(event) }},
|
||||
list: {name: web.REFRESH, cb: function(event) { can.Update(event) }},
|
||||
back: {name: "goback", cb: function(event) { can.onimport._back(can) }},
|
||||
refresh: {name: web.REFRESH, cb: function(event) { can.Update(event) }},
|
||||
list: {name: web.REFRESH, cb: function(event) { can.Update(event) }},
|
||||
back: {name: "goback", cb: function(event) { can.onimport.back(event, can) }},
|
||||
prev: {name: mdb.PREV, cb: function(event) { var sub = can.sub; sub.onaction && sub.onaction.prev? sub.onaction.prev(event, sub): can.onaction.prev(event, can) }},
|
||||
next: {name: mdb.NEXT, cb: function(event) { var sub = can.sub; sub.onaction && sub.onaction.next? sub.onaction.next(event, sub): can.onaction.next(event, can) }},
|
||||
play: {name: web.PLAY},
|
||||
@ -244,6 +245,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
||||
can.onmotion.clear(can, can._option), can.onappend._option(can, {inputs: can.page.inputs(can, sub.onimport.list, html.TEXT) })
|
||||
}
|
||||
sub.db.hash = can.isCmdMode()? can.misc.SearchHash(can): []
|
||||
can.page.style(can, can._output, html.HEIGHT, can._output.offsetHeight)
|
||||
can.onexport._output(sub, msg), sub.Mode() != "result" && can.onmotion.clear(can, output)
|
||||
can.core.CallFunc([sub, chat.ONIMPORT, chat._INIT], {can: sub, msg: msg, cb: function(msg) {
|
||||
if (action !== false) { can.onkeymap._build(sub)
|
||||
@ -743,16 +745,9 @@ Volcanos(chat.ONMOTION, {_init: function(can, target) {
|
||||
var last = can._delay_list.meta[key]||0, self = can._delay_list.meta[key] = can._delay_list.list.push(cb)
|
||||
return can.core.Timer(interval||30, function() { cb(self, last, can._delay_list.meta[key]) })
|
||||
},
|
||||
float: function(can) { var height = can.page.height()/2, width = can.page.width()*3/4
|
||||
if (can.user.isMobile) {
|
||||
if (can.user.isLandscape()) {
|
||||
height = can.page.height()*3/4, width = can.page.width()*3/4
|
||||
} else {
|
||||
width = can.page.width()
|
||||
}
|
||||
}
|
||||
can.onimport.size(can, height, width, true)
|
||||
can.onmotion.move(can, can._target, {left: can.page.width()-width, top: can.page.height()/4})
|
||||
float: function(can) { var height = can.base.Max(html.FLOAT_HEIGHT, can.page.height()/2), width = can.base.Max(html.FLOAT_WIDTH, can.page.width()-html.RIVER_WIDTH)
|
||||
if (can.user.isMobile) { if (can.user.isLandscape()) { height = can.page.height()*3/4, width = can.page.width()*3/4 } else { width = can.page.width() } }
|
||||
can.onimport.size(can, height, width, true), can.onmotion.move(can, can._target, {left: can.page.width()-width, top: can.page.height()/4})
|
||||
can.onmotion.resize(can, can._target, function(height, width) { can.onimport.size(can, height, width, true) })
|
||||
},
|
||||
clear: function(can, target) { return can.page.Modify(can, target||can._output, ""), target },
|
||||
@ -934,7 +929,7 @@ Volcanos(chat.ONKEYMAP, {_init: function(can, target) { target = target||documen
|
||||
total == 0 && can.base.isFunc(cb) && cb()
|
||||
},
|
||||
selectOutput: function(event, can) { if (!event.ctrlKey || event.key < "0" || event.key > "9") { return }
|
||||
event.key == "0"? can.onimport._back(can): can.page.Select(can, can._output, html.TR, function(tr, index) { if (index == event.key) {
|
||||
event.key == "0"? can.onimport.back(event, can): can.page.Select(can, can._output, html.TR, function(tr, index) { if (index == event.key) {
|
||||
var head = can.page.Select(can, can._output, html.TH, function(th, order) { return th.innerText }), data = {}
|
||||
can.page.Select(can, tr, html.TD, function(td, index) { data[head[index]] = td.innerText, can.Option(head[index], td.innerText) })
|
||||
can.onexport.record(can, "", "", data) || can.Update(event)
|
||||
|
18
index.css
18
index.css
@ -27,16 +27,17 @@ body {
|
||||
--code-font-family:monospace; --svg-font-family:var(--code-font-family);
|
||||
--body-font-family:sans-serif;
|
||||
--legend-font-family:var(--input-font-family); --status-font-family:var(--body-font-family);
|
||||
--input-font-family:cursive; --table-font-family:var(--body-font-family);
|
||||
--input-font-family:cursive; --table-font-family:var(--body-font-family);
|
||||
|
||||
--body-font-size:16px; --legend-font-size:20px; --icon-font-size:20px;
|
||||
--code-font-size:14px; --code-line-height:20px; --code-tabs-height:48px;
|
||||
--code-font-size:14px; --code-line-height:24px; --code-tabs-height:48px;
|
||||
--svg-font-size:24px; --svg-stroke-width:1; --status-font-size:12px;
|
||||
|
||||
--legend-padding:20px; --title-margin:var(--legend-padding); --river-margin:80px;
|
||||
--textarea-height:96px; --qrcode-height:320px; --iframe-height:420px;
|
||||
--action-height:32px; --status-height:var(--action-height); --footer-height:var(--action-height); --header-height:48px;
|
||||
--project-width:230px; --river-width:var(--project-width); --input-width:120px; --button-width:60px;
|
||||
--plug-width:800px; --plug-height:320px; --story-height:480px; --float-height:480px; --float-width:1000px; --desktop-width:1200px; --desktop-height:684px;
|
||||
--plugin-margin:var(--plugin-padding); --button-margin:var(--button-padding); --input-margin:var(--input-padding); --action-margin:200px; --desktop-icon-size:80px;
|
||||
--plugin-padding:10px; --button-padding:var(--plugin-padding); --input-padding:5px; --table-padding:var(--button-padding);
|
||||
--plugin-radius:var(--plugin-padding); --button-radius:var(--input-padding);
|
||||
@ -76,7 +77,14 @@ table.content thead { position:sticky; top:2px; }
|
||||
table.content tr.disable { color:var(--disable-fg-color); }
|
||||
table.content tr.offline { color:var(--disable-fg-color); }
|
||||
table.content tr.offline a { color:var(--disable-fg-color); }
|
||||
table.content th { font-family:var(--input-font-family); padding:var(--input-padding) var(--table-padding); box-shadow:var(--box-shadow); }
|
||||
table.content th { font-family:var(--input-font-family); padding:var(--input-padding) 24px; box-shadow:var(--box-shadow); }
|
||||
table.content th { position:relative; }
|
||||
table.content th span { cursor:pointer; }
|
||||
table.content th i { position:absolute; right:var(--input-padding); cursor:pointer; }
|
||||
table.content th:not(.select) i { display:none; }
|
||||
table.content th.select { background-color:var(--notice-bg-color); color:var(--notice-fg-color); }
|
||||
table.content th.select[data-asc="1"] i.bi-sort-down-alt { display:none; }
|
||||
table.content th.select[data-asc="0"] i.bi-sort-up { display:none; }
|
||||
table.content td { padding:var(--table-padding); }
|
||||
table.content.detail td:first-child { width:var(--input-width); }
|
||||
table.content.action th:last-child { position:sticky; right:2px; }
|
||||
@ -273,7 +281,9 @@ fieldset.story>div.action>div.button.icons>input { display:none; }
|
||||
fieldset.plug>form.option>div.button.icons>input { display:none; }
|
||||
fieldset.plug>div.action>div.button.icons>input { display:none; }
|
||||
fieldset.plug>form.option>div.icon:first-child { margin-left:var(--input-margin); }
|
||||
fieldset>form.option>div.text>span.value { white-space:pre; padding:var(--input-padding) var(--button-padding); max-width:200px; height:var(--action-height); overflow:auto; }
|
||||
fieldset>form.option>div.text>span.value {
|
||||
line-height:calc(var(--action-height) - 2 * var(--input-padding));
|
||||
white-space:pre; padding:var(--input-padding) var(--button-padding); max-width:200px; height:var(--action-height); overflow:auto; }
|
||||
fieldset.plug>form.option>div.text>span.value { display:none; }
|
||||
fieldset:not(.float)>form.option>div.text>span.value { display:none; }
|
||||
fieldset.float:not(.plug)>form.option>div.text>input { display:none; }
|
||||
|
11
lib/page.js
11
lib/page.js
@ -174,13 +174,18 @@ Volcanos("page", {
|
||||
try { var value = can.Option(key) } catch {}
|
||||
if (value == undefined) { return {view: [key, "col"]} } return {view: [[key, "option"], "col"]}
|
||||
} }) }, {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 can.user.trans(can, key, null, html.INPUT) } }) }])
|
||||
can.page.Append(can, ui.thead, [{type: html.TR, data: {dataset: {index: -1}}, list: can.core.List(list, function(key) {
|
||||
if (key[0] != "_") {
|
||||
return {type: html.TH, list: [{text: can.user.trans(can, key, null, html.INPUT)}, {icon: "bi bi-sort-down-alt"}, {icon: "bi bi-sort-up"}]}
|
||||
}
|
||||
}) }])
|
||||
can.page.Append(can, ui.tbody, can.core.List(msg.Table(), function(item, index, array) {
|
||||
return {dataset: {index: index}, className: item[mdb.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)
|
||||
},
|
||||
OrderTable: function(can, table) { can.page.Select(can, table, html.TH, function(th, index) { th.onclick = function(event) { var dataset = event.target.dataset
|
||||
OrderTable: function(can, table) { can.page.Select(can, table, html.TH, function(th, index) { th.onclick = function(event) {
|
||||
var dataset = event.currentTarget.dataset
|
||||
can.onmotion.select(can, th.parentNode, html.TH, th)
|
||||
can.page.RangeTable(can, table, index, (dataset["asc"] = (dataset["asc"] == "1") ? 0: 1) == "1")
|
||||
} }); return table },
|
||||
RangeTable: function(can, table, index, asc) { index = can.base.isArray(index)? can.core.List(index, function(item) { if (item > -1) { return item } }): [index]; if (index.length == 0) { return }
|
||||
|
@ -35,6 +35,14 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) {
|
||||
_const: function(can) {
|
||||
html.RIVER_WIDTH = can.page.styleValueInt(can, "--river-width")
|
||||
html.RIVER_MARGIN = can.page.styleValueInt(can, "--river-margin")
|
||||
html.PROJECT_WIDTH = can.page.styleValueInt(can, "--project-width")
|
||||
html.PLUG_WIDTH = can.page.styleValueInt(can, "--plug-width")
|
||||
html.PLUG_HEIGHT = can.page.styleValueInt(can, "--plug-height")
|
||||
html.STORY_HEIGHT = can.page.styleValueInt(can, "--story-height")
|
||||
html.FLOAT_HEIGHT = can.page.styleValueInt(can, "--float-height")
|
||||
html.FLOAT_WIDTH = can.page.styleValueInt(can, "--float-width")
|
||||
html.DESKTOP_WIDTH = can.page.styleValueInt(can, "--desktop-width")
|
||||
html.DESKTOP_HEIGHT = can.page.styleValueInt(can, "--desktop-height")
|
||||
html.PLUGIN_PADDING = can.page.styleValueInt(can, "--plugin-padding")
|
||||
html.PLUGIN_MARGIN = can.page.styleValueInt(can, "--plugin-margin")
|
||||
html.ACTION_MARGIN = can.page.styleValueInt(can, "--action-margin")
|
||||
|
@ -1,6 +1,7 @@
|
||||
Volcanos(chat.ONACTION, {
|
||||
run: function(event, can) { can.run(can.request(event, {_method: http.POST})) }, refresh: function(event, can) { can.run(can.request(event, {_method: http.GET})) },
|
||||
list: function(event, can) { can.sup.isSimpleMode() || can.run(can.request(event, {_method: http.GET})) }, back: function(event, can) { can.sup.onimport._back(can.sup) },
|
||||
list: function(event, can) {
|
||||
can.sup.isSimpleMode() || can.run(can.request(event, {_toast: event.isTrusted? ice.PROCESS: "" , _method: http.GET})) }, back: function(event, can) { can.sup.onimport.back(event, can.sup) },
|
||||
onclick: function(event, can) { can.Conf(mdb.TYPE) == html.BUTTON && can.run(event, [ctx.ACTION, can.Conf(mdb.NAME)].concat(can.sup.Input())), can.onkeymap.prevent(event) },
|
||||
onchange: function(event, can) { can.Conf(mdb.TYPE) == html.SELECT && can.run(event) },
|
||||
onkeydown: function(event, can) { can.onkeymap.input(event, can, event.target); if (can.Conf(mdb.TYPE) == html.TEXTAREA && !event.ctrlKey) { return }
|
||||
|
@ -59,7 +59,7 @@ div.vimer.open.float td:nth-child(2) { display:none; }
|
||||
div.vimer.plug.float div.item.text input { width:var(--river-width); }
|
||||
div.layout.flex>input.current { clear:both; }
|
||||
tr.line>td.line { user-select:none; border-right:var(--box-border); }
|
||||
tr.line>td.line { text-align:right; padding:0 var(--button-padding); position:sticky; left:0; }
|
||||
tr.line>td.line { text-align:right; line-height:var(--code-line-height); padding:0 var(--button-padding); position:sticky; left:0; }
|
||||
tr.line>td.text { white-space:pre; line-height:var(--code-line-height); padding-left:var(--input-padding); width:100%; }
|
||||
tr.line:hover { background-color:var(--hover-bg-color); }
|
||||
tr.line.insert { background-color:#283e2d; } tr.line.delete { background-color:#3c2626; }
|
||||
|
@ -22,6 +22,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) { var paths = can.core.Sp
|
||||
}
|
||||
can.db = {paths: paths, tabview: {}, history: [], _history: [], toolkit: {}}, can.db.tabview[can.onexport.keys(can)] = msg
|
||||
can.ui = can.onappend.layout(can, [html.PROJECT, [html.TABS, nfs.PATH, [html.CONTENT, html.PROFILE], html.DISPLAY, html.PLUG]])
|
||||
can.onimport.layout(can)
|
||||
can.ui._content = can.ui.content, can.ui._profile = can.ui.profile, can.ui._display = can.ui.display, can.onmotion.hidden(can, can.ui.plug)
|
||||
can.onmotion.hidden(can, can.ui.profile), can.onmotion.hidden(can, can.ui.display)
|
||||
if (can.Conf(ctx.STYLE) == html.OUTPUT) { can.onmotion.hidden(can, can.ui.project), can.page.style(can, can.ui.content, html.HEIGHT, "") }
|
||||
|
@ -1,5 +1,6 @@
|
||||
fieldset.vimer>div.output>div.layout>div.layout>div.layout div.content { border-left:var(--box-border); border-top:var(--box-border); }
|
||||
fieldset.vimer>div.output>div.layout>div.layout div.content input.current { background-color:transparent; color:transparent; padding-left:var(--input-padding); height:var(--code-line-height); position:absolute; }
|
||||
/* fieldset.vimer>div.output>div.layout>div.layout div.content input.current { background-color:transparent; color:transparent; padding-left:var(--input-padding); height:var(--code-line-height); position:absolute; } */
|
||||
fieldset.vimer>div.output>div.layout>div.layout input.current { background-color:transparent; color:transparent; padding-left:var(--input-padding); height:var(--code-line-height); position:absolute; }
|
||||
fieldset.vimer>div.output>div.layout>div.layout div.content div.complete { background-color:unset; padding-top:0; display:none; position:absolute; height:1px; overflow:visible; }
|
||||
fieldset.vimer>div.output>div.layout>div.layout div.content div.complete div.prefix { color:transparent; white-space:pre; float:left; }
|
||||
fieldset.vimer>div.output>div.layout>div.layout div.content div.complete table.content thead { display:none; }
|
||||
|
@ -46,7 +46,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.Conf(html.PADDI
|
||||
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])
|
||||
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.Max(html.STORY_HEIGHT, can.ConfHeight()), 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), 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._output, target)
|
||||
|
@ -12,7 +12,7 @@ Volcanos(chat.ONIMPORT, {
|
||||
_display: function(can, msg) { can.onappend._output(can, msg, msg.Option(ice.MSG_DISPLAY)) },
|
||||
_clear: function(can, msg) { can.onmotion.clear(can) },
|
||||
_inner: function(can, sub, msg) { can.onappend.table(sub, msg), can.onappend.board(sub, msg), can.onmotion.story.auto(sub) },
|
||||
_field: function(can, msg, cb) { var height = can.onexport.outputHeight(can), width = can.ConfWidth()
|
||||
_field: function(can, msg, cb) { var height = can.base.Max(html.STORY_HEIGHT, can.ConfHeight(), can.onexport.outputHeight(can)), width = can.ConfWidth()
|
||||
msg.Table(function(item) { can.onappend._plugin(can, item, {_space: can.ConfSpace(), index: item.index, args: can.base.Obj(item.args||item.arg, []), height: height, width: width}, function(sub) {
|
||||
can.onmotion.delay(can, function() { can.onmotion.scrollIntoView(can, sub._target) }, 300)
|
||||
sub.run = function(event, cmds, cb) { var index = msg.Option(ice.MSG_INDEX)
|
||||
@ -22,10 +22,7 @@ Volcanos(chat.ONIMPORT, {
|
||||
},
|
||||
_float: function(can, msg) { can.onimport._field(can, msg, function(sub) { can.onmotion.float(sub) }) },
|
||||
_hold: function(can, msg, arg) { can.user.toast(can, arg||ice.SUCCESS) },
|
||||
_back: function(can) { can._history.pop(); for (var i = 0, his = can._history.pop(); his; his = can._history.pop()) { if (his[0] == ctx.ACTION) { continue }
|
||||
can.page.SelectArgs(can, can._option, "", function(target) { target.value = his[i++]||"", can.page.Select(can, target.parentNode, "span.value", function(target) { target.innerText = target.value||"" }) })
|
||||
can.page.SelectArgs(can, can._action, "", function(target) { target.value = his[i++]||"" }); break
|
||||
} can.Update() },
|
||||
_back: function(can) { can.onimport.back({}, can) },
|
||||
_rich: function(can, msg) { if (can.page.Select(can, can._output, [html.TABLE_CONTENT, html.TBODY], function(table) {
|
||||
var head = can.page.Select(can, can._output, [html.TABLE_CONTENT, html.TH], function(th) { return th.innerText })
|
||||
return can.page.Append(can, table, msg.Table(function(value) { return {row: can.core.List(head, function(key) { return value[key] })} }))
|
||||
@ -78,6 +75,10 @@ Volcanos(chat.ONIMPORT, {
|
||||
var _height = can.base.Max(sub._target.offsetHeight+border, can.ConfHeight()/2)
|
||||
sub.onimport.size(sub, _height-border, can.ConfWidth()-(can.ui && can.ui.project? can.ui.project.offsetWidth: 0), true)
|
||||
},
|
||||
back: function(event, can) { can._history.pop(); for (var i = 0, his = can._history.pop(); his; his = can._history.pop()) { if (his[0] == ctx.ACTION) { continue }
|
||||
can.page.SelectArgs(can, can._option, "", function(target) { target.value = his[i++]||"", can.page.Select(can, target.parentNode, "span.value", function(target) { target.innerText = target.value||"" }) })
|
||||
can.page.SelectArgs(can, can._action, "", function(target) { target.value = his[i++]||"" }); break
|
||||
} can.Update(event) },
|
||||
})
|
||||
Volcanos(chat.ONACTION, {list: [
|
||||
"刷新数据", "刷新界面", "切换浮动", "切换全屏",
|
||||
|
@ -180,11 +180,9 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.onmotion.clear(
|
||||
tool: function(can, list, cb, target, status) { target = target||can._output, status = status||can._status
|
||||
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) {
|
||||
sub.onexport.output = function() { var width = can.ConfWidth()-(can.ui && can.ui.project? can.ui.project.offsetWidth: 0)
|
||||
var height = can.base.Max(can.ConfHeight()/2, can.ConfHeight()-html.ACTION_HEIGHT, 320)
|
||||
can.page.style(can, sub._output, html.MAX_HEIGHT, "", html.HEIGHT, "", html.WIDTH, "", html.MAX_WIDTH, "")
|
||||
sub.onimport.size(sub, height, can.base.Max(sub._target.offsetWidth, width, 800), false)
|
||||
can.onmotion.delay(can, function() { sub.onimport.size(sub, height, can.base.Max(sub._target.offsetWidth, width, 800), false) })
|
||||
sub.onexport.output = function() { can.page.style(can, sub._output, html.MAX_HEIGHT, "", html.HEIGHT, "", html.WIDTH, "", html.MAX_WIDTH, "")
|
||||
var height = can.base.Max(html.PLUG_HEIGHT, can.ConfHeight()-html.ACTION_HEIGHT), width = can.base.Max(html.PLUG_WIDTH, can.ConfWidth()-html.PROJECT_WIDTH)
|
||||
sub.onimport.size(sub, height, width, false), can.onmotion.delay(can, function() { sub.onimport.size(sub, height, width, false) })
|
||||
}
|
||||
can.onmotion.hidden(can, sub._target), sub._legend._target = sub._target, sub._legend._meta = {index: meta.index}
|
||||
can.page.Append(can, sub._legend,[{text: [can.page.unicode.remove, "", mdb.REMOVE], onclick: function(event) {
|
||||
|
2
proto.js
2
proto.js
@ -55,7 +55,7 @@ var Volcanos = shy({iceberg: "", volcano: "", frame: chat.FRAME_JS, _cache: {},
|
||||
can.core.List(arguments, function(item, index) { if (!item || index == 0) { return } can.core.Item(item, set) }); return msg
|
||||
},
|
||||
requestPodCmd: function(event) { return can.request(event, {space: can.ConfSpace(), index: can.ConfIndex()}) },
|
||||
requestAction: function(event, button) { return can.request(event, {action: button, _toast: ice.PROCESS+" "+button}) },
|
||||
requestAction: function(event, button) { return can.request(event, {action: button, _toast: event.isTrusted? ice.PROCESS+" "+button: ""}) },
|
||||
runActionInputs: function(event, cmds, cb) { var msg = can.request(event), meta = can.Conf()
|
||||
if (msg.Option(ice.MSG_HANDLE) != ice.TRUE && cmds && cmds[0] == ctx.ACTION && meta.feature[cmds[1]]) { var msg = can.request(event, {action: cmds[1]})
|
||||
if (can.base.isFunc(meta.feature[cmds[1]])) { return meta.feature[cmds[1]](can, msg, cmds.slice(2)) }
|
||||
|
Loading…
x
Reference in New Issue
Block a user