Updated all to use launch-action mark

This commit is contained in:
Logan Allen 2019-06-28 11:38:14 -07:00
parent c7b7f7eaf6
commit ace10ea9f6
13 changed files with 314 additions and 267 deletions

View File

@ -50,7 +50,8 @@
++ prep
|= old=(unit state)
^- (quip move _this)
=/ launchnoun [%noun [%chat /chattile '/~chat/js/tile.js']]
=/ launcha/poke
[%launch-action [%chat /chattile '/~chat/js/tile.js']]
?~ old
=/ inboxpat /circle/inbox/config/group
=/ circlespat /circles/[(scot %p our.bol)]
@ -63,9 +64,9 @@
[ost.bol %peer circlespat [our.bol %hall] circlespat]
[ost.bol %connect / [~ /'~chat'] %chat]
[ost.bol %poke /chat [our.bol %hall] inboxi]
[ost.bol %poke /chat [our.bol %launch] launchnoun]
[ost.bol %poke /chat [our.bol %launch] launcha]
==
:- [ost.bol %poke /chat [our.bol %launch] launchnoun]~
:- [ost.bol %poke /chat [our.bol %launch] launcha]~
this(sta u.old)
::
::

View File

@ -57766,6 +57766,17 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
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) {
this.setState({
idName: event.target.value,
@ -57781,7 +57792,7 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
const { props, state } = this;
if (!state.idName || !!state.showNameError) { return; }
let station = `~${props.api.authTokens.ship}/${state.idName}`;
let station = `~${window.ship}/${state.idName}`;
let actions = [
{
create: {
@ -57827,14 +57838,13 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
}
props.api.chat(actions);
props.history.push('/~chat/' + station);
}
render() {
let nameErrorElem = this.state.showNameError ? (
react.createElement('p', { className: "nice-red label-regular" , __self: this, __source: {fileName: _jsxFileName$g, lineNumber: 87}}, "Chat names may contain alphabetical characters, numbers, dots, or dashes." )
react.createElement('p', { className: "nice-red label-regular" , __self: this, __source: {fileName: _jsxFileName$g, lineNumber: 97}}, "Chat names may contain alphabetical characters, numbers, dots, or dashes." )
) : (
react.createElement('div', {__self: this, __source: {fileName: _jsxFileName$g, lineNumber: 89}})
react.createElement('div', {__self: this, __source: {fileName: _jsxFileName$g, lineNumber: 99}})
);
let createClasses = "label-regular btn-font pointer underline bn";
@ -57843,25 +57853,25 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
}
return (
react.createElement('div', { className: "h-100 w-100 pa3 pt2 overflow-x-hidden flex flex-column" , __self: this, __source: {fileName: _jsxFileName$g, lineNumber: 98}}
, react.createElement('h2', { className: "mb3", __self: this, __source: {fileName: _jsxFileName$g, lineNumber: 99}}, "Create a New Chat" )
, react.createElement('div', {__self: this, __source: {fileName: _jsxFileName$g, lineNumber: 100}}
, react.createElement('p', { className: "label-regular fw-bold" , __self: this, __source: {fileName: _jsxFileName$g, lineNumber: 101}}, "Name")
react.createElement('div', { className: "h-100 w-100 pa3 pt2 overflow-x-hidden flex flex-column" , __self: this, __source: {fileName: _jsxFileName$g, lineNumber: 108}}
, react.createElement('h2', { className: "mb3", __self: this, __source: {fileName: _jsxFileName$g, lineNumber: 109}}, "Create a New Chat" )
, react.createElement('div', {__self: this, __source: {fileName: _jsxFileName$g, lineNumber: 110}}
, react.createElement('p', { className: "label-regular fw-bold" , __self: this, __source: {fileName: _jsxFileName$g, lineNumber: 111}}, "Name")
, react.createElement('input', {
className: "body-large bn pa2 pl0 mb2 w-50" ,
placeholder: "secret-chat",
onChange: this.idChange, __self: this, __source: {fileName: _jsxFileName$g, lineNumber: 102}} )
onChange: this.idChange, __self: this, __source: {fileName: _jsxFileName$g, lineNumber: 112}} )
, nameErrorElem
, react.createElement('p', { className: "label-regular fw-bold" , __self: this, __source: {fileName: _jsxFileName$g, lineNumber: 107}}, "Invites")
, react.createElement('p', { className: "label-regular fw-bold" , __self: this, __source: {fileName: _jsxFileName$g, lineNumber: 117}}, "Invites")
, react.createElement('input', {
className: "body-large bn pa2 pl0 mb2 w-50" ,
placeholder: "~zod, ~bus" ,
onChange: this.invChange, __self: this, __source: {fileName: _jsxFileName$g, lineNumber: 108}} )
, react.createElement('br', {__self: this, __source: {fileName: _jsxFileName$g, lineNumber: 112}} )
onChange: this.invChange, __self: this, __source: {fileName: _jsxFileName$g, lineNumber: 118}} )
, react.createElement('br', {__self: this, __source: {fileName: _jsxFileName$g, lineNumber: 122}} )
, react.createElement('button', {
onClick: this.onClickCreate.bind(this),
className: createClasses,
style: { fontSize: '18px' }, __self: this, __source: {fileName: _jsxFileName$g, lineNumber: 113}}
style: { fontSize: '18px' }, __self: this, __source: {fileName: _jsxFileName$g, lineNumber: 123}}
, "-> Create" )
)
)
@ -57995,6 +58005,7 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 128}}
, react.createElement(NewScreen, {
api: api,
circles: circles,
...props, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 140}}
)
)
@ -58017,20 +58028,20 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
unreads: unreads,
api: api,
inviteConfig: inviteConfig,
...props, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 157}}
...props, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 158}}
)
, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 155}}
, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 156}}
, react.createElement(ChatScreen, {
api: api,
configs: configs,
messages: messages,
peers: state.peers,
subscription: subscription,
...props, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 167}}
...props, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 168}}
)
)
);
}, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 147}} )
}, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 148}} )
, react.createElement(Route, { exact: true, path: "/~chat/:ship/:station/members",
render: (props) => {
return (
@ -58043,17 +58054,17 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
unreads: unreads,
api: api,
inviteConfig: inviteConfig,
...props, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 183}}
...props, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 184}}
)
, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 181}}
, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 182}}
, react.createElement(MemberScreen, {
...props,
api: api,
peers: state.peers, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 193}}
peers: state.peers, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 194}}
)
)
);
}, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 178}} )
}, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 179}} )
, react.createElement(Route, { exact: true, path: "/~chat/:ship/:station/settings",
render: (props) => {
return (
@ -58066,18 +58077,18 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
unreads: unreads,
api: api,
inviteConfig: inviteConfig,
...props, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 206}}
...props, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 207}}
)
, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 204}}
, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 205}}
, react.createElement(SettingsScreen, {
...props,
api: api,
peers: state.peers,
circles: state.circles, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 216}}
circles: state.circles, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 217}}
)
)
);
}, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 201}} )
}, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 202}} )
)
)
)

View File

@ -24,7 +24,7 @@
::
+$ poke
$% [%hall-action action:hall]
[%noun [@tas path @t]]
[%launch-action [@tas path @t]]
==
::
+$ state

View File

@ -15,7 +15,7 @@
:: +card: output effect payload
::
+$ poke
$% [%noun [@tas path @t]]
$% [%launch-action [@tas path @t]]
==
::
+$ card
@ -39,11 +39,12 @@
++ prep
|= old=(unit ~)
^- (quip move _this)
=/ launchnoun [%noun [%clock /tile '/~clock/js/tile.js']]
=/ launcha
[%launch-action [%clock /tile '/~clock/js/tile.js']]
:_ this
:~
[ost.bol %connect / [~ /'~clock'] %clock]
[ost.bol %poke /clock [our.bol %launch] launchnoun]
[ost.bol %poke /clock [our.bol %launch] launcha]
==
::
++ peer-tile

View File

@ -1,5 +1,4 @@
/+ *server, collections
/+ *server, launch
/= index
/^ $-(marl manx)
/: /===/app/launch/index /!noun/
@ -21,23 +20,8 @@
/^ (map knot @)
/: /===/app/launch/img /_ /png/
::
|%
=, launch
::
+$ move [bone card]
::
+$ card
$% [%http-response =http-event:http]
[%connect wire binding:http-server term]
[%peer wire dock path]
[%diff %json json]
==
+$ tile [name=@tas subscribe=path]
+$ tile-data (map @tas [jon=json url=@t])
+$ state
$% [%0 tiles=(set tile) data=tile-data path-to-tile=(map path @tas)]
==
::
--
::
|_ [bol=bowl:gall sta=state]
::
@ -46,32 +30,37 @@
++ prep
|= old=(unit state)
^- (quip move _this)
~& 'launch prep'
?~ old
:_ this
[ost.bol %connect / [~ /] %launch]~
[~ this(sta u.old)]
::
++ bound
|= [wir=wire success=? binding=binding:http-server]
++ poke-launch-action
|= act=action:launch
^- (quip move _this)
[~ this]
::
++ poke-noun
|= [name=@tas subscribe=path url=@t]
^- (quip move _this)
=/ beforedata (~(get by data.sta) name)
=/ beforedata (~(get by data.sta) name.act)
=/ newdata
?~ beforedata
(~(put by data.sta) name [*json url])
(~(put by data.sta) name [jon.u.beforedata url])
:- [ost.bol %peer subscribe [our.bol name] subscribe]~
(~(put by data.sta) name.act [*json url.act])
(~(put by data.sta) name.act [jon.u.beforedata url.act])
:- [ost.bol %peer subscribe.act [our.bol name.act] subscribe.act]~
%= this
tiles.sta (~(put in tiles.sta) [name subscribe])
tiles.sta (~(put in tiles.sta) [name.act subscribe.act])
data.sta newdata
path-to-tile.sta (~(put by path-to-tile.sta) subscribe name)
path-to-tile.sta (~(put by path-to-tile.sta) subscribe.act name.act)
==
::
++ peer-main
|= [pax=path]
^- (quip move _this)
=/ data/json
%- pairs:enjs:format
%+ turn ~(tap by data.sta)
|= [key=@tas [jon=json url=@t]]
[key jon]
:_ this
[ost.bol %diff %json data]~
::
++ diff-json
|= [pax=path jon=json]
^- (quip move _this)
@ -89,17 +78,6 @@
data.sta (~(put by data.sta) name [jon url.u.data])
==
::
++ peer-main
|= [pax=path]
^- (quip move _this)
=/ data/json
%- pairs:enjs:format
%+ turn ~(tap by data.sta)
|= [key=@tas [jon=json url=@t]]
[key jon]
:_ this
[ost.bol %diff %json data]~
::
++ generate-script-marl
|= data=tile-data
^- marl
@ -113,9 +91,9 @@
|= =inbound-request:http-server
^- (quip move _this)
::
=+ request-line=(parse-request-line url.request.inbound-request)
=/ request-line (parse-request-line url.request.inbound-request)
=/ name=@t
=+ back-path=(flop site.request-line)
=/ back-path (flop site.request-line)
?~ back-path
''
i.back-path
@ -148,4 +126,9 @@
[ost.bol %http-response (png-response:app img)]~
==
::
++ bound
|= [wir=wire success=? binding=binding:http-server]
^- (quip move _this)
[~ this]
::
--

View File

@ -0,0 +1,24 @@
::
|%
::
+$ move [bone card]
::
+$ card
$% [%http-response =http-event:http]
[%connect wire binding:http-server term]
[%peer wire dock path]
[%diff %json json]
==
::
+$ tile [name=@tas subscribe=path]
::
+$ tile-data (map @tas [jon=json url=@t])
::
+$ action [name=@tas subscribe=path url=@t]
::
+$ state
$% [%0 tiles=(set tile) data=tile-data path-to-tile=(map path @tas)]
==
::
--
::

View File

@ -0,0 +1,11 @@
::
::
/+ launch
::
|_ act=action:launch
::
++ grab
|%
++ noun action:launch
--
--

View File

@ -55,7 +55,7 @@
+$ poke
$% [%hall-action action:hall]
[%write-action action]
[%noun @tas path @t]
[%launch-action @tas path @t]
==
::
+$ diff
@ -188,7 +188,7 @@
:_ this(sat *state)
:~ [ost.bol %connect / [~ /'~publish'] %write]
:* ost.bol %poke /publish [our.bol %launch]
%noun %write /publishtile '/~publish/tile.js'
%launch-action %write /publishtile '/~publish/tile.js'
==
==
::

View File

@ -57099,19 +57099,17 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
this.props.post.collectionName;
let postLink = collLink + "/" + this.props.post.postName;
// let postTitle =
return (
react.createElement('div', { className: "w-336 ma2" , __self: this, __source: {fileName: _jsxFileName, lineNumber: 50}}
, react.createElement(Link, { to: postLink, __self: this, __source: {fileName: _jsxFileName, lineNumber: 51}}
, react.createElement('p', { className: "body-large b" , __self: this, __source: {fileName: _jsxFileName, lineNumber: 52}}
react.createElement('div', { className: "w-336 ma2" , __self: this, __source: {fileName: _jsxFileName, lineNumber: 48}}
, react.createElement(Link, { to: postLink, __self: this, __source: {fileName: _jsxFileName, lineNumber: 49}}
, react.createElement('p', { className: "body-large b" , __self: this, __source: {fileName: _jsxFileName, lineNumber: 50}}
, this.props.post.postTitle
)
, react.createElement(PostSnippet, {
body: this.props.post.postBody, __self: this, __source: {fileName: _jsxFileName, lineNumber: 55}}
body: this.props.post.postBody, __self: this, __source: {fileName: _jsxFileName, lineNumber: 53}}
)
)
, react.createElement('p', { className: "label-small gray-50" , __self: this, __source: {fileName: _jsxFileName, lineNumber: 59}}
, react.createElement('p', { className: "label-small gray-50" , __self: this, __source: {fileName: _jsxFileName, lineNumber: 57}}
, authorDate
)
)
@ -57894,6 +57892,7 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
title: "",
body: "",
awaiting: false,
error: false,
};
this.titleChange = this.titleChange.bind(this);
@ -57980,24 +57979,31 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
let blogId = this.state.awaiting.blogId;
let postId = this.state.awaiting.postId;
let post;
let comments;
if (this.state.awaiting.ship == window.ship) {
let post = lodash.get(this.props, `pubs[${blogId}].posts[${postId}].post`, false);
let comments = lodash.get(this.props, `pubs[${blogId}].posts[${postId}].comments`, false);
if (post && comments) {
let redirect = `/~publish/~${ship}/${blogId}/${postId}`;
this.props.history.push(redirect);
}
post =
lodash.get(this.props, `pubs[${blogId}].posts[${postId}].post`, false);
comments =
lodash.get(this.props, `pubs[${blogId}].posts[${postId}].comments`, false);
} else {
post =
lodash.get(this.props, `subs[${ship}][${blogId}].posts[${postId}].post`, false);
comments =
lodash.get(this.props, `subs[${ship}][${blogId}].posts[${postId}].comments`, false);
}
let post = lodash.get(this.props, `subs[${ship}][${blogId}].posts[${postId}].post`, false);
let comments = lodash.get(this.props, `subs[${ship}][${blogId}].posts[${postId}].comments`, false);
if (post && comments) {
if (post && comments) {
if (typeof(post) === 'String') {
this.setState({
error: post,
awaiting: false,
});
} else {
let redirect = `/~publish/~${ship}/${blogId}/${postId}`;
this.props.history.push(redirect);
}
}
}
}
@ -58006,43 +58012,43 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
let enabledTab = ((this.state.title !== "") && (this.state.body !== ""));
return (
react.createElement('div', { className: "relative w-100" , style: {height: 'calc(100% - 124px)'}, __self: this, __source: {fileName: _jsxFileName$9, lineNumber: 153}}
, react.createElement('div', { className: "cf w-100 bg-white h-publish-header fixed" , __self: this, __source: {fileName: _jsxFileName$9, lineNumber: 154}}
, react.createElement(PC$4, { pathData: false, ...this.props, __self: this, __source: {fileName: _jsxFileName$9, lineNumber: 155}})
react.createElement('div', { className: "relative w-100" , style: {height: 'calc(100% - 124px)'}, __self: this, __source: {fileName: _jsxFileName$9, lineNumber: 161}}
, react.createElement('div', { className: "cf w-100 bg-white h-publish-header fixed" , __self: this, __source: {fileName: _jsxFileName$9, lineNumber: 162}}
, react.createElement(PC$4, { pathData: false, ...this.props, __self: this, __source: {fileName: _jsxFileName$9, lineNumber: 163}})
)
, react.createElement('div', { className: "w-100 relative" ,
style: {
top: 'calc(50% + 48px)'
}, __self: this, __source: {fileName: _jsxFileName$9, lineNumber: 157}}
}, __self: this, __source: {fileName: _jsxFileName$9, lineNumber: 165}}
, react.createElement('div', { className: "flex w-100 z-2" , style: {position: "sticky", top:0}, __self: this, __source: {fileName: _jsxFileName$9, lineNumber: 162}}
, react.createElement('div', { className: "w1 z-0" , style: {flexGrow:1}, __self: this, __source: {fileName: _jsxFileName$9, lineNumber: 163}}
)
, react.createElement('div', { className: "mw-688 w-100 z-0" , __self: this, __source: {fileName: _jsxFileName$9, lineNumber: 165}}
)
, react.createElement(SideTab, { enabled: enabledTab, postSubmit: this.postSubmit, __self: this, __source: {fileName: _jsxFileName$9, lineNumber: 167}} )
)
, react.createElement('div', { className: "flex absolute w-100 z-0" , style: {top:0}, __self: this, __source: {fileName: _jsxFileName$9, lineNumber: 170}}
, react.createElement('div', { className: "flex w-100 z-2" , style: {position: "sticky", top:0}, __self: this, __source: {fileName: _jsxFileName$9, lineNumber: 170}}
, react.createElement('div', { className: "w1 z-0" , style: {flexGrow:1}, __self: this, __source: {fileName: _jsxFileName$9, lineNumber: 171}}
)
, react.createElement('div', { className: "flex-col w-100 mw-688 w-100 z-1" , __self: this, __source: {fileName: _jsxFileName$9, lineNumber: 173}}
, react.createElement('div', { className: "mw-688 w-100 z-0" , __self: this, __source: {fileName: _jsxFileName$9, lineNumber: 173}}
)
, react.createElement(SideTab, { enabled: enabledTab, postSubmit: this.postSubmit, __self: this, __source: {fileName: _jsxFileName$9, lineNumber: 175}} )
)
, react.createElement('div', { className: "flex absolute w-100 z-0" , style: {top:0}, __self: this, __source: {fileName: _jsxFileName$9, lineNumber: 178}}
, react.createElement('div', { className: "w1 z-0" , style: {flexGrow:1}, __self: this, __source: {fileName: _jsxFileName$9, lineNumber: 179}}
)
, react.createElement('div', { className: "flex-col w-100 mw-688 w-100 z-1" , __self: this, __source: {fileName: _jsxFileName$9, lineNumber: 181}}
, react.createElement('input', { autoFocus: true,
className: "header-2 w-100 b--none" ,
type: "text",
name: "postName",
placeholder: "Add a Title" ,
onChange: this.titleChange, __self: this, __source: {fileName: _jsxFileName$9, lineNumber: 174}}
onChange: this.titleChange, __self: this, __source: {fileName: _jsxFileName$9, lineNumber: 182}}
)
, react.createElement('textarea', { className: "body-regular-400 w-100 b--none" ,
style: {resize:"none"},
type: "text",
name: "postBody",
placeholder: "And type away." ,
onChange: this.bodyChange, __self: this, __source: {fileName: _jsxFileName$9, lineNumber: 181}}
onChange: this.bodyChange, __self: this, __source: {fileName: _jsxFileName$9, lineNumber: 189}}
)
)
, react.createElement('div', { className: "w1 z-0" , style: {flexGrow:1}, __self: this, __source: {fileName: _jsxFileName$9, lineNumber: 189}}
, react.createElement('div', { className: "w1 z-0" , style: {flexGrow:1}, __self: this, __source: {fileName: _jsxFileName$9, lineNumber: 197}}
)
)
)
@ -58101,7 +58107,6 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
const _jsxFileName$d = "/Users/logan/Dev/interface/apps/publish/src/js/components/blog.js";
const PC$5 = withRouter(PathControl);
class Blog extends react_1 {
constructor(props){
super(props);
@ -58112,6 +58117,7 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
blogTitle: '',
blogHost: '',
pathData: [],
temporary: false,
};
}
@ -58122,6 +58128,7 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
let blog = diff.data.total.data;
this.setState({
postProps: this.buildPosts(blog),
blog: blog,
blogTitle: blog.info.title,
blogHost: blog.info.owner,
awaiting: false,
@ -58139,52 +58146,26 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
}
componentWillMount() {
if (this.props.ship != window.ship) {
let ship = this.props.ship;
let blogId = this.props.blogId;
let blog = lodash.get(this.props,
`subs[${ship}][${blogId}]`, false);
let ship = this.props.ship;
let blogId = this.props.blogId;
let blog = (ship == window.ship)
? lodash.get(this.props, `pubs[${blogId}]`, false)
: lodash.get(this.props, `subs[${ship}][${blogId}]`, false);
if (blog) {
this.setState({
postProps: this.buildPosts(blog),
blogTitle: blog.info.title,
blogHost: blog.info.owner,
awaiting: false,
pathData: [
{ text: "Home", url: "/~publish/recent" },
{ text: blog.info.title,
url: `/~publish/${blog.info.owner}/${blog.info.filename}` }
],
});
} else {
this.setState({
awaiting: {
ship: ship,
blogId: blogId,
}
});
let temporary = (!(blog) && (ship != window.ship));
this.props.api.bind(`/collection/${blogId}`, "PUT", ship, "write",
this.handleEvent.bind(this),
this.handleError.bind(this));
}
} else {
let ship = this.props.ship;
let blogId = this.props.blogId;
let blog = lodash.get(this.props,
`pubs[${blogId}]`, false);
if (temporary) {
this.setState({
postProps: this.buildPosts(blog),
blogTitle: blog.info.title,
blogHost: blog.info.owner,
awaiting: false,
pathData: [
{ text: "Home", url: "/~publish/recent" },
{ text: blog.info.title,
url: `/~publish/${blog.info.owner}/${blog.info.filename}` }
],
awaiting: {
ship: ship,
blogId: blogId,
},
temporary: true,
});
this.props.api.bind(`/collection/${blogId}`, "PUT", ship, "write",
this.handleEvent.bind(this),
this.handleError.bind(this));
}
}
@ -58216,15 +58197,42 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
date: post.post.info["date-created"],
pinned: pinned,
}
}
buildData(){
let blog = (this.props.ship == window.ship)
? lodash.get(this.props, `pubs[${this.props.blogId}]`, false)
: lodash.get(this.props, `subs[${this.props.ship}][${this.props.blogId}]`, false);
if (this.state.temporary) {
return {
postProps: this.state.postProps,
blogTitle: this.state.blogTitle,
blogHost: this.state.blogHost,
pathData: this.state.pathData,
};
} else {
return {
postProps: this.buildPosts(blog),
blogTitle: blog.info.title,
blogHost: blog.info.owner,
pathData: [
{ text: "Home", url: "/~publish/recent" },
{ text: blog.info.title,
url: `/~publish/${blog.info.owner}/${blog.info.filename}` }
],
};
}
}
render() {
let posts = this.state.postProps.map((post, key) => {
let data = this.buildData();
let posts = data.postProps.map((post, key) => {
return (
react.createElement(PostPreview, {
post: post,
key: key, __self: this, __source: {fileName: _jsxFileName$d, lineNumber: 131}}
key: key, __self: this, __source: {fileName: _jsxFileName$d, lineNumber: 133}}
)
);
});
@ -58234,33 +58242,33 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
if (this.state.awaiting) {
return (
react.createElement('div', { className: "w-100 ba h-inner" , __self: this, __source: {fileName: _jsxFileName$d, lineNumber: 143}}, "Loading"
react.createElement('div', { className: "w-100 ba h-inner" , __self: this, __source: {fileName: _jsxFileName$d, lineNumber: 145}}, "Loading"
)
);
} else {
return (
react.createElement('div', {__self: this, __source: {fileName: _jsxFileName$d, lineNumber: 149}}
, react.createElement('div', { className: "cf w-100 bg-white h-publish-header" , __self: this, __source: {fileName: _jsxFileName$d, lineNumber: 150}}
, react.createElement(PathControl, { pathData: this.state.pathData, __self: this, __source: {fileName: _jsxFileName$d, lineNumber: 151}})
react.createElement('div', {__self: this, __source: {fileName: _jsxFileName$d, lineNumber: 151}}
, react.createElement('div', { className: "cf w-100 bg-white h-publish-header" , __self: this, __source: {fileName: _jsxFileName$d, lineNumber: 152}}
, react.createElement(PathControl, { pathData: data.pathData, __self: this, __source: {fileName: _jsxFileName$d, lineNumber: 153}})
)
, react.createElement('div', { className: "flex-col", __self: this, __source: {fileName: _jsxFileName$d, lineNumber: 153}}
, react.createElement('h2', {__self: this, __source: {fileName: _jsxFileName$d, lineNumber: 154}}, this.state.blogTitle)
, react.createElement('div', { className: "flex", __self: this, __source: {fileName: _jsxFileName$d, lineNumber: 155}}
, react.createElement('div', { style: {flexBasis: 350}, __self: this, __source: {fileName: _jsxFileName$d, lineNumber: 156}}
, react.createElement('p', {__self: this, __source: {fileName: _jsxFileName$d, lineNumber: 157}}, "Host")
, react.createElement('p', {__self: this, __source: {fileName: _jsxFileName$d, lineNumber: 158}}, this.state.blogHost)
, react.createElement('div', { className: "flex-col", __self: this, __source: {fileName: _jsxFileName$d, lineNumber: 155}}
, react.createElement('h2', {__self: this, __source: {fileName: _jsxFileName$d, lineNumber: 156}}, data.blogTitle)
, react.createElement('div', { className: "flex", __self: this, __source: {fileName: _jsxFileName$d, lineNumber: 157}}
, react.createElement('div', { style: {flexBasis: 350}, __self: this, __source: {fileName: _jsxFileName$d, lineNumber: 158}}
, react.createElement('p', {__self: this, __source: {fileName: _jsxFileName$d, lineNumber: 159}}, "Host")
, react.createElement('p', {__self: this, __source: {fileName: _jsxFileName$d, lineNumber: 160}}, data.blogHost)
)
, react.createElement('div', { style: {flexBasis: 350}, __self: this, __source: {fileName: _jsxFileName$d, lineNumber: 160}}
, react.createElement('p', {__self: this, __source: {fileName: _jsxFileName$d, lineNumber: 161}}, "Contributors")
, react.createElement('p', {__self: this, __source: {fileName: _jsxFileName$d, lineNumber: 162}}, contributers)
, react.createElement('div', { style: {flexBasis: 350}, __self: this, __source: {fileName: _jsxFileName$d, lineNumber: 162}}
, react.createElement('p', {__self: this, __source: {fileName: _jsxFileName$d, lineNumber: 163}}, "Contributors")
, react.createElement('p', {__self: this, __source: {fileName: _jsxFileName$d, lineNumber: 164}}, contributers)
)
, react.createElement('div', { style: {flexBasis: 350}, __self: this, __source: {fileName: _jsxFileName$d, lineNumber: 164}}
, react.createElement('p', {__self: this, __source: {fileName: _jsxFileName$d, lineNumber: 165}}, "Subscribers")
, react.createElement('p', {__self: this, __source: {fileName: _jsxFileName$d, lineNumber: 166}}, subscribers)
, react.createElement('div', { style: {flexBasis: 350}, __self: this, __source: {fileName: _jsxFileName$d, lineNumber: 166}}
, react.createElement('p', {__self: this, __source: {fileName: _jsxFileName$d, lineNumber: 167}}, "Subscribers")
, react.createElement('p', {__self: this, __source: {fileName: _jsxFileName$d, lineNumber: 168}}, subscribers)
)
)
, react.createElement('div', { className: "flex flex-wrap" , __self: this, __source: {fileName: _jsxFileName$d, lineNumber: 169}}
, react.createElement('div', { className: "flex flex-wrap" , __self: this, __source: {fileName: _jsxFileName$d, lineNumber: 171}}
, posts
)
)
@ -58510,6 +58518,24 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
}
const _jsxFileName$h = "/Users/logan/Dev/interface/apps/publish/src/js/components/lib/comment-box.js";
class PostButton extends react_1 {
render() {
if (this.props.enabled) {
return (
react.createElement('p', { className: "body-regular pointer" , onClick: this.props.post, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 9}}, "-> Post"
)
);
} else {
return (
react.createElement('p', { className: "body-regular gray-30" , __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 15}}, "-> Post"
)
);
}
}
}
class CommentBox extends react_1 {
constructor(props){
super(props);
@ -58524,50 +58550,32 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
}
render() {
if (this.props.enabled) {
return (
react.createElement('div', { className: "cb w-100 flex" ,
style: {paddingBottom: 8, marginTop: 32}, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 21}}
, react.createElement('div', { className: "fl", style: {marginRight: 10}, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 23}}
, react.createElement(Sigil, { ship: this.props.our, size: 36, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 24}})
let textClass = (this.props.enabled)
? "body-regular-400 w-100"
: "body-regular-400 w-100 gray-30";
return (
react.createElement('div', { className: "cb w-100 flex" ,
style: {paddingBottom: 8, marginTop: 32}, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 41}}
, react.createElement('div', { className: "fl", style: {marginRight: 10}, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 43}}
, react.createElement(Sigil, { ship: this.props.our, size: 36, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 44}})
)
, react.createElement('div', { className: "flex-col w-100" , __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 46}}
, react.createElement('textarea', { className: textClass,
ref: (el) => {this.textarea = el;},
style: {resize: "none"},
type: "text",
name: "commentBody",
defaultValue: "",
onChange: this.props.action,
disabled: (!this.props.enabled), __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 47}}
)
, react.createElement('div', { className: "flex-col w-100" , __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 26}}
, react.createElement('textarea', { className: "body-regular-400 w-100" ,
ref: (el) => {this.textarea = el;},
style: {resize: "none"},
type: "text",
name: "commentBody",
defaultValue: "",
onChange: this.props.action, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 27}}
)
, react.createElement('p', { className: "body-regular pointer" , onClick: this.props.post, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 35}}, "-> Post"
)
, react.createElement(PostButton, {
post: this.props.post,
enabled: (Boolean(this.props.content) && this.props.enabled), __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 56}}
)
)
);
} else {
return (
react.createElement('div', { className: "cb w-100 flex" ,
style: {paddingBottom: 8, marginTop: 32}, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 43}}
, react.createElement('div', { className: "fl", style: {marginRight: 10}, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 45}}
, react.createElement(Sigil, { ship: this.props.our, size: 36, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 46}})
)
, react.createElement('div', { className: "flex-col w-100" , __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 48}}
, react.createElement('textarea', { className: "body-regular-400 w-100" ,
ref: (el) => {this.textarea = el;},
style: {resize: "none"},
type: "text",
name: "commentBody",
disabled: true, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 49}}
)
, react.createElement('p', { className: "body-regular gray-50" , __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 56}}, "-> Post"
)
)
)
);
}
)
);
}
}
@ -58651,24 +58659,25 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
, react.createElement(CommentBox, { our: our,
action: this.commentChange,
enabled: !(Boolean(this.state.awaiting)),
content: this.state.commentBody,
post: this.postComment, __self: this, __source: {fileName: _jsxFileName$i, lineNumber: 83}})
, react.createElement('div', { className: "flex-col", style: {marginTop: 32}, __self: this, __source: {fileName: _jsxFileName$i, lineNumber: 89}}
, react.createElement('div', { className: "flex-col", style: {marginTop: 32}, __self: this, __source: {fileName: _jsxFileName$i, lineNumber: 90}}
, comments
)
)
);
} else {
return (
react.createElement('div', { className: "cb mt3 mb4" , __self: this, __source: {fileName: _jsxFileName$i, lineNumber: 96}}
, react.createElement('p', { className: "gray-50 body-large b" , __self: this, __source: {fileName: _jsxFileName$i, lineNumber: 97}}
react.createElement('div', { className: "cb mt3 mb4" , __self: this, __source: {fileName: _jsxFileName$i, lineNumber: 97}}
, react.createElement('p', { className: "gray-50 body-large b" , __self: this, __source: {fileName: _jsxFileName$i, lineNumber: 98}}
, this.props.comments.length
, react.createElement('span', { className: "black", __self: this, __source: {fileName: _jsxFileName$i, lineNumber: 99}}, "\u0002Comments"
, react.createElement('span', { className: "black", __self: this, __source: {fileName: _jsxFileName$i, lineNumber: 100}}, "\u0002Comments"
)
)
, react.createElement('p', { className: "cl body-regular pointer" , onClick: this.toggleDisplay, __self: this, __source: {fileName: _jsxFileName$i, lineNumber: 103}}, "+ Show Comments"
, react.createElement('p', { className: "cl body-regular pointer" , onClick: this.toggleDisplay, __self: this, __source: {fileName: _jsxFileName$i, lineNumber: 104}}, "+ Show Comments"
)
)

View File

@ -18,7 +18,7 @@
:: +card: output effect payload
::
+$ poke
$% [%noun [@tas path @t]]
$% [%launch-action [@tas path @t]]
==
::
+$ card
@ -44,11 +44,11 @@
++ prep
|= old=(unit tim=@da)
^- (quip move _this)
=/ launchnoun [%noun [%timer /tile '/~timer/js/tile.js']]
=/ launcha [%launch-action [%timer /tile '/~timer/js/tile.js']]
:-
:~
[ost.bol %connect / [~ /'~timer'] %timer]
[ost.bol %poke /timer [our.bol %launch] launchnoun]
[ost.bol %poke /timer [our.bol %launch] launcha]
==
?~ old
this

View File

@ -33,12 +33,15 @@ export default class WeatherTile extends Component {
}
locationSubmit() {
console.log('location submit');
navigator.geolocation.getCurrentPosition((res) => {
console.log(res);
let latlng = `${res.coords.latitude},${res.coords.longitude}`;
this.setState({
latlng
});
}, (err) => {
console.log(err);
}, { maximumAge: Infinity, timeout: 10000 });
api.action('weather', 'json', latlng);
});
}

View File

@ -26,7 +26,7 @@
[%wait wire @da]
==
+$ poke
$% [%noun [@tas path @t]]
$% [%launch-action [@tas path @t]]
==
+$ state
$% [%0 data=json time=@da location=@t timer=(unit @da)]
@ -45,10 +45,12 @@
++ prep
|= old=(unit state)
^- (quip move _this)
=/ launcha
[%launch-action [%weather /weathertile '/~weather/js/tile.js']]
:-
:~
[ost.bol %connect / [~ /'~weather'] %weather]
[ost.bol %poke /weather [our.bol %launch] [%noun [%weather /weathertile '/~weather/js/tile.js']]]
[ost.bol %poke /weather [our.bol %launch] launcha]
==
?~ old
this
@ -70,15 +72,14 @@
=/ str/@t +.jon
=/ req/request:http (request-darksky str)
=/ out *outbound-config:http-client
=/ lismov [ost.bol %request /[(scot %da now.bol)] req out]~
?~ timer
:- %+ weld
`(list move)`[ost.bol %wait /timer (add now.bol ~d1)]~
`(list move)`[ost.bol %request /[(scot %da now.bol)] req out]~
:- [[ost.bol %wait /timer (add now.bol ~h3)] lismov]
%= this
location str
timer `(add now.bol ~d1)
timer `(add now.bol ~h3)
==
:- [ost.bol %request /[(scot %da now.bol)] req out]~
:- lismov
%= this
location str
==
@ -110,17 +111,17 @@
?~ data
:: data is null
[~ this]
=/ jon/(unit json) (de-json:html q.data.u.data)
?~ jon
=/ ujon/(unit json) (de-json:html q.data.u.data)
?~ ujon
[~ this]
?> ?=(%o -.u.jon)
=/ ayyy/json %- pairs:enjs:format :~
currently+(~(got by p.u.jon) 'currently')
daily+(~(got by p.u.jon) 'daily')
?> ?=(%o -.u.ujon)
=/ jon/json %- pairs:enjs:format :~
currently+(~(got by p.u.ujon) 'currently')
daily+(~(got by p.u.ujon) 'daily')
==
:- (send-tile-diff ayyy)
:- (send-tile-diff jon)
%= this
data ayyy
data jon
time now.bol
==
::
@ -128,10 +129,10 @@
%- (require-authorization:app ost.bol move this)
|= =inbound-request:http-server
^- (quip move _this)
=+ request-line=(parse-request-line url.request.inbound-request)
=+ back-path=(flop site.request-line)
=/ request-line (parse-request-line url.request.inbound-request)
=/ back-path (flop site.request-line)
=/ name=@t
=+ back-path=(flop site.request-line)
=/ back-path (flop site.request-line)
?~ back-path
''
i.back-path
@ -152,9 +153,9 @@
^- (quip move _this)
=/ req/request:http (request-darksky location)
=/ lismov/(list move)
`(list move)`[ost.bol %request /[(scot %da now.bol)] req *outbound-config:http-client]~
[ost.bol %request /[(scot %da now.bol)] req *outbound-config:http-client]~
?~ timer
:- (weld lismov `(list move)`[ost.bol %wait /timer (add now.bol ~h3)]~)
:- [[ost.bol %wait /timer (add now.bol ~h3)] lismov]
this(timer `(add now.bol ~h3))
[lismov this]
::

View File

@ -443,7 +443,7 @@
if (process.env.NODE_ENV !== "production") {
{
(function() {
var _assign = objectAssign;
@ -6840,12 +6840,15 @@
}
locationSubmit() {
console.log('location submit');
navigator.geolocation.getCurrentPosition((res) => {
console.log(res);
let latlng = `${res.coords.latitude},${res.coords.longitude}`;
this.setState({
latlng
});
}, (err) => {
console.log(err);
}, { maximumAge: Infinity, timeout: 10000 });
api.action('weather', 'json', latlng);
});
}
@ -6856,7 +6859,7 @@
width: 234,
height: 234,
background: '#1a1a1a'
}, __self: this, __source: {fileName: _jsxFileName, lineNumber: 48}}
}, __self: this, __source: {fileName: _jsxFileName, lineNumber: 51}}
, child
)
);
@ -6864,9 +6867,9 @@
renderNoData() {
return this.renderWrapper((
react.createElement('div', {__self: this, __source: {fileName: _jsxFileName, lineNumber: 60}}
, react.createElement('p', { className: "white sans-serif" , __self: this, __source: {fileName: _jsxFileName, lineNumber: 61}}, "Weather")
, react.createElement('button', { onClick: this.locationSubmit.bind(this), __self: this, __source: {fileName: _jsxFileName, lineNumber: 62}}, "Set location" )
react.createElement('div', {__self: this, __source: {fileName: _jsxFileName, lineNumber: 63}}
, react.createElement('p', { className: "white sans-serif" , __self: this, __source: {fileName: _jsxFileName, lineNumber: 64}}, "Weather")
, react.createElement('button', { onClick: this.locationSubmit.bind(this), __self: this, __source: {fileName: _jsxFileName, lineNumber: 65}}, "Set location" )
)
));
}
@ -6878,49 +6881,49 @@
let da = moment.unix(d.sunsetTime).format('h:mm a') || '';
return this.renderWrapper((
react.createElement('div', {__self: this, __source: {fileName: _jsxFileName, lineNumber: 74}}
react.createElement('div', {__self: this, __source: {fileName: _jsxFileName, lineNumber: 77}}
, react.createElement('p', { className: "gray", style: {
fontWeight: 'bold',
fontSize: 14,
lineHeight: '24px'
}, __self: this, __source: {fileName: _jsxFileName, lineNumber: 75}}, "Weather")
, react.createElement('div', { className: "w-100 mb2 mt2" , __self: this, __source: {fileName: _jsxFileName, lineNumber: 80}}
}, __self: this, __source: {fileName: _jsxFileName, lineNumber: 78}}, "Weather")
, react.createElement('div', { className: "w-100 mb2 mt2" , __self: this, __source: {fileName: _jsxFileName, lineNumber: 83}}
, react.createElement('img', {
src: '/~weather/img/' + c.icon + '.png',
width: 64,
height: 64,
className: "dib", __self: this, __source: {fileName: _jsxFileName, lineNumber: 81}} )
className: "dib", __self: this, __source: {fileName: _jsxFileName, lineNumber: 84}} )
, react.createElement('h2', {
className: "dib ml2 white" ,
style: {
fontSize: 72,
lineHeight: '64px',
fontWeight: 400
}, __self: this, __source: {fileName: _jsxFileName, lineNumber: 86}}
}, __self: this, __source: {fileName: _jsxFileName, lineNumber: 89}}
, Math.round(c.temperature), "°")
)
, react.createElement('div', { className: "w-100 cf" , __self: this, __source: {fileName: _jsxFileName, lineNumber: 95}}
, react.createElement('div', { className: "fl w-50" , __self: this, __source: {fileName: _jsxFileName, lineNumber: 96}}
, react.createElement('div', { className: "w-100 cf" , __self: this, __source: {fileName: _jsxFileName, lineNumber: 98}}
, react.createElement('div', { className: "fl w-50" , __self: this, __source: {fileName: _jsxFileName, lineNumber: 99}}
, react.createElement(IconWithData, {
icon: "winddirection",
text: c.windBearing + '°', __self: this, __source: {fileName: _jsxFileName, lineNumber: 97}} )
text: c.windBearing + '°', __self: this, __source: {fileName: _jsxFileName, lineNumber: 100}} )
, react.createElement(IconWithData, {
icon: "chancerain",
text: c.precipProbability + '%', __self: this, __source: {fileName: _jsxFileName, lineNumber: 100}} )
text: c.precipProbability + '%', __self: this, __source: {fileName: _jsxFileName, lineNumber: 103}} )
, react.createElement(IconWithData, {
icon: "windspeed",
text: Math.round(c.windSpeed) + ' mph', __self: this, __source: {fileName: _jsxFileName, lineNumber: 103}} )
text: Math.round(c.windSpeed) + ' mph', __self: this, __source: {fileName: _jsxFileName, lineNumber: 106}} )
)
, react.createElement('div', { className: "fr w-50" , __self: this, __source: {fileName: _jsxFileName, lineNumber: 107}}
, react.createElement('div', { className: "fr w-50" , __self: this, __source: {fileName: _jsxFileName, lineNumber: 110}}
, react.createElement(IconWithData, {
icon: "sunset",
text: da, __self: this, __source: {fileName: _jsxFileName, lineNumber: 108}} )
text: da, __self: this, __source: {fileName: _jsxFileName, lineNumber: 111}} )
, react.createElement(IconWithData, {
icon: "low",
text: Math.round(d.temperatureLow) + '°', __self: this, __source: {fileName: _jsxFileName, lineNumber: 111}} )
text: Math.round(d.temperatureLow) + '°', __self: this, __source: {fileName: _jsxFileName, lineNumber: 114}} )
, react.createElement(IconWithData, {
icon: "high",
text: Math.round(d.temperatureHigh) + '°', __self: this, __source: {fileName: _jsxFileName, lineNumber: 114}} )
text: Math.round(d.temperatureHigh) + '°', __self: this, __source: {fileName: _jsxFileName, lineNumber: 117}} )
)
)
)