mirror of
https://shylinux.com/x/volcanos
synced 2025-04-26 01:04:06 +08:00
opt some
This commit is contained in:
parent
055e358884
commit
c75c98e8a6
@ -12,9 +12,18 @@ var can = Volcanos("chrome", {
|
|||||||
msg.Push("link", item.src)
|
msg.Push("link", item.src)
|
||||||
})
|
})
|
||||||
can.page.Select(can, document.body, "img", function(item) {
|
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("time", can.base.Time())
|
||||||
msg.Push("type", "img")
|
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("text", item.src)
|
||||||
msg.Push("link", item.src)
|
msg.Push("link", item.src)
|
||||||
})
|
})
|
||||||
|
@ -236,5 +236,6 @@ var user = Volcanos("user", {help: "用户模块",
|
|||||||
isIPhone: navigator.userAgent.indexOf("iPhone") > -1,
|
isIPhone: navigator.userAgent.indexOf("iPhone") > -1,
|
||||||
isMacOSX: navigator.userAgent.indexOf("Mac OS X") > -1,
|
isMacOSX: navigator.userAgent.indexOf("Mac OS X") > -1,
|
||||||
isWindows: navigator.userAgent.indexOf("Windows") > -1,
|
isWindows: navigator.userAgent.indexOf("Windows") > -1,
|
||||||
|
isExtension: location && location.protocol && location.protocol == "chrome-extension:",
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -92,7 +92,7 @@ Volcanos("onexport", {help: "导出数据", list: [], _init: function(can, msg,
|
|||||||
}, }], }]).input)
|
}, }], }]).input)
|
||||||
|
|
||||||
var height = document.body.offsetHeight
|
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()},
|
return {view: "item", list: [{type: "input", data: {name: item, type: "button", value: item.toLowerCase()},
|
||||||
onclick: function(event) {
|
onclick: function(event) {
|
||||||
var cb = can.onaction[item]; if (typeof cb == "function") {
|
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:") {
|
if (can.user.isExtension) {
|
||||||
ui.River.click()
|
ui.River && ui.River.click()
|
||||||
} else if (can.user.Search(can, "pod")) {
|
} 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) {
|
} else if (can.user.isMobile) {
|
||||||
ui.River.click(), ui.Footer.click()
|
can.onaction.Footer({}, can)
|
||||||
|
ui.River && ui.River.click()
|
||||||
}
|
}
|
||||||
|
|
||||||
typeof cb == "function" && cb()
|
typeof cb == "function" && cb()
|
||||||
|
@ -52,7 +52,7 @@ fieldset.editor>div.output div.content {
|
|||||||
font-size:16px; font-family:monospace;
|
font-size:16px; font-family:monospace;
|
||||||
border-left:solid 2px red;
|
border-left:solid 2px red;
|
||||||
min-height:20px;
|
min-height:20px;
|
||||||
min-width:800px;
|
min-width:400px;
|
||||||
max-width:1000px;
|
max-width:1000px;
|
||||||
overflow:auto;
|
overflow:auto;
|
||||||
float:left;
|
float:left;
|
||||||
|
@ -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.file = file, can.parse = can.base.Ext(file||path), can.max = 0
|
||||||
can.onsyntax._init(can, can._msg)
|
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.Status("当前行", can.onexport.position(can, parseInt(can.Option("line")))-1)
|
||||||
can.page.Modify(can, can.ui.content, {style: {"max-width": width+"px"}})
|
can.page.Modify(can, can.ui.content, {style: {"max-width": width+"px"}})
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user