forked from x/icebergs
opt some
This commit is contained in:
parent
aa7fcaf472
commit
0abc171bf8
@ -21,6 +21,7 @@ fieldset.macos.desktop>div.output>div.desktop>div.item:hover { background-color:
|
||||
fieldset.macos.desktop>div.output>div.desktop>div.item img { width:80px; border-radius:80px; }
|
||||
fieldset.macos.desktop>div.output>div.desktop>div.item>div.name { font-size:12px; width:80px; overflow:hidden; }
|
||||
fieldset.macos.desktop>div.output>div.desktop>fieldset { border-radius:10px; position:absolute; }
|
||||
fieldset.macos.desktop>div.output>div.desktop>fieldset>div.output>table.content { width:100%; }
|
||||
fieldset.macos.desktop>div.output>div.desktop>fieldset>div.item.button { border-radius:20px; height:20px; width:20px; scale:0.7; position:absolute; top:17px; right:10px; }
|
||||
fieldset.macos.desktop>div.output>div.desktop>fieldset>legend { background-color:unset; padding-right:10px; margin:10px 0; }
|
||||
fieldset.macos.desktop>div.output>div.desktop>fieldset>form.option>*:not(.textarea) { margin:10px 0px 10px 10px; }
|
||||
|
@ -8,15 +8,13 @@ Volcanos(chat.ONIMPORT, { _init: function(can, msg) { can.onmotion.clear(can), c
|
||||
})
|
||||
}); index == 0 && item.click()
|
||||
}), can.onmotion.hidden(can, can.ui.profile), can.onmotion.hidden(can, can.ui.display) },
|
||||
icons: function(can, msg, target) {
|
||||
can.onimport.icon(can, msg = msg||can._msg, target, function(target, item) { can.page.Modify(can, target, {
|
||||
onclick: function(event) {
|
||||
can.sup.onexport.record(can.sup, item.name, mdb.NAME, item)
|
||||
}, oncontextmenu: function(event) { can.user.carteRight(event, can, {
|
||||
"add to desktop": function() { can.sup.onappend.desktop(item) },
|
||||
"add to dock": function() { can.sup.onappend.dock(item) },
|
||||
}, []) }, draggable: true, ondragstart: function(event) { window._drag_item = item },
|
||||
})})
|
||||
},
|
||||
icons: function(can, msg, target) { can.onimport.icon(can, msg = msg||can._msg, target, function(target, item) { can.page.Modify(can, target, {
|
||||
onclick: function(event) {
|
||||
can.sup.onexport.record(can.sup, item.name, mdb.NAME, item)
|
||||
}, oncontextmenu: function(event) { can.user.carteRight(event, can, {
|
||||
"add to desktop": function() { can.sup.onappend.desktop(item) },
|
||||
"add to dock": function() { can.sup.onappend.dock(item) },
|
||||
}, []) }, draggable: true, ondragstart: function(event) { window._drag_item = item },
|
||||
})}) },
|
||||
layout: function(can) { can.ui.layout(can.ConfHeight(), can.ConfWidth()) },
|
||||
})
|
||||
|
@ -34,7 +34,7 @@ func CmdHashAction(arg ...string) ice.Actions {
|
||||
}
|
||||
}},
|
||||
mdb.SELECT: {Name: "list hash auto create", Hand: func(m *ice.Message, arg ...string) {
|
||||
mdb.HashSelect(m, arg...).Sort(mdb.NAME).Display(kit.PathJoin("/require/", strings.TrimPrefix(file, ice.Info.Make.Path)))
|
||||
mdb.HashSelect(m, arg...).Sort(mdb.NAME).Display(strings.TrimPrefix(file, ice.Info.Make.Path))
|
||||
}},
|
||||
}, ctx.CmdAction(), mdb.HashAction(mdb.SHORT, kit.Select("", arg, 0), mdb.FIELD, kit.Select("time,hash,name,icon,text,index,args", arg, 1), kit.Slice(arg, 2)))
|
||||
}
|
||||
|
@ -8,14 +8,9 @@ import (
|
||||
const MENU = "menu"
|
||||
|
||||
func init() {
|
||||
Index.MergeCommands(ice.Commands{MENU: {Actions: ice.MergeActions(ice.Actions{
|
||||
ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) {
|
||||
if m.Cmd(MENU).Length() == 0 {
|
||||
MenuAppend(m, "", Prefix(NOTIFICATIONS))
|
||||
MenuAppend(m, "", Prefix(SEARCHS))
|
||||
}
|
||||
}},
|
||||
}, mdb.ImportantHashAction(), CmdHashAction())}})
|
||||
Index.MergeCommands(ice.Commands{
|
||||
MENU: {Actions: ice.MergeActions(mdb.ImportantHashAction(), CmdHashAction())},
|
||||
})
|
||||
}
|
||||
func MenuAppend(m *ice.Message, name, index string, arg ...string) {
|
||||
install(m, MENU, name, index, arg...)
|
||||
|
@ -2,7 +2,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg) { can.page.Append(can, can._o
|
||||
{view: [html.ITEM], list: [{img: can.page.drawText(can, "n", 25, 0, 20)}], onclick: function(event) { can.sup.onexport.record(can, "notifications") }},
|
||||
{view: [html.ITEM], list: [{img: can.page.drawText(can, "s", 25, 0, 20)}], onclick: function(event) { can.sup.onexport.record(can, "searchs") }},
|
||||
].concat(msg.Table(function(item) {
|
||||
return {view: [html.ITEM], list: [{img: can.page.drawText(can, 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) }}
|
||||
}), [
|
||||
{view: [html.MENU, "", location.hostname], onclick: function(event) { can.sup.onexport.record(can, html.DESKTOP) }},
|
||||
{view: [html.MENU, "", "+"], onclick: function(event) { can.sup.onexport.record(can, mdb.CREATE) }},
|
||||
|
@ -11,16 +11,14 @@ import (
|
||||
const NOTIFICATIONS = "notifications"
|
||||
|
||||
func init() {
|
||||
Index.MergeCommands(ice.Commands{NOTIFICATIONS: {Name: "notifications list", Actions: ice.MergeActions(ice.Actions{
|
||||
mdb.PRUNES: {Name: "prunes", Hand: func(m *ice.Message, arg ...string) {
|
||||
m.Conf("", kit.Keys(mdb.HASH), "")
|
||||
}},
|
||||
web.DREAM_CREATE: {Hand: func(m *ice.Message, arg ...string) {
|
||||
m.Cmd("", mdb.CREATE, m.OptionSimple(mdb.NAME), mdb.TEXT, "空间创建成功", ctx.INDEX, web.CHAT_IFRAME, ctx.ARGS, m.MergePod(m.Option(mdb.NAME)))
|
||||
}},
|
||||
}, CmdHashAction()), Hand: func(m *ice.Message, arg ...string) {
|
||||
mdb.HashSelect(m, arg...).SortStrR(mdb.TIME).Display("")
|
||||
}}})
|
||||
Index.MergeCommands(ice.Commands{
|
||||
NOTIFICATIONS: {Name: "notifications list", Actions: ice.MergeActions(ice.Actions{
|
||||
mdb.PRUNES: {Name: "prunes", Hand: func(m *ice.Message, arg ...string) { m.Conf("", kit.Keys(mdb.HASH), "") }},
|
||||
web.DREAM_CREATE: {Hand: func(m *ice.Message, arg ...string) {
|
||||
m.Cmd("", mdb.CREATE, m.OptionSimple(mdb.NAME), mdb.TEXT, "空间创建成功", ctx.INDEX, web.CHAT_IFRAME, ctx.ARGS, m.MergePod(m.Option(mdb.NAME)))
|
||||
}},
|
||||
}, CmdHashAction()), Hand: func(m *ice.Message, arg ...string) { mdb.HashSelect(m, arg...).SortStrR(mdb.TIME).Display("") }},
|
||||
})
|
||||
}
|
||||
func Notify(m *ice.Message, name, text string, arg ...string) {
|
||||
m.Cmd(NOTIFICATIONS, mdb.CREATE, mdb.NAME, name, mdb.TEXT, text, arg)
|
||||
|
@ -1,9 +1,9 @@
|
||||
Volcanos(chat.ONIMPORT, {_init: function(can, msg) {
|
||||
can.page.Appends(can, can._output, msg.Table(function(item) { return {view: html.ITEM, _init: function(target) {
|
||||
target.onclick = function(event) { can.sup.onexport.record(can.sup, item.index, ctx.INDEX, item), can.runAction(event, mdb.REMOVE, [item.hash], function() { can.page.Remove(can, target) }) }
|
||||
var ui = can.onappend.layout(can, [html.ICON, [[wiki.TITLE, mdb.TIME], wiki.CONTENT]], "", target)
|
||||
can.page.Append(can, ui.icon, [{img: can.misc.PathJoin(item.icon||can.page.drawText(can, item.index, 60))}])
|
||||
can.page.Append(can, ui.icon, [{img: can.misc.PathJoin(item.icon||can.page.drawText(can, item.name||item.index, 60))}])
|
||||
ui.title.innerHTML = item.name||"", ui.content.innerHTML = item.text||"", ui.time.innerHTML = item.time.split(lex.SP).pop().split(nfs.DF).slice(0, 2).join(nfs.DF)
|
||||
target.onclick = function(event) { can.sup.onexport.record(can.sup, item.index, ctx.INDEX, item), can.runAction(event, mdb.REMOVE, [item.hash], function() { can.page.Remove(can, target) }) }
|
||||
}} })), msg.Length() == 0 && can.onmotion.hidden(can, can._fields), can.onappend._action(can), can.page.style(can, can._action, html.DISPLAY, html.BLOCK)
|
||||
}})
|
||||
Volcanos(chat.ONACTION, {list: [web.UPDATE, mdb.PRUNES, web.TOGGLE], _trans: {update: "刷新", toggle: "隐藏"},
|
||||
|
@ -11,9 +11,9 @@ const OPENS = "opens"
|
||||
|
||||
func init() {
|
||||
Index.MergeCommands(ice.Commands{
|
||||
OPENS: {Name: "open app auto", Hand: func(m *ice.Message, arg ...string) {
|
||||
OPENS: {Name: "opens app auto", Hand: func(m *ice.Message, arg ...string) {
|
||||
if strings.HasPrefix(m.Option(ice.MSG_USERWEB), "http://localhost:") {
|
||||
m.Cmd(cli.SYSTEM, "open", "-a", arg)
|
||||
cli.Opens(m, arg...)
|
||||
}
|
||||
}},
|
||||
})
|
||||
|
@ -9,7 +9,9 @@ import (
|
||||
const SEARCHS = "searchs"
|
||||
|
||||
func init() {
|
||||
Index.MergeCommands(ice.Commands{SEARCHS: {Name: "searchs keyword list", Hand: func(m *ice.Message, arg ...string) {
|
||||
m.Cmdy(mdb.SEARCH, mdb.FOREACH, kit.Select("", arg, 0), "ctx,cmd,type,name,text")
|
||||
}}})
|
||||
Index.MergeCommands(ice.Commands{
|
||||
SEARCHS: {Name: "searchs keyword list", Hand: func(m *ice.Message, arg ...string) {
|
||||
m.Cmdy(mdb.SEARCH, mdb.FOREACH, kit.Select("", arg, 0), "ctx,cmd,type,name,text")
|
||||
}},
|
||||
})
|
||||
}
|
||||
|
@ -8,9 +8,11 @@ import (
|
||||
const SESSION = "session"
|
||||
|
||||
func init() {
|
||||
Index.MergeCommands(ice.Commands{SESSION: {Actions: ice.MergeActions(mdb.ImportantHashAction(), CmdHashAction(mdb.NAME)), Hand: func(m *ice.Message, arg ...string) {
|
||||
if mdb.HashSelect(m, arg...); len(arg) > 0 {
|
||||
m.EchoIFrame(m.MergePodCmd("", DESKTOP, SESSION, arg[0]))
|
||||
}
|
||||
}}})
|
||||
Index.MergeCommands(ice.Commands{
|
||||
SESSION: {Actions: ice.MergeActions(mdb.ImportantHashAction(), CmdHashAction(mdb.NAME)), Hand: func(m *ice.Message, arg ...string) {
|
||||
if mdb.HashSelect(m, arg...); len(arg) > 0 {
|
||||
m.EchoIFrame(m.MergePodCmd("", DESKTOP, SESSION, arg[0]))
|
||||
}
|
||||
}},
|
||||
})
|
||||
}
|
||||
|
@ -201,7 +201,10 @@ func (m *Message) EchoDownload(arg ...string) *Message {
|
||||
}
|
||||
func (m *Message) Display(file string, arg ...Any) {
|
||||
if file == "" {
|
||||
file = kit.PathJoin("/require/", strings.TrimPrefix(kit.FileLine(2, 100), Info.Make.Path))
|
||||
file = strings.TrimPrefix(kit.FileLine(2, 100), Info.Make.Path)
|
||||
}
|
||||
if !strings.HasPrefix(file, PS) && !strings.HasPrefix(file, HTTP) {
|
||||
file = "/require/" + file
|
||||
}
|
||||
m.Option(MSG_DISPLAY, kit.MergeURL(kit.Select(kit.ExtChange(file, JS), file, strings.Contains(file, QS)), arg...))
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user