1
0
mirror of https://shylinux.com/x/volcanos synced 2025-04-25 16:58:06 +08:00
This commit is contained in:
shaoying 2020-08-16 18:29:48 +08:00
parent 055e358884
commit c75c98e8a6
5 changed files with 20 additions and 8 deletions

View File

@ -12,9 +12,18 @@ var can = Volcanos("chrome", {
msg.Push("link", item.src)
})
can.page.Select(can, document.body, "img", function(item) {
var ls = item.src.split("?")
var ls = ls[0].split("/")
msg.Push("time", can.base.Time())
msg.Push("type", "img")
msg.Push("name", "img")
if (item.src.startsWith("data:image")) {
msg.Push("name", item.src.slice(item.src.length-20))
} else {
msg.Push("name", ls[ls.length-1]||"image.jpg")
}
msg.Push("text", item.src)
msg.Push("link", item.src)
})

View File

@ -236,5 +236,6 @@ var user = Volcanos("user", {help: "用户模块",
isIPhone: navigator.userAgent.indexOf("iPhone") > -1,
isMacOSX: navigator.userAgent.indexOf("Mac OS X") > -1,
isWindows: navigator.userAgent.indexOf("Windows") > -1,
isExtension: location && location.protocol && location.protocol == "chrome-extension:",
})

View File

@ -92,7 +92,7 @@ Volcanos("onexport", {help: "导出数据", list: [], _init: function(can, msg,
}, }], }]).input)
var height = document.body.offsetHeight
var ui = can.page.Append(can, can._output, can.core.List(["River", "Footer", "pack"], function(item) {
var ui = can.page.Append(can, can._output, can.core.List(can.user.isMobile || can.user.isExtension? ["River"]: [], function(item) {
return {view: "item", list: [{type: "input", data: {name: item, type: "button", value: item.toLowerCase()},
onclick: function(event) {
var cb = can.onaction[item]; if (typeof cb == "function") {
@ -106,12 +106,14 @@ Volcanos("onexport", {help: "导出数据", list: [], _init: function(can, msg,
}]}
}));
if (location.protocol == "chrome-extension:") {
ui.River.click()
if (can.user.isExtension) {
ui.River && ui.River.click()
} else if (can.user.Search(can, "pod")) {
ui.River.click(), ui.Footer.click()
can.onaction.Footer({}, can)
ui.River && ui.River.click()
} else if (can.user.isMobile) {
ui.River.click(), ui.Footer.click()
can.onaction.Footer({}, can)
ui.River && ui.River.click()
}
typeof cb == "function" && cb()

View File

@ -52,7 +52,7 @@ fieldset.editor>div.output div.content {
font-size:16px; font-family:monospace;
border-left:solid 2px red;
min-height:20px;
min-width:800px;
min-width:400px;
max-width:1000px;
overflow:auto;
float:left;

View File

@ -50,7 +50,7 @@ Volcanos("onimport", {help: "导入数据", _init: function(can, msg, list, cb,
can.file = file, can.parse = can.base.Ext(file||path), can.max = 0
can.onsyntax._init(can, can._msg)
var width = can._target.offsetWidth - can.ui.project.offsetWidth - can.ui.preview.offsetWidth - 60
var width = can._target.offsetWidth - can.ui.project.offsetWidth - can.ui.preview.offsetWidth - 30
can.Status("当前行", can.onexport.position(can, parseInt(can.Option("line")))-1)
can.page.Modify(can, can.ui.content, {style: {"max-width": width+"px"}})
}