mirror of
https://shylinux.com/x/volcanos
synced 2025-04-25 08:48:06 +08:00
add some
This commit is contained in:
parent
d6987088c3
commit
50cfffbf2a
5
const.js
5
const.js
@ -41,8 +41,8 @@ var ice = {
|
|||||||
MSG_RIVER: "sess.river", MSG_STORM: "sess.storm",
|
MSG_RIVER: "sess.river", MSG_STORM: "sess.storm",
|
||||||
|
|
||||||
MSG_COST: "sess.cost", MSG_MODE: "sess.mode",
|
MSG_COST: "sess.cost", MSG_MODE: "sess.mode",
|
||||||
MSG_NODETYPE: "node.type", TABLE_CHECKBOX: "table.checkbox",
|
MSG_NODETYPE: "node.type", MSG_NODENAME: "node.name",
|
||||||
FROM_DAEMON: "from.daemon",
|
TABLE_CHECKBOX: "table.checkbox", FROM_DAEMON: "from.daemon",
|
||||||
|
|
||||||
PROCESS_REWRITE: "_rewrite",
|
PROCESS_REWRITE: "_rewrite",
|
||||||
PROCESS_FIELD: "_field",
|
PROCESS_FIELD: "_field",
|
||||||
@ -390,6 +390,7 @@ var html = {
|
|||||||
CONFIRM: "confirm", CLOSE: "close", CLICK: "click", FOCUS: "focus", BLUR: "blur",
|
CONFIRM: "confirm", CLOSE: "close", CLICK: "click", FOCUS: "focus", BLUR: "blur",
|
||||||
TABLE: "table", THEAD: "thead", TBODY: "tbody", TR: "tr", TH: "th", TD: "td",
|
TABLE: "table", THEAD: "thead", TBODY: "tbody", TR: "tr", TH: "th", TD: "td",
|
||||||
HEADER: "header", NAV: "nav", MAIN: "main", ASIDE: "aside", FOOTER: "footer",
|
HEADER: "header", NAV: "nav", MAIN: "main", ASIDE: "aside", FOOTER: "footer",
|
||||||
|
NEED: "need", MUST: "must",
|
||||||
FAVICON: "favicon",
|
FAVICON: "favicon",
|
||||||
|
|
||||||
BACKGROUND_COLOR: "background-color", COLOR: "color",
|
BACKGROUND_COLOR: "background-color", COLOR: "color",
|
||||||
|
11
frame.js
11
frame.js
@ -194,12 +194,9 @@ Volcanos(chat.ONAPPEND, {
|
|||||||
}) })
|
}) })
|
||||||
}), can.base.isFunc(cb) && cb(sub)
|
}), can.base.isFunc(cb) && cb(sub)
|
||||||
if (sub.isOutputStyle()) { return } if (can.user.isMobile && !can.user.isLandscape()) { return }
|
if (sub.isOutputStyle()) { return } if (can.user.isMobile && !can.user.isLandscape()) { return }
|
||||||
sub.isCmdMode() && !can.base.isIn(meta.index, web.CODE_VIMER, web.CODE_INNER, web.CHAT_MACOS_DESKTOP) && can.page.insertBefore(can, [{view: "header", list: can.user.header(sub)}], sub._output, sub._fields||sub._target)
|
if (!sub.isCmdMode()) { return }
|
||||||
sub.isCmdMode() && can.onmotion.delay(can, function() { wx.ready(function () {
|
!can.base.isIn(meta.index, web.CODE_VIMER, web.CODE_INNER, web.CHAT_MACOS_DESKTOP) && can.page.insertBefore(can, [{view: "header", list: can.user.header(sub)}], sub._output, sub._fields||sub._target)
|
||||||
wx.updateAppMessageShareData({title: sub.Conf("help"), desc: "", link: location.href, imgUrl: sub.Conf(mdb.ICONS)})
|
can.user.agent.cmd = sub, can.user.agent.init && can.user.agent.init(sub)
|
||||||
wx.updateTimelineShareData({title: sub.Conf("help"), link: location.href, imgUrl: sub.Conf(mdb.ICONS)})
|
|
||||||
}) }, 300)
|
|
||||||
|
|
||||||
}); return sub
|
}); return sub
|
||||||
},
|
},
|
||||||
_option: function(can, meta, option, skip) { var index = -1, args = can.base.Obj(meta.args||meta.arg, []), opts = can.base.Obj(meta.opts, {})
|
_option: function(can, meta, option, skip) { var index = -1, args = can.base.Obj(meta.args||meta.arg, []), opts = can.base.Obj(meta.opts, {})
|
||||||
@ -364,6 +361,8 @@ Volcanos(chat.ONAPPEND, {
|
|||||||
} msg.Defer(), can.base.isFunc(cb) && cb(msg), can.page.style(can, can._target, "visibility", ""),
|
} msg.Defer(), can.base.isFunc(cb) && cb(msg), can.page.style(can, can._target, "visibility", ""),
|
||||||
can._output.scrollTop = output_old.scrollTop, can._output.scrollLeft = output_old.scrollLeft
|
can._output.scrollTop = output_old.scrollTop, can._output.scrollLeft = output_old.scrollLeft
|
||||||
can.page.style(can, can._output, "visibility", "", "position", ""), can.page.Remove(can, output_old)
|
can.page.style(can, can._output, "visibility", "", "position", ""), can.page.Remove(can, output_old)
|
||||||
|
can.isCmdMode() && (can.user.agent.cmd = can)
|
||||||
|
can.isCmdMode() && can.user.agent.init && can.user.agent.init(can)
|
||||||
}, target: output}), msg.Defer()
|
}, target: output}), msg.Defer()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
10
lib/user.js
10
lib/user.js
@ -1,6 +1,5 @@
|
|||||||
Volcanos("user", {
|
Volcanos("user", {
|
||||||
agent: {
|
agent: {
|
||||||
enableDebug: function(can) {},
|
|
||||||
getLocation: function(can, cb) { var call = arguments.callee; if (call._res) { return cb(call._res) }
|
getLocation: function(can, cb) { var call = arguments.callee; if (call._res) { return cb(call._res) }
|
||||||
navigator.geolocation.getCurrentPosition(function(res) {
|
navigator.geolocation.getCurrentPosition(function(res) {
|
||||||
cb(call._res = {type: "ip", name: "当前位置", text: "某某大街", latitude: res.coords.latitude.toFixed(6), longitude: res.coords.longitude.toFixed(6)})
|
cb(call._res = {type: "ip", name: "当前位置", text: "某某大街", latitude: res.coords.latitude.toFixed(6), longitude: res.coords.longitude.toFixed(6)})
|
||||||
@ -10,10 +9,13 @@ Volcanos("user", {
|
|||||||
window.open("https://map.baidu.com/search/"+encodeURIComponent(msg.Option(mdb.TEXT))
|
window.open("https://map.baidu.com/search/"+encodeURIComponent(msg.Option(mdb.TEXT))
|
||||||
+"/@12958750.085,4825785.55,16z?querytype=s&da_src=shareurl&wd="+encodeURIComponent(msg.Option(mdb.TEXT)))
|
+"/@12958750.085,4825785.55,16z?querytype=s&da_src=shareurl&wd="+encodeURIComponent(msg.Option(mdb.TEXT)))
|
||||||
},
|
},
|
||||||
|
chooseImage: function(can, cb, count) { can.base.isFunc(cb) && cb([]) },
|
||||||
|
uploadImage: function(can, id, cb) {},
|
||||||
|
previewImage: function(can, url, list) {},
|
||||||
|
scanQRCode: function(can, cb) { can.user.input(event, can, [{type: html.TEXTAREA, name: mdb.TEXT, text: ""}], function(list) { cb(can.base.ParseJSON(list[0])) }) },
|
||||||
connectWifi: function(can, ssid, password, cb, cbs) {},
|
connectWifi: function(can, ssid, password, cb, cbs) {},
|
||||||
getClipboard: function(can, cb) {},
|
getClipboard: function(can, cb) {},
|
||||||
scanQRCode: function(can, cb) { can.user.input(event, can, [{type: html.TEXTAREA, name: mdb.TEXT, text: ""}], function(list) { cb(can.base.ParseJSON(list[0])) }) },
|
enableDebug: function(can) {},
|
||||||
chooseImage: function(can, cb) { can.base.isFunc(cb) && cb([]) },
|
|
||||||
}, info: {},
|
}, info: {},
|
||||||
isIPad: false,
|
isIPad: false,
|
||||||
isTesla: navigator.userAgent.indexOf("Tesla") > -1,
|
isTesla: navigator.userAgent.indexOf("Tesla") > -1,
|
||||||
@ -143,7 +145,7 @@ Volcanos("user", {
|
|||||||
}
|
}
|
||||||
var input = can.page.Append(can, document.body, [{type: html.TEXTAREA, value: text}])._target
|
var input = can.page.Append(can, document.body, [{type: html.TEXTAREA, value: text}])._target
|
||||||
can.onmotion.focus(can, input), document.execCommand("Copy"), can.page.Remove(can, input)
|
can.onmotion.focus(can, input), document.execCommand("Copy"), can.page.Remove(can, input)
|
||||||
return can.user.toastSuccess(can, text, "copy success"), can.misc.Log(nfs.COPY, text), text
|
return can.user.toastSuccess(can, text, can.user.trans(can, "copy success", "复制成功")), can.misc.Log(nfs.COPY, text), text
|
||||||
},
|
},
|
||||||
carte: function(event, can, meta, list, cb, parent, trans) { var msg = can.request(event); event = msg._event
|
carte: function(event, can, meta, list, cb, parent, trans) { var msg = can.request(event); event = msg._event
|
||||||
function remove_sub(carte) { carte._sub && can.page.Remove(can, carte._sub._target), delete(carte._sub) } parent? remove_sub(parent): can.onmotion.clearCarte(can)
|
function remove_sub(carte) { carte._sub && can.page.Remove(can, carte._sub._target), delete(carte._sub) } parent? remove_sub(parent): can.onmotion.clearCarte(can)
|
||||||
|
@ -72,8 +72,7 @@ Volcanos(chat.ONIMPORT, {
|
|||||||
})
|
})
|
||||||
Volcanos(chat.ONACTION, {_init: function(can) {},
|
Volcanos(chat.ONACTION, {_init: function(can) {},
|
||||||
onsize: function(can) {
|
onsize: function(can) {
|
||||||
can.ConfHeight(can._target.offsetHeight), can.ConfWidth(can._target.offsetWidth)
|
can.ConfHeight(can._target.offsetHeight), can.ConfWidth(can._target.offsetWidth), can.onimport.theme(can)
|
||||||
can.onimport.theme(can)
|
|
||||||
},
|
},
|
||||||
onmain: function(can) {
|
onmain: function(can) {
|
||||||
if (window.parent == window && can.misc.Search(can, ice.MSG_SESSID) && can.misc.CookieSessid(can, can.misc.Search(can, ice.MSG_SESSID)) && !can.user.isMailMaster) {
|
if (window.parent == window && can.misc.Search(can, ice.MSG_SESSID) && can.misc.CookieSessid(can, can.misc.Search(can, ice.MSG_SESSID)) && !can.user.isMailMaster) {
|
||||||
@ -86,22 +85,23 @@ Volcanos(chat.ONACTION, {_init: function(can) {},
|
|||||||
function show(msg) { var p = can.misc.Search(can, "redirect_uri")
|
function show(msg) { var p = can.misc.Search(can, "redirect_uri")
|
||||||
if (p && location.pathname == web.BASIC_LOGIN) { return location.replace(can.base.MergeURL(p, ice.MSG_SESSID, can.misc.CookieSessid(can))) }
|
if (p && location.pathname == web.BASIC_LOGIN) { return location.replace(can.base.MergeURL(p, ice.MSG_SESSID, can.misc.CookieSessid(can))) }
|
||||||
var p = can.misc.Search(can, ice.BACK); if (p && location.pathname == web.CHAT_SSO) { return location.reload() }
|
var p = can.misc.Search(can, ice.BACK); if (p && location.pathname == web.CHAT_SSO) { return location.reload() }
|
||||||
can.user.info.usernick = can.Conf(aaa.USERNICK)
|
|
||||||
can.user.info.username = msg.Option(ice.MSG_USERNAME)
|
|
||||||
can.user.info.userrole = msg.Option(ice.MSG_USERROLE)
|
|
||||||
can.user.info.nodetype = msg.Option(ice.MSG_NODETYPE)
|
can.user.info.nodetype = msg.Option(ice.MSG_NODETYPE)
|
||||||
|
can.user.info.nodename = msg.Option(ice.MSG_NODENAME)
|
||||||
|
can.user.info.userrole = msg.Option(ice.MSG_USERROLE)
|
||||||
|
can.user.info.username = msg.Option(ice.MSG_USERNAME)
|
||||||
|
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)
|
||||||
can.user.info.background = msg.Option(aaa.BACKGROUND)
|
can.user.info.background = msg.Option(aaa.BACKGROUND)
|
||||||
can.user.info.titles = msg.Option("titles")||document.title
|
|
||||||
can.user.info.favicon = msg.Option("favicon")
|
can.user.info.favicon = msg.Option("favicon")
|
||||||
|
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)
|
||||||
// can.page.requireModules(can, [msg.Option("icon.lib")])
|
// can.page.requireModules(can, [msg.Option("icon.lib")])
|
||||||
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.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")||"")
|
||||||
can.onaction._menus[3] = [aaa.LANGUAGE, ice.AUTO].concat(can.core.List(msg["language.list"], function(item) { return can.base.trimSuffix(item, nfs._JS) }))
|
can.onaction._menus[3] = [aaa.LANGUAGE, ice.AUTO].concat(can.core.List(msg["language.list"], function(item) { return can.base.trimSuffix(item, nfs._JS) }))
|
||||||
can.onaction._menus[2] = [chat.THEME, ice.AUTO].concat(can.core.List(msg["theme.list"], function(item) { return can.base.trimSuffix(item, nfs._CSS) }))
|
can.onaction._menus[2] = [chat.THEME, ice.AUTO].concat(can.core.List(msg["theme.list"], function(item) { return can.base.trimSuffix(item, nfs._CSS) }))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user