mirror of
https://github.com/urbit/shrub.git
synced 2024-09-11 20:27:19 +03:00
fix con/hoon-htmx
This commit is contained in:
parent
c353ab69ca
commit
7acd7896e7
@ -45,6 +45,7 @@
|
||||
%iframe
|
||||
%task
|
||||
%txt
|
||||
%hoon
|
||||
%sail
|
||||
%slideshow
|
||||
==
|
||||
|
@ -4,7 +4,9 @@
|
||||
|= =bowl:neo
|
||||
=/ =name:neo
|
||||
[our here]:bowl
|
||||
=/ =file:ford:neo
|
||||
=/ fool=(each file:ford:neo tang)
|
||||
%- mule
|
||||
|.
|
||||
(scan (trip hon) (rein:ford:neo name))
|
||||
=/ src=wain
|
||||
(to-wain:format hon)
|
||||
@ -23,15 +25,21 @@
|
||||
::
|
||||
++ apex
|
||||
^- manx
|
||||
;div.wf.hf.p3.hoon.fc.g2
|
||||
;div.wf.hf.hoon.fc
|
||||
;+ imports
|
||||
;+ contents
|
||||
;+ style
|
||||
;+ script
|
||||
==
|
||||
++ imports
|
||||
;div.frw.g2
|
||||
;div.frw.g2.p2
|
||||
;*
|
||||
%+ turn pro.file
|
||||
?- -.fool
|
||||
%.n
|
||||
:_ ~
|
||||
(error p.fool)
|
||||
::
|
||||
%.y
|
||||
%+ turn pro.p.fool
|
||||
|= =pro:ford:neo
|
||||
^- manx
|
||||
;a.p2.br1.b1.hover.s-1
|
||||
@ -41,20 +49,24 @@
|
||||
; {<stud.pro>}
|
||||
==
|
||||
==
|
||||
==
|
||||
++ error
|
||||
;details.error-parent.wf.br1.bd1(open "")
|
||||
|= =tang
|
||||
=/ =wall (zing (turn tang |=(t=tank (~(win re t) [0 80]))))
|
||||
=/ =tape (zing (join "\0a" wall))
|
||||
;details.wf.br1.bd1(open "")
|
||||
=style "max-height: 220px;"
|
||||
;summary.p2.br1.b-3.f-3: error
|
||||
;div.p3
|
||||
;div.error.empty;
|
||||
;summary.p2.br1.b-3.f0: error
|
||||
;div.pre.mono.p2.wf.scroll-y
|
||||
;+ ;/ tape
|
||||
==
|
||||
==
|
||||
++ contents
|
||||
;form.fc.g2.wf.relative.grow.scroll-y
|
||||
=style "border-top: 1px solid var(--b3);"
|
||||
=hx-put "{(en-tape:pith:neo (welp /neo/hawk here.bowl))}?stud=hoon"
|
||||
=hx-trigger "click from:find button, keydown[metaKey&&key=='Enter']"
|
||||
=hx-target "closest .hoon"
|
||||
=hx-target-error "find .error"
|
||||
=hx-swap "morph"
|
||||
;div.relative.grow.fc
|
||||
;div.wfc.z1.absolute
|
||||
@ -67,13 +79,22 @@
|
||||
;span.loading: ...
|
||||
==
|
||||
==
|
||||
;textarea.p2.bd1.br1.scroll-x.pre.mono.wf.grow
|
||||
=style "outline:none;"
|
||||
;div.fr.grow
|
||||
;div.hf.f3.numbered
|
||||
=style "min-width: 10px; padding: 8px 5px; border-right: 1px solid var(--b3);"
|
||||
;*
|
||||
%+ turn (gulf 1 (lent src))
|
||||
|= n=@
|
||||
;div.mono(style "line-height: 1.1;");
|
||||
==
|
||||
;textarea.p2.pre.mono.wf.grow
|
||||
=id "bingo-bango"
|
||||
=style "outline:none; line-height: 1.1; overflow-y: hidden;"
|
||||
=autocomplete "off"
|
||||
=rows "1"
|
||||
=spellcheck "false"
|
||||
=name "text"
|
||||
=oninput "this.setAttribute('value', this.value);"
|
||||
=oninput "this.setAttribute('value', this.value); skyHoonRenumber(this);"
|
||||
=value (trip hon)
|
||||
;*
|
||||
%+ turn src
|
||||
@ -81,14 +102,28 @@
|
||||
;/ "{(trip lin)}\0a"
|
||||
==
|
||||
==
|
||||
;+ error
|
||||
==
|
||||
++ style
|
||||
;style
|
||||
==
|
||||
++ script
|
||||
;script
|
||||
;+ ;/ %- trip
|
||||
'''
|
||||
details.error-parent:has(.error:empty) {
|
||||
display: none;
|
||||
function skyHoonRenumber(el) {
|
||||
// corrects the line numbers
|
||||
let lines = 1 + el.value.split('\n').length;
|
||||
let nums = $(el).parent().find('.numbered').get()[0];
|
||||
let kids = nums.children.length + 1;
|
||||
while (kids < lines) {
|
||||
let div = document.createElement('div');
|
||||
div.classList.add('mono');
|
||||
div.style = 'line-height: 1.1;';
|
||||
nums.appendChild(div);
|
||||
kids = kids + 1;
|
||||
}
|
||||
while (kids > lines) {
|
||||
nums.children[0].remove();
|
||||
kids = kids - 1;
|
||||
}
|
||||
}
|
||||
'''
|
||||
==
|
||||
|
@ -622,11 +622,11 @@ button {
|
||||
.numbered > *:before {
|
||||
content: counter(line);
|
||||
display: inline-block;
|
||||
border-right: 1px solid var(--f3);
|
||||
padding: 0 .5em;
|
||||
margin-right: .5em;
|
||||
/* border-right: 1px solid var(--f3); */
|
||||
/* padding: 0 .5em; */
|
||||
/* margin-right: .5em; */
|
||||
color: var(--f3);
|
||||
min-width: 34px;
|
||||
/* min-width: 34px; */
|
||||
text-align: right;
|
||||
}
|
||||
.numbered > * {
|
||||
|
@ -1,5 +1,6 @@
|
||||
/@ folder
|
||||
/@ folder-diff
|
||||
/@ tracer
|
||||
=>
|
||||
|%
|
||||
++ default-pails
|
||||
@ -7,6 +8,7 @@
|
||||
^- (list [stud:neo pail:neo])
|
||||
:~
|
||||
[%iframe iframe/!>('')]
|
||||
[%hoon hoon/!>('~')]
|
||||
[%txt txt/!>('')]
|
||||
==
|
||||
--
|
||||
|
@ -179,6 +179,72 @@
|
||||
manx
|
||||
==
|
||||
==
|
||||
::
|
||||
%'PUT'
|
||||
=/ purl (parse-url:serv request.req)
|
||||
=/ content-type (~(gut by pam.purl) 'content-type' 'text/html')
|
||||
~& content-type
|
||||
=/ body (parse-body:serv request.req)
|
||||
=/ poke-stud
|
||||
^- stud:neo
|
||||
~| %no-stud-specified
|
||||
(~(got by pam.purl) 'stud')
|
||||
=/ mul
|
||||
%- mule
|
||||
|.
|
||||
?: =(content-type 'application/x-www-form-urlencoded')
|
||||
~& poke-stud
|
||||
=/ fine (http-request [poke-stud `request:http`request.req])
|
||||
fine
|
||||
(node [poke-stud body])
|
||||
?- -.mul
|
||||
%.n
|
||||
%: eyre-cards
|
||||
eyre-id
|
||||
bowl
|
||||
500
|
||||
:~
|
||||
['content-type' 'text/html']
|
||||
['HX-Reswap' 'outerHTML']
|
||||
==
|
||||
;div.b0.p-page.wf.hf.fc.g2.as
|
||||
;a.p2.br1.bd1.b1.hover.loader.block
|
||||
=href "/neo/hawk{(spud pax.purl)}"
|
||||
;span.loaded: reload
|
||||
;span.loading
|
||||
;+ loading.feather-icons
|
||||
==
|
||||
==
|
||||
;+ (print-tang (tang p.mul))
|
||||
==
|
||||
==
|
||||
::
|
||||
%.y
|
||||
=/ =pail:neo [poke-stud p.mul]
|
||||
=/ bol *bowl:neo
|
||||
=. here.bol here
|
||||
=. our.bol our.bowl
|
||||
=. now.bol now.bowl
|
||||
=. eny.bol eny.bowl
|
||||
=/ =manx
|
||||
?~ converter=(mole |.((htmx pail)))
|
||||
(default-refresher here)
|
||||
=/ mul
|
||||
%- mule
|
||||
|.((u.converter bol))
|
||||
?- -.mul
|
||||
%.y p.mul
|
||||
%.n ;div: error
|
||||
==
|
||||
:- [here %make poke-stud `pail ~]
|
||||
%: eyre-cards
|
||||
eyre-id
|
||||
bowl
|
||||
200
|
||||
['content-type' 'text/html']~
|
||||
manx
|
||||
==
|
||||
==
|
||||
==
|
||||
--
|
||||
--
|
||||
|
Loading…
Reference in New Issue
Block a user