mirror of
https://shylinux.com/x/volcanos
synced 2025-04-26 01:04:06 +08:00
add wx.shy
This commit is contained in:
parent
59b9e5b39c
commit
fa2f3dceb4
3
const.js
3
const.js
@ -104,6 +104,9 @@ var aaa = {
|
|||||||
EMAIL: "email", AVATAR: "avatar", BACKGROUND: "background",
|
EMAIL: "email", AVATAR: "avatar", BACKGROUND: "background",
|
||||||
LANGUAGE: "language", ENGLISH: "english", CHINESE: "chinese",
|
LANGUAGE: "language", ENGLISH: "english", CHINESE: "chinese",
|
||||||
VOID: "void", TECH: "tech", ROOT: "root",
|
VOID: "void", TECH: "tech", ROOT: "root",
|
||||||
|
PROVINCE: "province",
|
||||||
|
COUNTRY: "country",
|
||||||
|
CITY: "city",
|
||||||
}
|
}
|
||||||
var lex = {
|
var lex = {
|
||||||
SPLIT: "split", PARSE: "parse",
|
SPLIT: "split", PARSE: "parse",
|
||||||
|
2
frame.js
2
frame.js
@ -513,7 +513,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
|||||||
sub.onmotion.float(sub), sub.onaction.close = function() { can.page.Remove(can, sub._target) }, cb && cb(sub)
|
sub.onmotion.float(sub), sub.onaction.close = function() { can.page.Remove(can, sub._target) }, cb && cb(sub)
|
||||||
}, can._root._target) },
|
}, can._root._target) },
|
||||||
figure: function(can, meta, target, cb) { if (meta.type == html.SELECT || meta.type == html.BUTTON) { return }
|
figure: function(can, meta, target, cb) { if (meta.type == html.SELECT || meta.type == html.BUTTON) { return }
|
||||||
var input = meta.action||(meta.name == mdb.ICON? mdb.ICONS: mdb.KEY), path = chat.PLUGIN_INPUT+input+nfs._JS; can.require([path], function(can) {
|
var input = meta.action||(can.base.isIn(meta.name, mdb.ICON, mdb.ICONS)? meta.name: mdb.KEY), path = chat.PLUGIN_INPUT+input+nfs._JS; can.require([path], function(can) {
|
||||||
function _cb(sub, value, old) { if (value == old) { return } target.value = value, can.base.isFunc(cb) && cb(sub, value, old) }
|
function _cb(sub, value, old) { if (value == old) { return } target.value = value, can.base.isFunc(cb) && cb(sub, value, old) }
|
||||||
target.onkeydown = function() { if (event.key == code.ESCAPE && target._can) { return target._can.close(), target.blur() } else if (event.key == code.ENTER) { can.base.isFunc(cb) && cb(event, target.value) } }
|
target.onkeydown = function() { if (event.key == code.ESCAPE && target._can) { return target._can.close(), target.blur() } else if (event.key == code.ENTER) { can.base.isFunc(cb) && cb(event, target.value) } }
|
||||||
can.core.ItemCB(can.onfigure[input], function(key, on) { var last = target[key]||function() { }; target[key] = function(event) { can.misc.Event(event, can, function(msg) {
|
can.core.ItemCB(can.onfigure[input], function(key, on) { var last = target[key]||function() { }; target[key] = function(event) { can.misc.Event(event, can, function(msg) {
|
||||||
|
@ -149,6 +149,12 @@ body>div.input tr.icon td:last-child img:first-child { height:28px; width:28px;
|
|||||||
body>div.input tr.icon td:last-child input { padding-left:32px; }
|
body>div.input tr.icon td:last-child input { padding-left:32px; }
|
||||||
body>div.input td span.icon { margin-left:-20px; visibility:hidden; }
|
body>div.input td span.icon { margin-left:-20px; visibility:hidden; }
|
||||||
body>div.input td:hover span.icon { visibility:visible; }
|
body>div.input td:hover span.icon { visibility:visible; }
|
||||||
|
body>div.input tr.icons td:last-child { position:relative; }
|
||||||
|
body>div.input tr.icons td:last-child i:first-child { font-size:22px; position:absolute; left:15px; top:14px; }
|
||||||
|
body>div.input tr.icons td:last-child img:first-child { height:28px; width:28px; left:12px; top:12px; position:absolute; }
|
||||||
|
body>div.input tr.icons td:last-child input { padding-left:32px; }
|
||||||
|
body>div.input td span.icons { margin-left:-20px; visibility:hidden; }
|
||||||
|
body>div.input td:hover span.icons { visibility:visible; }
|
||||||
body>div.input select { width:230px !important; }
|
body>div.input select { width:230px !important; }
|
||||||
body>div.input input:not([type=button]) { width:240px; }
|
body>div.input input:not([type=button]) { width:240px; }
|
||||||
body>div.input textarea { height:120px; width:240px !important; }
|
body>div.input textarea { height:120px; width:240px !important; }
|
||||||
@ -535,6 +541,7 @@ fieldset.web.code.docker.studio>div.output>fieldset { margin:0; }
|
|||||||
fieldset.web.code.docker.studio>div.output>fieldset>legend { display:none; }
|
fieldset.web.code.docker.studio>div.output>fieldset>legend { display:none; }
|
||||||
fieldset.web.code.docker.studio>div.output>fieldset>form.option>div:first-child { margin-left:10px; }
|
fieldset.web.code.docker.studio>div.output>fieldset>form.option>div:first-child { margin-left:10px; }
|
||||||
fieldset.web.code.docker.studio>div.output { padding:10px; }
|
fieldset.web.code.docker.studio>div.output { padding:10px; }
|
||||||
|
body>fieldset.story.web.chat.wx.agent { position:fixed; left:0; bottom:0; }
|
||||||
fieldset.web.mall.region>div.output>fieldset.web.mall.region.float>div.action { display:none; }
|
fieldset.web.mall.region>div.output>fieldset.web.mall.region.float>div.action { display:none; }
|
||||||
fieldset.studio>div.output { padding:10px; }
|
fieldset.studio>div.output { padding:10px; }
|
||||||
fieldset.studio>div.action>div.cmds { padding:5px 20px; }
|
fieldset.studio>div.action>div.cmds { padding:5px 20px; }
|
||||||
|
@ -59,6 +59,7 @@ Volcanos(chat.ONACTION, {_init: function(can) {
|
|||||||
can.user.info.usernick = can.Conf(aaa.USERNICK), can.user.info.userrole = msg.Option(ice.MSG_USERROLE), can.user.info.avatar = msg.Option(aaa.AVATAR), can.user.info.background = msg.Option(aaa.BACKGROUND)
|
can.user.info.usernick = can.Conf(aaa.USERNICK), can.user.info.userrole = msg.Option(ice.MSG_USERROLE), can.user.info.avatar = msg.Option(aaa.AVATAR), can.user.info.background = msg.Option(aaa.BACKGROUND)
|
||||||
can.user.info.email = msg.Option(aaa.EMAIL), can.user.info.repos = msg.Option(nfs.REPOS)
|
can.user.info.email = msg.Option(aaa.EMAIL), can.user.info.repos = msg.Option(nfs.REPOS)
|
||||||
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) })
|
||||||
|
msg.Option(mdb.PLUGIN) && can.onappend.plugin(can, {index: msg.Option(mdb.PLUGIN)}, function() {}, document.body)
|
||||||
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)
|
||||||
|
@ -56,7 +56,7 @@ Volcanos(chat.ONACTION, {list: [mdb.CREATE, web.SHARE, web.REFRESH], _init: func
|
|||||||
}) }])._target, next && can._output.insertBefore(list, next), can.ui.sublist[river] = list, _menu(), list.children.length > 0 && list.children[select].click()
|
}) }])._target, next && can._output.insertBefore(list, next), can.ui.sublist[river] = list, _menu(), list.children.length > 0 && list.children[select].click()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
action: function(event, can, river, storm) { can.misc.SearchHash(can, river, storm)
|
action: function(event, can, river, storm) { can.user.isMobile || can.misc.SearchHash(can, river, storm)
|
||||||
can.page.Select(can, can._output, [html.DIV_LIST, html.DIV_ITEM], function(target) { can.page.ClassList.del(can, target, html.SELECT) })
|
can.page.Select(can, can._output, [html.DIV_LIST, html.DIV_ITEM], function(target) { can.page.ClassList.del(can, target, html.SELECT) })
|
||||||
can.onmotion.select(can, can.ui.sublist[river], html.DIV_ITEM, can.ui.storm_list[can.core.Keys(river, storm)])
|
can.onmotion.select(can, can.ui.sublist[river], html.DIV_ITEM, can.ui.storm_list[can.core.Keys(river, storm)])
|
||||||
can.onaction.storm({target: can.ui.river_list[river]}, can, river), can.onmotion.toggle(can, can.ui.sublist[river], true)
|
can.onaction.storm({target: can.ui.river_list[river]}, can, river), can.onmotion.toggle(can, can.ui.sublist[river], true)
|
||||||
|
@ -1,21 +1,34 @@
|
|||||||
Volcanos(chat.ONFIGURE, {icon: {
|
Volcanos(chat.ONFIGURE, {icon: {
|
||||||
_load: function(event, can, cb, target, name, value) {
|
_load: function(event, can, cb, target, name, value) {
|
||||||
can.runAction(event, ctx.RUN, ["nfs.dir", "usr/icons/"], function(msg) { can._show(can, msg, cb, target, name) })
|
can.runAction(event, ctx.RUN, ["web.chat.icon"], function(msg) { can._show(can, msg, cb, target, name) })
|
||||||
},
|
},
|
||||||
_show: function(can, msg, cb, target, name) { can.onmotion.clear(can)
|
_show: function(can, msg, cb, target, name) { can.onmotion.clear(can)
|
||||||
var table = can.page.Append(can, can._output, [{type: html.TABLE}])._target, tr
|
var table = can.page.Append(can, can._output, [{type: html.TABLE}])._target, tr
|
||||||
msg.Table(function(value, index) { if (index%5 == 0) { tr = can.page.Append(can, table, [{type: html.TR}])._target }
|
msg.Table(function(value, index) { if (index%10 == 0) { tr = can.page.Append(can, table, [{type: html.TR}])._target }
|
||||||
can.page.Append(can, tr, [{type: html.TD, title: value.path, list: [{img: can.misc.Resource(can, value.path)}], onclick: function() {
|
can.page.Append(can, tr, [{type: html.TD, inner: value.icon, title: value.name, onclick: function() {
|
||||||
can.close(), can.base.isFunc(cb) && cb(can, value.path, target.value)
|
can.close(), can.base.isFunc(cb) && cb(can, value.name, target.value)
|
||||||
target._icon.src = can.misc.Resource(can, value.path)
|
target._icon.className = value.name
|
||||||
}}])
|
}}])
|
||||||
}), can.onappend._status(can, [mdb.TOTAL]), can.Status(mdb.TOTAL, msg.Length())
|
}), can.onappend._status(can, [mdb.TOTAL]), can.Status(mdb.TOTAL, msg.Length())
|
||||||
can.onlayout.figure({target: target}, can, can._target, false, 200)
|
can.onlayout.figure({target: target}, can, can._target, false, 200)
|
||||||
},
|
},
|
||||||
onclick: function(event, can, meta, target, cbs) { can.onmotion.focus(can, target) },
|
onclick: function(event, can, meta, target, cbs) { can.onmotion.focus(can, target) },
|
||||||
onfocus: function(event, can, meta, target, cbs) { cbs(function(sub, cb) { if (sub.Status(mdb.TOTAL) > 0) { return }
|
onfocus: function(event, can, meta, target, cbs) { cbs(function(sub, cb) { if (sub.Status(mdb.TOTAL) > 0) { return }
|
||||||
target._icon = target._icon || can.page.insertBefore(can, [{type: "img"}], target)
|
target._icon = target._icon || can.page.insertBefore(can, [{type: "i"}], target)
|
||||||
meta.msg && meta.msg.Length() > 0? sub._show(sub, meta.msg, cb, target, meta.name): sub._load(event, sub, cb, target, meta.name, target.value)
|
meta.msg && meta.msg.Length() > 0? sub._show(sub, meta.msg, cb, target, meta.name): sub._load(event, sub, cb, target, meta.name, target.value)
|
||||||
}) },
|
}) },
|
||||||
onblur: function(event, can, sub, cb) { sub && can.onmotion.delay(can, sub.close, 300) },
|
onblur: function(event, can, sub, cb) { sub && can.onmotion.delay(can, sub.close, 300) },
|
||||||
|
onkeyup: function(event, can, sub, cb) { if (!sub) { return }
|
||||||
|
can.page.Select(can, sub._output, html.TD, function(target) {
|
||||||
|
can.onmotion.hidden(can, target, target.title.indexOf(event.target.value) > -1)
|
||||||
|
})
|
||||||
|
can.page.Select(can, sub._output, html.TR, function(target) {
|
||||||
|
can.onmotion.hidden(can, target,
|
||||||
|
can.page.Select(can, target, html.TD, function(target) {
|
||||||
|
if (!can.page.ClassList.has(can, target, html.HIDE)) { return target }
|
||||||
|
}).length > 0
|
||||||
|
)
|
||||||
|
})
|
||||||
|
},
|
||||||
}})
|
}})
|
||||||
|
|
||||||
|
@ -1,34 +1,21 @@
|
|||||||
Volcanos(chat.ONFIGURE, {icons: {
|
Volcanos(chat.ONFIGURE, {icons: {
|
||||||
_load: function(event, can, cb, target, name, value) {
|
_load: function(event, can, cb, target, name, value) {
|
||||||
can.runAction(event, ctx.RUN, ["web.chat.icons"], function(msg) { can._show(can, msg, cb, target, name) })
|
can.runAction(event, ctx.RUN, ["nfs.dir", "usr/icons/"], function(msg) { can._show(can, msg, cb, target, name) })
|
||||||
},
|
},
|
||||||
_show: function(can, msg, cb, target, name) { can.onmotion.clear(can)
|
_show: function(can, msg, cb, target, name) { can.onmotion.clear(can)
|
||||||
var table = can.page.Append(can, can._output, [{type: html.TABLE}])._target, tr
|
var table = can.page.Append(can, can._output, [{type: html.TABLE}])._target, tr
|
||||||
msg.Table(function(value, index) { if (index%10 == 0) { tr = can.page.Append(can, table, [{type: html.TR}])._target }
|
msg.Table(function(value, index) { if (index%5 == 0) { tr = can.page.Append(can, table, [{type: html.TR}])._target }
|
||||||
can.page.Append(can, tr, [{type: html.TD, inner: value.icon, title: value.name, onclick: function() {
|
can.page.Append(can, tr, [{type: html.TD, title: value.path, list: [{img: can.misc.Resource(can, value.path), style: {width: 60, height: 60}}], onclick: function() {
|
||||||
can.close(), can.base.isFunc(cb) && cb(can, value.name, target.value)
|
can.close(), can.base.isFunc(cb) && cb(can, value.path, target.value)
|
||||||
target._icon.className = value.name
|
target._icon.src = can.misc.Resource(can, value.path)
|
||||||
}}])
|
}}])
|
||||||
}), can.onappend._status(can, [mdb.TOTAL]), can.Status(mdb.TOTAL, msg.Length())
|
}), can.onappend._status(can, [mdb.TOTAL]), can.Status(mdb.TOTAL, msg.Length())
|
||||||
can.onlayout.figure({target: target}, can, can._target, false, 200)
|
can.onlayout.figure({target: target}, can, can._target, false, 200)
|
||||||
},
|
},
|
||||||
onclick: function(event, can, meta, target, cbs) { can.onmotion.focus(can, target) },
|
onclick: function(event, can, meta, target, cbs) { can.onmotion.focus(can, target) },
|
||||||
onfocus: function(event, can, meta, target, cbs) { cbs(function(sub, cb) { if (sub.Status(mdb.TOTAL) > 0) { return }
|
onfocus: function(event, can, meta, target, cbs) { cbs(function(sub, cb) { if (sub.Status(mdb.TOTAL) > 0) { return }
|
||||||
target._icon = target._icon || can.page.insertBefore(can, [{type: "i"}], target)
|
target._icon = target._icon || can.page.insertBefore(can, [{type: "img"}], target)
|
||||||
meta.msg && meta.msg.Length() > 0? sub._show(sub, meta.msg, cb, target, meta.name): sub._load(event, sub, cb, target, meta.name, target.value)
|
meta.msg && meta.msg.Length() > 0? sub._show(sub, meta.msg, cb, target, meta.name): sub._load(event, sub, cb, target, meta.name, target.value)
|
||||||
}) },
|
}) },
|
||||||
// onblur: function(event, can, sub, cb) { sub && can.onmotion.delay(can, sub.close, 300) },
|
onblur: function(event, can, sub, cb) { sub && can.onmotion.delay(can, sub.close, 300) },
|
||||||
onkeyup: function(event, can, sub, cb) { if (!sub) { return }
|
|
||||||
can.page.Select(can, sub._output, html.TD, function(target) {
|
|
||||||
can.onmotion.hidden(can, target, target.title.indexOf(event.target.value) > -1)
|
|
||||||
})
|
|
||||||
can.page.Select(can, sub._output, html.TR, function(target) {
|
|
||||||
can.onmotion.hidden(can, target,
|
|
||||||
can.page.Select(can, target, html.TD, function(target) {
|
|
||||||
if (!can.page.ClassList.has(can, target, html.HIDE)) { return target }
|
|
||||||
}).length > 0
|
|
||||||
)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
}})
|
}})
|
||||||
|
|
||||||
|
@ -1,28 +0,0 @@
|
|||||||
Volcanos(chat.ONACTION, {source: function(can, msg) {
|
|
||||||
can.require(["https://res.wx.qq.com/open/js/jweixin-1.6.0.js"], function(can) {
|
|
||||||
wx.config({debug: msg.Option("debug") == ice.TRUE,
|
|
||||||
appId: msg.Option("appid"), signature: msg.Option("signature"),
|
|
||||||
nonceStr: msg.Option("noncestr"), timestamp: msg.Option("timestamp"),
|
|
||||||
|
|
||||||
jsApiList: can.core.Item({
|
|
||||||
scanQRCode: function(can, cb) { wx.scanQRCode({needResult: cb? 1: 0, scanType: ["qrCode","barCode"], success: function (res) {
|
|
||||||
can.base.isFunc(cb) && cb(can.base.ParseJSON(res.resultStr))
|
|
||||||
} }) },
|
|
||||||
getLocation: function(can, cb) { wx.getLocation({type: "gcj02", success: function (res) {
|
|
||||||
can.base.isFunc(cb) && cb({type: "gcj02", name: "当前位置", text: "当前位置", latitude: parseInt(res.latitude*100000), longitude: parseInt(res.longitude*100000) })
|
|
||||||
} }) },
|
|
||||||
openLocation: function(can, msg) { wx.openLocation({
|
|
||||||
latitude: parseInt(msg.Option("latitude"))/100000,
|
|
||||||
longitude: parseInt(msg.Option("longitude"))/100000,
|
|
||||||
name: msg.Option(mdb.NAME), address: msg.Option(mdb.TEXT),
|
|
||||||
scale: msg.Option("scale")||14, infoUrl: msg.Option(mdb.LINK),
|
|
||||||
}) },
|
|
||||||
chooseImage: function(can, cb, count) { wx.chooseImage({count: count||9, sizeType: ['original', 'compressed'], sourceType: ['album', 'camera'], success: function (res) {
|
|
||||||
can.base.isFunc(cb) && cb(res.localIds)
|
|
||||||
} }) },
|
|
||||||
}, function(key, value) { return can.user.agent[key] = value, key }),
|
|
||||||
})
|
|
||||||
wx.error(function(err) { can.user.toast(err, "wx load") })
|
|
||||||
wx.ready(function() { can.misc.Log("ready") })
|
|
||||||
})
|
|
||||||
}})
|
|
@ -6,6 +6,7 @@ fieldset.word>div.output h2.story[data-type=spark][data-name=title] { text-align
|
|||||||
fieldset.word>div.output h3 { margin-top:20px; }
|
fieldset.word>div.output h3 { margin-top:20px; }
|
||||||
fieldset.word>div.output table { width:100%; }
|
fieldset.word>div.output table { width:100%; }
|
||||||
fieldset.word>div.output img { display:block; margin:auto; max-height:100%; max-width:100%; }
|
fieldset.word>div.output img { display:block; margin:auto; max-height:100%; max-width:100%; }
|
||||||
|
fieldset.word>div.output table.content img { margin:unset; }
|
||||||
fieldset.word>div.output video { max-height:100%; width:100%; }
|
fieldset.word>div.output video { max-height:100%; width:100%; }
|
||||||
fieldset.word>div.output iframe { height:480px; width:100%; }
|
fieldset.word>div.output iframe { height:480px; width:100%; }
|
||||||
fieldset.word>div.output svg.story[data-index] text { cursor:pointer; }
|
fieldset.word>div.output svg.story[data-index] text { cursor:pointer; }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user