diff --git a/lib/page.js b/lib/page.js index e5306168..956f91e5 100644 --- a/lib/page.js +++ b/lib/page.js @@ -301,7 +301,7 @@ Volcanos("page", {help: "网页模块", text = text.replace(/\\n/g, "
") return text }, - Format: function(type, src, name) { + Format: function(type, src) { switch (type) { case "a": return ""+(arguments[2]||arguments[1])+"" diff --git a/lib/user.js b/lib/user.js index 9b47a3e4..efdc0f5a 100644 --- a/lib/user.js +++ b/lib/user.js @@ -96,8 +96,8 @@ Volcanos("user", {help: "用户模块", agent: { can.run(msg._event, cmd||["action", "share"], function(msg) { var src = can.user.MergeURL(can, {_path: "/share/"+msg.Result()}, true) var ui = can.user.toast(can, { - title: can.page.Format("a", "/share?share="+msg.Result(), "share"), - content: can.page.Format("img", src+"/share")+"
"+can.user.MergeURL(can, {share: msg.Result()}, true), + title: can.page.Format("a", "/share/"+msg.Result()+"?share="+msg.Result()), + content: can.page.Format("img", src+"/share"), button: ["close"], duration: 100000, width: 300, height: 300, }) @@ -121,7 +121,7 @@ Volcanos("user", {help: "用户模块", agent: { case "扫码": can.misc.WSS(can, {type: "chrome"}, function(event, msg, cmd, arg) { if (!msg) { return } if (cmd == "pwd") { - can.user.share(can, can.request(event, {text: arg[0]}), ["action", "apply"]) + can.user.share(can, can.request(event, {name: arg[0]}), ["action", "apply"]) msg.Reply() return } @@ -142,6 +142,8 @@ Volcanos("user", {help: "用户模块", agent: { break } }) + + can.page.Modify(can, ui.first, {style: {left: (window.innerWidth-ui.first.offsetWidth)/2}}) }, carte: function(event, can, meta, list, cb, view) { meta = meta||can.ondetail||can.onaction||{}, list = list&&list.length > 0? list: meta.list||[]; if (list.length == 0) { return } diff --git a/page/index.css b/page/index.css index 60f89436..8f5a404f 100644 --- a/page/index.css +++ b/page/index.css @@ -202,6 +202,9 @@ div.toast { padding:5px; z-index:100; } +div.toast a { + color:yellow; +} div.toast div.title { font-size:14px; color:#cae850; diff --git a/panel/Header.js b/panel/Header.js index 42f7d448..7f5944c3 100644 --- a/panel/Header.js +++ b/panel/Header.js @@ -174,8 +174,8 @@ Volcanos("onaction", {help: "交互数据", list: [], _init: function(can, msg, can.onlayout.topic(can) can.user.isLocalFile? init(): can.run({}, ["check"], function(msg) { - if (msg.Option("type") == "apply" && msg.Option("name") == "") { - if (can.user.confirm("auth "+msg.Option("text"))) { + if (msg.Option("type") == "apply" && msg.Option("username") == "") { + if (can.user.confirm("auth "+msg.Option("name"))) { can.run(event, ["action", "auth", "share", can.user.Search(can, "share")]) } } diff --git a/panel/River.js b/panel/River.js index abd6ea5e..72e902c4 100644 --- a/panel/River.js +++ b/panel/River.js @@ -1,6 +1,10 @@ Volcanos("onimport", {help: "导入数据", list: [], _init: function(can, msg, list, cb, target) { - can._main_river = can.user.Search(can, "river") || Volcanos.meta.args.river || (can.user.isMobile||can.user.isExtension? "product": "project") - can._main_storm = can.user.Search(can, "storm") || Volcanos.meta.args.storm || (can.user.isMobile? "office": can.user.isExtension? "chrome": "studio") + can._main_river = can.user.Search(can, "river") || Volcanos.meta.args.river || "project" + can._main_storm = can.user.Search(can, "storm") || Volcanos.meta.args.storm || "studio" + + if (can.user.isExtension) { can._main_river = "product", can._main_storm = "chrome" } + if (can.user.isMobile) { can._main_river = "product", can._main_storm = "office" } + if (can.user.isWeiXin) { can._main_river = "service", can._main_storm = "wx" } can.onmotion.clear(can), can.sublist = {} var select; msg.Table(function(value, index, array) { diff --git a/proto.js b/proto.js index 8ed05e2f..922ac4ed 100644 --- a/proto.js +++ b/proto.js @@ -50,7 +50,7 @@ var Volcanos = shy("火山架", {args: {}, pack: {}, libs: [], cache: {}}, [], f return // 加载完成 } - if (libs && libs[0][0] != "/") { + if (libs && libs[0][0] != "/" && libs[0].indexOf("http") == -1) { can._require = can._require||[], can._require.push(libs[0]) can.require(libs.slice(1), cb, each) return