diff --git a/mar/urb.hoon b/mar/urb.hoon index 602f3bed2f..f5bb65b2e5 100644 --- a/mar/urb.hoon +++ b/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/{}.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/{}.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) + ; } + == + == == == -- diff --git a/mar/urb/wasp-data.js b/mar/urb/wasp-data.js index b630f80080..5ff8f8bccf 100644 --- a/mar/urb/wasp-data.js +++ b/mar/urb/wasp-data.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