Merge branch 'dillbo' of https://github.com/urbit/urbit into dillbo

This commit is contained in:
Anton Dyudin 2015-04-07 16:07:35 -07:00
commit f2efac054b
20 changed files with 213 additions and 212 deletions

View File

@ -36,6 +36,7 @@
[%di p=dojo-model] :: dialog
[%dv p=path] :: gate from source
[%fi p=dojo-filter q=dojo-source] :: filter
[%ge p=dojo-model] :: generator
[%sc p=dojo-model] :: script
[%tu p=(list dojo-source)] :: tuple
[%va p=term] :: dojo variable
@ -157,19 +158,33 @@
%+ knee *dojo-command |. ~+
;~ pose
%+ stag %poke
;~ pfix bar
;~ pfix col
%+ cook
|= [a=goal b=(each dojo-source (pair path dojo-config))]
|= [a=goal b=(each dojo-source (trel term path dojo-config))]
^- (pair goal dojo-source)
:- a
?- -.b
%& [a p.b]
%| [a [0 %di [0 [%gun q.a p.p.b]] q.p.b]]
%& p.b
%| ?+ p.p.b !!
%di [0 %di [0 [%dog q.a q.p.b]] r.p.b]
%ge [0 %ge [0 [%cat q.a q.p.b]] r.p.b]
%sc [0 %sc [0 [%pig q.a q.p.b]] r.p.b]
==
==
;~ plug
dp-goal
;~ pose
(stag %& ;~(pfix ace dp-source))
(stag %| ;~(plug (plus ;~(pfix fas sym)) dp-config))
%+ stag %|
;~ plug
;~ pose
(cold %di wut)
(cold %ge lus)
(cold %sc pam)
==
(most fas sym)
dp-config
==
==
==
==
@ -185,7 +200,7 @@
==
::
%+ stag %pill
;~ pfix lus
;~ pfix dot
;~(plug (most fas sym) ;~(pfix ace dp-source))
==
::
@ -195,8 +210,9 @@
++ dp-build :: ++dojo-build
%+ knee *dojo-build |. ~+
;~ pose
;~(pfix wut (stag %di dp-model-gun))
;~(pfix pam (stag %sc dp-model-sic))
;~(pfix lus (stag %ge dp-model-cat))
;~(pfix wut (stag %di dp-model-dog))
;~(pfix pam (stag %sc dp-model-pig))
;~(pfix buc (stag %va sym))
(stag %ex dp-twig)
(ifix [sel ser] (stag %tu (most ace dp-source)))
@ -211,10 +227,12 @@
==
(cook |=(a=term `goal`[our.hid a]) sym)
==
++ dp-model-gun ;~(plug dp-server-gun dp-config) :: ++dojo-model
++ dp-model-sic ;~(plug dp-server-sic dp-config) :: ++dojo-model
++ dp-server-gun (stag 0 (stag %gun dp-device)) :: ++dojo-server
++ dp-server-sic (stag 0 (stag %sic dp-device)) :: ++dojo-server
++ dp-model-cat ;~(plug dp-server-cat dp-config) :: ++dojo-model
++ dp-model-dog ;~(plug dp-server-dog dp-config) :: ++dojo-model
++ dp-model-pig ;~(plug dp-server-pig dp-config) :: ++dojo-model
++ dp-server-cat (stag 0 (stag %cat dp-device)) :: ++dojo-server
++ dp-server-dog (stag 0 (stag %dog dp-device)) :: ++dojo-server
++ dp-server-pig (stag 0 (stag %pig dp-device)) :: ++dojo-server
++ dp-twig wide:(vang & ~) :: ++twig
++ dp-device (most fas sym) :: ++dojo-device
++ dp-value :: ++dojo-source
@ -309,6 +327,7 @@
%di =^(mod +>.$ (dy-init-model p.bul) [[%di mod] +>.$])
%dv [bul +>.$]
%fi !!
%ge =^(mod +>.$ (dy-init-model p.bul) [[%ge mod] +>.$])
%sc !!
%tu =^ dof +>.$
|- ^+ [p.bul +>.^$]
@ -462,7 +481,7 @@
?~(b !>([~ ~]) (dy-vase p.u.b))
==
::
++ dy-silk-init-dial :: init and config
++ dy-silk-init-modo :: init and config
|= [cag=cage cig=dojo-config]
^- silk
(dy-silk-config cag cig)
@ -494,13 +513,18 @@
[%pro pom(cad [':' ' ' cad.pom])]
==
::
++ dy-made-gent :: generator product
|= cag=cage
(dy-meal q.cag)
::
++ dy-make :: build step
^+ +>
?> ?=(^ cud)
%- dy-ford
^- (pair path silk)
?+ -.q.u.cud !!
%di [/dial (dy-silk-init-dial (dy-cage p.p.p.q.u.cud) q.p.q.u.cud)]
%di [/dial (dy-silk-init-modo (dy-cage p.p.p.q.u.cud) q.p.q.u.cud)]
%ge [/gent (dy-silk-init-modo (dy-cage p.p.p.q.u.cud) q.p.q.u.cud)]
%dv [/hand (dy-silk-device p.q.u.cud)]
%ex [/hand [%ride p.q.u.cud [%reef ~]]]
%tu :- /hand
@ -593,6 +617,7 @@
?+ pax !!
[%hand ~] dy-hand:dye
[%dial ~] dy-made-dial:dye
[%gent ~] dy-made-gent:dye
[%edit ~] dy-made-edit:dye
==
%| ~& [%he-made-fail pax]

View File

@ -739,8 +739,8 @@
(fix inx '?' lit)
?: &((gte i.buf 'A') (lte i.buf 'Z'))
(fix inx (add 32 i.buf) lit)
?: &(=('/' i.buf) ?=([47 *] t.buf))
(fix inx '\\' lit)
:: ?: &(=('/' i.buf) ?=([47 *] t.buf))
:: (fix inx '\\' lit)
lit
::
++ sh-sane-rule :: sanitize by rule
@ -1085,7 +1085,6 @@
++ ra-cancel :: drop a bone
^+ .
=+ hep=(~(get by sup.hid) ost)
~& [%ra-cancel hep]
?~ hep +
?. ?=([@ @ *] q.u.hep)
+(general (~(del in general) ost))
@ -1142,8 +1141,27 @@
?~ tiz +>
$(tiz t.tiz, +> (ra-consume pub her i.tiz))
::
++ ra-normal :: normalize
|= tip=thought
^- thought
?. ?=([%lin *] r.r.tip) tip
%_ tip
q.r.r
%- crip
%+ scag 62
%- tufa
%+ turn (tuba (trip q.r.r.tip))
|= a=@c
?: &((gte a 'A') (lte a 'Z'))
(add a 32)
?: |((lth a 32) (gth a 126))
`@`'?'
a
==
::
++ ra-consume :: consume thought
|= [pub=? her=ship tip=thought]
=. tip (ra-normal tip)
=+ aud=(~(tap by q.tip) ~)
|- ^+ +>.^$
?~ aud +>.^$

10
main/cat/hello/gate.hook Normal file
View File

@ -0,0 +1,10 @@
::
:::: /hook/gate/hello/cat
::
/? 314
::
::::
!:
|= [* [[txt=@tas ~] ~]]
:- %noun
(crip (weld "hello, " (flop (trip txt))))

Binary file not shown.

View File

@ -0,0 +1,12 @@
::
:::: /hook/gate/reload/helm/cat
::
/? 314
::
::::
!:
|= $: [now=@da eny=@uvI bec=beak]
[arg=(list term) ~]
==
:- %helm-reload
arg

View File

@ -1,13 +1,12 @@
::
:::: /hook/gate/ticket/gun
:::: /hook/gate/ticket/cat
::
/? 314
/- *sole
::
::::
!:
|= $: [now=@da eny=@uvI bec=beak]
[[her=@p ~] ~]
==
%+ sole-so %noun
:- %noun
((hard ,@p) .^(/a/(scot %p p.bec)/tick/(scot %da now)/(scot %p her)))

View File

@ -1,142 +0,0 @@
::
:::: /hook/core/console/lib
::
:: This file is in the public domain.
::
/? 310
/- *console
!:
::::
::
|%
++ cs :: shared-state engine
|_ console-share
++ abet +<
++ apply
|= ted=console-edit
^+ +>
?- -.ted
%del +>.$(buf (weld (scag p.ted buf) (slag +(p.ted) buf)))
%ins +>.$(buf (weld (scag p.ted buf) `_buf`[q.ted (slag p.ted buf)]))
%mor |- ^+ +>.^$
?~ p.ted
+>.^$
$(p.ted t.p.ted, +>.^$ ^$(ted i.p.ted))
%nop +>.$
%set +>.$(buf p.ted)
==
::
::::
:: ++transmute: symmetric operational transformation.
::
:: for any console state +>, obeys
::
:: =+ [x=(transmute a b) y=(transmute b a)]
:: .= (apply:(apply b) x)
:: (apply:(apply a) y)
::
++ transmute :: dex as after sin
|= [sin=console-edit dex=console-edit]
^- console-edit
?: ?=(%mor -.sin)
|- ^- console-edit
?~ p.sin dex
$(p.sin t.p.sin, dex ^$(sin i.p.sin))
::
?: ?=(%mor -.dex)
:- %mor
|- ^- (list console-edit)
?~ p.dex ~
[^$(dex i.p.dex) $(p.dex t.p.dex)]
::
?: |(?=(%nop -.sin) ?=(%nop -.dex)) dex
?: ?=(%set -.sin) [%nop ~]
?: ?=(%set -.dex) dex
::
?- -.sin
%del
?- -.dex
%del ?: =(p.sin p.dex) [%nop ~]
?:((lth p.sin p.dex) dex(p (dec p.dex)) dex)
%ins ?:((lte p.sin p.dex) dex(p (dec p.dex)) dex)
==
::
%ins
?- -.dex
%del ?:((lte p.sin p.dex) dex(p +(p.dex)) dex)
%ins ?: =(p.sin p.dex)
?:((gth q.sin q.dex) dex dex(p +(p.dex)))
?:((lte p.sin p.dex) dex(p +(p.dex)) dex)
==
==
::
++ commit :: local change
|= ted=console-edit
^- console-share
abet:(apply(own.ven +(own.ven), leg [ted leg]) ted)
::
::::
:: ++inverse: inverse of change in context.
::
:: for any console state +>, obeys
::
:: =(+> (apply:(apply a) (inverse a)))
::
++ inverse :: relative inverse
|= ted=console-edit
^- console-edit
=. ted ?.(?=([%mor * ~] ted) ted i.p.ted)
?- -.ted
%del [%ins p.ted (snag p.ted buf)]
%ins [%del p.ted]
%mor :- %mor
%- flop
|- ^- (list console-edit)
?~ p.ted ~
:- ^$(ted i.p.ted)
$(p.ted t.p.ted, +>.^$ (apply i.p.ted))
%nop [%nop ~]
%set [%set buf]
==
::
++ receive :: naturalize event
|= console-change
^- [console-edit console-share]
?> &(=(his.ler his.ven) (lte own.ler own.ven))
?> &(=(his.ler his.ven) (lte own.ler own.ven))
?> |(!=(own.ler own.ven) =(haw (sham buf)))
=. leg (scag (sub own.ven own.ler) leg)
:: ~? !=(own.ler own.ven) [%miss-leg leg]
=+ dat=(transmute [%mor leg] ted)
:: ~? !=(~ leg) [%transmute from/ted to/dat ~]
[dat abet:(apply(his.ven +(his.ven)) dat)]
::
++ remit :: conditional accept
|= [cal=console-change ask=$+((list ,@c) ?)]
^- [(unit console-change) console-share]
=+ old=buf
=^ dat +>+<.$ (receive cal)
?: (ask buf)
[~ +>+<.$]
=^ lic +>+<.$ (transmit (inverse(buf old) dat))
[`lic +>+<.$]
::
++ transmit :: outgoing change
|= ted=console-edit
^- [console-change console-share]
[[[his.ven own.ven] (sham buf) ted] (commit ted)]
::
++ transceive :: receive and invert
|= console-change
^- [console-edit console-share]
=+ old=buf
=^ dat +>+<.$ (receive +<.$)
[(inverse(buf old) dat) +>+<.$]
::
++ transpose :: adjust position
|= pos=@ud
=+ dat=(transmute [%mor leg] [%ins pos `@c`0])
?> ?=(%ins -.dat)
p.dat
--
--

View File

@ -107,8 +107,13 @@ body {
.time {
font-size: 0.6rem;
letter-spacing: 0;
}
.time {
font-weight: 200;
}
#length {
font-weight: 500;
}
input.join,
.iden,
.audi,
@ -400,7 +405,7 @@ body {
outline: none;
overflow: hidden;
}
#audi.valid-false {
.valid-false {
color: #ff2f2f;
}
#scrolling {
@ -432,6 +437,17 @@ body {
}
}
@media only screen and (max-width: 1170px) {
#station-container.open {
max-height: 30rem;
height: auto;
-webkit-transition: max-height 0.2s;
}
#station-container.open #where .caret {
transform: rotate(90deg);
transform-origin: 0 50%;
-webkit-transform: rotate(90deg);
-webkit-transition: -webkit-transform 0.2s;
}
#c,
#station-container {
width: 96%;

View File

@ -29,8 +29,13 @@ body
.time
font-size .6rem
letter-spacing 0
.time
font-weight 200
#length
font-weight 500
input.join
.iden
.audi
@ -343,7 +348,7 @@ body
outline none
overflow hidden
#audi.valid-false
.valid-false
color #ff2f2f
//

View File

@ -13,6 +13,17 @@
/* laptops / small screens ----------- */
@media only screen and (max-width: 1170px)
#station-container.open
max-height 30rem
height auto
-webkit-transition max-height .2s
#station-container.open #where .caret
transform rotate(90deg)
transform-origin 0 50%
-webkit-transform rotate(90deg)
-webkit-transition -webkit-transform .2s
#c
#station-container
width 96%

View File

@ -23,11 +23,6 @@ module.exports = recl
valid:StationStore.getValidAudience()
s.audi = _.without s.audi, window.util.mainStationPath window.urb.user
s.ludi = _.without s.ludi, window.util.mainStationPath window.urb.user
console.log 'set'
console.log s.audi
console.log s.ludi
s
getInitialState: -> @stateFromStore()
@ -68,10 +63,16 @@ module.exports = recl
,0
return false
_writingKeyUp: (e) ->
txt = @$writing.text()
@$length.toggleClass('valid-false',(txt.length > 62))
_writingKeyDown: (e) ->
if e.keyCode is 13
txt = @$writing.text()
e.preventDefault()
@sendMessage()
if txt.length > 0 and txt.length < 63
@sendMessage()
return false
@_input()
@set()
@ -85,12 +86,7 @@ module.exports = recl
for url in urls
length -= url.length
length += 10
@$length.text "#{length}/69"
if length >= 69
@$writing.text(@$writing.text().substr(0,69))
@cursorAtEnd()
e.preventDefault() if e
return false
@$length.text "#{length}/62"
_setFocus: -> @$writing.focus()
@ -173,9 +169,6 @@ module.exports = recl
audi = if @state.audi.length is 0 then @state.ludi else @state.audi
audi = window.util.clipAudi audi
console.log 'audi'
console.log audi
k = "writing"
div {className:k}, [
@ -198,6 +191,7 @@ module.exports = recl
onInput: @_input
onPaste: @_input
onKeyDown: @_writingKeyDown
onKeyUp: @_writingKeyUp
onFocus: @cursorAtEnd
}, "")
div {id:"length"}, "0/69"

View File

@ -601,9 +601,6 @@ module.exports = recl({
};
s.audi = _.without(s.audi, window.util.mainStationPath(window.urb.user));
s.ludi = _.without(s.ludi, window.util.mainStationPath(window.urb.user));
console.log('set');
console.log(s.audi);
console.log(s.ludi);
return s;
},
getInitialState: function() {
@ -650,10 +647,19 @@ module.exports = recl({
return false;
}
},
_writingKeyUp: function(e) {
var txt;
txt = this.$writing.text();
return this.$length.toggleClass('valid-false', txt.length > 62);
},
_writingKeyDown: function(e) {
var txt;
if (e.keyCode === 13) {
txt = this.$writing.text();
e.preventDefault();
this.sendMessage();
if (txt.length > 0 && txt.length < 63) {
this.sendMessage();
}
return false;
}
this._input();
@ -672,15 +678,7 @@ module.exports = recl({
length += 10;
}
}
this.$length.text(length + "/69");
if (length >= 69) {
this.$writing.text(this.$writing.text().substr(0, 69));
this.cursorAtEnd();
if (e) {
e.preventDefault();
}
return false;
}
return this.$length.text(length + "/62");
},
_setFocus: function() {
return this.$writing.focus();
@ -781,8 +779,6 @@ module.exports = recl({
name = iden ? iden.name : "";
audi = this.state.audi.length === 0 ? this.state.ludi : this.state.audi;
audi = window.util.clipAudi(audi);
console.log('audi');
console.log(audi);
k = "writing";
return div({
className: k
@ -807,6 +803,7 @@ module.exports = recl({
onInput: this._input,
onPaste: this._input,
onKeyDown: this._writingKeyDown,
onKeyUp: this._writingKeyUp,
onFocus: this.cursorAtEnd
}, ""), div({
id: "length"
@ -5423,12 +5420,23 @@ MessageActions = require('../actions/MessageActions.coffee');
module.exports = {
listenStation: function(station, since) {
var $this;
$this = this;
console.log('listen station');
console.log(arguments);
return window.urb.subscribe({
appl: "talk",
path: "/f/" + station + "/" + since
}, function(err, res) {
var ref, ref1;
console.log('m subscription updates');
if (err || !res.data) {
console.log('/f/ err!');
console.log(err);
console.log(res);
$this.listenStation(station, since);
return;
}
console.log('/f/');
console.log(res.data);
if (res.data.ok === true) {
MessageActions.listeningStation(station);
@ -5444,7 +5452,12 @@ module.exports = {
path: "/f/" + station + "/" + end + "/" + start
}, function(err, res) {
var ref, ref1;
console.log('get');
if (err || !res.data) {
console.log('/f/ /e/s err');
console.log(err);
return;
}
console.log('/f/ /e/s');
console.log(res);
if ((ref = res.data) != null ? (ref1 = ref.grams) != null ? ref1.tele : void 0 : void 0) {
MessageActions.loadMessages(res.data.grams, true);
@ -5534,7 +5547,7 @@ module.exports = {
}
};
return window.urb.send(send, function(err, res) {
console.log('add source updates');
console.log('talk-command');
return console.log(arguments);
});
},
@ -5544,7 +5557,12 @@ module.exports = {
path: "/a/court"
}, function(err, res) {
var ref, ref1;
console.log('membership updates');
if (err || !res) {
console.log('/a/ err');
console.log(err);
return;
}
console.log('/a/');
console.log(res.data);
if ((ref = res.data) != null ? (ref1 = ref.group) != null ? ref1.global : void 0 : void 0) {
return StationActions.loadMembers(res.data.group.global);
@ -5556,7 +5574,12 @@ module.exports = {
appl: "talk",
path: "/"
}, function(err, res) {
console.log('house updates');
if (err || !res.data) {
console.log('/ err');
console.log(err);
return;
}
console.log('/');
console.log(res.data);
if (res.data.house) {
return StationActions.loadStations(res.data.house);
@ -5569,7 +5592,12 @@ module.exports = {
path: "/ax/" + station
}, function(err, res) {
var ref;
console.log('station subscription updates');
if (err || !res) {
console.log('/ax/ err');
console.log(err);
return;
}
console.log('/ax/');
console.log(res.data);
if (res.data.ok === true) {
StationActions.listeningStation(station);

View File

@ -2,11 +2,20 @@ MessageActions = require '../actions/MessageActions.coffee'
module.exports =
listenStation: (station,since) ->
$this = this
console.log 'listen station'
console.log arguments
window.urb.subscribe {
appl:"talk"
path:"/f/#{station}/#{since}"
}, (err,res) ->
console.log('m subscription updates')
if err or not res.data
console.log '/f/ err!'
console.log err
console.log res
$this.listenStation station,since
return
console.log('/f/')
console.log(res.data)
if res.data.ok is true
MessageActions.listeningStation station
@ -18,7 +27,11 @@ module.exports =
appl:"talk"
path:"/f/#{station}/#{end}/#{start}"
}, (err,res) ->
console.log 'get'
if err or not res.data
console.log '/f/ /e/s err'
console.log err
return
console.log '/f/ /e/s'
console.log res
if res.data?.grams?.tele
MessageActions.loadMessages res.data.grams,true

View File

@ -36,7 +36,7 @@ module.exports =
caption:""
cordon:{posture:"white", list:[]}
window.urb.send send, (err,res) ->
console.log 'add source updates'
console.log 'talk-command'
console.log arguments
members: ->
@ -44,7 +44,11 @@ module.exports =
appl:"talk"
path:"/a/court"
}, (err,res) ->
console.log 'membership updates'
if err or not res
console.log '/a/ err'
console.log err
return
console.log '/a/'
console.log res.data
if res.data?.group?.global
StationActions.loadMembers res.data.group.global
@ -54,7 +58,11 @@ module.exports =
appl:"talk"
path:"/"
}, (err,res) ->
console.log 'house updates'
if err or not res.data
console.log '/ err'
console.log err
return
console.log '/'
console.log res.data
if res.data.house
StationActions.loadStations res.data.house
@ -64,7 +72,11 @@ module.exports =
appl:"talk"
path:"/ax/#{station}"
}, (err,res) ->
console.log('station subscription updates')
if err or not res
console.log '/ax/ err'
console.log err
return
console.log('/ax/')
console.log(res.data)
if res.data.ok is true
StationActions.listeningStation station

View File

@ -37,10 +37,10 @@
$% [%twitter p=@t] :: twitter
== ::
++ posture :: security posture
$? %black :: public
%white :: private
%green :: readonly
%brown :: writeonly
$? %black :: channel
%white :: village
%green :: journal
%brown :: mailbox
== ::
++ presence ?(%gone %hear %talk) :: status type
++ register (pair atlas (map partner atlas)) :: ping me, ping srcs