diff --git a/core/chat/macos/desktop.css b/core/chat/macos/desktop.css index f7ef152e..5c158ad8 100644 --- a/core/chat/macos/desktop.css +++ b/core/chat/macos/desktop.css @@ -46,17 +46,18 @@ fieldset.desktop>div.output>div.desktop>fieldset>form.option>div.text input:hove fieldset.desktop>div.output>div.desktop>fieldset>div.action>div.text input:hover { border-top:var(--box-notice); } fieldset.desktop>div.output>div.desktop>fieldset>div.action>* { box-shadow:none; margin:var(--button-margin) var(--input-margin); } fieldset.desktop>div.output>div.desktop>fieldset>div.action>div:last-child { margin-right:100px; } -/* fieldset.desktop>div.output>div.desktop>fieldset>div.action>div.tabs { display:none; } */ fieldset.desktop>div.output>div.desktop>fieldset>div.output { min-height:240px; } fieldset.desktop>div.output>div.desktop>fieldset>div.output>table.content { width:100%; } fieldset.desktop>div.output>div.desktop>fieldset>div.output>table.content th { padding:var(--table-padding); } fieldset.desktop>div.output>div.desktop>fieldset>div.output>table.content td { padding:var(--table-padding); } fieldset.desktop>div.output>div.desktop>fieldset>div.output>table.content td>input { margin:var(--button-margin); } -fieldset.desktop>div.output>div.desktop>fieldset.web.wiki.feel>div.status { display:none; } -fieldset.desktop>div.output>div.desktop>fieldset.web.code.xterm>div.status { display:none; } -fieldset.desktop>div.output>div.desktop>fieldset.web.chat.iframe>div.status { display:none; } +fieldset.desktop>div.output>div.desktop>fieldset.iframe>div.status { display:none; } fieldset.desktop>div.output>div.desktop>fieldset.iframe>form.option>div.item.hash input { width:var(--form-width); } +fieldset.desktop>div.output>div.desktop>fieldset.xterm>div.status { display:none; } fieldset.desktop>div.output>div.desktop>fieldset.xterm>form.option>div.item.hash input { width:var(--form-width); } +fieldset.desktop>div.output>div.desktop>fieldset.vimer>form.option>div.item.path input { width:var(--input-width); } +fieldset.desktop>div.output>div.desktop>fieldset.vimer>div.action div.tabs { display:none; } +fieldset.desktop>div.output>div.desktop>fieldset.web.wiki.feel>div.status { display:none; } fieldset.desktop>div.output>div.desktop>fieldset.web.chat.location>form.option>div.item:last-child { margin-right:unset; } fieldset.desktop>div.output>div.desktop>fieldset.web.chat.location>div.action>div.item.text { display:none; } fieldset.desktop>div.output>div.desktop>fieldset.web.chat.location>div.action>div.item.style select { width:80px; } @@ -82,9 +83,9 @@ fieldset.macos.finder>div.output div.content>div.item { text-align:center; float fieldset.macos.finder>div.output div.content>div.item img { object-fit:contain; width:var(--desktop-icon-size); } fieldset.macos.finder>div.output div.content>div.item img { object-fit:contain; width:var(--desktop-icon-size); height:var(--desktop-icon-size); } fieldset.macos.finder>div.output div.content>div.item div.name { font-size:var(--code-font-size); white-space:pre; text-align:center; overflow:hidden; } -body.dark fieldset.desktop>div.output>fieldset.macos { background-color:#08234ad1; } fieldset.desktop>div.output>div.desktop fieldset table.content tbody tr:nth-child(odd):not(:hover) { background-color:var(--output-bg-color); } fieldset.desktop>div.output>div.desktop fieldset table.content tbody tr:nth-child(even):not(:hover) { background-color:var(--plugin-bg-color); } +body.dark fieldset.desktop>div.output>fieldset.macos { background-color:#08234ad1; } body.light fieldset.desktop>div.output>fieldset.macos { background-color:#daefff99; } body:not(.mobile) fieldset.macos.dock>div.output { overflow:visible; } body:not(.mobile) fieldset.macos.dock>div.output>div.item:hover { background-color:unset; margin-top:-80px; transition:margin-top 0.3s; } diff --git a/core/chat/tutor.css b/core/chat/tutor.css new file mode 100644 index 00000000..26115fc8 --- /dev/null +++ b/core/chat/tutor.css @@ -0,0 +1,6 @@ +$output>table.content tr.legend td:nth-child(2) { color:var(--notice-bg-color); } +$output>table.content tr.option td:nth-child(2) { color:var(--notice-bg-color); } +$output>table.content tr.action td:nth-child(2) { color:var(--notice-bg-color); } +$output>table.content tr.button td:nth-child(2) { color:var(--notice-bg-color); } +$output>table.content tr.status td:nth-child(2) { color:var(--notice-bg-color); } +$output>table.content tr.remove td:nth-child(2) { color:var(--danger-bg-color); } \ No newline at end of file diff --git a/core/chat/tutor.go b/core/chat/tutor.go index a9b15cc8..039cb679 100644 --- a/core/chat/tutor.go +++ b/core/chat/tutor.go @@ -27,7 +27,7 @@ func init() { m.PushAction(web.SHOW, "view", "data").Action(web.PLAY) } } - m.Display("") + m.Display("").DisplayCSS("") }}, }) } diff --git a/core/chat/tutor.js b/core/chat/tutor.js index 7e2e04cd..677d4e5e 100644 --- a/core/chat/tutor.js +++ b/core/chat/tutor.js @@ -40,48 +40,27 @@ Volcanos(chat.ONACTION, { can.user.toastSuccess(can, "play done") }) }, - show: function(can, type, text, delay) { + show: function(can, type, text, delay) { var ls = text.split(",") switch (type) { - case "theme": - can._root.Header.onimport.theme(can._root.Header, text, {}) - break - case "storm": var ls = text.split(",") - can._root.River.onaction.action({}, can._root.River, ls[0], ls[1]) - break - case "index": - can.page.Select(can, document.body, "fieldset.panel.Header>div.output>div.Action>div._tabs>div.tabs."+text, function(target) { - target.click() - }) - break + case "theme": can._root.Header.onimport.theme(can._root.Header, text, {}); break + case "storm": can._root.River.onaction.action({}, can._root.River, ls[0], ls[1]); break + case "index": can.page.Select(can, document.body, "fieldset.panel.Header>div.output>div.Action>div._tabs>div.tabs."+text, function(target) { target.click() }); break case "click": + case "legend": + case "option": + case "action": + case "button": + case "status": can.page.Select(can, document.body, text, function(target) { var count = 5 can.core.Next(can.core.List(count), function(value, next, index) { can.page.ClassList.add(can, target, "picker") can.onmotion.delay(can, function() { can.page.ClassList.del(can, target, "picker"), can.onmotion.delay(can, function() { next() }, delay/5/4) }, delay/5/4) - }, function() { - target.click() - }) - }) - break - case "focus": var ls = text.split(",") - can.page.Select(can, document.body, ls[0], function(target) { - target.focus() - }) - break - case "blur": var ls = text.split(",") - can.page.Select(can, document.body, ls[0], function(target) { target.value = ls[1] - can.onmotion.delay(can, function() { target.blur() }, 300) - }) - break - case "item": var ls = text.split(",") - can.page.Select(can, document.body, ls[0], function(target) { - can.onmotion.delay(can, function() { target._can.sub.ui[ls[1]].click() }) - }) - break - case "remove": - can.page.Select(can, document.body, text, function(target) { - can.page.Remove(can, target) + }, function() { target.click() }) }) break + case "focus": can.page.Select(can, document.body, ls[0], function(target) { target.focus() }); break + case "blur": can.page.Select(can, document.body, ls[0], function(target) { target.value = ls[1], can.onmotion.delay(can, function() { target.blur() }, 300) }); break + case "item": can.page.Select(can, document.body, ls[0], function(target) { can.onmotion.delay(can, function() { target._can.sub.ui[ls[1]].click() }) }); break + case "remove": can.page.Select(can, document.body, text, function(target) { can.page.Remove(can, target) }); break } }, view: function(can, type, text, delay) { diff --git a/core/code/compile.go b/core/code/compile.go index a17e26cc..27196713 100644 --- a/core/code/compile.go +++ b/core/code/compile.go @@ -1,6 +1,7 @@ package code import ( + "os" "path" "runtime" "strings" @@ -118,7 +119,11 @@ func init() { m.Options(cli.CMD_ENV, env).Cmd(AUTOGEN, VERSION) _compile_get(m, main) defer m.StatusTime(VERSION, strings.TrimPrefix(GoVersion(m), "go version")) - if msg := GoBuild(m.Spawn(), file, main, ice.SRC_VERSION_GO, ice.SRC_BINPACK_GO, ice.SRC_BINPACK_USR_GO); !cli.IsSuccess(msg) { + args := []string{main, ice.SRC_VERSION_GO, ice.SRC_BINPACK_GO, ice.SRC_BINPACK_USR_GO} + if _, e := os.Stat("src/option.go"); e == nil { + args = append(args, "src/option.go") + } + if msg := GoBuild(m.Spawn(), file, args...); !cli.IsSuccess(msg) { m.Copy(msg) } else { m.Logs(nfs.SAVE, nfs.TARGET, file, nfs.SOURCE, main) diff --git a/render.go b/render.go index 5af332ba..61d6d11a 100644 --- a/render.go +++ b/render.go @@ -257,6 +257,11 @@ func (m *Message) Display(file string, arg ...Any) *Message { m.Option(MSG_DISPLAY, kit.MergeURL(kit.ExtChange(m.resource(file), JS), arg...)) return m } +func (m *Message) DisplayCSS(file string, arg ...Any) *Message { + m.Option(MSG_DISPLAY_CSS, kit.MergeURL(path.Join(path.Dir(m.Option(MSG_DISPLAY)), kit.Select(m.CommandKey()+".css", file)), + "render", "replace", INDEX, m.PrefixKey(), POD, m.Option(MSG_USERPOD))) + return m +} func (m *Message) Resource(file string, arg ...string) string { if len(arg) > 0 && arg[0] != "" { if strings.HasPrefix(file, HTTP) {