diff --git a/const.js b/const.js index 0c509916..0c593a00 100644 --- a/const.js +++ b/const.js @@ -357,6 +357,7 @@ var html = {value: { CONFIRM: "confirm", TABLE: "table", THEAD: "thead", TBODY: "tbody", TR: "tr", TH: "th", TD: "td", HEADER: "header", NAV: "nav", MAIN: "main", ASIDE: "aside", FOOTER: "footer", + FAVICON: "favicon", BACKGROUND_COLOR: "background-color", COLOR: "color", PADDING: "padding", BORDER: "border", MARGIN: "margin", MARGIN_TOP: "margin-top", MARGIN_X: "margin-x", MARGIN_Y: "margin-y", diff --git a/frame.js b/frame.js index 669571f8..83fab54e 100644 --- a/frame.js +++ b/frame.js @@ -324,6 +324,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) { can.onappend.style(can, sub._args.style, can._output) // can.isCmdMode() && can.onimport.size(can, can.ConfHeight(), can.ConfWidth(), false) can.onexport._output(sub, msg), sub.Mode() != ice.MSG_RESULT && can.onmotion.clear(can, output) + sub.isCmdMode() && sub.onexport.title(sub, sub.ConfIndex()) can.core.CallFunc([sub, chat.ONIMPORT, chat._INIT], {can: sub, msg: msg, cb: function(msg) { if (action !== false) { can.onkeymap._build(sub) can.onmotion.clear(can, can._action), sub.onappend._action(sub, can.Conf(ice.MSG_ACTION)||msg.Option(ice.MSG_ACTION), action||can._action) diff --git a/lib/misc.js b/lib/misc.js index 7a9deca4..b5578c87 100644 --- a/lib/misc.js +++ b/lib/misc.js @@ -191,7 +191,7 @@ Volcanos("misc", { }) } return socket }, - ResourceFavicon(can) { return can.misc.Resource(can, nfs.SRC_MAIN_ICO) }, + ResourceFavicon(can, path) { return can.misc.Resource(can, path||can.user.info.favicon||nfs.SRC_MAIN_ICO) }, Resource(can, path, space, serve) { if (!can.base.beginWith(path, web.HTTP, nfs.PS)) { path = nfs.REQUIRE+path+_version } if (!can.base.beginWith(path, web.HTTP)) { if (serve && serve.indexOf(location.origin) == -1) { var u = can.base.ParseURL(serve); path = u.origin + path } } diff --git a/panel/action.js b/panel/action.js index 98642e49..c2a05f89 100644 --- a/panel/action.js +++ b/panel/action.js @@ -54,8 +54,6 @@ Volcanos(chat.ONACTION, {_init: function(can, target) { can.db.list = can.misc.S if (can.base.beginWith(location.pathname, "/share/")) { can._names = location.pathname } can.Conf(chat.TOOL)? can.onappend.layout(can, can.core.List(can.Conf(chat.TOOL), function(item, index, list) { item.type = chat.PLUGIN if (list.length == 1) { can.user.mod.cmd = item.index - var pod = can.misc.Search(can, ice.POD) - can.base.isIn(item.index, web.CHAT_MACOS_DESKTOP) || can.user.title(item.index+(pod? " "+pod: "")) can.onaction._onaction_cmd(can), item.mode = chat.CMD, item.opts = can.misc.Search(can) can.onappend.style(can, ice.CMD, document.body), can.onappend.style(can, item.index, document.body) } return item diff --git a/plugin/local/code/inner.js b/plugin/local/code/inner.js index 282ff45d..6594a724 100644 --- a/plugin/local/code/inner.js +++ b/plugin/local/code/inner.js @@ -142,8 +142,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) { var paths = can.core.Sp function show(skip) { can._msg && can._msg.Option && can._msg.Option(nfs.LINE, can.Option(nfs.LINE)), can._msg = can.db.tabview[key] can.Option(can.onimport.history(can, {path: path, file: file, line: line||can.onexport.session(can, SELECT_LINE+nfs.DF+path+file)||can._msg.Option(nfs.LINE)||1})) can.onsyntax._init(can, can._msg, function(content) { var msg = can._msg; can.onexport.hash(can) - var pod = can.misc.Search(can, ice.POD) - can.isCmdMode() && can.onexport.title(can, (isIndex()||isSpace()? "": path)+file+(pod && path != pod? " "+pod: "")), can.onmotion.select(can, can.ui._tabs, html.DIV_TABS, msg._tab), can.isCmdMode() && msg._tab.scrollIntoView() + can.isCmdMode() && can.onexport.title(can, (isIndex()||isSpace()? "": path)+file), can.onmotion.select(can, can.ui._tabs, html.DIV_TABS, msg._tab), can.isCmdMode() && msg._tab.scrollIntoView() can.onmotion.toggle(can, can.ui.path, true) if (isSpace()) { can.ui.path.innerHTML = can.page.Format(html.A, can.base.trimPrefix(can.misc.MergePodCmd(can, {pod: can.Option(nfs.FILE)}), location.origin)) diff --git a/plugin/local/wiki/word.js b/plugin/local/wiki/word.js index c50ea0b4..334a47d9 100644 --- a/plugin/local/wiki/word.js +++ b/plugin/local/wiki/word.js @@ -1,4 +1,5 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.Conf(html.PADDING, 10) + can.onexport.title(can, can.Option(nfs.PATH)) can.page.Modify(can, target, msg.Results()), can.onimport._content(can, target) can.onmotion.delay(can, function() { can.onappend.scroll(can, can._output) }) }, @@ -33,7 +34,6 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.Conf(html.PADDI endmenu: function(can, meta, target) { can.page.Select(can, can._output, can.page.Keys(html.H2, html.H3), function(_target) { can.onimport.item(can, {name: _target.innerHTML}, function() { can.onmotion.scrollIntoView(can, _target) }, function() {}, target) }) }, - title: function(can, meta, target) { can.page.tagis(target, html.H1) && can.onexport && can.onexport.title(can, meta.text) }, spark: function(can, meta, target) { if (meta[mdb.NAME] == html.INNER) { return can.onmotion.copy(can, target) } can.page.Select(can, target, "kbd,samp", function(item) { can.onmotion.copy(can, item, function() { diff --git a/plugin/state.js b/plugin/state.js index d9de3478..8cdfaa4a 100644 --- a/plugin/state.js +++ b/plugin/state.js @@ -291,7 +291,10 @@ Volcanos(chat.ONACTION, {list: ["刷新数据", }) Volcanos(chat.ONEXPORT, {_output: function(can, msg) {}, output: function(can, msg) {}, action: function(can, button, data) {}, record: function(can, value, key, data) {}, - title: function(can, title) { can.isCmdMode() && can.user.title(title) }, + title: function(can, title) { + if (can.base.isIn(title, web.DESKTOP)) { return } + var pod = can.misc.Search(can, ice.POD) + can.isCmdMode() && can.user.title(title+(pod && title != pod? " "+pod: "")) }, marginTop: function() { return 0 }, marginBottom: function() { return 0 }, actionHeight: function(can) { return can.page.ClassList.has(can, can._target, html.OUTPUT)? 0: html.ACTION_HEIGHT }, outputHeight: function(can) { var height = can.ConfHeight() - can.onexport.actionHeight(can) - can.onexport.statusHeight(can)