From 772f23d53304d493825f7fbb1c38caa45b921636 Mon Sep 17 00:00:00 2001 From: shylinux Date: Wed, 30 Dec 2020 17:40:51 +0800 Subject: [PATCH] opt print --- frame.js | 6 ++++-- index.css | 10 ++++++++-- index.js | 2 +- manifest.json | 6 ++---- page/share.js | 2 +- pane/Action.css | 2 +- publish/chrome/popup.js | 2 +- 7 files changed, 18 insertions(+), 12 deletions(-) diff --git a/frame.js b/frame.js index f4cbd905..93516fcd 100644 --- a/frame.js +++ b/frame.js @@ -426,10 +426,10 @@ Volcanos("onlayout", {help: "页面布局", list: [], _init: function(can, targe if (can.user.isMobile || can.user.Search(can, "share")) { return } can.onengine.trigger(can, can.request(event, {width: width, height: height}), "resize") - can.page.Select(can, target, ["fieldset.middle"], function(field, index) { + can.page.Select(can, target, ["fieldset.main"], function(field, index) { can.page.Modify(can, field, {style: {height: height}}) }) - can.page.Select(can, target, ["fieldset.middle>div.output"], function(output) { + can.page.Select(can, target, ["fieldset.main>div.output"], function(output) { can.page.Modify(can, output, {style: {height: height}}) }) }, @@ -586,6 +586,8 @@ Volcanos("onmotion", {help: "动态交互", list: [], _init: function(can) { var count = 0, add = true can.user.isMobile || can.user.Search(can, "share") || can.core.Timer({interval: 100}, function() { + if (document.body.className.indexOf("print") > -1) { return } + add? count++: count-- count < 0 && (add = true) count > 100 && (add = false) diff --git a/index.css b/index.css index 6948b477..627fa480 100644 --- a/index.css +++ b/index.css @@ -337,6 +337,9 @@ body.print input[type=text] { body.print select { box-shadow:0px 0px 0px 0px #626bd0; } +body.print div.code { + background-color:white; +} body.print fieldset.Action { background-color:white; } @@ -344,8 +347,11 @@ body.print fieldset.Action fieldset.plugin { padding-left:40px; } body.print fieldset.Action fieldset.plugin>legend { - display:none; + /* display:none; */ } body.print fieldset.Action fieldset.plugin>form.option { - display:none; + /* display:none; */ +} +body.print fieldset.River>div.output div.list div.item { + background-color:white; } diff --git a/index.js b/index.js index c04fc88f..da316982 100644 --- a/index.js +++ b/index.js @@ -3,7 +3,7 @@ Volcanos({name: "chat", iceberg: "/chat/", volcano: "/frame.js", {name: "Header", help: "标题栏", pos: "head", state: ["time", "username"]}, {name: "Search", help: "搜索框", pos: "float"}, {name: "River", help: "群聊组", pos: "left", action: ["创建", "刷新"]}, - {name: "Action", help: "工作台", pos: "middle"}, + {name: "Action", help: "工作台", pos: "main"}, {name: "Footer", help: "状态条", pos: "foot", state: ["ncmd", "keys"]}, ], main: {name: "Header", engine: "remote", list: ["/publish/order.js"]}, plugin: [ "/plugin/state.js", diff --git a/manifest.json b/manifest.json index 3e2a53ce..89c9ddb8 100644 --- a/manifest.json +++ b/manifest.json @@ -3,9 +3,7 @@ "name": "volcanos", "version": "0.0.1", "background": {"page": "/publish/chrome/chrome.html"}, - "browser_action": { - "default_popup": "/publish/chrome/popup.html" - }, + "browser_action": {"default_popup": "/publish/chrome/popup.html"}, "content_scripts": [ { "matches": [""], @@ -24,8 +22,8 @@ "history", "cookies", "bookmarks", - "notifications", "contextMenus", + "notifications", "http://localhost:9020/*" ] } diff --git a/page/share.js b/page/share.js index d91d7b51..e664cbfa 100644 --- a/page/share.js +++ b/page/share.js @@ -1,6 +1,6 @@ Volcanos({name: "chat", iceberg: "/chat/", volcano: "/frame.js", libs: ["/lib/base.js", "/lib/core.js", "/lib/misc.js", "/lib/page.js", "/lib/user.js"], panes: [ - {name: "Action", help: "工作台", pos: "middle"}, + {name: "Action", help: "工作台", pos: "main"}, ], main: {name: "Action", engine: "remote", list: ["/publish/order.js"]}, plugin: [ "/plugin/state.js", "/plugin/input.js", diff --git a/pane/Action.css b/pane/Action.css index bfa8839c..f34d5aa4 100644 --- a/pane/Action.css +++ b/pane/Action.css @@ -6,7 +6,7 @@ fieldset.Action { fieldset.Action fieldset.plugin { box-shadow:2px 2px 10px 4px #626bd0; background-color:#113c4a; - margin:8px; padding:4px; + margin:10px; padding:10px; } fieldset.Action fieldset.plugin:hover { box-shadow:4px 4px 12px 6px #626bd0; diff --git a/publish/chrome/popup.js b/publish/chrome/popup.js index 7690efe9..450d853e 100644 --- a/publish/chrome/popup.js +++ b/publish/chrome/popup.js @@ -2,7 +2,7 @@ Volcanos({name: "demo", volcano: "/frame.js", iceberg: "http://localhost:9020/ch libs: ["/lib/base", "/lib/core", "/lib/misc", "/lib/page", "/lib/user"], panes: [ {name: "Header", help: "标题栏", pos: "head", state: ["time", "username"]}, {name: "River", help: "群聊组", pos: "left"}, - {name: "Action", help: "工作台", pos: "middle"}, + {name: "Action", help: "工作台", pos: "main"}, {name: "Search", help: "搜索框", pos: "float"}, {name: "Footer", help: "状态条", pos: "foot", state: ["ncmd" ]}, ], main: {name: "Header", engine: "remote", list: ["/publish/order.js"]}, plugin: [