forked from x/icebergs
add some
This commit is contained in:
parent
9628216d0f
commit
a598a58a01
@ -4,6 +4,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
"regexp"
|
"regexp"
|
||||||
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -201,7 +202,10 @@ func init() {
|
|||||||
aaa.Black(m, ice.USR_LOCAL)
|
aaa.Black(m, ice.USR_LOCAL)
|
||||||
}},
|
}},
|
||||||
ice.APP: {Help: "本机", Hand: func(m *ice.Message, arg ...string) {
|
ice.APP: {Help: "本机", Hand: func(m *ice.Message, arg ...string) {
|
||||||
m.Cmd("cli.system", "opens", "Finder.app")
|
switch runtime.GOOS {
|
||||||
|
case "darwin":
|
||||||
|
m.Cmd("cli.system", "open", kit.Path(m.Option(PATH)))
|
||||||
|
}
|
||||||
}},
|
}},
|
||||||
mdb.SHOW: {Help: "预览", Hand: func(m *ice.Message, arg ...string) {
|
mdb.SHOW: {Help: "预览", Hand: func(m *ice.Message, arg ...string) {
|
||||||
Show(m.ProcessInner(), path.Join(m.Option(DIR_ROOT), m.Option(PATH)))
|
Show(m.ProcessInner(), path.Join(m.Option(DIR_ROOT), m.Option(PATH)))
|
||||||
|
@ -6,6 +6,7 @@ Volcanos(chat.ONIMPORT, {
|
|||||||
can.sup.onexport.link = function() { return can.misc.MergeURL(can, {pod: can.ConfSpace()||can.misc.Search(can, ice.POD), cmd: web.DESKTOP}) }
|
can.sup.onexport.link = function() { return can.misc.MergeURL(can, {pod: can.ConfSpace()||can.misc.Search(can, ice.POD), cmd: web.DESKTOP}) }
|
||||||
},
|
},
|
||||||
_menu: function(can) { can.onappend.plugin(can, {index: "web.chat.macos.menu", style: html.OUTPUT}, function(sub) { can.ui.menu = sub
|
_menu: function(can) { can.onappend.plugin(can, {index: "web.chat.macos.menu", style: html.OUTPUT}, function(sub) { can.ui.menu = sub
|
||||||
|
sub._desktop = can
|
||||||
var tabs = can.misc.sessionStorage(can, [can.ConfIndex(), html.TABS])
|
var tabs = can.misc.sessionStorage(can, [can.ConfIndex(), html.TABS])
|
||||||
sub.onexport.output = function() { can.onimport._desktop(can, can._msg)
|
sub.onexport.output = function() { can.onimport._desktop(can, can._msg)
|
||||||
var sess = can.misc.SearchHash(can)[0]||can.Conf("session")
|
var sess = can.misc.SearchHash(can)[0]||can.Conf("session")
|
||||||
@ -120,14 +121,10 @@ Volcanos(chat.ONIMPORT, {
|
|||||||
}, [""])
|
}, [""])
|
||||||
Volcanos(chat.ONACTION, {
|
Volcanos(chat.ONACTION, {
|
||||||
_search: function(can) { var sub = can.ui.searchs; if (can.onmotion.toggle(can, sub._target)) {
|
_search: function(can) { var sub = can.ui.searchs; if (can.onmotion.toggle(can, sub._target)) {
|
||||||
if (can.user.isMobile || can.ConfWidth() < 800) {
|
var height = can.ConfHeight()-115, top = 25, width = can.base.Min(sub._target.offsetWidth, can.ConfWidth()/2, can.ConfWidth()), left = (can.ConfWidth()-width)/2
|
||||||
can.page.style(can, sub._target, html.LEFT, 0, html.TOP, 25)
|
if (can.ConfHeight() > 600) { var height = can.ConfHeight()/2, top = can.ConfHeight()/4 }
|
||||||
sub.onimport.size(sub, can.ConfHeight()-115, can.ConfWidth(), true)
|
if (can.ConfWidth() < 800) { var width = can.ConfWidth(), left = 0 }
|
||||||
} else {
|
can.page.style(can, sub._target, html.LEFT, left, html.TOP, top), sub.onimport.size(sub, height, width, true)
|
||||||
can.page.style(can, sub._target, html.LEFT, (can.ConfWidth()-sub._target.offsetWidth)/2, html.TOP, can.ConfHeight()/4)
|
|
||||||
sub.onimport.size(sub, can.ConfHeight()/2, can.base.Min(sub._target.offsetWidth, can.ConfWidth()/2, can.ConfWidth()), true)
|
|
||||||
}
|
|
||||||
can.page.Select(can, sub._option, "input[name=keyword]", function(target) { can.onmotion.focus(can, target) })
|
|
||||||
} },
|
} },
|
||||||
create: function(event, can) { can.onimport._desktop(can) },
|
create: function(event, can) { can.onimport._desktop(can) },
|
||||||
})
|
})
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
Volcanos(chat.ONIMPORT, {_init: function(can, msg) { can.page.style(can, can._output, html.MAX_WIDTH, "")
|
Volcanos(chat.ONIMPORT, {_init: function(can, msg) { can.page.style(can, can._output, html.MAX_WIDTH, "")
|
||||||
can.page.Append(can, can._output, can.user.header(can)), can.page.Append(can, can._output, [
|
can.page.Append(can, can._output, can.user.header(can.sup._desktop)), can.page.Append(can, can._output, [
|
||||||
{view: [html.ITEM], list: [{icon: icon.notifications}], onclick: function(event) { can.sup.onexport.record(can, "notifications") }},
|
{view: [html.ITEM], list: [{icon: icon.notifications}], onclick: function(event) { can.sup.onexport.record(can, "notifications") }},
|
||||||
{view: [html.ITEM], list: [{icon: icon.search}], onclick: function(event) { can.sup.onexport.record(can, "searchs") }},
|
{view: [html.ITEM], list: [{icon: icon.search}], onclick: function(event) { can.sup.onexport.record(can, "searchs") }},
|
||||||
{view: [html.ITEM], list: [{icon: icon.qrcode}], onclick: function(event) { can.sup.onexport.record(can, "qrcode") }},
|
// {view: [html.ITEM], list: [{icon: icon.qrcode}], onclick: function(event) { can.sup.onexport.record(can, "qrcode") }},
|
||||||
].concat(msg.Table(function(item) {
|
].concat(msg.Table(function(item) {
|
||||||
return {view: [html.ITEM], list: [{img: can.page.drawText(can, item.name||item.index, 25, 0, 20)}], onclick: function(event) { can.sup.onexport.record(can, item) }}
|
return {view: [html.ITEM], list: [{img: can.page.drawText(can, item.name||item.index, 25, 0, 20)}], onclick: function(event) { can.sup.onexport.record(can, item) }}
|
||||||
}), [
|
}), [
|
||||||
|
@ -18,5 +18,5 @@ Volcanos(chat.ONIMPORT, {
|
|||||||
]}
|
]}
|
||||||
})), can.onappend.board(can, msg), can.onimport.layout(can), can.user.isWindows && can.onappend.scroll(can, can._output)
|
})), can.onappend.board(can, msg), can.onimport.layout(can), can.user.isWindows && can.onappend.scroll(can, can._output)
|
||||||
},
|
},
|
||||||
layout: function(can) { can.onlayout.expand(can, can._output, can.user.isMobile && !can.user.isLandscape()? can.ConfWidth(): 380) },
|
layout: function(can) { can.onlayout.expand(can, can._output, can.user.isMobile && !can.user.isLandscape()? can.ConfWidth(): 320) },
|
||||||
}, [""])
|
}, [""])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user