forked from x/volcanos
add print
This commit is contained in:
parent
6d3e088f3a
commit
f97945f731
8
frame.js
8
frame.js
@ -157,6 +157,7 @@ Volcanos("onengine", {help: "解析引擎", list: [], _init: function(can, meta,
|
||||
"web.code.tmux.session",
|
||||
]},
|
||||
"os": {name: "os", action: [
|
||||
{name: "文件系统", help: "fs", index: "nfs.dir", args: ["", "time,size,path,link"]},
|
||||
{name: "操作系统", help: "os", index: "web.wiki.word", args: ["usr/learning/自然/编程/system.shy"]},
|
||||
]},
|
||||
}},
|
||||
@ -431,7 +432,8 @@ Volcanos("onlayout", {help: "页面布局", list: [], _init: function(can, targe
|
||||
|
||||
can.Action._width = width, can.Action._height = height
|
||||
|
||||
if (can.user.isMobile) { return }
|
||||
if (can.user.isMobile || can.user.Search(can, "pod") || can.user.Search(can, "share")) { return }
|
||||
|
||||
can.page.Select(can, target, ["fieldset.middle"], function(field, index) {
|
||||
can.page.Modify(can, field, {style: {height: height}})
|
||||
})
|
||||
@ -589,8 +591,10 @@ Volcanos("onkeypop", {help: "键盘交互", list: [], _init: function(can, targe
|
||||
},
|
||||
})
|
||||
Volcanos("onmotion", {help: "动态交互", list: [], _init: function(can) {
|
||||
if ((can.user.Search(can, "topic")||"").indexOf("print") > -1) { return }
|
||||
|
||||
var count = 0, add = true
|
||||
can.user.isMobile || can.core.Timer({interval: 100}, function() {
|
||||
can.user.isMobile || can.user.Search(can, "share") || can.core.Timer({interval: 100}, function() {
|
||||
add? count++: count--
|
||||
count < 0 && (add = true)
|
||||
count > 100 && (add = false)
|
||||
|
26
index.css
26
index.css
@ -323,3 +323,29 @@ body.white table input[type=button][value=停止] {
|
||||
body.white table input[type=button][value=启动] {
|
||||
background:#52ce78;
|
||||
}
|
||||
|
||||
body.print {
|
||||
background-color:white;
|
||||
color:black;
|
||||
}
|
||||
body.print legend {
|
||||
box-shadow:0px 0px 0px 0px #626bd0;
|
||||
}
|
||||
body.print input[type=text] {
|
||||
box-shadow:0px 0px 0px 0px #626bd0;
|
||||
}
|
||||
body.print select {
|
||||
box-shadow:0px 0px 0px 0px #626bd0;
|
||||
}
|
||||
body.print fieldset.Action {
|
||||
background-color:white;
|
||||
}
|
||||
body.print fieldset.Action fieldset.plugin {
|
||||
padding-left:40px;
|
||||
}
|
||||
body.print fieldset.Action fieldset.plugin>legend {
|
||||
display:none;
|
||||
}
|
||||
body.print fieldset.Action fieldset.plugin>form.option {
|
||||
display:none;
|
||||
}
|
||||
|
@ -7,6 +7,7 @@
|
||||
<link rel="shortcut icon" type="image/ico" href="favicon.ico">
|
||||
<link rel="stylesheet" type="text/css" href="cache.css">
|
||||
<link rel="stylesheet" type="text/css" href="index.css">
|
||||
<link rel="stylesheet" type="text/css" href="/page/print.css" media="print"/>
|
||||
</head>
|
||||
<body>
|
||||
<script src="proto.js"></script>
|
||||
|
@ -7,6 +7,7 @@
|
||||
<link rel="shortcut icon" type="image/ico" href="/favicon.ico">
|
||||
<link rel="stylesheet" type="text/css" href="/index.css">
|
||||
<link rel="stylesheet" type="text/css" href="share.css">
|
||||
<link rel="stylesheet" type="text/css" href="print.css" media="print"/>
|
||||
</head>
|
||||
<body>
|
||||
<script src="/proto.js"></script>
|
||||
|
@ -21,6 +21,7 @@ Volcanos("onimport", {help: "导入数据", list: [], _init: function(can, msg,
|
||||
// 添加插件
|
||||
value.width = parseInt(can.Conf("width")), value.height = parseInt(can.Conf("height"))
|
||||
can.onappend._init(can, value, ["/plugin/state.js"], function(plugin) {
|
||||
plugin._option.dataset.id = value.id
|
||||
can._plugins = (can._plugins||[]).concat([plugin])
|
||||
plugin.run = function(event, cmds, cb, silent) { var msg = plugin.request(event); cmds = cmds || []
|
||||
can.run(event, can.onengine[cmds[0]]? cmds: [river, storm, value.action].concat(cmds), function(msg) {
|
||||
@ -55,6 +56,7 @@ Volcanos("onaction", {help: "交互操作", list: [], _init: function(can, msg,
|
||||
var share = can.user.Search(can, "share"); if (share) {
|
||||
can.run({}, ["_share", share], function(msg) {
|
||||
can.user.title(msg.Option("title"))
|
||||
can.user.topic(can, can.user.Search(can, "topic")||msg.Option("topic")||"white print")
|
||||
can.Conf(RIVER, "_share"), can.Conf(STORM, share)
|
||||
can.onimport._init(can, msg, [], cb, can._output)
|
||||
})
|
||||
|
@ -7,6 +7,7 @@ Volcanos("onimport", {help: "导入数据", list: [], _init: function(can, msg,
|
||||
"pack": "打包页面",
|
||||
"white": "白色主题",
|
||||
"black": "黑色主题",
|
||||
"print": "打印主题",
|
||||
"logout": "退出",
|
||||
}
|
||||
can.onmotion.clear(can)
|
||||
@ -167,11 +168,12 @@ Volcanos("onaction", {help: "交互数据", list: [], _init: function(can, msg,
|
||||
|
||||
river: function(event, can) { can.run(event, ["search", "River.onmotion.toggle"]) },
|
||||
setting: function(event, can) {
|
||||
var ui = can.user.carte(event, can, can.onaction, ["pack", "white", "black"])
|
||||
var ui = can.user.carte(event, can, can.onaction, ["pack", "white", "black", "print"])
|
||||
can.page.Modify(can, ui.first, {style: {top: can._target.offsetHeight}})
|
||||
},
|
||||
black: function(event, can, button) { can.onimport.topic(can, button) },
|
||||
white: function(event, can, button) { can.onimport.topic(can, button) },
|
||||
print: function(event, can, button) { can.onimport.topic(can, "white print") },
|
||||
|
||||
River: function(can) { can.run({}, ["search", "River.onmotion.toggle"]) },
|
||||
Footer: function(can) { can.run({}, ["search", "River.onmotion.autosize"]) },
|
||||
|
@ -166,7 +166,7 @@ Volcanos("ondetail", {help: "菜单交互", list: ["共享群组", "添加用户
|
||||
"保存参数": function(event, can, button, river, storm) {
|
||||
can.run(event, ["search", "Action.onexport.args"], function(item, next) {
|
||||
var msg = can.request({}, {hash: storm, id: item.dataset.id})
|
||||
can.run({}, [river, "tool", "action", "modify", "arg", item.dataset.args], function(msg) {
|
||||
can.run(msg._event, [river, "tool", "action", "modify", "arg", item.dataset.args], function(msg) {
|
||||
next()
|
||||
})
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user