mirror of
https://github.com/urbit/shrub.git
synced 2024-12-14 11:08:45 +03:00
Merge branch 'test' of github.com:urbit/urbit into test
This commit is contained in:
commit
c6caabae4c
@ -184,9 +184,11 @@
|
||||
hit(q (weld cuh q.hit))
|
||||
::
|
||||
++ add-poll :: inject dependency
|
||||
|= [dep=@uvH max=[[%html ~] [[%head ~] hed=marl] [[%body ~] manx marl] ~]]
|
||||
|= [dep=@uvH max=[[%html ~] [[%head ~] hed=marl] [[%body ~] tal=marl] ~]]
|
||||
^- manx
|
||||
=. hed.max :_(hed.max ;meta(charset "utf-8", urb_injected "");)
|
||||
=: 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 "");))
|
||||
::
|
||||
@ -293,6 +295,28 @@
|
||||
function(){document.getElementById("c").innerHTML = "<p>Goodbye.</p>" }
|
||||
)}
|
||||
'''
|
||||
++ etag
|
||||
'''
|
||||
if(!window.urb) window.urb = {}
|
||||
urb.fetchTag = function(){
|
||||
var tag = JSON.parse(this.getResponseHeader("etag"))
|
||||
if(tag) urb.wasp(tag)
|
||||
}
|
||||
urb.headReq = function(url){
|
||||
var xhr = new XMLHttpRequest()
|
||||
xhr.open("HEAD", url)
|
||||
xhr.onload = urb.fetchTag
|
||||
xhr.send()
|
||||
}
|
||||
Array.prototype.map.call(document.querySelectorAll('script'), function(ele){
|
||||
if((new URL(ele.src)).host == document.location.host)
|
||||
urb.headReq(ele.src)
|
||||
})
|
||||
Array.prototype.map.call(document.querySelectorAll('link'), function(ele){
|
||||
if((new URL(ele.href)).host == document.location.host)
|
||||
urb.headReq(ele.href)
|
||||
})
|
||||
'''
|
||||
--
|
||||
++ xml
|
||||
|%
|
||||
@ -418,7 +442,7 @@
|
||||
=. p.p.pul |(p.p.pul ?=(hoke r.p.pul))
|
||||
=+ her=(host-to-ship r.p.pul)
|
||||
?: |(?=(~ her) =(our u.her))
|
||||
(handle pul [q.+.kyz anon] [p.heq maf s.heq])
|
||||
(handle pul [q.+.kyz |] [p.heq maf s.heq])
|
||||
=+ han=(sham hen)
|
||||
=. pox (~(put by pox) han hen)
|
||||
(ames-gram u.her [%get ~] han +.kyz)
|
||||
@ -615,7 +639,7 @@
|
||||
(~(has in aut.u.cyz) our)
|
||||
::
|
||||
++ ses-ya |=(ses=hole ~(. ya ses (~(got by wup) ses)))
|
||||
++ our-host `hart`[& ~ `/com/urbit/(rsh 3 1 (scot %p our))]
|
||||
++ our-host `hart`[& ~ `/org/urbit/(rsh 3 1 (scot %p our))]
|
||||
:: [| [~ 8.445] `/localhost] :: XX testing
|
||||
::
|
||||
++ ames-gram
|
||||
@ -623,7 +647,8 @@
|
||||
::
|
||||
++ back :: %ford bounce
|
||||
|= [tea=whir dep=@uvH mar=mark cay=cage]
|
||||
(pass-note tea (ford-req root-beak [%cast mar %done ~ cay])) :: XX deps
|
||||
=+ sil=`silk`[%cast mar %flag dep %done ~ cay]
|
||||
(pass-note tea (ford-req root-beak sil))
|
||||
::
|
||||
++ ford-kill (pass-note ~ %f [%exec our *beak ~]) :: XX unused
|
||||
++ ford-req |=([bek=beak kas=silk] [%f [%exec our bek `kas]])
|
||||
@ -659,8 +684,8 @@
|
||||
++ host-to-ship :: host to ship
|
||||
|= hot=host
|
||||
^- (unit ship)
|
||||
=+ gow=(~(get by dop) hot)
|
||||
?^ gow gow
|
||||
:: =+ gow=(~(get by dop) hot) :: XX trust
|
||||
:: ?^ gow gow
|
||||
?. ?=(& -.hot) ~
|
||||
=+ dom=(flop p.hot) :: domain name
|
||||
?~ dom ~
|
||||
@ -675,7 +700,7 @@
|
||||
::
|
||||
++ handle
|
||||
|= $: [hat=hart pok=pork quy=quay] :: purl, parsed url
|
||||
[cip=clip him=ship] :: client ip, ship
|
||||
[cip=clip aut=?] :: client ip, nonymous?
|
||||
[mef=meth maf=math bod=(unit octs)] :: method/headers/body
|
||||
==
|
||||
=< apex
|
||||
@ -691,7 +716,9 @@
|
||||
::
|
||||
++ ford-get-beam
|
||||
|= [bem=beam ext=term]
|
||||
=: s.bem [%web ~(rent co (fcgi quy fcgi-cred:for-client)) s.bem]
|
||||
=+ yac=for-client
|
||||
=. him.yac ?.(aut anon him.yac)
|
||||
=: s.bem [%web ~(rent co (fcgi quy fcgi-cred.yac)) s.bem]
|
||||
r.bem ?+(r.bem r.bem [%ud %0] da/now)
|
||||
==
|
||||
(ford-req -.bem [%boil ext bem ~])
|
||||
@ -914,7 +941,8 @@
|
||||
=+ ext=(fall p.pok %urb)
|
||||
=+ bem=?-(-.hem %beam p.hem, %spur [root-beak p.hem])
|
||||
=+ wir=?+(mef !! %get ~, %head [%he ~])
|
||||
[%& %| wir (ford-get-beam bem ext)]
|
||||
=- ?.(aut [%& %| -] [%| (pass-note -)]) :: XX properly
|
||||
[wir (ford-get-beam bem ext)]
|
||||
::
|
||||
%bugs
|
||||
?- p.hem
|
||||
@ -992,7 +1020,10 @@
|
||||
%get
|
||||
~| aute/ham
|
||||
?: |(=(anon him.ham) (~(has in aut.yac) him.ham))
|
||||
process(him him.ham, pok rem.ham)
|
||||
=. ..ya abet.yac(him him.ham)
|
||||
=+ pez=process(pok rem.ham, aut &)
|
||||
?: ?=(%| -.pez) pez
|
||||
[%| (resolve ~ p.pez)]
|
||||
?. =(our him.ham)
|
||||
[%| ((teba foreign-auth.yac) him.ham hat rem.ham quy)]
|
||||
(show-login-page ~)
|
||||
@ -1033,7 +1064,7 @@
|
||||
?~ cyz
|
||||
~& bad-cookie/u.lig
|
||||
(new-ya (rsh 3 1 (scot %p (end 6 1 ney))))
|
||||
~(. ya u.lig u.cyz(him him, cug ~))
|
||||
~(. ya u.lig u.cyz(cug ~))
|
||||
::
|
||||
++ new-ya |=(ses=hole ~(. ya ses (new-cyst ses)))
|
||||
++ new-cyst
|
||||
@ -1166,7 +1197,6 @@
|
||||
::
|
||||
++ del-subs :: XX per path?
|
||||
|= [a=dock %json b=wire c=path] ^+ ..ix
|
||||
~& [%eyre-del-subs +< hen]
|
||||
=. ..ix (hurl-note [a b] [%g %deal [him -.a] +.a %pull ~])
|
||||
(nice-json:pop-duct:(ire-ix ire)) :: XX gall ack
|
||||
::
|
||||
|
@ -1111,9 +1111,17 @@
|
||||
$(kas [%done p.kas u.q.kas])
|
||||
::
|
||||
%file
|
||||
|
||||
%+ cool |.(leaf/"ford: file {<p.kas>}")
|
||||
(lear cof p.kas)
|
||||
::
|
||||
%flag
|
||||
?~ p.kas $(kas q.kas)
|
||||
=+ dap=(~(get by deh.bay) p.kas)
|
||||
?~ dap ~&(flag-missed/p.kas $(kas q.kas))
|
||||
=+ dep=?-(-.u.dap %init p.u.dap, %sent q.u.dap, %done [[bek ~] ~ ~])
|
||||
=+ rez=$(kas q.kas) :: XX revisit ^ during dependency review
|
||||
?: ?=(%1 -.q.rez) rez
|
||||
rez(p.q (~(uni in p.q.rez) `(set beam)`dep))
|
||||
::
|
||||
%join
|
||||
%+ cool
|
||||
|
@ -2475,6 +2475,7 @@
|
||||
[%dude p=tank q=silk] :: error wrap
|
||||
[%dune p=(set beam) q=(unit gage)] :: unit literal
|
||||
[%file p=beam] :: from clay
|
||||
[%flag p=@uvH q=silk] :: re-apply user deps
|
||||
[%join p=mark q=silk r=silk] :: merge
|
||||
[%mash p=mark q=milk r=milk] :: annotate
|
||||
[%mute p=silk q=(list (pair wing silk))] :: mutant
|
||||
|
@ -52,6 +52,17 @@ window.urb.req = function(method,url,params,json,cb) {
|
||||
xhr.send(JSON.stringify(_data))
|
||||
}
|
||||
|
||||
// window.urb.getJSON = function(url,cb){ window.urb.reqJSON("GET",url, null, cb)}
|
||||
// window.urb.reqJSON = function(method, url, data, cb){
|
||||
// var xhr = new XMLHttpRequest()
|
||||
// xhr.open(method, url)
|
||||
// xhr.onload = function(){
|
||||
// urb.fetchTag.call(xhr)
|
||||
// if(cb) cb(JSON.parse(xhr.responseText))
|
||||
// }
|
||||
// xhr.send(data === null ? null : JSON.stringify(data))
|
||||
// }
|
||||
|
||||
window.urb.reqq = []
|
||||
window.urb.qreq = function(method,url,params,json,cb) {
|
||||
walk = function() {
|
||||
|
@ -7,7 +7,7 @@
|
||||
;head
|
||||
;meta(charset "utf-8");
|
||||
;script(type "text/javascript", src "//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.js");
|
||||
;script(type "text/javascript", src "/~~/~/at/base/lib/urb.js");
|
||||
;script(type "text/javascript", src "/~/at/base/lib/urb.js");
|
||||
;link(type "text/css", rel "stylesheet", href "/home/pub/octo/src/main.css");
|
||||
;title: urbit cit cat eot
|
||||
==
|
||||
|
@ -37,23 +37,23 @@
|
||||
.spac[data-index="0-0"],
|
||||
.spac[data-index="1-0"],
|
||||
.spac[data-index="2-0"] {
|
||||
border-top: 0;
|
||||
border-left: 0;
|
||||
}
|
||||
|
||||
.spac[data-index="0-0"],
|
||||
.spac[data-index="0-1"],
|
||||
.spac[data-index="0-2"] {
|
||||
border-left: 0;
|
||||
border-top: 0;
|
||||
}
|
||||
|
||||
.spac[data-index="2-0"],
|
||||
.spac[data-index="2-1"],
|
||||
.spac[data-index="2-2"] {
|
||||
border-right: 0;
|
||||
border-bottom: 0;
|
||||
}
|
||||
|
||||
.spac[data-index="0-2"],
|
||||
.spac[data-index="1-2"],
|
||||
.spac[data-index="2-2"] {
|
||||
border-bottom: 0;
|
||||
border-right: 0;
|
||||
}
|
@ -4,15 +4,16 @@ $(function() {
|
||||
|
||||
symb = [" ","✕","◯"]
|
||||
draw = function(state) {
|
||||
space = function(_state,x,y) {
|
||||
return "<div class='spac' data-index='"+x+"-"+y+
|
||||
space = function(_state,y,x) {
|
||||
return "<div class='spac' data-index='"+y+"-"+x+
|
||||
"'>"+symb[_state]+"</div>"
|
||||
}
|
||||
s = ""
|
||||
x = 0
|
||||
y = 0
|
||||
for(i=0;i<9;i++) {
|
||||
s += space((state.box[i] ? 1 : 0)+(state.boo[i] ? 2 : 0),x,y)
|
||||
j = [0,3,6,1,4,7,2,5,8][i] // XX math
|
||||
s += space((state.box[j] ? 1 : 0)+(state.boo[j] ? 2 : 0),y,x)
|
||||
x++
|
||||
if((i+1)%3 == 0) {
|
||||
y++
|
||||
|
Loading…
Reference in New Issue
Block a user