mirror of
https://shylinux.com/x/volcanos
synced 2025-04-25 16:58:06 +08:00
add some
This commit is contained in:
parent
cc0aa5084f
commit
aca36e480c
@ -162,7 +162,7 @@ div.story[data-type=spark] { padding:0 5px; border-left:var(--notice-bg-color) s
|
||||
fieldset>div.action>div.tabs { font-style:italic; padding:5px 10px; box-shadow:var(--box-shadow); margin-left:5px; }
|
||||
fieldset>div.action>div.cmds { font-style:italic; padding:5px 10px; box-shadow:var(--box-shadow); margin-left:5px; }
|
||||
fieldset>div.output>div.code { font-size:14px; }
|
||||
fieldset>div.status { font-style:italic; max-height:32px; }
|
||||
fieldset>div.status { font-style:italic; line-height:20px; max-height:32px; }
|
||||
fieldset>div.status>div.item { padding:5px; height:31px; }
|
||||
fieldset>div.status>div.item>label { font-size:0.6rem; }
|
||||
fieldset>div.status>legend { font-style:italic; height:31px; }
|
||||
@ -397,7 +397,8 @@ body.mobile table.content { width:100%; }
|
||||
body.mobile form.option>div.item { margin:0; }
|
||||
body.mobile:not(.cmd) form.option>div.item.button>input { display:none; }
|
||||
body.mobile fieldset>div.status { max-height:32px; overflow:hidden; }
|
||||
body.mobile fieldset:not(.panel):not(.input):not(.play)>div.action>div:not(.icons) { display:none; }
|
||||
body.mobile:not(.cmd) fieldset:not(.panel):not(.input):not(.play)>div.action>div:not(.icons) { display:none; }
|
||||
body.mobile fieldset>div.action>div.item { margin-right:5px; }
|
||||
body.mobile fieldset.plugin:not(.float):not(.full):not(.cmd)>form.option>div.icon:not(.delete) { display:block; }
|
||||
body.mobile fieldset.plugin:not(.float):not(.full):not(.cmd)>form.option>div.button>span.icon { display:block; }
|
||||
body.mobile fieldset.plugin:not(.float):not(.full):not(.cmd)>div.action>div.button>span.icon { display:inline-block; }
|
||||
|
@ -37,6 +37,9 @@ Volcanos("misc", {
|
||||
Result: function() { if (!msg.result) { return "" } return msg.result[0] == ice.ErrWarn? msg.result.join(lex.SP): msg.result.join("") },
|
||||
Results: function() { return msg.result && msg.result[0] == ice.ErrWarn? "": msg.Result() },
|
||||
TableDetail: function() { var item = can.Option(); return msg.Table(function(value) { can.core.Value(item, value.key, value.value) }), item },
|
||||
IsDetail: function() {
|
||||
return msg.Option("fields") == "detail" || msg.append && msg.append.length == 2 && msg.append[0] == "key" && msg.append[1] == "value"
|
||||
},
|
||||
Table: function(cb) { return can.core.List(msg.Length(), function(index) { var item = {}
|
||||
can.core.List(msg.append, function(k) { item[k] = msg[k]&&msg[k][index]||"" })
|
||||
return can.base.isFunc(cb)? cb(item, index): item
|
||||
|
@ -60,7 +60,7 @@ Volcanos(chat.ONACTION, {_init: function(can, target) {
|
||||
},
|
||||
_onaction_cmd: function(can) { can.onengine.signal(can, chat.ONACTION_CMD), can.onlayout._init(can) },
|
||||
onaction_cmd: function(can, msg) { can.user.mod.isCmd = true
|
||||
can.page.ClassList.add(can, can._target, can.Mode(chat.CMD)), can.Conf(html.MARGIN_Y, 0), can.Conf(html.MARGIN_X, 0)
|
||||
can.page.ClassList.add(can, can._target, can.Mode(chat.CMD)), can.Conf(html.MARGIN_Y, 128), can.Conf(html.MARGIN_X, 0)
|
||||
},
|
||||
onsearch: function(can, msg, arg) { var fields = msg.Option(ice.MSG_FIELDS).split(mdb.FS)
|
||||
if (arg[0] == mdb.PLUGIN) { can.onexport.plugin(can, msg, arg, fields) }
|
||||
@ -121,7 +121,8 @@ Volcanos(chat.ONLAYOUT, {
|
||||
flow: function(can) { can.getActionSize(function(height, width) { can.ConfHeight(height-html.ACTION_MARGIN), can.ConfWidth(width) }) },
|
||||
page: function(can) { can.page.styleHeight(can, can._output, ""), can.page.style(can, document.body, kit.Dict(html.OVERFLOW, "")) },
|
||||
_plugin: function(can, button) { can.core.List(can._plugins, function(sub) {
|
||||
sub.onimport.size(sub, can.ConfHeight()-can.Conf(html.MARGIN_Y)-(button || sub.isCmdMode()? 0: html.ACTION_MARGIN), can.ConfWidth()-can.Conf(html.MARGIN_X), can.onexport.isauto(can)) && can.page.style(can, sub._output, html.MAX_HEIGHT, "")
|
||||
sub.onimport.size(sub, can.ConfHeight()-can.Conf(html.MARGIN_Y)-(button || sub.isCmdMode()? 0: html.ACTION_MARGIN),
|
||||
can.ConfWidth()-can.Conf(html.MARGIN_X), can.onexport.isauto(can)) && can.page.style(can, sub._output, html.MAX_HEIGHT, "")
|
||||
}) },
|
||||
_storage: function(can, value) { return can.misc.sessionStorage(can, can.core.Keys(CAN_LAYOUT, location.pathname), value) },
|
||||
})
|
||||
|
@ -1,11 +1,27 @@
|
||||
Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb, target) { can.ui = can.onappend.layout(can), can.ui.layout(can.ConfHeight(), can.ConfWidth()), cb && cb(msg)
|
||||
Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) { msg.Option(ice.MSG_ACTION, ""), cb && cb(msg)
|
||||
can.ui = can.onappend.layout(can); if (can.user.isMobile) {
|
||||
can.page.style(can, can.ui.project, "z-index", 10, "position", "absolute")
|
||||
can.page.style(can, can.ui.content, html.HEIGHT, can.ConfHeight(), html.WIDTH, can.ConfWidth())
|
||||
can.page.Select(can, can._action, "div.item.text", function(target) { can.onmotion.hidden(can, target) })
|
||||
can.onmotion.hidden(can, can._status)
|
||||
} else {
|
||||
can.ui.layout(can.ConfHeight(), can.ConfWidth())
|
||||
}
|
||||
can.require([msg.Option(nfs.SCRIPT)], function() {
|
||||
var res = {type: "unknown", latitude: 39.984120, longitude: 116.307480}, current = can.base.Obj(msg.Option(chat.LOCATION))
|
||||
var res = {type: "unknown", latitude: 39.984120, longitude: 116.307480}, current = can.base.Obj(msg.Option(chat.LOCATION), {})
|
||||
res.nation = current.nation||current.country, res.province = current.province||current.regionName, res.city = current.city
|
||||
res.latitude = current.latitude||current.lat||res.latitude, res.longitude = current.longitude||current.lon||res.longitude
|
||||
res.name = current.name||"当前位置", res.text = current.text||"某某大街", res.ip = current.ip||current.query
|
||||
can.Status(can._current = res), can.onimport._content(can, can._current), can.onimport._project(can), msg.Table(function(item) { can.onimport._item(can, item) })
|
||||
can.onimport._content(can, can._current = res), can.Status(can._current = res)
|
||||
can.onimport._project(can), can.db.list = {}
|
||||
if (msg.IsDetail()) {
|
||||
can.onaction.center(can, can._current = can.onimport._item(can, msg.TableDetail()))
|
||||
} else {
|
||||
msg.Table(function(item) { can.onimport._item(can, item) })
|
||||
var item = can.db.list[can.db.hash[0]]; item? item.click():
|
||||
can.user.agent.getLocation(can, function(res) { res.type = "current", can.onaction.center(can, can._current = res) })
|
||||
}
|
||||
can.user.isMobile && can.core.Item(can.ui.zone, function(key, item) { key == "favor" || item._legend.click() })
|
||||
})
|
||||
},
|
||||
_project: function(can) { can.onmotion.clear(can, can.ui.project), can.onimport.zone(can, [
|
||||
@ -15,7 +31,9 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb, target) { can.ui = can.on
|
||||
item.click(), can.onmotion.delay(can, next, 2000)
|
||||
}, function() { can.user.toastSuccess(can) })
|
||||
}})},
|
||||
{name: "district", _init: function(target, zone) { can.onimport._province(can, target) }},
|
||||
{name: "district", _delay_init: function(target, zone) {
|
||||
can.onimport._province(can, target)
|
||||
}},
|
||||
], can.ui.project) },
|
||||
_explore: function(can, keyword, i) { var p = can.onimport.point(can, can.current.item)
|
||||
can.runAction(can.request({}, {_method: http.GET, "boundary": "nearby("+can.base.join([p.lat, p.lng, "500"], mdb.FS)+")", "page_index": i||1, "keyword": keyword}), "search", [], function(msg) {
|
||||
@ -58,16 +76,11 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb, target) { can.ui = can.on
|
||||
}, function() {}, target)
|
||||
}) },
|
||||
_content: function(can, item) {
|
||||
can.map = new TMap.Map(can.ui.content, {center: can.onimport.point(can, item), zoom: can.Action("zoom"), pitch: can.Action("pitch"), rotation: can.Action("rotation"),
|
||||
mapStyleId: 'style3'})
|
||||
can.map.on("zoom", function(event) { can.Action("zoom", can.map.getZoom()) })
|
||||
can.map.on("pitch", function(event) { can.Action("pitch", can.map.getPitch()) })
|
||||
can.map.on("rotate", function(event) { can.Action("rotation", can.map.getRotation()) })
|
||||
can.map.on("click", function(event) { var point = can.onaction._point(event, can, {name: event.poi? event.poi.name: ""}); can.onaction.center(can, point)
|
||||
can.Action("mode") == mdb.INSERT && can.runAction(can.request({target: {getBoundingClientRect: function() { return point }}}, point), mdb.CREATE, function(msg) {
|
||||
can.onimport._item(can, point)
|
||||
})
|
||||
})
|
||||
can.map = new TMap.Map(can.ui.content, {center: can.onimport.point(can, item), zoom: can.Action("zoom"), pitch: can.Action("pitch"), rotation: can.Action("rotation"), mapStyleId: 'style3'})
|
||||
can.map.on("zoom", function(event) { can.Action("zoom", can.map.getZoom().toFixed(2)) })
|
||||
can.map.on("pitch", function(event) { can.Action("pitch", can.map.getPitch().toFixed(2)) })
|
||||
can.map.on("rotate", function(event) { can.Action("rotation", can.map.getRotation().toFixed(2)) })
|
||||
can.map.on("click", function(event) { var point = can.onaction._point(event, can, {name: event.poi? event.poi.name: ""}); can.onaction.center(can, point) })
|
||||
can.current = {item: item, info: can.onfigure.info(can, item), hover: can.onfigure.info(can, item),
|
||||
label: new TMap.MultiLabel({map: can.map, geometries: [{id: "current", position: can.onimport.point(can, item), content: item.name}]}),
|
||||
marker: new TMap.MultiMarker({map: can.map, geometries: [{id: "current", position: can.onimport.point(can, item)}]}),
|
||||
@ -76,28 +89,26 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb, target) { can.ui = can.on
|
||||
can.onfigure._mark(can), can.mark && can.mark.add({position: can.onimport.point(can, can._current), properties: can._current})
|
||||
can.page.Select(can, can._target, "div.content>div", function(item) { can.page.style(can, item, {"z-index": 3}) })
|
||||
},
|
||||
_item: function(can, item, target) { if (!item.latitude || !item.longitude) { return }
|
||||
var _target = can.onimport.item(can, item, function(event) { can.onaction.center(can, item) }, function(event) {
|
||||
_item: function(can, item, target) { if (!item.latitude || !item.longitude) { return item }
|
||||
var _target = can.onimport.item(can, item, function(event) {
|
||||
can.onaction.center(can, item), can.misc.SearchHash(can, item.hash)
|
||||
}, function(event) {
|
||||
can.onexport.hover(can, item), can.user.carteRight(event, can, {
|
||||
direction: function(event, button) { can.onaction.center(can, item), can.onaction[button](event, can, button) },
|
||||
favor: function(event) { can.request(event, item), can.onaction.create(event, can) },
|
||||
plugin: function(event, button) {
|
||||
can.user.input(can.request(event, item), can, [ctx.INDEX, ctx.ARGS], function(data) {
|
||||
plugin: function(event, button) { can.user.input(can.request(event, item), can, [ctx.INDEX, ctx.ARGS], function(data) {
|
||||
item.extra = can.base.Copy(item.extra||{}, data), can.onimport.plugin(can, item)
|
||||
can.runAction(event, mdb.MODIFY, ["extra.index", data.index, "extra.args", data.args], function() {})
|
||||
}) },
|
||||
remove: function(event, button) { can.runAction(event, mdb.REMOVE, [mdb.HASH, item.hash], function() { can.page.Remove(can, _target) }) },
|
||||
})
|
||||
},
|
||||
remove: function(event, button) {
|
||||
can.runAction(event, mdb.REMOVE, [mdb.HASH, item.hash], function() { can.page.Remove(can, _target) })
|
||||
},
|
||||
})
|
||||
}, target||can.ui.zone.favor._target)
|
||||
}, target||can.ui.zone.favor._target); can.db.list[item.hash] = _target
|
||||
can.mark && can.mark.add({position: can.onimport.point(can, item), properties: item})
|
||||
return item
|
||||
},
|
||||
point: function(can, item) { return new TMap.LatLng(item.latitude, item.longitude) },
|
||||
plugin: function(can, item) {
|
||||
var extra = can.base.Obj(item.extra, {}); if (!extra.index) { return can.onmotion.toggle(can, can.ui.profile, false) }
|
||||
can.onmotion.toggle(can, can.ui.profile, true)
|
||||
plugin: function(can, item) { var extra = can.base.Obj(item.extra, {})
|
||||
if (!extra.index) { return can.onmotion.toggle(can, can.ui.profile, false) } can.onmotion.toggle(can, can.ui.profile, true)
|
||||
if (can.onmotion.cache(can, function() { return item.hash }, can.ui.profile)) { return true}
|
||||
can.onappend.plugin(can, {index: extra.index, args: extra.args}, function(sub) { item._plugin = sub
|
||||
sub.onaction._close = function() { can.onmotion.hidden(can, can.ui.profile) }
|
||||
@ -111,7 +122,6 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb, target) { can.ui = can.on
|
||||
function myInfoWindow(options) { TMap.DOMOverlay.call(this, options) }
|
||||
myInfoWindow.prototype = new TMap.DOMOverlay()
|
||||
myInfoWindow.prototype.onInit = function(options) { this.position = options.position, this.meta = options.meta }
|
||||
|
||||
myInfoWindow.prototype.createDOM = function() {
|
||||
var meta = this.meta, ui = can.onappend.field(can, chat.FLOAT, {}, can._output)
|
||||
can.onappend.plugin(can, meta, function(sub) {
|
||||
@ -145,8 +155,12 @@ Volcanos(chat.ONFIGURE, {
|
||||
})
|
||||
},
|
||||
_mark: function(can, msg) { can.mark = new TMap.MultiMarker({map: can.map})
|
||||
can.mark.on("click", function(event) { if (!event.geometry) { return } var item = event.geometry.properties; can.onaction.center(can, item) })
|
||||
can.mark.on("hover", function(event) { if (!event.geometry) { return } var item = event.geometry.properties; can.onexport.hover(can, item) })
|
||||
can.mark.on("click", function(event) { if (!event.geometry) { return }
|
||||
var item = event.geometry.properties; can.db.list[item.hash].click()
|
||||
})
|
||||
can.mark.on("hover", function(event) { if (!event.geometry) { return }
|
||||
var item = event.geometry.properties; can.onexport.hover(can, item)
|
||||
})
|
||||
},
|
||||
_polyline: function(can, path) { return new TMap.MultiPolyline({
|
||||
map: can.map, styles: {
|
||||
@ -177,7 +191,7 @@ Volcanos(chat.ONFIGURE, {
|
||||
], speed: 70}}, {autoRotation:true})
|
||||
},
|
||||
})
|
||||
Volcanos(chat.ONACTION, {list: [["mode", mdb.SELECT, mdb.INSERT],
|
||||
Volcanos(chat.ONACTION, {list: [
|
||||
{type: html.TEXT, name: "zoom", value: 16, range: [3, 21]},
|
||||
{type: html.TEXT, name: "pitch", value: 30, range: [0, 80, 5]},
|
||||
{type: html.TEXT, name: "rotation", value: 0, range: [0, 360, 10]},
|
||||
|
@ -59,9 +59,11 @@ Volcanos(chat.ONFIGURE, {
|
||||
Volcanos(chat.ONACTION, {list: [
|
||||
"构建", "编译", "终端", "路由",
|
||||
"源码", "文档", "计划", "流程",
|
||||
"后台", "桌面", "官网"],
|
||||
_trans: {show: "预览", exec: "展示"},
|
||||
_run: function(event, can, button, args, cb) { can.runAction(event, button, args, cb||function(msg) { can.onimport.tabview(can, msg.Option(nfs.PATH), msg.Option(nfs.FILE)), can.user.toastSuccess(can, button), can.ui.zone.source.refresh() }) },
|
||||
"后台", "桌面", "官网"], _trans: {show: "预览", exec: "展示"},
|
||||
_run: function(event, can, button, args, cb) { can.runAction(event, button, args, cb||function(msg) {
|
||||
if (msg.IsErr()) { return can.user.toastFailure(can, msg.Result()) }
|
||||
can.onimport.tabview(can, msg.Option(nfs.PATH), msg.Option(nfs.FILE)), can.user.toastSuccess(can, button), can.ui.zone.source.refresh()
|
||||
}) },
|
||||
_runs: function(event, can, button, cb) { var meta = can.Conf(); can.request(event, {action: button}), can.user.input(event, can, meta.feature[button], function(args) { can.onaction._run(event, can, button, args, cb) }) },
|
||||
save: function(event, can, button) { can.request(event, {file: can.Option(nfs.FILE), content: can.onexport.content(can)})
|
||||
function imports(str) { var block = "", count = 0; can.core.List(str.split(lex.NL), function(item) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user