load dependency tracking at end of body, after a delay

This commit is contained in:
Anton Dyudin 2016-05-03 13:52:44 -07:00
parent 0b08848dbc
commit 998b7baca6
2 changed files with 18 additions and 10 deletions

View File

@ -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)
; }
==
==
== ==
== ==
-- --

View File

@ -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