mirror of
https://github.com/urbit/shrub.git
synced 2024-12-02 08:55:07 +03:00
load dependency tracking at end of body, after a delay
This commit is contained in:
parent
0b08848dbc
commit
998b7baca6
23
mar/urb.hoon
23
mar/urb.hoon
@ -10,7 +10,8 @@
|
||||
urb.waspAll = function(sel){
|
||||
[].map.call(document.querySelectorAll(sel), urb.waspElem)
|
||||
}
|
||||
if(urb.wasp){urb.waspAll('script'); urb.waspAll('link')}
|
||||
urb.waspAll('script'); urb.waspAll('link')
|
||||
|
||||
'''
|
||||
++ grow :: convert to
|
||||
|%
|
||||
@ -21,18 +22,22 @@
|
||||
;html
|
||||
;head
|
||||
;meta(charset "utf-8", urb_injected "");
|
||||
;* ?~ dep ~
|
||||
:~ ;script@"/~/on/{<dep>}.js"(urb_injected "");
|
||||
;script(urb_injected "")
|
||||
;- (trip urb-wasp-data-js)
|
||||
;- "urb.waspData({(pojo %s (scot %uv dep-bod))})"
|
||||
==
|
||||
==
|
||||
;* hed
|
||||
==
|
||||
;body
|
||||
;* bod
|
||||
;script(urb_injected ""):"{(trip linked-deps-js)}"
|
||||
;* ?~ dep ~
|
||||
:~ ;script@"/~/on/{<dep>}.js"(urb_injected "", async "", onload "setTimeout(urb.onDep,2000)");
|
||||
;script(urb_injected "")
|
||||
;- (trip urb-wasp-data-js)
|
||||
; window.urb = window.urb || \{}
|
||||
; urb.onDep = function()\{
|
||||
; urb.waspDeps();
|
||||
; urb.waspData({(pojo %s (scot %uv dep-bod))});
|
||||
;- (trip linked-deps-js)
|
||||
; }
|
||||
==
|
||||
==
|
||||
==
|
||||
==
|
||||
--
|
||||
|
@ -1,7 +1,10 @@
|
||||
// debugging
|
||||
urb.verb = false
|
||||
urb.sources = {}
|
||||
urb.deps.map(function(a){urb.sources[a] = "dep"})
|
||||
|
||||
urb.waspDeps = function(){
|
||||
urb.deps.map(function(a){urb.sources[a] = "dep"})
|
||||
}
|
||||
|
||||
urb.waspElem = function(ele){
|
||||
url = ele.src || ele.href
|
||||
|
Loading…
Reference in New Issue
Block a user