shrub/mar/urb.hoon
Anton Dyudin 8504d823c6 moved ~/on/<dep>.js injection to mar/urb
The script itself remains in eyre, for usage by error messages.
2016-02-09 17:09:33 -08:00

37 lines
1.2 KiB
Plaintext

::
:::: /hoon/urb/mar
::
/? 314
!:
|_ [dep=@uvH own=manx]
::
++ etag-js
'''
urb.waspAll = function(sel){
Array.prototype.map.call(document.querySelectorAll(sel), urb.waspElem)
}
if(urb.wasp){urb.waspAll('script'); urb.waspAll('link')}
'''
++ grow :: convert to
|%
++ mime [/text/html (taco html)] :: convert to %mime
++ html (crip (poxo hymn)) :: convert to %html
++ hymn :: inject dependencies
^- manx
=+ ^= max :: XX types
~| [%malformed-urb own]
?> ?=([[%html ~] [[%head ~] *] [[%body ~] *] ~] own)
`[[%html ~] [[%head ~] hed=marl] [[%body ~] tal=marl] ~]`own
::
=: hed.max :_(hed.max ;meta(charset "utf-8", urb_injected "");)
tal.max (welp tal.max ;script(urb_injected ""):"{(trip etag-js)}" ~)
==
?~ dep max
max(hed :_(hed.max ;script@"/~/on/{<dep>}.js"(urb_injected "");))
--
++ grab
|% :: convert from
++ noun ,[@uvH manx] :: clam from %noun
--
--