From e88d504f5cb8cec8abaea0a2f50da4cf95da7ab0 Mon Sep 17 00:00:00 2001 From: shaoying Date: Fri, 3 Jul 2020 08:44:14 +0800 Subject: [PATCH] opt some --- index.css | 4 ++-- pane/Header.js | 9 ++++----- plugin/input/date.css | 1 + plugin/input/date.js | 11 ++++------- plugin/local/team/plan.js | 5 ++--- 5 files changed, 13 insertions(+), 17 deletions(-) diff --git a/index.css b/index.css index 7ab0c121..ca572101 100644 --- a/index.css +++ b/index.css @@ -76,7 +76,7 @@ fieldset>form.option>div.item.textarea { } fieldset>div.action { - clear:both; + clear:none; } fieldset>div.action>div.item { float:left; @@ -85,7 +85,7 @@ fieldset>div.action>div.item { fieldset>div.action>div.item>select { color:cyan; background:black; - margin:3px 0; + /* margin:3px 0; */ } fieldset>div.action>div.item>input { color:cyan; diff --git a/pane/Header.js b/pane/Header.js index 555bd3e8..6db7a8ba 100644 --- a/pane/Header.js +++ b/pane/Header.js @@ -100,13 +100,12 @@ Volcanos("onexport", {help: "导出数据", list: [], _init: function(can, msg, }, }]} })); + if (location.protocol == "chrome-extension:") { ui.River.click() - } else { - // ui.River.click(), ui.Footer.click(), ui.Storm.click() - // ui.River.click(), ui.Footer.click() - } - if (can.user.isMobile) { + } else if (can.user.Search(can, "pod")) { + ui.River.click(), ui.Footer.click(), ui.Storm.click() + } else if (can.user.isMobile) { ui.River.click(), ui.Footer.click(), ui.Storm.click() } diff --git a/plugin/input/date.css b/plugin/input/date.css index 173aacef..67d7dc6d 100644 --- a/plugin/input/date.css +++ b/plugin/input/date.css @@ -1,4 +1,5 @@ fieldset.input.date { + position:fixed; background-color:black; z-index:100; } diff --git a/plugin/input/date.js b/plugin/input/date.js index 5d726948..e17fdf28 100644 --- a/plugin/input/date.js +++ b/plugin/input/date.js @@ -3,8 +3,7 @@ Volcanos("onfigure", {help: "控件详情", list: [], _merge: function(can, sub) }); return true }, date: {onclick: function(event, can, item, target) { - can._figure && can.page.Remove(can, can._figure.fieldset) - can._figure = can.onappend.field(can, can._target, "input date", {}) + // 设置输入 function set(now) { target.value = can.base.Time(now); @@ -12,11 +11,9 @@ Volcanos("onfigure", {help: "控件详情", list: [], _merge: function(can, sub) } // 添加插件 - var figure = can._figure + var figure = can.onappend.field(can, document.body, "input date", {}) figure.table = can.page.Append(can, figure.output, [{type: "table"}]).first - // can.page.Modify(can, figure.fieldset, {style: {top: target.offsetTop+20, left: target.offsetLeft}}) - var offset = can.page.offset(can._target) - can.page.Modify(can, figure.fieldset, {style: {top: event.clientY-offset.Top+60, left: event.clientX-offset.Left+60}}) + can.page.Modify(can, figure.fieldset, {style: {top: event.clientY+10, left: event.clientX}}) can.page.Remove(can, figure.legend) // 添加控件 @@ -41,7 +38,7 @@ Volcanos("onfigure", {help: "控件详情", list: [], _merge: function(can, sub) case "关闭": can.page.Remove(can, figure.fieldset); break; case "今天": now = new Date(); set(show(now)); break; case "随机": now.setDate((Math.random() * 100 - 50) + now.getDate()); set(show(now)); break; - case "关闭": can.page.Remove(can, figure.first); delete(can.figure); + case "关闭": can.page.Remove(can, figure.first); case "前一年": now.setFullYear(now.getFullYear()-1); show(now); break; case "后一年": now.setFullYear(now.getFullYear()+1); show(now); break; case "上一月": now.setMonth(now.getMonth()-1); show(now); break; diff --git a/plugin/local/team/plan.js b/plugin/local/team/plan.js index cc8c3d67..49a04106 100644 --- a/plugin/local/team/plan.js +++ b/plugin/local/team/plan.js @@ -208,13 +208,12 @@ Volcanos("onimport", {help: "导入数据", list: [], _init: function(can, msg, }]).table }, }, ["/plugin/local/team/plan.css"]) -Volcanos("onaction", {help: "组件交互", list: ["统计", "添加", "详情", "", +Volcanos("onaction", {help: "组件交互", list: ["导出", "导入", "统计", "详情", "", ["level", "all", "l1", "l2", "l3", "l4", "l5"], ["status", "all", "prepare", "process", "cancel", "finish"], ["score", "all", "s1", "s2", "s3", "s4", "s5"], ["view", "", "name", "text", "level", "score"], - "", "启动", "运行", "完成", - "", "导出", "导入", + "", "添加", "启动", "运行", "完成", ], insertTask: function(event, can, now) { now = now || new Date() can.require([