This commit is contained in:
Isaac Visintainer 2019-06-28 11:08:09 -07:00
commit c7b7f7eaf6
12 changed files with 202 additions and 153 deletions

View File

@ -36,6 +36,7 @@ export class ChatScreen extends Component {
componentDidMount() { componentDidMount() {
this.updateNumPeople(); this.updateNumPeople();
this.updateReadNumber();
} }
componentWillUnMount() { componentWillUnMount() {

View File

@ -18,6 +18,17 @@ export class NewScreen extends Component {
this.invChange = this.invChange.bind(this); this.invChange = this.invChange.bind(this);
} }
componentDidUpdate(prevProps, prevState) {
const { props, state } = this;
if (prevProps.circles !== props.circles) {
let station = `~${window.ship}/${state.idName}`;
if (props.circles.includes(station)) {
props.history.push('/~chat/' + station);
}
}
}
idChange(event) { idChange(event) {
this.setState({ this.setState({
idName: event.target.value, idName: event.target.value,
@ -33,7 +44,7 @@ export class NewScreen extends Component {
const { props, state } = this; const { props, state } = this;
if (!state.idName || !!state.showNameError) { return; } if (!state.idName || !!state.showNameError) { return; }
let station = `~${props.api.authTokens.ship}/${state.idName}`; let station = `~${window.ship}/${state.idName}`;
let actions = [ let actions = [
{ {
create: { create: {
@ -79,7 +90,6 @@ export class NewScreen extends Component {
} }
props.api.chat(actions); props.api.chat(actions);
props.history.push('/~chat/' + station);
} }
render() { render() {

View File

@ -139,6 +139,7 @@ export class Root extends Component {
}> }>
<NewScreen <NewScreen
api={api} api={api}
circles={circles}
{...props} {...props}
/> />
</Skeleton> </Skeleton>

View File

@ -13,12 +13,47 @@ export class Sidebar extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = {
invites: []
};
this.setInvitesToReadInterval = setInterval( this.setInvitesToReadInterval = setInterval(
this.setInvitesToRead.bind(this), this.setInvitesToRead.bind(this),
1000 1000
); );
} }
componentDidMount() {
this.filterInvites();
}
componentDidUpdate(prevProps, prevState) {
if (prevProps !== this.props) {
this.filterInvites();
}
}
filterInvites() {
const { props } = this;
let invites = [];
let filterInvites = {};
props.invites.forEach((msg) => {
let uid = _.get(msg, 'gam.sep.ire.top', false);
if (!uid) {
invites.push(msg.gam);
} else {
filterInvites[uid] = true;
}
});
invites = invites.filter((msg) => {
return !(msg.uid in filterInvites);
})
this.setState({ invites });
}
componentWillUnmount() { componentWillUnmount() {
if (this.setInvitesToReadInterval) { if (this.setInvitesToReadInterval) {
clearInterval(this.setInvitesToReadInterval); clearInterval(this.setInvitesToReadInterval);
@ -27,14 +62,21 @@ export class Sidebar extends Component {
} }
setInvitesToRead() { setInvitesToRead() {
const { props } = this; const { props, state } = this;
if ( if (
props.inviteConfig && props.inviteConfig &&
'red' in props.inviteConfig && 'red' in props.inviteConfig &&
props.invites.length > 0 && props.invites.length > 0
props.inviteConfig.red < (props.invites[props.invites.length - 1].num + 1)
) { ) {
props.api.read('i', props.invites[props.invites.length - 1].num + 1); let invNum = (props.invites[props.invites.length - 1].num + 1);
if (
props.inviteConfig.red < invNum &&
(invNum - props.inviteConfig.red) > state.invites.length
) {
props.api.read('i', invNum - state.invites.length);
}
} }
} }
@ -43,7 +85,7 @@ export class Sidebar extends Component {
} }
render() { render() {
const { props } = this; const { props, state } = this;
let station = props.match.params.ship + '/' + props.match.params.station; let station = props.match.params.ship + '/' + props.match.params.station;
let sidebarItems = props.circles let sidebarItems = props.circles
@ -93,21 +135,7 @@ export class Sidebar extends Component {
); );
}); });
let invites = []; let inviteItems = state.invites.map((inv) => {
let filterInvites = {};
props.invites.forEach((msg) => {
let uid = _.get(msg, 'gam.sep.ire.top', false);
if (!uid) {
invites.push(msg.gam);
} else {
filterInvites[uid] = true;
}
});
let inviteItems = invites.filter((msg) => {
return !(msg.uid in filterInvites);
}).map((inv) => {
return ( return (
<SidebarInvite <SidebarInvite
key={inv.uid} key={inv.uid}

View File

@ -30,8 +30,6 @@ class Store {
handleEvent(data) { handleEvent(data) {
let json = data.data; let json = data.data;
console.log(json);
this.initialReducer.reduce(json, this.state); this.initialReducer.reduce(json, this.state);
this.configReducer.reduce(json, this.state); this.configReducer.reduce(json, this.state);
this.updateReducer.reduce(json, this.state); this.updateReducer.reduce(json, this.state);

View File

@ -32,7 +32,6 @@ export default class ChatTile extends Component {
render() { render() {
const { state } = this; const { state } = this;
let inviteNum = 0; let inviteNum = 0;
let msgNum = 0; let msgNum = 0;
let inviteCircle = `~${window.ship}/i`; let inviteCircle = `~${window.ship}/i`;
@ -51,19 +50,16 @@ export default class ChatTile extends Component {
let host = key.split('/')[0]; let host = key.split('/')[0];
if (!state.configs[key]) { break; } if (!state.configs[key]) { break; }
if (!(key in numbers)) { break; }
let red = state.configs[key].red; let red = state.configs[key].red;
console.log(key, red, numbers[key]);
if (key === inviteCircle) { if (key === inviteCircle) {
inviteNum = inviteNum - red + numbers[key]; inviteNum = inviteNum - red + numbers[key];
console.log('case 1', inviteNum);
} else if (host === `~${window.ship}`) { } else if (host === `~${window.ship}`) {
msgNum = msgNum - red + numbers[key]; msgNum = msgNum - red + numbers[key];
console.log('case 2', msgNum);
} else { } else {
msgNum = msgNum + numbers[key]; msgNum = msgNum + numbers[key];
console.log('case 3', msgNum);
} }
} }
} }

View File

@ -81,11 +81,11 @@
[cir 0] [cir 0]
=/ last (snag (dec (lent lis)) `(list envelope:hall)`lis) =/ last (snag (dec (lent lis)) `(list envelope:hall)`lis)
[cir (add num.last 1)] [cir (add num.last 1)]
=/ maptjson *(map @t json) =/ maptjson=(map @t json)
=. maptjson %- my
(~(put by maptjson) 'config' (config-to-json str)) :~ ['config' (config-to-json str)]
=. maptjson ['numbers' (numbers-to-json numbers)]
(~(put by maptjson) 'numbers' (numbers-to-json numbers)) ==
[%o maptjson] [%o maptjson]
:: ::
++ peer-chattile ++ peer-chattile
@ -102,8 +102,8 @@
^- (quip move _this) ^- (quip move _this)
~& (lent (prey:pubsub:userlib /primary bol)) ~& (lent (prey:pubsub:userlib /primary bol))
=* messages messages.str.sta =* messages messages.str.sta
=/ lisunitmov=(list (unit move)) =/ lismov/(list move)
%+ turn ~(tap by messages) %+ murn ~(tap by messages)
|= [cir=circle:hall lis=(list envelope:hall)] |= [cir=circle:hall lis=(list envelope:hall)]
^- (unit move) ^- (unit move)
=/ envs/(unit (list envelope:hall)) (~(get by messages) cir) =/ envs/(unit (list envelope:hall)) (~(get by messages) cir)
@ -123,15 +123,7 @@
[%messages cir start end (swag [start offset] u.envs)] [%messages cir start end (swag [start offset] u.envs)]
== ==
:_ this :_ this
%+ weld [[ost.bol %diff %chat-config str.sta] lismov]
[ost.bol %diff %chat-config str.sta]~
%+ turn %+ skim lisunitmov
|= umov=(unit move)
^- ?
?~ umov
%.n
%.y
need
:: ::
:: +poke-chat: send us an action :: +poke-chat: send us an action
:: ::
@ -304,7 +296,8 @@
?: add.rum ?: add.rum
(~(put in circles.str.sta) cir.rum) (~(put in circles.str.sta) cir.rum)
(~(del in circles.str.sta) cir.rum) (~(del in circles.str.sta) cir.rum)
=/ str %= str.sta =/ str
%= str.sta
circles cis circles cis
peers peers
?: add.rum ?: add.rum
@ -329,8 +322,12 @@
?> ?=(%gram -.sto) ?> ?=(%gram -.sto)
=* messages messages.str.sta =* messages messages.str.sta
=/ circle/circle:hall [`@p`(slav %p &2:wir) &3:wir] =/ circle/circle:hall [`@p`(slav %p &2:wir) &3:wir]
=/ nes/(list envelope:hall) (~(got by messages) circle) =/ unes/(unit (list envelope:hall)) (~(get by messages) circle)
=/ str %= str.sta ?~ unes
[~ this]
=/ nes u.unes
=/ str
%= str.sta
messages (~(put by messages) circle (snoc nes nev.sto)) messages (~(put by messages) circle (snoc nes nev.sto))
== ==
:- (send-chat-update [[%message circle nev.sto] str]) :- (send-chat-update [[%message circle nev.sto] str])

View File

@ -17,10 +17,6 @@
return module = { exports: {} }, fn(module, module.exports), module.exports; return module = { exports: {} }, fn(module, module.exports), module.exports;
} }
function getCjsExportFromNamespace (n) {
return n && n.default || n;
}
/* /*
object-assign object-assign
(c) Sindre Sorhus (c) Sindre Sorhus
@ -45901,8 +45897,6 @@
handleEvent(data) { handleEvent(data) {
let json = data.data; let json = data.data;
console.log(json);
this.initialReducer.reduce(json, this.state); this.initialReducer.reduce(json, this.state);
this.configReducer.reduce(json, this.state); this.configReducer.reduce(json, this.state);
this.updateReducer.reduce(json, this.state); this.updateReducer.reduce(json, this.state);
@ -47902,8 +47896,6 @@
isBuffer: isBuffer isBuffer: isBuffer
}); });
var require$$0 = getCjsExportFromNamespace(bufferEs6);
var bn = createCommonjsModule(function (module) { var bn = createCommonjsModule(function (module) {
(function (module, exports) { (function (module, exports) {
@ -47956,7 +47948,7 @@
var Buffer; var Buffer;
try { try {
Buffer = require$$0.Buffer; Buffer = bufferEs6.Buffer;
} catch (e) { } catch (e) {
} }
@ -56741,12 +56733,47 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
constructor(props) { constructor(props) {
super(props); super(props);
this.state = {
invites: []
};
this.setInvitesToReadInterval = setInterval( this.setInvitesToReadInterval = setInterval(
this.setInvitesToRead.bind(this), this.setInvitesToRead.bind(this),
1000 1000
); );
} }
componentDidMount() {
this.filterInvites();
}
componentDidUpdate(prevProps, prevState) {
if (prevProps !== this.props) {
this.filterInvites();
}
}
filterInvites() {
const { props } = this;
let invites = [];
let filterInvites = {};
props.invites.forEach((msg) => {
let uid = lodash.get(msg, 'gam.sep.ire.top', false);
if (!uid) {
invites.push(msg.gam);
} else {
filterInvites[uid] = true;
}
});
invites = invites.filter((msg) => {
return !(msg.uid in filterInvites);
});
this.setState({ invites });
}
componentWillUnmount() { componentWillUnmount() {
if (this.setInvitesToReadInterval) { if (this.setInvitesToReadInterval) {
clearInterval(this.setInvitesToReadInterval); clearInterval(this.setInvitesToReadInterval);
@ -56755,14 +56782,21 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
} }
setInvitesToRead() { setInvitesToRead() {
const { props } = this; const { props, state } = this;
if ( if (
props.inviteConfig && props.inviteConfig &&
'red' in props.inviteConfig && 'red' in props.inviteConfig &&
props.invites.length > 0 && props.invites.length > 0
props.inviteConfig.red < (props.invites[props.invites.length - 1].num + 1)
) { ) {
props.api.read('i', props.invites[props.invites.length - 1].num + 1); let invNum = (props.invites[props.invites.length - 1].num + 1);
if (
props.inviteConfig.red < invNum &&
(invNum - props.inviteConfig.red) > state.invites.length
) {
props.api.read('i', invNum - state.invites.length);
}
} }
} }
@ -56771,7 +56805,7 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
} }
render() { render() {
const { props } = this; const { props, state } = this;
let station = props.match.params.ship + '/' + props.match.params.station; let station = props.match.params.ship + '/' + props.match.params.station;
let sidebarItems = props.circles let sidebarItems = props.circles
@ -56816,45 +56850,31 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
ship: obj.aut, ship: obj.aut,
selected: obj.selected, selected: obj.selected,
unread: unread, unread: unread,
history: props.history, __self: this, __source: {fileName: _jsxFileName$5, lineNumber: 82}} history: props.history, __self: this, __source: {fileName: _jsxFileName$5, lineNumber: 124}}
) )
); );
}); });
let invites = []; let inviteItems = state.invites.map((inv) => {
let filterInvites = {};
props.invites.forEach((msg) => {
let uid = lodash.get(msg, 'gam.sep.ire.top', false);
if (!uid) {
invites.push(msg.gam);
} else {
filterInvites[uid] = true;
}
});
let inviteItems = invites.filter((msg) => {
return !(msg.uid in filterInvites);
}).map((inv) => {
return ( return (
react.createElement(SidebarInvite, { react.createElement(SidebarInvite, {
key: inv.uid, key: inv.uid,
msg: inv, msg: inv,
api: props.api, api: props.api,
config: props.inviteConfig, __self: this, __source: {fileName: _jsxFileName$5, lineNumber: 112}} config: props.inviteConfig, __self: this, __source: {fileName: _jsxFileName$5, lineNumber: 140}}
) )
); );
}); });
return ( return (
react.createElement('div', { className: "h-100 w-100 overflow-x-hidden flex flex-column" , __self: this, __source: {fileName: _jsxFileName$5, lineNumber: 122}} react.createElement('div', { className: "h-100 w-100 overflow-x-hidden flex flex-column" , __self: this, __source: {fileName: _jsxFileName$5, lineNumber: 150}}
, react.createElement('div', { className: "pl3 pr3 pt3 pb3 cf" , __self: this, __source: {fileName: _jsxFileName$5, lineNumber: 123}} , react.createElement('div', { className: "pl3 pr3 pt3 pb3 cf" , __self: this, __source: {fileName: _jsxFileName$5, lineNumber: 151}}
, react.createElement('p', { className: "dib w-50 fw-bold body-large" , __self: this, __source: {fileName: _jsxFileName$5, lineNumber: 124}}, "Chat") , react.createElement('p', { className: "dib w-50 fw-bold body-large" , __self: this, __source: {fileName: _jsxFileName$5, lineNumber: 152}}, "Chat")
, react.createElement('a', { , react.createElement('a', {
className: "dib tr w-50 pointer plus-font" , className: "dib tr w-50 pointer plus-font" ,
onClick: this.onClickNew.bind(this), __self: this, __source: {fileName: _jsxFileName$5, lineNumber: 125}}, "+") onClick: this.onClickNew.bind(this), __self: this, __source: {fileName: _jsxFileName$5, lineNumber: 153}}, "+")
) )
, react.createElement('div', { style: { flexGrow: 1 }, __self: this, __source: {fileName: _jsxFileName$5, lineNumber: 129}} , react.createElement('div', { style: { flexGrow: 1 }, __self: this, __source: {fileName: _jsxFileName$5, lineNumber: 157}}
, inviteItems , inviteItems
, sidebarItems , sidebarItems
) )
@ -57272,6 +57292,7 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
componentDidMount() { componentDidMount() {
this.updateNumPeople(); this.updateNumPeople();
this.updateReadNumber();
} }
componentWillUnMount() { componentWillUnMount() {
@ -57393,7 +57414,7 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
return ( return (
react.createElement('a', { react.createElement('a', {
className: "vanilla hoverline text-600 text-mono" , className: "vanilla hoverline text-600 text-mono" ,
href: prettyShip(msg.gam.aut)[1], __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 158}} href: prettyShip(msg.gam.aut)[1], __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 159}}
, prettyShip(`~${msg.gam.aut}`)[0] , prettyShip(`~${msg.gam.aut}`)[0]
) )
); );
@ -57403,7 +57424,7 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
react.createElement(Message, { react.createElement(Message, {
key: msg.gam.uid + Math.random(), key: msg.gam.uid + Math.random(),
msg: msg.gam, msg: msg.gam,
details: details, __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 167}} ) details: details, __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 168}} )
); );
} }
@ -57425,18 +57446,18 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
return ( return (
react.createElement('div', { key: state.station, react.createElement('div', { key: state.station,
className: "h-100 w-100 overflow-hidden flex flex-column" , __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 191}} className: "h-100 w-100 overflow-hidden flex flex-column" , __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 192}}
, react.createElement('div', { className: "pl2 pt2 bb" , __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 193}} , react.createElement('div', { className: "pl2 pt2 bb" , __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 194}}
, react.createElement('h2', {__self: this, __source: {fileName: _jsxFileName$c, lineNumber: 194}}, state.circle) , react.createElement('h2', {__self: this, __source: {fileName: _jsxFileName$c, lineNumber: 195}}, state.circle)
, react.createElement(ChatTabBar, { ...props, , react.createElement(ChatTabBar, { ...props,
station: state.station, station: state.station,
numPeers: peers.length, __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 195}} ) numPeers: peers.length, __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 196}} )
) )
, react.createElement('div', { , react.createElement('div', {
className: "overflow-y-scroll pt3 flex flex-column-reverse" , className: "overflow-y-scroll pt3 flex flex-column-reverse" ,
style: { height: 'calc(100% - 157px)' }, style: { height: 'calc(100% - 157px)' },
onScroll: this.onScroll, __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 199}} onScroll: this.onScroll, __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 200}}
, react.createElement('div', { ref: el => { this.scrollElement = el; }, __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 203}}) , react.createElement('div', { ref: el => { this.scrollElement = el; }, __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 204}})
, chatMessages , chatMessages
) )
, react.createElement(ChatInput, { , react.createElement(ChatInput, {
@ -57444,7 +57465,7 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
numMsgs: lastMsgNum, numMsgs: lastMsgNum,
station: state.station, station: state.station,
circle: state.circle, circle: state.circle,
placeholder: "Message...", __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 206}} ) placeholder: "Message...", __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 207}} )
) )
) )
} }

View File

@ -19323,7 +19323,6 @@
render() { render() {
const { state } = this; const { state } = this;
let inviteNum = 0; let inviteNum = 0;
let msgNum = 0; let msgNum = 0;
let inviteCircle = `~${window.ship}/i`; let inviteCircle = `~${window.ship}/i`;
@ -19342,37 +19341,34 @@
let host = key.split('/')[0]; let host = key.split('/')[0];
if (!state.configs[key]) { break; } if (!state.configs[key]) { break; }
if (!(key in numbers)) { break; }
let red = state.configs[key].red; let red = state.configs[key].red;
console.log(key, red, numbers[key]);
if (key === inviteCircle) { if (key === inviteCircle) {
inviteNum = inviteNum - red + numbers[key]; inviteNum = inviteNum - red + numbers[key];
console.log('case 1', inviteNum);
} else if (host === `~${window.ship}`) { } else if (host === `~${window.ship}`) {
msgNum = msgNum - red + numbers[key]; msgNum = msgNum - red + numbers[key];
console.log('case 2', msgNum);
} else { } else {
msgNum = msgNum + numbers[key]; msgNum = msgNum + numbers[key];
console.log('case 3', msgNum);
} }
} }
} }
return ( return (
react.createElement('div', { className: "w-100 h-100 relative" , style: { background: '#1a1a1a' }, __self: this, __source: {fileName: _jsxFileName, lineNumber: 72}} react.createElement('div', { className: "w-100 h-100 relative" , style: { background: '#1a1a1a' }, __self: this, __source: {fileName: _jsxFileName, lineNumber: 68}}
, react.createElement('a', { className: "w-100 h-100 db pa2 no-underline" , href: "/~chat", __self: this, __source: {fileName: _jsxFileName, lineNumber: 73}} , react.createElement('a', { className: "w-100 h-100 db pa2 no-underline" , href: "/~chat", __self: this, __source: {fileName: _jsxFileName, lineNumber: 69}}
, react.createElement('p', { className: "gray", style: { , react.createElement('p', { className: "gray", style: {
fontWeight: 'bold', fontWeight: 'bold',
fontSize: 14, fontSize: 14,
lineHeight: '24px' lineHeight: '24px'
}, __self: this, __source: {fileName: _jsxFileName, lineNumber: 74}}, "Chat") }, __self: this, __source: {fileName: _jsxFileName, lineNumber: 70}}, "Chat")
, react.createElement('img', { , react.createElement('img', {
className: "absolute", className: "absolute",
style: { left: 68, top: 65 }, style: { left: 68, top: 65 },
src: "/~chat/img/Tile.png", src: "/~chat/img/Tile.png",
width: 106, width: 106,
height: 98, __self: this, __source: {fileName: _jsxFileName, lineNumber: 79}} ) height: 98, __self: this, __source: {fileName: _jsxFileName, lineNumber: 75}} )
, react.createElement('p', { , react.createElement('p', {
className: "absolute white" , className: "absolute white" ,
style: { style: {
@ -19380,7 +19376,7 @@
fontWeight: 600, fontWeight: 600,
fontSize: 16, fontSize: 16,
lineHeight: '20px' lineHeight: '20px'
}, __self: this, __source: {fileName: _jsxFileName, lineNumber: 85}}, inviteNum, " invites" ) }, __self: this, __source: {fileName: _jsxFileName, lineNumber: 81}}, inviteNum, " invites" )
, react.createElement('p', { , react.createElement('p', {
className: "absolute white" , className: "absolute white" ,
style: { style: {
@ -19388,7 +19384,7 @@
fontWeight: 600, fontWeight: 600,
fontSize: 16, fontSize: 16,
lineHeight: '20px' lineHeight: '20px'
}, __self: this, __source: {fileName: _jsxFileName, lineNumber: 93}}, msgNum, " new messages" ) }, __self: this, __source: {fileName: _jsxFileName, lineNumber: 89}}, msgNum, " new messages" )
) )
) )
); );

View File

@ -39,11 +39,12 @@
++ prep ++ prep
|= old=(unit ~) |= old=(unit ~)
^- (quip move _this) ^- (quip move _this)
=/ lismov/(list move) %+ weld =/ launchnoun [%noun [%clock /tile '/~clock/js/tile.js']]
`(list move)`[ost.bol %connect / [~ /'~clock'] %clock]~ :_ this
`(list move)`[ost.bol %poke /clock [our.bol %launch] [%noun [%clock /tile '/~clock/js/tile.js']]]~ :~
:- lismov [ost.bol %connect / [~ /'~clock'] %clock]
this [ost.bol %poke /clock [our.bol %launch] launchnoun]
==
:: ::
++ peer-tile ++ peer-tile
|= pax=path |= pax=path
@ -61,10 +62,10 @@
%- (require-authorization:app ost.bol move this) %- (require-authorization:app ost.bol move this)
|= =inbound-request:http-server |= =inbound-request:http-server
^- (quip move _this) ^- (quip move _this)
=+ request-line=(parse-request-line url.request.inbound-request) =/ request-line (parse-request-line url.request.inbound-request)
=+ back-path=(flop site.request-line) =/ back-path (flop site.request-line)
=/ name=@t =/ name=@t
=+ back-path=(flop site.request-line) =/ back-path (flop site.request-line)
?~ back-path ?~ back-path
'' ''
i.back-path i.back-path

View File

@ -79,10 +79,12 @@
=/ data/(unit [json url=@t]) (~(get by data.sta) name) =/ data/(unit [json url=@t]) (~(get by data.sta) name)
?~ data ?~ data
[~ this] [~ this]
::
:- :-
%+ turn (prey:pubsub:userlib /main bol) %+ turn (prey:pubsub:userlib /main bol)
|= [=bone *] |= [=bone *]
[bone %diff %json (frond:enjs:format name jon)] [bone %diff %json (frond:enjs:format name jon)]
::
%= this %= this
data.sta (~(put by data.sta) name [jon url.u.data]) data.sta (~(put by data.sta) name [jon url.u.data])
== ==

View File

@ -44,10 +44,12 @@
++ prep ++ prep
|= old=(unit tim=@da) |= old=(unit tim=@da)
^- (quip move _this) ^- (quip move _this)
=/ lismov/(list move) %+ weld =/ launchnoun [%noun [%timer /tile '/~timer/js/tile.js']]
`(list move)`[ost.bol %connect / [~ /'~timer'] %timer]~ :-
`(list move)`[ost.bol %poke /timer [our.bol %launch] [%noun [%timer /tile '/~timer/js/tile.js']]]~ :~
:- lismov [ost.bol %connect / [~ /'~timer'] %timer]
[ost.bol %poke /timer [our.bol %launch] launchnoun]
==
?~ old ?~ old
this this
%= this %= this
@ -76,25 +78,21 @@
=/ str/@t +.jon =/ str/@t +.jon
?: =(str 'start') ?: =(str 'start')
=/ data/@da (add now.bol ~s10) =/ data/@da (add now.bol ~s10)
:- %+ weld :_ this(tim data)
`(list move)`(send-tile-diff [%s (scot %da data)]) [[ost.bol %wait /timer data] (send-tile-diff [%s (scot %da data)])]
`(list move)`[ost.bol %wait /timer data]~
this(tim data)
?: =(str 'stop') ?: =(str 'stop')
:- %+ weld :_ this(tim *@da)
`(list move)`(send-tile-diff [%s '']) [[ost.bol %rest /timer tim] (send-tile-diff [%s ''])]
`(list move)`[ost.bol %rest /timer tim]~
this(tim *@da)
[~ this] [~ this]
:: ::
++ poke-handle-http-request ++ poke-handle-http-request
%- (require-authorization:app ost.bol move this) %- (require-authorization:app ost.bol move this)
|= =inbound-request:http-server |= =inbound-request:http-server
^- (quip move _this) ^- (quip move _this)
=+ request-line=(parse-request-line url.request.inbound-request) =/ request-line (parse-request-line url.request.inbound-request)
=+ back-path=(flop site.request-line) =/ back-path (flop site.request-line)
=/ name=@t =/ name=@t
=+ back-path=(flop site.request-line) =/ back-path (flop site.request-line)
?~ back-path ?~ back-path
'' ''
i.back-path i.back-path