mirror of
https://github.com/urbit/shrub.git
synced 2024-12-03 05:43:18 +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){
|
urb.waspAll = function(sel){
|
||||||
[].map.call(document.querySelectorAll(sel), urb.waspElem)
|
[].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
|
++ grow :: convert to
|
||||||
|%
|
|%
|
||||||
@ -21,18 +22,22 @@
|
|||||||
;html
|
;html
|
||||||
;head
|
;head
|
||||||
;meta(charset "utf-8", urb_injected "");
|
;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
|
;* hed
|
||||||
==
|
==
|
||||||
;body
|
;body
|
||||||
;* bod
|
;* 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
|
// debugging
|
||||||
urb.verb = false
|
urb.verb = false
|
||||||
urb.sources = {}
|
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){
|
urb.waspElem = function(ele){
|
||||||
url = ele.src || ele.href
|
url = ele.src || ele.href
|
||||||
|
Loading…
Reference in New Issue
Block a user