From b8a0c6de42f8dbaa4fad416c4d4c344e1fa670de Mon Sep 17 00:00:00 2001 From: shy Date: Sun, 13 Feb 2022 20:27:57 +0800 Subject: [PATCH] opt some --- manifest.json | 25 ++++++++----------------- page/index.css | 12 ++++++++---- plugin/local/code/inner.js | 2 ++ plugin/story/spide.js | 5 +++-- proto.js | 2 +- 5 files changed, 22 insertions(+), 24 deletions(-) diff --git a/manifest.json b/manifest.json index a08cab4b..d2438695 100644 --- a/manifest.json +++ b/manifest.json @@ -1,19 +1,10 @@ { - "manifest_version": 2, - "name": "volcanos", "version": "0.0.1", - "background": {"page": "/publish/chrome/chrome.html"}, - "browser_action": {"default_popup": "/publish/chrome/popup.html"}, - "content_scripts": [{"matches": [""], "css": [ - "/publish/chrome/contexts.css" - ], "js": [ - "/page/can.js", "/publish/chrome/contexts.js" - ]}], "permissions": [ - "tabs", - "history", - "cookies", - "bookmarks", - "contextMenus", - "notifications", - "http://localhost:9020/*" - ] + "manifest_version": 2, + "name": "volcanos", "version": "0.0.1", + "background": {"page": "/publish/chrome/chrome.html"}, + "browser_action": {"default_popup": "/publish/chrome/popup.html"}, + "css": ["/publish/chrome/contexts.css"], "js": ["/page/can.js", "/publish/chrome/contexts.js"]}], + "content_scripts": [{"matches": [""], "permissions": [ + "tabs", "history", "cookies", "bookmarks", "contextMenus", "notifications", "http://localhost:9020/*" + ] } diff --git a/page/index.css b/page/index.css index c272a8d8..29caaf14 100644 --- a/page/index.css +++ b/page/index.css @@ -95,6 +95,8 @@ legend { box-shadow:4px 4px 20px 4px #626bd0; cursor:pointer; } fieldset { margin:0; border:0; padding:0; } fieldset>form.option { float:left; display:contents; } fieldset>form.option>div.item { float:left; margin-right:3px; } +fieldset>form.option>div.item.select { background:none; } +fieldset>form.option>div.item:hover { background:none; } fieldset>form.option>div.item>label { display:none; } fieldset>form.option>div.item input.args.char { width:20px; } fieldset>form.option>div.item input.args.tiny { width:40px; } @@ -109,6 +111,8 @@ fieldset>form.option>div.item.textarea { clear:both; margin-top:4px; } fieldset>div.action { float:left; display:contents; } div.action>div.item { float:left; margin-right:3px; } +fieldset>div.action>div.item.select { background:none; } +fieldset>div.action>div.item:hover { background:none; } fieldset>div.action>div.item.space { width:10px; } fieldset div.action>div.item>label { display:none; } fieldset>div.action>div.tabs { float:left; margin:0; padding:4px; cursor:pointer; } @@ -132,7 +136,7 @@ fieldset.story>legend { display:block; padding:2px 20px; } fieldset.story>div.status { border-top:1px solid darkcyan; } fieldset.float { position:absolute; z-index:10; background-color:#023531cf; padding:0px; margin:0px; } fieldset.float>legend { float:left; } -fieldset.float>div.action { display:block; float:none; height:2rem; overflow:auto; } +fieldset.float>div.action { display:block; float:none; height:2.3rem; overflow:auto; } fieldset.float table { color:white; } fieldset.output { margin:0; padding:0; } @@ -243,10 +247,10 @@ body.white table.content tr:hover { background-color:green; } body.white fieldset.Action fieldset.plugin legend:hover { background-color:#6ee4e4; } body.print fieldset.River>div.output div.item.select { background-color:white; border:solid 2px red; } -body.mobile select { font-size:1.4rem; height:1.8rem; } -body.mobile legend { font-size:1.5rem; } +body.mobile legend { font-size:1.4rem; } body.mobile input { font-size:1.2rem; } -body.mobile input[type=text] { height:1.6rem; } +body.mobile input[type=text] { height:2rem; padding-top:3px; } +body.mobile select { font-size:1.4rem; height:2rem; margin-top:3px; } body.mobile fieldset.Header.head { width:-webkit-fill-available; } body.mobile fieldset.Header.head { background-color:#000000b8; font-size:2rem; height:3rem; position:fixed; top:0; } body.mobile fieldset.Header.head div.output { height:3rem; } diff --git a/plugin/local/code/inner.js b/plugin/local/code/inner.js index 8edb89a9..18ec1e81 100644 --- a/plugin/local/code/inner.js +++ b/plugin/local/code/inner.js @@ -15,6 +15,8 @@ Volcanos("onimport", {help: "导入数据", _init: function(can, msg, cb, target can.onimport._display(can, can.ui.display) can.base.isFunc(cb) && cb(msg) + can.page.style(can, can.ui.project, html.MIN_HEIGHT, can.ConfHeight()) + can.page.style(can, can.ui.content, html.MIN_HEIGHT, can.ConfHeight()) can.onimport.tabview(can, can.Option(nfs.PATH), can.Option(nfs.FILE), can.Option(nfs.LINE)) can.Conf("mode") == "simple"? can.onimport._simple(can): can.onimport.project(can, paths, function() { can.onimport._toolkit(can, can.ui.toolkit), can.onimport._session(can, msg), can.onimport._keydown(can) diff --git a/plugin/story/spide.js b/plugin/story/spide.js index 36c2bf37..dc529f5c 100644 --- a/plugin/story/spide.js +++ b/plugin/story/spide.js @@ -181,9 +181,10 @@ Volcanos("ondetail", {help: "用户交互", list: [], var top = 120, margin = 20; if (can.user.isMobile) { margin = 0 top = can.user.isLandscape()? 24: 48 } + if (height > window.innerHeight) { height = window.innerHeight-top } can.onmotion.move(can, sub._target, {position: html.FIXED, left: left+margin, top: top}) - can.page.style(can, sub._output, html.MAX_WIDTH, width-margin*2) - sub.Conf(html.HEIGHT, height-top-2*html.ACTION_HEIGHT) + sub.ConfHeight(height-top-2*html.ACTION_HEIGHT), sub.ConfWidth(width) + can.page.style(can, sub._output, html.MAX_WIDTH, width) can.base.isFunc(cb) && cb(msg) }) }, diff --git a/proto.js b/proto.js index 9c367f38..b88ff00d 100644 --- a/proto.js +++ b/proto.js @@ -226,7 +226,7 @@ var html = { OPACITY: "opacity", STROKE_WIDTH: "stroke-width", STROKE: "stroke", FILL: "fill", FONT_SIZE: "font-size", MONOSPACE: "monospace", SCROLL: "scroll", HEIGHT: "height", WIDTH: "width", LEFT: "left", TOP: "top", RIGHT: "right", BOTTOM: "bottom", - MAX_HEIGHT: "max-height", MAX_WIDTH: "max-width", MARGIN_X: "margin-x", MARGIN_Y: "margin-y", + MIN_HEIGHT: "min-height", MAX_HEIGHT: "max-height", MAX_WIDTH: "max-width", MARGIN_X: "margin-x", MARGIN_Y: "margin-y", PLUGIN_MARGIN: 10, ACTION_HEIGHT: 29, ACTION_MARGIN: 200, TOGGLE: "toggle",