1
0
forked from x/icebergs
This commit is contained in:
IT 老营长 @云轩领航-创始人 2023-05-10 10:38:31 +08:00
parent aa7fcaf472
commit 0abc171bf8
11 changed files with 42 additions and 43 deletions

View File

@ -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 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>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 { 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>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>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; } fieldset.macos.desktop>div.output>div.desktop>fieldset>form.option>*:not(.textarea) { margin:10px 0px 10px 10px; }

View File

@ -8,15 +8,13 @@ Volcanos(chat.ONIMPORT, { _init: function(can, msg) { can.onmotion.clear(can), c
}) })
}); index == 0 && item.click() }); index == 0 && item.click()
}), can.onmotion.hidden(can, can.ui.profile), can.onmotion.hidden(can, can.ui.display) }, }), can.onmotion.hidden(can, can.ui.profile), can.onmotion.hidden(can, can.ui.display) },
icons: function(can, msg, target) { icons: function(can, msg, target) { can.onimport.icon(can, msg = msg||can._msg, target, function(target, item) { can.page.Modify(can, target, {
can.onimport.icon(can, msg = msg||can._msg, target, function(target, item) { can.page.Modify(can, target, {
onclick: function(event) { onclick: function(event) {
can.sup.onexport.record(can.sup, item.name, mdb.NAME, item) can.sup.onexport.record(can.sup, item.name, mdb.NAME, item)
}, oncontextmenu: function(event) { can.user.carteRight(event, can, { }, oncontextmenu: function(event) { can.user.carteRight(event, can, {
"add to desktop": function() { can.sup.onappend.desktop(item) }, "add to desktop": function() { can.sup.onappend.desktop(item) },
"add to dock": function() { can.sup.onappend.dock(item) }, "add to dock": function() { can.sup.onappend.dock(item) },
}, []) }, draggable: true, ondragstart: function(event) { window._drag_item = item }, }, []) }, draggable: true, ondragstart: function(event) { window._drag_item = item },
})}) })}) },
},
layout: function(can) { can.ui.layout(can.ConfHeight(), can.ConfWidth()) }, layout: function(can) { can.ui.layout(can.ConfHeight(), can.ConfWidth()) },
}) })

View File

@ -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.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))) }, 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)))
} }

View File

@ -8,14 +8,9 @@ import (
const MENU = "menu" const MENU = "menu"
func init() { func init() {
Index.MergeCommands(ice.Commands{MENU: {Actions: ice.MergeActions(ice.Actions{ Index.MergeCommands(ice.Commands{
ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) { MENU: {Actions: ice.MergeActions(mdb.ImportantHashAction(), CmdHashAction())},
if m.Cmd(MENU).Length() == 0 { })
MenuAppend(m, "", Prefix(NOTIFICATIONS))
MenuAppend(m, "", Prefix(SEARCHS))
}
}},
}, mdb.ImportantHashAction(), CmdHashAction())}})
} }
func MenuAppend(m *ice.Message, name, index string, arg ...string) { func MenuAppend(m *ice.Message, name, index string, arg ...string) {
install(m, MENU, name, index, arg...) install(m, MENU, name, index, arg...)

View File

@ -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, "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") }}, {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) { ].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, "", 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) }}, {view: [html.MENU, "", "+"], onclick: function(event) { can.sup.onexport.record(can, mdb.CREATE) }},

View File

@ -11,16 +11,14 @@ import (
const NOTIFICATIONS = "notifications" const NOTIFICATIONS = "notifications"
func init() { func init() {
Index.MergeCommands(ice.Commands{NOTIFICATIONS: {Name: "notifications list", Actions: ice.MergeActions(ice.Actions{ Index.MergeCommands(ice.Commands{
mdb.PRUNES: {Name: "prunes", Hand: func(m *ice.Message, arg ...string) { NOTIFICATIONS: {Name: "notifications list", Actions: ice.MergeActions(ice.Actions{
m.Conf("", kit.Keys(mdb.HASH), "") 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) { 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))) 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) { }, CmdHashAction()), Hand: func(m *ice.Message, arg ...string) { mdb.HashSelect(m, arg...).SortStrR(mdb.TIME).Display("") }},
mdb.HashSelect(m, arg...).SortStrR(mdb.TIME).Display("") })
}}})
} }
func Notify(m *ice.Message, name, text string, arg ...string) { func Notify(m *ice.Message, name, text string, arg ...string) {
m.Cmd(NOTIFICATIONS, mdb.CREATE, mdb.NAME, name, mdb.TEXT, text, arg) m.Cmd(NOTIFICATIONS, mdb.CREATE, mdb.NAME, name, mdb.TEXT, text, arg)

View File

@ -1,9 +1,9 @@
Volcanos(chat.ONIMPORT, {_init: function(can, msg) { Volcanos(chat.ONIMPORT, {_init: function(can, msg) {
can.page.Appends(can, can._output, msg.Table(function(item) { return {view: html.ITEM, _init: function(target) { 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) 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) 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) }} })), 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: "隐藏"}, Volcanos(chat.ONACTION, {list: [web.UPDATE, mdb.PRUNES, web.TOGGLE], _trans: {update: "刷新", toggle: "隐藏"},

View File

@ -11,9 +11,9 @@ const OPENS = "opens"
func init() { func init() {
Index.MergeCommands(ice.Commands{ 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:") { if strings.HasPrefix(m.Option(ice.MSG_USERWEB), "http://localhost:") {
m.Cmd(cli.SYSTEM, "open", "-a", arg) cli.Opens(m, arg...)
} }
}}, }},
}) })

View File

@ -9,7 +9,9 @@ import (
const SEARCHS = "searchs" const SEARCHS = "searchs"
func init() { func init() {
Index.MergeCommands(ice.Commands{SEARCHS: {Name: "searchs keyword list", Hand: func(m *ice.Message, arg ...string) { 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") m.Cmdy(mdb.SEARCH, mdb.FOREACH, kit.Select("", arg, 0), "ctx,cmd,type,name,text")
}}}) }},
})
} }

View File

@ -8,9 +8,11 @@ import (
const SESSION = "session" const SESSION = "session"
func init() { func init() {
Index.MergeCommands(ice.Commands{SESSION: {Actions: ice.MergeActions(mdb.ImportantHashAction(), CmdHashAction(mdb.NAME)), Hand: func(m *ice.Message, arg ...string) { 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 { if mdb.HashSelect(m, arg...); len(arg) > 0 {
m.EchoIFrame(m.MergePodCmd("", DESKTOP, SESSION, arg[0])) m.EchoIFrame(m.MergePodCmd("", DESKTOP, SESSION, arg[0]))
} }
}}}) }},
})
} }

View File

@ -201,7 +201,10 @@ func (m *Message) EchoDownload(arg ...string) *Message {
} }
func (m *Message) Display(file string, arg ...Any) { func (m *Message) Display(file string, arg ...Any) {
if file == "" { 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...)) m.Option(MSG_DISPLAY, kit.MergeURL(kit.Select(kit.ExtChange(file, JS), file, strings.Contains(file, QS)), arg...))
} }